WordPress 5.0 Beta 2.
Built from https://develop.svn.wordpress.org/branches/5.0@43844 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0014a77fa3
commit
37177611f3
|
@ -1063,6 +1063,7 @@ var settings = {
|
||||||
attribute: 'src'
|
attribute: 'src'
|
||||||
},
|
},
|
||||||
caption: {
|
caption: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'figcaption'
|
selector: 'figcaption'
|
||||||
},
|
},
|
||||||
|
@ -1865,6 +1866,7 @@ var blockAttributes = {
|
||||||
attribute: 'title'
|
attribute: 'title'
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'a'
|
selector: 'a'
|
||||||
},
|
},
|
||||||
|
@ -2981,24 +2983,22 @@ var settings = {
|
||||||
__webpack_require__.r(__webpack_exports__);
|
__webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "name", function() { return name; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "name", function() { return name; });
|
||||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "settings", function() { return settings; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "settings", function() { return settings; });
|
||||||
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
||||||
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash");
|
||||||
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash");
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
||||||
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
|
/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! memize */ "./node_modules/memize/index.js");
|
||||||
/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! memize */ "./node_modules/memize/index.js");
|
/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(memize__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(memize__WEBPACK_IMPORTED_MODULE_4__);
|
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
||||||
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
|
||||||
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__);
|
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
|
||||||
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
|
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__);
|
||||||
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__);
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
|
||||||
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__);
|
||||||
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_7__);
|
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/editor */ "@wordpress/editor");
|
||||||
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/editor */ "@wordpress/editor");
|
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_7__);
|
||||||
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_8__);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3035,21 +3035,69 @@ var ALLOWED_BLOCKS = ['core/column'];
|
||||||
* @return {Object[]} Columns layout configuration.
|
* @return {Object[]} Columns layout configuration.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var getColumnsTemplate = memize__WEBPACK_IMPORTED_MODULE_4___default()(function (columns) {
|
var getColumnsTemplate = memize__WEBPACK_IMPORTED_MODULE_3___default()(function (columns) {
|
||||||
return Object(lodash__WEBPACK_IMPORTED_MODULE_2__["times"])(columns, function () {
|
return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["times"])(columns, function () {
|
||||||
return ['core/column'];
|
return ['core/column'];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
/**
|
||||||
|
* Given an HTML string for a deprecated columns inner block, returns the
|
||||||
|
* column index to which the migrated inner block should be assigned. Returns
|
||||||
|
* undefined if the inner block was not assigned to a column.
|
||||||
|
*
|
||||||
|
* @param {string} originalContent Deprecated Columns inner block HTML.
|
||||||
|
*
|
||||||
|
* @return {?number} Column to which inner block is to be assigned.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function getDeprecatedLayoutColumn(originalContent) {
|
||||||
|
var doc = getDeprecatedLayoutColumn.doc;
|
||||||
|
|
||||||
|
if (!doc) {
|
||||||
|
doc = document.implementation.createHTMLDocument('');
|
||||||
|
getDeprecatedLayoutColumn.doc = doc;
|
||||||
|
}
|
||||||
|
|
||||||
|
var columnMatch;
|
||||||
|
doc.body.innerHTML = originalContent;
|
||||||
|
var _iteratorNormalCompletion = true;
|
||||||
|
var _didIteratorError = false;
|
||||||
|
var _iteratorError = undefined;
|
||||||
|
|
||||||
|
try {
|
||||||
|
for (var _iterator = doc.body.firstChild.classList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
||||||
|
var classListItem = _step.value;
|
||||||
|
|
||||||
|
if (columnMatch = classListItem.match(/^layout-column-(\d+)$/)) {
|
||||||
|
return Number(columnMatch[1]) - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
_didIteratorError = true;
|
||||||
|
_iteratorError = err;
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
||||||
|
_iterator.return();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
if (_didIteratorError) {
|
||||||
|
throw _iteratorError;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var name = 'core/columns';
|
var name = 'core/columns';
|
||||||
var settings = {
|
var settings = {
|
||||||
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Columns'),
|
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Columns'),
|
||||||
icon: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__["SVG"], {
|
icon: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["SVG"], {
|
||||||
viewBox: "0 0 24 24",
|
viewBox: "0 0 24 24",
|
||||||
xmlns: "http://www.w3.org/2000/svg"
|
xmlns: "http://www.w3.org/2000/svg"
|
||||||
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__["Path"], {
|
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["Path"], {
|
||||||
fill: "none",
|
fill: "none",
|
||||||
d: "M0 0h24v24H0V0z"
|
d: "M0 0h24v24H0V0z"
|
||||||
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__["G"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__["Path"], {
|
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["G"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["Path"], {
|
||||||
d: "M21 4H3L2 5v14l1 1h18l1-1V5l-1-1zM8 18H4V6h4v12zm6 0h-4V6h4v12zm6 0h-4V6h4v12z"
|
d: "M21 4H3L2 5v14l1 1h18l1-1V5l-1-1zM8 18H4V6h4v12zm6 0h-4V6h4v12zm6 0h-4V6h4v12z"
|
||||||
}))),
|
}))),
|
||||||
category: 'layout',
|
category: 'layout',
|
||||||
|
@ -3059,7 +3107,7 @@ var settings = {
|
||||||
default: 2
|
default: 2
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
description: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Add a block that displays content in multiple columns, then add whatever content blocks you’d like.'),
|
description: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Add a block that displays content in multiple columns, then add whatever content blocks you’d like.'),
|
||||||
supports: {
|
supports: {
|
||||||
align: ['wide', 'full']
|
align: ['wide', 'full']
|
||||||
},
|
},
|
||||||
|
@ -3071,22 +3119,30 @@ var settings = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isEligible: function isEligible(attributes, innerBlocks) {
|
isEligible: function isEligible(attributes, innerBlocks) {
|
||||||
return innerBlocks.some(Object(lodash__WEBPACK_IMPORTED_MODULE_2__["property"])(['attributes', 'layout']));
|
// Since isEligible is called on every valid instance of the
|
||||||
|
// Columns block and a deprecation is the unlikely case due to
|
||||||
|
// its subsequent migration, optimize for the `false` condition
|
||||||
|
// by performing a naive, inaccurate pass at inner blocks.
|
||||||
|
var isFastPassEligible = innerBlocks.some(function (innerBlock) {
|
||||||
|
return /layout-column-\d+/.test(innerBlock.originalContent);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!isFastPassEligible) {
|
||||||
|
return false;
|
||||||
|
} // Only if the fast pass is considered eligible is the more
|
||||||
|
// accurate, durable, slower condition performed.
|
||||||
|
|
||||||
|
|
||||||
|
return innerBlocks.some(function (innerBlock) {
|
||||||
|
return getDeprecatedLayoutColumn(innerBlock.originalContent) !== undefined;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
migrate: function migrate(attributes, innerBlocks) {
|
migrate: function migrate(attributes, innerBlocks) {
|
||||||
function withoutLayout(block) {
|
|
||||||
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, block, {
|
|
||||||
attributes: Object(lodash__WEBPACK_IMPORTED_MODULE_2__["omit"])(block.attributes, ['layout'])
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var columns = innerBlocks.reduce(function (result, innerBlock) {
|
var columns = innerBlocks.reduce(function (result, innerBlock) {
|
||||||
var layout = innerBlock.attributes.layout;
|
var originalContent = innerBlock.originalContent;
|
||||||
var columnIndex, columnMatch;
|
var columnIndex = getDeprecatedLayoutColumn(originalContent);
|
||||||
|
|
||||||
if (layout && (columnMatch = layout.match(/^column-(\d+)$/))) {
|
if (columnIndex === undefined) {
|
||||||
columnIndex = Number(columnMatch[1]) - 1;
|
|
||||||
} else {
|
|
||||||
columnIndex = 0;
|
columnIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3094,20 +3150,20 @@ var settings = {
|
||||||
result[columnIndex] = [];
|
result[columnIndex] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
result[columnIndex].push(withoutLayout(innerBlock));
|
result[columnIndex].push(innerBlock);
|
||||||
return result;
|
return result;
|
||||||
}, []);
|
}, []);
|
||||||
var migratedInnerBlocks = columns.map(function (columnBlocks) {
|
var migratedInnerBlocks = columns.map(function (columnBlocks) {
|
||||||
return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_7__["createBlock"])('core/column', {}, columnBlocks);
|
return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__["createBlock"])('core/column', {}, columnBlocks);
|
||||||
});
|
});
|
||||||
return [attributes, migratedInnerBlocks];
|
return [attributes, migratedInnerBlocks];
|
||||||
},
|
},
|
||||||
save: function save(_ref) {
|
save: function save(_ref) {
|
||||||
var attributes = _ref.attributes;
|
var attributes = _ref.attributes;
|
||||||
var columns = attributes.columns;
|
var columns = attributes.columns;
|
||||||
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", {
|
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
|
||||||
className: "has-".concat(columns, "-columns")
|
className: "has-".concat(columns, "-columns")
|
||||||
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_8__["InnerBlocks"].Content, null));
|
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_7__["InnerBlocks"].Content, null));
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
edit: function edit(_ref2) {
|
edit: function edit(_ref2) {
|
||||||
|
@ -3115,9 +3171,9 @@ var settings = {
|
||||||
setAttributes = _ref2.setAttributes,
|
setAttributes = _ref2.setAttributes,
|
||||||
className = _ref2.className;
|
className = _ref2.className;
|
||||||
var columns = attributes.columns;
|
var columns = attributes.columns;
|
||||||
var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, "has-".concat(columns, "-columns"));
|
var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, "has-".concat(columns, "-columns"));
|
||||||
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_8__["InspectorControls"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__["PanelBody"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__["RangeControl"], {
|
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_7__["InspectorControls"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["PanelBody"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["RangeControl"], {
|
||||||
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Columns'),
|
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Columns'),
|
||||||
value: columns,
|
value: columns,
|
||||||
onChange: function onChange(nextColumns) {
|
onChange: function onChange(nextColumns) {
|
||||||
setAttributes({
|
setAttributes({
|
||||||
|
@ -3126,9 +3182,9 @@ var settings = {
|
||||||
},
|
},
|
||||||
min: 2,
|
min: 2,
|
||||||
max: 6
|
max: 6
|
||||||
}))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", {
|
}))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
|
||||||
className: classes
|
className: classes
|
||||||
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_8__["InnerBlocks"], {
|
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_7__["InnerBlocks"], {
|
||||||
template: getColumnsTemplate(columns),
|
template: getColumnsTemplate(columns),
|
||||||
templateLock: "all",
|
templateLock: "all",
|
||||||
allowedBlocks: ALLOWED_BLOCKS
|
allowedBlocks: ALLOWED_BLOCKS
|
||||||
|
@ -3137,9 +3193,9 @@ var settings = {
|
||||||
save: function save(_ref3) {
|
save: function save(_ref3) {
|
||||||
var attributes = _ref3.attributes;
|
var attributes = _ref3.attributes;
|
||||||
var columns = attributes.columns;
|
var columns = attributes.columns;
|
||||||
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", {
|
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
|
||||||
className: "has-".concat(columns, "-columns")
|
className: "has-".concat(columns, "-columns")
|
||||||
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_8__["InnerBlocks"].Content, null));
|
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_7__["InnerBlocks"].Content, null));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3194,6 +3250,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
var validAlignments = ['left', 'center', 'right', 'wide', 'full'];
|
var validAlignments = ['left', 'center', 'right', 'wide', 'full'];
|
||||||
var blockAttributes = {
|
var blockAttributes = {
|
||||||
title: {
|
title: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'p'
|
selector: 'p'
|
||||||
},
|
},
|
||||||
|
@ -3601,6 +3658,7 @@ var settings = {
|
||||||
}, {
|
}, {
|
||||||
attributes: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, blockAttributes, {
|
attributes: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, blockAttributes, {
|
||||||
title: {
|
title: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'h2'
|
selector: 'h2'
|
||||||
}
|
}
|
||||||
|
@ -4713,6 +4771,7 @@ var embedAttributes = {
|
||||||
type: 'string'
|
type: 'string'
|
||||||
},
|
},
|
||||||
caption: {
|
caption: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'figcaption'
|
selector: 'figcaption'
|
||||||
},
|
},
|
||||||
|
@ -5285,6 +5344,7 @@ var settings = {
|
||||||
type: 'string'
|
type: 'string'
|
||||||
},
|
},
|
||||||
fileName: {
|
fileName: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'a:not([download])'
|
selector: 'a:not([download])'
|
||||||
},
|
},
|
||||||
|
@ -5307,6 +5367,7 @@ var settings = {
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
downloadButtonText: {
|
downloadButtonText: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'a[download]',
|
selector: 'a[download]',
|
||||||
default: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["_x"])('Download', 'button label')
|
default: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["_x"])('Download', 'button label')
|
||||||
|
@ -6188,6 +6249,7 @@ var blockAttributes = {
|
||||||
attribute: 'data-id'
|
attribute: 'data-id'
|
||||||
},
|
},
|
||||||
caption: {
|
caption: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'figcaption'
|
selector: 'figcaption'
|
||||||
}
|
}
|
||||||
|
@ -6754,8 +6816,10 @@ var supports = {
|
||||||
};
|
};
|
||||||
var schema = {
|
var schema = {
|
||||||
content: {
|
content: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'h1,h2,h3,h4,h5,h6'
|
selector: 'h1,h2,h3,h4,h5,h6',
|
||||||
|
default: ''
|
||||||
},
|
},
|
||||||
level: {
|
level: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
|
@ -7908,6 +7972,7 @@ var blockAttributes = {
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
caption: {
|
caption: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'figcaption'
|
selector: 'figcaption'
|
||||||
},
|
},
|
||||||
|
@ -8996,9 +9061,11 @@ var schema = {
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
values: {
|
values: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'ol,ul',
|
selector: 'ol,ul',
|
||||||
multiline: 'li'
|
multiline: 'li',
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var name = 'core/list';
|
var name = 'core/list';
|
||||||
|
@ -10690,6 +10757,7 @@ var supports = {
|
||||||
};
|
};
|
||||||
var schema = {
|
var schema = {
|
||||||
content: {
|
content: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'p',
|
selector: 'p',
|
||||||
default: ''
|
default: ''
|
||||||
|
@ -10834,7 +10902,8 @@ var settings = {
|
||||||
attributes: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, schema, {
|
attributes: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, schema, {
|
||||||
content: {
|
content: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
source: 'html'
|
source: 'html',
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
save: function save(_ref3) {
|
save: function save(_ref3) {
|
||||||
|
@ -10967,8 +11036,10 @@ var settings = {
|
||||||
category: 'formatting',
|
category: 'formatting',
|
||||||
attributes: {
|
attributes: {
|
||||||
content: {
|
content: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'pre'
|
selector: 'pre',
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
transforms: {
|
transforms: {
|
||||||
|
@ -11260,13 +11331,16 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
|
|
||||||
var blockAttributes = {
|
var blockAttributes = {
|
||||||
value: {
|
value: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'blockquote',
|
selector: 'blockquote',
|
||||||
multiline: 'p'
|
multiline: 'p'
|
||||||
},
|
},
|
||||||
citation: {
|
citation: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'cite'
|
selector: 'cite',
|
||||||
|
default: ''
|
||||||
},
|
},
|
||||||
mainColor: {
|
mainColor: {
|
||||||
type: 'string'
|
type: 'string'
|
||||||
|
@ -11382,6 +11456,7 @@ var settings = {
|
||||||
}, {
|
}, {
|
||||||
attributes: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blockAttributes, {
|
attributes: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blockAttributes, {
|
||||||
citation: {
|
citation: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'footer'
|
selector: 'footer'
|
||||||
},
|
},
|
||||||
|
@ -11460,13 +11535,17 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
|
|
||||||
var blockAttributes = {
|
var blockAttributes = {
|
||||||
value: {
|
value: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'blockquote',
|
selector: 'blockquote',
|
||||||
multiline: 'p'
|
multiline: 'p',
|
||||||
|
default: ''
|
||||||
},
|
},
|
||||||
citation: {
|
citation: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'cite'
|
selector: 'cite',
|
||||||
|
default: ''
|
||||||
},
|
},
|
||||||
align: {
|
align: {
|
||||||
type: 'string'
|
type: 'string'
|
||||||
|
@ -11752,8 +11831,10 @@ var settings = {
|
||||||
}, {
|
}, {
|
||||||
attributes: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blockAttributes, {
|
attributes: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blockAttributes, {
|
||||||
citation: {
|
citation: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'footer'
|
selector: 'footer',
|
||||||
|
default: ''
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
|
@ -12153,6 +12234,7 @@ var settings = {
|
||||||
},
|
},
|
||||||
attributes: {
|
attributes: {
|
||||||
content: {
|
content: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'p'
|
selector: 'p'
|
||||||
},
|
},
|
||||||
|
@ -12827,6 +12909,7 @@ function getTableSectionAttributeSchema(section) {
|
||||||
selector: 'td,th',
|
selector: 'td,th',
|
||||||
query: {
|
query: {
|
||||||
content: {
|
content: {
|
||||||
|
type: 'string',
|
||||||
source: 'html'
|
source: 'html'
|
||||||
},
|
},
|
||||||
tag: {
|
tag: {
|
||||||
|
@ -13237,6 +13320,7 @@ var settings = {
|
||||||
selector: 'p',
|
selector: 'p',
|
||||||
query: {
|
query: {
|
||||||
children: {
|
children: {
|
||||||
|
type: 'string',
|
||||||
source: 'html'
|
source: 'html'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -13400,8 +13484,10 @@ var settings = {
|
||||||
keywords: [Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('poetry')],
|
keywords: [Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('poetry')],
|
||||||
attributes: {
|
attributes: {
|
||||||
content: {
|
content: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'pre'
|
selector: 'pre',
|
||||||
|
default: ''
|
||||||
},
|
},
|
||||||
textAlign: {
|
textAlign: {
|
||||||
type: 'string'
|
type: 'string'
|
||||||
|
@ -13864,6 +13950,7 @@ var settings = {
|
||||||
attribute: 'autoplay'
|
attribute: 'autoplay'
|
||||||
},
|
},
|
||||||
caption: {
|
caption: {
|
||||||
|
type: 'string',
|
||||||
source: 'html',
|
source: 'html',
|
||||||
selector: 'figcaption'
|
selector: 'figcaption'
|
||||||
},
|
},
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -619,22 +619,22 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
/**
|
/**
|
||||||
* Returns a block object given its type and attributes.
|
* Returns a block object given its type and attributes.
|
||||||
*
|
*
|
||||||
* @param {string} name Block name.
|
* @param {string} name Block name.
|
||||||
* @param {Object} blockAttributes Block attributes.
|
* @param {Object} attributes Block attributes.
|
||||||
* @param {?Array} innerBlocks Nested blocks.
|
* @param {?Array} innerBlocks Nested blocks.
|
||||||
*
|
*
|
||||||
* @return {Object} Block object.
|
* @return {Object} Block object.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function createBlock(name) {
|
function createBlock(name) {
|
||||||
var blockAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||||
var innerBlocks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
var innerBlocks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
||||||
// Get the type definition associated with a registered block.
|
// Get the type definition associated with a registered block.
|
||||||
var blockType = Object(_registration__WEBPACK_IMPORTED_MODULE_5__["getBlockType"])(name); // Ensure attributes contains only values defined by block type, and merge
|
var blockType = Object(_registration__WEBPACK_IMPORTED_MODULE_5__["getBlockType"])(name); // Ensure attributes contains only values defined by block type, and merge
|
||||||
// default values for missing attributes.
|
// default values for missing attributes.
|
||||||
|
|
||||||
var attributes = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["reduce"])(blockType.attributes, function (result, schema, key) {
|
var sanitizedAttributes = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["reduce"])(blockType.attributes, function (result, schema, key) {
|
||||||
var value = blockAttributes[key];
|
var value = attributes[key];
|
||||||
|
|
||||||
if (undefined !== value) {
|
if (undefined !== value) {
|
||||||
result[key] = value;
|
result[key] = value;
|
||||||
|
@ -642,10 +642,6 @@ function createBlock(name) {
|
||||||
result[key] = schema.default;
|
result[key] = schema.default;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (schema.source === 'html' && typeof result[key] !== 'string') {
|
|
||||||
result[key] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (['node', 'children'].indexOf(schema.source) !== -1) {
|
if (['node', 'children'].indexOf(schema.source) !== -1) {
|
||||||
// Ensure value passed is always an array, which we're expecting in
|
// Ensure value passed is always an array, which we're expecting in
|
||||||
// the RichText component to handle the deprecated value.
|
// the RichText component to handle the deprecated value.
|
||||||
|
@ -665,7 +661,7 @@ function createBlock(name) {
|
||||||
clientId: clientId,
|
clientId: clientId,
|
||||||
name: name,
|
name: name,
|
||||||
isValid: true,
|
isValid: true,
|
||||||
attributes: attributes,
|
attributes: sanitizedAttributes,
|
||||||
innerBlocks: innerBlocks
|
innerBlocks: innerBlocks
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -673,7 +669,7 @@ function createBlock(name) {
|
||||||
* Given a block object, returns a copy of the block object, optionally merging
|
* Given a block object, returns a copy of the block object, optionally merging
|
||||||
* new attributes and/or replacing its inner blocks.
|
* new attributes and/or replacing its inner blocks.
|
||||||
*
|
*
|
||||||
* @param {Object} block Block object.
|
* @param {Object} block Block instance.
|
||||||
* @param {Object} mergeAttributes Block attributes.
|
* @param {Object} mergeAttributes Block attributes.
|
||||||
* @param {?Array} newInnerBlocks Nested blocks.
|
* @param {?Array} newInnerBlocks Nested blocks.
|
||||||
*
|
*
|
||||||
|
@ -699,7 +695,6 @@ function cloneBlock(block) {
|
||||||
* @param {Object} transform The transform object to validate.
|
* @param {Object} transform The transform object to validate.
|
||||||
* @param {string} direction Is this a 'from' or 'to' transform.
|
* @param {string} direction Is this a 'from' or 'to' transform.
|
||||||
* @param {Array} blocks The blocks to transform from.
|
* @param {Array} blocks The blocks to transform from.
|
||||||
* @param {boolean} isMultiBlock Have multiple blocks been selected?
|
|
||||||
*
|
*
|
||||||
* @return {boolean} Is the transform possible?
|
* @return {boolean} Is the transform possible?
|
||||||
*/
|
*/
|
||||||
|
@ -750,7 +745,6 @@ var isPossibleTransformForSource = function isPossibleTransformForSource(transfo
|
||||||
* 'from' transforms on other blocks.
|
* 'from' transforms on other blocks.
|
||||||
*
|
*
|
||||||
* @param {Array} blocks The blocks to transform from.
|
* @param {Array} blocks The blocks to transform from.
|
||||||
* @param {boolean} isMultiBlock Have multiple blocks been selected?
|
|
||||||
*
|
*
|
||||||
* @return {Array} Block types that the blocks can be transformed into.
|
* @return {Array} Block types that the blocks can be transformed into.
|
||||||
*/
|
*/
|
||||||
|
@ -776,7 +770,6 @@ var getBlockTypesForPossibleFromTransforms = function getBlockTypesForPossibleFr
|
||||||
* the source block's own 'to' transforms.
|
* the source block's own 'to' transforms.
|
||||||
*
|
*
|
||||||
* @param {Array} blocks The blocks to transform from.
|
* @param {Array} blocks The blocks to transform from.
|
||||||
* @param {boolean} isMultiBlock Have multiple blocks been selected?
|
|
||||||
*
|
*
|
||||||
* @return {Array} Block types that the source can be transformed into.
|
* @return {Array} Block types that the source can be transformed into.
|
||||||
*/
|
*/
|
||||||
|
@ -1000,7 +993,7 @@ function switchToBlockType(blocks, name) {
|
||||||
/*!******************************************************************!*\
|
/*!******************************************************************!*\
|
||||||
!*** ./node_modules/@wordpress/blocks/build-module/api/index.js ***!
|
!*** ./node_modules/@wordpress/blocks/build-module/api/index.js ***!
|
||||||
\******************************************************************/
|
\******************************************************************/
|
||||||
/*! exports provided: createBlock, cloneBlock, getPossibleBlockTransformations, switchToBlockType, getBlockTransforms, findTransform, parse, getBlockAttributes, parseWithAttributeSchema, rawHandler, getPhrasingContentSchema, serialize, getBlockContent, getBlockDefaultClassName, getBlockMenuDefaultClassName, getSaveElement, getSaveContent, isValidBlock, getCategories, setCategories, registerBlockType, unregisterBlockType, setFreeformContentHandlerName, getFreeformContentHandlerName, setUnregisteredTypeHandlerName, getUnregisteredTypeHandlerName, setDefaultBlockName, getDefaultBlockName, getBlockType, getBlockTypes, getBlockSupport, hasBlockSupport, isReusableBlock, getChildBlockNames, hasChildBlocks, hasChildBlocksWithInserterSupport, unstable__bootstrapServerSideBlockDefinitions, registerBlockStyle, unregisterBlockStyle, isUnmodifiedDefaultBlock, normalizeIconObject, isValidIcon, doBlocksMatchTemplate, synchronizeBlocksWithTemplate, children, node */
|
/*! exports provided: createBlock, cloneBlock, getPossibleBlockTransformations, switchToBlockType, getBlockTransforms, findTransform, parse, getBlockAttributes, parseWithAttributeSchema, rawHandler, getPhrasingContentSchema, serialize, getBlockContent, getBlockDefaultClassName, getBlockMenuDefaultClassName, getSaveElement, getSaveContent, isValidBlockContent, isValidBlock, getCategories, setCategories, registerBlockType, unregisterBlockType, setFreeformContentHandlerName, getFreeformContentHandlerName, setUnregisteredTypeHandlerName, getUnregisteredTypeHandlerName, setDefaultBlockName, getDefaultBlockName, getBlockType, getBlockTypes, getBlockSupport, hasBlockSupport, isReusableBlock, getChildBlockNames, hasChildBlocks, hasChildBlocksWithInserterSupport, unstable__bootstrapServerSideBlockDefinitions, registerBlockStyle, unregisterBlockStyle, isUnmodifiedDefaultBlock, normalizeIconObject, isValidIcon, doBlocksMatchTemplate, synchronizeBlocksWithTemplate, children, node */
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
@ -1044,6 +1037,8 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getSaveContent", function() { return _serializer__WEBPACK_IMPORTED_MODULE_3__["getSaveContent"]; });
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getSaveContent", function() { return _serializer__WEBPACK_IMPORTED_MODULE_3__["getSaveContent"]; });
|
||||||
|
|
||||||
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./validation */ "./node_modules/@wordpress/blocks/build-module/api/validation.js");
|
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./validation */ "./node_modules/@wordpress/blocks/build-module/api/validation.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isValidBlockContent", function() { return _validation__WEBPACK_IMPORTED_MODULE_4__["isValidBlockContent"]; });
|
||||||
|
|
||||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isValidBlock", function() { return _validation__WEBPACK_IMPORTED_MODULE_4__["isValidBlock"]; });
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isValidBlock", function() { return _validation__WEBPACK_IMPORTED_MODULE_4__["isValidBlock"]; });
|
||||||
|
|
||||||
/* harmony import */ var _categories__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./categories */ "./node_modules/@wordpress/blocks/build-module/api/categories.js");
|
/* harmony import */ var _categories__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./categories */ "./node_modules/@wordpress/blocks/build-module/api/categories.js");
|
||||||
|
@ -1668,7 +1663,8 @@ function getBlockAttribute(attributeKey, attributeSchema, innerHTML, commentAttr
|
||||||
* @return {Object} All block attributes.
|
* @return {Object} All block attributes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getBlockAttributes(blockType, innerHTML, attributes) {
|
function getBlockAttributes(blockType, innerHTML) {
|
||||||
|
var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||||
var blockAttributes = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["mapValues"])(blockType.attributes, function (attributeSchema, attributeKey) {
|
var blockAttributes = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["mapValues"])(blockType.attributes, function (attributeSchema, attributeKey) {
|
||||||
return getBlockAttribute(attributeKey, attributeSchema, innerHTML, attributes);
|
return getBlockAttribute(attributeKey, attributeSchema, innerHTML, attributes);
|
||||||
});
|
});
|
||||||
|
@ -1714,7 +1710,7 @@ function getMigratedBlock(block) {
|
||||||
var deprecatedBlockType = Object.assign(Object(lodash__WEBPACK_IMPORTED_MODULE_3__["omit"])(blockType, ['attributes', 'save', 'supports']), deprecatedDefinitions[i]);
|
var deprecatedBlockType = Object.assign(Object(lodash__WEBPACK_IMPORTED_MODULE_3__["omit"])(blockType, ['attributes', 'save', 'supports']), deprecatedDefinitions[i]);
|
||||||
var migratedAttributes = getBlockAttributes(deprecatedBlockType, originalContent, attributes); // Ignore the deprecation if it produces a block which is not valid.
|
var migratedAttributes = getBlockAttributes(deprecatedBlockType, originalContent, attributes); // Ignore the deprecation if it produces a block which is not valid.
|
||||||
|
|
||||||
var isValid = Object(_validation__WEBPACK_IMPORTED_MODULE_9__["isValidBlock"])(originalContent, deprecatedBlockType, migratedAttributes);
|
var isValid = Object(_validation__WEBPACK_IMPORTED_MODULE_9__["isValidBlockContent"])(deprecatedBlockType, migratedAttributes, originalContent);
|
||||||
|
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -1818,7 +1814,7 @@ function createBlockWithFallback(blockNode) {
|
||||||
// the block. When both match, the block is marked as valid.
|
// the block. When both match, the block is marked as valid.
|
||||||
|
|
||||||
if (!isFallbackBlock) {
|
if (!isFallbackBlock) {
|
||||||
block.isValid = Object(_validation__WEBPACK_IMPORTED_MODULE_9__["isValidBlock"])(innerHTML, blockType, block.attributes);
|
block.isValid = Object(_validation__WEBPACK_IMPORTED_MODULE_9__["isValidBlockContent"])(blockType, block.attributes, innerHTML);
|
||||||
} // Preserve original content for future use in case the block is parsed as
|
} // Preserve original content for future use in case the block is parsed as
|
||||||
// invalid, or future serialization attempt results in an error.
|
// invalid, or future serialization attempt results in an error.
|
||||||
|
|
||||||
|
@ -3545,11 +3541,11 @@ function unregisterBlockType(name) {
|
||||||
/**
|
/**
|
||||||
* Assigns name of block for handling non-block content.
|
* Assigns name of block for handling non-block content.
|
||||||
*
|
*
|
||||||
* @param {string} name Block name.
|
* @param {string} blockName Block name.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function setFreeformContentHandlerName(name) {
|
function setFreeformContentHandlerName(blockName) {
|
||||||
Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["dispatch"])('core/blocks').setFreeformFallbackBlockName(name);
|
Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["dispatch"])('core/blocks').setFreeformFallbackBlockName(blockName);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Retrieves name of block handling non-block content, or undefined if no
|
* Retrieves name of block handling non-block content, or undefined if no
|
||||||
|
@ -3564,11 +3560,11 @@ function getFreeformContentHandlerName() {
|
||||||
/**
|
/**
|
||||||
* Assigns name of block handling unregistered block types.
|
* Assigns name of block handling unregistered block types.
|
||||||
*
|
*
|
||||||
* @param {string} name Block name.
|
* @param {string} blockName Block name.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function setUnregisteredTypeHandlerName(name) {
|
function setUnregisteredTypeHandlerName(blockName) {
|
||||||
Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["dispatch"])('core/blocks').setUnregisteredFallbackBlockName(name);
|
Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["dispatch"])('core/blocks').setUnregisteredFallbackBlockName(blockName);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Retrieves name of block handling unregistered block types, or undefined if no
|
* Retrieves name of block handling unregistered block types, or undefined if no
|
||||||
|
@ -3895,15 +3891,15 @@ function getSaveContent(blockType, attributes, innerBlocks) {
|
||||||
* This function returns only those attributes which are needed to persist and
|
* This function returns only those attributes which are needed to persist and
|
||||||
* which cannot be matched from the block content.
|
* which cannot be matched from the block content.
|
||||||
*
|
*
|
||||||
* @param {Object<string,*>} allAttributes Attributes from in-memory block data.
|
|
||||||
* @param {Object<string,*>} blockType Block type.
|
* @param {Object<string,*>} blockType Block type.
|
||||||
|
* @param {Object<string,*>} attributes Attributes from in-memory block data.
|
||||||
*
|
*
|
||||||
* @return {Object<string,*>} Subset of attributes for comment serialization.
|
* @return {Object<string,*>} Subset of attributes for comment serialization.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getCommentAttributes(allAttributes, blockType) {
|
function getCommentAttributes(blockType, attributes) {
|
||||||
var attributes = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["reduce"])(blockType.attributes, function (result, attributeSchema, key) {
|
return Object(lodash__WEBPACK_IMPORTED_MODULE_2__["reduce"])(blockType.attributes, function (result, attributeSchema, key) {
|
||||||
var value = allAttributes[key]; // Ignore undefined values.
|
var value = attributes[key]; // Ignore undefined values.
|
||||||
|
|
||||||
if (undefined === value) {
|
if (undefined === value) {
|
||||||
return result;
|
return result;
|
||||||
|
@ -3924,7 +3920,6 @@ function getCommentAttributes(allAttributes, blockType) {
|
||||||
result[key] = value;
|
result[key] = value;
|
||||||
return result;
|
return result;
|
||||||
}, {});
|
}, {});
|
||||||
return attributes;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Given an attributes object, returns a string in the serialized attributes
|
* Given an attributes object, returns a string in the serialized attributes
|
||||||
|
@ -3947,7 +3942,7 @@ function serializeAttributes(attributes) {
|
||||||
/**
|
/**
|
||||||
* Given a block object, returns the Block's Inner HTML markup.
|
* Given a block object, returns the Block's Inner HTML markup.
|
||||||
*
|
*
|
||||||
* @param {Object} block Block Object.
|
* @param {Object} block Block instance.
|
||||||
*
|
*
|
||||||
* @return {string} HTML.
|
* @return {string} HTML.
|
||||||
*/
|
*/
|
||||||
|
@ -4004,7 +3999,7 @@ function serializeBlock(block) {
|
||||||
var blockName = block.name;
|
var blockName = block.name;
|
||||||
var blockType = Object(_registration__WEBPACK_IMPORTED_MODULE_5__["getBlockType"])(blockName);
|
var blockType = Object(_registration__WEBPACK_IMPORTED_MODULE_5__["getBlockType"])(blockName);
|
||||||
var saveContent = getBlockContent(block);
|
var saveContent = getBlockContent(block);
|
||||||
var saveAttributes = getCommentAttributes(block.attributes, blockType);
|
var saveAttributes = getCommentAttributes(blockType, block.attributes);
|
||||||
|
|
||||||
switch (blockName) {
|
switch (blockName) {
|
||||||
case Object(_registration__WEBPACK_IMPORTED_MODULE_5__["getFreeformContentHandlerName"])():
|
case Object(_registration__WEBPACK_IMPORTED_MODULE_5__["getFreeformContentHandlerName"])():
|
||||||
|
@ -4181,17 +4176,19 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUnmodifiedDefaultBlock", function() { return isUnmodifiedDefaultBlock; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUnmodifiedDefaultBlock", function() { return isUnmodifiedDefaultBlock; });
|
||||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidIcon", function() { return isValidIcon; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidIcon", function() { return isValidIcon; });
|
||||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeIconObject", function() { return normalizeIconObject; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeIconObject", function() { return normalizeIconObject; });
|
||||||
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
|
||||||
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash");
|
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
|
||||||
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash");
|
||||||
/* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tinycolor2 */ "./node_modules/tinycolor2/tinycolor.js");
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
/* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(tinycolor2__WEBPACK_IMPORTED_MODULE_2__);
|
/* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! tinycolor2 */ "./node_modules/tinycolor2/tinycolor.js");
|
||||||
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
|
/* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(tinycolor2__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__);
|
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
|
||||||
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_4__);
|
||||||
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__);
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
||||||
/* harmony import */ var _registration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./registration */ "./node_modules/@wordpress/blocks/build-module/api/registration.js");
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
|
||||||
/* harmony import */ var _factory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./factory */ "./node_modules/@wordpress/blocks/build-module/api/factory.js");
|
/* harmony import */ var _registration__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./registration */ "./node_modules/@wordpress/blocks/build-module/api/registration.js");
|
||||||
|
/* harmony import */ var _factory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./factory */ "./node_modules/@wordpress/blocks/build-module/api/factory.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4230,16 +4227,16 @@ var ICON_COLORS = ['#191e23', '#f8f9f9'];
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function isUnmodifiedDefaultBlock(block) {
|
function isUnmodifiedDefaultBlock(block) {
|
||||||
var defaultBlockName = Object(_registration__WEBPACK_IMPORTED_MODULE_5__["getDefaultBlockName"])();
|
var defaultBlockName = Object(_registration__WEBPACK_IMPORTED_MODULE_6__["getDefaultBlockName"])();
|
||||||
|
|
||||||
if (block.name !== defaultBlockName) {
|
if (block.name !== defaultBlockName) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var newDefaultBlock = Object(_factory__WEBPACK_IMPORTED_MODULE_6__["createBlock"])(defaultBlockName);
|
var newDefaultBlock = Object(_factory__WEBPACK_IMPORTED_MODULE_7__["createBlock"])(defaultBlockName);
|
||||||
var attributeKeys = Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__["applyFilters"])('blocks.isUnmodifiedDefaultBlock.attributes', Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(lodash__WEBPACK_IMPORTED_MODULE_1__["keys"])(newDefaultBlock.attributes)).concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(lodash__WEBPACK_IMPORTED_MODULE_1__["keys"])(block.attributes))));
|
var attributeKeys = Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_4__["applyFilters"])('blocks.isUnmodifiedDefaultBlock.attributes', Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(lodash__WEBPACK_IMPORTED_MODULE_2__["keys"])(newDefaultBlock.attributes)).concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(lodash__WEBPACK_IMPORTED_MODULE_2__["keys"])(block.attributes))));
|
||||||
return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["every"])(attributeKeys, function (key) {
|
return Object(lodash__WEBPACK_IMPORTED_MODULE_2__["every"])(attributeKeys, function (key) {
|
||||||
return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isEqual"])(newDefaultBlock.attributes[key], block.attributes[key]);
|
return Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isEqual"])(newDefaultBlock.attributes[key], block.attributes[key]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -4251,7 +4248,7 @@ function isUnmodifiedDefaultBlock(block) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function isValidIcon(icon) {
|
function isValidIcon(icon) {
|
||||||
return !!icon && (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isString"])(icon) || Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__["isValidElement"])(icon) || Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isFunction"])(icon) || icon instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_4__["Component"]);
|
return !!icon && (Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isString"])(icon) || Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["isValidElement"])(icon) || Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(icon) || icon instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Function that receives an icon as set by the blocks during the registration
|
* Function that receives an icon as set by the blocks during the registration
|
||||||
|
@ -4267,9 +4264,7 @@ function isValidIcon(icon) {
|
||||||
|
|
||||||
function normalizeIconObject(icon) {
|
function normalizeIconObject(icon) {
|
||||||
if (!icon) {
|
if (!icon) {
|
||||||
return {
|
icon = 'block-default';
|
||||||
src: 'block-default'
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isValidIcon(icon)) {
|
if (isValidIcon(icon)) {
|
||||||
|
@ -4278,19 +4273,16 @@ function normalizeIconObject(icon) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (icon.background) {
|
if (Object(lodash__WEBPACK_IMPORTED_MODULE_2__["has"])(icon, ['background'])) {
|
||||||
var tinyBgColor = tinycolor2__WEBPACK_IMPORTED_MODULE_2___default()(icon.background);
|
var tinyBgColor = tinycolor2__WEBPACK_IMPORTED_MODULE_3___default()(icon.background);
|
||||||
|
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, icon, {
|
||||||
if (!icon.foreground) {
|
foreground: icon.foreground ? icon.foreground : Object(tinycolor2__WEBPACK_IMPORTED_MODULE_3__["mostReadable"])(tinyBgColor, ICON_COLORS, {
|
||||||
var foreground = Object(tinycolor2__WEBPACK_IMPORTED_MODULE_2__["mostReadable"])(tinyBgColor, ICON_COLORS, {
|
|
||||||
includeFallbackColors: true,
|
includeFallbackColors: true,
|
||||||
level: 'AA',
|
level: 'AA',
|
||||||
size: 'large'
|
size: 'large'
|
||||||
}).toHexString();
|
}).toHexString(),
|
||||||
icon.foreground = foreground;
|
shadowColor: tinyBgColor.setAlpha(0.3).toRgbString()
|
||||||
}
|
});
|
||||||
|
|
||||||
icon.shadowColor = tinyBgColor.setAlpha(0.3).toRgbString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return icon;
|
return icon;
|
||||||
|
@ -4303,7 +4295,7 @@ function normalizeIconObject(icon) {
|
||||||
/*!***********************************************************************!*\
|
/*!***********************************************************************!*\
|
||||||
!*** ./node_modules/@wordpress/blocks/build-module/api/validation.js ***!
|
!*** ./node_modules/@wordpress/blocks/build-module/api/validation.js ***!
|
||||||
\***********************************************************************/
|
\***********************************************************************/
|
||||||
/*! exports provided: getTextPiecesSplitOnWhitespace, getTextWithCollapsedWhitespace, getMeaningfulAttributePairs, isEqualTextTokensWithCollapsedWhitespace, getNormalizedStyleValue, getStyleProperties, isEqualAttributesOfName, isEqualTagAttributePairs, isEqualTokensOfType, getNextNonWhitespaceToken, isClosedByToken, isEquivalentHTML, isValidBlock */
|
/*! exports provided: getTextPiecesSplitOnWhitespace, getTextWithCollapsedWhitespace, getMeaningfulAttributePairs, isEqualTextTokensWithCollapsedWhitespace, getNormalizedStyleValue, getStyleProperties, isEqualAttributesOfName, isEqualTagAttributePairs, isEqualTokensOfType, getNextNonWhitespaceToken, isClosedByToken, isEquivalentHTML, isValidBlock, isValidBlockContent */
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
@ -4321,6 +4313,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isClosedByToken", function() { return isClosedByToken; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isClosedByToken", function() { return isClosedByToken; });
|
||||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEquivalentHTML", function() { return isEquivalentHTML; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEquivalentHTML", function() { return isEquivalentHTML; });
|
||||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidBlock", function() { return isValidBlock; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidBlock", function() { return isValidBlock; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidBlockContent", function() { return isValidBlockContent; });
|
||||||
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
|
||||||
/* harmony import */ var _babel_runtime_helpers_esm_toArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toArray */ "./node_modules/@babel/runtime/helpers/esm/toArray.js");
|
/* harmony import */ var _babel_runtime_helpers_esm_toArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toArray */ "./node_modules/@babel/runtime/helpers/esm/toArray.js");
|
||||||
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
|
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
|
||||||
|
@ -4328,7 +4321,9 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony import */ var simple_html_tokenizer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! simple-html-tokenizer */ "./node_modules/simple-html-tokenizer/dist/es6/index.js");
|
/* harmony import */ var simple_html_tokenizer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! simple-html-tokenizer */ "./node_modules/simple-html-tokenizer/dist/es6/index.js");
|
||||||
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash */ "lodash");
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash */ "lodash");
|
||||||
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_5__);
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_5__);
|
||||||
/* harmony import */ var _serializer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./serializer */ "./node_modules/@wordpress/blocks/build-module/api/serializer.js");
|
/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/deprecated */ "@wordpress/deprecated");
|
||||||
|
/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_6__);
|
||||||
|
/* harmony import */ var _serializer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./serializer */ "./node_modules/@wordpress/blocks/build-module/api/serializer.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -4339,6 +4334,11 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
|
@ -4771,6 +4771,15 @@ function isEquivalentHTML(actual, expected) {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
function isValidBlock(innerHTML, blockType, attributes) {
|
||||||
|
_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_6___default()('isValidBlock', {
|
||||||
|
plugin: 'Gutenberg',
|
||||||
|
version: '4.4',
|
||||||
|
alternative: 'isValidBlockContent',
|
||||||
|
hint: 'The order of params has changed.'
|
||||||
|
});
|
||||||
|
return isValidBlockContent(blockType, attributes, innerHTML);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Returns true if the parsed block is valid given the input content. A block
|
* Returns true if the parsed block is valid given the input content. A block
|
||||||
* is considered valid if, when serialized with assumed attributes, the content
|
* is considered valid if, when serialized with assumed attributes, the content
|
||||||
|
@ -4778,18 +4787,18 @@ function isEquivalentHTML(actual, expected) {
|
||||||
*
|
*
|
||||||
* Logs to console in development environments when invalid.
|
* Logs to console in development environments when invalid.
|
||||||
*
|
*
|
||||||
* @param {string} innerHTML Original block content.
|
|
||||||
* @param {string} blockType Block type.
|
* @param {string} blockType Block type.
|
||||||
* @param {Object} attributes Parsed block attributes.
|
* @param {Object} attributes Parsed block attributes.
|
||||||
|
* @param {string} innerHTML Original block content.
|
||||||
*
|
*
|
||||||
* @return {boolean} Whether block is valid.
|
* @return {boolean} Whether block is valid.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function isValidBlock(innerHTML, blockType, attributes) {
|
function isValidBlockContent(blockType, attributes, innerHTML) {
|
||||||
var saveContent;
|
var saveContent;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
saveContent = Object(_serializer__WEBPACK_IMPORTED_MODULE_6__["getSaveContent"])(blockType, attributes);
|
saveContent = Object(_serializer__WEBPACK_IMPORTED_MODULE_7__["getSaveContent"])(blockType, attributes);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error('Block validation failed because an error occurred while generating block content:\n\n%s', error.toString());
|
log.error('Block validation failed because an error occurred while generating block content:\n\n%s', error.toString());
|
||||||
return false;
|
return false;
|
||||||
|
@ -4900,7 +4909,7 @@ var withBlockContentContext = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE
|
||||||
/*!**************************************************************!*\
|
/*!**************************************************************!*\
|
||||||
!*** ./node_modules/@wordpress/blocks/build-module/index.js ***!
|
!*** ./node_modules/@wordpress/blocks/build-module/index.js ***!
|
||||||
\**************************************************************/
|
\**************************************************************/
|
||||||
/*! exports provided: withBlockContentContext, createBlock, cloneBlock, getPossibleBlockTransformations, switchToBlockType, getBlockTransforms, findTransform, parse, getBlockAttributes, parseWithAttributeSchema, rawHandler, getPhrasingContentSchema, serialize, getBlockContent, getBlockDefaultClassName, getBlockMenuDefaultClassName, getSaveElement, getSaveContent, isValidBlock, getCategories, setCategories, registerBlockType, unregisterBlockType, setFreeformContentHandlerName, getFreeformContentHandlerName, setUnregisteredTypeHandlerName, getUnregisteredTypeHandlerName, setDefaultBlockName, getDefaultBlockName, getBlockType, getBlockTypes, getBlockSupport, hasBlockSupport, isReusableBlock, getChildBlockNames, hasChildBlocks, hasChildBlocksWithInserterSupport, unstable__bootstrapServerSideBlockDefinitions, registerBlockStyle, unregisterBlockStyle, isUnmodifiedDefaultBlock, normalizeIconObject, isValidIcon, doBlocksMatchTemplate, synchronizeBlocksWithTemplate, children, node */
|
/*! exports provided: withBlockContentContext, createBlock, cloneBlock, getPossibleBlockTransformations, switchToBlockType, getBlockTransforms, findTransform, parse, getBlockAttributes, parseWithAttributeSchema, rawHandler, getPhrasingContentSchema, serialize, getBlockContent, getBlockDefaultClassName, getBlockMenuDefaultClassName, getSaveElement, getSaveContent, isValidBlockContent, isValidBlock, getCategories, setCategories, registerBlockType, unregisterBlockType, setFreeformContentHandlerName, getFreeformContentHandlerName, setUnregisteredTypeHandlerName, getUnregisteredTypeHandlerName, setDefaultBlockName, getDefaultBlockName, getBlockType, getBlockTypes, getBlockSupport, hasBlockSupport, isReusableBlock, getChildBlockNames, hasChildBlocks, hasChildBlocksWithInserterSupport, unstable__bootstrapServerSideBlockDefinitions, registerBlockStyle, unregisterBlockStyle, isUnmodifiedDefaultBlock, normalizeIconObject, isValidIcon, doBlocksMatchTemplate, synchronizeBlocksWithTemplate, children, node */
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
@ -4941,6 +4950,8 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
|
|
||||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getSaveContent", function() { return _api__WEBPACK_IMPORTED_MODULE_1__["getSaveContent"]; });
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getSaveContent", function() { return _api__WEBPACK_IMPORTED_MODULE_1__["getSaveContent"]; });
|
||||||
|
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isValidBlockContent", function() { return _api__WEBPACK_IMPORTED_MODULE_1__["isValidBlockContent"]; });
|
||||||
|
|
||||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isValidBlock", function() { return _api__WEBPACK_IMPORTED_MODULE_1__["isValidBlock"]; });
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isValidBlock", function() { return _api__WEBPACK_IMPORTED_MODULE_1__["isValidBlock"]; });
|
||||||
|
|
||||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCategories", function() { return _api__WEBPACK_IMPORTED_MODULE_1__["getCategories"]; });
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCategories", function() { return _api__WEBPACK_IMPORTED_MODULE_1__["getCategories"]; });
|
||||||
|
@ -12594,6 +12605,17 @@ module.exports = v4;
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/deprecated":
|
||||||
|
/*!*********************************************!*\
|
||||||
|
!*** external {"this":["wp","deprecated"]} ***!
|
||||||
|
\*********************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["deprecated"]; }());
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
/***/ "@wordpress/dom":
|
/***/ "@wordpress/dom":
|
||||||
/*!**************************************!*\
|
/*!**************************************!*\
|
||||||
!*** external {"this":["wp","dom"]} ***!
|
!*** external {"this":["wp","dom"]} ***!
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1428,6 +1428,10 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var ariaClosed = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Show more tools & options');
|
||||||
|
|
||||||
|
var ariaOpen = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Hide more tools & options');
|
||||||
|
|
||||||
var MoreMenu = function MoreMenu() {
|
var MoreMenu = function MoreMenu() {
|
||||||
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Dropdown"], {
|
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Dropdown"], {
|
||||||
className: "edit-post-more-menu",
|
className: "edit-post-more-menu",
|
||||||
|
@ -1438,7 +1442,7 @@ var MoreMenu = function MoreMenu() {
|
||||||
onToggle = _ref.onToggle;
|
onToggle = _ref.onToggle;
|
||||||
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["IconButton"], {
|
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["IconButton"], {
|
||||||
icon: "ellipsis",
|
icon: "ellipsis",
|
||||||
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["_x"])('More', 'button to expand options'),
|
label: isOpen ? ariaOpen : ariaClosed,
|
||||||
onClick: onToggle,
|
onClick: onToggle,
|
||||||
"aria-expanded": isOpen
|
"aria-expanded": isOpen
|
||||||
});
|
});
|
||||||
|
@ -5597,7 +5601,7 @@ function closeGeneralSidebar() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Returns an action object used in signalling that the user opened an editor sidebar.
|
* Returns an action object used in signalling that the user opened a modal.
|
||||||
*
|
*
|
||||||
* @param {string} name A string that uniquely identifies the modal.
|
* @param {string} name A string that uniquely identifies the modal.
|
||||||
*
|
*
|
||||||
|
@ -5611,7 +5615,7 @@ function openModal(name) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Returns an action object signalling that the user closed the sidebar.
|
* Returns an action object signalling that the user closed a modal.
|
||||||
*
|
*
|
||||||
* @return {Object} Action object.
|
* @return {Object} Action object.
|
||||||
*/
|
*/
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1584,8 +1584,6 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
|
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
|
||||||
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
|
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
|
|
||||||
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1597,7 +1595,6 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers a new format provided a unique name and an object defining its
|
* Registers a new format provided a unique name and an object defining its
|
||||||
* behavior.
|
* behavior.
|
||||||
|
@ -1649,13 +1646,6 @@ function registerFormatType(name, settings) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.icon = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["normalizeIconObject"])(settings.icon);
|
|
||||||
|
|
||||||
if (!Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["isValidIcon"])(settings.icon.src)) {
|
|
||||||
window.console.error('The icon passed is invalid. ' + 'The icon should be a string, an element, a function, or an object following the specifications documented in https://wordpress.org/gutenberg/handbook/format-api/#icon-optional');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["dispatch"])('core/rich-text').addFormatTypes(settings);
|
Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["dispatch"])('core/rich-text').addFormatTypes(settings);
|
||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
@ -3133,17 +3123,6 @@ function isShallowEqual( a, b, fromIndex ) {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "@wordpress/blocks":
|
|
||||||
/*!*****************************************!*\
|
|
||||||
!*** external {"this":["wp","blocks"]} ***!
|
|
||||||
\*****************************************/
|
|
||||||
/*! no static exports found */
|
|
||||||
/***/ (function(module, exports) {
|
|
||||||
|
|
||||||
(function() { module.exports = this["wp"]["blocks"]; }());
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "@wordpress/data":
|
/***/ "@wordpress/data":
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.0-beta1-43843';
|
$wp_version = '5.0-beta2';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue