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: widgets.js
* @access private
[500] Fix | Delete
*/
[501] Fix | Delete
set instance(instance) {
[502] Fix | Delete
if (this._instance !== instance) {
[503] Fix | Delete
this._instance = instance;
[504] Fix | Delete
this.onChangeInstance(instance);
[505] Fix | Delete
}
[506] Fix | Delete
}
[507] Fix | Delete
[508] Fix | Delete
/**
[509] Fix | Delete
* Whether or not the widget can be previewed.
[510] Fix | Delete
*
[511] Fix | Delete
* @access public
[512] Fix | Delete
*/
[513] Fix | Delete
get hasPreview() {
[514] Fix | Delete
return this._hasPreview;
[515] Fix | Delete
}
[516] Fix | Delete
[517] Fix | Delete
/**
[518] Fix | Delete
* Whether or not the widget can be previewed.
[519] Fix | Delete
*
[520] Fix | Delete
* @access private
[521] Fix | Delete
*/
[522] Fix | Delete
set hasPreview(hasPreview) {
[523] Fix | Delete
if (this._hasPreview !== hasPreview) {
[524] Fix | Delete
this._hasPreview = hasPreview;
[525] Fix | Delete
this.onChangeHasPreview(hasPreview);
[526] Fix | Delete
}
[527] Fix | Delete
}
[528] Fix | Delete
}
[529] Fix | Delete
let lastNumber = 0;
[530] Fix | Delete
function el(tagName, attributes = {}, content = null) {
[531] Fix | Delete
const element = document.createElement(tagName);
[532] Fix | Delete
for (const [attribute, value] of Object.entries(attributes)) {
[533] Fix | Delete
element.setAttribute(attribute, value);
[534] Fix | Delete
}
[535] Fix | Delete
if (Array.isArray(content)) {
[536] Fix | Delete
for (const child of content) {
[537] Fix | Delete
if (child) {
[538] Fix | Delete
element.appendChild(child);
[539] Fix | Delete
}
[540] Fix | Delete
}
[541] Fix | Delete
} else if (typeof content === 'string') {
[542] Fix | Delete
element.innerText = content;
[543] Fix | Delete
}
[544] Fix | Delete
return element;
[545] Fix | Delete
}
[546] Fix | Delete
async function saveWidget(id, formData = null) {
[547] Fix | Delete
let widget;
[548] Fix | Delete
if (formData) {
[549] Fix | Delete
widget = await external_wp_apiFetch_default()({
[550] Fix | Delete
path: `/wp/v2/widgets/${id}?context=edit`,
[551] Fix | Delete
method: 'PUT',
[552] Fix | Delete
data: {
[553] Fix | Delete
form_data: formData
[554] Fix | Delete
}
[555] Fix | Delete
});
[556] Fix | Delete
} else {
[557] Fix | Delete
widget = await external_wp_apiFetch_default()({
[558] Fix | Delete
path: `/wp/v2/widgets/${id}?context=edit`,
[559] Fix | Delete
method: 'GET'
[560] Fix | Delete
});
[561] Fix | Delete
}
[562] Fix | Delete
return {
[563] Fix | Delete
form: widget.rendered_form
[564] Fix | Delete
};
[565] Fix | Delete
}
[566] Fix | Delete
async function encodeWidget({
[567] Fix | Delete
idBase,
[568] Fix | Delete
instance,
[569] Fix | Delete
number,
[570] Fix | Delete
formData = null
[571] Fix | Delete
}) {
[572] Fix | Delete
const response = await external_wp_apiFetch_default()({
[573] Fix | Delete
path: `/wp/v2/widget-types/${idBase}/encode`,
[574] Fix | Delete
method: 'POST',
[575] Fix | Delete
data: {
[576] Fix | Delete
instance,
[577] Fix | Delete
number,
[578] Fix | Delete
form_data: formData
[579] Fix | Delete
}
[580] Fix | Delete
});
[581] Fix | Delete
return {
[582] Fix | Delete
instance: response.instance,
[583] Fix | Delete
form: response.form,
[584] Fix | Delete
preview: response.preview
[585] Fix | Delete
};
[586] Fix | Delete
}
[587] Fix | Delete
function isEmptyHTML(html) {
[588] Fix | Delete
const element = document.createElement('div');
[589] Fix | Delete
element.innerHTML = html;
[590] Fix | Delete
return isEmptyNode(element);
[591] Fix | Delete
}
[592] Fix | Delete
function isEmptyNode(node) {
[593] Fix | Delete
switch (node.nodeType) {
[594] Fix | Delete
case node.TEXT_NODE:
[595] Fix | Delete
// Text nodes are empty if it's entirely whitespace.
[596] Fix | Delete
return node.nodeValue.trim() === '';
[597] Fix | Delete
case node.ELEMENT_NODE:
[598] Fix | Delete
// Elements that are "embedded content" are not empty.
[599] Fix | Delete
// https://dev.w3.org/html5/spec-LC/content-models.html#embedded-content-0
[600] Fix | Delete
if (['AUDIO', 'CANVAS', 'EMBED', 'IFRAME', 'IMG', 'MATH', 'OBJECT', 'SVG', 'VIDEO'].includes(node.tagName)) {
[601] Fix | Delete
return false;
[602] Fix | Delete
}
[603] Fix | Delete
// Elements with no children are empty.
[604] Fix | Delete
if (!node.hasChildNodes()) {
[605] Fix | Delete
return true;
[606] Fix | Delete
}
[607] Fix | Delete
// Elements with children are empty if all their children are empty.
[608] Fix | Delete
return Array.from(node.childNodes).every(isEmptyNode);
[609] Fix | Delete
default:
[610] Fix | Delete
return true;
[611] Fix | Delete
}
[612] Fix | Delete
}
[613] Fix | Delete
function serializeForm(form) {
[614] Fix | Delete
return new window.URLSearchParams(Array.from(new window.FormData(form))).toString();
[615] Fix | Delete
}
[616] Fix | Delete
[617] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/form.js
[618] Fix | Delete
/**
[619] Fix | Delete
* External dependencies
[620] Fix | Delete
*/
[621] Fix | Delete
[622] Fix | Delete
/**
[623] Fix | Delete
* WordPress dependencies
[624] Fix | Delete
*/
[625] Fix | Delete
[626] Fix | Delete
[627] Fix | Delete
[628] Fix | Delete
[629] Fix | Delete
[630] Fix | Delete
[631] Fix | Delete
/**
[632] Fix | Delete
* Internal dependencies
[633] Fix | Delete
*/
[634] Fix | Delete
[635] Fix | Delete
[636] Fix | Delete
[637] Fix | Delete
function Form({
[638] Fix | Delete
title,
[639] Fix | Delete
isVisible,
[640] Fix | Delete
id,
[641] Fix | Delete
idBase,
[642] Fix | Delete
instance,
[643] Fix | Delete
isWide,
[644] Fix | Delete
onChangeInstance,
[645] Fix | Delete
onChangeHasPreview
[646] Fix | Delete
}) {
[647] Fix | Delete
const ref = (0,external_wp_element_namespaceObject.useRef)();
[648] Fix | Delete
const isMediumLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('small');
[649] Fix | Delete
[650] Fix | Delete
// We only want to remount the control when the instance changes
[651] Fix | Delete
// *externally*. For example, if the user performs an undo. To do this, we
[652] Fix | Delete
// keep track of changes made to instance by the control itself and then
[653] Fix | Delete
// ignore those.
[654] Fix | Delete
const outgoingInstances = (0,external_wp_element_namespaceObject.useRef)(new Set());
[655] Fix | Delete
const incomingInstances = (0,external_wp_element_namespaceObject.useRef)(new Set());
[656] Fix | Delete
const {
[657] Fix | Delete
createNotice
[658] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
[659] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[660] Fix | Delete
if (incomingInstances.current.has(instance)) {
[661] Fix | Delete
incomingInstances.current.delete(instance);
[662] Fix | Delete
return;
[663] Fix | Delete
}
[664] Fix | Delete
const control = new Control({
[665] Fix | Delete
id,
[666] Fix | Delete
idBase,
[667] Fix | Delete
instance,
[668] Fix | Delete
onChangeInstance(nextInstance) {
[669] Fix | Delete
outgoingInstances.current.add(instance);
[670] Fix | Delete
incomingInstances.current.add(nextInstance);
[671] Fix | Delete
onChangeInstance(nextInstance);
[672] Fix | Delete
},
[673] Fix | Delete
onChangeHasPreview,
[674] Fix | Delete
onError(error) {
[675] Fix | Delete
window.console.error(error);
[676] Fix | Delete
createNotice('error', (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: the name of the affected block. */
[677] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('The "%s" block was affected by errors and may not function properly. Check the developer tools for more details.'), idBase || id));
[678] Fix | Delete
}
[679] Fix | Delete
});
[680] Fix | Delete
ref.current.appendChild(control.element);
[681] Fix | Delete
return () => {
[682] Fix | Delete
if (outgoingInstances.current.has(instance)) {
[683] Fix | Delete
outgoingInstances.current.delete(instance);
[684] Fix | Delete
return;
[685] Fix | Delete
}
[686] Fix | Delete
control.destroy();
[687] Fix | Delete
};
[688] Fix | Delete
}, [id, idBase, instance, onChangeInstance, onChangeHasPreview, isMediumLargeViewport]);
[689] Fix | Delete
if (isWide && isMediumLargeViewport) {
[690] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[691] Fix | Delete
className: dist_clsx({
[692] Fix | Delete
'wp-block-legacy-widget__container': isVisible
[693] Fix | Delete
}),
[694] Fix | Delete
children: [isVisible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", {
[695] Fix | Delete
className: "wp-block-legacy-widget__edit-form-title",
[696] Fix | Delete
children: title
[697] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, {
[698] Fix | Delete
focusOnMount: false,
[699] Fix | Delete
placement: "right",
[700] Fix | Delete
offset: 32,
[701] Fix | Delete
resize: false,
[702] Fix | Delete
flip: false,
[703] Fix | Delete
shift: true,
[704] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[705] Fix | Delete
ref: ref,
[706] Fix | Delete
className: "wp-block-legacy-widget__edit-form",
[707] Fix | Delete
hidden: !isVisible
[708] Fix | Delete
})
[709] Fix | Delete
})]
[710] Fix | Delete
});
[711] Fix | Delete
}
[712] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[713] Fix | Delete
ref: ref,
[714] Fix | Delete
className: "wp-block-legacy-widget__edit-form",
[715] Fix | Delete
hidden: !isVisible,
[716] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", {
[717] Fix | Delete
className: "wp-block-legacy-widget__edit-form-title",
[718] Fix | Delete
children: title
[719] Fix | Delete
})
[720] Fix | Delete
});
[721] Fix | Delete
}
[722] Fix | Delete
[723] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/preview.js
[724] Fix | Delete
/**
[725] Fix | Delete
* External dependencies
[726] Fix | Delete
*/
[727] Fix | Delete
[728] Fix | Delete
[729] Fix | Delete
/**
[730] Fix | Delete
* WordPress dependencies
[731] Fix | Delete
*/
[732] Fix | Delete
[733] Fix | Delete
[734] Fix | Delete
[735] Fix | Delete
[736] Fix | Delete
[737] Fix | Delete
[738] Fix | Delete
[739] Fix | Delete
[740] Fix | Delete
function Preview({
[741] Fix | Delete
idBase,
[742] Fix | Delete
instance,
[743] Fix | Delete
isVisible
[744] Fix | Delete
}) {
[745] Fix | Delete
const [isLoaded, setIsLoaded] = (0,external_wp_element_namespaceObject.useState)(false);
[746] Fix | Delete
const [srcDoc, setSrcDoc] = (0,external_wp_element_namespaceObject.useState)('');
[747] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[748] Fix | Delete
const abortController = typeof window.AbortController === 'undefined' ? undefined : new window.AbortController();
[749] Fix | Delete
async function fetchPreviewHTML() {
[750] Fix | Delete
const restRoute = `/wp/v2/widget-types/${idBase}/render`;
[751] Fix | Delete
return await external_wp_apiFetch_default()({
[752] Fix | Delete
path: restRoute,
[753] Fix | Delete
method: 'POST',
[754] Fix | Delete
signal: abortController?.signal,
[755] Fix | Delete
data: instance ? {
[756] Fix | Delete
instance
[757] Fix | Delete
} : {}
[758] Fix | Delete
});
[759] Fix | Delete
}
[760] Fix | Delete
fetchPreviewHTML().then(response => {
[761] Fix | Delete
setSrcDoc(response.preview);
[762] Fix | Delete
}).catch(error => {
[763] Fix | Delete
if ('AbortError' === error.name) {
[764] Fix | Delete
// We don't want to log aborted requests.
[765] Fix | Delete
return;
[766] Fix | Delete
}
[767] Fix | Delete
throw error;
[768] Fix | Delete
});
[769] Fix | Delete
return () => abortController?.abort();
[770] Fix | Delete
}, [idBase, instance]);
[771] Fix | Delete
[772] Fix | Delete
// Resize the iframe on either the load event, or when the iframe becomes visible.
[773] Fix | Delete
const ref = (0,external_wp_compose_namespaceObject.useRefEffect)(iframe => {
[774] Fix | Delete
// Only set height if the iframe is loaded,
[775] Fix | Delete
// or it will grow to an unexpected large height in Safari if it's hidden initially.
[776] Fix | Delete
if (!isLoaded) {
[777] Fix | Delete
return;
[778] Fix | Delete
}
[779] Fix | Delete
// If the preview frame has another origin then this won't work.
[780] Fix | Delete
// One possible solution is to add custom script to call `postMessage` in the preview frame.
[781] Fix | Delete
// Or, better yet, we migrate away from iframe.
[782] Fix | Delete
function setHeight() {
[783] Fix | Delete
var _iframe$contentDocume, _iframe$contentDocume2;
[784] Fix | Delete
// Pick the maximum of these two values to account for margin collapsing.
[785] Fix | Delete
const height = Math.max((_iframe$contentDocume = iframe.contentDocument.documentElement?.offsetHeight) !== null && _iframe$contentDocume !== void 0 ? _iframe$contentDocume : 0, (_iframe$contentDocume2 = iframe.contentDocument.body?.offsetHeight) !== null && _iframe$contentDocume2 !== void 0 ? _iframe$contentDocume2 : 0);
[786] Fix | Delete
[787] Fix | Delete
// Fallback to a height of 100px if the height cannot be determined.
[788] Fix | Delete
// This ensures the block is still selectable. 100px should hopefully
[789] Fix | Delete
// be not so big that it's annoying, and not so small that nothing
[790] Fix | Delete
// can be seen.
[791] Fix | Delete
iframe.style.height = `${height !== 0 ? height : 100}px`;
[792] Fix | Delete
}
[793] Fix | Delete
const {
[794] Fix | Delete
IntersectionObserver
[795] Fix | Delete
} = iframe.ownerDocument.defaultView;
[796] Fix | Delete
[797] Fix | Delete
// Observe for intersections that might cause a change in the height of
[798] Fix | Delete
// the iframe, e.g. a Widget Area becoming expanded.
[799] Fix | Delete
const intersectionObserver = new IntersectionObserver(([entry]) => {
[800] Fix | Delete
if (entry.isIntersecting) {
[801] Fix | Delete
setHeight();
[802] Fix | Delete
}
[803] Fix | Delete
}, {
[804] Fix | Delete
threshold: 1
[805] Fix | Delete
});
[806] Fix | Delete
intersectionObserver.observe(iframe);
[807] Fix | Delete
iframe.addEventListener('load', setHeight);
[808] Fix | Delete
return () => {
[809] Fix | Delete
intersectionObserver.disconnect();
[810] Fix | Delete
iframe.removeEventListener('load', setHeight);
[811] Fix | Delete
};
[812] Fix | Delete
}, [isLoaded]);
[813] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[814] Fix | Delete
children: [isVisible && !isLoaded && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
[815] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})
[816] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[817] Fix | Delete
className: dist_clsx('wp-block-legacy-widget__edit-preview', {
[818] Fix | Delete
'is-offscreen': !isVisible || !isLoaded
[819] Fix | Delete
}),
[820] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, {
[821] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("iframe", {
[822] Fix | Delete
ref: ref,
[823] Fix | Delete
className: "wp-block-legacy-widget__edit-preview-iframe",
[824] Fix | Delete
tabIndex: "-1",
[825] Fix | Delete
title: (0,external_wp_i18n_namespaceObject.__)('Legacy Widget Preview'),
[826] Fix | Delete
srcDoc: srcDoc,
[827] Fix | Delete
onLoad: event => {
[828] Fix | Delete
// To hide the scrollbars of the preview frame for some edge cases,
[829] Fix | Delete
// such as negative margins in the Gallery Legacy Widget.
[830] Fix | Delete
// It can't be scrolled anyway.
[831] Fix | Delete
// TODO: Ideally, this should be fixed in core.
[832] Fix | Delete
event.target.contentDocument.body.style.overflow = 'hidden';
[833] Fix | Delete
setIsLoaded(true);
[834] Fix | Delete
},
[835] Fix | Delete
height: 100
[836] Fix | Delete
})
[837] Fix | Delete
})
[838] Fix | Delete
})]
[839] Fix | Delete
});
[840] Fix | Delete
}
[841] Fix | Delete
[842] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/no-preview.js
[843] Fix | Delete
/**
[844] Fix | Delete
* WordPress dependencies
[845] Fix | Delete
*/
[846] Fix | Delete
[847] Fix | Delete
[848] Fix | Delete
[849] Fix | Delete
function NoPreview({
[850] Fix | Delete
name
[851] Fix | Delete
}) {
[852] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[853] Fix | Delete
className: "wp-block-legacy-widget__edit-no-preview",
[854] Fix | Delete
children: [name && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", {
[855] Fix | Delete
children: name
[856] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
[857] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('No preview available.')
[858] Fix | Delete
})]
[859] Fix | Delete
});
[860] Fix | Delete
}
[861] Fix | Delete
[862] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/convert-to-blocks-button.js
[863] Fix | Delete
/**
[864] Fix | Delete
* WordPress dependencies
[865] Fix | Delete
*/
[866] Fix | Delete
[867] Fix | Delete
[868] Fix | Delete
[869] Fix | Delete
[870] Fix | Delete
[871] Fix | Delete
[872] Fix | Delete
function ConvertToBlocksButton({
[873] Fix | Delete
clientId,
[874] Fix | Delete
rawInstance
[875] Fix | Delete
}) {
[876] Fix | Delete
const {
[877] Fix | Delete
replaceBlocks
[878] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
[879] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
[880] Fix | Delete
onClick: () => {
[881] Fix | Delete
if (rawInstance.title) {
[882] Fix | Delete
replaceBlocks(clientId, [(0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
[883] Fix | Delete
content: rawInstance.title
[884] Fix | Delete
}), ...(0,external_wp_blocks_namespaceObject.rawHandler)({
[885] Fix | Delete
HTML: rawInstance.text
[886] Fix | Delete
})]);
[887] Fix | Delete
} else {
[888] Fix | Delete
replaceBlocks(clientId, (0,external_wp_blocks_namespaceObject.rawHandler)({
[889] Fix | Delete
HTML: rawInstance.text
[890] Fix | Delete
}));
[891] Fix | Delete
}
[892] Fix | Delete
},
[893] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Convert to blocks')
[894] Fix | Delete
});
[895] Fix | Delete
}
[896] Fix | Delete
[897] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/index.js
[898] Fix | Delete
/**
[899] Fix | Delete
* External dependencies
[900] Fix | Delete
*/
[901] Fix | Delete
[902] Fix | Delete
[903] Fix | Delete
/**
[904] Fix | Delete
* WordPress dependencies
[905] Fix | Delete
*/
[906] Fix | Delete
[907] Fix | Delete
[908] Fix | Delete
[909] Fix | Delete
[910] Fix | Delete
[911] Fix | Delete
[912] Fix | Delete
[913] Fix | Delete
[914] Fix | Delete
/**
[915] Fix | Delete
* Internal dependencies
[916] Fix | Delete
*/
[917] Fix | Delete
[918] Fix | Delete
[919] Fix | Delete
[920] Fix | Delete
[921] Fix | Delete
[922] Fix | Delete
[923] Fix | Delete
[924] Fix | Delete
[925] Fix | Delete
[926] Fix | Delete
function Edit(props) {
[927] Fix | Delete
const {
[928] Fix | Delete
id,
[929] Fix | Delete
idBase
[930] Fix | Delete
} = props.attributes;
[931] Fix | Delete
const {
[932] Fix | Delete
isWide = false
[933] Fix | Delete
} = props;
[934] Fix | Delete
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
[935] Fix | Delete
className: dist_clsx({
[936] Fix | Delete
'is-wide-widget': isWide
[937] Fix | Delete
})
[938] Fix | Delete
});
[939] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[940] Fix | Delete
...blockProps,
[941] Fix | Delete
children: !id && !idBase ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Empty, {
[942] Fix | Delete
...props
[943] Fix | Delete
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NotEmpty, {
[944] Fix | Delete
...props
[945] Fix | Delete
})
[946] Fix | Delete
});
[947] Fix | Delete
}
[948] Fix | Delete
function Empty({
[949] Fix | Delete
attributes: {
[950] Fix | Delete
id,
[951] Fix | Delete
idBase
[952] Fix | Delete
},
[953] Fix | Delete
setAttributes
[954] Fix | Delete
}) {
[955] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
[956] Fix | Delete
icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, {
[957] Fix | Delete
icon: library_brush
[958] Fix | Delete
}),
[959] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Legacy Widget'),
[960] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, {
[961] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, {
[962] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WidgetTypeSelector, {
[963] Fix | Delete
selectedId: id !== null && id !== void 0 ? id : idBase,
[964] Fix | Delete
onSelect: ({
[965] Fix | Delete
selectedId,
[966] Fix | Delete
isMulti
[967] Fix | Delete
}) => {
[968] Fix | Delete
if (!selectedId) {
[969] Fix | Delete
setAttributes({
[970] Fix | Delete
id: null,
[971] Fix | Delete
idBase: null,
[972] Fix | Delete
instance: null
[973] Fix | Delete
});
[974] Fix | Delete
} else if (isMulti) {
[975] Fix | Delete
setAttributes({
[976] Fix | Delete
id: null,
[977] Fix | Delete
idBase: selectedId,
[978] Fix | Delete
instance: {}
[979] Fix | Delete
});
[980] Fix | Delete
} else {
[981] Fix | Delete
setAttributes({
[982] Fix | Delete
id: selectedId,
[983] Fix | Delete
idBase: null,
[984] Fix | Delete
instance: null
[985] Fix | Delete
});
[986] Fix | Delete
}
[987] Fix | Delete
}
[988] Fix | Delete
})
[989] Fix | Delete
})
[990] Fix | Delete
})
[991] Fix | Delete
});
[992] Fix | Delete
}
[993] Fix | Delete
function NotEmpty({
[994] Fix | Delete
attributes: {
[995] Fix | Delete
id,
[996] Fix | Delete
idBase,
[997] Fix | Delete
instance
[998] Fix | Delete
},
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function