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
background-color: white;
[44000] Fix | Delete
}
[44001] Fix | Delete
</style>
[44002] Fix | Delete
${styles}
[44003] Fix | Delete
${scripts}
[44004] Fix | Delete
</head>
[44005] Fix | Delete
<body>
[44006] Fix | Delete
<script>document.currentScript.parentElement.remove()</script>
[44007] Fix | Delete
</body>
[44008] Fix | Delete
</html>`;
[44009] Fix | Delete
const [src, cleanup] = (0,external_wp_element_namespaceObject.useMemo)(() => {
[44010] Fix | Delete
const _src = URL.createObjectURL(new window.Blob([html], {
[44011] Fix | Delete
type: 'text/html'
[44012] Fix | Delete
}));
[44013] Fix | Delete
return [_src, () => URL.revokeObjectURL(_src)];
[44014] Fix | Delete
}, [html]);
[44015] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => cleanup, [cleanup]);
[44016] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[44017] Fix | Delete
if (!iframeDocument || !isZoomedOut) {
[44018] Fix | Delete
return;
[44019] Fix | Delete
}
[44020] Fix | Delete
iframeDocument.documentElement.classList.add('is-zoomed-out');
[44021] Fix | Delete
const maxWidth = 800;
[44022] Fix | Delete
iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-scale', scale === 'default' ? Math.min(containerWidth, maxWidth) / prevContainerWidth.current : scale);
[44023] Fix | Delete
iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-frame-size', typeof frameSize === 'number' ? `${frameSize}px` : frameSize);
[44024] Fix | Delete
iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-content-height', `${contentHeight}px`);
[44025] Fix | Delete
iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-inner-height', `${iframeWindowInnerHeight}px`);
[44026] Fix | Delete
iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-container-width', `${containerWidth}px`);
[44027] Fix | Delete
iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-prev-container-width', `${prevContainerWidth.current}px`);
[44028] Fix | Delete
return () => {
[44029] Fix | Delete
iframeDocument.documentElement.classList.remove('is-zoomed-out');
[44030] Fix | Delete
iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-scale');
[44031] Fix | Delete
iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-frame-size');
[44032] Fix | Delete
iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-content-height');
[44033] Fix | Delete
iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-inner-height');
[44034] Fix | Delete
iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-container-width');
[44035] Fix | Delete
iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-prev-container-width');
[44036] Fix | Delete
};
[44037] Fix | Delete
}, [scale, frameSize, iframeDocument, iframeWindowInnerHeight, contentHeight, containerWidth, windowInnerWidth, isZoomedOut]);
[44038] Fix | Delete
[44039] Fix | Delete
// Make sure to not render the before and after focusable div elements in view
[44040] Fix | Delete
// mode. They're only needed to capture focus in edit mode.
[44041] Fix | Delete
const shouldRenderFocusCaptureElements = tabIndex >= 0 && !isPreviewMode;
[44042] Fix | Delete
const iframe = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[44043] Fix | Delete
children: [shouldRenderFocusCaptureElements && before, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("iframe", {
[44044] Fix | Delete
...props,
[44045] Fix | Delete
style: {
[44046] Fix | Delete
border: 0,
[44047] Fix | Delete
...props.style,
[44048] Fix | Delete
height: props.style?.height,
[44049] Fix | Delete
transition: 'all .3s'
[44050] Fix | Delete
},
[44051] Fix | Delete
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, setRef]),
[44052] Fix | Delete
tabIndex: tabIndex
[44053] Fix | Delete
// Correct doctype is required to enable rendering in standards
[44054] Fix | Delete
// mode. Also preload the styles to avoid a flash of unstyled
[44055] Fix | Delete
// content.
[44056] Fix | Delete
,
[44057] Fix | Delete
src: src,
[44058] Fix | Delete
title: title,
[44059] Fix | Delete
onKeyDown: event => {
[44060] Fix | Delete
if (props.onKeyDown) {
[44061] Fix | Delete
props.onKeyDown(event);
[44062] Fix | Delete
}
[44063] Fix | Delete
// If the event originates from inside the iframe, it means
[44064] Fix | Delete
// it bubbled through the portal, but only with React
[44065] Fix | Delete
// events. We need to to bubble native events as well,
[44066] Fix | Delete
// though by doing so we also trigger another React event,
[44067] Fix | Delete
// so we need to stop the propagation of this event to avoid
[44068] Fix | Delete
// duplication.
[44069] Fix | Delete
if (event.currentTarget.ownerDocument !== event.target.ownerDocument) {
[44070] Fix | Delete
// We should only stop propagation of the React event,
[44071] Fix | Delete
// the native event should further bubble inside the
[44072] Fix | Delete
// iframe to the document and window.
[44073] Fix | Delete
// Alternatively, we could consider redispatching the
[44074] Fix | Delete
// native event in the iframe.
[44075] Fix | Delete
const {
[44076] Fix | Delete
stopPropagation
[44077] Fix | Delete
} = event.nativeEvent;
[44078] Fix | Delete
event.nativeEvent.stopPropagation = () => {};
[44079] Fix | Delete
event.stopPropagation();
[44080] Fix | Delete
event.nativeEvent.stopPropagation = stopPropagation;
[44081] Fix | Delete
bubbleEvent(event, window.KeyboardEvent, event.currentTarget);
[44082] Fix | Delete
}
[44083] Fix | Delete
},
[44084] Fix | Delete
children: iframeDocument && (0,external_wp_element_namespaceObject.createPortal)(
[44085] Fix | Delete
/*#__PURE__*/
[44086] Fix | Delete
// We want to prevent React events from bubbling throught the iframe
[44087] Fix | Delete
// we bubble these manually.
[44088] Fix | Delete
/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */
[44089] Fix | Delete
(0,external_ReactJSXRuntime_namespaceObject.jsxs)("body", {
[44090] Fix | Delete
ref: bodyRef,
[44091] Fix | Delete
className: dist_clsx('block-editor-iframe__body', 'editor-styles-wrapper', ...bodyClasses),
[44092] Fix | Delete
children: [contentResizeListener, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalStyleProvider, {
[44093] Fix | Delete
document: iframeDocument,
[44094] Fix | Delete
children: children
[44095] Fix | Delete
})]
[44096] Fix | Delete
}), iframeDocument.documentElement)
[44097] Fix | Delete
}), shouldRenderFocusCaptureElements && after]
[44098] Fix | Delete
});
[44099] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[44100] Fix | Delete
className: "block-editor-iframe__container",
[44101] Fix | Delete
ref: windowResizeRef,
[44102] Fix | Delete
children: [containerResizeListener, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[44103] Fix | Delete
className: dist_clsx('block-editor-iframe__scale-container', isZoomedOut && 'is-zoomed-out'),
[44104] Fix | Delete
style: {
[44105] Fix | Delete
'--wp-block-editor-iframe-zoom-out-container-width': isZoomedOut && `${containerWidth}px`,
[44106] Fix | Delete
'--wp-block-editor-iframe-zoom-out-prev-container-width': isZoomedOut && `${prevContainerWidth.current}px`
[44107] Fix | Delete
},
[44108] Fix | Delete
children: iframe
[44109] Fix | Delete
})]
[44110] Fix | Delete
});
[44111] Fix | Delete
}
[44112] Fix | Delete
function IframeIfReady(props, ref) {
[44113] Fix | Delete
const isInitialised = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().__internalIsInitialized, []);
[44114] Fix | Delete
[44115] Fix | Delete
// We shouldn't render the iframe until the editor settings are initialised.
[44116] Fix | Delete
// The initial settings are needed to get the styles for the srcDoc, which
[44117] Fix | Delete
// cannot be changed after the iframe is mounted. srcDoc is used to to set
[44118] Fix | Delete
// the initial iframe HTML, which is required to avoid a flash of unstyled
[44119] Fix | Delete
// content.
[44120] Fix | Delete
if (!isInitialised) {
[44121] Fix | Delete
return null;
[44122] Fix | Delete
}
[44123] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Iframe, {
[44124] Fix | Delete
...props,
[44125] Fix | Delete
forwardedRef: ref
[44126] Fix | Delete
});
[44127] Fix | Delete
}
[44128] Fix | Delete
/* harmony default export */ const iframe = ((0,external_wp_element_namespaceObject.forwardRef)(IframeIfReady));
[44129] Fix | Delete
[44130] Fix | Delete
// EXTERNAL MODULE: ./node_modules/postcss/lib/postcss.js
[44131] Fix | Delete
var postcss = __webpack_require__(4529);
[44132] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/postcss/lib/postcss.mjs
[44133] Fix | Delete
[44134] Fix | Delete
[44135] Fix | Delete
/* harmony default export */ const lib_postcss = (postcss);
[44136] Fix | Delete
[44137] Fix | Delete
const stringify = postcss.stringify
[44138] Fix | Delete
const fromJSON = postcss.fromJSON
[44139] Fix | Delete
const postcss_plugin = postcss.plugin
[44140] Fix | Delete
const parse = postcss.parse
[44141] Fix | Delete
const list = postcss.list
[44142] Fix | Delete
[44143] Fix | Delete
const postcss_document = postcss.document
[44144] Fix | Delete
const comment = postcss.comment
[44145] Fix | Delete
const atRule = postcss.atRule
[44146] Fix | Delete
const rule = postcss.rule
[44147] Fix | Delete
const decl = postcss.decl
[44148] Fix | Delete
const root = postcss.root
[44149] Fix | Delete
[44150] Fix | Delete
const CssSyntaxError = postcss.CssSyntaxError
[44151] Fix | Delete
const Declaration = postcss.Declaration
[44152] Fix | Delete
const Container = postcss.Container
[44153] Fix | Delete
const Processor = postcss.Processor
[44154] Fix | Delete
const Document = postcss.Document
[44155] Fix | Delete
const Comment = postcss.Comment
[44156] Fix | Delete
const postcss_Warning = postcss.Warning
[44157] Fix | Delete
const AtRule = postcss.AtRule
[44158] Fix | Delete
const Result = postcss.Result
[44159] Fix | Delete
const Input = postcss.Input
[44160] Fix | Delete
const Rule = postcss.Rule
[44161] Fix | Delete
const Root = postcss.Root
[44162] Fix | Delete
const Node = postcss.Node
[44163] Fix | Delete
[44164] Fix | Delete
// EXTERNAL MODULE: ./node_modules/postcss-prefixwrap/build/index.js
[44165] Fix | Delete
var build = __webpack_require__(8036);
[44166] Fix | Delete
var build_default = /*#__PURE__*/__webpack_require__.n(build);
[44167] Fix | Delete
// EXTERNAL MODULE: ./node_modules/postcss-urlrebase/index.js
[44168] Fix | Delete
var postcss_urlrebase = __webpack_require__(5404);
[44169] Fix | Delete
var postcss_urlrebase_default = /*#__PURE__*/__webpack_require__.n(postcss_urlrebase);
[44170] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/index.js
[44171] Fix | Delete
/**
[44172] Fix | Delete
* External dependencies
[44173] Fix | Delete
*/
[44174] Fix | Delete
[44175] Fix | Delete
[44176] Fix | Delete
[44177] Fix | Delete
const cacheByWrapperSelector = new Map();
[44178] Fix | Delete
function transformStyle({
[44179] Fix | Delete
css,
[44180] Fix | Delete
ignoredSelectors = [],
[44181] Fix | Delete
baseURL
[44182] Fix | Delete
}, wrapperSelector = '') {
[44183] Fix | Delete
// When there is no wrapper selector or base URL, there is no need
[44184] Fix | Delete
// to transform the CSS. This is most cases because in the default
[44185] Fix | Delete
// iframed editor, no wrapping is needed, and not many styles
[44186] Fix | Delete
// provide a base URL.
[44187] Fix | Delete
if (!wrapperSelector && !baseURL) {
[44188] Fix | Delete
return css;
[44189] Fix | Delete
}
[44190] Fix | Delete
const postcssFriendlyCSS = css.replace(/:root :where\(body\)/g, 'body').replace(/:where\(body\)/g, 'body');
[44191] Fix | Delete
try {
[44192] Fix | Delete
return lib_postcss([wrapperSelector && build_default()(wrapperSelector, {
[44193] Fix | Delete
ignoredSelectors: [...ignoredSelectors, wrapperSelector]
[44194] Fix | Delete
}), baseURL && postcss_urlrebase_default()({
[44195] Fix | Delete
rootUrl: baseURL
[44196] Fix | Delete
})].filter(Boolean)).process(postcssFriendlyCSS, {}).css; // use sync PostCSS API
[44197] Fix | Delete
} catch (error) {
[44198] Fix | Delete
if (error instanceof CssSyntaxError) {
[44199] Fix | Delete
// eslint-disable-next-line no-console
[44200] Fix | Delete
console.warn('wp.blockEditor.transformStyles Failed to transform CSS.', error.message + '\n' + error.showSourceCode(false));
[44201] Fix | Delete
} else {
[44202] Fix | Delete
// eslint-disable-next-line no-console
[44203] Fix | Delete
console.warn('wp.blockEditor.transformStyles Failed to transform CSS.', error);
[44204] Fix | Delete
}
[44205] Fix | Delete
return null;
[44206] Fix | Delete
}
[44207] Fix | Delete
}
[44208] Fix | Delete
[44209] Fix | Delete
/**
[44210] Fix | Delete
* Applies a series of CSS rule transforms to wrap selectors inside a given class and/or rewrite URLs depending on the parameters passed.
[44211] Fix | Delete
*
[44212] Fix | Delete
* @typedef {Object} EditorStyle
[44213] Fix | Delete
* @property {string} css the CSS block(s), as a single string.
[44214] Fix | Delete
* @property {?string} baseURL the base URL to be used as the reference when rewritting urls.
[44215] Fix | Delete
* @property {?string[]} ignoredSelectors the selectors not to wrap.
[44216] Fix | Delete
*
[44217] Fix | Delete
* @param {EditorStyle[]} styles CSS rules.
[44218] Fix | Delete
* @param {string} wrapperSelector Wrapper selector.
[44219] Fix | Delete
* @return {Array} converted rules.
[44220] Fix | Delete
*/
[44221] Fix | Delete
const transform_styles_transformStyles = (styles, wrapperSelector = '') => {
[44222] Fix | Delete
let cache = cacheByWrapperSelector.get(wrapperSelector);
[44223] Fix | Delete
if (!cache) {
[44224] Fix | Delete
cache = new WeakMap();
[44225] Fix | Delete
cacheByWrapperSelector.set(wrapperSelector, cache);
[44226] Fix | Delete
}
[44227] Fix | Delete
return styles.map(style => {
[44228] Fix | Delete
let css = cache.get(style);
[44229] Fix | Delete
if (!css) {
[44230] Fix | Delete
css = transformStyle(style, wrapperSelector);
[44231] Fix | Delete
cache.set(style, css);
[44232] Fix | Delete
}
[44233] Fix | Delete
return css;
[44234] Fix | Delete
});
[44235] Fix | Delete
};
[44236] Fix | Delete
/* harmony default export */ const transform_styles = (transform_styles_transformStyles);
[44237] Fix | Delete
[44238] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/editor-styles/index.js
[44239] Fix | Delete
/**
[44240] Fix | Delete
* External dependencies
[44241] Fix | Delete
*/
[44242] Fix | Delete
[44243] Fix | Delete
[44244] Fix | Delete
[44245] Fix | Delete
[44246] Fix | Delete
/**
[44247] Fix | Delete
* WordPress dependencies
[44248] Fix | Delete
*/
[44249] Fix | Delete
[44250] Fix | Delete
[44251] Fix | Delete
[44252] Fix | Delete
[44253] Fix | Delete
/**
[44254] Fix | Delete
* Internal dependencies
[44255] Fix | Delete
*/
[44256] Fix | Delete
[44257] Fix | Delete
[44258] Fix | Delete
[44259] Fix | Delete
[44260] Fix | Delete
[44261] Fix | Delete
[44262] Fix | Delete
k([names, a11y]);
[44263] Fix | Delete
function useDarkThemeBodyClassName(styles, scope) {
[44264] Fix | Delete
return (0,external_wp_element_namespaceObject.useCallback)(node => {
[44265] Fix | Delete
if (!node) {
[44266] Fix | Delete
return;
[44267] Fix | Delete
}
[44268] Fix | Delete
const {
[44269] Fix | Delete
ownerDocument
[44270] Fix | Delete
} = node;
[44271] Fix | Delete
const {
[44272] Fix | Delete
defaultView,
[44273] Fix | Delete
body
[44274] Fix | Delete
} = ownerDocument;
[44275] Fix | Delete
const canvas = scope ? ownerDocument.querySelector(scope) : body;
[44276] Fix | Delete
let backgroundColor;
[44277] Fix | Delete
if (!canvas) {
[44278] Fix | Delete
// The real .editor-styles-wrapper element might not exist in the
[44279] Fix | Delete
// DOM, so calculate the background color by creating a fake
[44280] Fix | Delete
// wrapper.
[44281] Fix | Delete
const tempCanvas = ownerDocument.createElement('div');
[44282] Fix | Delete
tempCanvas.classList.add('editor-styles-wrapper');
[44283] Fix | Delete
body.appendChild(tempCanvas);
[44284] Fix | Delete
backgroundColor = defaultView?.getComputedStyle(tempCanvas, null).getPropertyValue('background-color');
[44285] Fix | Delete
body.removeChild(tempCanvas);
[44286] Fix | Delete
} else {
[44287] Fix | Delete
backgroundColor = defaultView?.getComputedStyle(canvas, null).getPropertyValue('background-color');
[44288] Fix | Delete
}
[44289] Fix | Delete
const colordBackgroundColor = w(backgroundColor);
[44290] Fix | Delete
// If background is transparent, it should be treated as light color.
[44291] Fix | Delete
if (colordBackgroundColor.luminance() > 0.5 || colordBackgroundColor.alpha() === 0) {
[44292] Fix | Delete
body.classList.remove('is-dark-theme');
[44293] Fix | Delete
} else {
[44294] Fix | Delete
body.classList.add('is-dark-theme');
[44295] Fix | Delete
}
[44296] Fix | Delete
}, [styles, scope]);
[44297] Fix | Delete
}
[44298] Fix | Delete
function EditorStyles({
[44299] Fix | Delete
styles,
[44300] Fix | Delete
scope
[44301] Fix | Delete
}) {
[44302] Fix | Delete
const overrides = (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(store)).getStyleOverrides(), []);
[44303] Fix | Delete
const [transformedStyles, transformedSvgs] = (0,external_wp_element_namespaceObject.useMemo)(() => {
[44304] Fix | Delete
const _styles = Object.values(styles !== null && styles !== void 0 ? styles : []);
[44305] Fix | Delete
for (const [id, override] of overrides) {
[44306] Fix | Delete
const index = _styles.findIndex(({
[44307] Fix | Delete
id: _id
[44308] Fix | Delete
}) => id === _id);
[44309] Fix | Delete
const overrideWithId = {
[44310] Fix | Delete
...override,
[44311] Fix | Delete
id
[44312] Fix | Delete
};
[44313] Fix | Delete
if (index === -1) {
[44314] Fix | Delete
_styles.push(overrideWithId);
[44315] Fix | Delete
} else {
[44316] Fix | Delete
_styles[index] = overrideWithId;
[44317] Fix | Delete
}
[44318] Fix | Delete
}
[44319] Fix | Delete
return [transform_styles(_styles.filter(style => style?.css), scope), _styles.filter(style => style.__unstableType === 'svgs').map(style => style.assets).join('')];
[44320] Fix | Delete
}, [styles, overrides, scope]);
[44321] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[44322] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("style", {
[44323] Fix | Delete
ref: useDarkThemeBodyClassName(transformedStyles, scope)
[44324] Fix | Delete
}), transformedStyles.map((css, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("style", {
[44325] Fix | Delete
children: css
[44326] Fix | Delete
}, index)), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, {
[44327] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[44328] Fix | Delete
viewBox: "0 0 0 0",
[44329] Fix | Delete
width: "0",
[44330] Fix | Delete
height: "0",
[44331] Fix | Delete
role: "none",
[44332] Fix | Delete
style: {
[44333] Fix | Delete
visibility: 'hidden',
[44334] Fix | Delete
position: 'absolute',
[44335] Fix | Delete
left: '-9999px',
[44336] Fix | Delete
overflow: 'hidden'
[44337] Fix | Delete
},
[44338] Fix | Delete
dangerouslySetInnerHTML: {
[44339] Fix | Delete
__html: transformedSvgs
[44340] Fix | Delete
}
[44341] Fix | Delete
})]
[44342] Fix | Delete
});
[44343] Fix | Delete
}
[44344] Fix | Delete
/* harmony default export */ const editor_styles = ((0,external_wp_element_namespaceObject.memo)(EditorStyles));
[44345] Fix | Delete
[44346] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/auto.js
[44347] Fix | Delete
/**
[44348] Fix | Delete
* WordPress dependencies
[44349] Fix | Delete
*/
[44350] Fix | Delete
[44351] Fix | Delete
[44352] Fix | Delete
[44353] Fix | Delete
[44354] Fix | Delete
[44355] Fix | Delete
/**
[44356] Fix | Delete
* Internal dependencies
[44357] Fix | Delete
*/
[44358] Fix | Delete
[44359] Fix | Delete
[44360] Fix | Delete
[44361] Fix | Delete
[44362] Fix | Delete
[44363] Fix | Delete
// This is used to avoid rendering the block list if the sizes change.
[44364] Fix | Delete
[44365] Fix | Delete
[44366] Fix | Delete
[44367] Fix | Delete
let MemoizedBlockList;
[44368] Fix | Delete
const MAX_HEIGHT = 2000;
[44369] Fix | Delete
const EMPTY_ADDITIONAL_STYLES = [];
[44370] Fix | Delete
function ScaledBlockPreview({
[44371] Fix | Delete
viewportWidth,
[44372] Fix | Delete
containerWidth,
[44373] Fix | Delete
minHeight,
[44374] Fix | Delete
additionalStyles = EMPTY_ADDITIONAL_STYLES
[44375] Fix | Delete
}) {
[44376] Fix | Delete
if (!viewportWidth) {
[44377] Fix | Delete
viewportWidth = containerWidth;
[44378] Fix | Delete
}
[44379] Fix | Delete
const [contentResizeListener, {
[44380] Fix | Delete
height: contentHeight
[44381] Fix | Delete
}] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
[44382] Fix | Delete
const {
[44383] Fix | Delete
styles
[44384] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[44385] Fix | Delete
const settings = select(store).getSettings();
[44386] Fix | Delete
return {
[44387] Fix | Delete
styles: settings.styles
[44388] Fix | Delete
};
[44389] Fix | Delete
}, []);
[44390] Fix | Delete
[44391] Fix | Delete
// Avoid scrollbars for pattern previews.
[44392] Fix | Delete
const editorStyles = (0,external_wp_element_namespaceObject.useMemo)(() => {
[44393] Fix | Delete
if (styles) {
[44394] Fix | Delete
return [...styles, {
[44395] Fix | Delete
css: 'body{height:auto;overflow:hidden;border:none;padding:0;}',
[44396] Fix | Delete
__unstableType: 'presets'
[44397] Fix | Delete
}, ...additionalStyles];
[44398] Fix | Delete
}
[44399] Fix | Delete
return styles;
[44400] Fix | Delete
}, [styles, additionalStyles]);
[44401] Fix | Delete
[44402] Fix | Delete
// Initialize on render instead of module top level, to avoid circular dependency issues.
[44403] Fix | Delete
MemoizedBlockList = MemoizedBlockList || (0,external_wp_element_namespaceObject.memo)(BlockList);
[44404] Fix | Delete
const scale = containerWidth / viewportWidth;
[44405] Fix | Delete
const aspectRatio = contentHeight ? containerWidth / (contentHeight * scale) : 0;
[44406] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, {
[44407] Fix | Delete
className: "block-editor-block-preview__content",
[44408] Fix | Delete
style: {
[44409] Fix | Delete
transform: `scale(${scale})`,
[44410] Fix | Delete
// Using width + aspect-ratio instead of height here triggers browsers' native
[44411] Fix | Delete
// handling of scrollbar's visibility. It prevents the flickering issue seen
[44412] Fix | Delete
// in https://github.com/WordPress/gutenberg/issues/52027.
[44413] Fix | Delete
// See https://github.com/WordPress/gutenberg/pull/52921 for more info.
[44414] Fix | Delete
aspectRatio,
[44415] Fix | Delete
maxHeight: contentHeight > MAX_HEIGHT ? MAX_HEIGHT * scale : undefined,
[44416] Fix | Delete
minHeight
[44417] Fix | Delete
},
[44418] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(iframe, {
[44419] Fix | Delete
contentRef: (0,external_wp_compose_namespaceObject.useRefEffect)(bodyElement => {
[44420] Fix | Delete
const {
[44421] Fix | Delete
ownerDocument: {
[44422] Fix | Delete
documentElement
[44423] Fix | Delete
}
[44424] Fix | Delete
} = bodyElement;
[44425] Fix | Delete
documentElement.classList.add('block-editor-block-preview__content-iframe');
[44426] Fix | Delete
documentElement.style.position = 'absolute';
[44427] Fix | Delete
documentElement.style.width = '100%';
[44428] Fix | Delete
[44429] Fix | Delete
// Necessary for contentResizeListener to work.
[44430] Fix | Delete
bodyElement.style.boxSizing = 'border-box';
[44431] Fix | Delete
bodyElement.style.position = 'absolute';
[44432] Fix | Delete
bodyElement.style.width = '100%';
[44433] Fix | Delete
}, []),
[44434] Fix | Delete
"aria-hidden": true,
[44435] Fix | Delete
tabIndex: -1,
[44436] Fix | Delete
style: {
[44437] Fix | Delete
position: 'absolute',
[44438] Fix | Delete
width: viewportWidth,
[44439] Fix | Delete
height: contentHeight,
[44440] Fix | Delete
pointerEvents: 'none',
[44441] Fix | Delete
// This is a catch-all max-height for patterns.
[44442] Fix | Delete
// See: https://github.com/WordPress/gutenberg/pull/38175.
[44443] Fix | Delete
maxHeight: MAX_HEIGHT,
[44444] Fix | Delete
minHeight: scale !== 0 && scale < 1 && minHeight ? minHeight / scale : minHeight
[44445] Fix | Delete
},
[44446] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_styles, {
[44447] Fix | Delete
styles: editorStyles
[44448] Fix | Delete
}), contentResizeListener, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MemoizedBlockList, {
[44449] Fix | Delete
renderAppender: false
[44450] Fix | Delete
})]
[44451] Fix | Delete
})
[44452] Fix | Delete
});
[44453] Fix | Delete
}
[44454] Fix | Delete
function AutoBlockPreview(props) {
[44455] Fix | Delete
const [containerResizeListener, {
[44456] Fix | Delete
width: containerWidth
[44457] Fix | Delete
}] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
[44458] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[44459] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[44460] Fix | Delete
style: {
[44461] Fix | Delete
position: 'relative',
[44462] Fix | Delete
width: '100%',
[44463] Fix | Delete
height: 0
[44464] Fix | Delete
},
[44465] Fix | Delete
children: containerResizeListener
[44466] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[44467] Fix | Delete
className: "block-editor-block-preview__container",
[44468] Fix | Delete
children: !!containerWidth && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ScaledBlockPreview, {
[44469] Fix | Delete
...props,
[44470] Fix | Delete
containerWidth: containerWidth
[44471] Fix | Delete
})
[44472] Fix | Delete
})]
[44473] Fix | Delete
});
[44474] Fix | Delete
}
[44475] Fix | Delete
[44476] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/index.js
[44477] Fix | Delete
/**
[44478] Fix | Delete
* External dependencies
[44479] Fix | Delete
*/
[44480] Fix | Delete
[44481] Fix | Delete
[44482] Fix | Delete
/**
[44483] Fix | Delete
* WordPress dependencies
[44484] Fix | Delete
*/
[44485] Fix | Delete
[44486] Fix | Delete
[44487] Fix | Delete
[44488] Fix | Delete
[44489] Fix | Delete
[44490] Fix | Delete
/**
[44491] Fix | Delete
* Internal dependencies
[44492] Fix | Delete
*/
[44493] Fix | Delete
[44494] Fix | Delete
[44495] Fix | Delete
[44496] Fix | Delete
[44497] Fix | Delete
[44498] Fix | Delete
[44499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function