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: blocks.js
return;
[15000] Fix | Delete
}
[15001] Fix | Delete
if (node.getAttribute('data-stringify-type') !== 'paragraph-break') {
[15002] Fix | Delete
return;
[15003] Fix | Delete
}
[15004] Fix | Delete
const {
[15005] Fix | Delete
parentNode
[15006] Fix | Delete
} = node;
[15007] Fix | Delete
parentNode.insertBefore(node.ownerDocument.createElement('br'), node);
[15008] Fix | Delete
parentNode.insertBefore(node.ownerDocument.createElement('br'), node);
[15009] Fix | Delete
parentNode.removeChild(node);
[15010] Fix | Delete
}
[15011] Fix | Delete
[15012] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/paste-handler.js
[15013] Fix | Delete
/**
[15014] Fix | Delete
* WordPress dependencies
[15015] Fix | Delete
*/
[15016] Fix | Delete
[15017] Fix | Delete
[15018] Fix | Delete
/**
[15019] Fix | Delete
* Internal dependencies
[15020] Fix | Delete
*/
[15021] Fix | Delete
[15022] Fix | Delete
[15023] Fix | Delete
[15024] Fix | Delete
[15025] Fix | Delete
[15026] Fix | Delete
[15027] Fix | Delete
[15028] Fix | Delete
[15029] Fix | Delete
[15030] Fix | Delete
[15031] Fix | Delete
[15032] Fix | Delete
[15033] Fix | Delete
[15034] Fix | Delete
[15035] Fix | Delete
[15036] Fix | Delete
[15037] Fix | Delete
[15038] Fix | Delete
[15039] Fix | Delete
[15040] Fix | Delete
[15041] Fix | Delete
[15042] Fix | Delete
[15043] Fix | Delete
[15044] Fix | Delete
[15045] Fix | Delete
[15046] Fix | Delete
[15047] Fix | Delete
const log = (...args) => window?.console?.log?.(...args);
[15048] Fix | Delete
[15049] Fix | Delete
/**
[15050] Fix | Delete
* Filters HTML to only contain phrasing content.
[15051] Fix | Delete
*
[15052] Fix | Delete
* @param {string} HTML The HTML to filter.
[15053] Fix | Delete
*
[15054] Fix | Delete
* @return {string} HTML only containing phrasing content.
[15055] Fix | Delete
*/
[15056] Fix | Delete
function filterInlineHTML(HTML) {
[15057] Fix | Delete
HTML = deepFilterHTML(HTML, [headRemover, googleDocsUIdRemover, msListIgnore, phrasingContentReducer, commentRemover]);
[15058] Fix | Delete
HTML = (0,external_wp_dom_namespaceObject.removeInvalidHTML)(HTML, (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)('paste'), {
[15059] Fix | Delete
inline: true
[15060] Fix | Delete
});
[15061] Fix | Delete
HTML = deepFilterHTML(HTML, [htmlFormattingRemover, brRemover]);
[15062] Fix | Delete
[15063] Fix | Delete
// Allows us to ask for this information when we get a report.
[15064] Fix | Delete
log('Processed inline HTML:\n\n', HTML);
[15065] Fix | Delete
return HTML;
[15066] Fix | Delete
}
[15067] Fix | Delete
[15068] Fix | Delete
/**
[15069] Fix | Delete
* Converts an HTML string to known blocks. Strips everything else.
[15070] Fix | Delete
*
[15071] Fix | Delete
* @param {Object} options
[15072] Fix | Delete
* @param {string} [options.HTML] The HTML to convert.
[15073] Fix | Delete
* @param {string} [options.plainText] Plain text version.
[15074] Fix | Delete
* @param {string} [options.mode] Handle content as blocks or inline content.
[15075] Fix | Delete
* * 'AUTO': Decide based on the content passed.
[15076] Fix | Delete
* * 'INLINE': Always handle as inline content, and return string.
[15077] Fix | Delete
* * 'BLOCKS': Always handle as blocks, and return array of blocks.
[15078] Fix | Delete
* @param {Array} [options.tagName] The tag into which content will be inserted.
[15079] Fix | Delete
*
[15080] Fix | Delete
* @return {Array|string} A list of blocks or a string, depending on `handlerMode`.
[15081] Fix | Delete
*/
[15082] Fix | Delete
function pasteHandler({
[15083] Fix | Delete
HTML = '',
[15084] Fix | Delete
plainText = '',
[15085] Fix | Delete
mode = 'AUTO',
[15086] Fix | Delete
tagName
[15087] Fix | Delete
}) {
[15088] Fix | Delete
// First of all, strip any meta tags.
[15089] Fix | Delete
HTML = HTML.replace(/<meta[^>]+>/g, '');
[15090] Fix | Delete
// Strip Windows markers.
[15091] Fix | Delete
HTML = HTML.replace(/^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i, '');
[15092] Fix | Delete
HTML = HTML.replace(/(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i, '');
[15093] Fix | Delete
[15094] Fix | Delete
// If we detect block delimiters in HTML, parse entirely as blocks.
[15095] Fix | Delete
if (mode !== 'INLINE') {
[15096] Fix | Delete
// Check plain text if there is no HTML.
[15097] Fix | Delete
const content = HTML ? HTML : plainText;
[15098] Fix | Delete
if (content.indexOf('<!-- wp:') !== -1) {
[15099] Fix | Delete
const parseResult = parser_parse(content);
[15100] Fix | Delete
const isSingleFreeFormBlock = parseResult.length === 1 && parseResult[0].name === 'core/freeform';
[15101] Fix | Delete
if (!isSingleFreeFormBlock) {
[15102] Fix | Delete
return parseResult;
[15103] Fix | Delete
}
[15104] Fix | Delete
}
[15105] Fix | Delete
}
[15106] Fix | Delete
[15107] Fix | Delete
// Normalize unicode to use composed characters.
[15108] Fix | Delete
// This is unsupported in IE 11 but it's a nice-to-have feature, not mandatory.
[15109] Fix | Delete
// Not normalizing the content will only affect older browsers and won't
[15110] Fix | Delete
// entirely break the app.
[15111] Fix | Delete
// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize
[15112] Fix | Delete
// See: https://core.trac.wordpress.org/ticket/30130
[15113] Fix | Delete
// See: https://github.com/WordPress/gutenberg/pull/6983#pullrequestreview-125151075
[15114] Fix | Delete
if (String.prototype.normalize) {
[15115] Fix | Delete
HTML = HTML.normalize();
[15116] Fix | Delete
}
[15117] Fix | Delete
[15118] Fix | Delete
// Must be run before checking if it's inline content.
[15119] Fix | Delete
HTML = deepFilterHTML(HTML, [slackParagraphCorrector]);
[15120] Fix | Delete
[15121] Fix | Delete
// Consider plain text if:
[15122] Fix | Delete
// * There is a plain text version.
[15123] Fix | Delete
// * There is no HTML version, or it has no formatting.
[15124] Fix | Delete
const isPlainText = plainText && (!HTML || isPlain(HTML));
[15125] Fix | Delete
[15126] Fix | Delete
// Parse Markdown (and encoded HTML) if it's considered plain text.
[15127] Fix | Delete
if (isPlainText) {
[15128] Fix | Delete
HTML = plainText;
[15129] Fix | Delete
[15130] Fix | Delete
// The markdown converter (Showdown) trims whitespace.
[15131] Fix | Delete
if (!/^\s+$/.test(plainText)) {
[15132] Fix | Delete
HTML = markdownConverter(HTML);
[15133] Fix | Delete
}
[15134] Fix | Delete
}
[15135] Fix | Delete
[15136] Fix | Delete
// An array of HTML strings and block objects. The blocks replace matched
[15137] Fix | Delete
// shortcodes.
[15138] Fix | Delete
const pieces = shortcode_converter(HTML);
[15139] Fix | Delete
[15140] Fix | Delete
// The call to shortcodeConverter will always return more than one element
[15141] Fix | Delete
// if shortcodes are matched. The reason is when shortcodes are matched
[15142] Fix | Delete
// empty HTML strings are included.
[15143] Fix | Delete
const hasShortcodes = pieces.length > 1;
[15144] Fix | Delete
if (isPlainText && !hasShortcodes) {
[15145] Fix | Delete
// Switch to inline mode if:
[15146] Fix | Delete
// * The current mode is AUTO.
[15147] Fix | Delete
// * The original plain text had no line breaks.
[15148] Fix | Delete
// * The original plain text was not an HTML paragraph.
[15149] Fix | Delete
// * The converted text is just a paragraph.
[15150] Fix | Delete
if (mode === 'AUTO' && plainText.indexOf('\n') === -1 && plainText.indexOf('<p>') !== 0 && HTML.indexOf('<p>') === 0) {
[15151] Fix | Delete
mode = 'INLINE';
[15152] Fix | Delete
}
[15153] Fix | Delete
}
[15154] Fix | Delete
if (mode === 'INLINE') {
[15155] Fix | Delete
return filterInlineHTML(HTML);
[15156] Fix | Delete
}
[15157] Fix | Delete
if (mode === 'AUTO' && !hasShortcodes && isInlineContent(HTML, tagName)) {
[15158] Fix | Delete
return filterInlineHTML(HTML);
[15159] Fix | Delete
}
[15160] Fix | Delete
const phrasingContentSchema = (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)('paste');
[15161] Fix | Delete
const blockContentSchema = getBlockContentSchema('paste');
[15162] Fix | Delete
const blocks = pieces.map(piece => {
[15163] Fix | Delete
// Already a block from shortcode.
[15164] Fix | Delete
if (typeof piece !== 'string') {
[15165] Fix | Delete
return piece;
[15166] Fix | Delete
}
[15167] Fix | Delete
const filters = [googleDocsUIdRemover, msListConverter, headRemover, listReducer, imageCorrector, phrasingContentReducer, specialCommentConverter, commentRemover, iframeRemover, figureContentReducer, blockquoteNormaliser(), divNormaliser];
[15168] Fix | Delete
const schema = {
[15169] Fix | Delete
...blockContentSchema,
[15170] Fix | Delete
// Keep top-level phrasing content, normalised by `normaliseBlocks`.
[15171] Fix | Delete
...phrasingContentSchema
[15172] Fix | Delete
};
[15173] Fix | Delete
piece = deepFilterHTML(piece, filters, blockContentSchema);
[15174] Fix | Delete
piece = (0,external_wp_dom_namespaceObject.removeInvalidHTML)(piece, schema);
[15175] Fix | Delete
piece = normaliseBlocks(piece);
[15176] Fix | Delete
piece = deepFilterHTML(piece, [htmlFormattingRemover, brRemover, emptyParagraphRemover], blockContentSchema);
[15177] Fix | Delete
[15178] Fix | Delete
// Allows us to ask for this information when we get a report.
[15179] Fix | Delete
log('Processed HTML piece:\n\n', piece);
[15180] Fix | Delete
return htmlToBlocks(piece, pasteHandler);
[15181] Fix | Delete
}).flat().filter(Boolean);
[15182] Fix | Delete
[15183] Fix | Delete
// If we're allowed to return inline content, and there is only one
[15184] Fix | Delete
// inlineable block, and the original plain text content does not have any
[15185] Fix | Delete
// line breaks, then treat it as inline paste.
[15186] Fix | Delete
if (mode === 'AUTO' && blocks.length === 1 && hasBlockSupport(blocks[0].name, '__unstablePasteTextInline', false)) {
[15187] Fix | Delete
const trimRegex = /^[\n]+|[\n]+$/g;
[15188] Fix | Delete
// Don't catch line breaks at the start or end.
[15189] Fix | Delete
const trimmedPlainText = plainText.replace(trimRegex, '');
[15190] Fix | Delete
if (trimmedPlainText !== '' && trimmedPlainText.indexOf('\n') === -1) {
[15191] Fix | Delete
return (0,external_wp_dom_namespaceObject.removeInvalidHTML)(getBlockInnerHTML(blocks[0]), phrasingContentSchema).replace(trimRegex, '');
[15192] Fix | Delete
}
[15193] Fix | Delete
}
[15194] Fix | Delete
return blocks;
[15195] Fix | Delete
}
[15196] Fix | Delete
[15197] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/categories.js
[15198] Fix | Delete
/**
[15199] Fix | Delete
* WordPress dependencies
[15200] Fix | Delete
*/
[15201] Fix | Delete
[15202] Fix | Delete
[15203] Fix | Delete
/**
[15204] Fix | Delete
* Internal dependencies
[15205] Fix | Delete
*/
[15206] Fix | Delete
[15207] Fix | Delete
[15208] Fix | Delete
/** @typedef {import('../store/reducer').WPBlockCategory} WPBlockCategory */
[15209] Fix | Delete
[15210] Fix | Delete
/**
[15211] Fix | Delete
* Returns all the block categories.
[15212] Fix | Delete
* Ignored from documentation as the recommended usage is via useSelect from @wordpress/data.
[15213] Fix | Delete
*
[15214] Fix | Delete
* @ignore
[15215] Fix | Delete
*
[15216] Fix | Delete
* @return {WPBlockCategory[]} Block categories.
[15217] Fix | Delete
*/
[15218] Fix | Delete
function categories_getCategories() {
[15219] Fix | Delete
return (0,external_wp_data_namespaceObject.select)(store).getCategories();
[15220] Fix | Delete
}
[15221] Fix | Delete
[15222] Fix | Delete
/**
[15223] Fix | Delete
* Sets the block categories.
[15224] Fix | Delete
*
[15225] Fix | Delete
* @param {WPBlockCategory[]} categories Block categories.
[15226] Fix | Delete
*
[15227] Fix | Delete
* @example
[15228] Fix | Delete
* ```js
[15229] Fix | Delete
* import { __ } from '@wordpress/i18n';
[15230] Fix | Delete
* import { store as blocksStore, setCategories } from '@wordpress/blocks';
[15231] Fix | Delete
* import { useSelect } from '@wordpress/data';
[15232] Fix | Delete
* import { Button } from '@wordpress/components';
[15233] Fix | Delete
*
[15234] Fix | Delete
* const ExampleComponent = () => {
[15235] Fix | Delete
* // Retrieve the list of current categories.
[15236] Fix | Delete
* const blockCategories = useSelect(
[15237] Fix | Delete
* ( select ) => select( blocksStore ).getCategories(),
[15238] Fix | Delete
* []
[15239] Fix | Delete
* );
[15240] Fix | Delete
*
[15241] Fix | Delete
* return (
[15242] Fix | Delete
* <Button
[15243] Fix | Delete
* onClick={ () => {
[15244] Fix | Delete
* // Add a custom category to the existing list.
[15245] Fix | Delete
* setCategories( [
[15246] Fix | Delete
* ...blockCategories,
[15247] Fix | Delete
* { title: 'Custom Category', slug: 'custom-category' },
[15248] Fix | Delete
* ] );
[15249] Fix | Delete
* } }
[15250] Fix | Delete
* >
[15251] Fix | Delete
* { __( 'Add a new custom block category' ) }
[15252] Fix | Delete
* </Button>
[15253] Fix | Delete
* );
[15254] Fix | Delete
* };
[15255] Fix | Delete
* ```
[15256] Fix | Delete
*/
[15257] Fix | Delete
function categories_setCategories(categories) {
[15258] Fix | Delete
(0,external_wp_data_namespaceObject.dispatch)(store).setCategories(categories);
[15259] Fix | Delete
}
[15260] Fix | Delete
[15261] Fix | Delete
/**
[15262] Fix | Delete
* Updates a category.
[15263] Fix | Delete
*
[15264] Fix | Delete
* @param {string} slug Block category slug.
[15265] Fix | Delete
* @param {WPBlockCategory} category Object containing the category properties
[15266] Fix | Delete
* that should be updated.
[15267] Fix | Delete
*
[15268] Fix | Delete
* @example
[15269] Fix | Delete
* ```js
[15270] Fix | Delete
* import { __ } from '@wordpress/i18n';
[15271] Fix | Delete
* import { updateCategory } from '@wordpress/blocks';
[15272] Fix | Delete
* import { Button } from '@wordpress/components';
[15273] Fix | Delete
*
[15274] Fix | Delete
* const ExampleComponent = () => {
[15275] Fix | Delete
* return (
[15276] Fix | Delete
* <Button
[15277] Fix | Delete
* onClick={ () => {
[15278] Fix | Delete
* updateCategory( 'text', { title: __( 'Written Word' ) } );
[15279] Fix | Delete
* } }
[15280] Fix | Delete
* >
[15281] Fix | Delete
* { __( 'Update Text category title' ) }
[15282] Fix | Delete
* </Button>
[15283] Fix | Delete
* ) ;
[15284] Fix | Delete
* };
[15285] Fix | Delete
* ```
[15286] Fix | Delete
*/
[15287] Fix | Delete
function categories_updateCategory(slug, category) {
[15288] Fix | Delete
(0,external_wp_data_namespaceObject.dispatch)(store).updateCategory(slug, category);
[15289] Fix | Delete
}
[15290] Fix | Delete
[15291] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/templates.js
[15292] Fix | Delete
/**
[15293] Fix | Delete
* WordPress dependencies
[15294] Fix | Delete
*/
[15295] Fix | Delete
[15296] Fix | Delete
[15297] Fix | Delete
/**
[15298] Fix | Delete
* Internal dependencies
[15299] Fix | Delete
*/
[15300] Fix | Delete
[15301] Fix | Delete
[15302] Fix | Delete
[15303] Fix | Delete
[15304] Fix | Delete
/**
[15305] Fix | Delete
* Checks whether a list of blocks matches a template by comparing the block names.
[15306] Fix | Delete
*
[15307] Fix | Delete
* @param {Array} blocks Block list.
[15308] Fix | Delete
* @param {Array} template Block template.
[15309] Fix | Delete
*
[15310] Fix | Delete
* @return {boolean} Whether the list of blocks matches a templates.
[15311] Fix | Delete
*/
[15312] Fix | Delete
function doBlocksMatchTemplate(blocks = [], template = []) {
[15313] Fix | Delete
return blocks.length === template.length && template.every(([name,, innerBlocksTemplate], index) => {
[15314] Fix | Delete
const block = blocks[index];
[15315] Fix | Delete
return name === block.name && doBlocksMatchTemplate(block.innerBlocks, innerBlocksTemplate);
[15316] Fix | Delete
});
[15317] Fix | Delete
}
[15318] Fix | Delete
const isHTMLAttribute = attributeDefinition => attributeDefinition?.source === 'html';
[15319] Fix | Delete
const isQueryAttribute = attributeDefinition => attributeDefinition?.source === 'query';
[15320] Fix | Delete
function normalizeAttributes(schema, values) {
[15321] Fix | Delete
if (!values) {
[15322] Fix | Delete
return {};
[15323] Fix | Delete
}
[15324] Fix | Delete
return Object.fromEntries(Object.entries(values).map(([key, value]) => [key, normalizeAttribute(schema[key], value)]));
[15325] Fix | Delete
}
[15326] Fix | Delete
function normalizeAttribute(definition, value) {
[15327] Fix | Delete
if (isHTMLAttribute(definition) && Array.isArray(value)) {
[15328] Fix | Delete
// Introduce a deprecated call at this point
[15329] Fix | Delete
// When we're confident that "children" format should be removed from the templates.
[15330] Fix | Delete
[15331] Fix | Delete
return (0,external_wp_element_namespaceObject.renderToString)(value);
[15332] Fix | Delete
}
[15333] Fix | Delete
if (isQueryAttribute(definition) && value) {
[15334] Fix | Delete
return value.map(subValues => {
[15335] Fix | Delete
return normalizeAttributes(definition.query, subValues);
[15336] Fix | Delete
});
[15337] Fix | Delete
}
[15338] Fix | Delete
return value;
[15339] Fix | Delete
}
[15340] Fix | Delete
[15341] Fix | Delete
/**
[15342] Fix | Delete
* Synchronize a block list with a block template.
[15343] Fix | Delete
*
[15344] Fix | Delete
* Synchronizing a block list with a block template means that we loop over the blocks
[15345] Fix | Delete
* keep the block as is if it matches the block at the same position in the template
[15346] Fix | Delete
* (If it has the same name) and if doesn't match, we create a new block based on the template.
[15347] Fix | Delete
* Extra blocks not present in the template are removed.
[15348] Fix | Delete
*
[15349] Fix | Delete
* @param {Array} blocks Block list.
[15350] Fix | Delete
* @param {Array} template Block template.
[15351] Fix | Delete
*
[15352] Fix | Delete
* @return {Array} Updated Block list.
[15353] Fix | Delete
*/
[15354] Fix | Delete
function synchronizeBlocksWithTemplate(blocks = [], template) {
[15355] Fix | Delete
// If no template is provided, return blocks unmodified.
[15356] Fix | Delete
if (!template) {
[15357] Fix | Delete
return blocks;
[15358] Fix | Delete
}
[15359] Fix | Delete
return template.map(([name, attributes, innerBlocksTemplate], index) => {
[15360] Fix | Delete
var _blockType$attributes;
[15361] Fix | Delete
const block = blocks[index];
[15362] Fix | Delete
if (block && block.name === name) {
[15363] Fix | Delete
const innerBlocks = synchronizeBlocksWithTemplate(block.innerBlocks, innerBlocksTemplate);
[15364] Fix | Delete
return {
[15365] Fix | Delete
...block,
[15366] Fix | Delete
innerBlocks
[15367] Fix | Delete
};
[15368] Fix | Delete
}
[15369] Fix | Delete
[15370] Fix | Delete
// To support old templates that were using the "children" format
[15371] Fix | Delete
// for the attributes using "html" strings now, we normalize the template attributes
[15372] Fix | Delete
// before creating the blocks.
[15373] Fix | Delete
[15374] Fix | Delete
const blockType = getBlockType(name);
[15375] Fix | Delete
const normalizedAttributes = normalizeAttributes((_blockType$attributes = blockType?.attributes) !== null && _blockType$attributes !== void 0 ? _blockType$attributes : {}, attributes);
[15376] Fix | Delete
let [blockName, blockAttributes] = convertLegacyBlockNameAndAttributes(name, normalizedAttributes);
[15377] Fix | Delete
[15378] Fix | Delete
// If a Block is undefined at this point, use the core/missing block as
[15379] Fix | Delete
// a placeholder for a better user experience.
[15380] Fix | Delete
if (undefined === getBlockType(blockName)) {
[15381] Fix | Delete
blockAttributes = {
[15382] Fix | Delete
originalName: name,
[15383] Fix | Delete
originalContent: '',
[15384] Fix | Delete
originalUndelimitedContent: ''
[15385] Fix | Delete
};
[15386] Fix | Delete
blockName = 'core/missing';
[15387] Fix | Delete
}
[15388] Fix | Delete
return createBlock(blockName, blockAttributes, synchronizeBlocksWithTemplate([], innerBlocksTemplate));
[15389] Fix | Delete
});
[15390] Fix | Delete
}
[15391] Fix | Delete
[15392] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/index.js
[15393] Fix | Delete
// The blocktype is the most important concept within the block API. It defines
[15394] Fix | Delete
// all aspects of the block configuration and its interfaces, including `edit`
[15395] Fix | Delete
// and `save`. The transforms specification allows converting one blocktype to
[15396] Fix | Delete
// another through formulas defined by either the source or the destination.
[15397] Fix | Delete
// Switching a blocktype is to be considered a one-way operation implying a
[15398] Fix | Delete
// transformation in the opposite way has to be handled explicitly.
[15399] Fix | Delete
[15400] Fix | Delete
[15401] Fix | Delete
// The block tree is composed of a collection of block nodes. Blocks contained
[15402] Fix | Delete
// within other blocks are called inner blocks. An important design
[15403] Fix | Delete
// consideration is that inner blocks are -- conceptually -- not part of the
[15404] Fix | Delete
// territory established by the parent block that contains them.
[15405] Fix | Delete
//
[15406] Fix | Delete
// This has multiple practical implications: when parsing, we can safely dispose
[15407] Fix | Delete
// of any block boundary found within a block from the innerHTML property when
[15408] Fix | Delete
// transfering to state. Not doing so would have a compounding effect on memory
[15409] Fix | Delete
// and uncertainty over the source of truth. This can be illustrated in how,
[15410] Fix | Delete
// given a tree of `n` nested blocks, the entry node would have to contain the
[15411] Fix | Delete
// actual content of each block while each subsequent block node in the state
[15412] Fix | Delete
// tree would replicate the entire chain `n-1`, meaning the extreme end node
[15413] Fix | Delete
// would have been replicated `n` times as the tree is traversed and would
[15414] Fix | Delete
// generate uncertainty as to which one is to hold the current value of the
[15415] Fix | Delete
// block. For composition, it also means inner blocks can effectively be child
[15416] Fix | Delete
// components whose mechanisms can be shielded from the `edit` implementation
[15417] Fix | Delete
// and just passed along.
[15418] Fix | Delete
[15419] Fix | Delete
[15420] Fix | Delete
[15421] Fix | Delete
[15422] Fix | Delete
// While block transformations account for a specific surface of the API, there
[15423] Fix | Delete
// are also raw transformations which handle arbitrary sources not made out of
[15424] Fix | Delete
// blocks but producing block basaed on various heursitics. This includes
[15425] Fix | Delete
// pasting rich text or HTML data.
[15426] Fix | Delete
[15427] Fix | Delete
[15428] Fix | Delete
// The process of serialization aims to deflate the internal memory of the block
[15429] Fix | Delete
// editor and its state representation back into an HTML valid string. This
[15430] Fix | Delete
// process restores the document integrity and inserts invisible delimiters
[15431] Fix | Delete
// around each block with HTML comment boundaries which can contain any extra
[15432] Fix | Delete
// attributes needed to operate with the block later on.
[15433] Fix | Delete
[15434] Fix | Delete
[15435] Fix | Delete
// Validation is the process of comparing a block source with its output before
[15436] Fix | Delete
// there is any user input or interaction with a block. When this operation
[15437] Fix | Delete
// fails -- for whatever reason -- the block is to be considered invalid. As
[15438] Fix | Delete
// part of validating a block the system will attempt to run the source against
[15439] Fix | Delete
// any provided deprecation definitions.
[15440] Fix | Delete
//
[15441] Fix | Delete
// Worth emphasizing that validation is not a case of whether the markup is
[15442] Fix | Delete
// merely HTML spec-compliant but about how the editor knows to create such
[15443] Fix | Delete
// markup and that its inability to create an identical result can be a strong
[15444] Fix | Delete
// indicator of potential data loss (the invalidation is then a protective
[15445] Fix | Delete
// measure).
[15446] Fix | Delete
//
[15447] Fix | Delete
// The invalidation process can also be deconstructed in phases: 1) validate the
[15448] Fix | Delete
// block exists; 2) validate the source matches the output; 3) validate the
[15449] Fix | Delete
// source matches deprecated outputs; 4) work through the significance of
[15450] Fix | Delete
// differences. These are stacked in a way that favors performance and optimizes
[15451] Fix | Delete
// for the majority of cases. That is to say, the evaluation logic can become
[15452] Fix | Delete
// more sophisticated the further down it goes in the process as the cost is
[15453] Fix | Delete
// accounted for. The first logic checks have to be extremely efficient since
[15454] Fix | Delete
// they will be run for all valid and invalid blocks alike. However, once a
[15455] Fix | Delete
// block is detected as invalid -- failing the three first steps -- it is
[15456] Fix | Delete
// adequate to spend more time determining validity before throwing a conflict.
[15457] Fix | Delete
[15458] Fix | Delete
[15459] Fix | Delete
[15460] Fix | Delete
// Blocks are inherently indifferent about where the data they operate with ends
[15461] Fix | Delete
// up being saved. For example, all blocks can have a static and dynamic aspect
[15462] Fix | Delete
// to them depending on the needs. The static nature of a block is the `save()`
[15463] Fix | Delete
// definition that is meant to be serialized into HTML and which can be left
[15464] Fix | Delete
// void. Any block can also register a `render_callback` on the server, which
[15465] Fix | Delete
// makes its output dynamic either in part or in its totality.
[15466] Fix | Delete
//
[15467] Fix | Delete
// Child blocks are defined as a relationship that builds on top of the inner
[15468] Fix | Delete
// blocks mechanism. A child block is a block node of a particular type that can
[15469] Fix | Delete
// only exist within the inner block boundaries of a specific parent type. This
[15470] Fix | Delete
// allows block authors to compose specific blocks that are not meant to be used
[15471] Fix | Delete
// outside of a specified parent block context. Thus, child blocks extend the
[15472] Fix | Delete
// concept of inner blocks to support a more direct relationship between sets of
[15473] Fix | Delete
// blocks. The addition of parent–child would be a subset of the inner block
[15474] Fix | Delete
// functionality under the premise that certain blocks only make sense as
[15475] Fix | Delete
// children of another block.
[15476] Fix | Delete
[15477] Fix | Delete
[15478] Fix | Delete
[15479] Fix | Delete
// Templates are, in a general sense, a basic collection of block nodes with any
[15480] Fix | Delete
// given set of predefined attributes that are supplied as the initial state of
[15481] Fix | Delete
// an inner blocks group. These nodes can, in turn, contain any number of nested
[15482] Fix | Delete
// blocks within their definition. Templates allow both to specify a default
[15483] Fix | Delete
// state for an editor session or a default set of blocks for any inner block
[15484] Fix | Delete
// implementation within a specific block.
[15485] Fix | Delete
[15486] Fix | Delete
[15487] Fix | Delete
[15488] Fix | Delete
[15489] Fix | Delete
[15490] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/deprecated.js
[15491] Fix | Delete
/**
[15492] Fix | Delete
* WordPress dependencies
[15493] Fix | Delete
*/
[15494] Fix | Delete
[15495] Fix | Delete
[15496] Fix | Delete
/**
[15497] Fix | Delete
* A Higher Order Component used to inject BlockContent using context to the
[15498] Fix | Delete
* wrapped component.
[15499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function