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: editor.js
};
[17500] Fix | Delete
});
[17501] Fix | Delete
if (postType !== 'wp_block') {
[17502] Fix | Delete
return null;
[17503] Fix | Delete
}
[17504] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
[17505] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Sync status'),
[17506] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[17507] Fix | Delete
className: "editor-post-sync-status__value",
[17508] Fix | Delete
children: syncStatus === 'unsynced' ? (0,external_wp_i18n_namespaceObject._x)('Not synced', 'pattern (singular)') : (0,external_wp_i18n_namespaceObject._x)('Synced', 'pattern (singular)')
[17509] Fix | Delete
})
[17510] Fix | Delete
});
[17511] Fix | Delete
}
[17512] Fix | Delete
[17513] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/index.js
[17514] Fix | Delete
/**
[17515] Fix | Delete
* WordPress dependencies
[17516] Fix | Delete
*/
[17517] Fix | Delete
[17518] Fix | Delete
[17519] Fix | Delete
[17520] Fix | Delete
[17521] Fix | Delete
/**
[17522] Fix | Delete
* Internal dependencies
[17523] Fix | Delete
*/
[17524] Fix | Delete
[17525] Fix | Delete
[17526] Fix | Delete
[17527] Fix | Delete
[17528] Fix | Delete
const post_taxonomies_identity = x => x;
[17529] Fix | Delete
function PostTaxonomies({
[17530] Fix | Delete
taxonomyWrapper = post_taxonomies_identity
[17531] Fix | Delete
}) {
[17532] Fix | Delete
const {
[17533] Fix | Delete
postType,
[17534] Fix | Delete
taxonomies
[17535] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[17536] Fix | Delete
return {
[17537] Fix | Delete
postType: select(store_store).getCurrentPostType(),
[17538] Fix | Delete
taxonomies: select(external_wp_coreData_namespaceObject.store).getTaxonomies({
[17539] Fix | Delete
per_page: -1
[17540] Fix | Delete
})
[17541] Fix | Delete
};
[17542] Fix | Delete
}, []);
[17543] Fix | Delete
const visibleTaxonomies = (taxonomies !== null && taxonomies !== void 0 ? taxonomies : []).filter(taxonomy =>
[17544] Fix | Delete
// In some circumstances .visibility can end up as undefined so optional chaining operator required.
[17545] Fix | Delete
// https://github.com/WordPress/gutenberg/issues/40326
[17546] Fix | Delete
taxonomy.types.includes(postType) && taxonomy.visibility?.show_ui);
[17547] Fix | Delete
return visibleTaxonomies.map(taxonomy => {
[17548] Fix | Delete
const TaxonomyComponent = taxonomy.hierarchical ? hierarchical_term_selector : flat_term_selector;
[17549] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, {
[17550] Fix | Delete
children: taxonomyWrapper( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TaxonomyComponent, {
[17551] Fix | Delete
slug: taxonomy.slug
[17552] Fix | Delete
}), taxonomy)
[17553] Fix | Delete
}, `taxonomy-${taxonomy.slug}`);
[17554] Fix | Delete
});
[17555] Fix | Delete
}
[17556] Fix | Delete
/* harmony default export */ const post_taxonomies = (PostTaxonomies);
[17557] Fix | Delete
[17558] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/check.js
[17559] Fix | Delete
/**
[17560] Fix | Delete
* WordPress dependencies
[17561] Fix | Delete
*/
[17562] Fix | Delete
[17563] Fix | Delete
[17564] Fix | Delete
[17565] Fix | Delete
/**
[17566] Fix | Delete
* Internal dependencies
[17567] Fix | Delete
*/
[17568] Fix | Delete
[17569] Fix | Delete
function PostTaxonomiesCheck({
[17570] Fix | Delete
children
[17571] Fix | Delete
}) {
[17572] Fix | Delete
const hasTaxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => {
[17573] Fix | Delete
const postType = select(store_store).getCurrentPostType();
[17574] Fix | Delete
const taxonomies = select(external_wp_coreData_namespaceObject.store).getTaxonomies({
[17575] Fix | Delete
per_page: -1
[17576] Fix | Delete
});
[17577] Fix | Delete
return taxonomies?.some(taxonomy => taxonomy.types.includes(postType));
[17578] Fix | Delete
}, []);
[17579] Fix | Delete
if (!hasTaxonomies) {
[17580] Fix | Delete
return null;
[17581] Fix | Delete
}
[17582] Fix | Delete
return children;
[17583] Fix | Delete
}
[17584] Fix | Delete
[17585] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/panel.js
[17586] Fix | Delete
/**
[17587] Fix | Delete
* WordPress dependencies
[17588] Fix | Delete
*/
[17589] Fix | Delete
[17590] Fix | Delete
[17591] Fix | Delete
[17592] Fix | Delete
/**
[17593] Fix | Delete
* Internal dependencies
[17594] Fix | Delete
*/
[17595] Fix | Delete
[17596] Fix | Delete
[17597] Fix | Delete
[17598] Fix | Delete
[17599] Fix | Delete
function TaxonomyPanel({
[17600] Fix | Delete
taxonomy,
[17601] Fix | Delete
children
[17602] Fix | Delete
}) {
[17603] Fix | Delete
const slug = taxonomy?.slug;
[17604] Fix | Delete
const panelName = slug ? `taxonomy-panel-${slug}` : '';
[17605] Fix | Delete
const {
[17606] Fix | Delete
isEnabled,
[17607] Fix | Delete
isOpened
[17608] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[17609] Fix | Delete
const {
[17610] Fix | Delete
isEditorPanelEnabled,
[17611] Fix | Delete
isEditorPanelOpened
[17612] Fix | Delete
} = select(store_store);
[17613] Fix | Delete
return {
[17614] Fix | Delete
isEnabled: slug ? isEditorPanelEnabled(panelName) : false,
[17615] Fix | Delete
isOpened: slug ? isEditorPanelOpened(panelName) : false
[17616] Fix | Delete
};
[17617] Fix | Delete
}, [panelName, slug]);
[17618] Fix | Delete
const {
[17619] Fix | Delete
toggleEditorPanelOpened
[17620] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
[17621] Fix | Delete
if (!isEnabled) {
[17622] Fix | Delete
return null;
[17623] Fix | Delete
}
[17624] Fix | Delete
const taxonomyMenuName = taxonomy?.labels?.menu_name;
[17625] Fix | Delete
if (!taxonomyMenuName) {
[17626] Fix | Delete
return null;
[17627] Fix | Delete
}
[17628] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
[17629] Fix | Delete
title: taxonomyMenuName,
[17630] Fix | Delete
opened: isOpened,
[17631] Fix | Delete
onToggle: () => toggleEditorPanelOpened(panelName),
[17632] Fix | Delete
children: children
[17633] Fix | Delete
});
[17634] Fix | Delete
}
[17635] Fix | Delete
function panel_PostTaxonomies() {
[17636] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTaxonomiesCheck, {
[17637] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_taxonomies, {
[17638] Fix | Delete
taxonomyWrapper: (content, taxonomy) => {
[17639] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TaxonomyPanel, {
[17640] Fix | Delete
taxonomy: taxonomy,
[17641] Fix | Delete
children: content
[17642] Fix | Delete
});
[17643] Fix | Delete
}
[17644] Fix | Delete
})
[17645] Fix | Delete
});
[17646] Fix | Delete
}
[17647] Fix | Delete
/* harmony default export */ const post_taxonomies_panel = (panel_PostTaxonomies);
[17648] Fix | Delete
[17649] Fix | Delete
// EXTERNAL MODULE: ./node_modules/react-autosize-textarea/lib/index.js
[17650] Fix | Delete
var lib = __webpack_require__(4132);
[17651] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-text-editor/index.js
[17652] Fix | Delete
/**
[17653] Fix | Delete
* External dependencies
[17654] Fix | Delete
*/
[17655] Fix | Delete
[17656] Fix | Delete
[17657] Fix | Delete
/**
[17658] Fix | Delete
* WordPress dependencies
[17659] Fix | Delete
*/
[17660] Fix | Delete
[17661] Fix | Delete
[17662] Fix | Delete
[17663] Fix | Delete
[17664] Fix | Delete
[17665] Fix | Delete
[17666] Fix | Delete
[17667] Fix | Delete
[17668] Fix | Delete
/**
[17669] Fix | Delete
* Internal dependencies
[17670] Fix | Delete
*/
[17671] Fix | Delete
[17672] Fix | Delete
[17673] Fix | Delete
/**
[17674] Fix | Delete
* Displays the Post Text Editor along with content in Visual and Text mode.
[17675] Fix | Delete
*
[17676] Fix | Delete
* @return {JSX.Element|null} The rendered PostTextEditor component.
[17677] Fix | Delete
*/
[17678] Fix | Delete
[17679] Fix | Delete
[17680] Fix | Delete
[17681] Fix | Delete
function PostTextEditor() {
[17682] Fix | Delete
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostTextEditor);
[17683] Fix | Delete
const {
[17684] Fix | Delete
content,
[17685] Fix | Delete
blocks,
[17686] Fix | Delete
type,
[17687] Fix | Delete
id
[17688] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[17689] Fix | Delete
const {
[17690] Fix | Delete
getEditedEntityRecord
[17691] Fix | Delete
} = select(external_wp_coreData_namespaceObject.store);
[17692] Fix | Delete
const {
[17693] Fix | Delete
getCurrentPostType,
[17694] Fix | Delete
getCurrentPostId
[17695] Fix | Delete
} = select(store_store);
[17696] Fix | Delete
const _type = getCurrentPostType();
[17697] Fix | Delete
const _id = getCurrentPostId();
[17698] Fix | Delete
const editedRecord = getEditedEntityRecord('postType', _type, _id);
[17699] Fix | Delete
return {
[17700] Fix | Delete
content: editedRecord?.content,
[17701] Fix | Delete
blocks: editedRecord?.blocks,
[17702] Fix | Delete
type: _type,
[17703] Fix | Delete
id: _id
[17704] Fix | Delete
};
[17705] Fix | Delete
}, []);
[17706] Fix | Delete
const {
[17707] Fix | Delete
editEntityRecord
[17708] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
[17709] Fix | Delete
// Replicates the logic found in getEditedPostContent().
[17710] Fix | Delete
const value = (0,external_wp_element_namespaceObject.useMemo)(() => {
[17711] Fix | Delete
if (content instanceof Function) {
[17712] Fix | Delete
return content({
[17713] Fix | Delete
blocks
[17714] Fix | Delete
});
[17715] Fix | Delete
} else if (blocks) {
[17716] Fix | Delete
// If we have parsed blocks already, they should be our source of truth.
[17717] Fix | Delete
// Parsing applies block deprecations and legacy block conversions that
[17718] Fix | Delete
// unparsed content will not have.
[17719] Fix | Delete
return (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocks);
[17720] Fix | Delete
}
[17721] Fix | Delete
return content;
[17722] Fix | Delete
}, [content, blocks]);
[17723] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[17724] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
[17725] Fix | Delete
as: "label",
[17726] Fix | Delete
htmlFor: `post-content-${instanceId}`,
[17727] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Type text or HTML')
[17728] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(lib/* default */.A, {
[17729] Fix | Delete
autoComplete: "off",
[17730] Fix | Delete
dir: "auto",
[17731] Fix | Delete
value: value,
[17732] Fix | Delete
onChange: event => {
[17733] Fix | Delete
editEntityRecord('postType', type, id, {
[17734] Fix | Delete
content: event.target.value,
[17735] Fix | Delete
blocks: undefined,
[17736] Fix | Delete
selection: undefined
[17737] Fix | Delete
});
[17738] Fix | Delete
},
[17739] Fix | Delete
className: "editor-post-text-editor",
[17740] Fix | Delete
id: `post-content-${instanceId}`,
[17741] Fix | Delete
placeholder: (0,external_wp_i18n_namespaceObject.__)('Start writing with text or HTML')
[17742] Fix | Delete
})]
[17743] Fix | Delete
});
[17744] Fix | Delete
}
[17745] Fix | Delete
[17746] Fix | Delete
;// CONCATENATED MODULE: external ["wp","dom"]
[17747] Fix | Delete
const external_wp_dom_namespaceObject = window["wp"]["dom"];
[17748] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-title/constants.js
[17749] Fix | Delete
const DEFAULT_CLASSNAMES = 'wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text';
[17750] Fix | Delete
const REGEXP_NEWLINES = /[\r\n]+/g;
[17751] Fix | Delete
[17752] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-title/use-post-title-focus.js
[17753] Fix | Delete
/**
[17754] Fix | Delete
* WordPress dependencies
[17755] Fix | Delete
*/
[17756] Fix | Delete
[17757] Fix | Delete
[17758] Fix | Delete
[17759] Fix | Delete
/**
[17760] Fix | Delete
* Internal dependencies
[17761] Fix | Delete
*/
[17762] Fix | Delete
[17763] Fix | Delete
[17764] Fix | Delete
/**
[17765] Fix | Delete
* Custom hook that manages the focus behavior of the post title input field.
[17766] Fix | Delete
*
[17767] Fix | Delete
* @param {Element} forwardedRef - The forwarded ref for the input field.
[17768] Fix | Delete
*
[17769] Fix | Delete
* @return {Object} - The ref object.
[17770] Fix | Delete
*/
[17771] Fix | Delete
function usePostTitleFocus(forwardedRef) {
[17772] Fix | Delete
const ref = (0,external_wp_element_namespaceObject.useRef)();
[17773] Fix | Delete
const {
[17774] Fix | Delete
isCleanNewPost
[17775] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[17776] Fix | Delete
const {
[17777] Fix | Delete
isCleanNewPost: _isCleanNewPost
[17778] Fix | Delete
} = select(store_store);
[17779] Fix | Delete
return {
[17780] Fix | Delete
isCleanNewPost: _isCleanNewPost()
[17781] Fix | Delete
};
[17782] Fix | Delete
}, []);
[17783] Fix | Delete
(0,external_wp_element_namespaceObject.useImperativeHandle)(forwardedRef, () => ({
[17784] Fix | Delete
focus: () => {
[17785] Fix | Delete
ref?.current?.focus();
[17786] Fix | Delete
}
[17787] Fix | Delete
}));
[17788] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[17789] Fix | Delete
if (!ref.current) {
[17790] Fix | Delete
return;
[17791] Fix | Delete
}
[17792] Fix | Delete
const {
[17793] Fix | Delete
defaultView
[17794] Fix | Delete
} = ref.current.ownerDocument;
[17795] Fix | Delete
const {
[17796] Fix | Delete
name,
[17797] Fix | Delete
parent
[17798] Fix | Delete
} = defaultView;
[17799] Fix | Delete
const ownerDocument = name === 'editor-canvas' ? parent.document : defaultView.document;
[17800] Fix | Delete
const {
[17801] Fix | Delete
activeElement,
[17802] Fix | Delete
body
[17803] Fix | Delete
} = ownerDocument;
[17804] Fix | Delete
[17805] Fix | Delete
// Only autofocus the title when the post is entirely empty. This should
[17806] Fix | Delete
// only happen for a new post, which means we focus the title on new
[17807] Fix | Delete
// post so the author can start typing right away, without needing to
[17808] Fix | Delete
// click anything.
[17809] Fix | Delete
if (isCleanNewPost && (!activeElement || body === activeElement)) {
[17810] Fix | Delete
ref.current.focus();
[17811] Fix | Delete
}
[17812] Fix | Delete
}, [isCleanNewPost]);
[17813] Fix | Delete
return {
[17814] Fix | Delete
ref
[17815] Fix | Delete
};
[17816] Fix | Delete
}
[17817] Fix | Delete
[17818] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-title/use-post-title.js
[17819] Fix | Delete
/**
[17820] Fix | Delete
* WordPress dependencies
[17821] Fix | Delete
*/
[17822] Fix | Delete
[17823] Fix | Delete
/**
[17824] Fix | Delete
* Internal dependencies
[17825] Fix | Delete
*/
[17826] Fix | Delete
[17827] Fix | Delete
[17828] Fix | Delete
/**
[17829] Fix | Delete
* Custom hook for managing the post title in the editor.
[17830] Fix | Delete
*
[17831] Fix | Delete
* @return {Object} An object containing the current title and a function to update the title.
[17832] Fix | Delete
*/
[17833] Fix | Delete
function usePostTitle() {
[17834] Fix | Delete
const {
[17835] Fix | Delete
editPost
[17836] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
[17837] Fix | Delete
const {
[17838] Fix | Delete
title
[17839] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[17840] Fix | Delete
const {
[17841] Fix | Delete
getEditedPostAttribute
[17842] Fix | Delete
} = select(store_store);
[17843] Fix | Delete
return {
[17844] Fix | Delete
title: getEditedPostAttribute('title')
[17845] Fix | Delete
};
[17846] Fix | Delete
}, []);
[17847] Fix | Delete
function updateTitle(newTitle) {
[17848] Fix | Delete
editPost({
[17849] Fix | Delete
title: newTitle
[17850] Fix | Delete
});
[17851] Fix | Delete
}
[17852] Fix | Delete
return {
[17853] Fix | Delete
title,
[17854] Fix | Delete
setTitle: updateTitle
[17855] Fix | Delete
};
[17856] Fix | Delete
}
[17857] Fix | Delete
[17858] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-title/index.js
[17859] Fix | Delete
/**
[17860] Fix | Delete
* External dependencies
[17861] Fix | Delete
*/
[17862] Fix | Delete
[17863] Fix | Delete
/**
[17864] Fix | Delete
* WordPress dependencies
[17865] Fix | Delete
*/
[17866] Fix | Delete
[17867] Fix | Delete
[17868] Fix | Delete
[17869] Fix | Delete
[17870] Fix | Delete
[17871] Fix | Delete
[17872] Fix | Delete
[17873] Fix | Delete
[17874] Fix | Delete
[17875] Fix | Delete
[17876] Fix | Delete
[17877] Fix | Delete
/**
[17878] Fix | Delete
* Internal dependencies
[17879] Fix | Delete
*/
[17880] Fix | Delete
[17881] Fix | Delete
[17882] Fix | Delete
[17883] Fix | Delete
[17884] Fix | Delete
[17885] Fix | Delete
function PostTitle(_, forwardedRef) {
[17886] Fix | Delete
const {
[17887] Fix | Delete
placeholder,
[17888] Fix | Delete
hasFixedToolbar
[17889] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[17890] Fix | Delete
const {
[17891] Fix | Delete
getSettings
[17892] Fix | Delete
} = select(external_wp_blockEditor_namespaceObject.store);
[17893] Fix | Delete
const {
[17894] Fix | Delete
titlePlaceholder,
[17895] Fix | Delete
hasFixedToolbar: _hasFixedToolbar
[17896] Fix | Delete
} = getSettings();
[17897] Fix | Delete
return {
[17898] Fix | Delete
placeholder: titlePlaceholder,
[17899] Fix | Delete
hasFixedToolbar: _hasFixedToolbar
[17900] Fix | Delete
};
[17901] Fix | Delete
}, []);
[17902] Fix | Delete
const [isSelected, setIsSelected] = (0,external_wp_element_namespaceObject.useState)(false);
[17903] Fix | Delete
const {
[17904] Fix | Delete
ref: focusRef
[17905] Fix | Delete
} = usePostTitleFocus(forwardedRef);
[17906] Fix | Delete
const {
[17907] Fix | Delete
title,
[17908] Fix | Delete
setTitle: onUpdate
[17909] Fix | Delete
} = usePostTitle();
[17910] Fix | Delete
const [selection, setSelection] = (0,external_wp_element_namespaceObject.useState)({});
[17911] Fix | Delete
const {
[17912] Fix | Delete
clearSelectedBlock,
[17913] Fix | Delete
insertBlocks,
[17914] Fix | Delete
insertDefaultBlock
[17915] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
[17916] Fix | Delete
function onChange(value) {
[17917] Fix | Delete
onUpdate(value.replace(REGEXP_NEWLINES, ' '));
[17918] Fix | Delete
}
[17919] Fix | Delete
function onInsertBlockAfter(blocks) {
[17920] Fix | Delete
insertBlocks(blocks, 0);
[17921] Fix | Delete
}
[17922] Fix | Delete
function onSelect() {
[17923] Fix | Delete
setIsSelected(true);
[17924] Fix | Delete
clearSelectedBlock();
[17925] Fix | Delete
}
[17926] Fix | Delete
function onUnselect() {
[17927] Fix | Delete
setIsSelected(false);
[17928] Fix | Delete
setSelection({});
[17929] Fix | Delete
}
[17930] Fix | Delete
function onEnterPress() {
[17931] Fix | Delete
insertDefaultBlock(undefined, undefined, 0);
[17932] Fix | Delete
}
[17933] Fix | Delete
function onKeyDown(event) {
[17934] Fix | Delete
if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER) {
[17935] Fix | Delete
event.preventDefault();
[17936] Fix | Delete
onEnterPress();
[17937] Fix | Delete
}
[17938] Fix | Delete
}
[17939] Fix | Delete
function onPaste(event) {
[17940] Fix | Delete
const clipboardData = event.clipboardData;
[17941] Fix | Delete
let plainText = '';
[17942] Fix | Delete
let html = '';
[17943] Fix | Delete
[17944] Fix | Delete
// IE11 only supports `Text` as an argument for `getData` and will
[17945] Fix | Delete
// otherwise throw an invalid argument error, so we try the standard
[17946] Fix | Delete
// arguments first, then fallback to `Text` if they fail.
[17947] Fix | Delete
try {
[17948] Fix | Delete
plainText = clipboardData.getData('text/plain');
[17949] Fix | Delete
html = clipboardData.getData('text/html');
[17950] Fix | Delete
} catch (error1) {
[17951] Fix | Delete
try {
[17952] Fix | Delete
html = clipboardData.getData('Text');
[17953] Fix | Delete
} catch (error2) {
[17954] Fix | Delete
// Some browsers like UC Browser paste plain text by default and
[17955] Fix | Delete
// don't support clipboardData at all, so allow default
[17956] Fix | Delete
// behaviour.
[17957] Fix | Delete
return;
[17958] Fix | Delete
}
[17959] Fix | Delete
}
[17960] Fix | Delete
[17961] Fix | Delete
// Allows us to ask for this information when we get a report.
[17962] Fix | Delete
window.console.log('Received HTML:\n\n', html);
[17963] Fix | Delete
window.console.log('Received plain text:\n\n', plainText);
[17964] Fix | Delete
const content = (0,external_wp_blocks_namespaceObject.pasteHandler)({
[17965] Fix | Delete
HTML: html,
[17966] Fix | Delete
plainText
[17967] Fix | Delete
});
[17968] Fix | Delete
event.preventDefault();
[17969] Fix | Delete
if (!content.length) {
[17970] Fix | Delete
return;
[17971] Fix | Delete
}
[17972] Fix | Delete
if (typeof content !== 'string') {
[17973] Fix | Delete
const [firstBlock] = content;
[17974] Fix | Delete
if (!title && (firstBlock.name === 'core/heading' || firstBlock.name === 'core/paragraph')) {
[17975] Fix | Delete
// Strip HTML to avoid unwanted HTML being added to the title.
[17976] Fix | Delete
// In the majority of cases it is assumed that HTML in the title
[17977] Fix | Delete
// is undesirable.
[17978] Fix | Delete
const contentNoHTML = (0,external_wp_dom_namespaceObject.__unstableStripHTML)(firstBlock.attributes.content);
[17979] Fix | Delete
onUpdate(contentNoHTML);
[17980] Fix | Delete
onInsertBlockAfter(content.slice(1));
[17981] Fix | Delete
} else {
[17982] Fix | Delete
onInsertBlockAfter(content);
[17983] Fix | Delete
}
[17984] Fix | Delete
} else {
[17985] Fix | Delete
const value = {
[17986] Fix | Delete
...(0,external_wp_richText_namespaceObject.create)({
[17987] Fix | Delete
html: title
[17988] Fix | Delete
}),
[17989] Fix | Delete
...selection
[17990] Fix | Delete
};
[17991] Fix | Delete
[17992] Fix | Delete
// Strip HTML to avoid unwanted HTML being added to the title.
[17993] Fix | Delete
// In the majority of cases it is assumed that HTML in the title
[17994] Fix | Delete
// is undesirable.
[17995] Fix | Delete
const contentNoHTML = (0,external_wp_dom_namespaceObject.__unstableStripHTML)(content);
[17996] Fix | Delete
const newValue = (0,external_wp_richText_namespaceObject.insert)(value, (0,external_wp_richText_namespaceObject.create)({
[17997] Fix | Delete
html: contentNoHTML
[17998] Fix | Delete
}));
[17999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function