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 (_this.propsSize && _this.propsSize[key] && _this.propsSize[key].toString().endsWith('%')) {
[65500] Fix | Delete
if (_this.state[key].toString().endsWith('%')) {
[65501] Fix | Delete
return _this.state[key].toString();
[65502] Fix | Delete
}
[65503] Fix | Delete
var parentSize = _this.getParentSize();
[65504] Fix | Delete
var value = Number(_this.state[key].toString().replace('px', ''));
[65505] Fix | Delete
var percent = (value / parentSize[key]) * 100;
[65506] Fix | Delete
return percent + "%";
[65507] Fix | Delete
}
[65508] Fix | Delete
return getStringSize(_this.state[key]);
[65509] Fix | Delete
};
[65510] Fix | Delete
var width = size && typeof size.width !== 'undefined' && !this.state.isResizing
[65511] Fix | Delete
? getStringSize(size.width)
[65512] Fix | Delete
: getSize('width');
[65513] Fix | Delete
var height = size && typeof size.height !== 'undefined' && !this.state.isResizing
[65514] Fix | Delete
? getStringSize(size.height)
[65515] Fix | Delete
: getSize('height');
[65516] Fix | Delete
return { width: width, height: height };
[65517] Fix | Delete
},
[65518] Fix | Delete
enumerable: false,
[65519] Fix | Delete
configurable: true
[65520] Fix | Delete
});
[65521] Fix | Delete
Resizable.prototype.getParentSize = function () {
[65522] Fix | Delete
if (!this.parentNode) {
[65523] Fix | Delete
if (!this.window) {
[65524] Fix | Delete
return { width: 0, height: 0 };
[65525] Fix | Delete
}
[65526] Fix | Delete
return { width: this.window.innerWidth, height: this.window.innerHeight };
[65527] Fix | Delete
}
[65528] Fix | Delete
var base = this.appendBase();
[65529] Fix | Delete
if (!base) {
[65530] Fix | Delete
return { width: 0, height: 0 };
[65531] Fix | Delete
}
[65532] Fix | Delete
// INFO: To calculate parent width with flex layout
[65533] Fix | Delete
var wrapChanged = false;
[65534] Fix | Delete
var wrap = this.parentNode.style.flexWrap;
[65535] Fix | Delete
if (wrap !== 'wrap') {
[65536] Fix | Delete
wrapChanged = true;
[65537] Fix | Delete
this.parentNode.style.flexWrap = 'wrap';
[65538] Fix | Delete
// HACK: Use relative to get parent padding size
[65539] Fix | Delete
}
[65540] Fix | Delete
base.style.position = 'relative';
[65541] Fix | Delete
base.style.minWidth = '100%';
[65542] Fix | Delete
base.style.minHeight = '100%';
[65543] Fix | Delete
var size = {
[65544] Fix | Delete
width: base.offsetWidth,
[65545] Fix | Delete
height: base.offsetHeight,
[65546] Fix | Delete
};
[65547] Fix | Delete
if (wrapChanged) {
[65548] Fix | Delete
this.parentNode.style.flexWrap = wrap;
[65549] Fix | Delete
}
[65550] Fix | Delete
this.removeBase(base);
[65551] Fix | Delete
return size;
[65552] Fix | Delete
};
[65553] Fix | Delete
Resizable.prototype.bindEvents = function () {
[65554] Fix | Delete
if (this.window) {
[65555] Fix | Delete
this.window.addEventListener('mouseup', this.onMouseUp);
[65556] Fix | Delete
this.window.addEventListener('mousemove', this.onMouseMove);
[65557] Fix | Delete
this.window.addEventListener('mouseleave', this.onMouseUp);
[65558] Fix | Delete
this.window.addEventListener('touchmove', this.onMouseMove, {
[65559] Fix | Delete
capture: true,
[65560] Fix | Delete
passive: false,
[65561] Fix | Delete
});
[65562] Fix | Delete
this.window.addEventListener('touchend', this.onMouseUp);
[65563] Fix | Delete
}
[65564] Fix | Delete
};
[65565] Fix | Delete
Resizable.prototype.unbindEvents = function () {
[65566] Fix | Delete
if (this.window) {
[65567] Fix | Delete
this.window.removeEventListener('mouseup', this.onMouseUp);
[65568] Fix | Delete
this.window.removeEventListener('mousemove', this.onMouseMove);
[65569] Fix | Delete
this.window.removeEventListener('mouseleave', this.onMouseUp);
[65570] Fix | Delete
this.window.removeEventListener('touchmove', this.onMouseMove, true);
[65571] Fix | Delete
this.window.removeEventListener('touchend', this.onMouseUp);
[65572] Fix | Delete
}
[65573] Fix | Delete
};
[65574] Fix | Delete
Resizable.prototype.componentDidMount = function () {
[65575] Fix | Delete
if (!this.resizable || !this.window) {
[65576] Fix | Delete
return;
[65577] Fix | Delete
}
[65578] Fix | Delete
var computedStyle = this.window.getComputedStyle(this.resizable);
[65579] Fix | Delete
this.setState({
[65580] Fix | Delete
width: this.state.width || this.size.width,
[65581] Fix | Delete
height: this.state.height || this.size.height,
[65582] Fix | Delete
flexBasis: computedStyle.flexBasis !== 'auto' ? computedStyle.flexBasis : undefined,
[65583] Fix | Delete
});
[65584] Fix | Delete
};
[65585] Fix | Delete
Resizable.prototype.componentWillUnmount = function () {
[65586] Fix | Delete
if (this.window) {
[65587] Fix | Delete
this.unbindEvents();
[65588] Fix | Delete
}
[65589] Fix | Delete
};
[65590] Fix | Delete
Resizable.prototype.createSizeForCssProperty = function (newSize, kind) {
[65591] Fix | Delete
var propsSize = this.propsSize && this.propsSize[kind];
[65592] Fix | Delete
return this.state[kind] === 'auto' &&
[65593] Fix | Delete
this.state.original[kind] === newSize &&
[65594] Fix | Delete
(typeof propsSize === 'undefined' || propsSize === 'auto')
[65595] Fix | Delete
? 'auto'
[65596] Fix | Delete
: newSize;
[65597] Fix | Delete
};
[65598] Fix | Delete
Resizable.prototype.calculateNewMaxFromBoundary = function (maxWidth, maxHeight) {
[65599] Fix | Delete
var boundsByDirection = this.props.boundsByDirection;
[65600] Fix | Delete
var direction = this.state.direction;
[65601] Fix | Delete
var widthByDirection = boundsByDirection && hasDirection('left', direction);
[65602] Fix | Delete
var heightByDirection = boundsByDirection && hasDirection('top', direction);
[65603] Fix | Delete
var boundWidth;
[65604] Fix | Delete
var boundHeight;
[65605] Fix | Delete
if (this.props.bounds === 'parent') {
[65606] Fix | Delete
var parent_1 = this.parentNode;
[65607] Fix | Delete
if (parent_1) {
[65608] Fix | Delete
boundWidth = widthByDirection
[65609] Fix | Delete
? this.resizableRight - this.parentLeft
[65610] Fix | Delete
: parent_1.offsetWidth + (this.parentLeft - this.resizableLeft);
[65611] Fix | Delete
boundHeight = heightByDirection
[65612] Fix | Delete
? this.resizableBottom - this.parentTop
[65613] Fix | Delete
: parent_1.offsetHeight + (this.parentTop - this.resizableTop);
[65614] Fix | Delete
}
[65615] Fix | Delete
}
[65616] Fix | Delete
else if (this.props.bounds === 'window') {
[65617] Fix | Delete
if (this.window) {
[65618] Fix | Delete
boundWidth = widthByDirection ? this.resizableRight : this.window.innerWidth - this.resizableLeft;
[65619] Fix | Delete
boundHeight = heightByDirection ? this.resizableBottom : this.window.innerHeight - this.resizableTop;
[65620] Fix | Delete
}
[65621] Fix | Delete
}
[65622] Fix | Delete
else if (this.props.bounds) {
[65623] Fix | Delete
boundWidth = widthByDirection
[65624] Fix | Delete
? this.resizableRight - this.targetLeft
[65625] Fix | Delete
: this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft);
[65626] Fix | Delete
boundHeight = heightByDirection
[65627] Fix | Delete
? this.resizableBottom - this.targetTop
[65628] Fix | Delete
: this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop);
[65629] Fix | Delete
}
[65630] Fix | Delete
if (boundWidth && Number.isFinite(boundWidth)) {
[65631] Fix | Delete
maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth;
[65632] Fix | Delete
}
[65633] Fix | Delete
if (boundHeight && Number.isFinite(boundHeight)) {
[65634] Fix | Delete
maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight;
[65635] Fix | Delete
}
[65636] Fix | Delete
return { maxWidth: maxWidth, maxHeight: maxHeight };
[65637] Fix | Delete
};
[65638] Fix | Delete
Resizable.prototype.calculateNewSizeFromDirection = function (clientX, clientY) {
[65639] Fix | Delete
var scale = this.props.scale || 1;
[65640] Fix | Delete
var resizeRatio = this.props.resizeRatio || 1;
[65641] Fix | Delete
var _a = this.state, direction = _a.direction, original = _a.original;
[65642] Fix | Delete
var _b = this.props, lockAspectRatio = _b.lockAspectRatio, lockAspectRatioExtraHeight = _b.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _b.lockAspectRatioExtraWidth;
[65643] Fix | Delete
var newWidth = original.width;
[65644] Fix | Delete
var newHeight = original.height;
[65645] Fix | Delete
var extraHeight = lockAspectRatioExtraHeight || 0;
[65646] Fix | Delete
var extraWidth = lockAspectRatioExtraWidth || 0;
[65647] Fix | Delete
if (hasDirection('right', direction)) {
[65648] Fix | Delete
newWidth = original.width + ((clientX - original.x) * resizeRatio) / scale;
[65649] Fix | Delete
if (lockAspectRatio) {
[65650] Fix | Delete
newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;
[65651] Fix | Delete
}
[65652] Fix | Delete
}
[65653] Fix | Delete
if (hasDirection('left', direction)) {
[65654] Fix | Delete
newWidth = original.width - ((clientX - original.x) * resizeRatio) / scale;
[65655] Fix | Delete
if (lockAspectRatio) {
[65656] Fix | Delete
newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;
[65657] Fix | Delete
}
[65658] Fix | Delete
}
[65659] Fix | Delete
if (hasDirection('bottom', direction)) {
[65660] Fix | Delete
newHeight = original.height + ((clientY - original.y) * resizeRatio) / scale;
[65661] Fix | Delete
if (lockAspectRatio) {
[65662] Fix | Delete
newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;
[65663] Fix | Delete
}
[65664] Fix | Delete
}
[65665] Fix | Delete
if (hasDirection('top', direction)) {
[65666] Fix | Delete
newHeight = original.height - ((clientY - original.y) * resizeRatio) / scale;
[65667] Fix | Delete
if (lockAspectRatio) {
[65668] Fix | Delete
newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;
[65669] Fix | Delete
}
[65670] Fix | Delete
}
[65671] Fix | Delete
return { newWidth: newWidth, newHeight: newHeight };
[65672] Fix | Delete
};
[65673] Fix | Delete
Resizable.prototype.calculateNewSizeFromAspectRatio = function (newWidth, newHeight, max, min) {
[65674] Fix | Delete
var _a = this.props, lockAspectRatio = _a.lockAspectRatio, lockAspectRatioExtraHeight = _a.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _a.lockAspectRatioExtraWidth;
[65675] Fix | Delete
var computedMinWidth = typeof min.width === 'undefined' ? 10 : min.width;
[65676] Fix | Delete
var computedMaxWidth = typeof max.width === 'undefined' || max.width < 0 ? newWidth : max.width;
[65677] Fix | Delete
var computedMinHeight = typeof min.height === 'undefined' ? 10 : min.height;
[65678] Fix | Delete
var computedMaxHeight = typeof max.height === 'undefined' || max.height < 0 ? newHeight : max.height;
[65679] Fix | Delete
var extraHeight = lockAspectRatioExtraHeight || 0;
[65680] Fix | Delete
var extraWidth = lockAspectRatioExtraWidth || 0;
[65681] Fix | Delete
if (lockAspectRatio) {
[65682] Fix | Delete
var extraMinWidth = (computedMinHeight - extraHeight) * this.ratio + extraWidth;
[65683] Fix | Delete
var extraMaxWidth = (computedMaxHeight - extraHeight) * this.ratio + extraWidth;
[65684] Fix | Delete
var extraMinHeight = (computedMinWidth - extraWidth) / this.ratio + extraHeight;
[65685] Fix | Delete
var extraMaxHeight = (computedMaxWidth - extraWidth) / this.ratio + extraHeight;
[65686] Fix | Delete
var lockedMinWidth = Math.max(computedMinWidth, extraMinWidth);
[65687] Fix | Delete
var lockedMaxWidth = Math.min(computedMaxWidth, extraMaxWidth);
[65688] Fix | Delete
var lockedMinHeight = Math.max(computedMinHeight, extraMinHeight);
[65689] Fix | Delete
var lockedMaxHeight = Math.min(computedMaxHeight, extraMaxHeight);
[65690] Fix | Delete
newWidth = lib_clamp(newWidth, lockedMinWidth, lockedMaxWidth);
[65691] Fix | Delete
newHeight = lib_clamp(newHeight, lockedMinHeight, lockedMaxHeight);
[65692] Fix | Delete
}
[65693] Fix | Delete
else {
[65694] Fix | Delete
newWidth = lib_clamp(newWidth, computedMinWidth, computedMaxWidth);
[65695] Fix | Delete
newHeight = lib_clamp(newHeight, computedMinHeight, computedMaxHeight);
[65696] Fix | Delete
}
[65697] Fix | Delete
return { newWidth: newWidth, newHeight: newHeight };
[65698] Fix | Delete
};
[65699] Fix | Delete
Resizable.prototype.setBoundingClientRect = function () {
[65700] Fix | Delete
// For parent boundary
[65701] Fix | Delete
if (this.props.bounds === 'parent') {
[65702] Fix | Delete
var parent_2 = this.parentNode;
[65703] Fix | Delete
if (parent_2) {
[65704] Fix | Delete
var parentRect = parent_2.getBoundingClientRect();
[65705] Fix | Delete
this.parentLeft = parentRect.left;
[65706] Fix | Delete
this.parentTop = parentRect.top;
[65707] Fix | Delete
}
[65708] Fix | Delete
}
[65709] Fix | Delete
// For target(html element) boundary
[65710] Fix | Delete
if (this.props.bounds && typeof this.props.bounds !== 'string') {
[65711] Fix | Delete
var targetRect = this.props.bounds.getBoundingClientRect();
[65712] Fix | Delete
this.targetLeft = targetRect.left;
[65713] Fix | Delete
this.targetTop = targetRect.top;
[65714] Fix | Delete
}
[65715] Fix | Delete
// For boundary
[65716] Fix | Delete
if (this.resizable) {
[65717] Fix | Delete
var _a = this.resizable.getBoundingClientRect(), left = _a.left, top_1 = _a.top, right = _a.right, bottom = _a.bottom;
[65718] Fix | Delete
this.resizableLeft = left;
[65719] Fix | Delete
this.resizableRight = right;
[65720] Fix | Delete
this.resizableTop = top_1;
[65721] Fix | Delete
this.resizableBottom = bottom;
[65722] Fix | Delete
}
[65723] Fix | Delete
};
[65724] Fix | Delete
Resizable.prototype.onResizeStart = function (event, direction) {
[65725] Fix | Delete
if (!this.resizable || !this.window) {
[65726] Fix | Delete
return;
[65727] Fix | Delete
}
[65728] Fix | Delete
var clientX = 0;
[65729] Fix | Delete
var clientY = 0;
[65730] Fix | Delete
if (event.nativeEvent && isMouseEvent(event.nativeEvent)) {
[65731] Fix | Delete
clientX = event.nativeEvent.clientX;
[65732] Fix | Delete
clientY = event.nativeEvent.clientY;
[65733] Fix | Delete
}
[65734] Fix | Delete
else if (event.nativeEvent && isTouchEvent(event.nativeEvent)) {
[65735] Fix | Delete
clientX = event.nativeEvent.touches[0].clientX;
[65736] Fix | Delete
clientY = event.nativeEvent.touches[0].clientY;
[65737] Fix | Delete
}
[65738] Fix | Delete
if (this.props.onResizeStart) {
[65739] Fix | Delete
if (this.resizable) {
[65740] Fix | Delete
var startResize = this.props.onResizeStart(event, direction, this.resizable);
[65741] Fix | Delete
if (startResize === false) {
[65742] Fix | Delete
return;
[65743] Fix | Delete
}
[65744] Fix | Delete
}
[65745] Fix | Delete
}
[65746] Fix | Delete
// Fix #168
[65747] Fix | Delete
if (this.props.size) {
[65748] Fix | Delete
if (typeof this.props.size.height !== 'undefined' && this.props.size.height !== this.state.height) {
[65749] Fix | Delete
this.setState({ height: this.props.size.height });
[65750] Fix | Delete
}
[65751] Fix | Delete
if (typeof this.props.size.width !== 'undefined' && this.props.size.width !== this.state.width) {
[65752] Fix | Delete
this.setState({ width: this.props.size.width });
[65753] Fix | Delete
}
[65754] Fix | Delete
}
[65755] Fix | Delete
// For lockAspectRatio case
[65756] Fix | Delete
this.ratio =
[65757] Fix | Delete
typeof this.props.lockAspectRatio === 'number' ? this.props.lockAspectRatio : this.size.width / this.size.height;
[65758] Fix | Delete
var flexBasis;
[65759] Fix | Delete
var computedStyle = this.window.getComputedStyle(this.resizable);
[65760] Fix | Delete
if (computedStyle.flexBasis !== 'auto') {
[65761] Fix | Delete
var parent_3 = this.parentNode;
[65762] Fix | Delete
if (parent_3) {
[65763] Fix | Delete
var dir = this.window.getComputedStyle(parent_3).flexDirection;
[65764] Fix | Delete
this.flexDir = dir.startsWith('row') ? 'row' : 'column';
[65765] Fix | Delete
flexBasis = computedStyle.flexBasis;
[65766] Fix | Delete
}
[65767] Fix | Delete
}
[65768] Fix | Delete
// For boundary
[65769] Fix | Delete
this.setBoundingClientRect();
[65770] Fix | Delete
this.bindEvents();
[65771] Fix | Delete
var state = {
[65772] Fix | Delete
original: {
[65773] Fix | Delete
x: clientX,
[65774] Fix | Delete
y: clientY,
[65775] Fix | Delete
width: this.size.width,
[65776] Fix | Delete
height: this.size.height,
[65777] Fix | Delete
},
[65778] Fix | Delete
isResizing: true,
[65779] Fix | Delete
backgroundStyle: lib_assign(lib_assign({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(event.target).cursor || 'auto' }),
[65780] Fix | Delete
direction: direction,
[65781] Fix | Delete
flexBasis: flexBasis,
[65782] Fix | Delete
};
[65783] Fix | Delete
this.setState(state);
[65784] Fix | Delete
};
[65785] Fix | Delete
Resizable.prototype.onMouseMove = function (event) {
[65786] Fix | Delete
var _this = this;
[65787] Fix | Delete
if (!this.state.isResizing || !this.resizable || !this.window) {
[65788] Fix | Delete
return;
[65789] Fix | Delete
}
[65790] Fix | Delete
if (this.window.TouchEvent && isTouchEvent(event)) {
[65791] Fix | Delete
try {
[65792] Fix | Delete
event.preventDefault();
[65793] Fix | Delete
event.stopPropagation();
[65794] Fix | Delete
}
[65795] Fix | Delete
catch (e) {
[65796] Fix | Delete
// Ignore on fail
[65797] Fix | Delete
}
[65798] Fix | Delete
}
[65799] Fix | Delete
var _a = this.props, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, minWidth = _a.minWidth, minHeight = _a.minHeight;
[65800] Fix | Delete
var clientX = isTouchEvent(event) ? event.touches[0].clientX : event.clientX;
[65801] Fix | Delete
var clientY = isTouchEvent(event) ? event.touches[0].clientY : event.clientY;
[65802] Fix | Delete
var _b = this.state, direction = _b.direction, original = _b.original, width = _b.width, height = _b.height;
[65803] Fix | Delete
var parentSize = this.getParentSize();
[65804] Fix | Delete
var max = calculateNewMax(parentSize, this.window.innerWidth, this.window.innerHeight, maxWidth, maxHeight, minWidth, minHeight);
[65805] Fix | Delete
maxWidth = max.maxWidth;
[65806] Fix | Delete
maxHeight = max.maxHeight;
[65807] Fix | Delete
minWidth = max.minWidth;
[65808] Fix | Delete
minHeight = max.minHeight;
[65809] Fix | Delete
// Calculate new size
[65810] Fix | Delete
var _c = this.calculateNewSizeFromDirection(clientX, clientY), newHeight = _c.newHeight, newWidth = _c.newWidth;
[65811] Fix | Delete
// Calculate max size from boundary settings
[65812] Fix | Delete
var boundaryMax = this.calculateNewMaxFromBoundary(maxWidth, maxHeight);
[65813] Fix | Delete
if (this.props.snap && this.props.snap.x) {
[65814] Fix | Delete
newWidth = findClosestSnap(newWidth, this.props.snap.x, this.props.snapGap);
[65815] Fix | Delete
}
[65816] Fix | Delete
if (this.props.snap && this.props.snap.y) {
[65817] Fix | Delete
newHeight = findClosestSnap(newHeight, this.props.snap.y, this.props.snapGap);
[65818] Fix | Delete
}
[65819] Fix | Delete
// Calculate new size from aspect ratio
[65820] Fix | Delete
var newSize = this.calculateNewSizeFromAspectRatio(newWidth, newHeight, { width: boundaryMax.maxWidth, height: boundaryMax.maxHeight }, { width: minWidth, height: minHeight });
[65821] Fix | Delete
newWidth = newSize.newWidth;
[65822] Fix | Delete
newHeight = newSize.newHeight;
[65823] Fix | Delete
if (this.props.grid) {
[65824] Fix | Delete
var newGridWidth = snap(newWidth, this.props.grid[0]);
[65825] Fix | Delete
var newGridHeight = snap(newHeight, this.props.grid[1]);
[65826] Fix | Delete
var gap = this.props.snapGap || 0;
[65827] Fix | Delete
newWidth = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap ? newGridWidth : newWidth;
[65828] Fix | Delete
newHeight = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap ? newGridHeight : newHeight;
[65829] Fix | Delete
}
[65830] Fix | Delete
var delta = {
[65831] Fix | Delete
width: newWidth - original.width,
[65832] Fix | Delete
height: newHeight - original.height,
[65833] Fix | Delete
};
[65834] Fix | Delete
if (width && typeof width === 'string') {
[65835] Fix | Delete
if (width.endsWith('%')) {
[65836] Fix | Delete
var percent = (newWidth / parentSize.width) * 100;
[65837] Fix | Delete
newWidth = percent + "%";
[65838] Fix | Delete
}
[65839] Fix | Delete
else if (width.endsWith('vw')) {
[65840] Fix | Delete
var vw = (newWidth / this.window.innerWidth) * 100;
[65841] Fix | Delete
newWidth = vw + "vw";
[65842] Fix | Delete
}
[65843] Fix | Delete
else if (width.endsWith('vh')) {
[65844] Fix | Delete
var vh = (newWidth / this.window.innerHeight) * 100;
[65845] Fix | Delete
newWidth = vh + "vh";
[65846] Fix | Delete
}
[65847] Fix | Delete
}
[65848] Fix | Delete
if (height && typeof height === 'string') {
[65849] Fix | Delete
if (height.endsWith('%')) {
[65850] Fix | Delete
var percent = (newHeight / parentSize.height) * 100;
[65851] Fix | Delete
newHeight = percent + "%";
[65852] Fix | Delete
}
[65853] Fix | Delete
else if (height.endsWith('vw')) {
[65854] Fix | Delete
var vw = (newHeight / this.window.innerWidth) * 100;
[65855] Fix | Delete
newHeight = vw + "vw";
[65856] Fix | Delete
}
[65857] Fix | Delete
else if (height.endsWith('vh')) {
[65858] Fix | Delete
var vh = (newHeight / this.window.innerHeight) * 100;
[65859] Fix | Delete
newHeight = vh + "vh";
[65860] Fix | Delete
}
[65861] Fix | Delete
}
[65862] Fix | Delete
var newState = {
[65863] Fix | Delete
width: this.createSizeForCssProperty(newWidth, 'width'),
[65864] Fix | Delete
height: this.createSizeForCssProperty(newHeight, 'height'),
[65865] Fix | Delete
};
[65866] Fix | Delete
if (this.flexDir === 'row') {
[65867] Fix | Delete
newState.flexBasis = newState.width;
[65868] Fix | Delete
}
[65869] Fix | Delete
else if (this.flexDir === 'column') {
[65870] Fix | Delete
newState.flexBasis = newState.height;
[65871] Fix | Delete
}
[65872] Fix | Delete
// For v18, update state sync
[65873] Fix | Delete
(0,external_ReactDOM_namespaceObject.flushSync)(function () {
[65874] Fix | Delete
_this.setState(newState);
[65875] Fix | Delete
});
[65876] Fix | Delete
if (this.props.onResize) {
[65877] Fix | Delete
this.props.onResize(event, direction, this.resizable, delta);
[65878] Fix | Delete
}
[65879] Fix | Delete
};
[65880] Fix | Delete
Resizable.prototype.onMouseUp = function (event) {
[65881] Fix | Delete
var _a = this.state, isResizing = _a.isResizing, direction = _a.direction, original = _a.original;
[65882] Fix | Delete
if (!isResizing || !this.resizable) {
[65883] Fix | Delete
return;
[65884] Fix | Delete
}
[65885] Fix | Delete
var delta = {
[65886] Fix | Delete
width: this.size.width - original.width,
[65887] Fix | Delete
height: this.size.height - original.height,
[65888] Fix | Delete
};
[65889] Fix | Delete
if (this.props.onResizeStop) {
[65890] Fix | Delete
this.props.onResizeStop(event, direction, this.resizable, delta);
[65891] Fix | Delete
}
[65892] Fix | Delete
if (this.props.size) {
[65893] Fix | Delete
this.setState(this.props.size);
[65894] Fix | Delete
}
[65895] Fix | Delete
this.unbindEvents();
[65896] Fix | Delete
this.setState({
[65897] Fix | Delete
isResizing: false,
[65898] Fix | Delete
backgroundStyle: lib_assign(lib_assign({}, this.state.backgroundStyle), { cursor: 'auto' }),
[65899] Fix | Delete
});
[65900] Fix | Delete
};
[65901] Fix | Delete
Resizable.prototype.updateSize = function (size) {
[65902] Fix | Delete
this.setState({ width: size.width, height: size.height });
[65903] Fix | Delete
};
[65904] Fix | Delete
Resizable.prototype.renderResizer = function () {
[65905] Fix | Delete
var _this = this;
[65906] Fix | Delete
var _a = this.props, enable = _a.enable, handleStyles = _a.handleStyles, handleClasses = _a.handleClasses, handleWrapperStyle = _a.handleWrapperStyle, handleWrapperClass = _a.handleWrapperClass, handleComponent = _a.handleComponent;
[65907] Fix | Delete
if (!enable) {
[65908] Fix | Delete
return null;
[65909] Fix | Delete
}
[65910] Fix | Delete
var resizers = Object.keys(enable).map(function (dir) {
[65911] Fix | Delete
if (enable[dir] !== false) {
[65912] Fix | Delete
return (external_React_.createElement(Resizer, { key: dir, direction: dir, onResizeStart: _this.onResizeStart, replaceStyles: handleStyles && handleStyles[dir], className: handleClasses && handleClasses[dir] }, handleComponent && handleComponent[dir] ? handleComponent[dir] : null));
[65913] Fix | Delete
}
[65914] Fix | Delete
return null;
[65915] Fix | Delete
});
[65916] Fix | Delete
// #93 Wrap the resize box in span (will not break 100% width/height)
[65917] Fix | Delete
return (external_React_.createElement("div", { className: handleWrapperClass, style: handleWrapperStyle }, resizers));
[65918] Fix | Delete
};
[65919] Fix | Delete
Resizable.prototype.render = function () {
[65920] Fix | Delete
var _this = this;
[65921] Fix | Delete
var extendsProps = Object.keys(this.props).reduce(function (acc, key) {
[65922] Fix | Delete
if (definedProps.indexOf(key) !== -1) {
[65923] Fix | Delete
return acc;
[65924] Fix | Delete
}
[65925] Fix | Delete
acc[key] = _this.props[key];
[65926] Fix | Delete
return acc;
[65927] Fix | Delete
}, {});
[65928] Fix | Delete
var style = lib_assign(lib_assign(lib_assign({ position: 'relative', userSelect: this.state.isResizing ? 'none' : 'auto' }, this.props.style), this.sizeStyle), { maxWidth: this.props.maxWidth, maxHeight: this.props.maxHeight, minWidth: this.props.minWidth, minHeight: this.props.minHeight, boxSizing: 'border-box', flexShrink: 0 });
[65929] Fix | Delete
if (this.state.flexBasis) {
[65930] Fix | Delete
style.flexBasis = this.state.flexBasis;
[65931] Fix | Delete
}
[65932] Fix | Delete
var Wrapper = this.props.as || 'div';
[65933] Fix | Delete
return (external_React_.createElement(Wrapper, lib_assign({ ref: this.ref, style: style, className: this.props.className }, extendsProps),
[65934] Fix | Delete
this.state.isResizing && external_React_.createElement("div", { style: this.state.backgroundStyle }),
[65935] Fix | Delete
this.props.children,
[65936] Fix | Delete
this.renderResizer()));
[65937] Fix | Delete
};
[65938] Fix | Delete
Resizable.defaultProps = {
[65939] Fix | Delete
as: 'div',
[65940] Fix | Delete
onResizeStart: function () { },
[65941] Fix | Delete
onResize: function () { },
[65942] Fix | Delete
onResizeStop: function () { },
[65943] Fix | Delete
enable: {
[65944] Fix | Delete
top: true,
[65945] Fix | Delete
right: true,
[65946] Fix | Delete
bottom: true,
[65947] Fix | Delete
left: true,
[65948] Fix | Delete
topRight: true,
[65949] Fix | Delete
bottomRight: true,
[65950] Fix | Delete
bottomLeft: true,
[65951] Fix | Delete
topLeft: true,
[65952] Fix | Delete
},
[65953] Fix | Delete
style: {},
[65954] Fix | Delete
grid: [1, 1],
[65955] Fix | Delete
lockAspectRatio: false,
[65956] Fix | Delete
lockAspectRatioExtraWidth: 0,
[65957] Fix | Delete
lockAspectRatioExtraHeight: 0,
[65958] Fix | Delete
scale: 1,
[65959] Fix | Delete
resizeRatio: 1,
[65960] Fix | Delete
snapGap: 0,
[65961] Fix | Delete
};
[65962] Fix | Delete
return Resizable;
[65963] Fix | Delete
}(external_React_.PureComponent));
[65964] Fix | Delete
[65965] Fix | Delete
[65966] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/utils.js
[65967] Fix | Delete
/**
[65968] Fix | Delete
* WordPress dependencies
[65969] Fix | Delete
*/
[65970] Fix | Delete
[65971] Fix | Delete
[65972] Fix | Delete
const utils_noop = () => {};
[65973] Fix | Delete
const POSITIONS = {
[65974] Fix | Delete
bottom: 'bottom',
[65975] Fix | Delete
corner: 'corner'
[65976] Fix | Delete
};
[65977] Fix | Delete
/**
[65978] Fix | Delete
* Custom hook that manages resize listener events. It also provides a label
[65979] Fix | Delete
* based on current resize width x height values.
[65980] Fix | Delete
*
[65981] Fix | Delete
* @param props
[65982] Fix | Delete
* @param props.axis Only shows the label corresponding to the axis.
[65983] Fix | Delete
* @param props.fadeTimeout Duration (ms) before deactivating the resize label.
[65984] Fix | Delete
* @param props.onResize Callback when a resize occurs. Provides { width, height } callback.
[65985] Fix | Delete
* @param props.position Adjusts label value.
[65986] Fix | Delete
* @param props.showPx Whether to add `PX` to the label.
[65987] Fix | Delete
*
[65988] Fix | Delete
* @return Properties for hook.
[65989] Fix | Delete
*/
[65990] Fix | Delete
function useResizeLabel({
[65991] Fix | Delete
axis,
[65992] Fix | Delete
fadeTimeout = 180,
[65993] Fix | Delete
onResize = utils_noop,
[65994] Fix | Delete
position = POSITIONS.bottom,
[65995] Fix | Delete
showPx = false
[65996] Fix | Delete
}) {
[65997] Fix | Delete
/*
[65998] Fix | Delete
* The width/height values derive from this special useResizeObserver hook.
[65999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function