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/wp-conte.../plugins/wpforms-.../assets/lite/js/integrat.../gutenber...
File: formselector.es5.js
* @return {Object} React component.
[1500] Fix | Delete
*/
[1501] Fix | Delete
var BackgroundPreview = function BackgroundPreview(_ref) {
[1502] Fix | Delete
var attributes = _ref.attributes,
[1503] Fix | Delete
onRemoveBackground = _ref.onRemoveBackground,
[1504] Fix | Delete
onPreviewClicked = _ref.onPreviewClicked;
[1505] Fix | Delete
var Button = wp.components.Button;
[1506] Fix | Delete
var _wpforms_gutenberg_fo = wpforms_gutenberg_form_selector,
[1507] Fix | Delete
strings = _wpforms_gutenberg_fo.strings;
[1508] Fix | Delete
return /*#__PURE__*/React.createElement("div", {
[1509] Fix | Delete
className: "wpforms-gutenberg-form-selector-background-preview"
[1510] Fix | Delete
}, /*#__PURE__*/React.createElement("style", null, "\n\t\t\t\t\t.wpforms-gutenberg-form-selector-background-preview-image {\n\t\t\t\t\t\t--wpforms-background-url: ".concat(attributes.backgroundUrl, ";\n\t\t\t\t\t}\n\t\t\t\t")), /*#__PURE__*/React.createElement("input", {
[1511] Fix | Delete
className: "wpforms-gutenberg-form-selector-background-preview-image",
[1512] Fix | Delete
onClick: onPreviewClicked,
[1513] Fix | Delete
tabIndex: 0,
[1514] Fix | Delete
type: "button",
[1515] Fix | Delete
onKeyDown: function onKeyDown(event) {
[1516] Fix | Delete
if (event.key === 'Enter' || event.key === ' ') {
[1517] Fix | Delete
onPreviewClicked();
[1518] Fix | Delete
}
[1519] Fix | Delete
}
[1520] Fix | Delete
}), /*#__PURE__*/React.createElement(Button, {
[1521] Fix | Delete
isSecondary: true,
[1522] Fix | Delete
className: "is-destructive",
[1523] Fix | Delete
onClick: onRemoveBackground
[1524] Fix | Delete
}, strings.remove_image));
[1525] Fix | Delete
};
[1526] Fix | Delete
BackgroundPreview.propTypes = {
[1527] Fix | Delete
attributes: _propTypes.default.object.isRequired,
[1528] Fix | Delete
onRemoveBackground: _propTypes.default.func.isRequired,
[1529] Fix | Delete
onPreviewClicked: _propTypes.default.func.isRequired
[1530] Fix | Delete
};
[1531] Fix | Delete
var _default = exports.default = BackgroundPreview;
[1532] Fix | Delete
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcHJvcFR5cGVzIiwiX2ludGVyb3BSZXF1aXJlRGVmYXVsdCIsInJlcXVpcmUiLCJvYmoiLCJfX2VzTW9kdWxlIiwiZGVmYXVsdCIsIkJhY2tncm91bmRQcmV2aWV3IiwiX3JlZiIsImF0dHJpYnV0ZXMiLCJvblJlbW92ZUJhY2tncm91bmQiLCJvblByZXZpZXdDbGlja2VkIiwiQnV0dG9uIiwid3AiLCJjb21wb25lbnRzIiwiX3dwZm9ybXNfZ3V0ZW5iZXJnX2ZvIiwid3Bmb3Jtc19ndXRlbmJlcmdfZm9ybV9zZWxlY3RvciIsInN0cmluZ3MiLCJSZWFjdCIsImNyZWF0ZUVsZW1lbnQiLCJjbGFzc05hbWUiLCJjb25jYXQiLCJiYWNrZ3JvdW5kVXJsIiwib25DbGljayIsInRhYkluZGV4IiwidHlwZSIsIm9uS2V5RG93biIsImV2ZW50Iiwia2V5IiwiaXNTZWNvbmRhcnkiLCJyZW1vdmVfaW1hZ2UiLCJwcm9wVHlwZXMiLCJQcm9wVHlwZXMiLCJvYmplY3QiLCJpc1JlcXVpcmVkIiwiZnVuYyIsIl9kZWZhdWx0IiwiZXhwb3J0cyJdLCJzb3VyY2VzIjpbImJhY2tncm91bmQtcHJldmlldy5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKiBnbG9iYWwgd3Bmb3Jtc19ndXRlbmJlcmdfZm9ybV9zZWxlY3RvciAqL1xuLyoganNoaW50IGVzMzogZmFsc2UsI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
[1536] Fix | Delete
Object.defineProperty(exports, "__esModule", {
[1537] Fix | Delete
value: true
[1538] Fix | Delete
});
[1539] Fix | Delete
exports.default = void 0;
[1540] Fix | Delete
var _backgroundPreview = _interopRequireDefault(require("./background-preview.js"));
[1541] Fix | Delete
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
[1542] Fix | Delete
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
[1543] Fix | Delete
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
[1544] Fix | Delete
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
[1545] Fix | Delete
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
[1546] Fix | Delete
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
[1547] Fix | Delete
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /* global wpforms_gutenberg_form_selector */ /* jshint es3: false, esversion: 6 */
[1548] Fix | Delete
/**
[1549] Fix | Delete
* @param strings.background_styles
[1550] Fix | Delete
* @param strings.bottom_center
[1551] Fix | Delete
* @param strings.bottom_left
[1552] Fix | Delete
* @param strings.bottom_right
[1553] Fix | Delete
* @param strings.center_center
[1554] Fix | Delete
* @param strings.center_left
[1555] Fix | Delete
* @param strings.center_right
[1556] Fix | Delete
* @param strings.choose_image
[1557] Fix | Delete
* @param strings.image_url
[1558] Fix | Delete
* @param strings.media_library
[1559] Fix | Delete
* @param strings.no_repeat
[1560] Fix | Delete
* @param strings.repeat_x
[1561] Fix | Delete
* @param strings.repeat_y
[1562] Fix | Delete
* @param strings.select_background_image
[1563] Fix | Delete
* @param strings.select_image
[1564] Fix | Delete
* @param strings.stock_photo
[1565] Fix | Delete
* @param strings.tile
[1566] Fix | Delete
* @param strings.top_center
[1567] Fix | Delete
* @param strings.top_left
[1568] Fix | Delete
* @param strings.top_right
[1569] Fix | Delete
*/
[1570] Fix | Delete
/**
[1571] Fix | Delete
* Gutenberg editor block.
[1572] Fix | Delete
*
[1573] Fix | Delete
* Background styles panel module.
[1574] Fix | Delete
*
[1575] Fix | Delete
* @since 1.8.8
[1576] Fix | Delete
*/
[1577] Fix | Delete
var _default = exports.default = function () {
[1578] Fix | Delete
/**
[1579] Fix | Delete
* WP core components.
[1580] Fix | Delete
*
[1581] Fix | Delete
* @since 1.8.8
[1582] Fix | Delete
*/
[1583] Fix | Delete
var _ref = wp.blockEditor || wp.editor,
[1584] Fix | Delete
PanelColorSettings = _ref.PanelColorSettings;
[1585] Fix | Delete
var _wp$components = wp.components,
[1586] Fix | Delete
SelectControl = _wp$components.SelectControl,
[1587] Fix | Delete
PanelBody = _wp$components.PanelBody,
[1588] Fix | Delete
Flex = _wp$components.Flex,
[1589] Fix | Delete
FlexBlock = _wp$components.FlexBlock,
[1590] Fix | Delete
__experimentalUnitControl = _wp$components.__experimentalUnitControl,
[1591] Fix | Delete
TextControl = _wp$components.TextControl,
[1592] Fix | Delete
Button = _wp$components.Button;
[1593] Fix | Delete
var _wp$element = wp.element,
[1594] Fix | Delete
useState = _wp$element.useState,
[1595] Fix | Delete
useEffect = _wp$element.useEffect;
[1596] Fix | Delete
[1597] Fix | Delete
/**
[1598] Fix | Delete
* Localized data aliases.
[1599] Fix | Delete
*
[1600] Fix | Delete
* @since 1.8.8
[1601] Fix | Delete
*/
[1602] Fix | Delete
var _wpforms_gutenberg_fo = wpforms_gutenberg_form_selector,
[1603] Fix | Delete
strings = _wpforms_gutenberg_fo.strings,
[1604] Fix | Delete
defaults = _wpforms_gutenberg_fo.defaults,
[1605] Fix | Delete
isPro = _wpforms_gutenberg_fo.isPro,
[1606] Fix | Delete
isLicenseActive = _wpforms_gutenberg_fo.isLicenseActive;
[1607] Fix | Delete
[1608] Fix | Delete
/**
[1609] Fix | Delete
* Whether the background is selected.
[1610] Fix | Delete
*
[1611] Fix | Delete
* @since 1.8.8
[1612] Fix | Delete
*
[1613] Fix | Delete
* @type {boolean}
[1614] Fix | Delete
*/
[1615] Fix | Delete
var backgroundSelected = false;
[1616] Fix | Delete
[1617] Fix | Delete
/**
[1618] Fix | Delete
* Public functions and properties.
[1619] Fix | Delete
*
[1620] Fix | Delete
* @since 1.8.8
[1621] Fix | Delete
*
[1622] Fix | Delete
* @type {Object}
[1623] Fix | Delete
*/
[1624] Fix | Delete
var app = {
[1625] Fix | Delete
/**
[1626] Fix | Delete
* Get block attributes.
[1627] Fix | Delete
*
[1628] Fix | Delete
* @since 1.8.8
[1629] Fix | Delete
*
[1630] Fix | Delete
* @return {Object} Block attributes.
[1631] Fix | Delete
*/
[1632] Fix | Delete
getBlockAttributes: function getBlockAttributes() {
[1633] Fix | Delete
return {
[1634] Fix | Delete
backgroundImage: {
[1635] Fix | Delete
type: 'string',
[1636] Fix | Delete
default: defaults.backgroundImage
[1637] Fix | Delete
},
[1638] Fix | Delete
backgroundPosition: {
[1639] Fix | Delete
type: 'string',
[1640] Fix | Delete
default: defaults.backgroundPosition
[1641] Fix | Delete
},
[1642] Fix | Delete
backgroundRepeat: {
[1643] Fix | Delete
type: 'string',
[1644] Fix | Delete
default: defaults.backgroundRepeat
[1645] Fix | Delete
},
[1646] Fix | Delete
backgroundSizeMode: {
[1647] Fix | Delete
type: 'string',
[1648] Fix | Delete
default: defaults.backgroundSizeMode
[1649] Fix | Delete
},
[1650] Fix | Delete
backgroundSize: {
[1651] Fix | Delete
type: 'string',
[1652] Fix | Delete
default: defaults.backgroundSize
[1653] Fix | Delete
},
[1654] Fix | Delete
backgroundWidth: {
[1655] Fix | Delete
type: 'string',
[1656] Fix | Delete
default: defaults.backgroundWidth
[1657] Fix | Delete
},
[1658] Fix | Delete
backgroundHeight: {
[1659] Fix | Delete
type: 'string',
[1660] Fix | Delete
default: defaults.backgroundHeight
[1661] Fix | Delete
},
[1662] Fix | Delete
backgroundColor: {
[1663] Fix | Delete
type: 'string',
[1664] Fix | Delete
default: defaults.backgroundColor
[1665] Fix | Delete
},
[1666] Fix | Delete
backgroundUrl: {
[1667] Fix | Delete
type: 'string',
[1668] Fix | Delete
default: defaults.backgroundUrl
[1669] Fix | Delete
}
[1670] Fix | Delete
};
[1671] Fix | Delete
},
[1672] Fix | Delete
/**
[1673] Fix | Delete
* Get Background Styles panel JSX code.
[1674] Fix | Delete
*
[1675] Fix | Delete
* @since 1.8.8
[1676] Fix | Delete
*
[1677] Fix | Delete
* @param {Object} props Block properties.
[1678] Fix | Delete
* @param {Object} handlers Block handlers.
[1679] Fix | Delete
* @param {Object} formSelectorCommon Block properties.
[1680] Fix | Delete
* @param {Object} stockPhotos Stock Photos module.
[1681] Fix | Delete
*
[1682] Fix | Delete
* @return {Object} Field styles JSX code.
[1683] Fix | Delete
*/
[1684] Fix | Delete
getBackgroundStyles: function getBackgroundStyles(props, handlers, formSelectorCommon, stockPhotos) {
[1685] Fix | Delete
// eslint-disable-line max-lines-per-function, complexity
[1686] Fix | Delete
var _useState = useState(app._showBackgroundPreview(props)),
[1687] Fix | Delete
_useState2 = _slicedToArray(_useState, 2),
[1688] Fix | Delete
showBackgroundPreview = _useState2[0],
[1689] Fix | Delete
setShowBackgroundPreview = _useState2[1]; // eslint-disable-line react-hooks/rules-of-hooks
[1690] Fix | Delete
var _useState3 = useState(''),
[1691] Fix | Delete
_useState4 = _slicedToArray(_useState3, 2),
[1692] Fix | Delete
lastBgImage = _useState4[0],
[1693] Fix | Delete
setLastBgImage = _useState4[1]; // eslint-disable-line react-hooks/rules-of-hooks
[1694] Fix | Delete
var _useState5 = useState(isPro && isLicenseActive),
[1695] Fix | Delete
_useState6 = _slicedToArray(_useState5, 2),
[1696] Fix | Delete
isNotDisabled = _useState6[0],
[1697] Fix | Delete
_setIsNotDisabled = _useState6[1]; // eslint-disable-line react-hooks/rules-of-hooks, no-unused-vars
[1698] Fix | Delete
var _useState7 = useState(isPro),
[1699] Fix | Delete
_useState8 = _slicedToArray(_useState7, 2),
[1700] Fix | Delete
isProEnabled = _useState8[0],
[1701] Fix | Delete
_setIsProEnabled = _useState8[1]; // eslint-disable-line react-hooks/rules-of-hooks, no-unused-vars
[1702] Fix | Delete
[1703] Fix | Delete
var tabIndex = isNotDisabled ? 0 : -1;
[1704] Fix | Delete
var cssClass = formSelectorCommon.getPanelClass(props) + (isNotDisabled ? '' : ' wpforms-gutenberg-panel-disabled');
[1705] Fix | Delete
useEffect(function () {
[1706] Fix | Delete
// eslint-disable-line react-hooks/rules-of-hooks
[1707] Fix | Delete
setShowBackgroundPreview(props.attributes.backgroundImage !== 'none' && props.attributes.backgroundUrl && props.attributes.backgroundUrl !== 'url()');
[1708] Fix | Delete
}, [backgroundSelected, props.attributes.backgroundImage, props.attributes.backgroundUrl]); // eslint-disable-line react-hooks/exhaustive-deps
[1709] Fix | Delete
[1710] Fix | Delete
return /*#__PURE__*/React.createElement(PanelBody, {
[1711] Fix | Delete
className: cssClass,
[1712] Fix | Delete
title: strings.background_styles
[1713] Fix | Delete
}, /*#__PURE__*/React.createElement("div", {
[1714] Fix | Delete
// eslint-disable-line jsx-a11y/no-static-element-interactions
[1715] Fix | Delete
className: "wpforms-gutenberg-form-selector-panel-body",
[1716] Fix | Delete
onClick: function onClick(event) {
[1717] Fix | Delete
if (isNotDisabled) {
[1718] Fix | Delete
return;
[1719] Fix | Delete
}
[1720] Fix | Delete
event.stopPropagation();
[1721] Fix | Delete
if (!isProEnabled) {
[1722] Fix | Delete
return formSelectorCommon.education.showProModal('background', strings.background_styles);
[1723] Fix | Delete
}
[1724] Fix | Delete
formSelectorCommon.education.showLicenseModal('background', strings.background_styles, 'background-styles');
[1725] Fix | Delete
},
[1726] Fix | Delete
onKeyDown: function onKeyDown(event) {
[1727] Fix | Delete
if (isNotDisabled) {
[1728] Fix | Delete
return;
[1729] Fix | Delete
}
[1730] Fix | Delete
event.stopPropagation();
[1731] Fix | Delete
if (!isProEnabled) {
[1732] Fix | Delete
return formSelectorCommon.education.showProModal('background', strings.background_styles);
[1733] Fix | Delete
}
[1734] Fix | Delete
formSelectorCommon.education.showLicenseModal('background', strings.background_styles, 'background-styles');
[1735] Fix | Delete
}
[1736] Fix | Delete
}, /*#__PURE__*/React.createElement(Flex, {
[1737] Fix | Delete
gap: 4,
[1738] Fix | Delete
align: "flex-start",
[1739] Fix | Delete
className: 'wpforms-gutenberg-form-selector-flex',
[1740] Fix | Delete
justify: "space-between"
[1741] Fix | Delete
}, /*#__PURE__*/React.createElement(FlexBlock, null, /*#__PURE__*/React.createElement(SelectControl, {
[1742] Fix | Delete
label: strings.image,
[1743] Fix | Delete
tabIndex: tabIndex,
[1744] Fix | Delete
value: props.attributes.backgroundImage,
[1745] Fix | Delete
options: [{
[1746] Fix | Delete
label: strings.none,
[1747] Fix | Delete
value: 'none'
[1748] Fix | Delete
}, {
[1749] Fix | Delete
label: strings.media_library,
[1750] Fix | Delete
value: 'library'
[1751] Fix | Delete
}, {
[1752] Fix | Delete
label: strings.stock_photo,
[1753] Fix | Delete
value: 'stock'
[1754] Fix | Delete
}],
[1755] Fix | Delete
onChange: function onChange(value) {
[1756] Fix | Delete
return app.setContainerBackgroundImageWrapper(props, handlers, value, lastBgImage, setLastBgImage);
[1757] Fix | Delete
}
[1758] Fix | Delete
})), /*#__PURE__*/React.createElement(FlexBlock, null, (props.attributes.backgroundImage !== 'none' || !isNotDisabled) && /*#__PURE__*/React.createElement(SelectControl, {
[1759] Fix | Delete
label: strings.position,
[1760] Fix | Delete
value: props.attributes.backgroundPosition,
[1761] Fix | Delete
tabIndex: tabIndex,
[1762] Fix | Delete
options: [{
[1763] Fix | Delete
label: strings.top_left,
[1764] Fix | Delete
value: 'top left'
[1765] Fix | Delete
}, {
[1766] Fix | Delete
label: strings.top_center,
[1767] Fix | Delete
value: 'top center'
[1768] Fix | Delete
}, {
[1769] Fix | Delete
label: strings.top_right,
[1770] Fix | Delete
value: 'top right'
[1771] Fix | Delete
}, {
[1772] Fix | Delete
label: strings.center_left,
[1773] Fix | Delete
value: 'center left'
[1774] Fix | Delete
}, {
[1775] Fix | Delete
label: strings.center_center,
[1776] Fix | Delete
value: 'center center'
[1777] Fix | Delete
}, {
[1778] Fix | Delete
label: strings.center_right,
[1779] Fix | Delete
value: 'center right'
[1780] Fix | Delete
}, {
[1781] Fix | Delete
label: strings.bottom_left,
[1782] Fix | Delete
value: 'bottom left'
[1783] Fix | Delete
}, {
[1784] Fix | Delete
label: strings.bottom_center,
[1785] Fix | Delete
value: 'bottom center'
[1786] Fix | Delete
}, {
[1787] Fix | Delete
label: strings.bottom_right,
[1788] Fix | Delete
value: 'bottom right'
[1789] Fix | Delete
}],
[1790] Fix | Delete
disabled: props.attributes.backgroundImage === 'none' && isNotDisabled,
[1791] Fix | Delete
onChange: function onChange(value) {
[1792] Fix | Delete
return handlers.styleAttrChange('backgroundPosition', value);
[1793] Fix | Delete
}
[1794] Fix | Delete
}))), (props.attributes.backgroundImage !== 'none' || !isNotDisabled) && /*#__PURE__*/React.createElement(Flex, {
[1795] Fix | Delete
gap: 4,
[1796] Fix | Delete
align: "flex-start",
[1797] Fix | Delete
className: 'wpforms-gutenberg-form-selector-flex',
[1798] Fix | Delete
justify: "space-between"
[1799] Fix | Delete
}, /*#__PURE__*/React.createElement(FlexBlock, null, /*#__PURE__*/React.createElement(SelectControl, {
[1800] Fix | Delete
label: strings.repeat,
[1801] Fix | Delete
tabIndex: tabIndex,
[1802] Fix | Delete
value: props.attributes.backgroundRepeat,
[1803] Fix | Delete
options: [{
[1804] Fix | Delete
label: strings.no_repeat,
[1805] Fix | Delete
value: 'no-repeat'
[1806] Fix | Delete
}, {
[1807] Fix | Delete
label: strings.tile,
[1808] Fix | Delete
value: 'repeat'
[1809] Fix | Delete
}, {
[1810] Fix | Delete
label: strings.repeat_x,
[1811] Fix | Delete
value: 'repeat-x'
[1812] Fix | Delete
}, {
[1813] Fix | Delete
label: strings.repeat_y,
[1814] Fix | Delete
value: 'repeat-y'
[1815] Fix | Delete
}],
[1816] Fix | Delete
disabled: props.attributes.backgroundImage === 'none' && isNotDisabled,
[1817] Fix | Delete
onChange: function onChange(value) {
[1818] Fix | Delete
return handlers.styleAttrChange('backgroundRepeat', value);
[1819] Fix | Delete
}
[1820] Fix | Delete
})), /*#__PURE__*/React.createElement(FlexBlock, null, /*#__PURE__*/React.createElement(SelectControl, {
[1821] Fix | Delete
label: strings.size,
[1822] Fix | Delete
tabIndex: tabIndex,
[1823] Fix | Delete
value: props.attributes.backgroundSizeMode,
[1824] Fix | Delete
options: [{
[1825] Fix | Delete
label: strings.dimensions,
[1826] Fix | Delete
value: 'dimensions'
[1827] Fix | Delete
}, {
[1828] Fix | Delete
label: strings.cover,
[1829] Fix | Delete
value: 'cover'
[1830] Fix | Delete
}],
[1831] Fix | Delete
disabled: props.attributes.backgroundImage === 'none' && isNotDisabled,
[1832] Fix | Delete
onChange: function onChange(value) {
[1833] Fix | Delete
return app.handleSizeFromDimensions(props, handlers, value);
[1834] Fix | Delete
}
[1835] Fix | Delete
}))), (props.attributes.backgroundSizeMode === 'dimensions' && props.attributes.backgroundImage !== 'none' || !isNotDisabled) && /*#__PURE__*/React.createElement(Flex, {
[1836] Fix | Delete
gap: 4,
[1837] Fix | Delete
align: "flex-start",
[1838] Fix | Delete
className: 'wpforms-gutenberg-form-selector-flex',
[1839] Fix | Delete
justify: "space-between"
[1840] Fix | Delete
}, /*#__PURE__*/React.createElement(FlexBlock, null, /*#__PURE__*/React.createElement(__experimentalUnitControl, {
[1841] Fix | Delete
label: strings.width,
[1842] Fix | Delete
tabIndex: tabIndex,
[1843] Fix | Delete
value: props.attributes.backgroundWidth,
[1844] Fix | Delete
isUnitSelectTabbable: isNotDisabled,
[1845] Fix | Delete
onChange: function onChange(value) {
[1846] Fix | Delete
return app.handleSizeFromWidth(props, handlers, value);
[1847] Fix | Delete
}
[1848] Fix | Delete
})), /*#__PURE__*/React.createElement(FlexBlock, null, /*#__PURE__*/React.createElement(__experimentalUnitControl, {
[1849] Fix | Delete
label: strings.height,
[1850] Fix | Delete
tabIndex: tabIndex,
[1851] Fix | Delete
value: props.attributes.backgroundHeight,
[1852] Fix | Delete
isUnitSelectTabbable: isNotDisabled,
[1853] Fix | Delete
onChange: function onChange(value) {
[1854] Fix | Delete
return app.handleSizeFromHeight(props, handlers, value);
[1855] Fix | Delete
}
[1856] Fix | Delete
}))), (!showBackgroundPreview || props.attributes.backgroundUrl === 'url()') && (props.attributes.backgroundImage === 'library' && /*#__PURE__*/React.createElement(Flex, {
[1857] Fix | Delete
gap: 4,
[1858] Fix | Delete
align: "flex-start",
[1859] Fix | Delete
className: 'wpforms-gutenberg-form-selector-flex',
[1860] Fix | Delete
justify: "space-between"
[1861] Fix | Delete
}, /*#__PURE__*/React.createElement(FlexBlock, null, /*#__PURE__*/React.createElement(Button, {
[1862] Fix | Delete
isSecondary: true,
[1863] Fix | Delete
tabIndex: tabIndex,
[1864] Fix | Delete
className: 'wpforms-gutenberg-form-selector-media-library-button',
[1865] Fix | Delete
onClick: app.openMediaLibrary.bind(null, props, handlers, setShowBackgroundPreview)
[1866] Fix | Delete
}, strings.choose_image))) || props.attributes.backgroundImage === 'stock' && /*#__PURE__*/React.createElement(Flex, {
[1867] Fix | Delete
gap: 4,
[1868] Fix | Delete
align: "flex-start",
[1869] Fix | Delete
className: 'wpforms-gutenberg-form-selector-flex',
[1870] Fix | Delete
justify: "space-between"
[1871] Fix | Delete
}, /*#__PURE__*/React.createElement(FlexBlock, null, /*#__PURE__*/React.createElement(Button, {
[1872] Fix | Delete
isSecondary: true,
[1873] Fix | Delete
tabIndex: tabIndex,
[1874] Fix | Delete
className: 'wpforms-gutenberg-form-selector-media-library-button',
[1875] Fix | Delete
onClick: stockPhotos === null || stockPhotos === void 0 ? void 0 : stockPhotos.openModal.bind(null, props, handlers, 'bg-styles', setShowBackgroundPreview)
[1876] Fix | Delete
}, strings.choose_image)))), (showBackgroundPreview && props.attributes.backgroundImage !== 'none' || props.attributes.backgroundUrl !== 'url()') && /*#__PURE__*/React.createElement(Flex, {
[1877] Fix | Delete
gap: 4,
[1878] Fix | Delete
align: "flex-start",
[1879] Fix | Delete
className: 'wpforms-gutenberg-form-selector-flex',
[1880] Fix | Delete
justify: "space-between"
[1881] Fix | Delete
}, /*#__PURE__*/React.createElement(FlexBlock, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_backgroundPreview.default, {
[1882] Fix | Delete
attributes: props.attributes,
[1883] Fix | Delete
onRemoveBackground: function onRemoveBackground() {
[1884] Fix | Delete
app.onRemoveBackground(setShowBackgroundPreview, handlers, setLastBgImage);
[1885] Fix | Delete
},
[1886] Fix | Delete
onPreviewClicked: function onPreviewClicked() {
[1887] Fix | Delete
if (props.attributes.backgroundImage === 'library') {
[1888] Fix | Delete
return app.openMediaLibrary(props, handlers, setShowBackgroundPreview);
[1889] Fix | Delete
}
[1890] Fix | Delete
return stockPhotos === null || stockPhotos === void 0 ? void 0 : stockPhotos.openModal(props, handlers, 'bg-styles', setShowBackgroundPreview);
[1891] Fix | Delete
}
[1892] Fix | Delete
})), /*#__PURE__*/React.createElement(TextControl, {
[1893] Fix | Delete
label: strings.image_url,
[1894] Fix | Delete
tabIndex: tabIndex,
[1895] Fix | Delete
value: props.attributes.backgroundImage !== 'none' && props.attributes.backgroundUrl,
[1896] Fix | Delete
className: 'wpforms-gutenberg-form-selector-image-url',
[1897] Fix | Delete
onChange: function onChange(value) {
[1898] Fix | Delete
return handlers.styleAttrChange('backgroundUrl', value);
[1899] Fix | Delete
},
[1900] Fix | Delete
onLoad: function onLoad(value) {
[1901] Fix | Delete
return props.attributes.backgroundImage !== 'none' && handlers.styleAttrChange('backgroundUrl', value);
[1902] Fix | Delete
}
[1903] Fix | Delete
}))), /*#__PURE__*/React.createElement(Flex, {
[1904] Fix | Delete
gap: 4,
[1905] Fix | Delete
align: "flex-start",
[1906] Fix | Delete
className: 'wpforms-gutenberg-form-selector-flex',
[1907] Fix | Delete
justify: "space-between"
[1908] Fix | Delete
}, /*#__PURE__*/React.createElement(FlexBlock, null, /*#__PURE__*/React.createElement("div", {
[1909] Fix | Delete
className: "wpforms-gutenberg-form-selector-control-label"
[1910] Fix | Delete
}, strings.colors), /*#__PURE__*/React.createElement(PanelColorSettings, {
[1911] Fix | Delete
__experimentalIsRenderedInSidebar: true,
[1912] Fix | Delete
enableAlpha: true,
[1913] Fix | Delete
showTitle: false,
[1914] Fix | Delete
tabIndex: tabIndex,
[1915] Fix | Delete
className: "wpforms-gutenberg-form-selector-color-panel",
[1916] Fix | Delete
colorSettings: [{
[1917] Fix | Delete
value: props.attributes.backgroundColor,
[1918] Fix | Delete
onChange: function onChange(value) {
[1919] Fix | Delete
if (!isNotDisabled) {
[1920] Fix | Delete
return;
[1921] Fix | Delete
}
[1922] Fix | Delete
handlers.styleAttrChange('backgroundColor', value);
[1923] Fix | Delete
},
[1924] Fix | Delete
label: strings.background
[1925] Fix | Delete
}]
[1926] Fix | Delete
})))));
[1927] Fix | Delete
},
[1928] Fix | Delete
/**
[1929] Fix | Delete
* Open media library modal and handle image selection.
[1930] Fix | Delete
*
[1931] Fix | Delete
* @since 1.8.8
[1932] Fix | Delete
*
[1933] Fix | Delete
* @param {Object} props Block properties.
[1934] Fix | Delete
* @param {Object} handlers Block handlers.
[1935] Fix | Delete
* @param {Function} setShowBackgroundPreview Set show background preview.
[1936] Fix | Delete
*/
[1937] Fix | Delete
openMediaLibrary: function openMediaLibrary(props, handlers, setShowBackgroundPreview) {
[1938] Fix | Delete
var frame = wp.media({
[1939] Fix | Delete
title: strings.select_background_image,
[1940] Fix | Delete
multiple: false,
[1941] Fix | Delete
library: {
[1942] Fix | Delete
type: 'image'
[1943] Fix | Delete
},
[1944] Fix | Delete
button: {
[1945] Fix | Delete
text: strings.select_image
[1946] Fix | Delete
}
[1947] Fix | Delete
});
[1948] Fix | Delete
frame.on('select', function () {
[1949] Fix | Delete
var attachment = frame.state().get('selection').first().toJSON();
[1950] Fix | Delete
var setAttr = {};
[1951] Fix | Delete
var attribute = 'backgroundUrl';
[1952] Fix | Delete
if (attachment.url) {
[1953] Fix | Delete
var value = "url(".concat(attachment.url, ")");
[1954] Fix | Delete
setAttr[attribute] = value;
[1955] Fix | Delete
props.setAttributes(setAttr);
[1956] Fix | Delete
handlers.styleAttrChange('backgroundUrl', value);
[1957] Fix | Delete
setShowBackgroundPreview(true);
[1958] Fix | Delete
}
[1959] Fix | Delete
});
[1960] Fix | Delete
frame.open();
[1961] Fix | Delete
},
[1962] Fix | Delete
/**
[1963] Fix | Delete
* Set container background image.
[1964] Fix | Delete
*
[1965] Fix | Delete
* @since 1.8.8
[1966] Fix | Delete
*
[1967] Fix | Delete
* @param {HTMLElement} container Container element.
[1968] Fix | Delete
* @param {string} value Value.
[1969] Fix | Delete
*
[1970] Fix | Delete
* @return {boolean} True if the value was set, false otherwise.
[1971] Fix | Delete
*/
[1972] Fix | Delete
setContainerBackgroundImage: function setContainerBackgroundImage(container, value) {
[1973] Fix | Delete
if (value === 'none') {
[1974] Fix | Delete
container.style.setProperty("--wpforms-background-url", 'url()');
[1975] Fix | Delete
}
[1976] Fix | Delete
return true;
[1977] Fix | Delete
},
[1978] Fix | Delete
/**
[1979] Fix | Delete
* Set container background image.
[1980] Fix | Delete
*
[1981] Fix | Delete
* @since 1.8.8
[1982] Fix | Delete
*
[1983] Fix | Delete
* @param {Object} props Block properties.
[1984] Fix | Delete
* @param {Object} handlers Block event handlers.
[1985] Fix | Delete
* @param {string} value Value.
[1986] Fix | Delete
* @param {string} lastBgImage Last background image.
[1987] Fix | Delete
* @param {Function} setLastBgImage Set last background image.
[1988] Fix | Delete
*/
[1989] Fix | Delete
setContainerBackgroundImageWrapper: function setContainerBackgroundImageWrapper(props, handlers, value, lastBgImage, setLastBgImage) {
[1990] Fix | Delete
if (value === 'none') {
[1991] Fix | Delete
setLastBgImage(props.attributes.backgroundUrl);
[1992] Fix | Delete
props.attributes.backgroundUrl = 'url()';
[1993] Fix | Delete
handlers.styleAttrChange('backgroundUrl', 'url()');
[1994] Fix | Delete
} else if (lastBgImage) {
[1995] Fix | Delete
props.attributes.backgroundUrl = lastBgImage;
[1996] Fix | Delete
handlers.styleAttrChange('backgroundUrl', lastBgImage);
[1997] Fix | Delete
}
[1998] Fix | Delete
handlers.styleAttrChange('backgroundImage', value);
[1999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function