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: block-editor.js
setClipboardBlocks(event, blocks, registry);
[43500] Fix | Delete
}
[43501] Fix | Delete
}
[43502] Fix | Delete
if (event.type === 'cut') {
[43503] Fix | Delete
// We need to also check if at the start we needed to
[43504] Fix | Delete
// expand the selection, as in this point we might have
[43505] Fix | Delete
// programmatically fully selected the blocks above.
[43506] Fix | Delete
if (shouldHandleWholeBlocks && !expandSelectionIsNeeded) {
[43507] Fix | Delete
removeBlocks(selectedBlockClientIds);
[43508] Fix | Delete
} else {
[43509] Fix | Delete
event.target.ownerDocument.activeElement.contentEditable = false;
[43510] Fix | Delete
__unstableDeleteSelection();
[43511] Fix | Delete
}
[43512] Fix | Delete
} else if (event.type === 'paste') {
[43513] Fix | Delete
const {
[43514] Fix | Delete
__experimentalCanUserUseUnfilteredHTML: canUserUseUnfilteredHTML
[43515] Fix | Delete
} = getSettings();
[43516] Fix | Delete
const isInternal = event.clipboardData.getData('rich-text') === 'true';
[43517] Fix | Delete
if (isInternal) {
[43518] Fix | Delete
return;
[43519] Fix | Delete
}
[43520] Fix | Delete
const {
[43521] Fix | Delete
plainText,
[43522] Fix | Delete
html,
[43523] Fix | Delete
files
[43524] Fix | Delete
} = getPasteEventData(event);
[43525] Fix | Delete
const isFullySelected = __unstableIsFullySelected();
[43526] Fix | Delete
let blocks = [];
[43527] Fix | Delete
if (files.length) {
[43528] Fix | Delete
const fromTransforms = (0,external_wp_blocks_namespaceObject.getBlockTransforms)('from');
[43529] Fix | Delete
blocks = files.reduce((accumulator, file) => {
[43530] Fix | Delete
const transformation = (0,external_wp_blocks_namespaceObject.findTransform)(fromTransforms, transform => transform.type === 'files' && transform.isMatch([file]));
[43531] Fix | Delete
if (transformation) {
[43532] Fix | Delete
accumulator.push(transformation.transform([file]));
[43533] Fix | Delete
}
[43534] Fix | Delete
return accumulator;
[43535] Fix | Delete
}, []).flat();
[43536] Fix | Delete
} else {
[43537] Fix | Delete
blocks = (0,external_wp_blocks_namespaceObject.pasteHandler)({
[43538] Fix | Delete
HTML: html,
[43539] Fix | Delete
plainText,
[43540] Fix | Delete
mode: isFullySelected ? 'BLOCKS' : 'AUTO',
[43541] Fix | Delete
canUserUseUnfilteredHTML
[43542] Fix | Delete
});
[43543] Fix | Delete
}
[43544] Fix | Delete
[43545] Fix | Delete
// Inline paste: let rich text handle it.
[43546] Fix | Delete
if (typeof blocks === 'string') {
[43547] Fix | Delete
return;
[43548] Fix | Delete
}
[43549] Fix | Delete
if (isFullySelected) {
[43550] Fix | Delete
replaceBlocks(selectedBlockClientIds, blocks, blocks.length - 1, -1);
[43551] Fix | Delete
event.preventDefault();
[43552] Fix | Delete
return;
[43553] Fix | Delete
}
[43554] Fix | Delete
[43555] Fix | Delete
// If a block doesn't support splitting, let rich text paste
[43556] Fix | Delete
// inline.
[43557] Fix | Delete
if (!hasMultiSelection() && !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(getBlockName(selectedBlockClientIds[0]), 'splitting', false) && !event.__deprecatedOnSplit) {
[43558] Fix | Delete
return;
[43559] Fix | Delete
}
[43560] Fix | Delete
const [firstSelectedClientId] = selectedBlockClientIds;
[43561] Fix | Delete
const rootClientId = getBlockRootClientId(firstSelectedClientId);
[43562] Fix | Delete
const newBlocks = [];
[43563] Fix | Delete
for (const block of blocks) {
[43564] Fix | Delete
if (canInsertBlockType(block.name, rootClientId)) {
[43565] Fix | Delete
newBlocks.push(block);
[43566] Fix | Delete
} else {
[43567] Fix | Delete
// If a block cannot be inserted in a root block, try
[43568] Fix | Delete
// converting it to that root block type and insert the
[43569] Fix | Delete
// inner blocks.
[43570] Fix | Delete
// Example: paragraphs cannot be inserted into a list,
[43571] Fix | Delete
// so convert the paragraphs to a list for list items.
[43572] Fix | Delete
const rootBlockName = getBlockName(rootClientId);
[43573] Fix | Delete
const switchedBlocks = block.name !== rootBlockName ? (0,external_wp_blocks_namespaceObject.switchToBlockType)(block, rootBlockName) : [block];
[43574] Fix | Delete
if (!switchedBlocks) {
[43575] Fix | Delete
return;
[43576] Fix | Delete
}
[43577] Fix | Delete
for (const switchedBlock of switchedBlocks) {
[43578] Fix | Delete
for (const innerBlock of switchedBlock.innerBlocks) {
[43579] Fix | Delete
newBlocks.push(innerBlock);
[43580] Fix | Delete
}
[43581] Fix | Delete
}
[43582] Fix | Delete
}
[43583] Fix | Delete
}
[43584] Fix | Delete
__unstableSplitSelection(newBlocks);
[43585] Fix | Delete
event.preventDefault();
[43586] Fix | Delete
}
[43587] Fix | Delete
}
[43588] Fix | Delete
node.ownerDocument.addEventListener('copy', handler);
[43589] Fix | Delete
node.ownerDocument.addEventListener('cut', handler);
[43590] Fix | Delete
node.ownerDocument.addEventListener('paste', handler);
[43591] Fix | Delete
return () => {
[43592] Fix | Delete
node.ownerDocument.removeEventListener('copy', handler);
[43593] Fix | Delete
node.ownerDocument.removeEventListener('cut', handler);
[43594] Fix | Delete
node.ownerDocument.removeEventListener('paste', handler);
[43595] Fix | Delete
};
[43596] Fix | Delete
}, []);
[43597] Fix | Delete
}
[43598] Fix | Delete
[43599] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/index.js
[43600] Fix | Delete
/**
[43601] Fix | Delete
* External dependencies
[43602] Fix | Delete
*/
[43603] Fix | Delete
[43604] Fix | Delete
[43605] Fix | Delete
/**
[43606] Fix | Delete
* WordPress dependencies
[43607] Fix | Delete
*/
[43608] Fix | Delete
[43609] Fix | Delete
[43610] Fix | Delete
[43611] Fix | Delete
[43612] Fix | Delete
[43613] Fix | Delete
/**
[43614] Fix | Delete
* Internal dependencies
[43615] Fix | Delete
*/
[43616] Fix | Delete
[43617] Fix | Delete
[43618] Fix | Delete
[43619] Fix | Delete
[43620] Fix | Delete
[43621] Fix | Delete
[43622] Fix | Delete
[43623] Fix | Delete
[43624] Fix | Delete
[43625] Fix | Delete
[43626] Fix | Delete
[43627] Fix | Delete
[43628] Fix | Delete
[43629] Fix | Delete
function useWritingFlow() {
[43630] Fix | Delete
const [before, ref, after] = useTabNav();
[43631] Fix | Delete
const hasMultiSelection = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).hasMultiSelection(), []);
[43632] Fix | Delete
return [before, (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, useClipboardHandler(), useInput(), useDragSelection(), useSelectionObserver(), useClickSelection(), useMultiSelection(), useSelectAll(), useArrowNav(), (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
[43633] Fix | Delete
node.tabIndex = 0;
[43634] Fix | Delete
if (!hasMultiSelection) {
[43635] Fix | Delete
return;
[43636] Fix | Delete
}
[43637] Fix | Delete
node.classList.add('has-multi-selection');
[43638] Fix | Delete
node.setAttribute('aria-label', (0,external_wp_i18n_namespaceObject.__)('Multiple selected blocks'));
[43639] Fix | Delete
return () => {
[43640] Fix | Delete
node.classList.remove('has-multi-selection');
[43641] Fix | Delete
node.removeAttribute('aria-label');
[43642] Fix | Delete
};
[43643] Fix | Delete
}, [hasMultiSelection])]), after];
[43644] Fix | Delete
}
[43645] Fix | Delete
function WritingFlow({
[43646] Fix | Delete
children,
[43647] Fix | Delete
...props
[43648] Fix | Delete
}, forwardedRef) {
[43649] Fix | Delete
const [before, ref, after] = useWritingFlow();
[43650] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[43651] Fix | Delete
children: [before, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[43652] Fix | Delete
...props,
[43653] Fix | Delete
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, forwardedRef]),
[43654] Fix | Delete
className: dist_clsx(props.className, 'block-editor-writing-flow'),
[43655] Fix | Delete
children: children
[43656] Fix | Delete
}), after]
[43657] Fix | Delete
});
[43658] Fix | Delete
}
[43659] Fix | Delete
[43660] Fix | Delete
/**
[43661] Fix | Delete
* Handles selection and navigation across blocks. This component should be
[43662] Fix | Delete
* wrapped around BlockList.
[43663] Fix | Delete
*
[43664] Fix | Delete
* @param {Object} props Component properties.
[43665] Fix | Delete
* @param {Element} props.children Children to be rendered.
[43666] Fix | Delete
*/
[43667] Fix | Delete
/* harmony default export */ const writing_flow = ((0,external_wp_element_namespaceObject.forwardRef)(WritingFlow));
[43668] Fix | Delete
[43669] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/iframe/get-compatibility-styles.js
[43670] Fix | Delete
let compatibilityStyles = null;
[43671] Fix | Delete
[43672] Fix | Delete
/**
[43673] Fix | Delete
* Returns a list of stylesheets that target the editor canvas. A stylesheet is
[43674] Fix | Delete
* considered targetting the editor a canvas if it contains the
[43675] Fix | Delete
* `editor-styles-wrapper`, `wp-block`, or `wp-block-*` class selectors.
[43676] Fix | Delete
*
[43677] Fix | Delete
* Ideally, this hook should be removed in the future and styles should be added
[43678] Fix | Delete
* explicitly as editor styles.
[43679] Fix | Delete
*/
[43680] Fix | Delete
function getCompatibilityStyles() {
[43681] Fix | Delete
if (compatibilityStyles) {
[43682] Fix | Delete
return compatibilityStyles;
[43683] Fix | Delete
}
[43684] Fix | Delete
[43685] Fix | Delete
// Only memoize the result once on load, since these stylesheets should not
[43686] Fix | Delete
// change.
[43687] Fix | Delete
compatibilityStyles = Array.from(document.styleSheets).reduce((accumulator, styleSheet) => {
[43688] Fix | Delete
try {
[43689] Fix | Delete
// May fail for external styles.
[43690] Fix | Delete
// eslint-disable-next-line no-unused-expressions
[43691] Fix | Delete
styleSheet.cssRules;
[43692] Fix | Delete
} catch (e) {
[43693] Fix | Delete
return accumulator;
[43694] Fix | Delete
}
[43695] Fix | Delete
const {
[43696] Fix | Delete
ownerNode,
[43697] Fix | Delete
cssRules
[43698] Fix | Delete
} = styleSheet;
[43699] Fix | Delete
[43700] Fix | Delete
// Stylesheet is added by another stylesheet. See
[43701] Fix | Delete
// https://developer.mozilla.org/en-US/docs/Web/API/StyleSheet/ownerNode#notes.
[43702] Fix | Delete
if (ownerNode === null) {
[43703] Fix | Delete
return accumulator;
[43704] Fix | Delete
}
[43705] Fix | Delete
if (!cssRules) {
[43706] Fix | Delete
return accumulator;
[43707] Fix | Delete
}
[43708] Fix | Delete
[43709] Fix | Delete
// Don't try to add the reset styles, which were removed as a dependency
[43710] Fix | Delete
// from `edit-blocks` for the iframe since we don't need to reset admin
[43711] Fix | Delete
// styles.
[43712] Fix | Delete
if (ownerNode.id === 'wp-reset-editor-styles-css') {
[43713] Fix | Delete
return accumulator;
[43714] Fix | Delete
}
[43715] Fix | Delete
[43716] Fix | Delete
// Don't try to add styles without ID. Styles enqueued via the WP dependency system will always have IDs.
[43717] Fix | Delete
if (!ownerNode.id) {
[43718] Fix | Delete
return accumulator;
[43719] Fix | Delete
}
[43720] Fix | Delete
function matchFromRules(_cssRules) {
[43721] Fix | Delete
return Array.from(_cssRules).find(({
[43722] Fix | Delete
selectorText,
[43723] Fix | Delete
conditionText,
[43724] Fix | Delete
cssRules: __cssRules
[43725] Fix | Delete
}) => {
[43726] Fix | Delete
// If the rule is conditional then it will not have selector text.
[43727] Fix | Delete
// Recurse into child CSS ruleset to determine selector eligibility.
[43728] Fix | Delete
if (conditionText) {
[43729] Fix | Delete
return matchFromRules(__cssRules);
[43730] Fix | Delete
}
[43731] Fix | Delete
return selectorText && (selectorText.includes('.editor-styles-wrapper') || selectorText.includes('.wp-block'));
[43732] Fix | Delete
});
[43733] Fix | Delete
}
[43734] Fix | Delete
if (matchFromRules(cssRules)) {
[43735] Fix | Delete
const isInline = ownerNode.tagName === 'STYLE';
[43736] Fix | Delete
if (isInline) {
[43737] Fix | Delete
// If the current target is inline,
[43738] Fix | Delete
// it could be a dependency of an existing stylesheet.
[43739] Fix | Delete
// Look for that dependency and add it BEFORE the current target.
[43740] Fix | Delete
const mainStylesCssId = ownerNode.id.replace('-inline-css', '-css');
[43741] Fix | Delete
const mainStylesElement = document.getElementById(mainStylesCssId);
[43742] Fix | Delete
if (mainStylesElement) {
[43743] Fix | Delete
accumulator.push(mainStylesElement.cloneNode(true));
[43744] Fix | Delete
}
[43745] Fix | Delete
}
[43746] Fix | Delete
accumulator.push(ownerNode.cloneNode(true));
[43747] Fix | Delete
if (!isInline) {
[43748] Fix | Delete
// If the current target is not inline,
[43749] Fix | Delete
// we still look for inline styles that could be relevant for the current target.
[43750] Fix | Delete
// If they exist, add them AFTER the current target.
[43751] Fix | Delete
const inlineStylesCssId = ownerNode.id.replace('-css', '-inline-css');
[43752] Fix | Delete
const inlineStylesElement = document.getElementById(inlineStylesCssId);
[43753] Fix | Delete
if (inlineStylesElement) {
[43754] Fix | Delete
accumulator.push(inlineStylesElement.cloneNode(true));
[43755] Fix | Delete
}
[43756] Fix | Delete
}
[43757] Fix | Delete
}
[43758] Fix | Delete
return accumulator;
[43759] Fix | Delete
}, []);
[43760] Fix | Delete
return compatibilityStyles;
[43761] Fix | Delete
}
[43762] Fix | Delete
[43763] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/iframe/index.js
[43764] Fix | Delete
/**
[43765] Fix | Delete
* External dependencies
[43766] Fix | Delete
*/
[43767] Fix | Delete
[43768] Fix | Delete
[43769] Fix | Delete
/**
[43770] Fix | Delete
* WordPress dependencies
[43771] Fix | Delete
*/
[43772] Fix | Delete
[43773] Fix | Delete
[43774] Fix | Delete
[43775] Fix | Delete
[43776] Fix | Delete
[43777] Fix | Delete
[43778] Fix | Delete
/**
[43779] Fix | Delete
* Internal dependencies
[43780] Fix | Delete
*/
[43781] Fix | Delete
[43782] Fix | Delete
[43783] Fix | Delete
[43784] Fix | Delete
[43785] Fix | Delete
[43786] Fix | Delete
[43787] Fix | Delete
[43788] Fix | Delete
function bubbleEvent(event, Constructor, frame) {
[43789] Fix | Delete
const init = {};
[43790] Fix | Delete
for (const key in event) {
[43791] Fix | Delete
init[key] = event[key];
[43792] Fix | Delete
}
[43793] Fix | Delete
[43794] Fix | Delete
// Check if the event is a MouseEvent generated within the iframe.
[43795] Fix | Delete
// If so, adjust the coordinates to be relative to the position of
[43796] Fix | Delete
// the iframe. This ensures that components such as Draggable
[43797] Fix | Delete
// receive coordinates relative to the window, instead of relative
[43798] Fix | Delete
// to the iframe. Without this, the Draggable event handler would
[43799] Fix | Delete
// result in components "jumping" position as soon as the user
[43800] Fix | Delete
// drags over the iframe.
[43801] Fix | Delete
if (event instanceof frame.contentDocument.defaultView.MouseEvent) {
[43802] Fix | Delete
const rect = frame.getBoundingClientRect();
[43803] Fix | Delete
init.clientX += rect.left;
[43804] Fix | Delete
init.clientY += rect.top;
[43805] Fix | Delete
}
[43806] Fix | Delete
const newEvent = new Constructor(event.type, init);
[43807] Fix | Delete
if (init.defaultPrevented) {
[43808] Fix | Delete
newEvent.preventDefault();
[43809] Fix | Delete
}
[43810] Fix | Delete
const cancelled = !frame.dispatchEvent(newEvent);
[43811] Fix | Delete
if (cancelled) {
[43812] Fix | Delete
event.preventDefault();
[43813] Fix | Delete
}
[43814] Fix | Delete
}
[43815] Fix | Delete
[43816] Fix | Delete
/**
[43817] Fix | Delete
* Bubbles some event types (keydown, keypress, and dragover) to parent document
[43818] Fix | Delete
* document to ensure that the keyboard shortcuts and drag and drop work.
[43819] Fix | Delete
*
[43820] Fix | Delete
* Ideally, we should remove event bubbling in the future. Keyboard shortcuts
[43821] Fix | Delete
* should be context dependent, e.g. actions on blocks like Cmd+A should not
[43822] Fix | Delete
* work globally outside the block editor.
[43823] Fix | Delete
*
[43824] Fix | Delete
* @param {Document} iframeDocument Document to attach listeners to.
[43825] Fix | Delete
*/
[43826] Fix | Delete
function useBubbleEvents(iframeDocument) {
[43827] Fix | Delete
return (0,external_wp_compose_namespaceObject.useRefEffect)(() => {
[43828] Fix | Delete
const {
[43829] Fix | Delete
defaultView
[43830] Fix | Delete
} = iframeDocument;
[43831] Fix | Delete
if (!defaultView) {
[43832] Fix | Delete
return;
[43833] Fix | Delete
}
[43834] Fix | Delete
const {
[43835] Fix | Delete
frameElement
[43836] Fix | Delete
} = defaultView;
[43837] Fix | Delete
const html = iframeDocument.documentElement;
[43838] Fix | Delete
const eventTypes = ['dragover', 'mousemove'];
[43839] Fix | Delete
const handlers = {};
[43840] Fix | Delete
for (const name of eventTypes) {
[43841] Fix | Delete
handlers[name] = event => {
[43842] Fix | Delete
const prototype = Object.getPrototypeOf(event);
[43843] Fix | Delete
const constructorName = prototype.constructor.name;
[43844] Fix | Delete
const Constructor = window[constructorName];
[43845] Fix | Delete
bubbleEvent(event, Constructor, frameElement);
[43846] Fix | Delete
};
[43847] Fix | Delete
html.addEventListener(name, handlers[name]);
[43848] Fix | Delete
}
[43849] Fix | Delete
return () => {
[43850] Fix | Delete
for (const name of eventTypes) {
[43851] Fix | Delete
html.removeEventListener(name, handlers[name]);
[43852] Fix | Delete
}
[43853] Fix | Delete
};
[43854] Fix | Delete
});
[43855] Fix | Delete
}
[43856] Fix | Delete
function Iframe({
[43857] Fix | Delete
contentRef,
[43858] Fix | Delete
children,
[43859] Fix | Delete
tabIndex = 0,
[43860] Fix | Delete
scale = 1,
[43861] Fix | Delete
frameSize = 0,
[43862] Fix | Delete
readonly,
[43863] Fix | Delete
forwardedRef: ref,
[43864] Fix | Delete
title = (0,external_wp_i18n_namespaceObject.__)('Editor canvas'),
[43865] Fix | Delete
...props
[43866] Fix | Delete
}) {
[43867] Fix | Delete
const {
[43868] Fix | Delete
resolvedAssets,
[43869] Fix | Delete
isPreviewMode
[43870] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[43871] Fix | Delete
const {
[43872] Fix | Delete
getSettings
[43873] Fix | Delete
} = select(store);
[43874] Fix | Delete
const settings = getSettings();
[43875] Fix | Delete
return {
[43876] Fix | Delete
resolvedAssets: settings.__unstableResolvedAssets,
[43877] Fix | Delete
isPreviewMode: settings.__unstableIsPreviewMode
[43878] Fix | Delete
};
[43879] Fix | Delete
}, []);
[43880] Fix | Delete
const {
[43881] Fix | Delete
styles = '',
[43882] Fix | Delete
scripts = ''
[43883] Fix | Delete
} = resolvedAssets;
[43884] Fix | Delete
const [iframeDocument, setIframeDocument] = (0,external_wp_element_namespaceObject.useState)();
[43885] Fix | Delete
const prevContainerWidth = (0,external_wp_element_namespaceObject.useRef)();
[43886] Fix | Delete
const [bodyClasses, setBodyClasses] = (0,external_wp_element_namespaceObject.useState)([]);
[43887] Fix | Delete
const clearerRef = useBlockSelectionClearer();
[43888] Fix | Delete
const [before, writingFlowRef, after] = useWritingFlow();
[43889] Fix | Delete
const [contentResizeListener, {
[43890] Fix | Delete
height: contentHeight
[43891] Fix | Delete
}] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
[43892] Fix | Delete
const [containerResizeListener, {
[43893] Fix | Delete
width: containerWidth
[43894] Fix | Delete
}] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
[43895] Fix | Delete
const setRef = (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
[43896] Fix | Delete
node._load = () => {
[43897] Fix | Delete
setIframeDocument(node.contentDocument);
[43898] Fix | Delete
};
[43899] Fix | Delete
let iFrameDocument;
[43900] Fix | Delete
// Prevent the default browser action for files dropped outside of dropzones.
[43901] Fix | Delete
function preventFileDropDefault(event) {
[43902] Fix | Delete
event.preventDefault();
[43903] Fix | Delete
}
[43904] Fix | Delete
function onLoad() {
[43905] Fix | Delete
const {
[43906] Fix | Delete
contentDocument,
[43907] Fix | Delete
ownerDocument
[43908] Fix | Delete
} = node;
[43909] Fix | Delete
const {
[43910] Fix | Delete
documentElement
[43911] Fix | Delete
} = contentDocument;
[43912] Fix | Delete
iFrameDocument = contentDocument;
[43913] Fix | Delete
documentElement.classList.add('block-editor-iframe__html');
[43914] Fix | Delete
clearerRef(documentElement);
[43915] Fix | Delete
[43916] Fix | Delete
// Ideally ALL classes that are added through get_body_class should
[43917] Fix | Delete
// be added in the editor too, which we'll somehow have to get from
[43918] Fix | Delete
// the server in the future (which will run the PHP filters).
[43919] Fix | Delete
setBodyClasses(Array.from(ownerDocument.body.classList).filter(name => name.startsWith('admin-color-') || name.startsWith('post-type-') || name === 'wp-embed-responsive'));
[43920] Fix | Delete
contentDocument.dir = ownerDocument.dir;
[43921] Fix | Delete
for (const compatStyle of getCompatibilityStyles()) {
[43922] Fix | Delete
if (contentDocument.getElementById(compatStyle.id)) {
[43923] Fix | Delete
continue;
[43924] Fix | Delete
}
[43925] Fix | Delete
contentDocument.head.appendChild(compatStyle.cloneNode(true));
[43926] Fix | Delete
if (!isPreviewMode) {
[43927] Fix | Delete
// eslint-disable-next-line no-console
[43928] Fix | Delete
console.warn(`${compatStyle.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`, compatStyle);
[43929] Fix | Delete
}
[43930] Fix | Delete
}
[43931] Fix | Delete
iFrameDocument.addEventListener('dragover', preventFileDropDefault, false);
[43932] Fix | Delete
iFrameDocument.addEventListener('drop', preventFileDropDefault, false);
[43933] Fix | Delete
}
[43934] Fix | Delete
node.addEventListener('load', onLoad);
[43935] Fix | Delete
return () => {
[43936] Fix | Delete
delete node._load;
[43937] Fix | Delete
node.removeEventListener('load', onLoad);
[43938] Fix | Delete
iFrameDocument?.removeEventListener('dragover', preventFileDropDefault);
[43939] Fix | Delete
iFrameDocument?.removeEventListener('drop', preventFileDropDefault);
[43940] Fix | Delete
};
[43941] Fix | Delete
}, []);
[43942] Fix | Delete
const [iframeWindowInnerHeight, setIframeWindowInnerHeight] = (0,external_wp_element_namespaceObject.useState)();
[43943] Fix | Delete
const iframeResizeRef = (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
[43944] Fix | Delete
const nodeWindow = node.ownerDocument.defaultView;
[43945] Fix | Delete
setIframeWindowInnerHeight(nodeWindow.innerHeight);
[43946] Fix | Delete
const onResize = () => {
[43947] Fix | Delete
setIframeWindowInnerHeight(nodeWindow.innerHeight);
[43948] Fix | Delete
};
[43949] Fix | Delete
nodeWindow.addEventListener('resize', onResize);
[43950] Fix | Delete
return () => {
[43951] Fix | Delete
nodeWindow.removeEventListener('resize', onResize);
[43952] Fix | Delete
};
[43953] Fix | Delete
}, []);
[43954] Fix | Delete
const [windowInnerWidth, setWindowInnerWidth] = (0,external_wp_element_namespaceObject.useState)();
[43955] Fix | Delete
const windowResizeRef = (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
[43956] Fix | Delete
const nodeWindow = node.ownerDocument.defaultView;
[43957] Fix | Delete
setWindowInnerWidth(nodeWindow.innerWidth);
[43958] Fix | Delete
const onResize = () => {
[43959] Fix | Delete
setWindowInnerWidth(nodeWindow.innerWidth);
[43960] Fix | Delete
};
[43961] Fix | Delete
nodeWindow.addEventListener('resize', onResize);
[43962] Fix | Delete
return () => {
[43963] Fix | Delete
nodeWindow.removeEventListener('resize', onResize);
[43964] Fix | Delete
};
[43965] Fix | Delete
}, []);
[43966] Fix | Delete
const isZoomedOut = scale !== 1;
[43967] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[43968] Fix | Delete
if (!isZoomedOut) {
[43969] Fix | Delete
prevContainerWidth.current = containerWidth;
[43970] Fix | Delete
}
[43971] Fix | Delete
}, [containerWidth, isZoomedOut]);
[43972] Fix | Delete
const disabledRef = (0,external_wp_compose_namespaceObject.useDisabled)({
[43973] Fix | Delete
isDisabled: !readonly
[43974] Fix | Delete
});
[43975] Fix | Delete
const bodyRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([useBubbleEvents(iframeDocument), contentRef, clearerRef, writingFlowRef, disabledRef,
[43976] Fix | Delete
// Avoid resize listeners when not needed, these will trigger
[43977] Fix | Delete
// unnecessary re-renders when animating the iframe width, or when
[43978] Fix | Delete
// expanding preview iframes.
[43979] Fix | Delete
isZoomedOut ? iframeResizeRef : null]);
[43980] Fix | Delete
[43981] Fix | Delete
// Correct doctype is required to enable rendering in standards
[43982] Fix | Delete
// mode. Also preload the styles to avoid a flash of unstyled
[43983] Fix | Delete
// content.
[43984] Fix | Delete
const html = `<!doctype html>
[43985] Fix | Delete
<html>
[43986] Fix | Delete
<head>
[43987] Fix | Delete
<meta charset="utf-8">
[43988] Fix | Delete
<script>window.frameElement._load()</script>
[43989] Fix | Delete
<style>
[43990] Fix | Delete
html{
[43991] Fix | Delete
height: auto !important;
[43992] Fix | Delete
min-height: 100%;
[43993] Fix | Delete
}
[43994] Fix | Delete
/* Lowest specificity to not override global styles */
[43995] Fix | Delete
:where(body) {
[43996] Fix | Delete
margin: 0;
[43997] Fix | Delete
/* Default background color in case zoom out mode background
[43998] Fix | Delete
colors the html element */
[43999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function