Scripts: Revert some functions being incorrectly removed in [44163].

Built from https://develop.svn.wordpress.org/trunk@44164


git-svn-id: http://core.svn.wordpress.org/trunk@43994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2018-12-14 04:53:54 +00:00
parent bffe848347
commit 47b6c4e0d7
37 changed files with 28250 additions and 21325 deletions

View File

@ -272,8 +272,9 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _middlewares_nonce__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./middlewares/nonce */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/nonce.js"); /* harmony import */ var _middlewares_nonce__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./middlewares/nonce */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/nonce.js");
/* harmony import */ var _middlewares_root_url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./middlewares/root-url */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/root-url.js"); /* harmony import */ var _middlewares_root_url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./middlewares/root-url */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/root-url.js");
/* harmony import */ var _middlewares_preloading__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./middlewares/preloading */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/preloading.js"); /* harmony import */ var _middlewares_preloading__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./middlewares/preloading */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/preloading.js");
/* harmony import */ var _middlewares_namespace_endpoint__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./middlewares/namespace-endpoint */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js"); /* harmony import */ var _middlewares_fetch_all_middleware__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./middlewares/fetch-all-middleware */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/fetch-all-middleware.js");
/* harmony import */ var _middlewares_http_v1__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./middlewares/http-v1 */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/http-v1.js"); /* harmony import */ var _middlewares_namespace_endpoint__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./middlewares/namespace-endpoint */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js");
/* harmony import */ var _middlewares_http_v1__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./middlewares/http-v1 */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/http-v1.js");
@ -291,6 +292,7 @@ __webpack_require__.r(__webpack_exports__);
var middlewares = []; var middlewares = [];
function registerMiddleware(middleware) { function registerMiddleware(middleware) {
@ -400,23 +402,205 @@ function apiFetch(options) {
}); });
}; };
var steps = [raw, _middlewares_http_v1__WEBPACK_IMPORTED_MODULE_8__["default"], _middlewares_namespace_endpoint__WEBPACK_IMPORTED_MODULE_7__["default"]].concat(middlewares); var steps = [raw, _middlewares_fetch_all_middleware__WEBPACK_IMPORTED_MODULE_7__["default"], _middlewares_http_v1__WEBPACK_IMPORTED_MODULE_9__["default"], _middlewares_namespace_endpoint__WEBPACK_IMPORTED_MODULE_8__["default"]].concat(middlewares).reverse();
var next = function next(nextOptions) { var runMiddleware = function runMiddleware(index) {
var nextMiddleware = steps.pop(); return function (nextOptions) {
var nextMiddleware = steps[index];
var next = runMiddleware(index + 1);
return nextMiddleware(nextOptions, next); return nextMiddleware(nextOptions, next);
}; };
};
return next(options); return runMiddleware(0)(options);
} }
apiFetch.use = registerMiddleware; apiFetch.use = registerMiddleware;
apiFetch.createNonceMiddleware = _middlewares_nonce__WEBPACK_IMPORTED_MODULE_4__["default"]; apiFetch.createNonceMiddleware = _middlewares_nonce__WEBPACK_IMPORTED_MODULE_4__["default"];
apiFetch.createPreloadingMiddleware = _middlewares_preloading__WEBPACK_IMPORTED_MODULE_6__["default"]; apiFetch.createPreloadingMiddleware = _middlewares_preloading__WEBPACK_IMPORTED_MODULE_6__["default"];
apiFetch.createRootURLMiddleware = _middlewares_root_url__WEBPACK_IMPORTED_MODULE_5__["default"]; apiFetch.createRootURLMiddleware = _middlewares_root_url__WEBPACK_IMPORTED_MODULE_5__["default"];
apiFetch.fetchAllMiddleware = _middlewares_fetch_all_middleware__WEBPACK_IMPORTED_MODULE_7__["default"];
/* harmony default export */ __webpack_exports__["default"] = (apiFetch); /* harmony default export */ __webpack_exports__["default"] = (apiFetch);
/***/ }),
/***/ "./node_modules/@wordpress/api-fetch/build-module/middlewares/fetch-all-middleware.js":
/*!********************************************************************************************!*\
!*** ./node_modules/@wordpress/api-fetch/build-module/middlewares/fetch-all-middleware.js ***!
\********************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_3__);
/**
* WordPress dependencies
*/
// Apply query arguments to both URL and Path, whichever is present.
var modifyQuery = function modifyQuery(_ref, queryArgs) {
var path = _ref.path,
url = _ref.url,
options = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__["default"])(_ref, ["path", "url"]);
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, options, {
url: url && Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_3__["addQueryArgs"])(url, queryArgs),
path: path && Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_3__["addQueryArgs"])(path, queryArgs)
});
}; // Duplicates parsing functionality from apiFetch.
var parseResponse = function parseResponse(response) {
return response.json ? response.json() : Promise.reject(response);
};
var parseLinkHeader = function parseLinkHeader(linkHeader) {
if (!linkHeader) {
return {};
}
var match = linkHeader.match(/<([^>]+)>; rel="next"/);
return match ? {
next: match[1]
} : {};
};
var getNextPageUrl = function getNextPageUrl(response) {
var _parseLinkHeader = parseLinkHeader(response.headers.get('link')),
next = _parseLinkHeader.next;
return next;
};
var requestContainsUnboundedQuery = function requestContainsUnboundedQuery(options) {
var pathIsUnbounded = options.path && options.path.indexOf('per_page=-1') !== -1;
var urlIsUnbounded = options.url && options.url.indexOf('per_page=-1') !== -1;
return pathIsUnbounded || urlIsUnbounded;
}; // The REST API enforces an upper limit on the per_page option. To handle large
// collections, apiFetch consumers can pass `per_page=-1`; this middleware will
// then recursively assemble a full response array from all available pages.
var fetchAllMiddleware =
/*#__PURE__*/
function () {
var _ref2 = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(options, next) {
var response, results, nextPage, mergedResults, nextResponse, nextResults;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
if (!(options.parse === false)) {
_context.next = 2;
break;
}
return _context.abrupt("return", next(options));
case 2:
if (requestContainsUnboundedQuery(options)) {
_context.next = 4;
break;
}
return _context.abrupt("return", next(options));
case 4:
_context.next = 6;
return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, modifyQuery(options, {
per_page: 100
}), {
// Ensure headers are returned for page 1.
parse: false
}));
case 6:
response = _context.sent;
_context.next = 9;
return parseResponse(response);
case 9:
results = _context.sent;
if (Array.isArray(results)) {
_context.next = 12;
break;
}
return _context.abrupt("return", results);
case 12:
nextPage = getNextPageUrl(response);
if (nextPage) {
_context.next = 15;
break;
}
return _context.abrupt("return", results);
case 15:
// Iteratively fetch all remaining pages until no "next" header is found.
mergedResults = [].concat(results);
case 16:
if (!nextPage) {
_context.next = 27;
break;
}
_context.next = 19;
return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, options, {
// Ensure the URL for the next page is used instead of any provided path.
path: undefined,
url: nextPage,
// Ensure we still get headers so we can identify the next page.
parse: false
}));
case 19:
nextResponse = _context.sent;
_context.next = 22;
return parseResponse(nextResponse);
case 22:
nextResults = _context.sent;
mergedResults = mergedResults.concat(nextResults);
nextPage = getNextPageUrl(nextResponse);
_context.next = 16;
break;
case 27:
return _context.abrupt("return", mergedResults);
case 28:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
return function fetchAllMiddleware(_x, _x2) {
return _ref2.apply(this, arguments);
};
}();
/* harmony default export */ __webpack_exports__["default"] = (fetchAllMiddleware);
/***/ }), /***/ }),
/***/ "./node_modules/@wordpress/api-fetch/build-module/middlewares/http-v1.js": /***/ "./node_modules/@wordpress/api-fetch/build-module/middlewares/http-v1.js":
@ -689,6 +873,17 @@ var createRootURLMiddleware = function createRootURLMiddleware(rootURL) {
(function() { module.exports = this["wp"]["i18n"]; }()); (function() { module.exports = this["wp"]["i18n"]; }());
/***/ }),
/***/ "@wordpress/url":
/*!**************************************!*\
!*** external {"this":["wp","url"]} ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["url"]; }());
/***/ }) /***/ })
/******/ })["default"]; /******/ })["default"];

File diff suppressed because one or more lines are too long

View File

@ -91,7 +91,7 @@ this["wp"] = this["wp"] || {}; this["wp"]["blob"] =
/*!************************************************************!*\ /*!************************************************************!*\
!*** ./node_modules/@wordpress/blob/build-module/index.js ***! !*** ./node_modules/@wordpress/blob/build-module/index.js ***!
\************************************************************/ \************************************************************/
/*! exports provided: createBlobURL, getBlobByURL, revokeBlobURL */ /*! exports provided: createBlobURL, getBlobByURL, revokeBlobURL, isBlobURL */
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
@ -99,6 +99,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createBlobURL", function() { return createBlobURL; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createBlobURL", function() { return createBlobURL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlobByURL", function() { return getBlobByURL; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlobByURL", function() { return getBlobByURL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "revokeBlobURL", function() { return revokeBlobURL; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "revokeBlobURL", function() { return revokeBlobURL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBlobURL", function() { return isBlobURL; });
/** /**
* Browser dependencies * Browser dependencies
*/ */
@ -145,6 +146,21 @@ function revokeBlobURL(url) {
delete cache[url]; delete cache[url];
} }
/**
* Check whether a url is a blob url.
*
* @param {string} url The URL.
*
* @return {boolean} Is the url a blob url?
*/
function isBlobURL(url) {
if (!url || !url.indexOf) {
return false;
}
return url.indexOf('blob:') === 0;
}
/***/ }) /***/ })

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

View File

@ -642,6 +642,10 @@ 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.
@ -1775,10 +1779,15 @@ function createBlockWithFallback(blockNode) {
var unregisteredFallbackBlock = Object(_registration__WEBPACK_IMPORTED_MODULE_8__["getUnregisteredTypeHandlerName"])() || freeformContentFallbackBlock; var unregisteredFallbackBlock = Object(_registration__WEBPACK_IMPORTED_MODULE_8__["getUnregisteredTypeHandlerName"])() || freeformContentFallbackBlock;
attributes = attributes || {}; // Trim content to avoid creation of intermediary freeform segments. attributes = attributes || {}; // Trim content to avoid creation of intermediary freeform segments.
var originalUndelimitedContent = innerHTML = innerHTML.trim(); // Use type from block content if available. Otherwise, default to the innerHTML = innerHTML.trim(); // Use type from block content if available. Otherwise, default to the
// freeform content fallback. // freeform content fallback.
var name = originalName || freeformContentFallbackBlock; // Convert 'core/text' blocks in existing content to 'core/paragraph'. var name = originalName || freeformContentFallbackBlock; // Convert 'core/cover-image' block in existing content to 'core/cover'.
if ('core/cover-image' === name) {
name = 'core/cover';
} // Convert 'core/text' blocks in existing content to 'core/paragraph'.
if ('core/text' === name || 'core/cover-text' === name) { if ('core/text' === name || 'core/cover-text' === name) {
name = 'core/paragraph'; name = 'core/paragraph';
@ -1795,8 +1804,10 @@ function createBlockWithFallback(blockNode) {
var blockType = Object(_registration__WEBPACK_IMPORTED_MODULE_8__["getBlockType"])(name); var blockType = Object(_registration__WEBPACK_IMPORTED_MODULE_8__["getBlockType"])(name);
if (!blockType) { if (!blockType) {
// If detected as a block which is not registered, preserve comment // Preserve undelimited content for use by the unregistered type handler.
var originalUndelimitedContent = innerHTML; // If detected as a block which is not registered, preserve comment
// delimiters in content of unregistered type handler. // delimiters in content of unregistered type handler.
if (name) { if (name) {
innerHTML = Object(_serializer__WEBPACK_IMPORTED_MODULE_11__["getCommentDelimitedContent"])(name, attributes, innerHTML); innerHTML = Object(_serializer__WEBPACK_IMPORTED_MODULE_11__["getCommentDelimitedContent"])(name, attributes, innerHTML);
} }
@ -2140,24 +2151,25 @@ __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 _factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../factory */ "./node_modules/@wordpress/blocks/build-module/api/factory.js"); /* harmony import */ var _factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../factory */ "./node_modules/@wordpress/blocks/build-module/api/factory.js");
/* harmony import */ var _registration__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../registration */ "./node_modules/@wordpress/blocks/build-module/api/registration.js"); /* harmony import */ var _registration__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../registration */ "./node_modules/@wordpress/blocks/build-module/api/registration.js");
/* harmony import */ var _parser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../parser */ "./node_modules/@wordpress/blocks/build-module/api/parser.js"); /* harmony import */ var _serializer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../serializer */ "./node_modules/@wordpress/blocks/build-module/api/serializer.js");
/* harmony import */ var _normalise_blocks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./normalise-blocks */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/normalise-blocks.js"); /* harmony import */ var _parser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../parser */ "./node_modules/@wordpress/blocks/build-module/api/parser.js");
/* harmony import */ var _special_comment_converter__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./special-comment-converter */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/special-comment-converter.js"); /* harmony import */ var _normalise_blocks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./normalise-blocks */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/normalise-blocks.js");
/* harmony import */ var _is_inline_content__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./is-inline-content */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/is-inline-content.js"); /* harmony import */ var _special_comment_converter__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./special-comment-converter */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/special-comment-converter.js");
/* harmony import */ var _phrasing_content_reducer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./phrasing-content-reducer */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/phrasing-content-reducer.js"); /* harmony import */ var _is_inline_content__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./is-inline-content */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/is-inline-content.js");
/* harmony import */ var _head_remover__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./head-remover */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/head-remover.js"); /* harmony import */ var _phrasing_content_reducer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./phrasing-content-reducer */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/phrasing-content-reducer.js");
/* harmony import */ var _ms_list_converter__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ms-list-converter */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/ms-list-converter.js"); /* harmony import */ var _head_remover__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./head-remover */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/head-remover.js");
/* harmony import */ var _list_reducer__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./list-reducer */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/list-reducer.js"); /* harmony import */ var _ms_list_converter__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ms-list-converter */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/ms-list-converter.js");
/* harmony import */ var _image_corrector__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./image-corrector */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/image-corrector.js"); /* harmony import */ var _list_reducer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./list-reducer */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/list-reducer.js");
/* harmony import */ var _blockquote_normaliser__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./blockquote-normaliser */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/blockquote-normaliser.js"); /* harmony import */ var _image_corrector__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./image-corrector */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/image-corrector.js");
/* harmony import */ var _figure_content_reducer__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./figure-content-reducer */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/figure-content-reducer.js"); /* harmony import */ var _blockquote_normaliser__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./blockquote-normaliser */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/blockquote-normaliser.js");
/* harmony import */ var _shortcode_converter__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./shortcode-converter */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/shortcode-converter.js"); /* harmony import */ var _figure_content_reducer__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./figure-content-reducer */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/figure-content-reducer.js");
/* harmony import */ var _markdown_converter__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./markdown-converter */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/markdown-converter.js"); /* harmony import */ var _shortcode_converter__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./shortcode-converter */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/shortcode-converter.js");
/* harmony import */ var _iframe_remover__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./iframe-remover */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/iframe-remover.js"); /* harmony import */ var _markdown_converter__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./markdown-converter */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/markdown-converter.js");
/* harmony import */ var _phrasing_content__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./phrasing-content */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/phrasing-content.js"); /* harmony import */ var _iframe_remover__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./iframe-remover */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/iframe-remover.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getPhrasingContentSchema", function() { return _phrasing_content__WEBPACK_IMPORTED_MODULE_18__["getPhrasingContentSchema"]; }); /* harmony import */ var _phrasing_content__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./phrasing-content */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/phrasing-content.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getPhrasingContentSchema", function() { return _phrasing_content__WEBPACK_IMPORTED_MODULE_19__["getPhrasingContentSchema"]; });
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/utils.js"); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/blocks/build-module/api/raw-handling/utils.js");
/** /**
@ -2186,6 +2198,7 @@ __webpack_require__.r(__webpack_exports__);
/** /**
* Browser dependencies * Browser dependencies
*/ */
@ -2202,8 +2215,8 @@ var _window = window,
*/ */
function filterInlineHTML(HTML) { function filterInlineHTML(HTML) {
HTML = Object(_utils__WEBPACK_IMPORTED_MODULE_19__["deepFilterHTML"])(HTML, [_phrasing_content_reducer__WEBPACK_IMPORTED_MODULE_8__["default"]]); HTML = Object(_utils__WEBPACK_IMPORTED_MODULE_20__["deepFilterHTML"])(HTML, [_phrasing_content_reducer__WEBPACK_IMPORTED_MODULE_9__["default"]]);
HTML = Object(_utils__WEBPACK_IMPORTED_MODULE_19__["removeInvalidHTML"])(HTML, Object(_phrasing_content__WEBPACK_IMPORTED_MODULE_18__["getPhrasingContentSchema"])(), { HTML = Object(_utils__WEBPACK_IMPORTED_MODULE_20__["removeInvalidHTML"])(HTML, Object(_phrasing_content__WEBPACK_IMPORTED_MODULE_19__["getPhrasingContentSchema"])(), {
inline: true inline: true
}); // Allows us to ask for this information when we get a report. }); // Allows us to ask for this information when we get a report.
@ -2252,7 +2265,7 @@ function rawHandler(_ref) {
HTML = HTML.replace(/<meta[^>]+>/, ''); // If we detect block delimiters, parse entirely as blocks. HTML = HTML.replace(/<meta[^>]+>/, ''); // If we detect block delimiters, parse entirely as blocks.
if (mode !== 'INLINE' && HTML.indexOf('<!-- wp:') !== -1) { if (mode !== 'INLINE' && HTML.indexOf('<!-- wp:') !== -1) {
return Object(_parser__WEBPACK_IMPORTED_MODULE_4__["parseWithGrammar"])(HTML); return Object(_parser__WEBPACK_IMPORTED_MODULE_5__["parseWithGrammar"])(HTML);
} // Normalize unicode to use composed characters. } // Normalize unicode to use composed characters.
// This is unsupported in IE 11 but it's a nice-to-have feature, not mandatory. // This is unsupported in IE 11 but it's a nice-to-have feature, not mandatory.
// Not normalizing the content will only affect older browsers and won't // Not normalizing the content will only affect older browsers and won't
@ -2269,8 +2282,8 @@ function rawHandler(_ref) {
// * There is no HTML version, or it has no formatting. // * There is no HTML version, or it has no formatting.
if (plainText && (!HTML || Object(_utils__WEBPACK_IMPORTED_MODULE_19__["isPlain"])(HTML))) { if (plainText && (!HTML || Object(_utils__WEBPACK_IMPORTED_MODULE_20__["isPlain"])(HTML))) {
HTML = Object(_markdown_converter__WEBPACK_IMPORTED_MODULE_16__["default"])(plainText); // Switch to inline mode if: HTML = Object(_markdown_converter__WEBPACK_IMPORTED_MODULE_17__["default"])(plainText); // Switch to inline mode if:
// * The current mode is AUTO. // * The current mode is AUTO.
// * The original plain text had no line breaks. // * The original plain text had no line breaks.
// * The original plain text was not an HTML paragraph. // * The original plain text was not an HTML paragraph.
@ -2287,37 +2300,37 @@ function rawHandler(_ref) {
// shortcodes. // shortcodes.
var pieces = Object(_shortcode_converter__WEBPACK_IMPORTED_MODULE_15__["default"])(HTML); // The call to shortcodeConverter will always return more than one element var pieces = Object(_shortcode_converter__WEBPACK_IMPORTED_MODULE_16__["default"])(HTML); // The call to shortcodeConverter will always return more than one element
// if shortcodes are matched. The reason is when shortcodes are matched // if shortcodes are matched. The reason is when shortcodes are matched
// empty HTML strings are included. // empty HTML strings are included.
var hasShortcodes = pieces.length > 1; var hasShortcodes = pieces.length > 1;
if (mode === 'AUTO' && !hasShortcodes && Object(_is_inline_content__WEBPACK_IMPORTED_MODULE_7__["default"])(HTML, tagName)) { if (mode === 'AUTO' && !hasShortcodes && Object(_is_inline_content__WEBPACK_IMPORTED_MODULE_8__["default"])(HTML, tagName)) {
return filterInlineHTML(HTML); return filterInlineHTML(HTML);
} }
var rawTransformations = getRawTransformations(); var rawTransformations = getRawTransformations();
var phrasingContentSchema = Object(_phrasing_content__WEBPACK_IMPORTED_MODULE_18__["getPhrasingContentSchema"])(); var phrasingContentSchema = Object(_phrasing_content__WEBPACK_IMPORTED_MODULE_19__["getPhrasingContentSchema"])();
var blockContentSchema = Object(_utils__WEBPACK_IMPORTED_MODULE_19__["getBlockContentSchema"])(rawTransformations); var blockContentSchema = Object(_utils__WEBPACK_IMPORTED_MODULE_20__["getBlockContentSchema"])(rawTransformations);
return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["compact"])(Object(lodash__WEBPACK_IMPORTED_MODULE_1__["flatMap"])(pieces, function (piece) { var blocks = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["compact"])(Object(lodash__WEBPACK_IMPORTED_MODULE_1__["flatMap"])(pieces, function (piece) {
// Already a block from shortcode. // Already a block from shortcode.
if (typeof piece !== 'string') { if (typeof piece !== 'string') {
return piece; return piece;
} }
var filters = [_ms_list_converter__WEBPACK_IMPORTED_MODULE_10__["default"], _head_remover__WEBPACK_IMPORTED_MODULE_9__["default"], _list_reducer__WEBPACK_IMPORTED_MODULE_11__["default"], _image_corrector__WEBPACK_IMPORTED_MODULE_12__["default"], _phrasing_content_reducer__WEBPACK_IMPORTED_MODULE_8__["default"], _special_comment_converter__WEBPACK_IMPORTED_MODULE_6__["default"], _figure_content_reducer__WEBPACK_IMPORTED_MODULE_14__["default"], _blockquote_normaliser__WEBPACK_IMPORTED_MODULE_13__["default"]]; var filters = [_ms_list_converter__WEBPACK_IMPORTED_MODULE_11__["default"], _head_remover__WEBPACK_IMPORTED_MODULE_10__["default"], _list_reducer__WEBPACK_IMPORTED_MODULE_12__["default"], _image_corrector__WEBPACK_IMPORTED_MODULE_13__["default"], _phrasing_content_reducer__WEBPACK_IMPORTED_MODULE_9__["default"], _special_comment_converter__WEBPACK_IMPORTED_MODULE_7__["default"], _figure_content_reducer__WEBPACK_IMPORTED_MODULE_15__["default"], _blockquote_normaliser__WEBPACK_IMPORTED_MODULE_14__["default"]];
if (!canUserUseUnfilteredHTML) { if (!canUserUseUnfilteredHTML) {
// Should run before `figureContentReducer`. // Should run before `figureContentReducer`.
filters.unshift(_iframe_remover__WEBPACK_IMPORTED_MODULE_17__["default"]); filters.unshift(_iframe_remover__WEBPACK_IMPORTED_MODULE_18__["default"]);
} }
var schema = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blockContentSchema, phrasingContentSchema); var schema = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blockContentSchema, phrasingContentSchema);
piece = Object(_utils__WEBPACK_IMPORTED_MODULE_19__["deepFilterHTML"])(piece, filters, blockContentSchema); piece = Object(_utils__WEBPACK_IMPORTED_MODULE_20__["deepFilterHTML"])(piece, filters, blockContentSchema);
piece = Object(_utils__WEBPACK_IMPORTED_MODULE_19__["removeInvalidHTML"])(piece, schema); piece = Object(_utils__WEBPACK_IMPORTED_MODULE_20__["removeInvalidHTML"])(piece, schema);
piece = Object(_normalise_blocks__WEBPACK_IMPORTED_MODULE_5__["default"])(piece); // Allows us to ask for this information when we get a report. piece = Object(_normalise_blocks__WEBPACK_IMPORTED_MODULE_6__["default"])(piece); // Allows us to ask for this information when we get a report.
console.log('Processed HTML piece:\n\n', piece); console.log('Processed HTML piece:\n\n', piece);
var doc = document.implementation.createHTMLDocument(''); var doc = document.implementation.createHTMLDocument('');
@ -2340,9 +2353,21 @@ function rawHandler(_ref) {
return transform(node); return transform(node);
} }
return Object(_factory__WEBPACK_IMPORTED_MODULE_2__["createBlock"])(blockName, Object(_parser__WEBPACK_IMPORTED_MODULE_4__["getBlockAttributes"])(Object(_registration__WEBPACK_IMPORTED_MODULE_3__["getBlockType"])(blockName), node.outerHTML)); return Object(_factory__WEBPACK_IMPORTED_MODULE_2__["createBlock"])(blockName, Object(_parser__WEBPACK_IMPORTED_MODULE_5__["getBlockAttributes"])(Object(_registration__WEBPACK_IMPORTED_MODULE_3__["getBlockType"])(blockName), node.outerHTML));
}); });
})); })); // If we're allowed to return inline content and there is only one block
// and the original plain text content does not have any line breaks, then
// treat it as inline paste.
if (mode === 'AUTO' && blocks.length === 1) {
var trimmedPlainText = plainText.trim();
if (trimmedPlainText !== '' && trimmedPlainText.indexOf('\n') === -1) {
return Object(_utils__WEBPACK_IMPORTED_MODULE_20__["removeInvalidHTML"])(Object(_serializer__WEBPACK_IMPORTED_MODULE_4__["getBlockContent"])(blocks[0]), phrasingContentSchema);
}
}
return blocks;
} }
@ -4313,7 +4338,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, isEquivalentHTML, isValidBlock */ /*! exports provided: getTextPiecesSplitOnWhitespace, getTextWithCollapsedWhitespace, getMeaningfulAttributePairs, isEqualTextTokensWithCollapsedWhitespace, getNormalizedStyleValue, getStyleProperties, isEqualAttributesOfName, isEqualTagAttributePairs, isEqualTokensOfType, getNextNonWhitespaceToken, isClosedByToken, isEquivalentHTML, isValidBlock */
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
@ -4328,6 +4353,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEqualTagAttributePairs", function() { return isEqualTagAttributePairs; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEqualTagAttributePairs", function() { return isEqualTagAttributePairs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEqualTokensOfType", function() { return isEqualTokensOfType; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEqualTokensOfType", function() { return isEqualTokensOfType; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNextNonWhitespaceToken", function() { return getNextNonWhitespaceToken; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNextNonWhitespaceToken", function() { return getNextNonWhitespaceToken; });
/* 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 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");
@ -4688,6 +4714,29 @@ function getHTMLTokens(html) {
return null; return null;
} }
/**
* Returns true if the next HTML token closes the current token.
*
* @param {Object} currentToken Current token to compare with.
* @param {Object|undefined} nextToken Next token to compare against.
*
* @return {boolean} true if `nextToken` closes `currentToken`, false otherwise
*/
function isClosedByToken(currentToken, nextToken) {
// Ensure this is a self closed token
if (!currentToken.selfClosing) {
return false;
} // Check token names and determine if nextToken is the closing tag for currentToken
if (nextToken && nextToken.tagName === currentToken.tagName && nextToken.type === 'EndTag') {
return true;
}
return false;
}
/** /**
* Returns true if the given HTML strings are effectively equivalent, or * Returns true if the given HTML strings are effectively equivalent, or
* false otherwise. Invalid HTML is not considered equivalent, even if the * false otherwise. Invalid HTML is not considered equivalent, even if the
@ -4699,7 +4748,6 @@ function getHTMLTokens(html) {
* @return {boolean} Whether HTML strings are equivalent. * @return {boolean} Whether HTML strings are equivalent.
*/ */
function isEquivalentHTML(actual, expected) { function isEquivalentHTML(actual, expected) {
// Tokenize input content and reserialized save content // Tokenize input content and reserialized save content
var _map3 = [actual, expected].map(getHTMLTokens), var _map3 = [actual, expected].map(getHTMLTokens),
@ -4734,6 +4782,18 @@ function isEquivalentHTML(actual, expected) {
if (isEqualTokens && !isEqualTokens(actualToken, expectedToken)) { if (isEqualTokens && !isEqualTokens(actualToken, expectedToken)) {
return false; return false;
} // Peek at the next tokens (actual and expected) to see if they close
// a self-closing tag
if (isClosedByToken(actualToken, expectedTokens[0])) {
// Consume the next expected token that closes the current actual
// self-closing token
getNextNonWhitespaceToken(expectedTokens);
} else if (isClosedByToken(expectedToken, actualTokens[0])) {
// Consume the next actual token that closes the current expected
// self-closing token
getNextNonWhitespaceToken(actualTokens);
} }
} }

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

View File

@ -319,7 +319,7 @@ function _toConsumableArray(arr) {
/*!*******************************************************************!*\ /*!*******************************************************************!*\
!*** ./node_modules/@wordpress/core-data/build-module/actions.js ***! !*** ./node_modules/@wordpress/core-data/build-module/actions.js ***!
\*******************************************************************/ \*******************************************************************/
/*! exports provided: receiveUserQuery, addEntities, receiveEntityRecords, receiveThemeSupportsFromIndex, receiveEmbedPreview */ /*! exports provided: receiveUserQuery, addEntities, receiveEntityRecords, receiveThemeSupports, receiveEmbedPreview */
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
@ -327,7 +327,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "receiveUserQuery", function() { return receiveUserQuery; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "receiveUserQuery", function() { return receiveUserQuery; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEntities", function() { return addEntities; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEntities", function() { return addEntities; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "receiveEntityRecords", function() { return receiveEntityRecords; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "receiveEntityRecords", function() { return receiveEntityRecords; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "receiveThemeSupportsFromIndex", function() { return receiveThemeSupportsFromIndex; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "receiveThemeSupports", function() { return receiveThemeSupports; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "receiveEmbedPreview", function() { return receiveEmbedPreview; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "receiveEmbedPreview", function() { return receiveEmbedPreview; });
/* 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 lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash");
@ -402,15 +402,15 @@ function receiveEntityRecords(kind, name, records, query) {
/** /**
* Returns an action object used in signalling that the index has been received. * Returns an action object used in signalling that the index has been received.
* *
* @param {Object} index Index received. * @param {Object} themeSupports Theme support for the current theme.
* *
* @return {Object} Action object. * @return {Object} Action object.
*/ */
function receiveThemeSupportsFromIndex(index) { function receiveThemeSupports(themeSupports) {
return { return {
type: 'RECEIVE_THEME_SUPPORTS', type: 'RECEIVE_THEME_SUPPORTS',
themeSupports: index.theme_supports themeSupports: themeSupports
}; };
} }
/** /**
@ -1697,20 +1697,20 @@ function getEntityRecords(kind, name) {
*/ */
function getThemeSupports() { function getThemeSupports() {
var index; var activeThemes;
return regeneratorRuntime.wrap(function getThemeSupports$(_context4) { return regeneratorRuntime.wrap(function getThemeSupports$(_context4) {
while (1) { while (1) {
switch (_context4.prev = _context4.next) { switch (_context4.prev = _context4.next) {
case 0: case 0:
_context4.next = 2; _context4.next = 2;
return Object(_controls__WEBPACK_IMPORTED_MODULE_5__["apiFetch"])({ return Object(_controls__WEBPACK_IMPORTED_MODULE_5__["apiFetch"])({
path: '/' path: '/wp/v2/themes?status=active'
}); });
case 2: case 2:
index = _context4.sent; activeThemes = _context4.sent;
_context4.next = 5; _context4.next = 5;
return Object(_actions__WEBPACK_IMPORTED_MODULE_3__["receiveThemeSupportsFromIndex"])(index); return Object(_actions__WEBPACK_IMPORTED_MODULE_3__["receiveThemeSupports"])(activeThemes[0].theme_supports);
case 5: case 5:
case "end": case "end":

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -114,6 +114,8 @@ __webpack_require__.r(__webpack_exports__);
*/ */
// Changes made here will likely need to be made in `lib/client-assets.php` as
// well because it uses the `setSettings()` function to change these settings.
var settings = { var settings = {
l10n: { l10n: {
@ -136,7 +138,8 @@ var settings = {
formats: { formats: {
time: 'g: i a', time: 'g: i a',
date: 'F j, Y', date: 'F j, Y',
datetime: 'F j, Y g: i a' datetime: 'F j, Y g: i a',
datetimeAbbreviated: 'M j, Y g: i a'
}, },
timezone: { timezone: {
offset: '0', offset: '0',

File diff suppressed because one or more lines are too long

View File

@ -617,10 +617,22 @@ function placeCaretAtVerticalEdge(container, isReverse, rect) {
*/ */
function isTextField(element) { function isTextField(element) {
try {
var nodeName = element.nodeName, var nodeName = element.nodeName,
selectionStart = element.selectionStart, selectionStart = element.selectionStart,
contentEditable = element.contentEditable; contentEditable = element.contentEditable;
return nodeName === 'INPUT' && selectionStart !== null || nodeName === 'TEXTAREA' || contentEditable === 'true'; return nodeName === 'INPUT' && selectionStart !== null || nodeName === 'TEXTAREA' || contentEditable === 'true';
} catch (error) {
// Safari throws an exception when trying to get `selectionStart`
// on non-text <input> elements (which, understandably, don't
// have the text selection API). We catch this via a try/catch
// block, as opposed to a more explicit check of the element's
// input types, because of Safari's non-standard behavior. This
// also means we don't have to worry about the list of input
// types that support `selectionStart` changing as the HTML spec
// evolves over time.
return false;
}
} }
/** /**
* Check wether the current document has a selection. * Check wether the current document has a selection.

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 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

File diff suppressed because one or more lines are too long

View File

@ -201,33 +201,6 @@ function _createClass(Constructor, protoProps, staticProps) {
/***/ }), /***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js":
/*!*******************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
\*******************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _defineProperty; });
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js": /***/ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js":
/*!*******************************************************************!*\ /*!*******************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js ***! !*** ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js ***!
@ -276,39 +249,6 @@ function _inherits(subClass, superClass) {
/***/ }), /***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js":
/*!*****************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/objectSpread.js ***!
\*****************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectSpread; });
/* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys.forEach(function (key) {
Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]);
});
}
return target;
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js": /***/ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js":
/*!******************************************************************************!*\ /*!******************************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js ***! !*** ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js ***!
@ -695,14 +635,12 @@ document.addEventListener('DOMContentLoaded', function () {
"use strict"; "use strict";
__webpack_require__.r(__webpack_exports__); __webpack_require__.r(__webpack_exports__);
/* 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_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); /* 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 _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _file__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./file */ "./node_modules/@wordpress/list-reusable-blocks/build-module/utils/file.js");
/* harmony import */ var _file__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./file */ "./node_modules/@wordpress/list-reusable-blocks/build-module/utils/file.js");
/** /**
@ -730,35 +668,39 @@ function exportReusableBlock(_x) {
} }
function _exportReusableBlock() { function _exportReusableBlock() {
_exportReusableBlock = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( _exportReusableBlock = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])(
/*#__PURE__*/ /*#__PURE__*/
regeneratorRuntime.mark(function _callee(id) { regeneratorRuntime.mark(function _callee(id) {
var postType, reusableBlock, fileContent, fileName; var postType, post, title, content, fileContent, fileName;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
_context.next = 2; _context.next = 2;
return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default()({ return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({
path: "/wp/v2/types/wp_block" path: "/wp/v2/types/wp_block"
}); });
case 2: case 2:
postType = _context.sent; postType = _context.sent;
_context.next = 5; _context.next = 5;
return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default()({ return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({
path: "/wp/v2/".concat(postType.rest_base, "/").concat(id) path: "/wp/v2/".concat(postType.rest_base, "/").concat(id, "?context=edit")
}); });
case 5: case 5:
reusableBlock = _context.sent; post = _context.sent;
fileContent = JSON.stringify(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({ title = post.title.raw;
__file: 'wp_block' content = post.content.raw;
}, Object(lodash__WEBPACK_IMPORTED_MODULE_2__["pick"])(reusableBlock, ['title', 'content'])), null, 2); fileContent = JSON.stringify({
fileName = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["kebabCase"])(reusableBlock.title) + '.json'; __file: 'wp_block',
Object(_file__WEBPACK_IMPORTED_MODULE_4__["download"])(fileName, fileContent, 'application/json'); title: title,
content: content
}, null, 2);
fileName = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["kebabCase"])(title) + '.json';
Object(_file__WEBPACK_IMPORTED_MODULE_3__["download"])(fileName, fileContent, 'application/json');
case 9: case 11:
case "end": case "end":
return _context.stop(); return _context.stop();
} }
@ -917,7 +859,8 @@ function _importReusableBlock() {
path: "/wp/v2/".concat(postType.rest_base), path: "/wp/v2/".concat(postType.rest_base),
data: { data: {
title: parsedContent.title, title: parsedContent.title,
content: parsedContent.content content: parsedContent.content,
status: 'publish'
}, },
method: 'POST' method: 'POST'
}); });

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -190,6 +190,51 @@ function createMiddleware() {
} }
/***/ }),
/***/ "./node_modules/@wordpress/redux-routine/build-module/is-action.js":
/*!*************************************************************************!*\
!*** ./node_modules/@wordpress/redux-routine/build-module/is-action.js ***!
\*************************************************************************/
/*! exports provided: isAction, isActionOfType */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAction", function() { return isAction; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isActionOfType", function() { return isActionOfType; });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/**
* External imports
*/
/**
* Returns true if the given object quacks like an action.
*
* @param {*} object Object to test
*
* @return {boolean} Whether object is an action.
*/
function isAction(object) {
return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])(object) && Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isString"])(object.type);
}
/**
* Returns true if the given object quacks like an action and has a specific
* action type
*
* @param {*} object Object to test
* @param {string} expectedType The expected type for the action.
*
* @return {boolean} Whether object is an action and is of specific type.
*/
function isActionOfType(object, expectedType) {
return isAction(object) && object.type === expectedType;
}
/***/ }), /***/ }),
/***/ "./node_modules/@wordpress/redux-routine/build-module/is-generator.js": /***/ "./node_modules/@wordpress/redux-routine/build-module/is-generator.js":
@ -236,6 +281,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var is_promise__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! is-promise */ "./node_modules/is-promise/index.js"); /* harmony import */ var is_promise__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! is-promise */ "./node_modules/is-promise/index.js");
/* harmony import */ var is_promise__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(is_promise__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var is_promise__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(is_promise__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _cast_error__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cast-error */ "./node_modules/@wordpress/redux-routine/build-module/cast-error.js"); /* harmony import */ var _cast_error__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cast-error */ "./node_modules/@wordpress/redux-routine/build-module/cast-error.js");
/* harmony import */ var _is_action__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./is-action */ "./node_modules/@wordpress/redux-routine/build-module/is-action.js");
/** /**
@ -249,6 +295,7 @@ __webpack_require__.r(__webpack_exports__);
*/ */
/** /**
* Create a co-routine runtime. * Create a co-routine runtime.
* *
@ -263,7 +310,7 @@ function createRuntime() {
var dispatch = arguments.length > 1 ? arguments[1] : undefined; var dispatch = arguments.length > 1 ? arguments[1] : undefined;
var rungenControls = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["map"])(controls, function (control, actionType) { var rungenControls = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["map"])(controls, function (control, actionType) {
return function (value, next, iterate, yieldNext, yieldError) { return function (value, next, iterate, yieldNext, yieldError) {
if (Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(value) !== 'object' || value.type !== actionType) { if (!Object(_is_action__WEBPACK_IMPORTED_MODULE_5__["isActionOfType"])(value, actionType)) {
return false; return false;
} }
@ -283,7 +330,7 @@ function createRuntime() {
}); });
var unhandledActionControl = function unhandledActionControl(value, next) { var unhandledActionControl = function unhandledActionControl(value, next) {
if (Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(value) !== 'object' || !Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isString"])(value.type)) { if (!Object(_is_action__WEBPACK_IMPORTED_MODULE_5__["isAction"])(value)) {
return false; return false;
} }

File diff suppressed because one or more lines are too long

View File

@ -2061,6 +2061,10 @@ function createElementHTML(_ref5) {
var attributeString = ''; var attributeString = '';
for (var key in attributes) { for (var key in attributes) {
if (!Object(_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_0__["isValidAttributeName"])(key)) {
continue;
}
attributeString += " ".concat(key, "=\"").concat(Object(_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_0__["escapeAttribute"])(attributes[key]), "\""); attributeString += " ".concat(key, "=\"").concat(Object(_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_0__["escapeAttribute"])(attributes[key]), "\"");
} }

File diff suppressed because one or more lines are too long

View File

@ -151,7 +151,7 @@ function _objectSpread(target) {
/*!***********************************************************!*\ /*!***********************************************************!*\
!*** ./node_modules/@wordpress/url/build-module/index.js ***! !*** ./node_modules/@wordpress/url/build-module/index.js ***!
\***********************************************************/ \***********************************************************/
/*! exports provided: isURL, addQueryArgs, prependHTTP */ /*! exports provided: isURL, addQueryArgs, prependHTTP, safeDecodeURI */
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
@ -159,6 +159,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isURL", function() { return isURL; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isURL", function() { return isURL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addQueryArgs", function() { return addQueryArgs; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addQueryArgs", function() { return addQueryArgs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prependHTTP", function() { return prependHTTP; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prependHTTP", function() { return prependHTTP; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeDecodeURI", function() { return safeDecodeURI; });
/* 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 qs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! qs */ "./node_modules/@wordpress/url/node_modules/qs/lib/index.js"); /* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! qs */ "./node_modules/@wordpress/url/node_modules/qs/lib/index.js");
/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_1__);
@ -212,6 +213,22 @@ function prependHTTP(url) {
return url; return url;
} }
/**
* Safely decodes a URI with `decodeURI`. Returns the URI unmodified if
* `decodeURI` throws an error.
*
* @param {string} uri URI to decode.
*
* @return {string} Decoded URI if possible.
*/
function safeDecodeURI(uri) {
try {
return decodeURI(uri);
} catch (uriError) {
return uri;
}
}
/***/ }), /***/ }),

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2406,3 +2406,74 @@ function script_concat_settings() {
} }
} }
} }
/**
* Handles the enqueueing of block scripts and styles that are common to both
* the editor and the front-end.
*
* @since 5.0.0
*
* @global WP_Screen $current_screen
*/
function wp_common_block_scripts_and_styles() {
global $current_screen;
if ( is_admin() && ! $current_screen->is_block_editor() ) {
return;
}
wp_enqueue_style( 'wp-block-library' );
if ( current_theme_supports( 'wp-block-styles' ) ) {
wp_enqueue_style( 'wp-block-library-theme' );
}
/**
* Fires after enqueuing block assets for both editor and front-end.
*
* Call `add_action` on any hook before 'wp_enqueue_scripts'.
*
* In the function call you supply, simply use `wp_enqueue_script` and
* `wp_enqueue_style` to add your functionality to the Gutenberg editor.
*
* @since 5.0.0
*/
do_action( 'enqueue_block_assets' );
}
/**
* Enqueues registered block scripts and styles, depending on current rendered
* context (only enqueuing editor scripts while in context of the editor).
*
* @since 5.0.0
*
* @global WP_Screen $current_screen
*/
function wp_enqueue_registered_block_scripts_and_styles() {
global $current_screen;
$is_editor = ( is_admin() && $current_screen->is_block_editor() );
$block_registry = WP_Block_Type_Registry::get_instance();
foreach ( $block_registry->get_all_registered() as $block_name => $block_type ) {
// Front-end styles.
if ( ! empty( $block_type->style ) ) {
wp_enqueue_style( $block_type->style );
}
// Front-end script.
if ( ! empty( $block_type->script ) ) {
wp_enqueue_script( $block_type->script );
}
// Editor styles.
if ( $is_editor && ! empty( $block_type->editor_style ) ) {
wp_enqueue_style( $block_type->editor_style );
}
// Editor script.
if ( $is_editor && ! empty( $block_type->editor_script ) ) {
wp_enqueue_script( $block_type->editor_script );
}
}
}

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.1-alpha-44163'; $wp_version = '5.1-alpha-44164';
/** /**
* 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.