diff -r be944660c56a -r 3d72ae0968f4 wp/wp-includes/js/dist/editor.js --- a/wp/wp-includes/js/dist/editor.js Wed Sep 21 18:19:35 2022 +0200 +++ b/wp/wp-includes/js/dist/editor.js Tue Sep 27 16:37:53 2022 +0200 @@ -1,387 +1,9 @@ -this["wp"] = this["wp"] || {}; this["wp"]["editor"] = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "PLxR"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "16Al": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -var ReactPropTypesSecret = __webpack_require__("WbBG"); - -function emptyFunction() {} -function emptyFunctionWithReset() {} -emptyFunctionWithReset.resetWarningCache = emptyFunction; - -module.exports = function() { - function shim(props, propName, componentName, location, propFullName, secret) { - if (secret === ReactPropTypesSecret) { - // It is still safe when called from React. - return; - } - var err = new Error( - 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + - 'Use PropTypes.checkPropTypes() to call them. ' + - 'Read more at http://fb.me/use-check-prop-types' - ); - err.name = 'Invariant Violation'; - throw err; - }; - shim.isRequired = shim; - function getShim() { - return shim; - }; - // Important! - // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. - var ReactPropTypes = { - array: shim, - bool: shim, - func: shim, - number: shim, - object: shim, - string: shim, - symbol: shim, - - any: shim, - arrayOf: getShim, - element: shim, - elementType: shim, - instanceOf: getShim, - node: shim, - objectOf: getShim, - oneOf: getShim, - oneOfType: getShim, - shape: getShim, - exact: getShim, - - checkPropTypes: emptyFunctionWithReset, - resetWarningCache: emptyFunction - }; - - ReactPropTypes.PropTypes = ReactPropTypes; - - return ReactPropTypes; -}; - - -/***/ }), - -/***/ "17x9": -/***/ (function(module, exports, __webpack_require__) { - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -if (false) { var throwOnDirectAccess, ReactIs; } else { - // By explicitly using `prop-types` you are opting into new production behavior. - // http://fb.me/prop-types-in-prod - module.exports = __webpack_require__("16Al")(); -} - - -/***/ }), - -/***/ "1ZqX": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["data"]; }()); - -/***/ }), - -/***/ "51Zz": +/******/ (function() { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ 6411: /***/ (function(module, exports) { -(function() { module.exports = window["wp"]["dataControls"]; }()); - -/***/ }), - -/***/ "6aBm": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["mediaUtils"]; }()); - -/***/ }), - -/***/ "7fqt": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["wordcount"]; }()); - -/***/ }), - -/***/ "CNgt": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __assign = (this && this.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; -}; -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; -exports.__esModule = true; -var React = __webpack_require__("cDcd"); -var PropTypes = __webpack_require__("17x9"); -var autosize = __webpack_require__("GemG"); -var _getLineHeight = __webpack_require__("Rk8H"); -var getLineHeight = _getLineHeight; -var RESIZED = "autosize:resized"; -/** - * A light replacement for built-in textarea component - * which automaticaly adjusts its height to match the content - */ -var TextareaAutosizeClass = /** @class */ (function (_super) { - __extends(TextareaAutosizeClass, _super); - function TextareaAutosizeClass() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.state = { - lineHeight: null - }; - _this.textarea = null; - _this.onResize = function (e) { - if (_this.props.onResize) { - _this.props.onResize(e); - } - }; - _this.updateLineHeight = function () { - if (_this.textarea) { - _this.setState({ - lineHeight: getLineHeight(_this.textarea) - }); - } - }; - _this.onChange = function (e) { - var onChange = _this.props.onChange; - _this.currentValue = e.currentTarget.value; - onChange && onChange(e); - }; - return _this; - } - TextareaAutosizeClass.prototype.componentDidMount = function () { - var _this = this; - var _a = this.props, maxRows = _a.maxRows, async = _a.async; - if (typeof maxRows === "number") { - this.updateLineHeight(); - } - if (typeof maxRows === "number" || async) { - /* - the defer is needed to: - - force "autosize" to activate the scrollbar when this.props.maxRows is passed - - support StyledComponents (see #71) - */ - setTimeout(function () { return _this.textarea && autosize(_this.textarea); }); - } - else { - this.textarea && autosize(this.textarea); - } - if (this.textarea) { - this.textarea.addEventListener(RESIZED, this.onResize); - } - }; - TextareaAutosizeClass.prototype.componentWillUnmount = function () { - if (this.textarea) { - this.textarea.removeEventListener(RESIZED, this.onResize); - autosize.destroy(this.textarea); - } - }; - TextareaAutosizeClass.prototype.render = function () { - var _this = this; - var _a = this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, children = _b.children, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef", "children"]), lineHeight = _a.state.lineHeight; - var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null; - return (React.createElement("textarea", __assign({}, props, { onChange: this.onChange, style: maxHeight ? __assign({}, style, { maxHeight: maxHeight }) : style, ref: function (element) { - _this.textarea = element; - if (typeof _this.props.innerRef === 'function') { - _this.props.innerRef(element); - } - else if (_this.props.innerRef) { - _this.props.innerRef.current = element; - } - } }), children)); - }; - TextareaAutosizeClass.prototype.componentDidUpdate = function () { - this.textarea && autosize.update(this.textarea); - }; - TextareaAutosizeClass.defaultProps = { - rows: 1, - async: false - }; - TextareaAutosizeClass.propTypes = { - rows: PropTypes.number, - maxRows: PropTypes.number, - onResize: PropTypes.func, - innerRef: PropTypes.any, - async: PropTypes.bool - }; - return TextareaAutosizeClass; -}(React.Component)); -exports.TextareaAutosize = React.forwardRef(function (props, ref) { - return React.createElement(TextareaAutosizeClass, __assign({}, props, { innerRef: ref })); -}); - - -/***/ }), - -/***/ "Civd": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const layout = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" -})); -/* harmony default export */ __webpack_exports__["a"] = (layout); - - -/***/ }), - -/***/ "FqII": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["date"]; }()); - -/***/ }), - -/***/ "GRId": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["element"]; }()); - -/***/ }), - -/***/ "GemG": -/***/ (function(module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! autosize 4.0.4 license: MIT @@ -390,9 +12,9 @@ (function (global, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else { var mod; } })(this, function (module, exports) { 'use strict'; @@ -668,687 +290,918 @@ /***/ }), -/***/ "HSyU": +/***/ 4403: /***/ (function(module, exports) { -(function() { module.exports = window["wp"]["blocks"]; }()); +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +/* global define */ + +(function () { + 'use strict'; + + var hasOwn = {}.hasOwnProperty; + + function classNames() { + var classes = []; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; + + var argType = typeof arg; + + if (argType === 'string' || argType === 'number') { + classes.push(arg); + } else if (Array.isArray(arg)) { + if (arg.length) { + var inner = classNames.apply(null, arg); + if (inner) { + classes.push(inner); + } + } + } else if (argType === 'object') { + if (arg.toString === Object.prototype.toString) { + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes.push(key); + } + } + } else { + classes.push(arg.toString()); + } + } + } + + return classes.join(' '); + } + + if ( true && module.exports) { + classNames.default = classNames; + module.exports = classNames; + } else if (true) { + // register as 'classnames', consistent with npm package name + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { + return classNames; + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}()); + /***/ }), -/***/ "JREk": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["serverSideRender"]; }()); +/***/ 4827: +/***/ (function(module) { + +// This code has been refactored for 140 bytes +// You can see the original here: https://github.com/twolfson/computedStyle/blob/04cd1da2e30fa45844f95f5cb1ac898e9b9ef050/lib/computedStyle.js +var computedStyle = function (el, prop, getComputedStyle) { + getComputedStyle = window.getComputedStyle; + + // In one fell swoop + return ( + // If we have getComputedStyle + getComputedStyle ? + // Query it + // TODO: From CSS-Query notes, we might need (node, null) for FF + getComputedStyle(el) : + + // Otherwise, we are in IE and use currentStyle + el.currentStyle + )[ + // Switch to camelCase for CSSOM + // DEV: Grabbed from jQuery + // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194 + // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597 + prop.replace(/-(\w)/gi, function (word, letter) { + return letter.toUpperCase(); + }) + ]; +}; + +module.exports = computedStyle; + /***/ }), -/***/ "K2cm": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const redo = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z" -})); -/* harmony default export */ __webpack_exports__["a"] = (redo); +/***/ 9894: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Load in dependencies +var computedStyle = __webpack_require__(4827); + +/** + * Calculate the `line-height` of a given node + * @param {HTMLElement} node Element to calculate line height of. Must be in the DOM. + * @returns {Number} `line-height` of the element in pixels + */ +function lineHeight(node) { + // Grab the line-height via style + var lnHeightStr = computedStyle(node, 'line-height'); + var lnHeight = parseFloat(lnHeightStr, 10); + + // If the lineHeight did not contain a unit (i.e. it was numeric), convert it to ems (e.g. '2.3' === '2.3em') + if (lnHeightStr === lnHeight + '') { + // Save the old lineHeight style and update the em unit to the element + var _lnHeightStyle = node.style.lineHeight; + node.style.lineHeight = lnHeightStr + 'em'; + + // Calculate the em based height + lnHeightStr = computedStyle(node, 'line-height'); + lnHeight = parseFloat(lnHeightStr, 10); + + // Revert the lineHeight style + if (_lnHeightStyle) { + node.style.lineHeight = _lnHeightStyle; + } else { + delete node.style.lineHeight; + } + } + + // If the lineHeight is in `pt`, convert it to pixels (4px for 3pt) + // DEV: `em` units are converted to `pt` in IE6 + // Conversion ratio from https://developer.mozilla.org/en-US/docs/Web/CSS/length + if (lnHeightStr.indexOf('pt') !== -1) { + lnHeight *= 4; + lnHeight /= 3; + // Otherwise, if the lineHeight is in `mm`, convert it to pixels (96px for 25.4mm) + } else if (lnHeightStr.indexOf('mm') !== -1) { + lnHeight *= 96; + lnHeight /= 25.4; + // Otherwise, if the lineHeight is in `cm`, convert it to pixels (96px for 2.54cm) + } else if (lnHeightStr.indexOf('cm') !== -1) { + lnHeight *= 96; + lnHeight /= 2.54; + // Otherwise, if the lineHeight is in `in`, convert it to pixels (96px for 1in) + } else if (lnHeightStr.indexOf('in') !== -1) { + lnHeight *= 96; + // Otherwise, if the lineHeight is in `pc`, convert it to pixels (12pt for 1pc) + } else if (lnHeightStr.indexOf('pc') !== -1) { + lnHeight *= 16; + } + + // Continue our computation + lnHeight = Math.round(lnHeight); + + // If the line-height is "normal", calculate by font-size + if (lnHeightStr === 'normal') { + // Create a temporary node + var nodeName = node.nodeName; + var _node = document.createElement(nodeName); + _node.innerHTML = ' '; + + // If we have a text area, reset it to only 1 row + // https://github.com/twolfson/line-height/issues/4 + if (nodeName.toUpperCase() === 'TEXTAREA') { + _node.setAttribute('rows', '1'); + } + + // Set the font-size of the element + var fontSizeStr = computedStyle(node, 'font-size'); + _node.style.fontSize = fontSizeStr; + + // Remove default padding/border which can affect offset height + // https://github.com/twolfson/line-height/issues/4 + // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight + _node.style.padding = '0px'; + _node.style.border = '0px'; + + // Append it to the body + var body = document.body; + body.appendChild(_node); + + // Assume the line height of the element is the height + var height = _node.offsetHeight; + lnHeight = height; + + // Remove our child from the DOM + body.removeChild(_node); + } + + // Return the calculated height + return lnHeight; +} + +// Export lineHeight +module.exports = lineHeight; /***/ }), -/***/ "K9lf": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["compose"]; }()); - -/***/ }), - -/***/ "Mmq9": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["url"]; }()); - -/***/ }), - -/***/ "NMb1": -/***/ (function(module, exports) { - -(function() { module.exports = window["wp"]["deprecated"]; }()); +/***/ 5372: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + +var ReactPropTypesSecret = __webpack_require__(9567); + +function emptyFunction() {} +function emptyFunctionWithReset() {} +emptyFunctionWithReset.resetWarningCache = emptyFunction; + +module.exports = function() { + function shim(props, propName, componentName, location, propFullName, secret) { + if (secret === ReactPropTypesSecret) { + // It is still safe when called from React. + return; + } + var err = new Error( + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use PropTypes.checkPropTypes() to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + err.name = 'Invariant Violation'; + throw err; + }; + shim.isRequired = shim; + function getShim() { + return shim; + }; + // Important! + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. + var ReactPropTypes = { + array: shim, + bigint: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + + any: shim, + arrayOf: getShim, + element: shim, + elementType: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim, + exact: getShim, + + checkPropTypes: emptyFunctionWithReset, + resetWarningCache: emptyFunction + }; + + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + /***/ }), -/***/ "Ntru": -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ 2652: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +if (false) { var throwOnDirectAccess, ReactIs; } else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = __webpack_require__(5372)(); +} + + +/***/ }), + +/***/ 9567: +/***/ (function(module) { "use strict"; -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); - - -/** - * WordPress dependencies - */ - -const undo = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { - d: "M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z" -})); -/* harmony default export */ __webpack_exports__["a"] = (undo); +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; /***/ }), -/***/ "O6Fj": -/***/ (function(module, exports, __webpack_require__) { +/***/ 5438: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; exports.__esModule = true; -var TextareaAutosize_1 = __webpack_require__("CNgt"); -exports["default"] = TextareaAutosize_1.TextareaAutosize; +var React = __webpack_require__(9196); +var PropTypes = __webpack_require__(2652); +var autosize = __webpack_require__(6411); +var _getLineHeight = __webpack_require__(9894); +var getLineHeight = _getLineHeight; +var RESIZED = "autosize:resized"; +/** + * A light replacement for built-in textarea component + * which automaticaly adjusts its height to match the content + */ +var TextareaAutosizeClass = /** @class */ (function (_super) { + __extends(TextareaAutosizeClass, _super); + function TextareaAutosizeClass() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.state = { + lineHeight: null + }; + _this.textarea = null; + _this.onResize = function (e) { + if (_this.props.onResize) { + _this.props.onResize(e); + } + }; + _this.updateLineHeight = function () { + if (_this.textarea) { + _this.setState({ + lineHeight: getLineHeight(_this.textarea) + }); + } + }; + _this.onChange = function (e) { + var onChange = _this.props.onChange; + _this.currentValue = e.currentTarget.value; + onChange && onChange(e); + }; + return _this; + } + TextareaAutosizeClass.prototype.componentDidMount = function () { + var _this = this; + var _a = this.props, maxRows = _a.maxRows, async = _a.async; + if (typeof maxRows === "number") { + this.updateLineHeight(); + } + if (typeof maxRows === "number" || async) { + /* + the defer is needed to: + - force "autosize" to activate the scrollbar when this.props.maxRows is passed + - support StyledComponents (see #71) + */ + setTimeout(function () { return _this.textarea && autosize(_this.textarea); }); + } + else { + this.textarea && autosize(this.textarea); + } + if (this.textarea) { + this.textarea.addEventListener(RESIZED, this.onResize); + } + }; + TextareaAutosizeClass.prototype.componentWillUnmount = function () { + if (this.textarea) { + this.textarea.removeEventListener(RESIZED, this.onResize); + autosize.destroy(this.textarea); + } + }; + TextareaAutosizeClass.prototype.render = function () { + var _this = this; + var _a = this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, children = _b.children, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef", "children"]), lineHeight = _a.state.lineHeight; + var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null; + return (React.createElement("textarea", __assign({}, props, { onChange: this.onChange, style: maxHeight ? __assign({}, style, { maxHeight: maxHeight }) : style, ref: function (element) { + _this.textarea = element; + if (typeof _this.props.innerRef === 'function') { + _this.props.innerRef(element); + } + else if (_this.props.innerRef) { + _this.props.innerRef.current = element; + } + } }), children)); + }; + TextareaAutosizeClass.prototype.componentDidUpdate = function () { + this.textarea && autosize.update(this.textarea); + }; + TextareaAutosizeClass.defaultProps = { + rows: 1, + async: false + }; + TextareaAutosizeClass.propTypes = { + rows: PropTypes.number, + maxRows: PropTypes.number, + onResize: PropTypes.func, + innerRef: PropTypes.any, + async: PropTypes.bool + }; + return TextareaAutosizeClass; +}(React.Component)); +exports.TextareaAutosize = React.forwardRef(function (props, ref) { + return React.createElement(TextareaAutosizeClass, __assign({}, props, { innerRef: ref })); +}); /***/ }), -/***/ "PLxR": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - +/***/ 773: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +var __webpack_unused_export__; + +__webpack_unused_export__ = true; +var TextareaAutosize_1 = __webpack_require__(5438); +exports.Z = TextareaAutosize_1.TextareaAutosize; + + +/***/ }), + +/***/ 9196: +/***/ (function(module) { + +"use strict"; +module.exports = window["React"]; + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ !function() { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function() { return module['default']; } : +/******/ function() { return module; }; +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be in strict mode. +!function() { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS -__webpack_require__.d(__webpack_exports__, "storeConfig", function() { return /* reexport */ storeConfig; }); -__webpack_require__.d(__webpack_exports__, "store", function() { return /* reexport */ store; }); -__webpack_require__.d(__webpack_exports__, "userAutocompleter", function() { return /* reexport */ autocompleters_user; }); -__webpack_require__.d(__webpack_exports__, "AutosaveMonitor", function() { return /* reexport */ autosave_monitor; }); -__webpack_require__.d(__webpack_exports__, "DocumentOutline", function() { return /* reexport */ document_outline; }); -__webpack_require__.d(__webpack_exports__, "DocumentOutlineCheck", function() { return /* reexport */ check; }); -__webpack_require__.d(__webpack_exports__, "VisualEditorGlobalKeyboardShortcuts", function() { return /* reexport */ visual_editor_shortcuts; }); -__webpack_require__.d(__webpack_exports__, "TextEditorGlobalKeyboardShortcuts", function() { return /* reexport */ TextEditorGlobalKeyboardShortcuts; }); -__webpack_require__.d(__webpack_exports__, "EditorKeyboardShortcutsRegister", function() { return /* reexport */ register_shortcuts; }); -__webpack_require__.d(__webpack_exports__, "EditorHistoryRedo", function() { return /* reexport */ editor_history_redo; }); -__webpack_require__.d(__webpack_exports__, "EditorHistoryUndo", function() { return /* reexport */ editor_history_undo; }); -__webpack_require__.d(__webpack_exports__, "EditorNotices", function() { return /* reexport */ editor_notices; }); -__webpack_require__.d(__webpack_exports__, "EditorSnackbars", function() { return /* reexport */ EditorSnackbars; }); -__webpack_require__.d(__webpack_exports__, "EntitiesSavedStates", function() { return /* reexport */ EntitiesSavedStates; }); -__webpack_require__.d(__webpack_exports__, "ErrorBoundary", function() { return /* reexport */ error_boundary; }); -__webpack_require__.d(__webpack_exports__, "LocalAutosaveMonitor", function() { return /* reexport */ local_autosave_monitor; }); -__webpack_require__.d(__webpack_exports__, "PageAttributesCheck", function() { return /* reexport */ page_attributes_check; }); -__webpack_require__.d(__webpack_exports__, "PageAttributesOrder", function() { return /* reexport */ page_attributes_order; }); -__webpack_require__.d(__webpack_exports__, "PageAttributesParent", function() { return /* reexport */ page_attributes_parent; }); -__webpack_require__.d(__webpack_exports__, "PageTemplate", function() { return /* reexport */ post_template; }); -__webpack_require__.d(__webpack_exports__, "PostAuthor", function() { return /* reexport */ post_author; }); -__webpack_require__.d(__webpack_exports__, "PostAuthorCheck", function() { return /* reexport */ post_author_check; }); -__webpack_require__.d(__webpack_exports__, "PostComments", function() { return /* reexport */ post_comments; }); -__webpack_require__.d(__webpack_exports__, "PostExcerpt", function() { return /* reexport */ post_excerpt; }); -__webpack_require__.d(__webpack_exports__, "PostExcerptCheck", function() { return /* reexport */ post_excerpt_check; }); -__webpack_require__.d(__webpack_exports__, "PostFeaturedImage", function() { return /* reexport */ post_featured_image; }); -__webpack_require__.d(__webpack_exports__, "PostFeaturedImageCheck", function() { return /* reexport */ post_featured_image_check; }); -__webpack_require__.d(__webpack_exports__, "PostFormat", function() { return /* reexport */ PostFormat; }); -__webpack_require__.d(__webpack_exports__, "PostFormatCheck", function() { return /* reexport */ post_format_check; }); -__webpack_require__.d(__webpack_exports__, "PostLastRevision", function() { return /* reexport */ post_last_revision; }); -__webpack_require__.d(__webpack_exports__, "PostLastRevisionCheck", function() { return /* reexport */ post_last_revision_check; }); -__webpack_require__.d(__webpack_exports__, "PostLockedModal", function() { return /* reexport */ PostLockedModal; }); -__webpack_require__.d(__webpack_exports__, "PostPendingStatus", function() { return /* reexport */ post_pending_status; }); -__webpack_require__.d(__webpack_exports__, "PostPendingStatusCheck", function() { return /* reexport */ post_pending_status_check; }); -__webpack_require__.d(__webpack_exports__, "PostPingbacks", function() { return /* reexport */ post_pingbacks; }); -__webpack_require__.d(__webpack_exports__, "PostPreviewButton", function() { return /* reexport */ post_preview_button; }); -__webpack_require__.d(__webpack_exports__, "PostPublishButton", function() { return /* reexport */ post_publish_button; }); -__webpack_require__.d(__webpack_exports__, "PostPublishButtonLabel", function() { return /* reexport */ post_publish_button_label; }); -__webpack_require__.d(__webpack_exports__, "PostPublishPanel", function() { return /* reexport */ post_publish_panel; }); -__webpack_require__.d(__webpack_exports__, "PostSavedState", function() { return /* reexport */ PostSavedState; }); -__webpack_require__.d(__webpack_exports__, "PostSchedule", function() { return /* reexport */ PostSchedule; }); -__webpack_require__.d(__webpack_exports__, "PostScheduleCheck", function() { return /* reexport */ post_schedule_check; }); -__webpack_require__.d(__webpack_exports__, "PostScheduleLabel", function() { return /* reexport */ post_schedule_label; }); -__webpack_require__.d(__webpack_exports__, "PostSlug", function() { return /* reexport */ post_slug; }); -__webpack_require__.d(__webpack_exports__, "PostSlugCheck", function() { return /* reexport */ PostSlugCheck; }); -__webpack_require__.d(__webpack_exports__, "PostSticky", function() { return /* reexport */ post_sticky; }); -__webpack_require__.d(__webpack_exports__, "PostStickyCheck", function() { return /* reexport */ post_sticky_check; }); -__webpack_require__.d(__webpack_exports__, "PostSwitchToDraftButton", function() { return /* reexport */ post_switch_to_draft_button; }); -__webpack_require__.d(__webpack_exports__, "PostTaxonomies", function() { return /* reexport */ post_taxonomies; }); -__webpack_require__.d(__webpack_exports__, "PostTaxonomiesCheck", function() { return /* reexport */ post_taxonomies_check; }); -__webpack_require__.d(__webpack_exports__, "PostTextEditor", function() { return /* reexport */ PostTextEditor; }); -__webpack_require__.d(__webpack_exports__, "PostTitle", function() { return /* reexport */ PostTitle; }); -__webpack_require__.d(__webpack_exports__, "PostTrash", function() { return /* reexport */ post_trash; }); -__webpack_require__.d(__webpack_exports__, "PostTrashCheck", function() { return /* reexport */ post_trash_check; }); -__webpack_require__.d(__webpack_exports__, "PostTypeSupportCheck", function() { return /* reexport */ post_type_support_check; }); -__webpack_require__.d(__webpack_exports__, "PostVisibility", function() { return /* reexport */ post_visibility; }); -__webpack_require__.d(__webpack_exports__, "PostVisibilityLabel", function() { return /* reexport */ post_visibility_label; }); -__webpack_require__.d(__webpack_exports__, "PostVisibilityCheck", function() { return /* reexport */ post_visibility_check; }); -__webpack_require__.d(__webpack_exports__, "TableOfContents", function() { return /* reexport */ table_of_contents; }); -__webpack_require__.d(__webpack_exports__, "UnsavedChangesWarning", function() { return /* reexport */ UnsavedChangesWarning; }); -__webpack_require__.d(__webpack_exports__, "WordCount", function() { return /* reexport */ WordCount; }); -__webpack_require__.d(__webpack_exports__, "EditorProvider", function() { return /* reexport */ provider; }); -__webpack_require__.d(__webpack_exports__, "ServerSideRender", function() { return /* reexport */ external_wp_serverSideRender_default.a; }); -__webpack_require__.d(__webpack_exports__, "RichText", function() { return /* reexport */ RichText; }); -__webpack_require__.d(__webpack_exports__, "Autocomplete", function() { return /* reexport */ Autocomplete; }); -__webpack_require__.d(__webpack_exports__, "AlignmentToolbar", function() { return /* reexport */ AlignmentToolbar; }); -__webpack_require__.d(__webpack_exports__, "BlockAlignmentToolbar", function() { return /* reexport */ BlockAlignmentToolbar; }); -__webpack_require__.d(__webpack_exports__, "BlockControls", function() { return /* reexport */ BlockControls; }); -__webpack_require__.d(__webpack_exports__, "BlockEdit", function() { return /* reexport */ deprecated_BlockEdit; }); -__webpack_require__.d(__webpack_exports__, "BlockEditorKeyboardShortcuts", function() { return /* reexport */ BlockEditorKeyboardShortcuts; }); -__webpack_require__.d(__webpack_exports__, "BlockFormatControls", function() { return /* reexport */ BlockFormatControls; }); -__webpack_require__.d(__webpack_exports__, "BlockIcon", function() { return /* reexport */ BlockIcon; }); -__webpack_require__.d(__webpack_exports__, "BlockInspector", function() { return /* reexport */ BlockInspector; }); -__webpack_require__.d(__webpack_exports__, "BlockList", function() { return /* reexport */ BlockList; }); -__webpack_require__.d(__webpack_exports__, "BlockMover", function() { return /* reexport */ BlockMover; }); -__webpack_require__.d(__webpack_exports__, "BlockNavigationDropdown", function() { return /* reexport */ BlockNavigationDropdown; }); -__webpack_require__.d(__webpack_exports__, "BlockSelectionClearer", function() { return /* reexport */ BlockSelectionClearer; }); -__webpack_require__.d(__webpack_exports__, "BlockSettingsMenu", function() { return /* reexport */ BlockSettingsMenu; }); -__webpack_require__.d(__webpack_exports__, "BlockTitle", function() { return /* reexport */ BlockTitle; }); -__webpack_require__.d(__webpack_exports__, "BlockToolbar", function() { return /* reexport */ BlockToolbar; }); -__webpack_require__.d(__webpack_exports__, "ColorPalette", function() { return /* reexport */ ColorPalette; }); -__webpack_require__.d(__webpack_exports__, "ContrastChecker", function() { return /* reexport */ ContrastChecker; }); -__webpack_require__.d(__webpack_exports__, "CopyHandler", function() { return /* reexport */ CopyHandler; }); -__webpack_require__.d(__webpack_exports__, "DefaultBlockAppender", function() { return /* reexport */ DefaultBlockAppender; }); -__webpack_require__.d(__webpack_exports__, "FontSizePicker", function() { return /* reexport */ FontSizePicker; }); -__webpack_require__.d(__webpack_exports__, "Inserter", function() { return /* reexport */ Inserter; }); -__webpack_require__.d(__webpack_exports__, "InnerBlocks", function() { return /* reexport */ InnerBlocks; }); -__webpack_require__.d(__webpack_exports__, "InspectorAdvancedControls", function() { return /* reexport */ InspectorAdvancedControls; }); -__webpack_require__.d(__webpack_exports__, "InspectorControls", function() { return /* reexport */ InspectorControls; }); -__webpack_require__.d(__webpack_exports__, "PanelColorSettings", function() { return /* reexport */ PanelColorSettings; }); -__webpack_require__.d(__webpack_exports__, "PlainText", function() { return /* reexport */ PlainText; }); -__webpack_require__.d(__webpack_exports__, "RichTextShortcut", function() { return /* reexport */ RichTextShortcut; }); -__webpack_require__.d(__webpack_exports__, "RichTextToolbarButton", function() { return /* reexport */ RichTextToolbarButton; }); -__webpack_require__.d(__webpack_exports__, "__unstableRichTextInputEvent", function() { return /* reexport */ __unstableRichTextInputEvent; }); -__webpack_require__.d(__webpack_exports__, "MediaPlaceholder", function() { return /* reexport */ MediaPlaceholder; }); -__webpack_require__.d(__webpack_exports__, "MediaUpload", function() { return /* reexport */ MediaUpload; }); -__webpack_require__.d(__webpack_exports__, "MediaUploadCheck", function() { return /* reexport */ MediaUploadCheck; }); -__webpack_require__.d(__webpack_exports__, "MultiSelectScrollIntoView", function() { return /* reexport */ MultiSelectScrollIntoView; }); -__webpack_require__.d(__webpack_exports__, "NavigableToolbar", function() { return /* reexport */ NavigableToolbar; }); -__webpack_require__.d(__webpack_exports__, "ObserveTyping", function() { return /* reexport */ ObserveTyping; }); -__webpack_require__.d(__webpack_exports__, "PreserveScrollInReorder", function() { return /* reexport */ PreserveScrollInReorder; }); -__webpack_require__.d(__webpack_exports__, "SkipToSelectedBlock", function() { return /* reexport */ SkipToSelectedBlock; }); -__webpack_require__.d(__webpack_exports__, "URLInput", function() { return /* reexport */ URLInput; }); -__webpack_require__.d(__webpack_exports__, "URLInputButton", function() { return /* reexport */ URLInputButton; }); -__webpack_require__.d(__webpack_exports__, "URLPopover", function() { return /* reexport */ URLPopover; }); -__webpack_require__.d(__webpack_exports__, "Warning", function() { return /* reexport */ Warning; }); -__webpack_require__.d(__webpack_exports__, "WritingFlow", function() { return /* reexport */ WritingFlow; }); -__webpack_require__.d(__webpack_exports__, "createCustomColorsHOC", function() { return /* reexport */ createCustomColorsHOC; }); -__webpack_require__.d(__webpack_exports__, "getColorClassName", function() { return /* reexport */ getColorClassName; }); -__webpack_require__.d(__webpack_exports__, "getColorObjectByAttributeValues", function() { return /* reexport */ getColorObjectByAttributeValues; }); -__webpack_require__.d(__webpack_exports__, "getColorObjectByColorValue", function() { return /* reexport */ getColorObjectByColorValue; }); -__webpack_require__.d(__webpack_exports__, "getFontSize", function() { return /* reexport */ getFontSize; }); -__webpack_require__.d(__webpack_exports__, "getFontSizeClass", function() { return /* reexport */ getFontSizeClass; }); -__webpack_require__.d(__webpack_exports__, "withColorContext", function() { return /* reexport */ withColorContext; }); -__webpack_require__.d(__webpack_exports__, "withColors", function() { return /* reexport */ withColors; }); -__webpack_require__.d(__webpack_exports__, "withFontSizes", function() { return /* reexport */ withFontSizes; }); -__webpack_require__.d(__webpack_exports__, "mediaUpload", function() { return /* reexport */ mediaUpload; }); -__webpack_require__.d(__webpack_exports__, "cleanForSlug", function() { return /* reexport */ cleanForSlug; }); -__webpack_require__.d(__webpack_exports__, "transformStyles", function() { return /* reexport */ external_wp_blockEditor_["transformStyles"]; }); +__webpack_require__.d(__webpack_exports__, { + "AlignmentToolbar": function() { return /* reexport */ AlignmentToolbar; }, + "Autocomplete": function() { return /* reexport */ Autocomplete; }, + "AutosaveMonitor": function() { return /* reexport */ autosave_monitor; }, + "BlockAlignmentToolbar": function() { return /* reexport */ BlockAlignmentToolbar; }, + "BlockControls": function() { return /* reexport */ BlockControls; }, + "BlockEdit": function() { return /* reexport */ BlockEdit; }, + "BlockEditorKeyboardShortcuts": function() { return /* reexport */ BlockEditorKeyboardShortcuts; }, + "BlockFormatControls": function() { return /* reexport */ BlockFormatControls; }, + "BlockIcon": function() { return /* reexport */ BlockIcon; }, + "BlockInspector": function() { return /* reexport */ BlockInspector; }, + "BlockList": function() { return /* reexport */ BlockList; }, + "BlockMover": function() { return /* reexport */ BlockMover; }, + "BlockNavigationDropdown": function() { return /* reexport */ BlockNavigationDropdown; }, + "BlockSelectionClearer": function() { return /* reexport */ BlockSelectionClearer; }, + "BlockSettingsMenu": function() { return /* reexport */ BlockSettingsMenu; }, + "BlockTitle": function() { return /* reexport */ BlockTitle; }, + "BlockToolbar": function() { return /* reexport */ BlockToolbar; }, + "ColorPalette": function() { return /* reexport */ ColorPalette; }, + "ContrastChecker": function() { return /* reexport */ ContrastChecker; }, + "CopyHandler": function() { return /* reexport */ CopyHandler; }, + "DefaultBlockAppender": function() { return /* reexport */ DefaultBlockAppender; }, + "DocumentOutline": function() { return /* reexport */ document_outline; }, + "DocumentOutlineCheck": function() { return /* reexport */ check; }, + "EditorHistoryRedo": function() { return /* reexport */ editor_history_redo; }, + "EditorHistoryUndo": function() { return /* reexport */ editor_history_undo; }, + "EditorKeyboardShortcutsRegister": function() { return /* reexport */ register_shortcuts; }, + "EditorNotices": function() { return /* reexport */ editor_notices; }, + "EditorProvider": function() { return /* reexport */ provider; }, + "EditorSnackbars": function() { return /* reexport */ EditorSnackbars; }, + "EntitiesSavedStates": function() { return /* reexport */ EntitiesSavedStates; }, + "ErrorBoundary": function() { return /* reexport */ error_boundary; }, + "FontSizePicker": function() { return /* reexport */ FontSizePicker; }, + "InnerBlocks": function() { return /* reexport */ InnerBlocks; }, + "Inserter": function() { return /* reexport */ Inserter; }, + "InspectorAdvancedControls": function() { return /* reexport */ InspectorAdvancedControls; }, + "InspectorControls": function() { return /* reexport */ InspectorControls; }, + "LocalAutosaveMonitor": function() { return /* reexport */ local_autosave_monitor; }, + "MediaPlaceholder": function() { return /* reexport */ MediaPlaceholder; }, + "MediaUpload": function() { return /* reexport */ MediaUpload; }, + "MediaUploadCheck": function() { return /* reexport */ MediaUploadCheck; }, + "MultiSelectScrollIntoView": function() { return /* reexport */ MultiSelectScrollIntoView; }, + "NavigableToolbar": function() { return /* reexport */ NavigableToolbar; }, + "ObserveTyping": function() { return /* reexport */ ObserveTyping; }, + "PageAttributesCheck": function() { return /* reexport */ page_attributes_check; }, + "PageAttributesOrder": function() { return /* reexport */ order; }, + "PageAttributesParent": function() { return /* reexport */ page_attributes_parent; }, + "PageTemplate": function() { return /* reexport */ post_template; }, + "PanelColorSettings": function() { return /* reexport */ PanelColorSettings; }, + "PlainText": function() { return /* reexport */ PlainText; }, + "PostAuthor": function() { return /* reexport */ post_author; }, + "PostAuthorCheck": function() { return /* reexport */ PostAuthorCheck; }, + "PostComments": function() { return /* reexport */ post_comments; }, + "PostExcerpt": function() { return /* reexport */ post_excerpt; }, + "PostExcerptCheck": function() { return /* reexport */ post_excerpt_check; }, + "PostFeaturedImage": function() { return /* reexport */ post_featured_image; }, + "PostFeaturedImageCheck": function() { return /* reexport */ post_featured_image_check; }, + "PostFormat": function() { return /* reexport */ PostFormat; }, + "PostFormatCheck": function() { return /* reexport */ post_format_check; }, + "PostLastRevision": function() { return /* reexport */ post_last_revision; }, + "PostLastRevisionCheck": function() { return /* reexport */ post_last_revision_check; }, + "PostLockedModal": function() { return /* reexport */ PostLockedModal; }, + "PostPendingStatus": function() { return /* reexport */ post_pending_status; }, + "PostPendingStatusCheck": function() { return /* reexport */ post_pending_status_check; }, + "PostPingbacks": function() { return /* reexport */ post_pingbacks; }, + "PostPreviewButton": function() { return /* reexport */ post_preview_button; }, + "PostPublishButton": function() { return /* reexport */ post_publish_button; }, + "PostPublishButtonLabel": function() { return /* reexport */ label; }, + "PostPublishPanel": function() { return /* reexport */ post_publish_panel; }, + "PostSavedState": function() { return /* reexport */ PostSavedState; }, + "PostSchedule": function() { return /* reexport */ PostSchedule; }, + "PostScheduleCheck": function() { return /* reexport */ post_schedule_check; }, + "PostScheduleLabel": function() { return /* reexport */ post_schedule_label; }, + "PostSlug": function() { return /* reexport */ post_slug; }, + "PostSlugCheck": function() { return /* reexport */ PostSlugCheck; }, + "PostSticky": function() { return /* reexport */ post_sticky; }, + "PostStickyCheck": function() { return /* reexport */ post_sticky_check; }, + "PostSwitchToDraftButton": function() { return /* reexport */ post_switch_to_draft_button; }, + "PostTaxonomies": function() { return /* reexport */ post_taxonomies; }, + "PostTaxonomiesCheck": function() { return /* reexport */ post_taxonomies_check; }, + "PostTaxonomiesFlatTermSelector": function() { return /* reexport */ flat_term_selector; }, + "PostTaxonomiesHierarchicalTermSelector": function() { return /* reexport */ hierarchical_term_selector; }, + "PostTextEditor": function() { return /* reexport */ PostTextEditor; }, + "PostTitle": function() { return /* reexport */ PostTitle; }, + "PostTrash": function() { return /* reexport */ PostTrash; }, + "PostTrashCheck": function() { return /* reexport */ post_trash_check; }, + "PostTypeSupportCheck": function() { return /* reexport */ post_type_support_check; }, + "PostVisibility": function() { return /* reexport */ post_visibility; }, + "PostVisibilityCheck": function() { return /* reexport */ post_visibility_check; }, + "PostVisibilityLabel": function() { return /* reexport */ post_visibility_label; }, + "RichText": function() { return /* reexport */ RichText; }, + "RichTextShortcut": function() { return /* reexport */ RichTextShortcut; }, + "RichTextToolbarButton": function() { return /* reexport */ RichTextToolbarButton; }, + "ServerSideRender": function() { return /* reexport */ (external_wp_serverSideRender_default()); }, + "SkipToSelectedBlock": function() { return /* reexport */ SkipToSelectedBlock; }, + "TableOfContents": function() { return /* reexport */ table_of_contents; }, + "TextEditorGlobalKeyboardShortcuts": function() { return /* reexport */ TextEditorGlobalKeyboardShortcuts; }, + "ThemeSupportCheck": function() { return /* reexport */ theme_support_check; }, + "URLInput": function() { return /* reexport */ URLInput; }, + "URLInputButton": function() { return /* reexport */ URLInputButton; }, + "URLPopover": function() { return /* reexport */ URLPopover; }, + "UnsavedChangesWarning": function() { return /* reexport */ UnsavedChangesWarning; }, + "VisualEditorGlobalKeyboardShortcuts": function() { return /* reexport */ visual_editor_shortcuts; }, + "Warning": function() { return /* reexport */ Warning; }, + "WordCount": function() { return /* reexport */ WordCount; }, + "WritingFlow": function() { return /* reexport */ WritingFlow; }, + "__unstableRichTextInputEvent": function() { return /* reexport */ __unstableRichTextInputEvent; }, + "cleanForSlug": function() { return /* reexport */ cleanForSlug; }, + "createCustomColorsHOC": function() { return /* reexport */ createCustomColorsHOC; }, + "getColorClassName": function() { return /* reexport */ getColorClassName; }, + "getColorObjectByAttributeValues": function() { return /* reexport */ getColorObjectByAttributeValues; }, + "getColorObjectByColorValue": function() { return /* reexport */ getColorObjectByColorValue; }, + "getFontSize": function() { return /* reexport */ getFontSize; }, + "getFontSizeClass": function() { return /* reexport */ getFontSizeClass; }, + "getTemplatePartIcon": function() { return /* reexport */ getTemplatePartIcon; }, + "mediaUpload": function() { return /* reexport */ mediaUpload; }, + "store": function() { return /* reexport */ store_store; }, + "storeConfig": function() { return /* reexport */ storeConfig; }, + "transformStyles": function() { return /* reexport */ external_wp_blockEditor_namespaceObject.transformStyles; }, + "userAutocompleter": function() { return /* reexport */ user; }, + "withColorContext": function() { return /* reexport */ withColorContext; }, + "withColors": function() { return /* reexport */ withColors; }, + "withFontSizes": function() { return /* reexport */ withFontSizes; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/editor/build-module/store/selectors.js var selectors_namespaceObject = {}; __webpack_require__.r(selectors_namespaceObject); -__webpack_require__.d(selectors_namespaceObject, "hasEditorUndo", function() { return hasEditorUndo; }); -__webpack_require__.d(selectors_namespaceObject, "hasEditorRedo", function() { return hasEditorRedo; }); -__webpack_require__.d(selectors_namespaceObject, "isEditedPostNew", function() { return selectors_isEditedPostNew; }); -__webpack_require__.d(selectors_namespaceObject, "hasChangedContent", function() { return hasChangedContent; }); -__webpack_require__.d(selectors_namespaceObject, "isEditedPostDirty", function() { return selectors_isEditedPostDirty; }); -__webpack_require__.d(selectors_namespaceObject, "hasNonPostEntityChanges", function() { return selectors_hasNonPostEntityChanges; }); -__webpack_require__.d(selectors_namespaceObject, "isCleanNewPost", function() { return selectors_isCleanNewPost; }); -__webpack_require__.d(selectors_namespaceObject, "getCurrentPost", function() { return selectors_getCurrentPost; }); -__webpack_require__.d(selectors_namespaceObject, "getCurrentPostType", function() { return selectors_getCurrentPostType; }); -__webpack_require__.d(selectors_namespaceObject, "getCurrentPostId", function() { return selectors_getCurrentPostId; }); -__webpack_require__.d(selectors_namespaceObject, "getCurrentPostRevisionsCount", function() { return getCurrentPostRevisionsCount; }); -__webpack_require__.d(selectors_namespaceObject, "getCurrentPostLastRevisionId", function() { return getCurrentPostLastRevisionId; }); -__webpack_require__.d(selectors_namespaceObject, "getPostEdits", function() { return selectors_getPostEdits; }); -__webpack_require__.d(selectors_namespaceObject, "getReferenceByDistinctEdits", function() { return getReferenceByDistinctEdits; }); -__webpack_require__.d(selectors_namespaceObject, "getCurrentPostAttribute", function() { return selectors_getCurrentPostAttribute; }); -__webpack_require__.d(selectors_namespaceObject, "getEditedPostAttribute", function() { return selectors_getEditedPostAttribute; }); -__webpack_require__.d(selectors_namespaceObject, "getAutosaveAttribute", function() { return getAutosaveAttribute; }); -__webpack_require__.d(selectors_namespaceObject, "getEditedPostVisibility", function() { return selectors_getEditedPostVisibility; }); -__webpack_require__.d(selectors_namespaceObject, "isCurrentPostPending", function() { return isCurrentPostPending; }); -__webpack_require__.d(selectors_namespaceObject, "isCurrentPostPublished", function() { return selectors_isCurrentPostPublished; }); -__webpack_require__.d(selectors_namespaceObject, "isCurrentPostScheduled", function() { return selectors_isCurrentPostScheduled; }); -__webpack_require__.d(selectors_namespaceObject, "isEditedPostPublishable", function() { return selectors_isEditedPostPublishable; }); -__webpack_require__.d(selectors_namespaceObject, "isEditedPostSaveable", function() { return selectors_isEditedPostSaveable; }); -__webpack_require__.d(selectors_namespaceObject, "isEditedPostEmpty", function() { return isEditedPostEmpty; }); -__webpack_require__.d(selectors_namespaceObject, "isEditedPostAutosaveable", function() { return selectors_isEditedPostAutosaveable; }); -__webpack_require__.d(selectors_namespaceObject, "getAutosave", function() { return getAutosave; }); -__webpack_require__.d(selectors_namespaceObject, "hasAutosave", function() { return hasAutosave; }); -__webpack_require__.d(selectors_namespaceObject, "isEditedPostBeingScheduled", function() { return selectors_isEditedPostBeingScheduled; }); -__webpack_require__.d(selectors_namespaceObject, "isEditedPostDateFloating", function() { return isEditedPostDateFloating; }); -__webpack_require__.d(selectors_namespaceObject, "isSavingPost", function() { return selectors_isSavingPost; }); -__webpack_require__.d(selectors_namespaceObject, "didPostSaveRequestSucceed", function() { return didPostSaveRequestSucceed; }); -__webpack_require__.d(selectors_namespaceObject, "didPostSaveRequestFail", function() { return didPostSaveRequestFail; }); -__webpack_require__.d(selectors_namespaceObject, "isAutosavingPost", function() { return selectors_isAutosavingPost; }); -__webpack_require__.d(selectors_namespaceObject, "isPreviewingPost", function() { return isPreviewingPost; }); -__webpack_require__.d(selectors_namespaceObject, "getEditedPostPreviewLink", function() { return selectors_getEditedPostPreviewLink; }); -__webpack_require__.d(selectors_namespaceObject, "getSuggestedPostFormat", function() { return selectors_getSuggestedPostFormat; }); -__webpack_require__.d(selectors_namespaceObject, "getBlocksForSerialization", function() { return getBlocksForSerialization; }); -__webpack_require__.d(selectors_namespaceObject, "getEditedPostContent", function() { return getEditedPostContent; }); -__webpack_require__.d(selectors_namespaceObject, "isPublishingPost", function() { return selectors_isPublishingPost; }); -__webpack_require__.d(selectors_namespaceObject, "isPermalinkEditable", function() { return isPermalinkEditable; }); -__webpack_require__.d(selectors_namespaceObject, "getPermalink", function() { return getPermalink; }); -__webpack_require__.d(selectors_namespaceObject, "getEditedPostSlug", function() { return getEditedPostSlug; }); -__webpack_require__.d(selectors_namespaceObject, "getPermalinkParts", function() { return getPermalinkParts; }); -__webpack_require__.d(selectors_namespaceObject, "isPostLocked", function() { return selectors_isPostLocked; }); -__webpack_require__.d(selectors_namespaceObject, "isPostSavingLocked", function() { return selectors_isPostSavingLocked; }); -__webpack_require__.d(selectors_namespaceObject, "isPostAutosavingLocked", function() { return isPostAutosavingLocked; }); -__webpack_require__.d(selectors_namespaceObject, "isPostLockTakeover", function() { return isPostLockTakeover; }); -__webpack_require__.d(selectors_namespaceObject, "getPostLockUser", function() { return getPostLockUser; }); -__webpack_require__.d(selectors_namespaceObject, "getActivePostLock", function() { return getActivePostLock; }); -__webpack_require__.d(selectors_namespaceObject, "canUserUseUnfilteredHTML", function() { return selectors_canUserUseUnfilteredHTML; }); -__webpack_require__.d(selectors_namespaceObject, "isPublishSidebarEnabled", function() { return selectors_isPublishSidebarEnabled; }); -__webpack_require__.d(selectors_namespaceObject, "getEditorBlocks", function() { return getEditorBlocks; }); -__webpack_require__.d(selectors_namespaceObject, "getEditorSelectionStart", function() { return getEditorSelectionStart; }); -__webpack_require__.d(selectors_namespaceObject, "getEditorSelectionEnd", function() { return getEditorSelectionEnd; }); -__webpack_require__.d(selectors_namespaceObject, "getEditorSelection", function() { return selectors_getEditorSelection; }); -__webpack_require__.d(selectors_namespaceObject, "__unstableIsEditorReady", function() { return selectors_unstableIsEditorReady; }); -__webpack_require__.d(selectors_namespaceObject, "getEditorSettings", function() { return selectors_getEditorSettings; }); -__webpack_require__.d(selectors_namespaceObject, "getStateBeforeOptimisticTransaction", function() { return getStateBeforeOptimisticTransaction; }); -__webpack_require__.d(selectors_namespaceObject, "inSomeHistory", function() { return inSomeHistory; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockName", function() { return getBlockName; }); -__webpack_require__.d(selectors_namespaceObject, "isBlockValid", function() { return isBlockValid; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockAttributes", function() { return getBlockAttributes; }); -__webpack_require__.d(selectors_namespaceObject, "getBlock", function() { return getBlock; }); -__webpack_require__.d(selectors_namespaceObject, "getBlocks", function() { return selectors_getBlocks; }); -__webpack_require__.d(selectors_namespaceObject, "__unstableGetBlockWithoutInnerBlocks", function() { return __unstableGetBlockWithoutInnerBlocks; }); -__webpack_require__.d(selectors_namespaceObject, "getClientIdsOfDescendants", function() { return getClientIdsOfDescendants; }); -__webpack_require__.d(selectors_namespaceObject, "getClientIdsWithDescendants", function() { return getClientIdsWithDescendants; }); -__webpack_require__.d(selectors_namespaceObject, "getGlobalBlockCount", function() { return selectors_getGlobalBlockCount; }); -__webpack_require__.d(selectors_namespaceObject, "getBlocksByClientId", function() { return getBlocksByClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockCount", function() { return getBlockCount; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockSelectionStart", function() { return getBlockSelectionStart; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockSelectionEnd", function() { return getBlockSelectionEnd; }); -__webpack_require__.d(selectors_namespaceObject, "getSelectedBlockCount", function() { return getSelectedBlockCount; }); -__webpack_require__.d(selectors_namespaceObject, "hasSelectedBlock", function() { return hasSelectedBlock; }); -__webpack_require__.d(selectors_namespaceObject, "getSelectedBlockClientId", function() { return getSelectedBlockClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getSelectedBlock", function() { return getSelectedBlock; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockRootClientId", function() { return getBlockRootClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockHierarchyRootClientId", function() { return getBlockHierarchyRootClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getAdjacentBlockClientId", function() { return getAdjacentBlockClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getPreviousBlockClientId", function() { return getPreviousBlockClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getNextBlockClientId", function() { return getNextBlockClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getSelectedBlocksInitialCaretPosition", function() { return getSelectedBlocksInitialCaretPosition; }); -__webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlockClientIds", function() { return getMultiSelectedBlockClientIds; }); -__webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocks", function() { return getMultiSelectedBlocks; }); -__webpack_require__.d(selectors_namespaceObject, "getFirstMultiSelectedBlockClientId", function() { return getFirstMultiSelectedBlockClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getLastMultiSelectedBlockClientId", function() { return getLastMultiSelectedBlockClientId; }); -__webpack_require__.d(selectors_namespaceObject, "isFirstMultiSelectedBlock", function() { return isFirstMultiSelectedBlock; }); -__webpack_require__.d(selectors_namespaceObject, "isBlockMultiSelected", function() { return isBlockMultiSelected; }); -__webpack_require__.d(selectors_namespaceObject, "isAncestorMultiSelected", function() { return isAncestorMultiSelected; }); -__webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocksStartClientId", function() { return getMultiSelectedBlocksStartClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocksEndClientId", function() { return getMultiSelectedBlocksEndClientId; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockOrder", function() { return getBlockOrder; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockIndex", function() { return getBlockIndex; }); -__webpack_require__.d(selectors_namespaceObject, "isBlockSelected", function() { return isBlockSelected; }); -__webpack_require__.d(selectors_namespaceObject, "hasSelectedInnerBlock", function() { return hasSelectedInnerBlock; }); -__webpack_require__.d(selectors_namespaceObject, "isBlockWithinSelection", function() { return isBlockWithinSelection; }); -__webpack_require__.d(selectors_namespaceObject, "hasMultiSelection", function() { return hasMultiSelection; }); -__webpack_require__.d(selectors_namespaceObject, "isMultiSelecting", function() { return isMultiSelecting; }); -__webpack_require__.d(selectors_namespaceObject, "isSelectionEnabled", function() { return isSelectionEnabled; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockMode", function() { return getBlockMode; }); -__webpack_require__.d(selectors_namespaceObject, "isTyping", function() { return isTyping; }); -__webpack_require__.d(selectors_namespaceObject, "isCaretWithinFormattedText", function() { return isCaretWithinFormattedText; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockInsertionPoint", function() { return getBlockInsertionPoint; }); -__webpack_require__.d(selectors_namespaceObject, "isBlockInsertionPointVisible", function() { return isBlockInsertionPointVisible; }); -__webpack_require__.d(selectors_namespaceObject, "isValidTemplate", function() { return isValidTemplate; }); -__webpack_require__.d(selectors_namespaceObject, "getTemplate", function() { return getTemplate; }); -__webpack_require__.d(selectors_namespaceObject, "getTemplateLock", function() { return getTemplateLock; }); -__webpack_require__.d(selectors_namespaceObject, "canInsertBlockType", function() { return canInsertBlockType; }); -__webpack_require__.d(selectors_namespaceObject, "getInserterItems", function() { return getInserterItems; }); -__webpack_require__.d(selectors_namespaceObject, "hasInserterItems", function() { return hasInserterItems; }); -__webpack_require__.d(selectors_namespaceObject, "getBlockListSettings", function() { return getBlockListSettings; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetDefaultTemplateTypes", function() { return __experimentalGetDefaultTemplateTypes; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetDefaultTemplatePartAreas", function() { return __experimentalGetDefaultTemplatePartAreas; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetDefaultTemplateType", function() { return __experimentalGetDefaultTemplateType; }); -__webpack_require__.d(selectors_namespaceObject, "__experimentalGetTemplateInfo", function() { return __experimentalGetTemplateInfo; }); +__webpack_require__.d(selectors_namespaceObject, { + "__experimentalGetDefaultTemplatePartAreas": function() { return __experimentalGetDefaultTemplatePartAreas; }, + "__experimentalGetDefaultTemplateType": function() { return __experimentalGetDefaultTemplateType; }, + "__experimentalGetDefaultTemplateTypes": function() { return __experimentalGetDefaultTemplateTypes; }, + "__experimentalGetTemplateInfo": function() { return __experimentalGetTemplateInfo; }, + "__unstableIsEditorReady": function() { return __unstableIsEditorReady; }, + "canInsertBlockType": function() { return canInsertBlockType; }, + "canUserUseUnfilteredHTML": function() { return canUserUseUnfilteredHTML; }, + "didPostSaveRequestFail": function() { return didPostSaveRequestFail; }, + "didPostSaveRequestSucceed": function() { return didPostSaveRequestSucceed; }, + "getActivePostLock": function() { return getActivePostLock; }, + "getAdjacentBlockClientId": function() { return getAdjacentBlockClientId; }, + "getAutosaveAttribute": function() { return getAutosaveAttribute; }, + "getBlock": function() { return getBlock; }, + "getBlockAttributes": function() { return getBlockAttributes; }, + "getBlockCount": function() { return getBlockCount; }, + "getBlockHierarchyRootClientId": function() { return getBlockHierarchyRootClientId; }, + "getBlockIndex": function() { return getBlockIndex; }, + "getBlockInsertionPoint": function() { return getBlockInsertionPoint; }, + "getBlockListSettings": function() { return getBlockListSettings; }, + "getBlockMode": function() { return getBlockMode; }, + "getBlockName": function() { return getBlockName; }, + "getBlockOrder": function() { return getBlockOrder; }, + "getBlockRootClientId": function() { return getBlockRootClientId; }, + "getBlockSelectionEnd": function() { return getBlockSelectionEnd; }, + "getBlockSelectionStart": function() { return getBlockSelectionStart; }, + "getBlocks": function() { return getBlocks; }, + "getBlocksByClientId": function() { return getBlocksByClientId; }, + "getClientIdsOfDescendants": function() { return getClientIdsOfDescendants; }, + "getClientIdsWithDescendants": function() { return getClientIdsWithDescendants; }, + "getCurrentPost": function() { return getCurrentPost; }, + "getCurrentPostAttribute": function() { return getCurrentPostAttribute; }, + "getCurrentPostId": function() { return getCurrentPostId; }, + "getCurrentPostLastRevisionId": function() { return getCurrentPostLastRevisionId; }, + "getCurrentPostRevisionsCount": function() { return getCurrentPostRevisionsCount; }, + "getCurrentPostType": function() { return getCurrentPostType; }, + "getEditedPostAttribute": function() { return getEditedPostAttribute; }, + "getEditedPostContent": function() { return getEditedPostContent; }, + "getEditedPostPreviewLink": function() { return getEditedPostPreviewLink; }, + "getEditedPostSlug": function() { return getEditedPostSlug; }, + "getEditedPostVisibility": function() { return getEditedPostVisibility; }, + "getEditorBlocks": function() { return getEditorBlocks; }, + "getEditorSelection": function() { return getEditorSelection; }, + "getEditorSelectionEnd": function() { return getEditorSelectionEnd; }, + "getEditorSelectionStart": function() { return getEditorSelectionStart; }, + "getEditorSettings": function() { return getEditorSettings; }, + "getFirstMultiSelectedBlockClientId": function() { return getFirstMultiSelectedBlockClientId; }, + "getGlobalBlockCount": function() { return getGlobalBlockCount; }, + "getInserterItems": function() { return getInserterItems; }, + "getLastMultiSelectedBlockClientId": function() { return getLastMultiSelectedBlockClientId; }, + "getMultiSelectedBlockClientIds": function() { return getMultiSelectedBlockClientIds; }, + "getMultiSelectedBlocks": function() { return getMultiSelectedBlocks; }, + "getMultiSelectedBlocksEndClientId": function() { return getMultiSelectedBlocksEndClientId; }, + "getMultiSelectedBlocksStartClientId": function() { return getMultiSelectedBlocksStartClientId; }, + "getNextBlockClientId": function() { return getNextBlockClientId; }, + "getPermalink": function() { return getPermalink; }, + "getPermalinkParts": function() { return getPermalinkParts; }, + "getPostEdits": function() { return getPostEdits; }, + "getPostLockUser": function() { return getPostLockUser; }, + "getPostTypeLabel": function() { return getPostTypeLabel; }, + "getPreviousBlockClientId": function() { return getPreviousBlockClientId; }, + "getSelectedBlock": function() { return getSelectedBlock; }, + "getSelectedBlockClientId": function() { return getSelectedBlockClientId; }, + "getSelectedBlockCount": function() { return getSelectedBlockCount; }, + "getSelectedBlocksInitialCaretPosition": function() { return getSelectedBlocksInitialCaretPosition; }, + "getStateBeforeOptimisticTransaction": function() { return getStateBeforeOptimisticTransaction; }, + "getSuggestedPostFormat": function() { return getSuggestedPostFormat; }, + "getTemplate": function() { return getTemplate; }, + "getTemplateLock": function() { return getTemplateLock; }, + "hasChangedContent": function() { return hasChangedContent; }, + "hasEditorRedo": function() { return hasEditorRedo; }, + "hasEditorUndo": function() { return hasEditorUndo; }, + "hasInserterItems": function() { return hasInserterItems; }, + "hasMultiSelection": function() { return hasMultiSelection; }, + "hasNonPostEntityChanges": function() { return hasNonPostEntityChanges; }, + "hasSelectedBlock": function() { return hasSelectedBlock; }, + "hasSelectedInnerBlock": function() { return hasSelectedInnerBlock; }, + "inSomeHistory": function() { return inSomeHistory; }, + "isAncestorMultiSelected": function() { return isAncestorMultiSelected; }, + "isAutosavingPost": function() { return isAutosavingPost; }, + "isBlockInsertionPointVisible": function() { return isBlockInsertionPointVisible; }, + "isBlockMultiSelected": function() { return isBlockMultiSelected; }, + "isBlockSelected": function() { return isBlockSelected; }, + "isBlockValid": function() { return isBlockValid; }, + "isBlockWithinSelection": function() { return isBlockWithinSelection; }, + "isCaretWithinFormattedText": function() { return isCaretWithinFormattedText; }, + "isCleanNewPost": function() { return isCleanNewPost; }, + "isCurrentPostPending": function() { return isCurrentPostPending; }, + "isCurrentPostPublished": function() { return isCurrentPostPublished; }, + "isCurrentPostScheduled": function() { return isCurrentPostScheduled; }, + "isEditedPostAutosaveable": function() { return isEditedPostAutosaveable; }, + "isEditedPostBeingScheduled": function() { return isEditedPostBeingScheduled; }, + "isEditedPostDateFloating": function() { return isEditedPostDateFloating; }, + "isEditedPostDirty": function() { return isEditedPostDirty; }, + "isEditedPostEmpty": function() { return isEditedPostEmpty; }, + "isEditedPostNew": function() { return isEditedPostNew; }, + "isEditedPostPublishable": function() { return isEditedPostPublishable; }, + "isEditedPostSaveable": function() { return isEditedPostSaveable; }, + "isFirstMultiSelectedBlock": function() { return isFirstMultiSelectedBlock; }, + "isMultiSelecting": function() { return isMultiSelecting; }, + "isPermalinkEditable": function() { return isPermalinkEditable; }, + "isPostAutosavingLocked": function() { return isPostAutosavingLocked; }, + "isPostLockTakeover": function() { return isPostLockTakeover; }, + "isPostLocked": function() { return isPostLocked; }, + "isPostSavingLocked": function() { return isPostSavingLocked; }, + "isPreviewingPost": function() { return isPreviewingPost; }, + "isPublishSidebarEnabled": function() { return isPublishSidebarEnabled; }, + "isPublishingPost": function() { return isPublishingPost; }, + "isSavingNonPostEntityChanges": function() { return isSavingNonPostEntityChanges; }, + "isSavingPost": function() { return isSavingPost; }, + "isSelectionEnabled": function() { return isSelectionEnabled; }, + "isTyping": function() { return isTyping; }, + "isValidTemplate": function() { return isValidTemplate; } +}); // NAMESPACE OBJECT: ./node_modules/@wordpress/editor/build-module/store/actions.js var actions_namespaceObject = {}; __webpack_require__.r(actions_namespaceObject); -__webpack_require__.d(actions_namespaceObject, "setupEditor", function() { return actions_setupEditor; }); -__webpack_require__.d(actions_namespaceObject, "__experimentalTearDownEditor", function() { return actions_experimentalTearDownEditor; }); -__webpack_require__.d(actions_namespaceObject, "resetPost", function() { return resetPost; }); -__webpack_require__.d(actions_namespaceObject, "resetAutosave", function() { return resetAutosave; }); -__webpack_require__.d(actions_namespaceObject, "__experimentalRequestPostUpdateStart", function() { return __experimentalRequestPostUpdateStart; }); -__webpack_require__.d(actions_namespaceObject, "__experimentalRequestPostUpdateFinish", function() { return __experimentalRequestPostUpdateFinish; }); -__webpack_require__.d(actions_namespaceObject, "updatePost", function() { return updatePost; }); -__webpack_require__.d(actions_namespaceObject, "setupEditorState", function() { return setupEditorState; }); -__webpack_require__.d(actions_namespaceObject, "editPost", function() { return actions_editPost; }); -__webpack_require__.d(actions_namespaceObject, "savePost", function() { return actions_savePost; }); -__webpack_require__.d(actions_namespaceObject, "refreshPost", function() { return refreshPost; }); -__webpack_require__.d(actions_namespaceObject, "trashPost", function() { return trashPost; }); -__webpack_require__.d(actions_namespaceObject, "autosave", function() { return actions_autosave; }); -__webpack_require__.d(actions_namespaceObject, "redo", function() { return actions_redo; }); -__webpack_require__.d(actions_namespaceObject, "undo", function() { return actions_undo; }); -__webpack_require__.d(actions_namespaceObject, "createUndoLevel", function() { return createUndoLevel; }); -__webpack_require__.d(actions_namespaceObject, "updatePostLock", function() { return actions_updatePostLock; }); -__webpack_require__.d(actions_namespaceObject, "enablePublishSidebar", function() { return enablePublishSidebar; }); -__webpack_require__.d(actions_namespaceObject, "disablePublishSidebar", function() { return disablePublishSidebar; }); -__webpack_require__.d(actions_namespaceObject, "lockPostSaving", function() { return lockPostSaving; }); -__webpack_require__.d(actions_namespaceObject, "unlockPostSaving", function() { return unlockPostSaving; }); -__webpack_require__.d(actions_namespaceObject, "lockPostAutosaving", function() { return lockPostAutosaving; }); -__webpack_require__.d(actions_namespaceObject, "unlockPostAutosaving", function() { return unlockPostAutosaving; }); -__webpack_require__.d(actions_namespaceObject, "resetEditorBlocks", function() { return actions_resetEditorBlocks; }); -__webpack_require__.d(actions_namespaceObject, "updateEditorSettings", function() { return actions_updateEditorSettings; }); -__webpack_require__.d(actions_namespaceObject, "resetBlocks", function() { return resetBlocks; }); -__webpack_require__.d(actions_namespaceObject, "receiveBlocks", function() { return receiveBlocks; }); -__webpack_require__.d(actions_namespaceObject, "updateBlock", function() { return updateBlock; }); -__webpack_require__.d(actions_namespaceObject, "updateBlockAttributes", function() { return updateBlockAttributes; }); -__webpack_require__.d(actions_namespaceObject, "selectBlock", function() { return actions_selectBlock; }); -__webpack_require__.d(actions_namespaceObject, "startMultiSelect", function() { return startMultiSelect; }); -__webpack_require__.d(actions_namespaceObject, "stopMultiSelect", function() { return stopMultiSelect; }); -__webpack_require__.d(actions_namespaceObject, "multiSelect", function() { return multiSelect; }); -__webpack_require__.d(actions_namespaceObject, "clearSelectedBlock", function() { return actions_clearSelectedBlock; }); -__webpack_require__.d(actions_namespaceObject, "toggleSelection", function() { return toggleSelection; }); -__webpack_require__.d(actions_namespaceObject, "replaceBlocks", function() { return replaceBlocks; }); -__webpack_require__.d(actions_namespaceObject, "replaceBlock", function() { return replaceBlock; }); -__webpack_require__.d(actions_namespaceObject, "moveBlocksDown", function() { return moveBlocksDown; }); -__webpack_require__.d(actions_namespaceObject, "moveBlocksUp", function() { return moveBlocksUp; }); -__webpack_require__.d(actions_namespaceObject, "moveBlockToPosition", function() { return moveBlockToPosition; }); -__webpack_require__.d(actions_namespaceObject, "insertBlock", function() { return insertBlock; }); -__webpack_require__.d(actions_namespaceObject, "insertBlocks", function() { return actions_insertBlocks; }); -__webpack_require__.d(actions_namespaceObject, "showInsertionPoint", function() { return showInsertionPoint; }); -__webpack_require__.d(actions_namespaceObject, "hideInsertionPoint", function() { return hideInsertionPoint; }); -__webpack_require__.d(actions_namespaceObject, "setTemplateValidity", function() { return actions_setTemplateValidity; }); -__webpack_require__.d(actions_namespaceObject, "synchronizeTemplate", function() { return actions_synchronizeTemplate; }); -__webpack_require__.d(actions_namespaceObject, "mergeBlocks", function() { return mergeBlocks; }); -__webpack_require__.d(actions_namespaceObject, "removeBlocks", function() { return removeBlocks; }); -__webpack_require__.d(actions_namespaceObject, "removeBlock", function() { return removeBlock; }); -__webpack_require__.d(actions_namespaceObject, "toggleBlockMode", function() { return toggleBlockMode; }); -__webpack_require__.d(actions_namespaceObject, "startTyping", function() { return startTyping; }); -__webpack_require__.d(actions_namespaceObject, "stopTyping", function() { return stopTyping; }); -__webpack_require__.d(actions_namespaceObject, "enterFormattedText", function() { return enterFormattedText; }); -__webpack_require__.d(actions_namespaceObject, "exitFormattedText", function() { return exitFormattedText; }); -__webpack_require__.d(actions_namespaceObject, "insertDefaultBlock", function() { return actions_insertDefaultBlock; }); -__webpack_require__.d(actions_namespaceObject, "updateBlockListSettings", function() { return updateBlockListSettings; }); - -// EXTERNAL MODULE: external ["wp","blockEditor"] -var external_wp_blockEditor_ = __webpack_require__("axFQ"); - -// EXTERNAL MODULE: external ["wp","coreData"] -var external_wp_coreData_ = __webpack_require__("jZUy"); - -// EXTERNAL MODULE: external ["wp","richText"] -var external_wp_richText_ = __webpack_require__("qRz9"); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -var esm_extends = __webpack_require__("wx14"); - -// EXTERNAL MODULE: external ["wp","element"] -var external_wp_element_ = __webpack_require__("GRId"); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__("YLtl"); - -// EXTERNAL MODULE: external ["wp","blocks"] -var external_wp_blocks_ = __webpack_require__("HSyU"); - -// EXTERNAL MODULE: external ["wp","data"] -var external_wp_data_ = __webpack_require__("1ZqX"); - -// EXTERNAL MODULE: external ["wp","compose"] -var external_wp_compose_ = __webpack_require__("K9lf"); - -// EXTERNAL MODULE: external ["wp","hooks"] -var external_wp_hooks_ = __webpack_require__("g56x"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/hooks/custom-sources-backwards-compatibility.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - - -/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */ - -/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */ - -/** - * Object whose keys are the names of block attributes, where each value - * represents the meta key to which the block attribute is intended to save. - * - * @see https://developer.wordpress.org/reference/functions/register_meta/ - * - * @typedef {Object} WPMetaAttributeMapping - */ - -/** - * Given a mapping of attribute names (meta source attributes) to their - * associated meta key, returns a higher order component that overrides its - * `attributes` and `setAttributes` props to sync any changes with the edited - * post's meta keys. - * - * @param {WPMetaAttributeMapping} metaAttributes Meta attribute mapping. - * - * @return {WPHigherOrderComponent} Higher-order component. - */ - -const createWithMetaAttributeSource = metaAttributes => Object(external_wp_compose_["createHigherOrderComponent"])(BlockEdit => ({ - attributes, - setAttributes, - ...props -}) => { - const postType = Object(external_wp_data_["useSelect"])(select => select('core/editor').getCurrentPostType(), []); - const [meta, setMeta] = Object(external_wp_coreData_["useEntityProp"])('postType', postType, 'meta'); - const mergedAttributes = Object(external_wp_element_["useMemo"])(() => ({ ...attributes, - ...Object(external_lodash_["mapValues"])(metaAttributes, metaKey => meta[metaKey]) - }), [attributes, meta]); - return Object(external_wp_element_["createElement"])(BlockEdit, Object(esm_extends["a" /* default */])({ - attributes: mergedAttributes, - setAttributes: nextAttributes => { - const nextMeta = Object(external_lodash_["mapKeys"])( // Filter to intersection of keys between the updated - // attributes and those with an associated meta key. - Object(external_lodash_["pickBy"])(nextAttributes, (value, key) => metaAttributes[key]), // Rename the keys to the expected meta key name. - (value, attributeKey) => metaAttributes[attributeKey]); - - if (!Object(external_lodash_["isEmpty"])(nextMeta)) { - setMeta(nextMeta); +__webpack_require__.d(actions_namespaceObject, { + "__experimentalTearDownEditor": function() { return __experimentalTearDownEditor; }, + "autosave": function() { return autosave; }, + "clearSelectedBlock": function() { return clearSelectedBlock; }, + "createUndoLevel": function() { return createUndoLevel; }, + "disablePublishSidebar": function() { return disablePublishSidebar; }, + "editPost": function() { return editPost; }, + "enablePublishSidebar": function() { return enablePublishSidebar; }, + "enterFormattedText": function() { return enterFormattedText; }, + "exitFormattedText": function() { return exitFormattedText; }, + "hideInsertionPoint": function() { return hideInsertionPoint; }, + "insertBlock": function() { return insertBlock; }, + "insertBlocks": function() { return insertBlocks; }, + "insertDefaultBlock": function() { return insertDefaultBlock; }, + "lockPostAutosaving": function() { return lockPostAutosaving; }, + "lockPostSaving": function() { return lockPostSaving; }, + "mergeBlocks": function() { return mergeBlocks; }, + "moveBlockToPosition": function() { return moveBlockToPosition; }, + "moveBlocksDown": function() { return moveBlocksDown; }, + "moveBlocksUp": function() { return moveBlocksUp; }, + "multiSelect": function() { return multiSelect; }, + "receiveBlocks": function() { return receiveBlocks; }, + "redo": function() { return redo; }, + "refreshPost": function() { return refreshPost; }, + "removeBlock": function() { return removeBlock; }, + "removeBlocks": function() { return removeBlocks; }, + "replaceBlock": function() { return replaceBlock; }, + "replaceBlocks": function() { return replaceBlocks; }, + "resetBlocks": function() { return resetBlocks; }, + "resetEditorBlocks": function() { return resetEditorBlocks; }, + "resetPost": function() { return resetPost; }, + "savePost": function() { return savePost; }, + "selectBlock": function() { return selectBlock; }, + "setTemplateValidity": function() { return setTemplateValidity; }, + "setupEditor": function() { return setupEditor; }, + "setupEditorState": function() { return setupEditorState; }, + "showInsertionPoint": function() { return showInsertionPoint; }, + "startMultiSelect": function() { return startMultiSelect; }, + "startTyping": function() { return startTyping; }, + "stopMultiSelect": function() { return stopMultiSelect; }, + "stopTyping": function() { return stopTyping; }, + "synchronizeTemplate": function() { return synchronizeTemplate; }, + "toggleBlockMode": function() { return toggleBlockMode; }, + "toggleSelection": function() { return toggleSelection; }, + "trashPost": function() { return trashPost; }, + "undo": function() { return undo; }, + "unlockPostAutosaving": function() { return unlockPostAutosaving; }, + "unlockPostSaving": function() { return unlockPostSaving; }, + "updateBlock": function() { return updateBlock; }, + "updateBlockAttributes": function() { return updateBlockAttributes; }, + "updateBlockListSettings": function() { return updateBlockListSettings; }, + "updateEditorSettings": function() { return updateEditorSettings; }, + "updatePost": function() { return updatePost; }, + "updatePostLock": function() { return updatePostLock; } +}); + +;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js +function _extends() { + _extends = Object.assign ? Object.assign.bind() : function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } } - - setAttributes(nextAttributes); - } - }, props)); -}, 'withMetaAttributeSource'); -/** - * Filters a registered block's settings to enhance a block's `edit` component - * to upgrade meta-sourced attributes to use the post's meta entity property. - * - * @param {WPBlockSettings} settings Registered block settings. - * - * @return {WPBlockSettings} Filtered block settings. - */ - - -function shimAttributeSource(settings) { - /** @type {WPMetaAttributeMapping} */ - const metaAttributes = Object(external_lodash_["mapValues"])(Object(external_lodash_["pickBy"])(settings.attributes, { - source: 'meta' - }), 'meta'); - - if (!Object(external_lodash_["isEmpty"])(metaAttributes)) { - settings.edit = createWithMetaAttributeSource(metaAttributes)(settings.edit); - } - - return settings; -} - -Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/editor/custom-sources-backwards-compatibility/shim-attribute-source', shimAttributeSource); // The above filter will only capture blocks registered after the filter was -// added. There may already be blocks registered by this point, and those must -// be updated to apply the shim. -// -// The following implementation achieves this, albeit with a couple caveats: -// - Only blocks registered on the global store will be modified. -// - The block settings are directly mutated, since there is currently no -// mechanism to update an existing block registration. This is the reason for -// `getBlockType` separate from `getBlockTypes`, since the latter returns a -// _copy_ of the block registration (i.e. the mutation would not affect the -// actual registered block settings). -// -// `getBlockTypes` or `getBlockType` implementation could change in the future -// in regards to creating settings clones, but the corresponding end-to-end -// tests for meta blocks should cover against any potential regressions. -// -// In the future, we could support updating block settings, at which point this -// implementation could use that mechanism instead. - -Object(external_wp_data_["select"])(external_wp_blocks_["store"]).getBlockTypes().map(({ - name -}) => Object(external_wp_data_["select"])(external_wp_blocks_["store"]).getBlockType(name)).forEach(shimAttributeSource); - -// EXTERNAL MODULE: external ["wp","apiFetch"] -var external_wp_apiFetch_ = __webpack_require__("ywyh"); -var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/autocompleters/user.js - - -/** - * WordPress dependencies - */ - -/** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */ - -/** - * A user mentions completer. - * - * @type {WPCompleter} - */ - -/* harmony default export */ var autocompleters_user = ({ - name: 'users', - className: 'editor-autocompleters__user', - triggerPrefix: '@', - - options(search) { - let payload = ''; - - if (search) { - payload = '?search=' + encodeURIComponent(search); - } - - return external_wp_apiFetch_default()({ - path: '/wp/v2/users' + payload - }); - }, - - isDebounced: true, - - getOptionKeywords(user) { - return [user.slug, user.name]; - }, - - getOptionLabel(user) { - const avatar = user.avatar_urls && user.avatar_urls[24] ? Object(external_wp_element_["createElement"])("img", { - key: "avatar", - className: "editor-autocompleters__user-avatar", - alt: "", - src: user.avatar_urls[24] - }) : Object(external_wp_element_["createElement"])("span", { - className: "editor-autocompleters__no-avatar" - }); - return [avatar, Object(external_wp_element_["createElement"])("span", { - key: "name", - className: "editor-autocompleters__user-name" - }, user.name), Object(external_wp_element_["createElement"])("span", { - key: "slug", - className: "editor-autocompleters__user-slug" - }, user.slug)]; - }, - - getOptionCompletion(user) { - return `@${user.slug}`; - } - -}); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/hooks/default-autocompleters.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - -function setDefaultCompleters(completers = []) { - // Provide copies so filters may directly modify them. - completers.push(Object(external_lodash_["clone"])(autocompleters_user)); - return completers; -} - -Object(external_wp_hooks_["addFilter"])('editor.Autocomplete.completers', 'editor/autocompleters/set-default-completers', setDefaultCompleters); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/hooks/index.js -/** - * Internal dependencies - */ - - - -// EXTERNAL MODULE: external ["wp","dataControls"] -var external_wp_dataControls_ = __webpack_require__("51Zz"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/defaults.js -/** - * WordPress dependencies - */ - -const PREFERENCES_DEFAULTS = { - insertUsage: {}, - // Should be kept for backward compatibility, see: https://github.com/WordPress/gutenberg/issues/14580. - isPublishSidebarEnabled: true -}; -/** - * The default post editor settings - * - * allowedBlockTypes boolean|Array Allowed block types - * richEditingEnabled boolean Whether rich editing is enabled or not - * codeEditingEnabled boolean Whether code editing is enabled or not - * enableCustomFields boolean Whether the WordPress custom fields are enabled or not - * autosaveInterval number Autosave Interval - * availableTemplates array? The available post templates - * disablePostFormats boolean Whether or not the post formats are disabled - * allowedMimeTypes array? List of allowed mime types and file extensions - * maxUploadFileSize number Maximum upload file size - * supportsLayout boolean Whether the editor supports layouts. - */ - -const EDITOR_SETTINGS_DEFAULTS = { ...external_wp_blockEditor_["SETTINGS_DEFAULTS"], + } + + return target; + }; + return _extends.apply(this, arguments); +} +;// CONCATENATED MODULE: external ["wp","element"] +var external_wp_element_namespaceObject = window["wp"]["element"]; +;// CONCATENATED MODULE: external "lodash" +var external_lodash_namespaceObject = window["lodash"]; +;// CONCATENATED MODULE: external ["wp","blocks"] +var external_wp_blocks_namespaceObject = window["wp"]["blocks"]; +;// CONCATENATED MODULE: external ["wp","data"] +var external_wp_data_namespaceObject = window["wp"]["data"]; +;// CONCATENATED MODULE: external ["wp","coreData"] +var external_wp_coreData_namespaceObject = window["wp"]["coreData"]; +;// CONCATENATED MODULE: external ["wp","compose"] +var external_wp_compose_namespaceObject = window["wp"]["compose"]; +;// CONCATENATED MODULE: external ["wp","hooks"] +var external_wp_hooks_namespaceObject = window["wp"]["hooks"]; +;// CONCATENATED MODULE: external ["wp","blockEditor"] +var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/defaults.js +/** + * WordPress dependencies + */ + +/** + * The default post editor settings. + * + * @property {boolean|Array} allowedBlockTypes Allowed block types + * @property {boolean} richEditingEnabled Whether rich editing is enabled or not + * @property {boolean} codeEditingEnabled Whether code editing is enabled or not + * @property {boolean} enableCustomFields Whether the WordPress custom fields are enabled or not. + * true = the user has opted to show the Custom Fields panel at the bottom of the editor. + * false = the user has opted to hide the Custom Fields panel at the bottom of the editor. + * undefined = the current environment does not support Custom Fields, so the option toggle in Preferences -> Panels to enable the Custom Fields panel is not displayed. + * @property {number} autosaveInterval How often in seconds the post will be auto-saved via the REST API. + * @property {number} localAutosaveInterval How often in seconds the post will be backed up to sessionStorage. + * @property {Array?} availableTemplates The available post templates + * @property {boolean} disablePostFormats Whether or not the post formats are disabled + * @property {Array?} allowedMimeTypes List of allowed mime types and file extensions + * @property {number} maxUploadFileSize Maximum upload file size + * @property {boolean} supportsLayout Whether the editor supports layouts. + */ + +const EDITOR_SETTINGS_DEFAULTS = { ...external_wp_blockEditor_namespaceObject.SETTINGS_DEFAULTS, richEditingEnabled: true, codeEditingEnabled: true, - enableCustomFields: false, + enableCustomFields: undefined, supportsLayout: true }; -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/reducer.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/reducer.js /** * External dependencies */ @@ -1390,7 +1243,7 @@ */ function hasSameKeys(a, b) { - return Object(external_lodash_["isEqual"])(Object(external_lodash_["keys"])(a), Object(external_lodash_["keys"])(b)); + return isEqual(keys(a), keys(b)); } /** * Returns true if, given the currently dispatching action and the previously @@ -1428,19 +1281,23 @@ return isUpdatingSamePostProperty(action, previousAction); } -function reducer_postId(state = null, action) { +function postId() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + let action = arguments.length > 1 ? arguments[1] : undefined; + switch (action.type) { case 'SETUP_EDITOR_STATE': - case 'RESET_POST': return action.post.id; } return state; } -function reducer_postType(state = null, action) { +function postType() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + let action = arguments.length > 1 ? arguments[1] : undefined; + switch (action.type) { case 'SETUP_EDITOR_STATE': - case 'RESET_POST': return action.post.type; } @@ -1455,9 +1312,12 @@ * @return {boolean} Updated state. */ -function reducer_template(state = { - isValid: true -}, action) { +function template() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + isValid: true + }; + let action = arguments.length > 1 ? arguments[1] : undefined; + switch (action.type) { case 'SET_TEMPLATE_VALIDITY': return { ...state, @@ -1468,30 +1328,6 @@ return state; } /** - * Reducer returning the user preferences. - * - * @param {Object} state Current state. - * @param {Object} action Dispatched action. - * - * @return {string} Updated state. - */ - -function preferences(state = PREFERENCES_DEFAULTS, action) { - switch (action.type) { - case 'ENABLE_PUBLISH_SIDEBAR': - return { ...state, - isPublishSidebarEnabled: true - }; - - case 'DISABLE_PUBLISH_SIDEBAR': - return { ...state, - isPublishSidebarEnabled: false - }; - } - - return state; -} -/** * Reducer returning current network request state (whether a request to * the WP REST API is in progress, successful, or failed). * @@ -1501,7 +1337,10 @@ * @return {Object} Updated state. */ -function saving(state = {}, action) { +function saving() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let action = arguments.length > 1 ? arguments[1] : undefined; + switch (action.type) { case 'REQUEST_POST_UPDATE_START': case 'REQUEST_POST_UPDATE_FINISH': @@ -1518,7 +1357,7 @@ * * @typedef {Object} PostLockState * - * @property {boolean} isLocked Whether the post is locked. + * @property {boolean} isLocked Whether the post is locked. * @property {?boolean} isTakeover Whether the post editing has been taken over. * @property {?boolean} activePostLock Active post lock value. * @property {?Object} user User that took over the post. @@ -1528,14 +1367,17 @@ * Reducer returning the post lock status. * * @param {PostLockState} state Current state. - * @param {Object} action Dispatched action. + * @param {Object} action Dispatched action. * * @return {PostLockState} Updated state. */ -function postLock(state = { - isLocked: false -}, action) { +function postLock() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + isLocked: false + }; + let action = arguments.length > 1 ? arguments[1] : undefined; + switch (action.type) { case 'UPDATE_POST_LOCK': return action.lock; @@ -1554,7 +1396,10 @@ * @return {PostLockState} Updated state. */ -function postSavingLock(state = {}, action) { +function postSavingLock() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let action = arguments.length > 1 ? arguments[1] : undefined; + switch (action.type) { case 'LOCK_POST_SAVING': return { ...state, @@ -1562,7 +1407,7 @@ }; case 'UNLOCK_POST_SAVING': - return Object(external_lodash_["omit"])(state, action.lockName); + return (0,external_lodash_namespaceObject.omit)(state, action.lockName); } return state; @@ -1578,7 +1423,10 @@ * @return {PostLockState} Updated state. */ -function postAutosavingLock(state = {}, action) { +function postAutosavingLock() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let action = arguments.length > 1 ? arguments[1] : undefined; + switch (action.type) { case 'LOCK_POST_AUTOSAVING': return { ...state, @@ -1586,7 +1434,7 @@ }; case 'UNLOCK_POST_AUTOSAVING': - return Object(external_lodash_["omit"])(state, action.lockName); + return (0,external_lodash_namespaceObject.omit)(state, action.lockName); } return state; @@ -1597,12 +1445,15 @@ * the post object is loaded properly and the initial blocks parsed. * * @param {boolean} state - * @param {Object} action + * @param {Object} action * * @return {boolean} Updated state. */ -function reducer_isReady(state = false, action) { +function isReady() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + let action = arguments.length > 1 ? arguments[1] : undefined; + switch (action.type) { case 'SETUP_EDITOR_STATE': return true; @@ -1622,7 +1473,10 @@ * @return {Object} Updated state. */ -function reducer_editorSettings(state = EDITOR_SETTINGS_DEFAULTS, action) { +function editorSettings() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : EDITOR_SETTINGS_DEFAULTS; + let action = arguments.length > 1 ? arguments[1] : undefined; + switch (action.type) { case 'UPDATE_EDITOR_SETTINGS': return { ...state, @@ -1632,36 +1486,321 @@ return state; } -/* harmony default export */ var reducer = (Object(external_wp_data_["combineReducers"])({ - postId: reducer_postId, - postType: reducer_postType, - preferences, +/* harmony default export */ var reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ + postId, + postType, saving, postLock, - template: reducer_template, + template, postSavingLock, - isReady: reducer_isReady, - editorSettings: reducer_editorSettings, + isReady, + editorSettings, postAutosavingLock })); -// EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js -var rememo = __webpack_require__("pPDe"); - -// EXTERNAL MODULE: external ["wp","date"] -var external_wp_date_ = __webpack_require__("FqII"); - -// EXTERNAL MODULE: external ["wp","url"] -var external_wp_url_ = __webpack_require__("Mmq9"); - -// EXTERNAL MODULE: external ["wp","deprecated"] -var external_wp_deprecated_ = __webpack_require__("NMb1"); -var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js -var layout = __webpack_require__("Civd"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/constants.js +;// CONCATENATED MODULE: ./node_modules/rememo/es/rememo.js + + +var LEAF_KEY, hasWeakMap; + +/** + * Arbitrary value used as key for referencing cache object in WeakMap tree. + * + * @type {Object} + */ +LEAF_KEY = {}; + +/** + * Whether environment supports WeakMap. + * + * @type {boolean} + */ +hasWeakMap = typeof WeakMap !== 'undefined'; + +/** + * Returns the first argument as the sole entry in an array. + * + * @param {*} value Value to return. + * + * @return {Array} Value returned as entry in array. + */ +function arrayOf( value ) { + return [ value ]; +} + +/** + * Returns true if the value passed is object-like, or false otherwise. A value + * is object-like if it can support property assignment, e.g. object or array. + * + * @param {*} value Value to test. + * + * @return {boolean} Whether value is object-like. + */ +function isObjectLike( value ) { + return !! value && 'object' === typeof value; +} + +/** + * Creates and returns a new cache object. + * + * @return {Object} Cache object. + */ +function createCache() { + var cache = { + clear: function() { + cache.head = null; + }, + }; + + return cache; +} + +/** + * Returns true if entries within the two arrays are strictly equal by + * reference from a starting index. + * + * @param {Array} a First array. + * @param {Array} b Second array. + * @param {number} fromIndex Index from which to start comparison. + * + * @return {boolean} Whether arrays are shallowly equal. + */ +function isShallowEqual( a, b, fromIndex ) { + var i; + + if ( a.length !== b.length ) { + return false; + } + + for ( i = fromIndex; i < a.length; i++ ) { + if ( a[ i ] !== b[ i ] ) { + return false; + } + } + + return true; +} + +/** + * Returns a memoized selector function. The getDependants function argument is + * called before the memoized selector and is expected to return an immutable + * reference or array of references on which the selector depends for computing + * its own return value. The memoize cache is preserved only as long as those + * dependant references remain the same. If getDependants returns a different + * reference(s), the cache is cleared and the selector value regenerated. + * + * @param {Function} selector Selector function. + * @param {Function} getDependants Dependant getter returning an immutable + * reference or array of reference used in + * cache bust consideration. + * + * @return {Function} Memoized selector. + */ +/* harmony default export */ function rememo(selector, getDependants ) { + var rootCache, getCache; + + // Use object source as dependant if getter not provided + if ( ! getDependants ) { + getDependants = arrayOf; + } + + /** + * Returns the root cache. If WeakMap is supported, this is assigned to the + * root WeakMap cache set, otherwise it is a shared instance of the default + * cache object. + * + * @return {(WeakMap|Object)} Root cache object. + */ + function getRootCache() { + return rootCache; + } + + /** + * Returns the cache for a given dependants array. When possible, a WeakMap + * will be used to create a unique cache for each set of dependants. This + * is feasible due to the nature of WeakMap in allowing garbage collection + * to occur on entries where the key object is no longer referenced. Since + * WeakMap requires the key to be an object, this is only possible when the + * dependant is object-like. The root cache is created as a hierarchy where + * each top-level key is the first entry in a dependants set, the value a + * WeakMap where each key is the next dependant, and so on. This continues + * so long as the dependants are object-like. If no dependants are object- + * like, then the cache is shared across all invocations. + * + * @see isObjectLike + * + * @param {Array} dependants Selector dependants. + * + * @return {Object} Cache object. + */ + function getWeakMapCache( dependants ) { + var caches = rootCache, + isUniqueByDependants = true, + i, dependant, map, cache; + + for ( i = 0; i < dependants.length; i++ ) { + dependant = dependants[ i ]; + + // Can only compose WeakMap from object-like key. + if ( ! isObjectLike( dependant ) ) { + isUniqueByDependants = false; + break; + } + + // Does current segment of cache already have a WeakMap? + if ( caches.has( dependant ) ) { + // Traverse into nested WeakMap. + caches = caches.get( dependant ); + } else { + // Create, set, and traverse into a new one. + map = new WeakMap(); + caches.set( dependant, map ); + caches = map; + } + } + + // We use an arbitrary (but consistent) object as key for the last item + // in the WeakMap to serve as our running cache. + if ( ! caches.has( LEAF_KEY ) ) { + cache = createCache(); + cache.isUniqueByDependants = isUniqueByDependants; + caches.set( LEAF_KEY, cache ); + } + + return caches.get( LEAF_KEY ); + } + + // Assign cache handler by availability of WeakMap + getCache = hasWeakMap ? getWeakMapCache : getRootCache; + + /** + * Resets root memoization cache. + */ + function clear() { + rootCache = hasWeakMap ? new WeakMap() : createCache(); + } + + // eslint-disable-next-line jsdoc/check-param-names + /** + * The augmented selector call, considering first whether dependants have + * changed before passing it to underlying memoize function. + * + * @param {Object} source Source object for derivation. + * @param {...*} extraArgs Additional arguments to pass to selector. + * + * @return {*} Selector result. + */ + function callSelector( /* source, ...extraArgs */ ) { + var len = arguments.length, + cache, node, i, args, dependants; + + // Create copy of arguments (avoid leaking deoptimization). + args = new Array( len ); + for ( i = 0; i < len; i++ ) { + args[ i ] = arguments[ i ]; + } + + dependants = getDependants.apply( null, args ); + cache = getCache( dependants ); + + // If not guaranteed uniqueness by dependants (primitive type or lack + // of WeakMap support), shallow compare against last dependants and, if + // references have changed, destroy cache to recalculate result. + if ( ! cache.isUniqueByDependants ) { + if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) { + cache.clear(); + } + + cache.lastDependants = dependants; + } + + node = cache.head; + while ( node ) { + // Check whether node arguments match arguments + if ( ! isShallowEqual( node.args, args, 1 ) ) { + node = node.next; + continue; + } + + // At this point we can assume we've found a match + + // Surface matched node to head if not already + if ( node !== cache.head ) { + // Adjust siblings to point to each other. + node.prev.next = node.next; + if ( node.next ) { + node.next.prev = node.prev; + } + + node.next = cache.head; + node.prev = null; + cache.head.prev = node; + cache.head = node; + } + + // Return immediately + return node.val; + } + + // No cached value found. Continue to insertion phase: + + node = { + // Generate the result from original function + val: selector.apply( null, args ), + }; + + // Avoid including the source object in the cache. + args[ 0 ] = null; + node.args = args; + + // Don't need to check whether node is already head, since it would + // have been returned above already if it was + + // Shift existing head down list + if ( cache.head ) { + cache.head.prev = node; + node.next = cache.head; + } + + cache.head = node; + + return node.val; + } + + callSelector.getDependants = getDependants; + callSelector.clear = clear; + clear(); + + return callSelector; +} + +;// CONCATENATED MODULE: external ["wp","date"] +var external_wp_date_namespaceObject = window["wp"]["date"]; +;// CONCATENATED MODULE: external ["wp","url"] +var external_wp_url_namespaceObject = window["wp"]["url"]; +;// CONCATENATED MODULE: external ["wp","deprecated"] +var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; +var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); +;// CONCATENATED MODULE: external ["wp","primitives"] +var external_wp_primitives_namespaceObject = window["wp"]["primitives"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js + + +/** + * WordPress dependencies + */ + +const layout = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" +})); +/* harmony default export */ var library_layout = (layout); + +;// CONCATENATED MODULE: external ["wp","preferences"] +var external_wp_preferences_namespaceObject = window["wp"]["preferences"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/constants.js /** * Set of post properties for which edits should assume a merging behavior, * assuming an object value. @@ -1682,105 +1821,68 @@ const ONE_MINUTE_IN_MS = 60 * 1000; const AUTOSAVE_PROPERTIES = ['title', 'excerpt', 'content']; -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/utils/url.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - -/** - * Returns the URL of a WPAdmin Page. - * - * TODO: This should be moved to a module less specific to the editor. - * - * @param {string} page Page to navigate to. - * @param {Object} query Query Args. - * - * @return {string} WPAdmin URL. - */ - -function getWPAdminURL(page, query) { - return Object(external_wp_url_["addQueryArgs"])(page, query); -} -/** - * Performs some basic cleanup of a string for use as a post slug - * - * This replicates some of what sanitize_title() does in WordPress core, but - * is only designed to approximate what the slug will be. - * - * Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin letters. - * Removes combining diacritical marks. Converts whitespace, periods, - * and forward slashes to hyphens. Removes any remaining non-word characters - * except hyphens and underscores. Converts remaining string to lowercase. - * It does not account for octets, HTML entities, or other encoded characters. - * - * @param {string} string Title or slug to be processed - * - * @return {string} Processed string - */ - -function cleanForSlug(string) { - if (!string) { - return ''; - } - - return Object(external_lodash_["trim"])(Object(external_lodash_["deburr"])(string).replace(/[\s\./]+/g, '-').replace(/[^\p{L}\p{N}_-]+/gu, '').toLowerCase(), '-'); -} - -// EXTERNAL MODULE: external ["wp","primitives"] -var external_wp_primitives_ = __webpack_require__("Tqx9"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/header.js - - -/** - * WordPress dependencies - */ - -const header = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/header.js + + +/** + * WordPress dependencies + */ + +const header = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M18.5 10.5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" })); /* harmony default export */ var library_header = (header); -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/footer.js - - -/** - * WordPress dependencies - */ - -const footer = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/footer.js + + +/** + * WordPress dependencies + */ + +const footer = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", d: "M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" })); /* harmony default export */ var library_footer = (footer); -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/sidebar.js - - -/** - * WordPress dependencies - */ - -const sidebar = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/sidebar.js + + +/** + * WordPress dependencies + */ + +const sidebar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" })); /* harmony default export */ var library_sidebar = (sidebar); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/utils/get-template-part-icon.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js + + +/** + * WordPress dependencies + */ + +const symbolFilled = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" +})); +/* harmony default export */ var symbol_filled = (symbolFilled); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/utils/get-template-part-icon.js /** * WordPress dependencies */ @@ -1802,10 +1904,10 @@ return library_sidebar; } - return layout["a" /* default */]; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/selectors.js + return symbol_filled; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/selectors.js /** * External dependencies */ @@ -1822,6 +1924,9 @@ + + + /** * Internal dependencies */ @@ -1829,8 +1934,6 @@ - - /** * Shared reference to an empty object for cases where it is important to avoid * returning a new object reference on every invocation, as in a connected or @@ -1857,8 +1960,8 @@ * @return {boolean} Whether undo history exists. */ -const hasEditorUndo = Object(external_wp_data_["createRegistrySelector"])(select => () => { - return select('core').hasUndo(); +const hasEditorUndo = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { + return select(external_wp_coreData_namespaceObject.store).hasUndo(); }); /** * Returns true if any future editor history snapshots exist, or false @@ -1869,8 +1972,8 @@ * @return {boolean} Whether redo history exists. */ -const hasEditorRedo = Object(external_wp_data_["createRegistrySelector"])(select => () => { - return select('core').hasRedo(); +const hasEditorRedo = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { + return select(external_wp_coreData_namespaceObject.store).hasRedo(); }); /** * Returns true if the currently edited post is yet to be saved, or false if @@ -1881,8 +1984,8 @@ * @return {boolean} Whether the post is new. */ -function selectors_isEditedPostNew(state) { - return selectors_getCurrentPost(state).status === 'auto-draft'; +function isEditedPostNew(state) { + return getCurrentPost(state).status === 'auto-draft'; } /** * Returns true if content includes unsaved changes, or false otherwise. @@ -1893,7 +1996,7 @@ */ function hasChangedContent(state) { - const edits = selectors_getPostEdits(state); + const edits = getPostEdits(state); return 'blocks' in edits || // `edits` is intended to contain only values which are different from // the saved post, so the mere presence of a property is an indicator // that the value is different than what is known to be saved. While @@ -1910,14 +2013,14 @@ * @return {boolean} Whether unsaved values exist. */ -const selectors_isEditedPostDirty = Object(external_wp_data_["createRegistrySelector"])(select => state => { +const isEditedPostDirty = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { // Edits should contain only fields which differ from the saved post (reset // at initial load and save complete). Thus, a non-empty edits state can be // inferred to contain unsaved values. - const postType = selectors_getCurrentPostType(state); - const postId = selectors_getCurrentPostId(state); - - if (select('core').hasEditsForEntityRecord('postType', postType, postId)) { + const postType = getCurrentPostType(state); + const postId = getCurrentPostId(state); + + if (select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord('postType', postType, postId)) { return true; } @@ -1932,14 +2035,14 @@ * @return {boolean} Whether there are edits or not. */ -const selectors_hasNonPostEntityChanges = Object(external_wp_data_["createRegistrySelector"])(select => state => { - const dirtyEntityRecords = select('core').__experimentalGetDirtyEntityRecords(); +const hasNonPostEntityChanges = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { + const dirtyEntityRecords = select(external_wp_coreData_namespaceObject.store).__experimentalGetDirtyEntityRecords(); const { type, id - } = selectors_getCurrentPost(state); - return Object(external_lodash_["some"])(dirtyEntityRecords, entityRecord => entityRecord.kind !== 'postType' || entityRecord.name !== type || entityRecord.key !== id); + } = getCurrentPost(state); + return (0,external_lodash_namespaceObject.some)(dirtyEntityRecords, entityRecord => entityRecord.kind !== 'postType' || entityRecord.name !== type || entityRecord.key !== id); }); /** * Returns true if there are no unsaved values for the current edit session and @@ -1950,8 +2053,8 @@ * @return {boolean} Whether new post and unsaved values exist. */ -function selectors_isCleanNewPost(state) { - return !selectors_isEditedPostDirty(state) && selectors_isEditedPostNew(state); +function isCleanNewPost(state) { + return !isEditedPostDirty(state) && isEditedPostNew(state); } /** * Returns the post currently being edited in its last known saved state, not @@ -1963,10 +2066,10 @@ * @return {Object} Post object. */ -const selectors_getCurrentPost = Object(external_wp_data_["createRegistrySelector"])(select => state => { - const postId = selectors_getCurrentPostId(state); - const postType = selectors_getCurrentPostType(state); - const post = select('core').getRawEntityRecord('postType', postType, postId); +const getCurrentPost = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { + const postId = getCurrentPostId(state); + const postType = getCurrentPostType(state); + const post = select(external_wp_coreData_namespaceObject.store).getRawEntityRecord('postType', postType, postId); if (post) { return post; @@ -1985,7 +2088,7 @@ * @return {string} Post type. */ -function selectors_getCurrentPostType(state) { +function getCurrentPostType(state) { return state.postType; } /** @@ -1997,7 +2100,7 @@ * @return {?number} ID of current post. */ -function selectors_getCurrentPostId(state) { +function getCurrentPostId(state) { return state.postId; } /** @@ -2009,7 +2112,7 @@ */ function getCurrentPostRevisionsCount(state) { - return Object(external_lodash_["get"])(selectors_getCurrentPost(state), ['_links', 'version-history', 0, 'count'], 0); + return (0,external_lodash_namespaceObject.get)(getCurrentPost(state), ['_links', 'version-history', 0, 'count'], 0); } /** * Returns the last revision ID of the post currently being edited, @@ -2021,7 +2124,7 @@ */ function getCurrentPostLastRevisionId(state) { - return Object(external_lodash_["get"])(selectors_getCurrentPost(state), ['_links', 'predecessor-version', 0, 'id'], null); + return (0,external_lodash_namespaceObject.get)(getCurrentPost(state), ['_links', 'predecessor-version', 0, 'id'], null); } /** * Returns any post values which have been changed in the editor but not yet @@ -2032,40 +2135,10 @@ * @return {Object} Object of key value pairs comprising unsaved edits. */ -const selectors_getPostEdits = Object(external_wp_data_["createRegistrySelector"])(select => state => { - const postType = selectors_getCurrentPostType(state); - const postId = selectors_getCurrentPostId(state); - return select('core').getEntityRecordEdits('postType', postType, postId) || EMPTY_OBJECT; -}); -/** - * Returns a new reference when edited values have changed. This is useful in - * inferring where an edit has been made between states by comparison of the - * return values using strict equality. - * - * @deprecated since Gutenberg 6.5.0. - * - * @example - * - * ``` - * const hasEditOccurred = ( - * getReferenceByDistinctEdits( beforeState ) !== - * getReferenceByDistinctEdits( afterState ) - * ); - * ``` - * - * @param {Object} state Editor state. - * - * @return {*} A value whose reference will change only when an edit occurs. - */ - -const getReferenceByDistinctEdits = Object(external_wp_data_["createRegistrySelector"])(select => () => -/* state */ -{ - external_wp_deprecated_default()("`wp.data.select( 'core/editor' ).getReferenceByDistinctEdits`", { - since: '5.4', - alternative: "`wp.data.select( 'core' ).getReferenceByDistinctEdits`" - }); - return select('core').getReferenceByDistinctEdits(); +const getPostEdits = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { + const postType = getCurrentPostType(state); + const postId = getCurrentPostId(state); + return select(external_wp_coreData_namespaceObject.store).getEntityRecordEdits('postType', postType, postId) || EMPTY_OBJECT; }); /** * Returns an attribute value of the saved post. @@ -2076,16 +2149,16 @@ * @return {*} Post attribute value. */ -function selectors_getCurrentPostAttribute(state, attributeName) { +function getCurrentPostAttribute(state, attributeName) { switch (attributeName) { case 'type': - return selectors_getCurrentPostType(state); + return getCurrentPostType(state); case 'id': - return selectors_getCurrentPostId(state); + return getCurrentPostId(state); default: - const post = selectors_getCurrentPost(state); + const post = getCurrentPost(state); if (!post.hasOwnProperty(attributeName)) { break; @@ -2106,13 +2179,13 @@ */ const getNestedEditedPostProperty = (state, attributeName) => { - const edits = selectors_getPostEdits(state); + const edits = getPostEdits(state); if (!edits.hasOwnProperty(attributeName)) { - return selectors_getCurrentPostAttribute(state, attributeName); - } - - return { ...selectors_getCurrentPostAttribute(state, attributeName), + return getCurrentPostAttribute(state, attributeName); + } + + return { ...getCurrentPostAttribute(state, attributeName), ...edits[attributeName] }; }; @@ -2128,18 +2201,18 @@ */ -function selectors_getEditedPostAttribute(state, attributeName) { - // Special cases +function getEditedPostAttribute(state, attributeName) { + // Special cases. switch (attributeName) { case 'content': return getEditedPostContent(state); } // Fall back to saved post value if not edited. - const edits = selectors_getPostEdits(state); + const edits = getPostEdits(state); if (!edits.hasOwnProperty(attributeName)) { - return selectors_getCurrentPostAttribute(state, attributeName); + return getCurrentPostAttribute(state, attributeName); } // Merge properties are objects which contain only the patch edit in state, // and thus must be merged with the current post attribute. @@ -2164,15 +2237,15 @@ * @return {*} Autosave attribute value. */ -const getAutosaveAttribute = Object(external_wp_data_["createRegistrySelector"])(select => (state, attributeName) => { - if (!Object(external_lodash_["includes"])(AUTOSAVE_PROPERTIES, attributeName) && attributeName !== 'preview_link') { +const getAutosaveAttribute = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, attributeName) => { + if (!(0,external_lodash_namespaceObject.includes)(AUTOSAVE_PROPERTIES, attributeName) && attributeName !== 'preview_link') { return; } - const postType = selectors_getCurrentPostType(state); - const postId = selectors_getCurrentPostId(state); - const currentUserId = Object(external_lodash_["get"])(select('core').getCurrentUser(), ['id']); - const autosave = select('core').getAutosave(postType, postId, currentUserId); + const postType = getCurrentPostType(state); + const postId = getCurrentPostId(state); + const currentUserId = (0,external_lodash_namespaceObject.get)(select(external_wp_coreData_namespaceObject.store).getCurrentUser(), ['id']); + const autosave = select(external_wp_coreData_namespaceObject.store).getAutosave(postType, postId, currentUserId); if (autosave) { return getPostRawValue(autosave[attributeName]); @@ -2188,14 +2261,14 @@ * @return {string} Post visibility. */ -function selectors_getEditedPostVisibility(state) { - const status = selectors_getEditedPostAttribute(state, 'status'); +function getEditedPostVisibility(state) { + const status = getEditedPostAttribute(state, 'status'); if (status === 'private') { return 'private'; } - const password = selectors_getEditedPostAttribute(state, 'password'); + const password = getEditedPostAttribute(state, 'password'); if (password) { return 'password'; @@ -2212,7 +2285,7 @@ */ function isCurrentPostPending(state) { - return selectors_getCurrentPost(state).status === 'pending'; + return getCurrentPost(state).status === 'pending'; } /** * Return true if the current post has already been published. @@ -2223,9 +2296,9 @@ * @return {boolean} Whether the post has been published. */ -function selectors_isCurrentPostPublished(state, currentPost) { - const post = currentPost || selectors_getCurrentPost(state); - return ['publish', 'private'].indexOf(post.status) !== -1 || post.status === 'future' && !Object(external_wp_date_["isInTheFuture"])(new Date(Number(Object(external_wp_date_["getDate"])(post.date)) - ONE_MINUTE_IN_MS)); +function isCurrentPostPublished(state, currentPost) { + const post = currentPost || getCurrentPost(state); + return ['publish', 'private'].indexOf(post.status) !== -1 || post.status === 'future' && !(0,external_wp_date_namespaceObject.isInTheFuture)(new Date(Number((0,external_wp_date_namespaceObject.getDate)(post.date)) - ONE_MINUTE_IN_MS)); } /** * Returns true if post is already scheduled. @@ -2235,8 +2308,8 @@ * @return {boolean} Whether current post is scheduled to be posted. */ -function selectors_isCurrentPostScheduled(state) { - return selectors_getCurrentPost(state).status === 'future' && !selectors_isCurrentPostPublished(state); +function isCurrentPostScheduled(state) { + return getCurrentPost(state).status === 'future' && !isCurrentPostPublished(state); } /** * Return true if the post being edited can be published. @@ -2246,13 +2319,13 @@ * @return {boolean} Whether the post can been published. */ -function selectors_isEditedPostPublishable(state) { - const post = selectors_getCurrentPost(state); // TODO: Post being publishable should be superset of condition of post +function isEditedPostPublishable(state) { + const post = getCurrentPost(state); // TODO: Post being publishable should be superset of condition of post // being saveable. Currently this restriction is imposed at UI. // - // See: (`isButtonEnabled` assigned by `isSaveable`) - - return selectors_isEditedPostDirty(state) || ['publish', 'private', 'future'].indexOf(post.status) === -1; + // See: (`isButtonEnabled` assigned by `isSaveable`). + + return isEditedPostDirty(state) || ['publish', 'private', 'future'].indexOf(post.status) === -1; } /** * Returns true if the post can be saved, or false otherwise. A post must @@ -2263,8 +2336,8 @@ * @return {boolean} Whether the post can be saved. */ -function selectors_isEditedPostSaveable(state) { - if (selectors_isSavingPost(state)) { +function isEditedPostSaveable(state) { + if (isSavingPost(state)) { return false; } // TODO: Post should not be saveable if not dirty. Cannot be added here at // this time since posts where meta boxes are present can be saved even if @@ -2274,10 +2347,10 @@ // See: `isEditedPostPublishable` (includes `isEditedPostDirty` condition) // See: (`forceIsDirty` prop) // See: (`forceIsDirty` prop) - // See: https://github.com/WordPress/gutenberg/pull/4184 - - - return !!selectors_getEditedPostAttribute(state, 'title') || !!selectors_getEditedPostAttribute(state, 'excerpt') || !isEditedPostEmpty(state) || external_wp_element_["Platform"].OS === 'native'; + // See: https://github.com/WordPress/gutenberg/pull/4184. + + + return !!getEditedPostAttribute(state, 'title') || !!getEditedPostAttribute(state, 'excerpt') || !isEditedPostEmpty(state) || external_wp_element_namespaceObject.Platform.OS === 'native'; } /** * Returns true if the edited post has content. A post has content if it has at @@ -2319,7 +2392,7 @@ const blockName = blocks[0].name; - if (blockName !== Object(external_wp_blocks_["getDefaultBlockName"])() && blockName !== Object(external_wp_blocks_["getFreeformContentHandlerName"])()) { + if (blockName !== (0,external_wp_blocks_namespaceObject.getDefaultBlockName)() && blockName !== (0,external_wp_blocks_namespaceObject.getFreeformContentHandlerName)()) { return false; } } @@ -2335,9 +2408,9 @@ * @return {boolean} Whether the post can be autosaved. */ -const selectors_isEditedPostAutosaveable = Object(external_wp_data_["createRegistrySelector"])(select => state => { +const isEditedPostAutosaveable = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { // A post must contain a title, an excerpt, or non-empty content to be valid for autosaving. - if (!selectors_isEditedPostSaveable(state)) { + if (!isEditedPostSaveable(state)) { return false; } // A post is not autosavable when there is a post autosave lock. @@ -2346,15 +2419,15 @@ return false; } - const postType = selectors_getCurrentPostType(state); - const postId = selectors_getCurrentPostId(state); - const hasFetchedAutosave = select('core').hasFetchedAutosaves(postType, postId); - const currentUserId = Object(external_lodash_["get"])(select('core').getCurrentUser(), ['id']); // Disable reason - this line causes the side-effect of fetching the autosave + const postType = getCurrentPostType(state); + const postId = getCurrentPostId(state); + const hasFetchedAutosave = select(external_wp_coreData_namespaceObject.store).hasFetchedAutosaves(postType, postId); + const currentUserId = (0,external_lodash_namespaceObject.get)(select(external_wp_coreData_namespaceObject.store).getCurrentUser(), ['id']); // Disable reason - this line causes the side-effect of fetching the autosave // via a resolver, moving below the return would result in the autosave never // being fetched. // eslint-disable-next-line @wordpress/no-unused-vars-before-return - const autosave = select('core').getAutosave(postType, postId, currentUserId); // If any existing autosaves have not yet been fetched, this function is + const autosave = select(external_wp_coreData_namespaceObject.store).getAutosave(postType, postId, currentUserId); // If any existing autosaves have not yet been fetched, this function is // unable to determine if the post is autosaveable, so return false. if (!hasFetchedAutosave) { @@ -2375,52 +2448,7 @@ } // If the title or excerpt has changed, the post is autosaveable. - return ['title', 'excerpt'].some(field => getPostRawValue(autosave[field]) !== selectors_getEditedPostAttribute(state, field)); -}); -/** - * Returns the current autosave, or null if one is not set (i.e. if the post - * has yet to be autosaved, or has been saved or published since the last - * autosave). - * - * @deprecated since 5.6. Callers should use the `getAutosave( postType, postId, userId )` - * selector from the '@wordpress/core-data' package. - * - * @param {Object} state Editor state. - * - * @return {?Object} Current autosave, if exists. - */ - -const getAutosave = Object(external_wp_data_["createRegistrySelector"])(select => state => { - external_wp_deprecated_default()("`wp.data.select( 'core/editor' ).getAutosave()`", { - since: '5.3', - alternative: "`wp.data.select( 'core' ).getAutosave( postType, postId, userId )`" - }); - const postType = selectors_getCurrentPostType(state); - const postId = selectors_getCurrentPostId(state); - const currentUserId = Object(external_lodash_["get"])(select('core').getCurrentUser(), ['id']); - const autosave = select('core').getAutosave(postType, postId, currentUserId); - return Object(external_lodash_["mapValues"])(Object(external_lodash_["pick"])(autosave, AUTOSAVE_PROPERTIES), getPostRawValue); -}); -/** - * Returns the true if there is an existing autosave, otherwise false. - * - * @deprecated since 5.6. Callers should use the `getAutosave( postType, postId, userId )` selector - * from the '@wordpress/core-data' package and check for a truthy value. - * - * @param {Object} state Global application state. - * - * @return {boolean} Whether there is an existing autosave. - */ - -const hasAutosave = Object(external_wp_data_["createRegistrySelector"])(select => state => { - external_wp_deprecated_default()("`wp.data.select( 'core/editor' ).hasAutosave()`", { - since: '5.3', - alternative: "`!! wp.data.select( 'core' ).getAutosave( postType, postId, userId )`" - }); - const postType = selectors_getCurrentPostType(state); - const postId = selectors_getCurrentPostId(state); - const currentUserId = Object(external_lodash_["get"])(select('core').getCurrentUser(), ['id']); - return !!select('core').getAutosave(postType, postId, currentUserId); + return ['title', 'excerpt'].some(field => getPostRawValue(autosave[field]) !== getEditedPostAttribute(state, field)); }); /** * Return true if the post being edited is being scheduled. Preferring the @@ -2431,11 +2459,11 @@ * @return {boolean} Whether the post has been published. */ -function selectors_isEditedPostBeingScheduled(state) { - const date = selectors_getEditedPostAttribute(state, 'date'); // Offset the date by one minute (network latency) - - const checkedDate = new Date(Number(Object(external_wp_date_["getDate"])(date)) - ONE_MINUTE_IN_MS); - return Object(external_wp_date_["isInTheFuture"])(checkedDate); +function isEditedPostBeingScheduled(state) { + const date = getEditedPostAttribute(state, 'date'); // Offset the date by one minute (network latency). + + const checkedDate = new Date(Number((0,external_wp_date_namespaceObject.getDate)(date)) - ONE_MINUTE_IN_MS); + return (0,external_wp_date_namespaceObject.isInTheFuture)(checkedDate); } /** * Returns whether the current post should be considered to have a "floating" @@ -2452,13 +2480,13 @@ */ function isEditedPostDateFloating(state) { - const date = selectors_getEditedPostAttribute(state, 'date'); - const modified = selectors_getEditedPostAttribute(state, 'modified'); // This should be the status of the persisted post + const date = getEditedPostAttribute(state, 'date'); + const modified = getEditedPostAttribute(state, 'modified'); // This should be the status of the persisted post // It shouldn't use the "edited" status otherwise it breaks the - // infered post data floating status - // See https://github.com/WordPress/gutenberg/issues/28083 - - const status = selectors_getCurrentPost(state).status; + // inferred post data floating status + // See https://github.com/WordPress/gutenberg/issues/28083. + + const status = getCurrentPost(state).status; if (status === 'draft' || status === 'auto-draft' || status === 'pending') { return date === modified || date === null; @@ -2474,10 +2502,27 @@ * @return {boolean} Whether post is being saved. */ -const selectors_isSavingPost = Object(external_wp_data_["createRegistrySelector"])(select => state => { - const postType = selectors_getCurrentPostType(state); - const postId = selectors_getCurrentPostId(state); - return select('core').isSavingEntityRecord('postType', postType, postId); +const isSavingPost = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { + const postType = getCurrentPostType(state); + const postId = getCurrentPostId(state); + return select(external_wp_coreData_namespaceObject.store).isSavingEntityRecord('postType', postType, postId); +}); +/** + * Returns true if non-post entities are currently being saved, or false otherwise. + * + * @param {Object} state Global application state. + * + * @return {boolean} Whether non-post entities are being saved. + */ + +const isSavingNonPostEntityChanges = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { + const entitiesBeingSaved = select(external_wp_coreData_namespaceObject.store).__experimentalGetEntitiesBeingSaved(); + + const { + type, + id + } = getCurrentPost(state); + return (0,external_lodash_namespaceObject.some)(entitiesBeingSaved, entityRecord => entityRecord.kind !== 'postType' || entityRecord.name !== type || entityRecord.key !== id); }); /** * Returns true if a previous post save was attempted successfully, or false @@ -2488,10 +2533,10 @@ * @return {boolean} Whether the post was saved successfully. */ -const didPostSaveRequestSucceed = Object(external_wp_data_["createRegistrySelector"])(select => state => { - const postType = selectors_getCurrentPostType(state); - const postId = selectors_getCurrentPostId(state); - return !select('core').getLastEntitySaveError('postType', postType, postId); +const didPostSaveRequestSucceed = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { + const postType = getCurrentPostType(state); + const postId = getCurrentPostId(state); + return !select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError('postType', postType, postId); }); /** * Returns true if a previous post save was attempted but failed, or false @@ -2502,10 +2547,10 @@ * @return {boolean} Whether the post save failed. */ -const didPostSaveRequestFail = Object(external_wp_data_["createRegistrySelector"])(select => state => { - const postType = selectors_getCurrentPostType(state); - const postId = selectors_getCurrentPostId(state); - return !!select('core').getLastEntitySaveError('postType', postType, postId); +const didPostSaveRequestFail = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { + const postType = getCurrentPostType(state); + const postId = getCurrentPostId(state); + return !!select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError('postType', postType, postId); }); /** * Returns true if the post is autosaving, or false otherwise. @@ -2515,12 +2560,12 @@ * @return {boolean} Whether the post is autosaving. */ -function selectors_isAutosavingPost(state) { - if (!selectors_isSavingPost(state)) { +function isAutosavingPost(state) { + if (!isSavingPost(state)) { return false; } - return !!Object(external_lodash_["get"])(state.saving, ['options', 'isAutosave']); + return !!(0,external_lodash_namespaceObject.get)(state.saving, ['options', 'isAutosave']); } /** * Returns true if the post is being previewed, or false otherwise. @@ -2531,11 +2576,11 @@ */ function isPreviewingPost(state) { - if (!selectors_isSavingPost(state)) { + if (!isSavingPost(state)) { return false; } - return !!state.saving.options.isPreview; + return !!(0,external_lodash_namespaceObject.get)(state.saving, ['options', 'isPreview']); } /** * Returns the post preview link @@ -2545,27 +2590,31 @@ * @return {string?} Preview Link. */ -function selectors_getEditedPostPreviewLink(state) { - if (state.saving.pending || selectors_isSavingPost(state)) { +function getEditedPostPreviewLink(state) { + if (state.saving.pending || isSavingPost(state)) { return; } - let previewLink = getAutosaveAttribute(state, 'preview_link'); - - if (!previewLink) { - previewLink = selectors_getEditedPostAttribute(state, 'link'); + let previewLink = getAutosaveAttribute(state, 'preview_link'); // Fix for issue: https://github.com/WordPress/gutenberg/issues/33616 + // If the post is draft, ignore the preview link from the autosave record, + // because the preview could be a stale autosave if the post was switched from + // published to draft. + // See: https://github.com/WordPress/gutenberg/pull/37952. + + if (!previewLink || 'draft' === getCurrentPost(state).status) { + previewLink = getEditedPostAttribute(state, 'link'); if (previewLink) { - previewLink = Object(external_wp_url_["addQueryArgs"])(previewLink, { + previewLink = (0,external_wp_url_namespaceObject.addQueryArgs)(previewLink, { preview: true }); } } - const featuredImageId = selectors_getEditedPostAttribute(state, 'featured_media'); + const featuredImageId = getEditedPostAttribute(state, 'featured_media'); if (previewLink && featuredImageId) { - return Object(external_wp_url_["addQueryArgs"])(previewLink, { + return (0,external_wp_url_namespaceObject.addQueryArgs)(previewLink, { _thumbnail_id: featuredImageId }); } @@ -2582,14 +2631,14 @@ * @return {?string} Suggested post format. */ -function selectors_getSuggestedPostFormat(state) { +function getSuggestedPostFormat(state) { const blocks = getEditorBlocks(state); if (blocks.length > 2) return null; let name; // If there is only one block in the content of the post grab its name // so we can derive a suitable post format from it. if (blocks.length === 1) { - name = blocks[0].name; // check for core/embed `video` and `audio` eligible suggestions + name = blocks[0].name; // Check for core/embed `video` and `audio` eligible suggestions. if (name === 'core/embed') { var _blocks$0$attributes; @@ -2633,38 +2682,6 @@ } } /** - * Returns a set of blocks which are to be used in consideration of the post's - * generated save content. - * - * @deprecated since Gutenberg 6.2.0. - * - * @param {Object} state Editor state. - * - * @return {WPBlock[]} Filtered set of blocks for save. - */ - -function getBlocksForSerialization(state) { - external_wp_deprecated_default()('`core/editor` getBlocksForSerialization selector', { - since: '5.3', - alternative: 'getEditorBlocks', - hint: 'Blocks serialization pre-processing occurs at save time' - }); - const blocks = state.editor.present.blocks.value; // WARNING: Any changes to the logic of this function should be verified - // against the implementation of isEditedPostEmpty, which bypasses this - // function for performance' sake, in an assumption of this current logic - // being irrelevant to the optimized condition of emptiness. - // A single unmodified default block is assumed to be equivalent to an - // empty post. - - const isSingleUnmodifiedDefaultBlock = blocks.length === 1 && Object(external_wp_blocks_["isUnmodifiedDefaultBlock"])(blocks[0]); - - if (isSingleUnmodifiedDefaultBlock) { - return []; - } - - return blocks; -} -/** * Returns the content of the post being edited. * * @param {Object} state Global application state. @@ -2672,16 +2689,16 @@ * @return {string} Post content. */ -const getEditedPostContent = Object(external_wp_data_["createRegistrySelector"])(select => state => { - const postId = selectors_getCurrentPostId(state); - const postType = selectors_getCurrentPostType(state); - const record = select('core').getEditedEntityRecord('postType', postType, postId); +const getEditedPostContent = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { + const postId = getCurrentPostId(state); + const postType = getCurrentPostType(state); + const record = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', postType, postId); if (record) { if (typeof record.content === 'function') { return record.content(record); } else if (record.blocks) { - return Object(external_wp_blocks_["__unstableSerializeAndClean"])(record.blocks); + return (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(record.blocks); } else if (record.content) { return record.content; } @@ -2697,8 +2714,8 @@ * @return {boolean} Whether post is being published. */ -function selectors_isPublishingPost(state) { - return selectors_isSavingPost(state) && !selectors_isCurrentPostPublished(state) && selectors_getEditedPostAttribute(state, 'status') === 'publish'; +function isPublishingPost(state) { + return isSavingPost(state) && !isCurrentPostPublished(state) && getEditedPostAttribute(state, 'status') === 'publish'; } /** * Returns whether the permalink is editable or not. @@ -2709,7 +2726,7 @@ */ function isPermalinkEditable(state) { - const permalinkTemplate = selectors_getEditedPostAttribute(state, 'permalink_template'); + const permalinkTemplate = getEditedPostAttribute(state, 'permalink_template'); return PERMALINK_POSTNAME_REGEX.test(permalinkTemplate); } /** @@ -2750,7 +2767,7 @@ */ function getEditedPostSlug(state) { - return selectors_getEditedPostAttribute(state, 'slug') || cleanForSlug(selectors_getEditedPostAttribute(state, 'title')) || selectors_getCurrentPostId(state); + return getEditedPostAttribute(state, 'slug') || (0,external_wp_url_namespaceObject.cleanForSlug)(getEditedPostAttribute(state, 'title')) || getCurrentPostId(state); } /** * Returns the permalink for a post, split into it's three parts: the prefix, @@ -2763,13 +2780,13 @@ */ function getPermalinkParts(state) { - const permalinkTemplate = selectors_getEditedPostAttribute(state, 'permalink_template'); + const permalinkTemplate = getEditedPostAttribute(state, 'permalink_template'); if (!permalinkTemplate) { return null; } - const postName = selectors_getEditedPostAttribute(state, 'slug') || selectors_getEditedPostAttribute(state, 'generated_slug'); + const postName = getEditedPostAttribute(state, 'slug') || getEditedPostAttribute(state, 'generated_slug'); const [prefix, suffix] = permalinkTemplate.split(PERMALINK_POSTNAME_REGEX); return { prefix, @@ -2785,7 +2802,7 @@ * @return {boolean} Is locked. */ -function selectors_isPostLocked(state) { +function isPostLocked(state) { return state.postLock.isLocked; } /** @@ -2796,7 +2813,7 @@ * @return {boolean} Is locked. */ -function selectors_isPostSavingLocked(state) { +function isPostSavingLocked(state) { return Object.keys(state.postSavingLock).length > 0; } /** @@ -2851,25 +2868,17 @@ * @return {boolean} Whether the user can or can't post unfiltered HTML. */ -function selectors_canUserUseUnfilteredHTML(state) { - return Object(external_lodash_["has"])(selectors_getCurrentPost(state), ['_links', 'wp:action-unfiltered-html']); +function canUserUseUnfilteredHTML(state) { + return (0,external_lodash_namespaceObject.has)(getCurrentPost(state), ['_links', 'wp:action-unfiltered-html']); } /** * Returns whether the pre-publish panel should be shown * or skipped when the user clicks the "publish" button. * - * @param {Object} state Global application state. - * * @return {boolean} Whether the pre-publish panel should be shown or not. */ -function selectors_isPublishSidebarEnabled(state) { - if (state.preferences.hasOwnProperty('isPublishSidebarEnabled')) { - return state.preferences.isPublishSidebarEnabled; - } - - return PREFERENCES_DEFAULTS.isPublishSidebarEnabled; -} +const isPublishSidebarEnabled = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => !!select(external_wp_preferences_namespaceObject.store).get('core/edit-post', 'isPublishSidebarEnabled')); /** * Return the current block list. * @@ -2878,7 +2887,7 @@ */ function getEditorBlocks(state) { - return selectors_getEditedPostAttribute(state, 'blocks') || EMPTY_ARRAY; + return getEditedPostAttribute(state, 'blocks') || EMPTY_ARRAY; } /** * A block selection object. @@ -2904,11 +2913,10 @@ var _getEditedPostAttribu; external_wp_deprecated_default()("select('core/editor').getEditorSelectionStart", { - since: '10.0', - plugin: 'Gutenberg', + since: '5.8', alternative: "select('core/editor').getEditorSelection" }); - return (_getEditedPostAttribu = selectors_getEditedPostAttribute(state, 'selection')) === null || _getEditedPostAttribu === void 0 ? void 0 : _getEditedPostAttribu.selectionStart; + return (_getEditedPostAttribu = getEditedPostAttribute(state, 'selection')) === null || _getEditedPostAttribu === void 0 ? void 0 : _getEditedPostAttribu.selectionStart; } /** * Returns the current selection end. @@ -2923,11 +2931,10 @@ var _getEditedPostAttribu2; external_wp_deprecated_default()("select('core/editor').getEditorSelectionStart", { - since: '10.0', - plugin: 'Gutenberg', + since: '5.8', alternative: "select('core/editor').getEditorSelection" }); - return (_getEditedPostAttribu2 = selectors_getEditedPostAttribute(state, 'selection')) === null || _getEditedPostAttribu2 === void 0 ? void 0 : _getEditedPostAttribu2.selectionEnd; + return (_getEditedPostAttribu2 = getEditedPostAttribute(state, 'selection')) === null || _getEditedPostAttribu2 === void 0 ? void 0 : _getEditedPostAttribu2.selectionEnd; } /** * Returns the current selection. @@ -2936,8 +2943,8 @@ * @return {WPBlockSelection} The selection end. */ -function selectors_getEditorSelection(state) { - return selectors_getEditedPostAttribute(state, 'selection'); +function getEditorSelection(state) { + return getEditedPostAttribute(state, 'selection'); } /** * Is the editor ready @@ -2946,7 +2953,7 @@ * @return {boolean} is Ready. */ -function selectors_unstableIsEditorReady(state) { +function __unstableIsEditorReady(state) { return state.isReady; } /** @@ -2957,7 +2964,7 @@ * @return {Object} The editor settings object. */ -function selectors_getEditorSettings(state) { +function getEditorSettings(state) { return state.editorSettings; } /* @@ -2994,12 +3001,18 @@ } function getBlockEditorSelector(name) { - return Object(external_wp_data_["createRegistrySelector"])(select => (state, ...args) => { + return (0,external_wp_data_namespaceObject.createRegistrySelector)(select => function (state) { external_wp_deprecated_default()("`wp.data.select( 'core/editor' )." + name + '`', { since: '5.3', - alternative: "`wp.data.select( 'core/block-editor' )." + name + '`' + alternative: "`wp.data.select( 'core/block-editor' )." + name + '`', + version: '6.2' }); - return select('core/block-editor')[name](...args); + + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + return select(external_wp_blockEditor_namespaceObject.store)[name](...args); }); } /** @@ -3027,12 +3040,7 @@ * @see getBlocks in core/block-editor store. */ -const selectors_getBlocks = getBlockEditorSelector('getBlocks'); -/** - * @see __unstableGetBlockWithoutInnerBlocks in core/block-editor store. - */ - -const __unstableGetBlockWithoutInnerBlocks = getBlockEditorSelector('__unstableGetBlockWithoutInnerBlocks'); +const getBlocks = getBlockEditorSelector('getBlocks'); /** * @see getClientIdsOfDescendants in core/block-editor store. */ @@ -3047,7 +3055,7 @@ * @see getGlobalBlockCount in core/block-editor store. */ -const selectors_getGlobalBlockCount = getBlockEditorSelector('getGlobalBlockCount'); +const getGlobalBlockCount = getBlockEditorSelector('getGlobalBlockCount'); /** * @see getBlocksByClientId in core/block-editor store. */ @@ -3274,7 +3282,7 @@ function __experimentalGetDefaultTemplateTypes(state) { var _getEditorSettings; - return (_getEditorSettings = selectors_getEditorSettings(state)) === null || _getEditorSettings === void 0 ? void 0 : _getEditorSettings.defaultTemplateTypes; + return (_getEditorSettings = getEditorSettings(state)) === null || _getEditorSettings === void 0 ? void 0 : _getEditorSettings.defaultTemplateTypes; } /** * Returns the default template part areas. @@ -3284,10 +3292,10 @@ * @return {Array} The template part areas. */ -const __experimentalGetDefaultTemplatePartAreas = Object(rememo["a" /* default */])(state => { +const __experimentalGetDefaultTemplatePartAreas = rememo(state => { var _getEditorSettings2; - const areas = ((_getEditorSettings2 = selectors_getEditorSettings(state)) === null || _getEditorSettings2 === void 0 ? void 0 : _getEditorSettings2.defaultTemplatePartAreas) || []; + const areas = ((_getEditorSettings2 = getEditorSettings(state)) === null || _getEditorSettings2 === void 0 ? void 0 : _getEditorSettings2.defaultTemplatePartAreas) || []; return areas === null || areas === void 0 ? void 0 : areas.map(item => { return { ...item, icon: getTemplatePartIcon(item.icon) @@ -3296,25 +3304,25 @@ }, state => { var _getEditorSettings3; - return [(_getEditorSettings3 = selectors_getEditorSettings(state)) === null || _getEditorSettings3 === void 0 ? void 0 : _getEditorSettings3.defaultTemplatePartAreas]; + return [(_getEditorSettings3 = getEditorSettings(state)) === null || _getEditorSettings3 === void 0 ? void 0 : _getEditorSettings3.defaultTemplatePartAreas]; }); /** * Returns a default template type searched by slug. * * @param {Object} state Global application state. - * @param {string} slug The template type slug. + * @param {string} slug The template type slug. * * @return {Object} The template type. */ -const __experimentalGetDefaultTemplateType = Object(rememo["a" /* default */])((state, slug) => Object(external_lodash_["find"])(__experimentalGetDefaultTemplateTypes(state), { +const __experimentalGetDefaultTemplateType = rememo((state, slug) => (0,external_lodash_namespaceObject.find)(__experimentalGetDefaultTemplateTypes(state), { slug }) || {}, (state, slug) => [__experimentalGetDefaultTemplateTypes(state), slug]); /** * Given a template entity, return information about it which is ready to be * rendered, such as the title, description, and icon. * - * @param {Object} state Global application state. + * @param {Object} state Global application state. * @param {Object} template The template for which we need information. * @return {Object} Information about the template, including title, description, and icon. */ @@ -3338,23 +3346,74 @@ description: defaultDescription } = __experimentalGetDefaultTemplateType(state, slug); - const templateTitle = Object(external_lodash_["isString"])(title) ? title : title === null || title === void 0 ? void 0 : title.rendered; - const templateDescription = Object(external_lodash_["isString"])(excerpt) ? excerpt : excerpt === null || excerpt === void 0 ? void 0 : excerpt.raw; - const templateIcon = ((_experimentalGetDefa = __experimentalGetDefaultTemplatePartAreas(state).find(item => area === item.area)) === null || _experimentalGetDefa === void 0 ? void 0 : _experimentalGetDefa.icon) || layout["a" /* default */]; + const templateTitle = (0,external_lodash_namespaceObject.isString)(title) ? title : title === null || title === void 0 ? void 0 : title.rendered; + const templateDescription = (0,external_lodash_namespaceObject.isString)(excerpt) ? excerpt : excerpt === null || excerpt === void 0 ? void 0 : excerpt.raw; + const templateIcon = ((_experimentalGetDefa = __experimentalGetDefaultTemplatePartAreas(state).find(item => area === item.area)) === null || _experimentalGetDefa === void 0 ? void 0 : _experimentalGetDefa.icon) || library_layout; return { title: templateTitle && templateTitle !== slug ? templateTitle : defaultTitle || slug, description: templateDescription || defaultDescription, icon: templateIcon }; } - -// EXTERNAL MODULE: external ["wp","notices"] -var external_wp_notices_ = __webpack_require__("onLe"); - -// EXTERNAL MODULE: external ["wp","i18n"] -var external_wp_i18n_ = __webpack_require__("l3Sj"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/utils/notice-builder.js +/** + * Returns a post type label depending on the current post. + * + * @param {Object} state Global application state. + * + * @return {string|undefined} The post type label if available, otherwise undefined. + */ + +const getPostTypeLabel = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { + var _postType$labels; + + const currentPostType = getCurrentPostType(state); + const postType = select(external_wp_coreData_namespaceObject.store).getPostType(currentPostType); // Disable reason: Post type labels object is shaped like this. + // eslint-disable-next-line camelcase + + return postType === null || postType === void 0 ? void 0 : (_postType$labels = postType.labels) === null || _postType$labels === void 0 ? void 0 : _postType$labels.singular_name; +}); + +;// CONCATENATED MODULE: external ["wp","apiFetch"] +var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; +var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); +;// CONCATENATED MODULE: external ["wp","notices"] +var external_wp_notices_namespaceObject = window["wp"]["notices"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/local-autosave.js +/** + * Function returning a sessionStorage key to set or retrieve a given post's + * automatic session backup. + * + * Keys are crucially prefixed with 'wp-autosave-' so that wp-login.php's + * `loggedout` handler can clear sessionStorage of any user-private content. + * + * @see https://github.com/WordPress/wordpress-develop/blob/6dad32d2aed47e6c0cf2aee8410645f6d7aba6bd/src/wp-login.php#L103 + * + * @param {string} postId Post ID. + * @param {boolean} isPostNew Whether post new. + * + * @return {string} sessionStorage key + */ +function postKey(postId, isPostNew) { + return `wp-autosave-block-editor-post-${isPostNew ? 'auto-draft' : postId}`; +} + +function localAutosaveGet(postId, isPostNew) { + return window.sessionStorage.getItem(postKey(postId, isPostNew)); +} +function localAutosaveSet(postId, isPostNew, title, content, excerpt) { + window.sessionStorage.setItem(postKey(postId, isPostNew), JSON.stringify({ + post_title: title, + content, + excerpt + })); +} +function localAutosaveClear(postId, isPostNew) { + window.sessionStorage.removeItem(postKey(postId, isPostNew)); +} + +;// CONCATENATED MODULE: external ["wp","i18n"] +var external_wp_i18n_namespaceObject = window["wp"]["i18n"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/utils/notice-builder.js /** * WordPress dependencies */ @@ -3385,54 +3444,57 @@ postType } = data; // Autosaves are neither shown a notice nor redirected. - if (Object(external_lodash_["get"])(data.options, ['isAutosave'])) { + if ((0,external_lodash_namespaceObject.get)(data.options, ['isAutosave'])) { + return []; + } // No notice is shown after trashing a post + + + if (post.status === 'trash' && previousPost.status !== 'trash') { return []; } const publishStatus = ['publish', 'private', 'future']; - const isPublished = Object(external_lodash_["includes"])(publishStatus, previousPost.status); - const willPublish = Object(external_lodash_["includes"])(publishStatus, post.status); + const isPublished = (0,external_lodash_namespaceObject.includes)(publishStatus, previousPost.status); + const willPublish = (0,external_lodash_namespaceObject.includes)(publishStatus, post.status); let noticeMessage; - let shouldShowLink = Object(external_lodash_["get"])(postType, ['viewable'], false); + let shouldShowLink = (0,external_lodash_namespaceObject.get)(postType, ['viewable'], false); + let isDraft; // Always should a notice, which will be spoken for accessibility. if (!isPublished && !willPublish) { // If saving a non-published post, don't show notice. - noticeMessage = null; + noticeMessage = (0,external_wp_i18n_namespaceObject.__)('Draft saved.'); + isDraft = true; } else if (isPublished && !willPublish) { - // If undoing publish status, show specific notice + // If undoing publish status, show specific notice. noticeMessage = postType.labels.item_reverted_to_draft; shouldShowLink = false; } else if (!isPublished && willPublish) { // If publishing or scheduling a post, show the corresponding - // publish message + // publish message. noticeMessage = { publish: postType.labels.item_published, private: postType.labels.item_published_privately, future: postType.labels.item_scheduled }[post.status]; } else { - // Generic fallback notice + // Generic fallback notice. noticeMessage = postType.labels.item_updated; } - if (noticeMessage) { - const actions = []; - - if (shouldShowLink) { - actions.push({ - label: postType.labels.view_item, - url: post.link - }); - } - - return [noticeMessage, { - id: SAVE_POST_NOTICE_ID, - type: 'snackbar', - actions - }]; - } - - return []; + const actions = []; + + if (shouldShowLink) { + actions.push({ + label: isDraft ? (0,external_wp_i18n_namespaceObject.__)('View Preview') : postType.labels.view_item, + url: post.link + }); + } + + return [noticeMessage, { + id: SAVE_POST_NOTICE_ID, + type: 'snackbar', + actions + }]; } /** * Builds the fail notification arguments for dispatch. @@ -3458,14 +3520,14 @@ const publishStatus = ['publish', 'private', 'future']; const isPublished = publishStatus.indexOf(post.status) !== -1; // If the post was being published, we show the corresponding publish error message - // Unless we publish an "updating failed" message + // Unless we publish an "updating failed" message. const messages = { - publish: Object(external_wp_i18n_["__"])('Publishing failed.'), - private: Object(external_wp_i18n_["__"])('Publishing failed.'), - future: Object(external_wp_i18n_["__"])('Scheduling failed.') - }; - let noticeMessage = !isPublished && publishStatus.indexOf(edits.status) !== -1 ? messages[edits.status] : Object(external_wp_i18n_["__"])('Updating failed.'); // Check if message string contains HTML. Notice text is currently only + publish: (0,external_wp_i18n_namespaceObject.__)('Publishing failed.'), + private: (0,external_wp_i18n_namespaceObject.__)('Publishing failed.'), + future: (0,external_wp_i18n_namespaceObject.__)('Scheduling failed.') + }; + let noticeMessage = !isPublished && publishStatus.indexOf(edits.status) !== -1 ? messages[edits.status] : (0,external_wp_i18n_namespaceObject.__)('Updating failed.'); // Check if message string contains HTML. Notice text is currently only // supported as plaintext, and stripping the tags may muddle the meaning. if (error.message && !/<\/?[^>]*>/.test(error.message)) { @@ -3485,12 +3547,12 @@ */ function getNotificationArgumentsForTrashFail(data) { - return [data.error.message && data.error.code !== 'unknown_error' ? data.error.message : Object(external_wp_i18n_["__"])('Trashing failed'), { + return [data.error.message && data.error.code !== 'unknown_error' ? data.error.message : (0,external_wp_i18n_namespaceObject.__)('Trashing failed'), { id: TRASH_POST_NOTICE_ID }]; } -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/actions.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/actions.js /** * External dependencies */ @@ -3504,57 +3566,60 @@ + + /** * Internal dependencies */ + /** * Returns an action generator used in signalling that editor has initialized with * the specified post object and editor settings. * - * @param {Object} post Post object. - * @param {Object} edits Initial edited attributes object. - * @param {Array?} template Block Template. - */ - -function* actions_setupEditor(post, edits, template) { - // In order to ensure maximum of a single parse during setup, edits are - // included as part of editor setup action. Assume edited content as - // canonical if provided, falling back to post. - let content; - - if (Object(external_lodash_["has"])(edits, ['content'])) { - content = edits.content; - } else { - content = post.content.raw; - } - - let blocks = Object(external_wp_blocks_["parse"])(content); // Apply a template for new posts only, if exists. + * @param {Object} post Post object. + * @param {Object} edits Initial edited attributes object. + * @param {Array?} template Block Template. + */ + +const setupEditor = (post, edits, template) => _ref => { + let { + dispatch + } = _ref; + dispatch.setupEditorState(post); // Apply a template for new posts only, if exists. const isNewPost = post.status === 'auto-draft'; if (isNewPost && template) { - blocks = Object(external_wp_blocks_["synchronizeBlocksWithTemplate"])(blocks, template); - } - - yield resetPost(post); - yield { - type: 'SETUP_EDITOR', - post, - edits, - template - }; - yield actions_resetEditorBlocks(blocks, { - __unstableShouldCreateUndoLevel: false - }); - yield setupEditorState(post); - - if (edits && Object.keys(edits).some(key => edits[key] !== (Object(external_lodash_["has"])(post, [key, 'raw']) ? post[key].raw : post[key]))) { - yield actions_editPost(edits); - } -} + // In order to ensure maximum of a single parse during setup, edits are + // included as part of editor setup action. Assume edited content as + // canonical if provided, falling back to post. + let content; + + if ((0,external_lodash_namespaceObject.has)(edits, ['content'])) { + content = edits.content; + } else { + content = post.content.raw; + } + + let blocks = (0,external_wp_blocks_namespaceObject.parse)(content); + blocks = (0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(blocks, template); + dispatch.resetEditorBlocks(blocks, { + __unstableShouldCreateUndoLevel: false + }); + } + + if (edits && Object.values(edits).some(_ref2 => { + var _post$key$raw, _post$key; + + let [key, edit] = _ref2; + return edit !== ((_post$key$raw = (_post$key = post[key]) === null || _post$key === void 0 ? void 0 : _post$key.raw) !== null && _post$key$raw !== void 0 ? _post$key$raw : post[key]); + })) { + dispatch.editPost(edits); + } +}; /** * Returns an action object signalling that the editor is being destroyed and * that any necessary state or side-effect cleanup should occur. @@ -3562,7 +3627,7 @@ * @return {Object} Action object. */ -function actions_experimentalTearDownEditor() { +function __experimentalTearDownEditor() { return { type: 'TEAR_DOWN_EDITOR' }; @@ -3571,66 +3636,17 @@ * Returns an action object used in signalling that the latest version of the * post has been received, either by initialization or save. * - * @param {Object} post Post object. - * - * @return {Object} Action object. - */ - -function resetPost(post) { - return { - type: 'RESET_POST', - post - }; -} -/** - * Returns an action object used in signalling that the latest autosave of the - * post has been received, by initialization or autosave. - * - * @deprecated since 5.6. Callers should use the `receiveAutosaves( postId, autosave )` - * selector from the '@wordpress/core-data' package. - * - * @param {Object} newAutosave Autosave post object. - * - * @return {Object} Action object. - */ - -function* resetAutosave(newAutosave) { - external_wp_deprecated_default()('resetAutosave action (`core/editor` store)', { - since: '5.3', - alternative: 'receiveAutosaves action (`core` store)' + * @deprecated Since WordPress 6.0. + */ + +function resetPost() { + external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).resetPost", { + since: '6.0', + version: '6.3', + alternative: 'Initialize the editor with the setupEditorState action' }); - const postId = yield external_wp_data_["controls"].select(STORE_NAME, 'getCurrentPostId'); - yield external_wp_data_["controls"].dispatch('core', 'receiveAutosaves', postId, newAutosave); return { - type: '__INERT__' - }; -} -/** - * Action for dispatching that a post update request has started. - * - * @param {Object} options - * - * @return {Object} An action object - */ - -function __experimentalRequestPostUpdateStart(options = {}) { - return { - type: 'REQUEST_POST_UPDATE_START', - options - }; -} -/** - * Action for dispatching that a post update request has finished. - * - * @param {Object} options - * - * @return {Object} An action object - */ - -function __experimentalRequestPostUpdateFinish(options = {}) { - return { - type: 'REQUEST_POST_UPDATE_FINISH', - options + type: 'DO_NOTHING' }; } /** @@ -3644,7 +3660,7 @@ function updatePost() { external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).updatePost", { since: '5.7', - alternative: 'User the core entitires store instead' + alternative: 'Use the core entities store instead' }); return { type: 'DO_NOTHING' @@ -3654,7 +3670,7 @@ * Returns an action object used to setup the editor state when first opening * an editor. * - * @param {Object} post Post object. + * @param {Object} post Post object. * * @return {Object} Action object. */ @@ -3671,118 +3687,141 @@ * * @param {Object} edits Post attributes to edit. * @param {Object} options Options for the edit. - * - * @yield {Object} Action object or control. - */ - -function* actions_editPost(edits, options) { + */ + +const editPost = (edits, options) => _ref3 => { + let { + select, + registry + } = _ref3; const { id, type - } = yield external_wp_data_["controls"].select(STORE_NAME, 'getCurrentPost'); - yield external_wp_data_["controls"].dispatch('core', 'editEntityRecord', 'postType', type, id, edits, options); -} -/** - * Action generator for saving the current post in the editor. + } = select.getCurrentPost(); + registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', type, id, edits, options); +}; +/** + * Action for saving the current post in the editor. * * @param {Object} options */ -function* actions_savePost(options = {}) { - if (!(yield external_wp_data_["controls"].select(STORE_NAME, 'isEditedPostSaveable'))) { - return; - } - - let edits = { - content: yield external_wp_data_["controls"].select(STORE_NAME, 'getEditedPostContent') - }; - - if (!options.isAutosave) { - yield external_wp_data_["controls"].dispatch(STORE_NAME, 'editPost', edits, { - undoIgnore: true +const savePost = function () { + let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return async _ref4 => { + let { + select, + dispatch, + registry + } = _ref4; + + if (!select.isEditedPostSaveable()) { + return; + } + + const content = select.getEditedPostContent(); + + if (!options.isAutosave) { + dispatch.editPost({ + content + }, { + undoIgnore: true + }); + } + + const previousRecord = select.getCurrentPost(); + const edits = { + id: previousRecord.id, + ...registry.select(external_wp_coreData_namespaceObject.store).getEntityRecordNonTransientEdits('postType', previousRecord.type, previousRecord.id), + content + }; + dispatch({ + type: 'REQUEST_POST_UPDATE_START', + options }); - } - - yield __experimentalRequestPostUpdateStart(options); - const previousRecord = yield external_wp_data_["controls"].select(STORE_NAME, 'getCurrentPost'); - edits = { - id: previousRecord.id, - ...(yield external_wp_data_["controls"].select('core', 'getEntityRecordNonTransientEdits', 'postType', previousRecord.type, previousRecord.id)), - ...edits - }; - yield external_wp_data_["controls"].dispatch('core', 'saveEntityRecord', 'postType', previousRecord.type, edits, options); - yield __experimentalRequestPostUpdateFinish(options); - const error = yield external_wp_data_["controls"].select('core', 'getLastEntitySaveError', 'postType', previousRecord.type, previousRecord.id); - - if (error) { - const args = getNotificationArgumentsForSaveFail({ - post: previousRecord, - edits, - error - }); - - if (args.length) { - yield external_wp_data_["controls"].dispatch(external_wp_notices_["store"], 'createErrorNotice', ...args); - } - } else { - const updatedRecord = yield external_wp_data_["controls"].select(STORE_NAME, 'getCurrentPost'); - const args = getNotificationArgumentsForSaveSuccess({ - previousPost: previousRecord, - post: updatedRecord, - postType: yield external_wp_data_["controls"].resolveSelect('core', 'getPostType', updatedRecord.type), + await registry.dispatch(external_wp_coreData_namespaceObject.store).saveEntityRecord('postType', previousRecord.type, edits, options); + dispatch({ + type: 'REQUEST_POST_UPDATE_FINISH', options }); - - if (args.length) { - yield external_wp_data_["controls"].dispatch(external_wp_notices_["store"], 'createSuccessNotice', ...args); - } // Make sure that any edits after saving create an undo level and are - // considered for change detection. - - - if (!options.isAutosave) { - yield external_wp_data_["controls"].dispatch('core/block-editor', '__unstableMarkLastChangeAsPersistent'); - } - } -} -/** - * Action generator for handling refreshing the current post. - */ - -function* refreshPost() { - const post = yield external_wp_data_["controls"].select(STORE_NAME, 'getCurrentPost'); - const postTypeSlug = yield external_wp_data_["controls"].select(STORE_NAME, 'getCurrentPostType'); - const postType = yield external_wp_data_["controls"].resolveSelect('core', 'getPostType', postTypeSlug); - const newPost = yield Object(external_wp_dataControls_["apiFetch"])({ - // Timestamp arg allows caller to bypass browser caching, which is - // expected for this specific function. - path: `/wp/v2/${postType.rest_base}/${post.id}` + `?context=edit&_timestamp=${Date.now()}` + const error = registry.select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError('postType', previousRecord.type, previousRecord.id); + + if (error) { + const args = getNotificationArgumentsForSaveFail({ + post: previousRecord, + edits, + error + }); + + if (args.length) { + registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(...args); + } + } else { + const updatedRecord = select.getCurrentPost(); + const args = getNotificationArgumentsForSaveSuccess({ + previousPost: previousRecord, + post: updatedRecord, + postType: await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getPostType(updatedRecord.type), + options + }); + + if (args.length) { + registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice(...args); + } // Make sure that any edits after saving create an undo level and are + // considered for change detection. + + + if (!options.isAutosave) { + registry.dispatch(external_wp_blockEditor_namespaceObject.store).__unstableMarkLastChangeAsPersistent(); + } + } + }; +}; +/** + * Action for refreshing the current post. + * + * @deprecated Since WordPress 6.0. + */ + +function refreshPost() { + external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).refreshPost", { + since: '6.0', + version: '6.3', + alternative: 'Use the core entities store instead' }); - yield external_wp_data_["controls"].dispatch(STORE_NAME, 'resetPost', newPost); -} -/** - * Action generator for trashing the current post in the editor. - */ - -function* trashPost() { - const postTypeSlug = yield external_wp_data_["controls"].select(STORE_NAME, 'getCurrentPostType'); - const postType = yield external_wp_data_["controls"].resolveSelect('core', 'getPostType', postTypeSlug); - yield external_wp_data_["controls"].dispatch(external_wp_notices_["store"], 'removeNotice', TRASH_POST_NOTICE_ID); + return { + type: 'DO_NOTHING' + }; +} +/** + * Action for trashing the current post in the editor. + */ + +const trashPost = () => async _ref5 => { + let { + select, + dispatch, + registry + } = _ref5; + const postTypeSlug = select.getCurrentPostType(); + const postType = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug); + registry.dispatch(external_wp_notices_namespaceObject.store).removeNotice(TRASH_POST_NOTICE_ID); try { - const post = yield external_wp_data_["controls"].select(STORE_NAME, 'getCurrentPost'); - yield Object(external_wp_dataControls_["apiFetch"])({ + const post = select.getCurrentPost(); + await external_wp_apiFetch_default()({ path: `/wp/v2/${postType.rest_base}/${post.id}`, method: 'DELETE' }); - yield external_wp_data_["controls"].dispatch(STORE_NAME, 'savePost'); + await dispatch.savePost(); } catch (error) { - yield external_wp_data_["controls"].dispatch(external_wp_notices_["store"], 'createErrorNotice', ...getNotificationArgumentsForTrashFail({ + registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(...getNotificationArgumentsForTrashFail({ error })); } -} -/** - * Action generator used in signalling that the post should autosave. This +}; +/** + * Action that autosaves the current post. This * includes server-side autosaving (default) and client-side (a.k.a. local) * autosaving (e.g. on the Web, the post might be committed to Session * Storage). @@ -3790,104 +3829,105 @@ * @param {Object?} options Extra flags to identify the autosave. */ -function* actions_autosave({ - local = false, - ...options -} = {}) { - if (local) { - const post = yield external_wp_data_["controls"].select(STORE_NAME, 'getCurrentPost'); - const isPostNew = yield external_wp_data_["controls"].select(STORE_NAME, 'isEditedPostNew'); - const title = yield external_wp_data_["controls"].select(STORE_NAME, 'getEditedPostAttribute', 'title'); - const content = yield external_wp_data_["controls"].select(STORE_NAME, 'getEditedPostAttribute', 'content'); - const excerpt = yield external_wp_data_["controls"].select(STORE_NAME, 'getEditedPostAttribute', 'excerpt'); - yield { - type: 'LOCAL_AUTOSAVE_SET', - postId: post.id, - isPostNew, - title, - content, - excerpt - }; - } else { - yield external_wp_data_["controls"].dispatch(STORE_NAME, 'savePost', { - isAutosave: true, - ...options - }); - } -} -/** - * Returns an action object used in signalling that undo history should - * restore last popped state. - * - * @yield {Object} Action object. - */ - -function* actions_redo() { - yield external_wp_data_["controls"].dispatch('core', 'redo'); -} -/** - * Returns an action object used in signalling that undo history should pop. - * - * @yield {Object} Action object. - */ - -function* actions_undo() { - yield external_wp_data_["controls"].dispatch('core', 'undo'); -} -/** - * Returns an action object used in signalling that undo history record should - * be created. - * - * @return {Object} Action object. +const autosave = function () { + let { + local = false, + ...options + } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return async _ref6 => { + let { + select, + dispatch + } = _ref6; + + if (local) { + const post = select.getCurrentPost(); + const isPostNew = select.isEditedPostNew(); + const title = select.getEditedPostAttribute('title'); + const content = select.getEditedPostAttribute('content'); + const excerpt = select.getEditedPostAttribute('excerpt'); + localAutosaveSet(post.id, isPostNew, title, content, excerpt); + } else { + await dispatch.savePost({ + isAutosave: true, + ...options + }); + } + }; +}; +/** + * Action that restores last popped state in undo history. + */ + +const redo = () => _ref7 => { + let { + registry + } = _ref7; + registry.dispatch(external_wp_coreData_namespaceObject.store).redo(); +}; +/** + * Action that pops a record from undo history and undoes the edit. + */ + +const undo = () => _ref8 => { + let { + registry + } = _ref8; + registry.dispatch(external_wp_coreData_namespaceObject.store).undo(); +}; +/** + * Action that creates an undo history record. + * + * @deprecated Since WordPress 6.0 */ function createUndoLevel() { + external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).createUndoLevel", { + since: '6.0', + version: '6.3', + alternative: 'Use the core entities store instead' + }); return { - type: 'CREATE_UNDO_LEVEL' - }; -} -/** - * Returns an action object used to lock the editor. - * - * @param {Object} lock Details about the post lock status, user, and nonce. - * + type: 'DO_NOTHING' + }; +} +/** + * Action that locks the editor. + * + * @param {Object} lock Details about the post lock status, user, and nonce. * @return {Object} Action object. */ -function actions_updatePostLock(lock) { +function updatePostLock(lock) { return { type: 'UPDATE_POST_LOCK', lock }; } /** - * Returns an action object used in signalling that the user has enabled the - * publish sidebar. - * - * @return {Object} Action object - */ - -function enablePublishSidebar() { - return { - type: 'ENABLE_PUBLISH_SIDEBAR' - }; -} -/** - * Returns an action object used in signalling that the user has disabled the - * publish sidebar. - * - * @return {Object} Action object - */ - -function disablePublishSidebar() { - return { - type: 'DISABLE_PUBLISH_SIDEBAR' - }; -} -/** - * Returns an action object used to signal that post saving is locked. - * - * @param {string} lockName The lock name. + * Enable the publish sidebar. + */ + +const enablePublishSidebar = () => _ref9 => { + let { + registry + } = _ref9; + registry.dispatch(external_wp_preferences_namespaceObject.store).set('core/edit-post', 'isPublishSidebarEnabled', true); +}; +/** + * Disables the publish sidebar. + */ + +const disablePublishSidebar = () => _ref10 => { + let { + registry + } = _ref10; + registry.dispatch(external_wp_preferences_namespaceObject.store).set('core/edit-post', 'isPublishSidebarEnabled', false); +}; +/** + * Action that locks post saving. + * + * @param {string} lockName The lock name. * * @example * ``` @@ -3935,9 +3975,9 @@ }; } /** - * Returns an action object used to signal that post saving is unlocked. - * - * @param {string} lockName The lock name. + * Action that unlocks post saving. + * + * @param {string} lockName The lock name. * * @example * ``` @@ -3955,9 +3995,9 @@ }; } /** - * Returns an action object used to signal that post autosaving is locked. - * - * @param {string} lockName The lock name. + * Action that locks post autosaving. + * + * @param {string} lockName The lock name. * * @example * ``` @@ -3975,9 +4015,9 @@ }; } /** - * Returns an action object used to signal that post autosaving is unlocked. - * - * @param {string} lockName The lock name. + * Action that unlocks post autosaving. + * + * @param {string} lockName The lock name. * * @example * ``` @@ -3999,41 +4039,52 @@ * * @param {Array} blocks Block Array. * @param {?Object} options Optional options. - * - * @yield {Object} Action object - */ - -function* actions_resetEditorBlocks(blocks, options = {}) { - const { - __unstableShouldCreateUndoLevel, - selection - } = options; - const edits = { - blocks, - selection - }; - - if (__unstableShouldCreateUndoLevel !== false) { + */ + +const resetEditorBlocks = function (blocks) { + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return _ref11 => { + let { + select, + dispatch, + registry + } = _ref11; const { - id, - type - } = yield external_wp_data_["controls"].select(STORE_NAME, 'getCurrentPost'); - const noChange = (yield external_wp_data_["controls"].select('core', 'getEditedEntityRecord', 'postType', type, id)).blocks === edits.blocks; - - if (noChange) { - return yield external_wp_data_["controls"].dispatch('core', '__unstableCreateUndoLevel', 'postType', type, id); - } // We create a new function here on every persistent edit - // to make sure the edit makes the post dirty and creates - // a new undo level. - - - edits.content = ({ - blocks: blocksForSerialization = [] - }) => Object(external_wp_blocks_["__unstableSerializeAndClean"])(blocksForSerialization); - } - - yield* actions_editPost(edits); -} + __unstableShouldCreateUndoLevel, + selection + } = options; + const edits = { + blocks, + selection + }; + + if (__unstableShouldCreateUndoLevel !== false) { + const { + id, + type + } = select.getCurrentPost(); + const noChange = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', type, id).blocks === edits.blocks; + + if (noChange) { + registry.dispatch(external_wp_coreData_namespaceObject.store).__unstableCreateUndoLevel('postType', type, id); + + return; + } // We create a new function here on every persistent edit + // to make sure the edit makes the post dirty and creates + // a new undo level. + + + edits.content = _ref12 => { + let { + blocks: blocksForSerialization = [] + } = _ref12; + return (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization); + }; + } + + dispatch.editPost(edits); + }; +}; /* * Returns an action object used in signalling that the post editor settings have been updated. * @@ -4042,7 +4093,7 @@ * @return {Object} Action object */ -function actions_updateEditorSettings(settings) { +function updateEditorSettings(settings) { return { type: 'UPDATE_EDITOR_SETTINGS', settings @@ -4052,12 +4103,22 @@ * Backward compatibility */ -const getBlockEditorAction = name => function* (...args) { - external_wp_deprecated_default()("`wp.data.dispatch( 'core/editor' )." + name + '`', { - since: '5.3', - alternative: "`wp.data.dispatch( 'core/block-editor' )." + name + '`' - }); - yield external_wp_data_["controls"].dispatch('core/block-editor', name, ...args); +const getBlockEditorAction = name => function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ref13 => { + let { + registry + } = _ref13; + external_wp_deprecated_default()("`wp.data.dispatch( 'core/editor' )." + name + '`', { + since: '5.3', + alternative: "`wp.data.dispatch( 'core/block-editor' )." + name + '`', + version: '6.2' + }); + registry.dispatch(external_wp_blockEditor_namespaceObject.store)[name](...args); + }; }; /** * @see resetBlocks in core/block-editor store. @@ -4084,7 +4145,7 @@ * @see selectBlock in core/block-editor store. */ -const actions_selectBlock = getBlockEditorAction('selectBlock'); +const selectBlock = getBlockEditorAction('selectBlock'); /** * @see startMultiSelect in core/block-editor store. */ @@ -4104,7 +4165,7 @@ * @see clearSelectedBlock in core/block-editor store. */ -const actions_clearSelectedBlock = getBlockEditorAction('clearSelectedBlock'); +const clearSelectedBlock = getBlockEditorAction('clearSelectedBlock'); /** * @see toggleSelection in core/block-editor store. */ @@ -4144,7 +4205,7 @@ * @see insertBlocks in core/block-editor store. */ -const actions_insertBlocks = getBlockEditorAction('insertBlocks'); +const insertBlocks = getBlockEditorAction('insertBlocks'); /** * @see showInsertionPoint in core/block-editor store. */ @@ -4159,12 +4220,12 @@ * @see setTemplateValidity in core/block-editor store. */ -const actions_setTemplateValidity = getBlockEditorAction('setTemplateValidity'); +const setTemplateValidity = getBlockEditorAction('setTemplateValidity'); /** * @see synchronizeTemplate in core/block-editor store. */ -const actions_synchronizeTemplate = getBlockEditorAction('synchronizeTemplate'); +const synchronizeTemplate = getBlockEditorAction('synchronizeTemplate'); /** * @see mergeBlocks in core/block-editor store. */ @@ -4209,63 +4270,17 @@ * @see insertDefaultBlock in core/block-editor store. */ -const actions_insertDefaultBlock = getBlockEditorAction('insertDefaultBlock'); +const insertDefaultBlock = getBlockEditorAction('insertDefaultBlock'); /** * @see updateBlockListSettings in core/block-editor store. */ const updateBlockListSettings = getBlockEditorAction('updateBlockListSettings'); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/controls.js -/** - * Function returning a sessionStorage key to set or retrieve a given post's - * automatic session backup. - * - * Keys are crucially prefixed with 'wp-autosave-' so that wp-login.php's - * `loggedout` handler can clear sessionStorage of any user-private content. - * - * @see https://github.com/WordPress/wordpress-develop/blob/6dad32d2aed47e6c0cf2aee8410645f6d7aba6bd/src/wp-login.php#L103 - * - * @param {string} postId Post ID. - * @param {boolean} isPostNew Whether post new. - * @return {string} sessionStorage key - */ -function postKey(postId, isPostNew) { - return `wp-autosave-block-editor-post-${isPostNew ? 'auto-draft' : postId}`; -} - -function localAutosaveGet(postId, isPostNew) { - return window.sessionStorage.getItem(postKey(postId, isPostNew)); -} -function localAutosaveSet(postId, isPostNew, title, content, excerpt) { - window.sessionStorage.setItem(postKey(postId, isPostNew), JSON.stringify({ - post_title: title, - content, - excerpt - })); -} -function localAutosaveClear(postId, isPostNew) { - window.sessionStorage.removeItem(postKey(postId, isPostNew)); -} -const controls = { - LOCAL_AUTOSAVE_SET({ - postId, - isPostNew, - title, - content, - excerpt - }) { - localAutosaveSet(postId, isPostNew, title, content, excerpt); - } - -}; -/* harmony default export */ var store_controls = (controls); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/index.js -/** - * WordPress dependencies - */ - +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/index.js +/** + * WordPress dependencies + */ /** * Internal dependencies @@ -4275,7 +4290,6 @@ - /** * Post editor data store configuration. * @@ -4287,10 +4301,7 @@ const storeConfig = { reducer: reducer, selectors: selectors_namespaceObject, - actions: actions_namespaceObject, - controls: { ...external_wp_dataControls_["controls"], - ...store_controls - } + actions: actions_namespaceObject }; /** * Store definition for the editor namespace. @@ -4300,23 +4311,239 @@ * @type {Object} */ -const store = Object(external_wp_data_["createReduxStore"])(STORE_NAME, { ...storeConfig, - persist: ['preferences'] -}); // Once we build a more generic persistence plugin that works across types of stores -// we'd be able to replace this with a register call. - -Object(external_wp_data_["registerStore"])(STORE_NAME, { ...storeConfig, - persist: ['preferences'] +const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { ...storeConfig }); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/autocompleters/index.js - - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/autosave-monitor/index.js -/** - * WordPress dependencies - */ - +(0,external_wp_data_namespaceObject.register)(store_store); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/hooks/custom-sources-backwards-compatibility.js + + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + +/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */ + +/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */ + +/** + * Object whose keys are the names of block attributes, where each value + * represents the meta key to which the block attribute is intended to save. + * + * @see https://developer.wordpress.org/reference/functions/register_meta/ + * + * @typedef {Object} WPMetaAttributeMapping + */ + +/** + * Given a mapping of attribute names (meta source attributes) to their + * associated meta key, returns a higher order component that overrides its + * `attributes` and `setAttributes` props to sync any changes with the edited + * post's meta keys. + * + * @param {WPMetaAttributeMapping} metaAttributes Meta attribute mapping. + * + * @return {WPHigherOrderComponent} Higher-order component. + */ + +const createWithMetaAttributeSource = metaAttributes => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => _ref => { + let { + attributes, + setAttributes, + ...props + } = _ref; + const postType = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getCurrentPostType(), []); + const [meta, setMeta] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'meta'); + const mergedAttributes = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...attributes, + ...(0,external_lodash_namespaceObject.mapValues)(metaAttributes, metaKey => meta[metaKey]) + }), [attributes, meta]); + return (0,external_wp_element_namespaceObject.createElement)(BlockEdit, _extends({ + attributes: mergedAttributes, + setAttributes: nextAttributes => { + const nextMeta = (0,external_lodash_namespaceObject.mapKeys)( // Filter to intersection of keys between the updated + // attributes and those with an associated meta key. + (0,external_lodash_namespaceObject.pickBy)(nextAttributes, (value, key) => metaAttributes[key]), // Rename the keys to the expected meta key name. + (value, attributeKey) => metaAttributes[attributeKey]); + + if (!(0,external_lodash_namespaceObject.isEmpty)(nextMeta)) { + setMeta(nextMeta); + } + + setAttributes(nextAttributes); + } + }, props)); +}, 'withMetaAttributeSource'); +/** + * Filters a registered block's settings to enhance a block's `edit` component + * to upgrade meta-sourced attributes to use the post's meta entity property. + * + * @param {WPBlockSettings} settings Registered block settings. + * + * @return {WPBlockSettings} Filtered block settings. + */ + + +function shimAttributeSource(settings) { + /** @type {WPMetaAttributeMapping} */ + const metaAttributes = (0,external_lodash_namespaceObject.mapValues)((0,external_lodash_namespaceObject.pickBy)(settings.attributes, { + source: 'meta' + }), 'meta'); + + if (!(0,external_lodash_namespaceObject.isEmpty)(metaAttributes)) { + settings.edit = createWithMetaAttributeSource(metaAttributes)(settings.edit); + } + + return settings; +} + +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/editor/custom-sources-backwards-compatibility/shim-attribute-source', shimAttributeSource); // The above filter will only capture blocks registered after the filter was +// added. There may already be blocks registered by this point, and those must +// be updated to apply the shim. +// +// The following implementation achieves this, albeit with a couple caveats: +// - Only blocks registered on the global store will be modified. +// - The block settings are directly mutated, since there is currently no +// mechanism to update an existing block registration. This is the reason for +// `getBlockType` separate from `getBlockTypes`, since the latter returns a +// _copy_ of the block registration (i.e. the mutation would not affect the +// actual registered block settings). +// +// `getBlockTypes` or `getBlockType` implementation could change in the future +// in regards to creating settings clones, but the corresponding end-to-end +// tests for meta blocks should cover against any potential regressions. +// +// In the future, we could support updating block settings, at which point this +// implementation could use that mechanism instead. + +(0,external_wp_data_namespaceObject.select)(external_wp_blocks_namespaceObject.store).getBlockTypes().map(_ref2 => { + let { + name + } = _ref2; + return (0,external_wp_data_namespaceObject.select)(external_wp_blocks_namespaceObject.store).getBlockType(name); +}).forEach(shimAttributeSource); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/autocompleters/user.js + + +/** + * WordPress dependencies + */ + + + +/** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */ + +function getUserLabel(user) { + const avatar = user.avatar_urls && user.avatar_urls[24] ? (0,external_wp_element_namespaceObject.createElement)("img", { + className: "editor-autocompleters__user-avatar", + alt: "", + src: user.avatar_urls[24] + }) : (0,external_wp_element_namespaceObject.createElement)("span", { + className: "editor-autocompleters__no-avatar" + }); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, avatar, (0,external_wp_element_namespaceObject.createElement)("span", { + className: "editor-autocompleters__user-name" + }, user.name), (0,external_wp_element_namespaceObject.createElement)("span", { + className: "editor-autocompleters__user-slug" + }, user.slug)); +} +/** + * A user mentions completer. + * + * @type {WPCompleter} + */ + +/* harmony default export */ var user = ({ + name: 'users', + className: 'editor-autocompleters__user', + triggerPrefix: '@', + + useItems(filterValue) { + const users = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getUsers + } = select(external_wp_coreData_namespaceObject.store); + return getUsers({ + context: 'view', + search: encodeURIComponent(filterValue) + }); + }, [filterValue]); + const options = (0,external_wp_element_namespaceObject.useMemo)(() => users ? users.map(user => ({ + key: `user-${user.slug}`, + value: user, + label: getUserLabel(user) + })) : [], [users]); + return [options]; + }, + + getOptionCompletion(user) { + return `@${user.slug}`; + } + +}); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/hooks/default-autocompleters.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +function setDefaultCompleters() { + let completers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + // Provide copies so filters may directly modify them. + completers.push((0,external_lodash_namespaceObject.clone)(user)); + return completers; +} + +(0,external_wp_hooks_namespaceObject.addFilter)('editor.Autocomplete.completers', 'editor/autocompleters/set-default-completers', setDefaultCompleters); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/hooks/index.js +/** + * Internal dependencies + */ + + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/autocompleters/index.js + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/autosave-monitor/index.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ /** @@ -4331,7 +4558,7 @@ * * The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`. */ -class autosave_monitor_AutosaveMonitor extends external_wp_element_["Component"] { +class AutosaveMonitor extends external_wp_element_namespaceObject.Component { constructor(props) { super(props); this.needsAutosave = !!(props.isDirty && props.isAutosaveable); @@ -4352,6 +4579,11 @@ return; } + if (this.props.interval !== prevProps.interval) { + clearTimeout(this.timerId); + this.setAutosaveTimer(); + } + if (!this.props.isDirty) { this.needsAutosave = false; return; @@ -4371,7 +4603,8 @@ clearTimeout(this.timerId); } - setAutosaveTimer(timeout = this.props.interval * 1000) { + setAutosaveTimer() { + let timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.interval * 1000; this.timerId = setTimeout(() => { this.autosaveTimerHandler(); }, timeout); @@ -4396,16 +4629,16 @@ } } -/* harmony default export */ var autosave_monitor = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])((select, ownProps) => { +/* harmony default export */ var autosave_monitor = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, ownProps) => { const { getReferenceByDistinctEdits - } = select('core'); + } = select(external_wp_coreData_namespaceObject.store); const { isEditedPostDirty, isEditedPostAutosaveable, isAutosavingPost, getEditorSettings - } = select('core/editor'); + } = select(store_store); const { interval = getEditorSettings().autosaveInterval } = ownProps; @@ -4416,21 +4649,22 @@ isAutosaving: isAutosavingPost(), interval }; -}), Object(external_wp_data_["withDispatch"])((dispatch, ownProps) => ({ +}), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps) => ({ autosave() { const { - autosave = dispatch('core/editor').autosave + autosave = dispatch(store_store).autosave } = ownProps; autosave(); } -}))])(autosave_monitor_AutosaveMonitor)); - +}))])(AutosaveMonitor)); + +;// CONCATENATED MODULE: external ["wp","richText"] +var external_wp_richText_namespaceObject = window["wp"]["richText"]; // EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__("TSYQ"); +var classnames = __webpack_require__(4403); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/document-outline/item.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/document-outline/item.js /** @@ -4438,32 +4672,35 @@ */ -const TableOfContentsItem = ({ - children, - isValid, - level, - href, - onSelect -}) => Object(external_wp_element_["createElement"])("li", { - className: classnames_default()('document-outline__item', `is-${level.toLowerCase()}`, { - 'is-invalid': !isValid - }) -}, Object(external_wp_element_["createElement"])("a", { - href: href, - className: "document-outline__button", - onClick: onSelect -}, Object(external_wp_element_["createElement"])("span", { - className: "document-outline__emdash", - "aria-hidden": "true" -}), Object(external_wp_element_["createElement"])("strong", { - className: "document-outline__level" -}, level), Object(external_wp_element_["createElement"])("span", { - className: "document-outline__item-content" -}, children))); +const TableOfContentsItem = _ref => { + let { + children, + isValid, + level, + href, + onSelect + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)("li", { + className: classnames_default()('document-outline__item', `is-${level.toLowerCase()}`, { + 'is-invalid': !isValid + }) + }, (0,external_wp_element_namespaceObject.createElement)("a", { + href: href, + className: "document-outline__button", + onClick: onSelect + }, (0,external_wp_element_namespaceObject.createElement)("span", { + className: "document-outline__emdash", + "aria-hidden": "true" + }), (0,external_wp_element_namespaceObject.createElement)("strong", { + className: "document-outline__level" + }, level), (0,external_wp_element_namespaceObject.createElement)("span", { + className: "document-outline__item-content" + }, children))); +}; /* harmony default export */ var document_outline_item = (TableOfContentsItem); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/document-outline/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/document-outline/index.js /** @@ -4479,31 +4716,33 @@ + /** * Internal dependencies */ + /** * Module constants */ -const emptyHeadingContent = Object(external_wp_element_["createElement"])("em", null, Object(external_wp_i18n_["__"])('(Empty heading)')); -const incorrectLevelContent = [Object(external_wp_element_["createElement"])("br", { +const emptyHeadingContent = (0,external_wp_element_namespaceObject.createElement)("em", null, (0,external_wp_i18n_namespaceObject.__)('(Empty heading)')); +const incorrectLevelContent = [(0,external_wp_element_namespaceObject.createElement)("br", { key: "incorrect-break" -}), Object(external_wp_element_["createElement"])("em", { +}), (0,external_wp_element_namespaceObject.createElement)("em", { key: "incorrect-message" -}, Object(external_wp_i18n_["__"])('(Incorrect heading level)'))]; -const singleH1Headings = [Object(external_wp_element_["createElement"])("br", { +}, (0,external_wp_i18n_namespaceObject.__)('(Incorrect heading level)'))]; +const singleH1Headings = [(0,external_wp_element_namespaceObject.createElement)("br", { key: "incorrect-break-h1" -}), Object(external_wp_element_["createElement"])("em", { +}), (0,external_wp_element_namespaceObject.createElement)("em", { key: "incorrect-message-h1" -}, Object(external_wp_i18n_["__"])('(Your theme may already use a H1 for the post title)'))]; -const multipleH1Headings = [Object(external_wp_element_["createElement"])("br", { +}, (0,external_wp_i18n_namespaceObject.__)('(Your theme may already use a H1 for the post title)'))]; +const multipleH1Headings = [(0,external_wp_element_namespaceObject.createElement)("br", { key: "incorrect-break-multiple-h1" -}), Object(external_wp_element_["createElement"])("em", { +}), (0,external_wp_element_namespaceObject.createElement)("em", { key: "incorrect-message-multiple-h1" -}, Object(external_wp_i18n_["__"])('(Multiple H1 headings are not recommended)'))]; +}, (0,external_wp_i18n_namespaceObject.__)('(Multiple H1 headings are not recommended)'))]; /** * Returns an array of heading blocks enhanced with the following properties: * level - An integer with the heading level. @@ -4514,8 +4753,11 @@ * @return {Array} An array of heading blocks enhanced with the properties described above. */ -const computeOutlineHeadings = (blocks = []) => { - return Object(external_lodash_["flatMap"])(blocks, (block = {}) => { +const computeOutlineHeadings = function () { + let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + return (0,external_lodash_namespaceObject.flatMap)(blocks, function () { + let block = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + if (block.name === 'core/heading') { return { ...block, level: block.attributes.level, @@ -4529,13 +4771,14 @@ const isEmptyHeading = heading => !heading.attributes.content || heading.attributes.content.length === 0; -const DocumentOutline = ({ - blocks = [], - title, - onSelect, - isTitleSupported, - hasOutlineItemsDisabled -}) => { +const DocumentOutline = _ref => { + let { + blocks = [], + title, + onSelect, + isTitleSupported, + hasOutlineItemsDisabled + } = _ref; const headings = computeOutlineHeadings(blocks); if (headings.length < 1) { @@ -4546,12 +4789,12 @@ const titleNode = document.querySelector('.editor-post-title__input'); const hasTitle = isTitleSupported && title && titleNode; - const countByLevel = Object(external_lodash_["countBy"])(headings, 'level'); + const countByLevel = (0,external_lodash_namespaceObject.countBy)(headings, 'level'); const hasMultipleH1 = countByLevel[1] > 1; - return Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)("div", { className: "document-outline" - }, Object(external_wp_element_["createElement"])("ul", null, hasTitle && Object(external_wp_element_["createElement"])(document_outline_item, { - level: Object(external_wp_i18n_["__"])('Title'), + }, (0,external_wp_element_namespaceObject.createElement)("ul", null, hasTitle && (0,external_wp_element_namespaceObject.createElement)(document_outline_item, { + level: (0,external_wp_i18n_namespaceObject.__)('Title'), isValid: true, onSelect: onSelect, href: `#${titleNode.id}`, @@ -4562,37 +4805,37 @@ const isIncorrectLevel = item.level > prevHeadingLevel + 1; const isValid = !item.isEmpty && !isIncorrectLevel && !!item.level && (item.level !== 1 || !hasMultipleH1 && !hasTitle); prevHeadingLevel = item.level; - return Object(external_wp_element_["createElement"])(document_outline_item, { + return (0,external_wp_element_namespaceObject.createElement)(document_outline_item, { key: index, level: `H${item.level}`, isValid: isValid, isDisabled: hasOutlineItemsDisabled, href: `#block-${item.clientId}`, onSelect: onSelect - }, item.isEmpty ? emptyHeadingContent : Object(external_wp_richText_["getTextContent"])(Object(external_wp_richText_["create"])({ + }, item.isEmpty ? emptyHeadingContent : (0,external_wp_richText_namespaceObject.getTextContent)((0,external_wp_richText_namespaceObject.create)({ html: item.attributes.content })), isIncorrectLevel && incorrectLevelContent, item.level === 1 && hasMultipleH1 && multipleH1Headings, hasTitle && item.level === 1 && !hasMultipleH1 && singleH1Headings); }))); }; -/* harmony default export */ var document_outline = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])(select => { +/* harmony default export */ var document_outline = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)(select => { const { getBlocks - } = select(external_wp_blockEditor_["store"]); + } = select(external_wp_blockEditor_namespaceObject.store); const { getEditedPostAttribute - } = select('core/editor'); + } = select(store_store); const { getPostType - } = select('core'); + } = select(external_wp_coreData_namespaceObject.store); const postType = getPostType(getEditedPostAttribute('type')); return { title: getEditedPostAttribute('title'), blocks: getBlocks(), - isTitleSupported: Object(external_lodash_["get"])(postType, ['supports', 'title'], false) + isTitleSupported: (0,external_lodash_namespaceObject.get)(postType, ['supports', 'title'], false) }; }))(DocumentOutline)); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/document-outline/check.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/document-outline/check.js /** * External dependencies */ @@ -4604,11 +4847,12 @@ -function DocumentOutlineCheck({ - blocks, - children -}) { - const headings = Object(external_lodash_["filter"])(blocks, block => block.name === 'core/heading'); +function DocumentOutlineCheck(_ref) { + let { + blocks, + children + } = _ref; + const headings = (0,external_lodash_namespaceObject.filter)(blocks, block => block.name === 'core/heading'); if (headings.length < 1) { return null; @@ -4617,48 +4861,53 @@ return children; } -/* harmony default export */ var check = (Object(external_wp_data_["withSelect"])(select => ({ - blocks: select(external_wp_blockEditor_["store"]).getBlocks() +/* harmony default export */ var check = ((0,external_wp_data_namespaceObject.withSelect)(select => ({ + blocks: select(external_wp_blockEditor_namespaceObject.store).getBlocks() }))(DocumentOutlineCheck)); -// EXTERNAL MODULE: external ["wp","keyboardShortcuts"] -var external_wp_keyboardShortcuts_ = __webpack_require__("hF7m"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/save-shortcut.js -/** - * WordPress dependencies - */ - - - - -function SaveShortcut({ - resetBlocksOnSave -}) { +;// CONCATENATED MODULE: external ["wp","keyboardShortcuts"] +var external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/save-shortcut.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +function SaveShortcut(_ref) { + let { + resetBlocksOnSave + } = _ref; const { resetEditorBlocks, savePost - } = Object(external_wp_data_["useDispatch"])('core/editor'); + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const { isEditedPostDirty, - getPostEdits - } = Object(external_wp_data_["useSelect"])(select => { - const { - isEditedPostDirty: _isEditedPostDirty, - getPostEdits: _getPostEdits - } = select('core/editor'); - return { - isEditedPostDirty: _isEditedPostDirty, - getPostEdits: _getPostEdits - }; - }, []); - Object(external_wp_keyboardShortcuts_["useShortcut"])('core/editor/save', event => { - event.preventDefault(); // TODO: This should be handled in the `savePost` effect in + getPostEdits, + isPostSavingLocked + } = (0,external_wp_data_namespaceObject.useSelect)(store_store); + (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/save', event => { + event.preventDefault(); + /** + * Do not save the post if post saving is locked. + */ + + if (isPostSavingLocked()) { + return; + } // TODO: This should be handled in the `savePost` effect in // considering `isSaveable`. See note on `isEditedPostSaveable` // selector about dirtiness and meta-boxes. // // See: `isEditedPostSaveable` + if (!isEditedPostDirty()) { return; } // The text editor requires that editor blocks are updated for a @@ -4671,27 +4920,24 @@ const postEdits = getPostEdits(); if (postEdits.content && typeof postEdits.content === 'string') { - const blocks = Object(external_wp_blocks_["parse"])(postEdits.content); + const blocks = (0,external_wp_blocks_namespaceObject.parse)(postEdits.content); resetEditorBlocks(blocks); } } savePost(); - }, { - bindGlobal: true }); return null; } /* harmony default export */ var save_shortcut = (SaveShortcut); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/visual-editor-shortcuts.js - - -/** - * WordPress dependencies - */ - +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/visual-editor-shortcuts.js + + +/** + * WordPress dependencies + */ /** @@ -4700,29 +4946,26 @@ + function VisualEditorGlobalKeyboardShortcuts() { const { redo, undo - } = Object(external_wp_data_["useDispatch"])('core/editor'); - Object(external_wp_keyboardShortcuts_["useShortcut"])('core/editor/undo', event => { + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); + (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/undo', event => { undo(); event.preventDefault(); - }, { - bindGlobal: true }); - Object(external_wp_keyboardShortcuts_["useShortcut"])('core/editor/redo', event => { + (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/redo', event => { redo(); event.preventDefault(); - }, { - bindGlobal: true }); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockEditorKeyboardShortcuts"], null), Object(external_wp_element_["createElement"])(save_shortcut, null)); + return (0,external_wp_element_namespaceObject.createElement)(save_shortcut, null); } /* harmony default export */ var visual_editor_shortcuts = (VisualEditorGlobalKeyboardShortcuts); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/text-editor-shortcuts.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/text-editor-shortcuts.js /** @@ -4730,12 +4973,12 @@ */ function TextEditorGlobalKeyboardShortcuts() { - return Object(external_wp_element_["createElement"])(save_shortcut, { + return (0,external_wp_element_namespaceObject.createElement)(save_shortcut, { resetBlocksOnSave: true }); } -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/register-shortcuts.js /** @@ -4748,15 +4991,15 @@ function EditorKeyboardShortcutsRegister() { - // Registering the shortcuts + // Registering the shortcuts. const { registerShortcut - } = Object(external_wp_data_["useDispatch"])(external_wp_keyboardShortcuts_["store"]); - Object(external_wp_element_["useEffect"])(() => { + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store); + (0,external_wp_element_namespaceObject.useEffect)(() => { registerShortcut({ name: 'core/editor/save', category: 'global', - description: Object(external_wp_i18n_["__"])('Save your changes.'), + description: (0,external_wp_i18n_namespaceObject.__)('Save your changes.'), keyCombination: { modifier: 'primary', character: 's' @@ -4765,7 +5008,7 @@ registerShortcut({ name: 'core/editor/undo', category: 'global', - description: Object(external_wp_i18n_["__"])('Undo your last changes.'), + description: (0,external_wp_i18n_namespaceObject.__)('Undo your last changes.'), keyCombination: { modifier: 'primary', character: 'z' @@ -4774,31 +5017,53 @@ registerShortcut({ name: 'core/editor/redo', category: 'global', - description: Object(external_wp_i18n_["__"])('Redo your last undo.'), + description: (0,external_wp_i18n_namespaceObject.__)('Redo your last undo.'), keyCombination: { modifier: 'primaryShift', character: 'z' } }); }, [registerShortcut]); - return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockEditorKeyboardShortcuts"].Register, null); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockEditorKeyboardShortcuts.Register, null); } /* harmony default export */ var register_shortcuts = (EditorKeyboardShortcutsRegister); -// EXTERNAL MODULE: external ["wp","components"] -var external_wp_components_ = __webpack_require__("tI+e"); - -// EXTERNAL MODULE: external ["wp","keycodes"] -var external_wp_keycodes_ = __webpack_require__("RxS6"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/redo.js -var library_redo = __webpack_require__("K2cm"); - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/undo.js -var library_undo = __webpack_require__("Ntru"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor-history/redo.js +;// CONCATENATED MODULE: external ["wp","components"] +var external_wp_components_namespaceObject = window["wp"]["components"]; +;// CONCATENATED MODULE: external ["wp","keycodes"] +var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/redo.js + + +/** + * WordPress dependencies + */ + +const redo_redo = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z" +})); +/* harmony default export */ var library_redo = (redo_redo); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/undo.js + + +/** + * WordPress dependencies + */ + +const undo_undo = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z" +})); +/* harmony default export */ var library_undo = (undo_undo); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor-history/redo.js @@ -4818,17 +5083,17 @@ function EditorHistoryRedo(props, ref) { - const hasRedo = Object(external_wp_data_["useSelect"])(select => select(store).hasEditorRedo(), []); + const hasRedo = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).hasEditorRedo(), []); const { redo - } = Object(external_wp_data_["useDispatch"])(store); - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], Object(esm_extends["a" /* default */])({}, props, { + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({}, props, { ref: ref, - icon: !Object(external_wp_i18n_["isRTL"])() ? library_redo["a" /* default */] : library_undo["a" /* default */] + icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_redo : library_undo /* translators: button label text should, if possible, be under 16 characters. */ , - label: Object(external_wp_i18n_["__"])('Redo'), - shortcut: external_wp_keycodes_["displayShortcut"].primaryShift('z') // If there are no redo levels we don't want to actually disable this + label: (0,external_wp_i18n_namespaceObject.__)('Redo'), + shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('z') // If there are no redo levels we don't want to actually disable this // button, because it will remove focus for keyboard users. // See: https://github.com/WordPress/gutenberg/issues/3486 , @@ -4838,9 +5103,9 @@ })); } -/* harmony default export */ var editor_history_redo = (Object(external_wp_element_["forwardRef"])(EditorHistoryRedo)); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor-history/undo.js +/* harmony default export */ var editor_history_redo = ((0,external_wp_element_namespaceObject.forwardRef)(EditorHistoryRedo)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor-history/undo.js @@ -4860,17 +5125,17 @@ function EditorHistoryUndo(props, ref) { - const hasUndo = Object(external_wp_data_["useSelect"])(select => select(store).hasEditorUndo(), []); + const hasUndo = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).hasEditorUndo(), []); const { undo - } = Object(external_wp_data_["useDispatch"])(store); - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], Object(esm_extends["a" /* default */])({}, props, { + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({}, props, { ref: ref, - icon: !Object(external_wp_i18n_["isRTL"])() ? library_undo["a" /* default */] : library_redo["a" /* default */] + icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_undo : library_redo /* translators: button label text should, if possible, be under 16 characters. */ , - label: Object(external_wp_i18n_["__"])('Undo'), - shortcut: external_wp_keycodes_["displayShortcut"].primary('z') // If there are no undo levels we don't want to actually disable this + label: (0,external_wp_i18n_namespaceObject.__)('Undo'), + shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('z') // If there are no undo levels we don't want to actually disable this // button, because it will remove focus for keyboard users. // See: https://github.com/WordPress/gutenberg/issues/3486 , @@ -4880,63 +5145,224 @@ })); } -/* harmony default export */ var editor_history_undo = (Object(external_wp_element_["forwardRef"])(EditorHistoryUndo)); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/template-validation-notice/index.js - - -/** - * WordPress dependencies - */ - - - - - - -function TemplateValidationNotice({ - isValid, - ...props -}) { +/* harmony default export */ var editor_history_undo = ((0,external_wp_element_namespaceObject.forwardRef)(EditorHistoryUndo)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/template-validation-notice/index.js + + +/** + * WordPress dependencies + */ + + + + + + +function TemplateValidationNotice(_ref) { + let { + isValid, + ...props + } = _ref; + if (isValid) { return null; } const confirmSynchronization = () => { if ( // eslint-disable-next-line no-alert - window.confirm(Object(external_wp_i18n_["__"])('Resetting the template may result in loss of content, do you want to continue?'))) { + window.confirm((0,external_wp_i18n_namespaceObject.__)('Resetting the template may result in loss of content, do you want to continue?'))) { props.synchronizeTemplate(); } }; - return Object(external_wp_element_["createElement"])(external_wp_components_["Notice"], { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, { className: "editor-template-validation-notice", isDismissible: false, status: "warning", actions: [{ - label: Object(external_wp_i18n_["__"])('Keep it as is'), + label: (0,external_wp_i18n_namespaceObject.__)('Keep it as is'), onClick: props.resetTemplateValidity }, { - label: Object(external_wp_i18n_["__"])('Reset the template'), + label: (0,external_wp_i18n_namespaceObject.__)('Reset the template'), onClick: confirmSynchronization }] - }, Object(external_wp_i18n_["__"])('The content of your post doesn’t match the template assigned to your post type.')); -} - -/* harmony default export */ var template_validation_notice = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => ({ - isValid: select(external_wp_blockEditor_["store"]).isValidTemplate() -})), Object(external_wp_data_["withDispatch"])(dispatch => { + }, (0,external_wp_i18n_namespaceObject.__)('The content of your post doesn’t match the template assigned to your post type.')); +} + +/* harmony default export */ var template_validation_notice = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)(select => ({ + isValid: select(external_wp_blockEditor_namespaceObject.store).isValidTemplate() +})), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => { const { setTemplateValidity, synchronizeTemplate - } = dispatch(external_wp_blockEditor_["store"]); + } = dispatch(external_wp_blockEditor_namespaceObject.store); return { resetTemplateValidity: () => setTemplateValidity(true), synchronizeTemplate }; })])(TemplateValidationNotice)); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor-notices/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor-notices/index.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +function EditorNotices(_ref) { + let { + notices, + onRemove + } = _ref; + const dismissibleNotices = (0,external_lodash_namespaceObject.filter)(notices, { + isDismissible: true, + type: 'default' + }); + const nonDismissibleNotices = (0,external_lodash_namespaceObject.filter)(notices, { + isDismissible: false, + type: 'default' + }); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NoticeList, { + notices: nonDismissibleNotices, + className: "components-editor-notices__pinned" + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NoticeList, { + notices: dismissibleNotices, + className: "components-editor-notices__dismissible", + onRemove: onRemove + }, (0,external_wp_element_namespaceObject.createElement)(template_validation_notice, null))); +} +/* harmony default export */ var editor_notices = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)(select => ({ + notices: select(external_wp_notices_namespaceObject.store).getNotices() +})), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => ({ + onRemove: dispatch(external_wp_notices_namespaceObject.store).removeNotice +}))])(EditorNotices)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor-snackbars/index.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + +function EditorSnackbars() { + const notices = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_notices_namespaceObject.store).getNotices(), []); + const { + removeNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const snackbarNotices = (0,external_lodash_namespaceObject.filter)(notices, { + type: 'snackbar' + }); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SnackbarList, { + notices: snackbarNotices, + className: "components-editor-notices__snackbar", + onRemove: removeNotice + }); +} + +;// CONCATENATED MODULE: external ["wp","htmlEntities"] +var external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/entity-record-item.js + + +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + +function EntityRecordItem(_ref) { + let { + record, + checked, + onChange, + closePanel + } = _ref; + const { + name, + kind, + title, + key + } = record; + const parentBlockId = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _blocks$; + + // Get entity's blocks. + const { + blocks = [] + } = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(kind, name, key); // Get parents of the entity's first block. + + const parents = select(external_wp_blockEditor_namespaceObject.store).getBlockParents((_blocks$ = blocks[0]) === null || _blocks$ === void 0 ? void 0 : _blocks$.clientId); // Return closest parent block's clientId. + + return parents[parents.length - 1]; + }, []); // Handle templates that might use default descriptive titles. + + const entityRecordTitle = (0,external_wp_data_namespaceObject.useSelect)(select => { + if ('postType' !== kind || 'wp_template' !== name) { + return title; + } + + const template = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(kind, name, key); + return select(store_store).__experimentalGetTemplateInfo(template).title; + }, [name, kind, title, key]); + const isSelected = (0,external_wp_data_namespaceObject.useSelect)(select => { + const selectedBlockId = select(external_wp_blockEditor_namespaceObject.store).getSelectedBlockClientId(); + return selectedBlockId === parentBlockId; + }, [parentBlockId]); + const isSelectedText = isSelected ? (0,external_wp_i18n_namespaceObject.__)('Selected') : (0,external_wp_i18n_namespaceObject.__)('Select'); + const { + selectBlock + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + const selectParentBlock = (0,external_wp_element_namespaceObject.useCallback)(() => selectBlock(parentBlockId), [parentBlockId]); + const selectAndDismiss = (0,external_wp_element_namespaceObject.useCallback)(() => { + selectBlock(parentBlockId); + closePanel(); + }, [parentBlockId]); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, { + label: (0,external_wp_element_namespaceObject.createElement)("strong", null, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(entityRecordTitle) || (0,external_wp_i18n_namespaceObject.__)('Untitled')), + checked: checked, + onChange: onChange + }), parentBlockId ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + onClick: selectParentBlock, + className: "entities-saved-states__find-entity", + disabled: isSelected + }, isSelectedText), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + onClick: selectAndDismiss, + className: "entities-saved-states__find-entity-small", + disabled: isSelected + }, isSelectedText)) : null); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/entity-type-list.js /** @@ -4956,205 +5382,57 @@ */ -function EditorNotices({ - notices, - onRemove -}) { - const dismissibleNotices = Object(external_lodash_["filter"])(notices, { - isDismissible: true, - type: 'default' - }); - const nonDismissibleNotices = Object(external_lodash_["filter"])(notices, { - isDismissible: false, - type: 'default' - }); - return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["NoticeList"], { - notices: nonDismissibleNotices, - className: "components-editor-notices__pinned" - }), Object(external_wp_element_["createElement"])(external_wp_components_["NoticeList"], { - notices: dismissibleNotices, - className: "components-editor-notices__dismissible", - onRemove: onRemove - }, Object(external_wp_element_["createElement"])(template_validation_notice, null))); -} -/* harmony default export */ var editor_notices = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => ({ - notices: select(external_wp_notices_["store"]).getNotices() -})), Object(external_wp_data_["withDispatch"])(dispatch => ({ - onRemove: dispatch(external_wp_notices_["store"]).removeNotice -}))])(EditorNotices)); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor-snackbars/index.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - -function EditorSnackbars() { - const notices = Object(external_wp_data_["useSelect"])(select => select(external_wp_notices_["store"]).getNotices(), []); - const { - removeNotice - } = Object(external_wp_data_["useDispatch"])(external_wp_notices_["store"]); - const snackbarNotices = Object(external_lodash_["filter"])(notices, { - type: 'snackbar' - }); - return Object(external_wp_element_["createElement"])(external_wp_components_["SnackbarList"], { - notices: snackbarNotices, - className: "components-editor-notices__snackbar", - onRemove: removeNotice - }); -} - -// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js -var library_close = __webpack_require__("w95h"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page.js - - -/** - * WordPress dependencies - */ - -const page_page = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { - d: "M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z" -})); -/* harmony default export */ var library_page = (page_page); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/entity-record-item.js - - -/** - * WordPress dependencies - */ - - - - - -function EntityRecordItem({ - record, - checked, - onChange, - closePanel -}) { - const { - name, - kind, - title, - key - } = record; - const parentBlockId = Object(external_wp_data_["useSelect"])(select => { - var _blocks$; - - // Get entity's blocks. - const { - blocks = [] - } = select('core').getEditedEntityRecord(kind, name, key); // Get parents of the entity's first block. - - const parents = select(external_wp_blockEditor_["store"]).getBlockParents((_blocks$ = blocks[0]) === null || _blocks$ === void 0 ? void 0 : _blocks$.clientId); // Return closest parent block's clientId. - - return parents[parents.length - 1]; - }, []); // Handle templates that might use default descriptive titles - - const entityRecordTitle = Object(external_wp_data_["useSelect"])(select => { - if ('postType' !== kind || 'wp_template' !== name) { - return title; - } - - const template = select('core').getEditedEntityRecord(kind, name, key); - return select('core/editor').__experimentalGetTemplateInfo(template).title; - }, [name, kind, title, key]); - const isSelected = Object(external_wp_data_["useSelect"])(select => { - const selectedBlockId = select(external_wp_blockEditor_["store"]).getSelectedBlockClientId(); - return selectedBlockId === parentBlockId; - }, [parentBlockId]); - const isSelectedText = isSelected ? Object(external_wp_i18n_["__"])('Selected') : Object(external_wp_i18n_["__"])('Select'); - const { - selectBlock - } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]); - const selectParentBlock = Object(external_wp_element_["useCallback"])(() => selectBlock(parentBlockId), [parentBlockId]); - const selectAndDismiss = Object(external_wp_element_["useCallback"])(() => { - selectBlock(parentBlockId); - closePanel(); - }, [parentBlockId]); - return Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_components_["CheckboxControl"], { - label: Object(external_wp_element_["createElement"])("strong", null, entityRecordTitle || Object(external_wp_i18n_["__"])('Untitled')), - checked: checked, - onChange: onChange - }), parentBlockId ? Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - onClick: selectParentBlock, - className: "entities-saved-states__find-entity", - disabled: isSelected - }, isSelectedText), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - onClick: selectAndDismiss, - className: "entities-saved-states__find-entity-small", - disabled: isSelected - }, isSelectedText)) : null); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/entity-type-list.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - -const ENTITY_NAME_ICONS = { - site: layout["a" /* default */], - page: library_page -}; -function EntityTypeList({ - list, - unselectedEntities, - setUnselectedEntities, - closePanel -}) { + +function getEntityDescription(entity, count) { + switch (entity) { + case 'site': + return 1 === count ? (0,external_wp_i18n_namespaceObject.__)('This change will affect your whole site.') : (0,external_wp_i18n_namespaceObject.__)('These changes will affect your whole site.'); + + case 'wp_template': + return (0,external_wp_i18n_namespaceObject.__)('This change will affect pages and posts that use this template.'); + + case 'page': + case 'post': + return (0,external_wp_i18n_namespaceObject.__)('The following content has been modified.'); + } +} + +function EntityTypeList(_ref) { + let { + list, + unselectedEntities, + setUnselectedEntities, + closePanel + } = _ref; + const count = list.length; const firstRecord = list[0]; - const entity = Object(external_wp_data_["useSelect"])(select => select(external_wp_coreData_["store"]).getEntity(firstRecord.kind, firstRecord.name), [firstRecord.kind, firstRecord.name]); // Set icon based on type of entity. - + const entityConfig = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityConfig(firstRecord.kind, firstRecord.name), [firstRecord.kind, firstRecord.name]); const { name } = firstRecord; - const icon = ENTITY_NAME_ICONS[name]; - return Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], { - title: entity.label, - initialOpen: true, - icon: icon - }, list.map(record => { - return Object(external_wp_element_["createElement"])(EntityRecordItem, { + let entityLabel = entityConfig.label; + + if (name === 'wp_template_part') { + entityLabel = 1 === count ? (0,external_wp_i18n_namespaceObject.__)('Template Part') : (0,external_wp_i18n_namespaceObject.__)('Template Parts'); + } // Set description based on type of entity. + + + const description = getEntityDescription(name, count); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { + title: entityLabel, + initialOpen: true + }, description && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, null, description), list.map(record => { + return (0,external_wp_element_namespaceObject.createElement)(EntityRecordItem, { key: record.key || record.property, record: record, - checked: !Object(external_lodash_["some"])(unselectedEntities, elt => elt.kind === record.kind && elt.name === record.name && elt.key === record.key && elt.property === record.property), + checked: !(0,external_lodash_namespaceObject.some)(unselectedEntities, elt => elt.kind === record.kind && elt.name === record.name && elt.key === record.key && elt.property === record.property), onChange: value => setUnselectedEntities(record, value), closePanel: closePanel }); })); } -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/index.js @@ -5173,37 +5451,44 @@ + /** * Internal dependencies */ -const TRANSLATED_SITE_PROTPERTIES = { - title: Object(external_wp_i18n_["__"])('Title'), - description: Object(external_wp_i18n_["__"])('Tagline'), - site_logo: Object(external_wp_i18n_["__"])('Logo'), - show_on_front: Object(external_wp_i18n_["__"])('Show on front'), - page_on_front: Object(external_wp_i18n_["__"])('Page on front') +const TRANSLATED_SITE_PROPERTIES = { + title: (0,external_wp_i18n_namespaceObject.__)('Title'), + description: (0,external_wp_i18n_namespaceObject.__)('Tagline'), + site_logo: (0,external_wp_i18n_namespaceObject.__)('Logo'), + site_icon: (0,external_wp_i18n_namespaceObject.__)('Icon'), + show_on_front: (0,external_wp_i18n_namespaceObject.__)('Show on front'), + page_on_front: (0,external_wp_i18n_namespaceObject.__)('Page on front') }; -function EntitiesSavedStates({ - close -}) { - const saveButtonRef = Object(external_wp_element_["useRef"])(); +const PUBLISH_ON_SAVE_ENTITIES = [{ + kind: 'postType', + name: 'wp_navigation' +}]; +function EntitiesSavedStates(_ref) { + let { + close + } = _ref; + const saveButtonRef = (0,external_wp_element_namespaceObject.useRef)(); const { dirtyEntityRecords - } = Object(external_wp_data_["useSelect"])(select => { - const dirtyRecords = select(external_wp_coreData_["store"]).__experimentalGetDirtyEntityRecords(); // Remove site object and decouple into its edited pieces. + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const dirtyRecords = select(external_wp_coreData_namespaceObject.store).__experimentalGetDirtyEntityRecords(); // Remove site object and decouple into its edited pieces. const dirtyRecordsWithoutSite = dirtyRecords.filter(record => !(record.kind === 'root' && record.name === 'site')); - const siteEdits = select(external_wp_coreData_["store"]).getEntityRecordEdits('root', 'site'); + const siteEdits = select(external_wp_coreData_namespaceObject.store).getEntityRecordEdits('root', 'site'); const siteEditsAsEntities = []; for (const property in siteEdits) { siteEditsAsEntities.push({ kind: 'root', name: 'site', - title: TRANSLATED_SITE_PROTPERTIES[property] || property, + title: TRANSLATED_SITE_PROPERTIES[property] || property, property }); } @@ -5214,20 +5499,38 @@ }; }, []); const { + editEntityRecord, saveEditedEntityRecord, __experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits - } = Object(external_wp_data_["useDispatch"])(external_wp_coreData_["store"]); // To group entities by type. - - const partitionedSavables = Object.values(Object(external_lodash_["groupBy"])(dirtyEntityRecords, 'name')); // Unchecked entities to be ignored by save function. - - const [unselectedEntities, _setUnselectedEntities] = Object(external_wp_element_["useState"])([]); - - const setUnselectedEntities = ({ - kind, - name, - key, - property - }, checked) => { + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const { + __unstableMarkLastChangeAsPersistent + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + const { + createSuccessNotice, + createErrorNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); // To group entities by type. + + const partitionedSavables = (0,external_lodash_namespaceObject.groupBy)(dirtyEntityRecords, 'name'); // Sort entity groups. + + const { + site: siteSavables, + wp_template: templateSavables, + wp_template_part: templatePartSavables, + ...contentSavables + } = partitionedSavables; + const sortedPartitionedSavables = [siteSavables, templateSavables, templatePartSavables, ...Object.values(contentSavables)].filter(Array.isArray); // Unchecked entities to be ignored by save function. + + const [unselectedEntities, _setUnselectedEntities] = (0,external_wp_element_namespaceObject.useState)([]); + + const setUnselectedEntities = (_ref2, checked) => { + let { + kind, + name, + key, + property + } = _ref2; + if (checked) { _setUnselectedEntities(unselectedEntities.filter(elt => elt.kind !== kind || elt.name !== name || elt.key !== key || elt.property !== property)); } else { @@ -5241,57 +5544,86 @@ }; const saveCheckedEntities = () => { - const entitiesToSave = dirtyEntityRecords.filter(({ - kind, - name, - key, - property - }) => { - return !Object(external_lodash_["some"])(unselectedEntities, elt => elt.kind === kind && elt.name === name && elt.key === key && elt.property === property); + const entitiesToSave = dirtyEntityRecords.filter(_ref3 => { + let { + kind, + name, + key, + property + } = _ref3; + return !(0,external_lodash_namespaceObject.some)(unselectedEntities, elt => elt.kind === kind && elt.name === name && elt.key === key && elt.property === property); }); close(entitiesToSave); const siteItemsToSave = []; - entitiesToSave.forEach(({ - kind, - name, - key, - property - }) => { + const pendingSavedRecords = []; + entitiesToSave.forEach(_ref4 => { + let { + kind, + name, + key, + property + } = _ref4; + if ('root' === kind && 'site' === name) { siteItemsToSave.push(property); } else { - saveEditedEntityRecord(kind, name, key); + if (PUBLISH_ON_SAVE_ENTITIES.some(typeToPublish => typeToPublish.kind === kind && typeToPublish.name === name)) { + editEntityRecord(kind, name, key, { + status: 'publish' + }); + } + + pendingSavedRecords.push(saveEditedEntityRecord(kind, name, key)); } }); - saveSpecifiedEntityEdits('root', 'site', undefined, siteItemsToSave); + + if (siteItemsToSave.length) { + pendingSavedRecords.push(saveSpecifiedEntityEdits('root', 'site', undefined, siteItemsToSave)); + } + + __unstableMarkLastChangeAsPersistent(); + + Promise.all(pendingSavedRecords).then(values => { + if (values.some(value => typeof value === 'undefined')) { + createErrorNotice((0,external_wp_i18n_namespaceObject.__)('Saving failed.')); + } else { + createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Site updated.'), { + type: 'snackbar' + }); + } + }).catch(error => createErrorNotice(`${(0,external_wp_i18n_namespaceObject.__)('Saving failed.')} ${error}`)); }; // Explicitly define this with no argument passed. Using `close` on // its own will use the event object in place of the expected saved entities. - const dismissPanel = Object(external_wp_element_["useCallback"])(() => close(), [close]); - const [saveDialogRef, saveDialogProps] = Object(external_wp_compose_["__experimentalUseDialog"])({ + const dismissPanel = (0,external_wp_element_namespaceObject.useCallback)(() => close(), [close]); + const [saveDialogRef, saveDialogProps] = (0,external_wp_compose_namespaceObject.__experimentalUseDialog)({ onClose: () => dismissPanel() }); - return Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({ + return (0,external_wp_element_namespaceObject.createElement)("div", _extends({ ref: saveDialogRef }, saveDialogProps, { className: "entities-saved-states__panel" - }), Object(external_wp_element_["createElement"])("div", { - className: "entities-saved-states__panel-header" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, { + className: "entities-saved-states__panel-header", + gap: 2 + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, { + isBlock: true, + as: external_wp_components_namespaceObject.Button, ref: saveButtonRef, - isPrimary: true, + variant: "primary", disabled: dirtyEntityRecords.length - unselectedEntities.length === 0, onClick: saveCheckedEntities, className: "editor-entities-saved-states__save-button" - }, Object(external_wp_i18n_["__"])('Save')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - icon: library_close["a" /* default */], - onClick: dismissPanel, - label: Object(external_wp_i18n_["__"])('Close panel') - })), Object(external_wp_element_["createElement"])("div", { + }, (0,external_wp_i18n_namespaceObject.__)('Save')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, { + isBlock: true, + as: external_wp_components_namespaceObject.Button, + variant: "secondary", + onClick: dismissPanel + }, (0,external_wp_i18n_namespaceObject.__)('Cancel'))), (0,external_wp_element_namespaceObject.createElement)("div", { className: "entities-saved-states__text-prompt" - }, Object(external_wp_element_["createElement"])("strong", null, Object(external_wp_i18n_["__"])('Select the changes you want to save')), Object(external_wp_element_["createElement"])("p", null, Object(external_wp_i18n_["__"])('Some changes may affect other areas of your site.'))), partitionedSavables.map(list => { - return Object(external_wp_element_["createElement"])(EntityTypeList, { + }, (0,external_wp_element_namespaceObject.createElement)("strong", null, (0,external_wp_i18n_namespaceObject.__)('Are you ready to save?')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('The following changes have been made to your site, templates, and content.'))), sortedPartitionedSavables.map(list => { + return (0,external_wp_element_namespaceObject.createElement)(EntityTypeList, { key: list[0].name, list: list, closePanel: dismissPanel, @@ -5301,31 +5633,37 @@ })); } -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/error-boundary/index.js - - -/** - * WordPress dependencies - */ - - - - - - - -function CopyButton({ - text, - children -}) { - const ref = Object(external_wp_compose_["useCopyToClipboard"])(text); - return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - isSecondary: true, +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/error-boundary/index.js + + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + +function CopyButton(_ref) { + let { + text, + children + } = _ref; + const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text); + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + variant: "secondary", ref: ref }, children); } -class error_boundary_ErrorBoundary extends external_wp_element_["Component"] { +class ErrorBoundary extends external_wp_element_namespaceObject.Component { constructor() { super(...arguments); this.reboot = this.reboot.bind(this); @@ -5353,7 +5691,7 @@ // (b) avoids the performance cost associated with unnecessary // content serialization throughout the lifetime of a non-erroring // application. - return Object(external_wp_data_["select"])('core/editor').getEditedPostContent(); + return (0,external_wp_data_namespaceObject.select)(store_store).getEditedPostContent(); } catch (error) {} } @@ -5366,27 +5704,27 @@ return this.props.children; } - return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, { className: "editor-error-boundary", - actions: [Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { + actions: [(0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { key: "recovery", onClick: this.reboot, - isSecondary: true - }, Object(external_wp_i18n_["__"])('Attempt Recovery')), Object(external_wp_element_["createElement"])(CopyButton, { + variant: "secondary" + }, (0,external_wp_i18n_namespaceObject.__)('Attempt Recovery')), (0,external_wp_element_namespaceObject.createElement)(CopyButton, { key: "copy-post", text: this.getContent - }, Object(external_wp_i18n_["__"])('Copy Post Text')), Object(external_wp_element_["createElement"])(CopyButton, { + }, (0,external_wp_i18n_namespaceObject.__)('Copy Post Text')), (0,external_wp_element_namespaceObject.createElement)(CopyButton, { key: "copy-error", text: error.stack - }, Object(external_wp_i18n_["__"])('Copy Error'))] - }, Object(external_wp_i18n_["__"])('The editor has encountered an unexpected error.')); - } - -} - -/* harmony default export */ var error_boundary = (error_boundary_ErrorBoundary); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/local-autosave-monitor/index.js + }, (0,external_wp_i18n_namespaceObject.__)('Copy Error'))] + }, (0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error.')); + } + +} + +/* harmony default export */ var error_boundary = (ErrorBoundary); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/local-autosave-monitor/index.js /** @@ -5409,6 +5747,7 @@ + const requestIdleCallback = window.requestIdleCallback ? window.requestIdleCallback : window.requestAnimationFrame; /** * Function which returns true if the current environment supports browser @@ -5416,7 +5755,7 @@ * reused in subsequent invocations. */ -const hasSessionStorageSupport = Object(external_lodash_["once"])(() => { +const hasSessionStorageSupport = (0,external_lodash_namespaceObject.once)(() => { try { // Private Browsing in Safari 10 and earlier will throw an error when // attempting to set into sessionStorage. The test here is intentional in @@ -5438,24 +5777,23 @@ postId, isEditedPostNew, hasRemoteAutosave - } = Object(external_wp_data_["useSelect"])(select => ({ - postId: select('core/editor').getCurrentPostId(), - isEditedPostNew: select('core/editor').isEditedPostNew(), - getEditedPostAttribute: select('core/editor').getEditedPostAttribute, - hasRemoteAutosave: !!select('core/editor').getEditorSettings().autosave + } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ + postId: select(store_store).getCurrentPostId(), + isEditedPostNew: select(store_store).isEditedPostNew(), + hasRemoteAutosave: !!select(store_store).getEditorSettings().autosave }), []); const { getEditedPostAttribute - } = Object(external_wp_data_["useSelect"])('core/editor'); + } = (0,external_wp_data_namespaceObject.useSelect)(store_store); const { createWarningNotice, removeNotice - } = Object(external_wp_data_["useDispatch"])(external_wp_notices_["store"]); + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { editPost, resetEditorBlocks - } = Object(external_wp_data_["useDispatch"])('core/editor'); - Object(external_wp_element_["useEffect"])(() => { + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); + (0,external_wp_element_namespaceObject.useEffect)(() => { let localAutosave = localAutosaveGet(postId, isEditedPostNew); if (!localAutosave) { @@ -5497,15 +5835,15 @@ return; } - const noticeId = Object(external_lodash_["uniqueId"])('wpEditorAutosaveRestore'); - createWarningNotice(Object(external_wp_i18n_["__"])('The backup of this post in your browser is different from the version below.'), { + const noticeId = (0,external_lodash_namespaceObject.uniqueId)('wpEditorAutosaveRestore'); + createWarningNotice((0,external_wp_i18n_namespaceObject.__)('The backup of this post in your browser is different from the version below.'), { id: noticeId, actions: [{ - label: Object(external_wp_i18n_["__"])('Restore the backup'), + label: (0,external_wp_i18n_namespaceObject.__)('Restore the backup'), onClick() { - editPost(Object(external_lodash_["omit"])(edits, ['content'])); - resetEditorBlocks(Object(external_wp_blocks_["parse"])(edits.content)); + editPost((0,external_lodash_namespaceObject.omit)(edits, ['content'])); + resetEditorBlocks((0,external_wp_blocks_namespaceObject.parse)(edits.content)); removeNotice(noticeId); } @@ -5525,16 +5863,16 @@ isDirty, isAutosaving, didError - } = Object(external_wp_data_["useSelect"])(select => ({ - postId: select('core/editor').getCurrentPostId(), - isEditedPostNew: select('core/editor').isEditedPostNew(), - isDirty: select('core/editor').isEditedPostDirty(), - isAutosaving: select('core/editor').isAutosavingPost(), - didError: select('core/editor').didPostSaveRequestFail() + } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ + postId: select(store_store).getCurrentPostId(), + isEditedPostNew: select(store_store).isEditedPostNew(), + isDirty: select(store_store).isEditedPostDirty(), + isAutosaving: select(store_store).isAutosavingPost(), + didError: select(store_store).didPostSaveRequestFail() }), []); - const lastIsDirty = Object(external_wp_element_["useRef"])(isDirty); - const lastIsAutosaving = Object(external_wp_element_["useRef"])(isAutosaving); - Object(external_wp_element_["useEffect"])(() => { + const lastIsDirty = (0,external_wp_element_namespaceObject.useRef)(isDirty); + const lastIsAutosaving = (0,external_wp_element_namespaceObject.useRef)(isAutosaving); + (0,external_wp_element_namespaceObject.useEffect)(() => { if (!didError && (lastIsAutosaving.current && !isAutosaving || lastIsDirty.current && !isDirty)) { localAutosaveClear(postId, isEditedPostNew); } @@ -5543,9 +5881,9 @@ lastIsAutosaving.current = isAutosaving; }, [isDirty, isAutosaving, didError]); // Once the isEditedPostNew changes from true to false, let's clear the auto-draft autosave. - const wasEditedPostNew = Object(external_wp_compose_["usePrevious"])(isEditedPostNew); - const prevPostId = Object(external_wp_compose_["usePrevious"])(postId); - Object(external_wp_element_["useEffect"])(() => { + const wasEditedPostNew = (0,external_wp_compose_namespaceObject.usePrevious)(isEditedPostNew); + const prevPostId = (0,external_wp_compose_namespaceObject.usePrevious)(postId); + (0,external_wp_element_namespaceObject.useEffect)(() => { if (prevPostId === postId && wasEditedPostNew && !isEditedPostNew) { localAutosaveClear(postId, true); } @@ -5555,8 +5893,8 @@ function LocalAutosaveMonitor() { const { autosave - } = Object(external_wp_data_["useDispatch"])('core/editor'); - const deferedAutosave = Object(external_wp_element_["useCallback"])(() => { + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); + const deferredAutosave = (0,external_wp_element_namespaceObject.useCallback)(() => { requestIdleCallback(() => autosave({ local: true })); @@ -5565,18 +5903,57 @@ useAutosavePurge(); const { localAutosaveInterval - } = Object(external_wp_data_["useSelect"])(select => ({ - localAutosaveInterval: select('core/editor').getEditorSettings().__experimentalLocalAutosaveInterval + } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ + localAutosaveInterval: select(store_store).getEditorSettings().localAutosaveInterval }), []); - return Object(external_wp_element_["createElement"])(autosave_monitor, { + return (0,external_wp_element_namespaceObject.createElement)(autosave_monitor, { interval: localAutosaveInterval, - autosave: deferedAutosave + autosave: deferredAutosave }); } -/* harmony default export */ var local_autosave_monitor = (Object(external_wp_compose_["ifCondition"])(hasSessionStorageSupport)(LocalAutosaveMonitor)); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/check.js +/* harmony default export */ var local_autosave_monitor = ((0,external_wp_compose_namespaceObject.ifCondition)(hasSessionStorageSupport)(LocalAutosaveMonitor)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/check.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + +function PageAttributesCheck(_ref) { + let { + children + } = _ref; + const postType = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEditedPostAttribute + } = select(store_store); + const { + getPostType + } = select(external_wp_coreData_namespaceObject.store); + return getPostType(getEditedPostAttribute('type')); + }, []); + const supportsPageAttributes = (0,external_lodash_namespaceObject.get)(postType, ['supports', 'page-attributes'], false); // Only render fields if post type supports page attributes or available templates exist. + + if (!supportsPageAttributes) { + return null; + } + + return children; +} +/* harmony default export */ var page_attributes_check = (PageAttributesCheck); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js /** * External dependencies */ @@ -5592,61 +5969,30 @@ */ -function PageAttributesCheck({ - children -}) { - const postType = Object(external_wp_data_["useSelect"])(select => { - const { - getEditedPostAttribute - } = select(store); - const { - getPostType - } = select(external_wp_coreData_["store"]); - return getPostType(getEditedPostAttribute('type')); - }, []); - const supportsPageAttributes = Object(external_lodash_["get"])(postType, ['supports', 'page-attributes'], false); // Only render fields if post type supports page attributes or available templates exist. - - if (!supportsPageAttributes) { - return null; - } - - return children; -} -/* harmony default export */ var page_attributes_check = (PageAttributesCheck); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - /** * A component which renders its own children only if the current editor post * type supports one of the given `supportKeys` prop. * - * @param {Object} props Props. - * @param {string} [props.postType] Current post type. - * @param {WPElement} props.children Children to be rendered if post - * type supports. - * @param {(string|string[])} props.supportKeys String or string array of keys - * to test. + * @param {Object} props Props. + * @param {string} [props.postType] Current post type. + * @param {WPElement} props.children Children to be rendered if post + * type supports. + * @param {(string|string[])} props.supportKeys String or string array of keys + * to test. * * @return {WPComponent} The component to be rendered. */ -function PostTypeSupportCheck({ - postType, - children, - supportKeys -}) { +function PostTypeSupportCheck(_ref) { + let { + postType, + children, + supportKeys + } = _ref; let isSupported = true; if (postType) { - isSupported = Object(external_lodash_["some"])(Object(external_lodash_["castArray"])(supportKeys), key => !!postType.supports[key]); + isSupported = (0,external_lodash_namespaceObject.some)((0,external_lodash_namespaceObject.castArray)(supportKeys), key => !!postType.supports[key]); } if (!isSupported) { @@ -5655,19 +6001,19 @@ return children; } -/* harmony default export */ var post_type_support_check = (Object(external_wp_data_["withSelect"])(select => { +/* harmony default export */ var post_type_support_check = ((0,external_wp_data_namespaceObject.withSelect)(select => { const { getEditedPostAttribute - } = select('core/editor'); + } = select(store_store); const { getPostType - } = select('core'); + } = select(external_wp_coreData_namespaceObject.store); return { postType: getPostType(getEditedPostAttribute('type')) }; })(PostTypeSupportCheck)); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/order.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/order.js /** @@ -5682,69 +6028,63 @@ + /** * Internal dependencies */ -const PageAttributesOrder = Object(external_wp_compose_["withState"])({ - orderInput: null -})(({ - onUpdateOrder, - order = 0, - orderInput, - setState -}) => { + +const PageAttributesOrder = _ref => { + let { + onUpdateOrder, + order = 0 + } = _ref; + const [orderInput, setOrderInput] = (0,external_wp_element_namespaceObject.useState)(null); + const setUpdatedOrder = value => { - setState({ - orderInput: value - }); + setOrderInput(value); const newOrder = Number(value); - if (Number.isInteger(newOrder) && Object(external_lodash_["invoke"])(value, ['trim']) !== '') { + if (Number.isInteger(newOrder) && (0,external_lodash_namespaceObject.invoke)(value, ['trim']) !== '') { onUpdateOrder(Number(value)); } }; const value = orderInput === null ? order : orderInput; - return Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { className: "editor-page-attributes__order", type: "number", - label: Object(external_wp_i18n_["__"])('Order'), + label: (0,external_wp_i18n_namespaceObject.__)('Order'), value: value, onChange: setUpdatedOrder, size: 6, onBlur: () => { - setState({ - orderInput: null - }); + setOrderInput(null); } }); -}); +}; function PageAttributesOrderWithChecks(props) { - return Object(external_wp_element_["createElement"])(post_type_support_check, { + return (0,external_wp_element_namespaceObject.createElement)(post_type_support_check, { supportKeys: "page-attributes" - }, Object(external_wp_element_["createElement"])(PageAttributesOrder, props)); -} - -/* harmony default export */ var page_attributes_order = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => { + }, (0,external_wp_element_namespaceObject.createElement)(PageAttributesOrder, props)); +} + +/* harmony default export */ var order = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)(select => { return { - order: select('core/editor').getEditedPostAttribute('menu_order') - }; -}), Object(external_wp_data_["withDispatch"])(dispatch => ({ + order: select(store_store).getEditedPostAttribute('menu_order') + }; +}), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => ({ onUpdateOrder(order) { - dispatch('core/editor').editPost({ + dispatch(store_store).editPost({ menu_order: order }); } }))])(PageAttributesOrderWithChecks)); -// EXTERNAL MODULE: external ["wp","htmlEntities"] -var external_wp_htmlEntities_ = __webpack_require__("rmEH"); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/utils/terms.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/utils/terms.js /** * External dependencies */ @@ -5752,7 +6092,7 @@ /** * Returns terms in a tree form. * - * @param {Array} flatTerms Array of terms in flat format. + * @param {Array} flatTerms Array of terms in flat format. * * @return {Array} Array of terms in tree format. */ @@ -5765,7 +6105,7 @@ ...term }; }); - const termsByParent = Object(external_lodash_["groupBy"])(flatTermsWithParentAndChildren, 'parent'); + const termsByParent = (0,external_lodash_namespaceObject.groupBy)(flatTermsWithParentAndChildren, 'parent'); if (termsByParent.null && termsByParent.null.length) { return flatTermsWithParentAndChildren; @@ -5784,7 +6124,7 @@ } // Lodash unescape function handles ' but not ' which may be return in some API requests. const unescapeString = arg => { - return Object(external_lodash_["unescape"])(arg.replace(''', "'")); + return (0,external_lodash_namespaceObject.unescape)(arg.replace(''', "'")); }; /** * Returns a term object with name unescaped. @@ -5810,10 +6150,10 @@ */ const unescapeTerms = terms => { - return Object(external_lodash_["map"])(terms, unescapeTerm); + return (0,external_lodash_namespaceObject.map)(terms, unescapeTerm); }; -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/parent.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/parent.js /** @@ -5829,21 +6169,23 @@ + /** * Internal dependencies */ + function getTitle(post) { var _post$title; - return post !== null && post !== void 0 && (_post$title = post.title) !== null && _post$title !== void 0 && _post$title.rendered ? Object(external_wp_htmlEntities_["decodeEntities"])(post.title.rendered) : `#${post.id} (${Object(external_wp_i18n_["__"])('no title')})`; + return post !== null && post !== void 0 && (_post$title = post.title) !== null && _post$title !== void 0 && _post$title.rendered ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(post.title.rendered) : `#${post.id} (${(0,external_wp_i18n_namespaceObject.__)('no title')})`; } const getItemPriority = (name, searchValue) => { - const normalizedName = Object(external_lodash_["deburr"])(name).toLowerCase(); - const normalizedSearch = Object(external_lodash_["deburr"])(searchValue).toLowerCase(); + const normalizedName = (0,external_lodash_namespaceObject.deburr)(name).toLowerCase(); + const normalizedSearch = (0,external_lodash_namespaceObject.deburr)(searchValue).toLowerCase(); if (normalizedName === normalizedSearch) { return 0; @@ -5858,28 +6200,28 @@ function PageAttributesParent() { const { editPost - } = Object(external_wp_data_["useDispatch"])('core/editor'); - const [fieldValue, setFieldValue] = Object(external_wp_element_["useState"])(false); + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); + const [fieldValue, setFieldValue] = (0,external_wp_element_namespaceObject.useState)(false); const { parentPost, parentPostId, items, postType - } = Object(external_wp_data_["useSelect"])(select => { + } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getPostType, getEntityRecords, getEntityRecord - } = select('core'); + } = select(external_wp_coreData_namespaceObject.store); const { getCurrentPostId, getEditedPostAttribute - } = select('core/editor'); + } = select(store_store); const postTypeSlug = getEditedPostAttribute('type'); const pageId = getEditedPostAttribute('parent'); const pType = getPostType(postTypeSlug); const postId = getCurrentPostId(); - const isHierarchical = Object(external_lodash_["get"])(pType, ['hierarchical'], false); + const isHierarchical = (0,external_lodash_namespaceObject.get)(pType, ['hierarchical'], false); const query = { per_page: 100, exclude: postId, @@ -5900,22 +6242,25 @@ postType: pType }; }, [fieldValue]); - const isHierarchical = Object(external_lodash_["get"])(postType, ['hierarchical'], false); - const parentPageLabel = Object(external_lodash_["get"])(postType, ['labels', 'parent_item_colon']); + const isHierarchical = (0,external_lodash_namespaceObject.get)(postType, ['hierarchical'], false); + const parentPageLabel = (0,external_lodash_namespaceObject.get)(postType, ['labels', 'parent_item_colon']); const pageItems = items || []; - const parentOptions = Object(external_wp_element_["useMemo"])(() => { - const getOptionsFromTree = (tree, level = 0) => { + const parentOptions = (0,external_wp_element_namespaceObject.useMemo)(() => { + const getOptionsFromTree = function (tree) { + let level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; const mappedNodes = tree.map(treeNode => [{ value: treeNode.id, - label: Object(external_lodash_["repeat"])('— ', level) + Object(external_lodash_["unescape"])(treeNode.name), + label: (0,external_lodash_namespaceObject.repeat)('— ', level) + (0,external_lodash_namespaceObject.unescape)(treeNode.name), rawName: treeNode.name }, ...getOptionsFromTree(treeNode.children || [], level + 1)]); - const sortedNodes = mappedNodes.sort(([a], [b]) => { + const sortedNodes = mappedNodes.sort((_ref, _ref2) => { + let [a] = _ref; + let [b] = _ref2; const priorityA = getItemPriority(a.rawName, fieldValue); const priorityB = getItemPriority(b.rawName, fieldValue); return priorityA >= priorityB ? 1 : -1; }); - return Object(external_lodash_["flatten"])(sortedNodes); + return (0,external_lodash_namespaceObject.flatten)(sortedNodes); }; let tree = pageItems.map(item => ({ @@ -5930,7 +6275,7 @@ const opts = getOptionsFromTree(tree); // Ensure the current parent is in the options list. - const optsHasParent = Object(external_lodash_["find"])(opts, item => item.value === parentPostId); + const optsHasParent = (0,external_lodash_namespaceObject.find)(opts, item => item.value === parentPostId); if (parentPost && !optsHasParent) { opts.unshift({ @@ -5968,18 +6313,18 @@ }); }; - return Object(external_wp_element_["createElement"])(external_wp_components_["ComboboxControl"], { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ComboboxControl, { className: "editor-page-attributes__parent", label: parentPageLabel, value: parentPostId, options: parentOptions, - onFilterValueChange: Object(external_lodash_["debounce"])(handleKeydown, 300), + onFilterValueChange: (0,external_lodash_namespaceObject.debounce)(handleKeydown, 300), onChange: handleChange }); } /* harmony default export */ var page_attributes_parent = (PageAttributesParent); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-template/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-template/index.js /** @@ -5999,22 +6344,23 @@ */ -function PostTemplate({}) { +function PostTemplate(_ref) { + let {} = _ref; const { availableTemplates, selectedTemplate, isViewable - } = Object(external_wp_data_["useSelect"])(select => { + } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _getPostType$viewable, _getPostType; const { getEditedPostAttribute, getEditorSettings, getCurrentPostType - } = select(store); + } = select(store_store); const { getPostType - } = select(external_wp_coreData_["store"]); + } = select(external_wp_coreData_namespaceObject.store); return { selectedTemplate: getEditedPostAttribute('template'), availableTemplates: getEditorSettings().availableTemplates, @@ -6023,21 +6369,21 @@ }, []); const { editPost - } = Object(external_wp_data_["useDispatch"])(store); - - if (!isViewable || Object(external_lodash_["isEmpty"])(availableTemplates)) { + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); + + if (!isViewable || (0,external_lodash_namespaceObject.isEmpty)(availableTemplates)) { return null; } - return Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], { - label: Object(external_wp_i18n_["__"])('Template:'), + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Template:'), value: selectedTemplate, onChange: templateSlug => { editPost({ template: templateSlug || '' }); }, - options: Object(external_lodash_["map"])(availableTemplates, (templateName, templateSlug) => ({ + options: (0,external_lodash_namespaceObject.map)(availableTemplates, (templateName, templateSlug) => ({ value: templateSlug, label: templateName })) @@ -6045,7 +6391,16 @@ } /* harmony default export */ var post_template = (PostTemplate); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/combobox.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/constants.js +const AUTHORS_QUERY = { + who: 'authors', + per_page: 50, + _fields: 'id,name', + context: 'view' // Allows non-admins to perform requests. + +}; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/combobox.js /** @@ -6061,66 +6416,74 @@ + +/** + * Internal dependencies + */ + + + + function PostAuthorCombobox() { - const [fieldValue, setFieldValue] = Object(external_wp_element_["useState"])(); + const [fieldValue, setFieldValue] = (0,external_wp_element_namespaceObject.useState)(); const { authorId, isLoading, authors, postAuthor - } = Object(external_wp_data_["useSelect"])(select => { + } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { - __unstableGetAuthor, - getAuthors, + getUser, + getUsers, isResolving - } = select('core'); + } = select(external_wp_coreData_namespaceObject.store); const { getEditedPostAttribute - } = select('core/editor'); - - const author = __unstableGetAuthor(getEditedPostAttribute('author')); - - const query = !fieldValue || '' === fieldValue ? {} : { - search: fieldValue + } = select(store_store); + const author = getUser(getEditedPostAttribute('author'), { + context: 'view' + }); + const query = { ...AUTHORS_QUERY }; + + if (fieldValue) { + query.search = fieldValue; + } + return { authorId: getEditedPostAttribute('author'), postAuthor: author, - authors: getAuthors(query), - isLoading: isResolving('core', 'getAuthors', [query]) + authors: getUsers(query), + isLoading: isResolving('core', 'getUsers', [query]) }; }, [fieldValue]); const { editPost - } = Object(external_wp_data_["useDispatch"])('core/editor'); - const authorOptions = Object(external_wp_element_["useMemo"])(() => { + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); + const authorOptions = (0,external_wp_element_namespaceObject.useMemo)(() => { const fetchedAuthors = (authors !== null && authors !== void 0 ? authors : []).map(author => { return { value: author.id, - label: author.name + label: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(author.name) }; }); // Ensure the current author is included in the dropdown list. - const foundAuthor = fetchedAuthors.findIndex(({ - value - }) => (postAuthor === null || postAuthor === void 0 ? void 0 : postAuthor.id) === value); + const foundAuthor = fetchedAuthors.findIndex(_ref => { + let { + value + } = _ref; + return (postAuthor === null || postAuthor === void 0 ? void 0 : postAuthor.id) === value; + }); if (foundAuthor < 0 && postAuthor) { return [{ value: postAuthor.id, - label: postAuthor.name + label: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(postAuthor.name) }, ...fetchedAuthors]; } return fetchedAuthors; - }, [authors, postAuthor]); // Initializes the post author properly - // Also ensures external changes are reflected. - - Object(external_wp_element_["useEffect"])(() => { - if (postAuthor) { - setFieldValue(postAuthor.name); - } - }, [postAuthor]); + }, [authors, postAuthor]); /** * Handle author selection. * @@ -6151,11 +6514,11 @@ return null; } - return Object(external_wp_element_["createElement"])(external_wp_components_["ComboboxControl"], { - label: Object(external_wp_i18n_["__"])('Author'), + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ComboboxControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Author'), options: authorOptions, value: authorId, - onFilterValueChange: Object(external_lodash_["debounce"])(handleKeydown, 300), + onFilterValueChange: (0,external_lodash_namespaceObject.debounce)(handleKeydown, 300), onChange: handleSelect, isLoading: isLoading, allowReset: false @@ -6164,13 +6527,21 @@ /* harmony default export */ var combobox = (PostAuthorCombobox); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/select.js - - -/** - * WordPress dependencies - */ - +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/select.js + + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ @@ -6178,20 +6549,24 @@ function PostAuthorSelect() { const { editPost - } = Object(external_wp_data_["useDispatch"])('core/editor'); + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const { postAuthor, authors - } = Object(external_wp_data_["useSelect"])(select => { - const authorsFromAPI = select('core').getAuthors(); + } = (0,external_wp_data_namespaceObject.useSelect)(select => { return { - postAuthor: select('core/editor').getEditedPostAttribute('author'), - authors: authorsFromAPI.map(author => ({ - label: Object(external_wp_htmlEntities_["decodeEntities"])(author.name), - value: author.id - })) + postAuthor: select(store_store).getEditedPostAttribute('author'), + authors: select(external_wp_coreData_namespaceObject.store).getUsers(AUTHORS_QUERY) }; }, []); + const authorOptions = (0,external_wp_element_namespaceObject.useMemo)(() => { + return (authors !== null && authors !== void 0 ? authors : []).map(author => { + return { + value: author.id, + label: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(author.name) + }; + }); + }, [authors]); const setAuthorId = value => { const author = Number(value); @@ -6200,10 +6575,10 @@ }); }; - return Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { className: "post-author-selector", - label: Object(external_wp_i18n_["__"])('Author'), - options: authors, + label: (0,external_wp_i18n_namespaceObject.__)('Author'), + options: authorOptions, onChange: setAuthorId, value: postAuthor }); @@ -6211,7 +6586,7 @@ /* harmony default export */ var post_author_select = (PostAuthorSelect); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/index.js /** @@ -6225,25 +6600,25 @@ + const minimumUsersForCombobox = 25; function PostAuthor() { - const showCombobox = Object(external_wp_data_["useSelect"])(select => { - // Not using `getUsers()` because it requires `list_users` capability. - const authors = select(external_wp_coreData_["store"]).getAuthors(); + const showCombobox = (0,external_wp_data_namespaceObject.useSelect)(select => { + const authors = select(external_wp_coreData_namespaceObject.store).getUsers(AUTHORS_QUERY); return (authors === null || authors === void 0 ? void 0 : authors.length) >= minimumUsersForCombobox; }, []); if (showCombobox) { - return Object(external_wp_element_["createElement"])(combobox, null); - } - - return Object(external_wp_element_["createElement"])(post_author_select, null); + return (0,external_wp_element_namespaceObject.createElement)(combobox, null); + } + + return (0,external_wp_element_namespaceObject.createElement)(post_author_select, null); } /* harmony default export */ var post_author = (PostAuthor); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/check.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/check.js /** @@ -6261,103 +6636,121 @@ */ -function PostAuthorCheck({ - hasAssignAuthorAction, - authors, - children -}) { - if (!hasAssignAuthorAction || !authors || 1 >= authors.length) { + + +function PostAuthorCheck(_ref) { + let { + children + } = _ref; + const { + hasAssignAuthorAction, + hasAuthors + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const post = select(store_store).getCurrentPost(); + const authors = select(external_wp_coreData_namespaceObject.store).getUsers(AUTHORS_QUERY); + return { + hasAssignAuthorAction: (0,external_lodash_namespaceObject.get)(post, ['_links', 'wp:action-assign-author'], false), + hasAuthors: (authors === null || authors === void 0 ? void 0 : authors.length) >= 1 + }; + }, []); + + if (!hasAssignAuthorAction || !hasAuthors) { return null; } - return Object(external_wp_element_["createElement"])(post_type_support_check, { + return (0,external_wp_element_namespaceObject.createElement)(post_type_support_check, { supportKeys: "author" }, children); } -/* harmony default export */ var post_author_check = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => { - const post = select('core/editor').getCurrentPost(); - return { - hasAssignAuthorAction: Object(external_lodash_["get"])(post, ['_links', 'wp:action-assign-author'], false), - postType: select('core/editor').getCurrentPostType(), - authors: select('core').getAuthors() - }; -}), external_wp_compose_["withInstanceId"]])(PostAuthorCheck)); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-comments/index.js - - -/** - * WordPress dependencies - */ - - - - - -function PostComments({ - commentStatus = 'open', - ...props -}) { + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-comments/index.js + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + +function PostComments(_ref) { + let { + commentStatus = 'open', + ...props + } = _ref; + const onToggleComments = () => props.editPost({ comment_status: commentStatus === 'open' ? 'closed' : 'open' }); - return Object(external_wp_element_["createElement"])(external_wp_components_["CheckboxControl"], { - label: Object(external_wp_i18n_["__"])('Allow comments'), + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Allow comments'), checked: commentStatus === 'open', onChange: onToggleComments }); } -/* harmony default export */ var post_comments = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => { +/* harmony default export */ var post_comments = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)(select => { return { - commentStatus: select('core/editor').getEditedPostAttribute('comment_status') - }; -}), Object(external_wp_data_["withDispatch"])(dispatch => ({ - editPost: dispatch('core/editor').editPost + commentStatus: select(store_store).getEditedPostAttribute('comment_status') + }; +}), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => ({ + editPost: dispatch(store_store).editPost }))])(PostComments)); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-excerpt/index.js - - -/** - * WordPress dependencies - */ - - - - - -function PostExcerpt({ - excerpt, - onUpdateExcerpt -}) { - return Object(external_wp_element_["createElement"])("div", { +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-excerpt/index.js + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + +function PostExcerpt(_ref) { + let { + excerpt, + onUpdateExcerpt + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)("div", { className: "editor-post-excerpt" - }, Object(external_wp_element_["createElement"])(external_wp_components_["TextareaControl"], { - label: Object(external_wp_i18n_["__"])('Write an excerpt (optional)'), + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Write an excerpt (optional)'), className: "editor-post-excerpt__textarea", onChange: value => onUpdateExcerpt(value), value: excerpt - }), Object(external_wp_element_["createElement"])(external_wp_components_["ExternalLink"], { - href: Object(external_wp_i18n_["__"])('https://wordpress.org/support/article/excerpt/') - }, Object(external_wp_i18n_["__"])('Learn more about manual excerpts'))); -} - -/* harmony default export */ var post_excerpt = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => { + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { + href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/support/article/settings-sidebar/#excerpt') + }, (0,external_wp_i18n_namespaceObject.__)('Learn more about manual excerpts'))); +} + +/* harmony default export */ var post_excerpt = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)(select => { return { - excerpt: select('core/editor').getEditedPostAttribute('excerpt') - }; -}), Object(external_wp_data_["withDispatch"])(dispatch => ({ + excerpt: select(store_store).getEditedPostAttribute('excerpt') + }; +}), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => ({ onUpdateExcerpt(excerpt) { - dispatch('core/editor').editPost({ + dispatch(store_store).editPost({ excerpt }); } }))])(PostExcerpt)); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-excerpt/check.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-excerpt/check.js @@ -6367,14 +6760,14 @@ function PostExcerptCheck(props) { - return Object(external_wp_element_["createElement"])(post_type_support_check, Object(esm_extends["a" /* default */])({}, props, { + return (0,external_wp_element_namespaceObject.createElement)(post_type_support_check, _extends({}, props, { supportKeys: "excerpt" })); } /* harmony default export */ var post_excerpt_check = (PostExcerptCheck); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/theme-support-check/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/theme-support-check/index.js /** * External dependencies */ @@ -6384,20 +6777,27 @@ */ -function ThemeSupportCheck({ - themeSupports, - children, - postType, - supportKeys -}) { - const isSupported = Object(external_lodash_["some"])(Object(external_lodash_["castArray"])(supportKeys), key => { - const supported = Object(external_lodash_["get"])(themeSupports, [key], false); // 'post-thumbnails' can be boolean or an array of post types. + +/** + * Internal dependencies + */ + + +function ThemeSupportCheck(_ref) { + let { + themeSupports, + children, + postType, + supportKeys + } = _ref; + const isSupported = (0,external_lodash_namespaceObject.some)((0,external_lodash_namespaceObject.castArray)(supportKeys), key => { + const supported = (0,external_lodash_namespaceObject.get)(themeSupports, [key], false); // 'post-thumbnails' can be boolean or an array of post types. // In the latter case, we need to verify `postType` exists // within `supported`. If `postType` isn't passed, then the check // should fail. - if ('post-thumbnails' === key && Object(external_lodash_["isArray"])(supported)) { - return Object(external_lodash_["includes"])(supported, postType); + if ('post-thumbnails' === key && (0,external_lodash_namespaceObject.isArray)(supported)) { + return (0,external_lodash_namespaceObject.includes)(supported, postType); } return supported; @@ -6409,20 +6809,20 @@ return children; } -/* harmony default export */ var theme_support_check = (Object(external_wp_data_["withSelect"])(select => { +/* harmony default export */ var theme_support_check = ((0,external_wp_data_namespaceObject.withSelect)(select => { const { getThemeSupports - } = select('core'); + } = select(external_wp_coreData_namespaceObject.store); const { getEditedPostAttribute - } = select('core/editor'); + } = select(store_store); return { postType: getEditedPostAttribute('type'), themeSupports: getThemeSupports() }; })(ThemeSupportCheck)); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-featured-image/check.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-featured-image/check.js @@ -6433,16 +6833,16 @@ function PostFeaturedImageCheck(props) { - return Object(external_wp_element_["createElement"])(theme_support_check, { + return (0,external_wp_element_namespaceObject.createElement)(theme_support_check, { supportKeys: "post-thumbnails" - }, Object(external_wp_element_["createElement"])(post_type_support_check, Object(esm_extends["a" /* default */])({}, props, { + }, (0,external_wp_element_namespaceObject.createElement)(post_type_support_check, _extends({}, props, { supportKeys: "thumbnail" }))); } /* harmony default export */ var post_featured_image_check = (PostFeaturedImageCheck); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-featured-image/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-featured-image/index.js /** @@ -6459,54 +6859,57 @@ + /** * Internal dependencies */ + const ALLOWED_MEDIA_TYPES = ['image']; // Used when labels from post type were not yet loaded or when they are not present. -const DEFAULT_FEATURE_IMAGE_LABEL = Object(external_wp_i18n_["__"])('Featured image'); - -const DEFAULT_SET_FEATURE_IMAGE_LABEL = Object(external_wp_i18n_["__"])('Set featured image'); - -const DEFAULT_REMOVE_FEATURE_IMAGE_LABEL = Object(external_wp_i18n_["__"])('Remove image'); - -function PostFeaturedImage({ - currentPostId, - featuredImageId, - onUpdateImage, - onDropImage, - onRemoveImage, - media, - postType, - noticeUI -}) { +const DEFAULT_FEATURE_IMAGE_LABEL = (0,external_wp_i18n_namespaceObject.__)('Featured image'); + +const DEFAULT_SET_FEATURE_IMAGE_LABEL = (0,external_wp_i18n_namespaceObject.__)('Set featured image'); + +const DEFAULT_REMOVE_FEATURE_IMAGE_LABEL = (0,external_wp_i18n_namespaceObject.__)('Remove image'); + +function PostFeaturedImage(_ref) { var _media$media_details$, _media$media_details$2; - const postLabel = Object(external_lodash_["get"])(postType, ['labels'], {}); - const instructions = Object(external_wp_element_["createElement"])("p", null, Object(external_wp_i18n_["__"])('To edit the featured image, you need permission to upload media.')); + let { + currentPostId, + featuredImageId, + onUpdateImage, + onDropImage, + onRemoveImage, + media, + postType, + noticeUI + } = _ref; + const postLabel = (0,external_lodash_namespaceObject.get)(postType, ['labels'], {}); + const instructions = (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('To edit the featured image, you need permission to upload media.')); let mediaWidth, mediaHeight, mediaSourceUrl; if (media) { - const mediaSize = Object(external_wp_hooks_["applyFilters"])('editor.PostFeaturedImage.imageSize', 'post-thumbnail', media.id, currentPostId); - - if (Object(external_lodash_["has"])(media, ['media_details', 'sizes', mediaSize])) { - // use mediaSize when available + const mediaSize = (0,external_wp_hooks_namespaceObject.applyFilters)('editor.PostFeaturedImage.imageSize', 'post-thumbnail', media.id, currentPostId); + + if ((0,external_lodash_namespaceObject.has)(media, ['media_details', 'sizes', mediaSize])) { + // Use mediaSize when available. mediaWidth = media.media_details.sizes[mediaSize].width; mediaHeight = media.media_details.sizes[mediaSize].height; mediaSourceUrl = media.media_details.sizes[mediaSize].source_url; } else { - // get fallbackMediaSize if mediaSize is not available - const fallbackMediaSize = Object(external_wp_hooks_["applyFilters"])('editor.PostFeaturedImage.imageSize', 'thumbnail', media.id, currentPostId); - - if (Object(external_lodash_["has"])(media, ['media_details', 'sizes', fallbackMediaSize])) { - // use fallbackMediaSize when mediaSize is not available + // Get fallbackMediaSize if mediaSize is not available. + const fallbackMediaSize = (0,external_wp_hooks_namespaceObject.applyFilters)('editor.PostFeaturedImage.imageSize', 'thumbnail', media.id, currentPostId); + + if ((0,external_lodash_namespaceObject.has)(media, ['media_details', 'sizes', fallbackMediaSize])) { + // Use fallbackMediaSize when mediaSize is not available. mediaWidth = media.media_details.sizes[fallbackMediaSize].width; mediaHeight = media.media_details.sizes[fallbackMediaSize].height; mediaSourceUrl = media.media_details.sizes[fallbackMediaSize].source_url; } else { - // use full image size when mediaFallbackSize and mediaSize are not available + // Use full image size when mediaFallbackSize and mediaSize are not available. mediaWidth = media.media_details.width; mediaHeight = media.media_details.height; mediaSourceUrl = media.source_url; @@ -6514,85 +6917,95 @@ } } - return Object(external_wp_element_["createElement"])(post_featured_image_check, null, noticeUI, Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)(post_featured_image_check, null, noticeUI, (0,external_wp_element_namespaceObject.createElement)("div", { className: "editor-post-featured-image" - }, media && Object(external_wp_element_["createElement"])("div", { + }, media && (0,external_wp_element_namespaceObject.createElement)("div", { id: `editor-post-featured-image-${featuredImageId}-describedby`, className: "hidden" - }, media.alt_text && Object(external_wp_i18n_["sprintf"])( // Translators: %s: The selected image alt text. - Object(external_wp_i18n_["__"])('Current image: %s'), media.alt_text), !media.alt_text && Object(external_wp_i18n_["sprintf"])( // Translators: %s: The selected image filename. - Object(external_wp_i18n_["__"])('The current image has no alternative text. The file name is: %s'), ((_media$media_details$ = media.media_details.sizes) === null || _media$media_details$ === void 0 ? void 0 : (_media$media_details$2 = _media$media_details$.full) === null || _media$media_details$2 === void 0 ? void 0 : _media$media_details$2.file) || media.slug)), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaUploadCheck"], { + }, media.alt_text && (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s: The selected image alt text. + (0,external_wp_i18n_namespaceObject.__)('Current image: %s'), media.alt_text), !media.alt_text && (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s: The selected image filename. + (0,external_wp_i18n_namespaceObject.__)('The current image has no alternative text. The file name is: %s'), ((_media$media_details$ = media.media_details.sizes) === null || _media$media_details$ === void 0 ? void 0 : (_media$media_details$2 = _media$media_details$.full) === null || _media$media_details$2 === void 0 ? void 0 : _media$media_details$2.file) || media.slug)), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, { fallback: instructions - }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaUpload"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, { title: postLabel.featured_image || DEFAULT_FEATURE_IMAGE_LABEL, onSelect: onUpdateImage, unstableFeaturedImageFlow: true, allowedTypes: ALLOWED_MEDIA_TYPES, modalClass: "editor-post-featured-image__media-modal", - render: ({ - open - }) => Object(external_wp_element_["createElement"])("div", { - className: "editor-post-featured-image__container" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - className: !featuredImageId ? 'editor-post-featured-image__toggle' : 'editor-post-featured-image__preview', - onClick: open, - "aria-label": !featuredImageId ? null : Object(external_wp_i18n_["__"])('Edit or update the image'), - "aria-describedby": !featuredImageId ? null : `editor-post-featured-image-${featuredImageId}-describedby` - }, !!featuredImageId && media && Object(external_wp_element_["createElement"])(external_wp_components_["ResponsiveWrapper"], { - naturalWidth: mediaWidth, - naturalHeight: mediaHeight, - isInline: true - }, Object(external_wp_element_["createElement"])("img", { - src: mediaSourceUrl, - alt: "" - })), !!featuredImageId && !media && Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null), !featuredImageId && (postLabel.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL)), Object(external_wp_element_["createElement"])(external_wp_components_["DropZone"], { - onFilesDrop: onDropImage - })), + render: _ref2 => { + let { + open + } = _ref2; + return (0,external_wp_element_namespaceObject.createElement)("div", { + className: "editor-post-featured-image__container" + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + className: !featuredImageId ? 'editor-post-featured-image__toggle' : 'editor-post-featured-image__preview', + onClick: open, + "aria-label": !featuredImageId ? null : (0,external_wp_i18n_namespaceObject.__)('Edit or update the image'), + "aria-describedby": !featuredImageId ? null : `editor-post-featured-image-${featuredImageId}-describedby` + }, !!featuredImageId && media && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResponsiveWrapper, { + naturalWidth: mediaWidth, + naturalHeight: mediaHeight, + isInline: true + }, (0,external_wp_element_namespaceObject.createElement)("img", { + src: mediaSourceUrl, + alt: "" + })), !!featuredImageId && !media && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), !featuredImageId && (postLabel.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropZone, { + onFilesDrop: onDropImage + })); + }, value: featuredImageId - })), !!featuredImageId && media && !media.isLoading && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaUploadCheck"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaUpload"], { + })), !!featuredImageId && media && !media.isLoading && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, { title: postLabel.featured_image || DEFAULT_FEATURE_IMAGE_LABEL, onSelect: onUpdateImage, unstableFeaturedImageFlow: true, allowedTypes: ALLOWED_MEDIA_TYPES, modalClass: "editor-post-featured-image__media-modal", - render: ({ - open - }) => Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - onClick: open, - isSecondary: true - }, Object(external_wp_i18n_["__"])('Replace Image')) - })), !!featuredImageId && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaUploadCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { + render: _ref3 => { + let { + open + } = _ref3; + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + onClick: open, + variant: "secondary" + }, (0,external_wp_i18n_namespaceObject.__)('Replace Image')); + } + })), !!featuredImageId && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { onClick: onRemoveImage, - isLink: true, + variant: "link", isDestructive: true }, postLabel.remove_featured_image || DEFAULT_REMOVE_FEATURE_IMAGE_LABEL)))); } -const applyWithSelect = Object(external_wp_data_["withSelect"])(select => { +const applyWithSelect = (0,external_wp_data_namespaceObject.withSelect)(select => { const { getMedia, getPostType - } = select('core'); + } = select(external_wp_coreData_namespaceObject.store); const { getCurrentPostId, getEditedPostAttribute - } = select('core/editor'); + } = select(store_store); const featuredImageId = getEditedPostAttribute('featured_media'); return { - media: featuredImageId ? getMedia(featuredImageId) : null, + media: featuredImageId ? getMedia(featuredImageId, { + context: 'view' + }) : null, currentPostId: getCurrentPostId(), postType: getPostType(getEditedPostAttribute('type')), featuredImageId }; }); -const applyWithDispatch = Object(external_wp_data_["withDispatch"])((dispatch, { - noticeOperations -}, { - select -}) => { +const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, _ref4, _ref5) => { + let { + noticeOperations + } = _ref4; + let { + select + } = _ref5; const { editPost - } = dispatch('core/editor'); + } = dispatch(store_store); return { onUpdateImage(image) { editPost({ @@ -6601,11 +7014,12 @@ }, onDropImage(filesList) { - select(external_wp_blockEditor_["store"]).getSettings().mediaUpload({ + select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload({ allowedTypes: ['image'], filesList, - onFileChange([image]) { + onFileChange(_ref6) { + let [image] = _ref6; editPost({ featured_media: image.id }); @@ -6627,9 +7041,9 @@ }; }); -/* harmony default export */ var post_featured_image = (Object(external_wp_compose_["compose"])(external_wp_components_["withNotices"], applyWithSelect, applyWithDispatch, Object(external_wp_components_["withFilters"])('editor.PostFeaturedImage'))(PostFeaturedImage)); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-format/check.js +/* harmony default export */ var post_featured_image = ((0,external_wp_compose_namespaceObject.compose)(external_wp_components_namespaceObject.withNotices, applyWithSelect, applyWithDispatch, (0,external_wp_components_namespaceObject.withFilters)('editor.PostFeaturedImage'))(PostFeaturedImage)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-format/check.js @@ -6643,23 +7057,25 @@ -function PostFormatCheck({ - disablePostFormats, - ...props -}) { - return !disablePostFormats && Object(external_wp_element_["createElement"])(post_type_support_check, Object(esm_extends["a" /* default */])({}, props, { + +function PostFormatCheck(_ref) { + let { + disablePostFormats, + ...props + } = _ref; + return !disablePostFormats && (0,external_wp_element_namespaceObject.createElement)(post_type_support_check, _extends({}, props, { supportKeys: "post-formats" })); } -/* harmony default export */ var post_format_check = (Object(external_wp_data_["withSelect"])(select => { - const editorSettings = select('core/editor').getEditorSettings(); +/* harmony default export */ var post_format_check = ((0,external_wp_data_namespaceObject.withSelect)(select => { + const editorSettings = select(store_store).getEditorSettings(); return { disablePostFormats: editorSettings.disablePostFormats }; })(PostFormatCheck)); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-format/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-format/index.js /** @@ -6674,42 +7090,44 @@ + /** * Internal dependencies */ + // All WP post formats, sorted alphabetically by translated name. const POST_FORMATS = [{ id: 'aside', - caption: Object(external_wp_i18n_["__"])('Aside') + caption: (0,external_wp_i18n_namespaceObject.__)('Aside') }, { id: 'audio', - caption: Object(external_wp_i18n_["__"])('Audio') + caption: (0,external_wp_i18n_namespaceObject.__)('Audio') }, { id: 'chat', - caption: Object(external_wp_i18n_["__"])('Chat') + caption: (0,external_wp_i18n_namespaceObject.__)('Chat') }, { id: 'gallery', - caption: Object(external_wp_i18n_["__"])('Gallery') + caption: (0,external_wp_i18n_namespaceObject.__)('Gallery') }, { id: 'image', - caption: Object(external_wp_i18n_["__"])('Image') + caption: (0,external_wp_i18n_namespaceObject.__)('Image') }, { id: 'link', - caption: Object(external_wp_i18n_["__"])('Link') + caption: (0,external_wp_i18n_namespaceObject.__)('Link') }, { id: 'quote', - caption: Object(external_wp_i18n_["__"])('Quote') + caption: (0,external_wp_i18n_namespaceObject.__)('Quote') }, { id: 'standard', - caption: Object(external_wp_i18n_["__"])('Standard') + caption: (0,external_wp_i18n_namespaceObject.__)('Standard') }, { id: 'status', - caption: Object(external_wp_i18n_["__"])('Status') + caption: (0,external_wp_i18n_namespaceObject.__)('Status') }, { id: 'video', - caption: Object(external_wp_i18n_["__"])('Video') + caption: (0,external_wp_i18n_namespaceObject.__)('Video') }].sort((a, b) => { const normalizedA = a.caption.toUpperCase(); const normalizedB = b.caption.toUpperCase(); @@ -6725,46 +7143,48 @@ return 0; }); function PostFormat() { - const instanceId = Object(external_wp_compose_["useInstanceId"])(PostFormat); + const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostFormat); const postFormatSelectorId = `post-format-selector-${instanceId}`; const { postFormat, suggestedFormat, supportedFormats - } = Object(external_wp_data_["useSelect"])(select => { + } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedPostAttribute, getSuggestedPostFormat - } = select('core/editor'); + } = select(store_store); const _postFormat = getEditedPostAttribute('format'); - const themeSupports = select('core').getThemeSupports(); + const themeSupports = select(external_wp_coreData_namespaceObject.store).getThemeSupports(); return { postFormat: _postFormat !== null && _postFormat !== void 0 ? _postFormat : 'standard', suggestedFormat: getSuggestedPostFormat(), - // Ensure current format is always in the set. - // The current format may not be a format supported by the theme. - supportedFormats: Object(external_lodash_["union"])([_postFormat], Object(external_lodash_["get"])(themeSupports, ['formats'], [])) + supportedFormats: themeSupports.formats }; }, []); - const formats = POST_FORMATS.filter(format => Object(external_lodash_["includes"])(supportedFormats, format.id)); - const suggestion = Object(external_lodash_["find"])(formats, format => format.id === suggestedFormat); + const formats = POST_FORMATS.filter(format => { + // Ensure current format is always in the set. + // The current format may not be a format supported by the theme. + return (0,external_lodash_namespaceObject.includes)(supportedFormats, format.id) || postFormat === format.id; + }); + const suggestion = (0,external_lodash_namespaceObject.find)(formats, format => format.id === suggestedFormat); const { editPost - } = Object(external_wp_data_["useDispatch"])('core/editor'); + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const onUpdatePostFormat = format => editPost({ format }); - return Object(external_wp_element_["createElement"])(post_format_check, null, Object(external_wp_element_["createElement"])("div", { + return (0,external_wp_element_namespaceObject.createElement)(post_format_check, null, (0,external_wp_element_namespaceObject.createElement)("div", { className: "editor-post-format" - }, Object(external_wp_element_["createElement"])("div", { + }, (0,external_wp_element_namespaceObject.createElement)("div", { className: "editor-post-format__content" - }, Object(external_wp_element_["createElement"])("label", { + }, (0,external_wp_element_namespaceObject.createElement)("label", { htmlFor: postFormatSelectorId - }, Object(external_wp_i18n_["__"])('Post Format')), Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], { + }, (0,external_wp_i18n_namespaceObject.__)('Post Format')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { value: postFormat, onChange: format => onUpdatePostFormat(format), id: postFormatSelectorId, @@ -6772,30 +7192,32 @@ label: format.caption, value: format.id })) - })), suggestion && suggestion.id !== postFormat && Object(external_wp_element_["createElement"])("div", { + })), suggestion && suggestion.id !== postFormat && (0,external_wp_element_namespaceObject.createElement)("div", { className: "editor-post-format__suggestion" - }, Object(external_wp_i18n_["__"])('Suggestion:'), ' ', Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - isLink: true, + }, (0,external_wp_i18n_namespaceObject.__)('Suggestion:'), ' ', (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + variant: "link", onClick: () => onUpdatePostFormat(suggestion.id) - }, suggestion.caption)))); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/backup.js - - -/** - * WordPress dependencies - */ - -const backup = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { + }, (0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %s: post format */ + (0,external_wp_i18n_namespaceObject.__)('Apply format: %s'), suggestion.caption))))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/backup.js + + +/** + * WordPress dependencies + */ + +const backup = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z" })); /* harmony default export */ var library_backup = (backup); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-last-revision/check.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-last-revision/check.js /** @@ -6807,31 +7229,334 @@ */ -function PostLastRevisionCheck({ - lastRevisionId, - revisionsCount, - children -}) { + +function PostLastRevisionCheck(_ref) { + let { + lastRevisionId, + revisionsCount, + children + } = _ref; + if (!lastRevisionId || revisionsCount < 2) { return null; } - return Object(external_wp_element_["createElement"])(post_type_support_check, { + return (0,external_wp_element_namespaceObject.createElement)(post_type_support_check, { supportKeys: "revisions" }, children); } -/* harmony default export */ var post_last_revision_check = (Object(external_wp_data_["withSelect"])(select => { +/* harmony default export */ var post_last_revision_check = ((0,external_wp_data_namespaceObject.withSelect)(select => { const { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount - } = select('core/editor'); + } = select(store_store); return { lastRevisionId: getCurrentPostLastRevisionId(), revisionsCount: getCurrentPostRevisionsCount() }; })(PostLastRevisionCheck)); -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-last-revision/index.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-last-revision/index.js + + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + +function LastRevision(_ref) { + let { + lastRevisionId, + revisionsCount + } = _ref; + return (0,external_wp_element_namespaceObject.createElement)(post_last_revision_check, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + href: (0,external_wp_url_namespaceObject.addQueryArgs)('revision.php', { + revision: lastRevisionId, + gutenberg: true + }), + className: "editor-post-last-revision__title", + icon: library_backup + }, (0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %d: number of revisions */ + (0,external_wp_i18n_namespaceObject._n)('%d Revision', '%d Revisions', revisionsCount), revisionsCount))); +} + +/* harmony default export */ var post_last_revision = ((0,external_wp_data_namespaceObject.withSelect)(select => { + const { + getCurrentPostLastRevisionId, + getCurrentPostRevisionsCount + } = select(store_store); + return { + lastRevisionId: getCurrentPostLastRevisionId(), + revisionsCount: getCurrentPostRevisionsCount() + }; +})(LastRevision)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-locked-modal/index.js + + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + + + + +/** + * Internal dependencies + */ + + +function PostLockedModal() { + const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostLockedModal); + const hookName = 'core/editor/post-locked-modal-' + instanceId; + const { + autosave, + updatePostLock + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); + const { + isLocked, + isTakeover, + user, + postId, + postLockUtils, + activePostLock, + postType, + previewLink + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + isPostLocked, + isPostLockTakeover, + getPostLockUser, + getCurrentPostId, + getActivePostLock, + getEditedPostAttribute, + getEditedPostPreviewLink, + getEditorSettings + } = select(store_store); + const { + getPostType + } = select(external_wp_coreData_namespaceObject.store); + return { + isLocked: isPostLocked(), + isTakeover: isPostLockTakeover(), + user: getPostLockUser(), + postId: getCurrentPostId(), + postLockUtils: getEditorSettings().postLockUtils, + activePostLock: getActivePostLock(), + postType: getPostType(getEditedPostAttribute('type')), + previewLink: getEditedPostPreviewLink() + }; + }, []); + (0,external_wp_element_namespaceObject.useEffect)(() => { + /** + * Keep the lock refreshed. + * + * When the user does not send a heartbeat in a heartbeat-tick + * the user is no longer editing and another user can start editing. + * + * @param {Object} data Data to send in the heartbeat request. + */ + function sendPostLock(data) { + if (isLocked) { + return; + } + + data['wp-refresh-post-lock'] = { + lock: activePostLock, + post_id: postId + }; + } + /** + * Refresh post locks: update the lock string or show the dialog if somebody has taken over editing. + * + * @param {Object} data Data received in the heartbeat request + */ + + + function receivePostLock(data) { + if (!data['wp-refresh-post-lock']) { + return; + } + + const received = data['wp-refresh-post-lock']; + + if (received.lock_error) { + // Auto save and display the takeover modal. + autosave(); + updatePostLock({ + isLocked: true, + isTakeover: true, + user: { + name: received.lock_error.name, + avatar: received.lock_error.avatar_src_2x + } + }); + } else if (received.new_lock) { + updatePostLock({ + isLocked: false, + activePostLock: received.new_lock + }); + } + } + /** + * Unlock the post before the window is exited. + */ + + + function releasePostLock() { + if (isLocked || !activePostLock) { + return; + } + + const data = new window.FormData(); + data.append('action', 'wp-remove-post-lock'); + data.append('_wpnonce', postLockUtils.unlockNonce); + data.append('post_ID', postId); + data.append('active_post_lock', activePostLock); + + if (window.navigator.sendBeacon) { + window.navigator.sendBeacon(postLockUtils.ajaxUrl, data); + } else { + const xhr = new window.XMLHttpRequest(); + xhr.open('POST', postLockUtils.ajaxUrl, false); + xhr.send(data); + } + } // Details on these events on the Heartbeat API docs + // https://developer.wordpress.org/plugins/javascript/heartbeat-api/ + + + (0,external_wp_hooks_namespaceObject.addAction)('heartbeat.send', hookName, sendPostLock); + (0,external_wp_hooks_namespaceObject.addAction)('heartbeat.tick', hookName, receivePostLock); + window.addEventListener('beforeunload', releasePostLock); + return () => { + (0,external_wp_hooks_namespaceObject.removeAction)('heartbeat.send', hookName); + (0,external_wp_hooks_namespaceObject.removeAction)('heartbeat.tick', hookName); + window.removeEventListener('beforeunload', releasePostLock); + }; + }, []); + + if (!isLocked) { + return null; + } + + const userDisplayName = user.name; + const userAvatar = user.avatar; + const unlockUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('post.php', { + 'get-post-lock': '1', + lockKey: true, + post: postId, + action: 'edit', + _wpnonce: postLockUtils.nonce + }); + const allPostsUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { + post_type: (0,external_lodash_namespaceObject.get)(postType, ['slug']) + }); + + const allPostsLabel = (0,external_wp_i18n_namespaceObject.__)('Exit editor'); + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, { + title: isTakeover ? (0,external_wp_i18n_namespaceObject.__)('Someone else has taken over this post') : (0,external_wp_i18n_namespaceObject.__)('This post is already being edited'), + focusOnMount: true, + shouldCloseOnClickOutside: false, + shouldCloseOnEsc: false, + isDismissible: false, + className: "editor-post-locked-modal" + }, !!userAvatar && (0,external_wp_element_namespaceObject.createElement)("img", { + src: userAvatar, + alt: (0,external_wp_i18n_namespaceObject.__)('Avatar'), + className: "editor-post-locked-modal__avatar", + width: 64, + height: 64 + }), (0,external_wp_element_namespaceObject.createElement)("div", null, !!isTakeover && (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_element_namespaceObject.createInterpolateElement)(userDisplayName ? (0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %s: user's display name */ + (0,external_wp_i18n_namespaceObject.__)('%s now has editing control of this posts (). Don’t worry, your changes up to this moment have been saved.'), userDisplayName) : (0,external_wp_i18n_namespaceObject.__)('Another user now has editing control of this post (). Don’t worry, your changes up to this moment have been saved.'), { + strong: (0,external_wp_element_namespaceObject.createElement)("strong", null), + PreviewLink: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { + href: previewLink + }, (0,external_wp_i18n_namespaceObject.__)('preview')) + })), !isTakeover && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_element_namespaceObject.createInterpolateElement)(userDisplayName ? (0,external_wp_i18n_namespaceObject.sprintf)( + /* translators: %s: user's display name */ + (0,external_wp_i18n_namespaceObject.__)('%s is currently working on this post (), which means you cannot make changes, unless you take over.'), userDisplayName) : (0,external_wp_i18n_namespaceObject.__)('Another user is currently working on this post (), which means you cannot make changes, unless you take over.'), { + strong: (0,external_wp_element_namespaceObject.createElement)("strong", null), + PreviewLink: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { + href: previewLink + }, (0,external_wp_i18n_namespaceObject.__)('preview')) + })), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('If you take over, the other user will lose editing control to the post, but their changes will be saved.'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, { + className: "editor-post-locked-modal__buttons", + justify: "flex-end", + expanded: false + }, !isTakeover && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + variant: "tertiary", + href: unlockUrl + }, (0,external_wp_i18n_namespaceObject.__)('Take over'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { + variant: "primary", + href: allPostsUrl + }, allPostsLabel))))); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-pending-status/check.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + +function PostPendingStatusCheck(_ref) { + let { + hasPublishAction, + isPublished, + children + } = _ref; + + if (isPublished || !hasPublishAction) { + return null; + } + + return children; +} +/* harmony default export */ var post_pending_status_check = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)(select => { + const { + isCurrentPostPublished, + getCurrentPostType, + getCurrentPost + } = select(store_store); + return { + hasPublishAction: (0,external_lodash_namespaceObject.get)(getCurrentPost(), ['_links', 'wp:action-publish'], false), + isPublished: isCurrentPostPublished(), + postType: getCurrentPostType() + }; +}))(PostPendingStatusCheck)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-pending-status/index.js /** @@ -6847,35 +7572,76 @@ - -function LastRevision({ - lastRevisionId, - revisionsCount -}) { - return Object(external_wp_element_["createElement"])(post_last_revision_check, null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { - href: getWPAdminURL('revision.php', { - revision: lastRevisionId, - gutenberg: true - }), - className: "editor-post-last-revision__title", - icon: library_backup - }, Object(external_wp_i18n_["sprintf"])( - /* translators: %d: number of revisions */ - Object(external_wp_i18n_["_n"])('%d Revision', '%d Revisions', revisionsCount), revisionsCount))); -} - -/* harmony default export */ var post_last_revision = (Object(external_wp_data_["withSelect"])(select => { - const { - getCurrentPostLastRevisionId, - getCurrentPostRevisionsCount - } = select('core/editor'); +function PostPendingStatus(_ref) { + let { + status, + onUpdateStatus + } = _ref; + + const togglePendingStatus = () => { + const updatedStatus = status === 'pending' ? 'draft' : 'pending'; + onUpdateStatus(updatedStatus); + }; + + return (0,external_wp_element_namespaceObject.createElement)(post_pending_status_check, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Pending review'), + checked: status === 'pending', + onChange: togglePendingStatus + })); +} +/* harmony default export */ var post_pending_status = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)(select => ({ + status: select(store_store).getEditedPostAttribute('status') +})), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => ({ + onUpdateStatus(status) { + dispatch(store_store).editPost({ + status + }); + } + +})))(PostPendingStatus)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-pingbacks/index.js + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + +function PostPingbacks(_ref) { + let { + pingStatus = 'open', + ...props + } = _ref; + + const onTogglePingback = () => props.editPost({ + ping_status: pingStatus === 'open' ? 'closed' : 'open' + }); + + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Allow pingbacks & trackbacks'), + checked: pingStatus === 'open', + onChange: onTogglePingback + }); +} + +/* harmony default export */ var post_pingbacks = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)(select => { return { - lastRevisionId: getCurrentPostLastRevisionId(), - revisionsCount: getCurrentPostRevisionsCount() - }; -})(LastRevision)); - -// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-preview-button/index.js + pingStatus: select(store_store).getEditedPostAttribute('ping_status') + }; +}), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => ({ + editPost: dispatch(store_store).editPost +}))])(PostPingbacks)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-preview-button/index.js /** @@ -6894,21 +7660,27 @@ +/** + * Internal dependencies + */ + + + function writeInterstitialMessage(targetDocument) { - let markup = Object(external_wp_element_["renderToString"])(Object(external_wp_element_["createElement"])("div", { + let markup = (0,external_wp_element_namespaceObject.renderToString)((0,external_wp_element_namespaceObject.createElement)("div", { className: "editor-post-preview-button__interstitial-message" - }, Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 96 96" - }, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { className: "outer", d: "M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36", fill: "none" - }), Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { className: "inner", d: "M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z", fill: "none" - })), Object(external_wp_element_["createElement"])("p", null, Object(external_wp_i18n_["__"])('Generating preview…')))); + })), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Generating preview…')))); markup += `