Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: blocks.js
[4500] Fix | Delete
if (actualToken.type !== expectedToken.type) {
[4501] Fix | Delete
logger.warning('Expected token of type `%s` (%o), instead saw `%s` (%o).', expectedToken.type, expectedToken, actualToken.type, actualToken);
[4502] Fix | Delete
return false;
[4503] Fix | Delete
} // Defer custom token type equality handling, otherwise continue and
[4504] Fix | Delete
// assume as equal
[4505] Fix | Delete
[4506] Fix | Delete
[4507] Fix | Delete
var isEqualTokens = isEqualTokensOfType[actualToken.type];
[4508] Fix | Delete
[4509] Fix | Delete
if (isEqualTokens && !isEqualTokens(actualToken, expectedToken, logger)) {
[4510] Fix | Delete
return false;
[4511] Fix | Delete
} // Peek at the next tokens (actual and expected) to see if they close
[4512] Fix | Delete
// a self-closing tag
[4513] Fix | Delete
[4514] Fix | Delete
[4515] Fix | Delete
if (isClosedByToken(actualToken, expectedTokens[0])) {
[4516] Fix | Delete
// Consume the next expected token that closes the current actual
[4517] Fix | Delete
// self-closing token
[4518] Fix | Delete
getNextNonWhitespaceToken(expectedTokens);
[4519] Fix | Delete
} else if (isClosedByToken(expectedToken, actualTokens[0])) {
[4520] Fix | Delete
// Consume the next actual token that closes the current expected
[4521] Fix | Delete
// self-closing token
[4522] Fix | Delete
getNextNonWhitespaceToken(actualTokens);
[4523] Fix | Delete
}
[4524] Fix | Delete
}
[4525] Fix | Delete
[4526] Fix | Delete
if (expectedToken = getNextNonWhitespaceToken(expectedTokens)) {
[4527] Fix | Delete
// If any non-whitespace tokens remain in expected token set, this
[4528] Fix | Delete
// indicates inequality
[4529] Fix | Delete
logger.warning('Expected %o, instead saw end of content.', expectedToken);
[4530] Fix | Delete
return false;
[4531] Fix | Delete
}
[4532] Fix | Delete
[4533] Fix | Delete
return true;
[4534] Fix | Delete
}
[4535] Fix | Delete
/**
[4536] Fix | Delete
* Returns an object with `isValid` property set to `true` if the parsed block
[4537] Fix | Delete
* is valid given the input content. A block is considered valid if, when serialized
[4538] Fix | Delete
* with assumed attributes, the content matches the original value. If block is
[4539] Fix | Delete
* invalid, this function returns all validations issues as well.
[4540] Fix | Delete
*
[4541] Fix | Delete
* @param {string|Object} blockTypeOrName Block type.
[4542] Fix | Delete
* @param {Object} attributes Parsed block attributes.
[4543] Fix | Delete
* @param {string} originalBlockContent Original block content.
[4544] Fix | Delete
* @param {Object} logger Validation logger object.
[4545] Fix | Delete
*
[4546] Fix | Delete
* @return {Object} Whether block is valid and contains validation messages.
[4547] Fix | Delete
*/
[4548] Fix | Delete
[4549] Fix | Delete
function getBlockContentValidationResult(blockTypeOrName, attributes, originalBlockContent) {
[4550] Fix | Delete
var logger = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : createQueuedLogger();
[4551] Fix | Delete
var blockType = normalizeBlockType(blockTypeOrName);
[4552] Fix | Delete
var generatedBlockContent;
[4553] Fix | Delete
[4554] Fix | Delete
try {
[4555] Fix | Delete
generatedBlockContent = getSaveContent(blockType, attributes);
[4556] Fix | Delete
} catch (error) {
[4557] Fix | Delete
logger.error('Block validation failed because an error occurred while generating block content:\n\n%s', error.toString());
[4558] Fix | Delete
return {
[4559] Fix | Delete
isValid: false,
[4560] Fix | Delete
validationIssues: logger.getItems()
[4561] Fix | Delete
};
[4562] Fix | Delete
}
[4563] Fix | Delete
[4564] Fix | Delete
var isValid = isEquivalentHTML(originalBlockContent, generatedBlockContent, logger);
[4565] Fix | Delete
[4566] Fix | Delete
if (!isValid) {
[4567] Fix | Delete
logger.error('Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s', blockType.name, blockType, generatedBlockContent, originalBlockContent);
[4568] Fix | Delete
}
[4569] Fix | Delete
[4570] Fix | Delete
return {
[4571] Fix | Delete
isValid: isValid,
[4572] Fix | Delete
validationIssues: logger.getItems()
[4573] Fix | Delete
};
[4574] Fix | Delete
}
[4575] Fix | Delete
/**
[4576] Fix | Delete
* Returns true if the parsed block is valid given the input content. A block
[4577] Fix | Delete
* is considered valid if, when serialized with assumed attributes, the content
[4578] Fix | Delete
* matches the original value.
[4579] Fix | Delete
*
[4580] Fix | Delete
* Logs to console in development environments when invalid.
[4581] Fix | Delete
*
[4582] Fix | Delete
* @param {string|Object} blockTypeOrName Block type.
[4583] Fix | Delete
* @param {Object} attributes Parsed block attributes.
[4584] Fix | Delete
* @param {string} originalBlockContent Original block content.
[4585] Fix | Delete
*
[4586] Fix | Delete
* @return {boolean} Whether block is valid.
[4587] Fix | Delete
*/
[4588] Fix | Delete
[4589] Fix | Delete
function isValidBlockContent(blockTypeOrName, attributes, originalBlockContent) {
[4590] Fix | Delete
var _getBlockContentValid = getBlockContentValidationResult(blockTypeOrName, attributes, originalBlockContent, createLogger()),
[4591] Fix | Delete
isValid = _getBlockContentValid.isValid;
[4592] Fix | Delete
[4593] Fix | Delete
return isValid;
[4594] Fix | Delete
}
[4595] Fix | Delete
[4596] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/matchers.js
[4597] Fix | Delete
/**
[4598] Fix | Delete
* External dependencies
[4599] Fix | Delete
*/
[4600] Fix | Delete
[4601] Fix | Delete
/**
[4602] Fix | Delete
* Internal dependencies
[4603] Fix | Delete
*/
[4604] Fix | Delete
[4605] Fix | Delete
[4606] Fix | Delete
[4607] Fix | Delete
function matchers_html(selector, multilineTag) {
[4608] Fix | Delete
return function (domNode) {
[4609] Fix | Delete
var match = domNode;
[4610] Fix | Delete
[4611] Fix | Delete
if (selector) {
[4612] Fix | Delete
match = domNode.querySelector(selector);
[4613] Fix | Delete
}
[4614] Fix | Delete
[4615] Fix | Delete
if (!match) {
[4616] Fix | Delete
return '';
[4617] Fix | Delete
}
[4618] Fix | Delete
[4619] Fix | Delete
if (multilineTag) {
[4620] Fix | Delete
var value = '';
[4621] Fix | Delete
var length = match.children.length;
[4622] Fix | Delete
[4623] Fix | Delete
for (var index = 0; index < length; index++) {
[4624] Fix | Delete
var child = match.children[index];
[4625] Fix | Delete
[4626] Fix | Delete
if (child.nodeName.toLowerCase() !== multilineTag) {
[4627] Fix | Delete
continue;
[4628] Fix | Delete
}
[4629] Fix | Delete
[4630] Fix | Delete
value += child.outerHTML;
[4631] Fix | Delete
}
[4632] Fix | Delete
[4633] Fix | Delete
return value;
[4634] Fix | Delete
}
[4635] Fix | Delete
[4636] Fix | Delete
return match.innerHTML;
[4637] Fix | Delete
};
[4638] Fix | Delete
}
[4639] Fix | Delete
[4640] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/node.js
[4641] Fix | Delete
[4642] Fix | Delete
[4643] Fix | Delete
function node_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
[4644] Fix | Delete
[4645] Fix | Delete
function node_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { node_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { node_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
[4646] Fix | Delete
[4647] Fix | Delete
/**
[4648] Fix | Delete
* Internal dependencies
[4649] Fix | Delete
*/
[4650] Fix | Delete
[4651] Fix | Delete
/**
[4652] Fix | Delete
* A representation of a single node within a block's rich text value. If
[4653] Fix | Delete
* representing a text node, the value is simply a string of the node value.
[4654] Fix | Delete
* As representing an element node, it is an object of:
[4655] Fix | Delete
*
[4656] Fix | Delete
* 1. `type` (string): Tag name.
[4657] Fix | Delete
* 2. `props` (object): Attributes and children array of WPBlockNode.
[4658] Fix | Delete
*
[4659] Fix | Delete
* @typedef {string|Object} WPBlockNode
[4660] Fix | Delete
*/
[4661] Fix | Delete
[4662] Fix | Delete
/**
[4663] Fix | Delete
* Given a single node and a node type (e.g. `'br'`), returns true if the node
[4664] Fix | Delete
* corresponds to that type, false otherwise.
[4665] Fix | Delete
*
[4666] Fix | Delete
* @param {WPBlockNode} node Block node to test
[4667] Fix | Delete
* @param {string} type Node to type to test against.
[4668] Fix | Delete
*
[4669] Fix | Delete
* @return {boolean} Whether node is of intended type.
[4670] Fix | Delete
*/
[4671] Fix | Delete
[4672] Fix | Delete
function isNodeOfType(node, type) {
[4673] Fix | Delete
return node && node.type === type;
[4674] Fix | Delete
}
[4675] Fix | Delete
/**
[4676] Fix | Delete
* Given an object implementing the NamedNodeMap interface, returns a plain
[4677] Fix | Delete
* object equivalent value of name, value key-value pairs.
[4678] Fix | Delete
*
[4679] Fix | Delete
* @see https://dom.spec.whatwg.org/#interface-namednodemap
[4680] Fix | Delete
*
[4681] Fix | Delete
* @param {NamedNodeMap} nodeMap NamedNodeMap to convert to object.
[4682] Fix | Delete
*
[4683] Fix | Delete
* @return {Object} Object equivalent value of NamedNodeMap.
[4684] Fix | Delete
*/
[4685] Fix | Delete
[4686] Fix | Delete
[4687] Fix | Delete
function getNamedNodeMapAsObject(nodeMap) {
[4688] Fix | Delete
var result = {};
[4689] Fix | Delete
[4690] Fix | Delete
for (var i = 0; i < nodeMap.length; i++) {
[4691] Fix | Delete
var _nodeMap$i = nodeMap[i],
[4692] Fix | Delete
name = _nodeMap$i.name,
[4693] Fix | Delete
value = _nodeMap$i.value;
[4694] Fix | Delete
result[name] = value;
[4695] Fix | Delete
}
[4696] Fix | Delete
[4697] Fix | Delete
return result;
[4698] Fix | Delete
}
[4699] Fix | Delete
/**
[4700] Fix | Delete
* Given a DOM Element or Text node, returns an equivalent block node. Throws
[4701] Fix | Delete
* if passed any node type other than element or text.
[4702] Fix | Delete
*
[4703] Fix | Delete
* @throws {TypeError} If non-element/text node is passed.
[4704] Fix | Delete
*
[4705] Fix | Delete
* @param {Node} domNode DOM node to convert.
[4706] Fix | Delete
*
[4707] Fix | Delete
* @return {WPBlockNode} Block node equivalent to DOM node.
[4708] Fix | Delete
*/
[4709] Fix | Delete
[4710] Fix | Delete
function fromDOM(domNode) {
[4711] Fix | Delete
if (domNode.nodeType === domNode.TEXT_NODE) {
[4712] Fix | Delete
return domNode.nodeValue;
[4713] Fix | Delete
}
[4714] Fix | Delete
[4715] Fix | Delete
if (domNode.nodeType !== domNode.ELEMENT_NODE) {
[4716] Fix | Delete
throw new TypeError('A block node can only be created from a node of type text or ' + 'element.');
[4717] Fix | Delete
}
[4718] Fix | Delete
[4719] Fix | Delete
return {
[4720] Fix | Delete
type: domNode.nodeName.toLowerCase(),
[4721] Fix | Delete
props: node_objectSpread(node_objectSpread({}, getNamedNodeMapAsObject(domNode.attributes)), {}, {
[4722] Fix | Delete
children: children_fromDOM(domNode.childNodes)
[4723] Fix | Delete
})
[4724] Fix | Delete
};
[4725] Fix | Delete
}
[4726] Fix | Delete
/**
[4727] Fix | Delete
* Given a block node, returns its HTML string representation.
[4728] Fix | Delete
*
[4729] Fix | Delete
* @param {WPBlockNode} node Block node to convert to string.
[4730] Fix | Delete
*
[4731] Fix | Delete
* @return {string} String HTML representation of block node.
[4732] Fix | Delete
*/
[4733] Fix | Delete
[4734] Fix | Delete
function toHTML(node) {
[4735] Fix | Delete
return children_toHTML([node]);
[4736] Fix | Delete
}
[4737] Fix | Delete
/**
[4738] Fix | Delete
* Given a selector, returns an hpq matcher generating a WPBlockNode value
[4739] Fix | Delete
* matching the selector result.
[4740] Fix | Delete
*
[4741] Fix | Delete
* @param {string} selector DOM selector.
[4742] Fix | Delete
*
[4743] Fix | Delete
* @return {Function} hpq matcher.
[4744] Fix | Delete
*/
[4745] Fix | Delete
[4746] Fix | Delete
function node_matcher(selector) {
[4747] Fix | Delete
return function (domNode) {
[4748] Fix | Delete
var match = domNode;
[4749] Fix | Delete
[4750] Fix | Delete
if (selector) {
[4751] Fix | Delete
match = domNode.querySelector(selector);
[4752] Fix | Delete
}
[4753] Fix | Delete
[4754] Fix | Delete
try {
[4755] Fix | Delete
return fromDOM(match);
[4756] Fix | Delete
} catch (error) {
[4757] Fix | Delete
return null;
[4758] Fix | Delete
}
[4759] Fix | Delete
};
[4760] Fix | Delete
}
[4761] Fix | Delete
/**
[4762] Fix | Delete
* Object of utility functions used in managing block attribute values of
[4763] Fix | Delete
* source `node`.
[4764] Fix | Delete
*
[4765] Fix | Delete
* @see https://github.com/WordPress/gutenberg/pull/10439
[4766] Fix | Delete
*
[4767] Fix | Delete
* @deprecated since 4.0. The `node` source should not be used, and can be
[4768] Fix | Delete
* replaced by the `html` source.
[4769] Fix | Delete
*
[4770] Fix | Delete
* @private
[4771] Fix | Delete
*/
[4772] Fix | Delete
[4773] Fix | Delete
/* harmony default export */ var api_node = ({
[4774] Fix | Delete
isNodeOfType: isNodeOfType,
[4775] Fix | Delete
fromDOM: fromDOM,
[4776] Fix | Delete
toHTML: toHTML,
[4777] Fix | Delete
matcher: node_matcher
[4778] Fix | Delete
});
[4779] Fix | Delete
[4780] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/children.js
[4781] Fix | Delete
/**
[4782] Fix | Delete
* External dependencies
[4783] Fix | Delete
*/
[4784] Fix | Delete
[4785] Fix | Delete
/**
[4786] Fix | Delete
* WordPress dependencies
[4787] Fix | Delete
*/
[4788] Fix | Delete
[4789] Fix | Delete
[4790] Fix | Delete
/**
[4791] Fix | Delete
* Internal dependencies
[4792] Fix | Delete
*/
[4793] Fix | Delete
[4794] Fix | Delete
[4795] Fix | Delete
/**
[4796] Fix | Delete
* A representation of a block's rich text value.
[4797] Fix | Delete
*
[4798] Fix | Delete
* @typedef {WPBlockNode[]} WPBlockChildren
[4799] Fix | Delete
*/
[4800] Fix | Delete
[4801] Fix | Delete
/**
[4802] Fix | Delete
* Given block children, returns a serialize-capable WordPress element.
[4803] Fix | Delete
*
[4804] Fix | Delete
* @param {WPBlockChildren} children Block children object to convert.
[4805] Fix | Delete
*
[4806] Fix | Delete
* @return {WPElement} A serialize-capable element.
[4807] Fix | Delete
*/
[4808] Fix | Delete
[4809] Fix | Delete
function getSerializeCapableElement(children) {
[4810] Fix | Delete
// The fact that block children are compatible with the element serializer is
[4811] Fix | Delete
// merely an implementation detail that currently serves to be true, but
[4812] Fix | Delete
// should not be mistaken as being a guarantee on the external API. The
[4813] Fix | Delete
// public API only offers guarantees to work with strings (toHTML) and DOM
[4814] Fix | Delete
// elements (fromDOM), and should provide utilities to manipulate the value
[4815] Fix | Delete
// rather than expect consumers to inspect or construct its shape (concat).
[4816] Fix | Delete
return children;
[4817] Fix | Delete
}
[4818] Fix | Delete
/**
[4819] Fix | Delete
* Given block children, returns an array of block nodes.
[4820] Fix | Delete
*
[4821] Fix | Delete
* @param {WPBlockChildren} children Block children object to convert.
[4822] Fix | Delete
*
[4823] Fix | Delete
* @return {Array<WPBlockNode>} An array of individual block nodes.
[4824] Fix | Delete
*/
[4825] Fix | Delete
[4826] Fix | Delete
function getChildrenArray(children) {
[4827] Fix | Delete
// The fact that block children are compatible with the element serializer
[4828] Fix | Delete
// is merely an implementation detail that currently serves to be true, but
[4829] Fix | Delete
// should not be mistaken as being a guarantee on the external API.
[4830] Fix | Delete
return children;
[4831] Fix | Delete
}
[4832] Fix | Delete
/**
[4833] Fix | Delete
* Given two or more block nodes, returns a new block node representing a
[4834] Fix | Delete
* concatenation of its values.
[4835] Fix | Delete
*
[4836] Fix | Delete
* @param {...WPBlockChildren} blockNodes Block nodes to concatenate.
[4837] Fix | Delete
*
[4838] Fix | Delete
* @return {WPBlockChildren} Concatenated block node.
[4839] Fix | Delete
*/
[4840] Fix | Delete
[4841] Fix | Delete
[4842] Fix | Delete
function concat() {
[4843] Fix | Delete
var result = [];
[4844] Fix | Delete
[4845] Fix | Delete
for (var i = 0; i < arguments.length; i++) {
[4846] Fix | Delete
var blockNode = Object(external_lodash_["castArray"])(i < 0 || arguments.length <= i ? undefined : arguments[i]);
[4847] Fix | Delete
[4848] Fix | Delete
for (var j = 0; j < blockNode.length; j++) {
[4849] Fix | Delete
var child = blockNode[j];
[4850] Fix | Delete
var canConcatToPreviousString = typeof child === 'string' && typeof result[result.length - 1] === 'string';
[4851] Fix | Delete
[4852] Fix | Delete
if (canConcatToPreviousString) {
[4853] Fix | Delete
result[result.length - 1] += child;
[4854] Fix | Delete
} else {
[4855] Fix | Delete
result.push(child);
[4856] Fix | Delete
}
[4857] Fix | Delete
}
[4858] Fix | Delete
}
[4859] Fix | Delete
[4860] Fix | Delete
return result;
[4861] Fix | Delete
}
[4862] Fix | Delete
/**
[4863] Fix | Delete
* Given an iterable set of DOM nodes, returns equivalent block children.
[4864] Fix | Delete
* Ignores any non-element/text nodes included in set.
[4865] Fix | Delete
*
[4866] Fix | Delete
* @param {Iterable.<Node>} domNodes Iterable set of DOM nodes to convert.
[4867] Fix | Delete
*
[4868] Fix | Delete
* @return {WPBlockChildren} Block children equivalent to DOM nodes.
[4869] Fix | Delete
*/
[4870] Fix | Delete
[4871] Fix | Delete
function children_fromDOM(domNodes) {
[4872] Fix | Delete
var result = [];
[4873] Fix | Delete
[4874] Fix | Delete
for (var i = 0; i < domNodes.length; i++) {
[4875] Fix | Delete
try {
[4876] Fix | Delete
result.push(fromDOM(domNodes[i]));
[4877] Fix | Delete
} catch (error) {// Simply ignore if DOM node could not be converted.
[4878] Fix | Delete
}
[4879] Fix | Delete
}
[4880] Fix | Delete
[4881] Fix | Delete
return result;
[4882] Fix | Delete
}
[4883] Fix | Delete
/**
[4884] Fix | Delete
* Given a block node, returns its HTML string representation.
[4885] Fix | Delete
*
[4886] Fix | Delete
* @param {WPBlockChildren} children Block node(s) to convert to string.
[4887] Fix | Delete
*
[4888] Fix | Delete
* @return {string} String HTML representation of block node.
[4889] Fix | Delete
*/
[4890] Fix | Delete
[4891] Fix | Delete
function children_toHTML(children) {
[4892] Fix | Delete
var element = getSerializeCapableElement(children);
[4893] Fix | Delete
return Object(external_wp_element_["renderToString"])(element);
[4894] Fix | Delete
}
[4895] Fix | Delete
/**
[4896] Fix | Delete
* Given a selector, returns an hpq matcher generating a WPBlockChildren value
[4897] Fix | Delete
* matching the selector result.
[4898] Fix | Delete
*
[4899] Fix | Delete
* @param {string} selector DOM selector.
[4900] Fix | Delete
*
[4901] Fix | Delete
* @return {Function} hpq matcher.
[4902] Fix | Delete
*/
[4903] Fix | Delete
[4904] Fix | Delete
function children_matcher(selector) {
[4905] Fix | Delete
return function (domNode) {
[4906] Fix | Delete
var match = domNode;
[4907] Fix | Delete
[4908] Fix | Delete
if (selector) {
[4909] Fix | Delete
match = domNode.querySelector(selector);
[4910] Fix | Delete
}
[4911] Fix | Delete
[4912] Fix | Delete
if (match) {
[4913] Fix | Delete
return children_fromDOM(match.childNodes);
[4914] Fix | Delete
}
[4915] Fix | Delete
[4916] Fix | Delete
return [];
[4917] Fix | Delete
};
[4918] Fix | Delete
}
[4919] Fix | Delete
/**
[4920] Fix | Delete
* Object of utility functions used in managing block attribute values of
[4921] Fix | Delete
* source `children`.
[4922] Fix | Delete
*
[4923] Fix | Delete
* @see https://github.com/WordPress/gutenberg/pull/10439
[4924] Fix | Delete
*
[4925] Fix | Delete
* @deprecated since 4.0. The `children` source should not be used, and can be
[4926] Fix | Delete
* replaced by the `html` source.
[4927] Fix | Delete
*
[4928] Fix | Delete
* @private
[4929] Fix | Delete
*/
[4930] Fix | Delete
[4931] Fix | Delete
/* harmony default export */ var api_children = ({
[4932] Fix | Delete
concat: concat,
[4933] Fix | Delete
getChildrenArray: getChildrenArray,
[4934] Fix | Delete
fromDOM: children_fromDOM,
[4935] Fix | Delete
toHTML: children_toHTML,
[4936] Fix | Delete
matcher: children_matcher
[4937] Fix | Delete
});
[4938] Fix | Delete
[4939] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/parser.js
[4940] Fix | Delete
[4941] Fix | Delete
[4942] Fix | Delete
[4943] Fix | Delete
[4944] Fix | Delete
function parser_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
[4945] Fix | Delete
[4946] Fix | Delete
function parser_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { parser_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { parser_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
[4947] Fix | Delete
[4948] Fix | Delete
/**
[4949] Fix | Delete
* External dependencies
[4950] Fix | Delete
*/
[4951] Fix | Delete
[4952] Fix | Delete
[4953] Fix | Delete
/**
[4954] Fix | Delete
* WordPress dependencies
[4955] Fix | Delete
*/
[4956] Fix | Delete
[4957] Fix | Delete
[4958] Fix | Delete
[4959] Fix | Delete
[4960] Fix | Delete
/**
[4961] Fix | Delete
* Internal dependencies
[4962] Fix | Delete
*/
[4963] Fix | Delete
[4964] Fix | Delete
[4965] Fix | Delete
[4966] Fix | Delete
[4967] Fix | Delete
[4968] Fix | Delete
[4969] Fix | Delete
[4970] Fix | Delete
[4971] Fix | Delete
/**
[4972] Fix | Delete
* Sources which are guaranteed to return a string value.
[4973] Fix | Delete
*
[4974] Fix | Delete
* @type {Set}
[4975] Fix | Delete
*/
[4976] Fix | Delete
[4977] Fix | Delete
var STRING_SOURCES = new Set(['attribute', 'html', 'text', 'tag']);
[4978] Fix | Delete
/**
[4979] Fix | Delete
* Higher-order hpq matcher which enhances an attribute matcher to return true
[4980] Fix | Delete
* or false depending on whether the original matcher returns undefined. This
[4981] Fix | Delete
* is useful for boolean attributes (e.g. disabled) whose attribute values may
[4982] Fix | Delete
* be technically falsey (empty string), though their mere presence should be
[4983] Fix | Delete
* enough to infer as true.
[4984] Fix | Delete
*
[4985] Fix | Delete
* @param {Function} matcher Original hpq matcher.
[4986] Fix | Delete
*
[4987] Fix | Delete
* @return {Function} Enhanced hpq matcher.
[4988] Fix | Delete
*/
[4989] Fix | Delete
[4990] Fix | Delete
var parser_toBooleanAttributeMatcher = function toBooleanAttributeMatcher(matcher) {
[4991] Fix | Delete
return Object(external_lodash_["flow"])([matcher, // Expected values from `attr( 'disabled' )`:
[4992] Fix | Delete
//
[4993] Fix | Delete
// <input>
[4994] Fix | Delete
// - Value: `undefined`
[4995] Fix | Delete
// - Transformed: `false`
[4996] Fix | Delete
//
[4997] Fix | Delete
// <input disabled>
[4998] Fix | Delete
// - Value: `''`
[4999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function