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 = "./node_modules/@wordpress/editor/build-module/index.js"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js ***! \*******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _arrayWithHoles; }); function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js": /*!**********************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js ***! \**********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _arrayWithoutHoles; }); function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js": /*!**************************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js ***! \**************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _assertThisInitialized; }); function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js": /*!*********************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js ***! \*********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _asyncToGenerator; }); function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js ***! \*******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _classCallCheck; }); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/createClass.js": /*!****************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/createClass.js ***! \****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _createClass; }); function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/defineProperty.js ***! \*******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _defineProperty; }); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/extends.js": /*!************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/extends.js ***! \************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _extends; }); function _extends() { _extends = Object.assign || 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]; } } } return target; }; return _extends.apply(this, arguments); } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js ***! \*******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _getPrototypeOf; }); function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/inherits.js": /*!*************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/inherits.js ***! \*************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _inherits; }); /* harmony import */ var _setPrototypeOf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js"); function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Object(_setPrototypeOf__WEBPACK_IMPORTED_MODULE_0__["default"])(subClass, superClass); } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/iterableToArray.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js ***! \********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _iterableToArray; }); function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js": /*!*************************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js ***! \*************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _iterableToArrayLimit; }); function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js ***! \********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _nonIterableRest; }); function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js": /*!**********************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js ***! \**********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _nonIterableSpread; }); function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js": /*!*****************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/objectSpread.js ***! \*****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectSpread; }); /* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }); } return target; } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js": /*!****************************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js ***! \****************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectWithoutProperties; }); /* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"); function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js": /*!*********************************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js ***! \*********************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectWithoutPropertiesLoose; }); function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js": /*!******************************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js ***! \******************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _possibleConstructorReturn; }); /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js"); /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); function _possibleConstructorReturn(self, call) { if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(call) === "object" || typeof call === "function")) { return call; } return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__["default"])(self); } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js ***! \*******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _setPrototypeOf; }); function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js": /*!******************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js ***! \******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _slicedToArray; }); /* harmony import */ var _arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithHoles */ "./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js"); /* harmony import */ var _iterableToArrayLimit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArrayLimit */ "./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js"); /* harmony import */ var _nonIterableRest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nonIterableRest */ "./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js"); function _slicedToArray(arr, i) { return Object(_arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || Object(_iterableToArrayLimit__WEBPACK_IMPORTED_MODULE_1__["default"])(arr, i) || Object(_nonIterableRest__WEBPACK_IMPORTED_MODULE_2__["default"])(); } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js": /*!**********************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js ***! \**********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _toConsumableArray; }); /* harmony import */ var _arrayWithoutHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithoutHoles */ "./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js"); /* harmony import */ var _iterableToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArray */ "./node_modules/@babel/runtime/helpers/esm/iterableToArray.js"); /* harmony import */ var _nonIterableSpread__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nonIterableSpread */ "./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js"); function _toConsumableArray(arr) { return Object(_arrayWithoutHoles__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || Object(_iterableToArray__WEBPACK_IMPORTED_MODULE_1__["default"])(arr) || Object(_nonIterableSpread__WEBPACK_IMPORTED_MODULE_2__["default"])(); } /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/typeof.js": /*!***********************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/typeof.js ***! \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _typeof; }); function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); } function _typeof(obj) { if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") { _typeof = function _typeof(obj) { return _typeof2(obj); }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); }; } return _typeof(obj); } /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/alignment-toolbar/index.js": /*!*******************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/alignment-toolbar/index.js ***! \*******************************************************************************************/ /*! exports provided: AlignmentToolbar, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AlignmentToolbar", function() { return AlignmentToolbar; }); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/viewport */ "@wordpress/viewport"); /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var ALIGNMENT_CONTROLS = [{ icon: 'editor-alignleft', title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Align left'), align: 'left' }, { icon: 'editor-aligncenter', title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Align center'), align: 'center' }, { icon: 'editor-alignright', title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Align right'), align: 'right' }]; function AlignmentToolbar(_ref) { var isCollapsed = _ref.isCollapsed, value = _ref.value, onChange = _ref.onChange; function applyOrUnset(align) { return function () { return onChange(value === align ? undefined : align); }; } var activeAlignment = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["find"])(ALIGNMENT_CONTROLS, function (control) { return control.align === value; }); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Toolbar"], { isCollapsed: isCollapsed, icon: activeAlignment ? activeAlignment.icon : 'editor-alignleft', label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Change Text Alignment'), controls: ALIGNMENT_CONTROLS.map(function (control) { var align = control.align; var isActive = value === align; return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, control, { isActive: isActive, onClick: applyOrUnset(align) }); }) }); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__["compose"])(Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_8__["withBlockEditContext"])(function (_ref2) { var clientId = _ref2.clientId; return { clientId: clientId }; }), Object(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_5__["withViewportMatch"])({ isLargeViewport: 'medium' }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withSelect"])(function (select, _ref3) { var clientId = _ref3.clientId, isLargeViewport = _ref3.isLargeViewport, isCollapsed = _ref3.isCollapsed; var _select = select('core/editor'), getBlockRootClientId = _select.getBlockRootClientId, getEditorSettings = _select.getEditorSettings; return { isCollapsed: isCollapsed || !isLargeViewport || !getEditorSettings().hasFixedToolbar && getBlockRootClientId(clientId) }; }))(AlignmentToolbar)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/autocomplete/index.js": /*!**************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/autocomplete/index.js ***! \**************************************************************************************/ /*! exports provided: withFilteredAutocompleters, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withFilteredAutocompleters", function() { return withFilteredAutocompleters; }); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /* * Use one array instance for fallback rather than inline array literals * because the latter may cause rerender due to failed prop equality checks. */ var completersFallback = []; /** * Wrap the default Autocomplete component with one that * supports a filter hook for customizing its list of autocompleters. * * Since there may be many Autocomplete instances at one time, this component * applies the filter on demand, when the component is first focused after * receiving a new list of completers. * * This function is exported for unit test. * * @param {Function} Autocomplete Original component. * @return {Function} Wrapped component */ function withFilteredAutocompleters(Autocomplete) { return ( /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(FilteredAutocomplete, _Component); function FilteredAutocomplete() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, FilteredAutocomplete); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(FilteredAutocomplete).call(this)); _this.state = { completers: completersFallback }; _this.saveParentRef = _this.saveParentRef.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.onFocus = _this.onFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(FilteredAutocomplete, [{ key: "componentDidUpdate", value: function componentDidUpdate() { var hasFocus = this.parentNode.contains(document.activeElement); /* * It's possible for props to be updated when the component has focus, * so here, we ensure new completers are immediately applied while we * have the focus. * * NOTE: This may trigger another render but only when the component has focus. */ if (hasFocus && this.hasStaleCompleters()) { this.updateCompletersState(); } } }, { key: "onFocus", value: function onFocus() { if (this.hasStaleCompleters()) { this.updateCompletersState(); } } }, { key: "hasStaleCompleters", value: function hasStaleCompleters() { return !('lastFilteredCompletersProp' in this.state) || this.state.lastFilteredCompletersProp !== this.props.completers; } }, { key: "updateCompletersState", value: function updateCompletersState() { var _this$props = this.props, blockName = _this$props.blockName, completers = _this$props.completers; var nextCompleters = completers; var lastFilteredCompletersProp = nextCompleters; if (Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_10__["hasFilter"])('editor.Autocomplete.completers')) { nextCompleters = Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_10__["applyFilters"])('editor.Autocomplete.completers', // Provide copies so filters may directly modify them. nextCompleters && nextCompleters.map(lodash__WEBPACK_IMPORTED_MODULE_9__["clone"]), blockName); } this.setState({ lastFilteredCompletersProp: lastFilteredCompletersProp, completers: nextCompleters || completersFallback }); } }, { key: "saveParentRef", value: function saveParentRef(parentNode) { this.parentNode = parentNode; } }, { key: "render", value: function render() { var completers = this.state.completers; var autocompleteProps = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, this.props, { completers: completers }); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { onFocus: this.onFocus, ref: this.saveParentRef }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(Autocomplete, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ onFocus: this.onFocus }, autocompleteProps))); } }]); return FilteredAutocomplete; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]) ); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["compose"])([Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_13__["withBlockEditContext"])(function (_ref) { var name = _ref.name; return { blockName: name }; }), withFilteredAutocompleters])(_wordpress_components__WEBPACK_IMPORTED_MODULE_12__["Autocomplete"])); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/autocompleters/block.js": /*!****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/autocompleters/block.js ***! \****************************************************************************************/ /*! exports provided: createBlockCompleter, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createBlockCompleter", function() { return createBlockCompleter; }); /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _block_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../block-icon */ "./node_modules/@wordpress/editor/build-module/components/block-icon/index.js"); /** * WordPress dependencies */ /** * Internal dependencies */ /** * Returns the client ID of the parent where a newly inserted block would be * placed. * * @return {string} Client ID of the parent where a newly inserted block would * be placed. */ function defaultGetBlockInsertionParentClientId() { return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["select"])('core/editor').getBlockInsertionPoint().rootClientId; } /** * Returns the inserter items for the specified parent block. * * @param {string} parentClientId Client ID of the block for which to retrieve * inserter items. * * @return {Array} The inserter items for the specified * parent. */ function defaultGetInserterItems(parentClientId) { return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["select"])('core/editor').getInserterItems(parentClientId); } /** * Returns the name of the currently selected block. * * @return {string?} The name of the currently selected block or `null` if no * block is selected. */ function defaultGetSelectedBlockName() { var selectedBlock = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["select"])('core/editor').getSelectedBlock(); return selectedBlock ? selectedBlock.name : null; } /** * Creates a blocks repeater for replacing the current block with a selected block type. * * @return {Completer} A blocks completer. */ function createBlockCompleter() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, _ref$getBlockInsertio = _ref.getBlockInsertionParentClientId, getBlockInsertionParentClientId = _ref$getBlockInsertio === void 0 ? defaultGetBlockInsertionParentClientId : _ref$getBlockInsertio, _ref$getInserterItems = _ref.getInserterItems, getInserterItems = _ref$getInserterItems === void 0 ? defaultGetInserterItems : _ref$getInserterItems, _ref$getSelectedBlock = _ref.getSelectedBlockName, getSelectedBlockName = _ref$getSelectedBlock === void 0 ? defaultGetSelectedBlockName : _ref$getSelectedBlock; return { name: 'blocks', className: 'editor-autocompleters__block', triggerPrefix: '/', options: function options() { var selectedBlockName = getSelectedBlockName(); return getInserterItems(getBlockInsertionParentClientId()).filter( // Avoid offering to replace the current block with a block of the same type. function (inserterItem) { return selectedBlockName !== inserterItem.name; }); }, getOptionKeywords: function getOptionKeywords(inserterItem) { var title = inserterItem.title, _inserterItem$keyword = inserterItem.keywords, keywords = _inserterItem$keyword === void 0 ? [] : _inserterItem$keyword; return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(keywords).concat([title]); }, getOptionLabel: function getOptionLabel(inserterItem) { var icon = inserterItem.icon, title = inserterItem.title; return [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_block_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { key: "icon", icon: icon && icon.src, showColors: true }), title]; }, allowContext: function allowContext(before, after) { return !(/\S/.test(before) || /\S/.test(after)); }, getOptionCompletion: function getOptionCompletion(inserterItem) { var name = inserterItem.name, initialAttributes = inserterItem.initialAttributes; return { action: 'replace', value: Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["createBlock"])(name, initialAttributes) }; }, isOptionDisabled: function isOptionDisabled(inserterItem) { return inserterItem.isDisabled; } }; } /** * Creates a blocks repeater for replacing the current block with a selected block type. * * @return {Completer} A blocks completer. */ /* harmony default export */ __webpack_exports__["default"] = (createBlockCompleter()); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/autocompleters/index.js": /*!****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/autocompleters/index.js ***! \****************************************************************************************/ /*! exports provided: blockAutocompleter, userAutocompleter */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _block__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./block */ "./node_modules/@wordpress/editor/build-module/components/autocompleters/block.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "blockAutocompleter", function() { return _block__WEBPACK_IMPORTED_MODULE_0__["default"]; }); /* harmony import */ var _user__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./user */ "./node_modules/@wordpress/editor/build-module/components/autocompleters/user.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "userAutocompleter", function() { return _user__WEBPACK_IMPORTED_MODULE_1__["default"]; }); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/autocompleters/user.js": /*!***************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/autocompleters/user.js ***! \***************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ /** * A user mentions completer. * * @type {Completer} */ /* harmony default export */ __webpack_exports__["default"] = ({ name: 'users', className: 'editor-autocompleters__user', triggerPrefix: '@', options: function options(search) { var payload = ''; if (search) { payload = '?search=' + encodeURIComponent(search); } return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({ path: '/wp/v2/users' + payload }); }, isDebounced: true, getOptionKeywords: function getOptionKeywords(user) { return [user.slug, user.name]; }, getOptionLabel: function getOptionLabel(user) { return [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("img", { key: "avatar", className: "editor-autocompleters__user-avatar", alt: "", src: user.avatar_urls[24] }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { key: "name", className: "editor-autocompleters__user-name" }, user.name), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { key: "slug", className: "editor-autocompleters__user-slug" }, user.slug)]; }, getOptionCompletion: function getOptionCompletion(user) { return "@".concat(user.slug); } }); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/autosave-monitor/index.js": /*!******************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/autosave-monitor/index.js ***! \******************************************************************************************/ /*! exports provided: AutosaveMonitor, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AutosaveMonitor", function() { return AutosaveMonitor; }); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__); /** * WordPress dependencies */ var AutosaveMonitor = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(AutosaveMonitor, _Component); function AutosaveMonitor() { Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, AutosaveMonitor); return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(AutosaveMonitor).apply(this, arguments)); } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(AutosaveMonitor, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this$props = this.props, isDirty = _this$props.isDirty, isAutosaveable = _this$props.isAutosaveable; if (prevProps.isDirty !== isDirty || prevProps.isAutosaveable !== isAutosaveable) { this.toggleTimer(isDirty && isAutosaveable); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.toggleTimer(false); } }, { key: "toggleTimer", value: function toggleTimer(isPendingSave) { var _this = this; clearTimeout(this.pendingSave); var autosaveInterval = this.props.autosaveInterval; if (isPendingSave) { this.pendingSave = setTimeout(function () { return _this.props.autosave(); }, autosaveInterval * 1000); } } }, { key: "render", value: function render() { return null; } }]); return AutosaveMonitor; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withSelect"])(function (select) { var _select = select('core/editor'), isEditedPostDirty = _select.isEditedPostDirty, isEditedPostAutosaveable = _select.isEditedPostAutosaveable, getEditorSettings = _select.getEditorSettings; var _getEditorSettings = getEditorSettings(), autosaveInterval = _getEditorSettings.autosaveInterval; return { isDirty: isEditedPostDirty(), isAutosaveable: isEditedPostAutosaveable(), autosaveInterval: autosaveInterval }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withDispatch"])(function (dispatch) { return { autosave: dispatch('core/editor').autosave }; })])(AutosaveMonitor)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-actions/index.js": /*!***************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-actions/index.js ***! \***************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__); /** * External dependencies */ /** * WordPress dependencies */ function BlockActions(_ref) { var onDuplicate = _ref.onDuplicate, onRemove = _ref.onRemove, onInsertBefore = _ref.onInsertBefore, onInsertAfter = _ref.onInsertAfter, isLocked = _ref.isLocked, canDuplicate = _ref.canDuplicate, children = _ref.children; return children({ onDuplicate: onDuplicate, onRemove: onRemove, onInsertAfter: onInsertAfter, onInsertBefore: onInsertBefore, isLocked: isLocked, canDuplicate: canDuplicate }); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select, props) { var _select = select('core/editor'), getBlocksByClientId = _select.getBlocksByClientId, getBlockIndex = _select.getBlockIndex, getTemplateLock = _select.getTemplateLock, getBlockRootClientId = _select.getBlockRootClientId; var blocks = getBlocksByClientId(props.clientIds); var canDuplicate = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["every"])(blocks, function (block) { return !!block && Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["hasBlockSupport"])(block.name, 'multiple', true); }); var rootClientId = getBlockRootClientId(props.clientIds[0]); return { firstSelectedIndex: getBlockIndex(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["first"])(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["castArray"])(props.clientIds)), rootClientId), lastSelectedIndex: getBlockIndex(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["last"])(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["castArray"])(props.clientIds)), rootClientId), isLocked: !!getTemplateLock(rootClientId), blocks: blocks, canDuplicate: canDuplicate, rootClientId: rootClientId, extraProps: props }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withDispatch"])(function (dispatch, props) { var clientIds = props.clientIds, rootClientId = props.rootClientId, blocks = props.blocks, firstSelectedIndex = props.firstSelectedIndex, lastSelectedIndex = props.lastSelectedIndex, isLocked = props.isLocked, canDuplicate = props.canDuplicate; var _dispatch = dispatch('core/editor'), insertBlocks = _dispatch.insertBlocks, multiSelect = _dispatch.multiSelect, removeBlocks = _dispatch.removeBlocks, insertDefaultBlock = _dispatch.insertDefaultBlock; return { onDuplicate: function onDuplicate() { if (isLocked || !canDuplicate) { return; } var clonedBlocks = blocks.map(function (block) { return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["cloneBlock"])(block); }); insertBlocks(clonedBlocks, lastSelectedIndex + 1, rootClientId); if (clonedBlocks.length > 1) { multiSelect(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["first"])(clonedBlocks).clientId, Object(lodash__WEBPACK_IMPORTED_MODULE_0__["last"])(clonedBlocks).clientId); } }, onRemove: function onRemove() { if (!isLocked) { removeBlocks(clientIds); } }, onInsertBefore: function onInsertBefore() { if (!isLocked) { insertDefaultBlock({}, rootClientId, firstSelectedIndex); } }, onInsertAfter: function onInsertAfter() { if (!isLocked) { insertDefaultBlock({}, rootClientId, lastSelectedIndex + 1); } } }; })])(BlockActions)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-alignment-toolbar/index.js": /*!*************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-alignment-toolbar/index.js ***! \*************************************************************************************************/ /*! exports provided: BlockAlignmentToolbar, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockAlignmentToolbar", function() { return BlockAlignmentToolbar; }); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/viewport */ "@wordpress/viewport"); /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); /** * WordPress dependencies */ /** * Internal dependencies */ var BLOCK_ALIGNMENTS_CONTROLS = { left: { icon: 'align-left', title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Align left') }, center: { icon: 'align-center', title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Align center') }, right: { icon: 'align-right', title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Align right') }, wide: { icon: 'align-wide', title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Wide width') }, full: { icon: 'align-full-width', title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Full width') } }; var DEFAULT_CONTROLS = ['left', 'center', 'right', 'wide', 'full']; var WIDE_CONTROLS = ['wide', 'full']; function BlockAlignmentToolbar(_ref) { var isCollapsed = _ref.isCollapsed, value = _ref.value, onChange = _ref.onChange, _ref$controls = _ref.controls, controls = _ref$controls === void 0 ? DEFAULT_CONTROLS : _ref$controls, _ref$wideControlsEnab = _ref.wideControlsEnabled, wideControlsEnabled = _ref$wideControlsEnab === void 0 ? false : _ref$wideControlsEnab; function applyOrUnset(align) { return function () { return onChange(value === align ? undefined : align); }; } var enabledControls = wideControlsEnabled ? controls : controls.filter(function (control) { return WIDE_CONTROLS.indexOf(control) === -1; }); var activeAlignment = BLOCK_ALIGNMENTS_CONTROLS[value]; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["Toolbar"], { isCollapsed: isCollapsed, icon: activeAlignment ? activeAlignment.icon : 'align-left', label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Change Alignment'), controls: enabledControls.map(function (control) { return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, BLOCK_ALIGNMENTS_CONTROLS[control], { isActive: value === control, onClick: applyOrUnset(control) }); }) }); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__["compose"])(Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_7__["withBlockEditContext"])(function (_ref2) { var clientId = _ref2.clientId; return { clientId: clientId }; }), Object(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_4__["withViewportMatch"])({ isLargeViewport: 'medium' }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select, _ref3) { var clientId = _ref3.clientId, isLargeViewport = _ref3.isLargeViewport, isCollapsed = _ref3.isCollapsed; var _select = select('core/editor'), getBlockRootClientId = _select.getBlockRootClientId, getEditorSettings = _select.getEditorSettings; return { wideControlsEnabled: select('core/editor').getEditorSettings().alignWide, isCollapsed: isCollapsed || !isLargeViewport || !getEditorSettings().hasFixedToolbar && getBlockRootClientId(clientId) }; }))(BlockAlignmentToolbar)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-compare/block-view.js": /*!********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-compare/block-view.js ***! \********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ var BlockView = function BlockView(_ref) { var title = _ref.title, rawContent = _ref.rawContent, renderedContent = _ref.renderedContent, action = _ref.action, actionText = _ref.actionText, className = _ref.className; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: className }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-block-compare__content" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("h1", { className: "editor-block-compare__heading" }, title), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-block-compare__html" }, rawContent), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-block-compare__preview edit-post-visual-editor" }, renderedContent)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-block-compare__action" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Button"], { isLarge: true, tabIndex: "0", onClick: action }, actionText))); }; /* harmony default export */ __webpack_exports__["default"] = (BlockView); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-compare/index.js": /*!***************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-compare/index.js ***! \***************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var diff__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! diff */ "./node_modules/diff/dist/diff.js"); /* harmony import */ var diff__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(diff__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _block_view__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./block-view */ "./node_modules/@wordpress/editor/build-module/components/block-compare/block-view.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var BlockCompare = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockCompare, _Component); function BlockCompare() { Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockCompare); return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockCompare).apply(this, arguments)); } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockCompare, [{ key: "getDifference", value: function getDifference(originalContent, newContent) { var difference = Object(diff__WEBPACK_IMPORTED_MODULE_8__["diffChars"])(originalContent, newContent); return difference.map(function (item, pos) { var classes = classnames__WEBPACK_IMPORTED_MODULE_6___default()({ 'editor-block-compare__added': item.added, 'editor-block-compare__removed': item.removed }); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", { key: pos, className: classes }, item.value); }); } }, { key: "getOriginalContent", value: function getOriginalContent(block) { // Get current block details var blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getBlockType"])(block.name); return { rawContent: block.originalContent, renderedContent: Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getSaveElement"])(blockType, block.attributes) }; } }, { key: "getConvertedContent", value: function getConvertedContent(block) { // The convertor may return an array of items or a single item var newBlocks = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["castArray"])(block); // Get converted block details var newContent = newBlocks.map(function (item) { return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getSaveContent"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getBlockType"])(item.name), item.attributes, item.innerBlocks); }); var renderedContent = newBlocks.map(function (item) { return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getSaveElement"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getBlockType"])(item.name), item.attributes, item.innerBlocks); }); return { rawContent: newContent.join(''), renderedContent: renderedContent }; } }, { key: "render", value: function render() { var _this$props = this.props, block = _this$props.block, onKeep = _this$props.onKeep, onConvert = _this$props.onConvert, convertor = _this$props.convertor, convertButtonText = _this$props.convertButtonText; var original = this.getOriginalContent(block); var converted = this.getConvertedContent(convertor(block)); var difference = this.getDifference(original.rawContent, converted.rawContent); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("div", { className: "editor-block-compare__wrapper" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_view__WEBPACK_IMPORTED_MODULE_11__["default"], { title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Current'), className: "editor-block-compare__current", action: onKeep, actionText: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Convert to HTML'), rawContent: original.rawContent, renderedContent: original.renderedContent }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_view__WEBPACK_IMPORTED_MODULE_11__["default"], { title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('After Conversion'), className: "editor-block-compare__converted", action: onConvert, actionText: convertButtonText, rawContent: difference, renderedContent: converted.renderedContent })); } }]); return BlockCompare; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (BlockCompare); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-controls/index.js": /*!****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-controls/index.js ***! \****************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); /** * WordPress dependencies */ /** * Internal dependencies */ var _createSlotFill = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["createSlotFill"])('BlockControls'), Fill = _createSlotFill.Fill, Slot = _createSlotFill.Slot; var BlockControlsFill = function BlockControlsFill(_ref) { var controls = _ref.controls, children = _ref.children; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(Fill, null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Toolbar"], { controls: controls }), children); }; var BlockControls = Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_2__["ifBlockEditSelected"])(BlockControlsFill); BlockControls.Slot = Slot; /* harmony default export */ __webpack_exports__["default"] = (BlockControls); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-draggable/index.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-draggable/index.js ***! \*****************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /** * WordPress dependencies */ var BlockDraggable = function BlockDraggable(_ref) { var children = _ref.children, clientId = _ref.clientId, rootClientId = _ref.rootClientId, blockElementId = _ref.blockElementId, index = _ref.index, onDragStart = _ref.onDragStart, onDragEnd = _ref.onDragEnd; var transferData = { type: 'block', srcIndex: index, srcRootClientId: rootClientId, srcClientId: clientId }; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Draggable"], { elementId: blockElementId, transferData: transferData, onDragStart: onDragStart, onDragEnd: onDragEnd }, function (_ref2) { var onDraggableStart = _ref2.onDraggableStart, onDraggableEnd = _ref2.onDraggableEnd; return children({ onDraggableStart: onDraggableStart, onDraggableEnd: onDraggableEnd }); }); }; /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select, _ref3) { var clientId = _ref3.clientId; var _select = select('core/editor'), getBlockIndex = _select.getBlockIndex, getBlockRootClientId = _select.getBlockRootClientId; return { index: getBlockIndex(clientId), rootClientId: getBlockRootClientId(clientId) }; })(BlockDraggable)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-drop-zone/index.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-drop-zone/index.js ***! \*****************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__); /** * External Dependencies */ /** * WordPress dependencies */ var parseDropEvent = function parseDropEvent(event) { var result = { srcRootClientId: null, srcClientId: null, srcIndex: null, type: null }; if (!event.dataTransfer) { return result; } try { result = Object.assign(result, JSON.parse(event.dataTransfer.getData('text'))); } catch (err) { return result; } return result; }; var BlockDropZone = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockDropZone, _Component); function BlockDropZone() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockDropZone); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockDropZone).apply(this, arguments)); _this.onFilesDrop = _this.onFilesDrop.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.onHTMLDrop = _this.onHTMLDrop.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.onDrop = _this.onDrop.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockDropZone, [{ key: "getInsertIndex", value: function getInsertIndex(position) { var index = this.props.index; if (index !== undefined) { return position.y === 'top' ? index : index + 1; } } }, { key: "onFilesDrop", value: function onFilesDrop(files, position) { var transformation = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["findTransform"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getBlockTransforms"])('from'), function (transform) { return transform.type === 'files' && transform.isMatch(files); }); if (transformation) { var insertIndex = this.getInsertIndex(position); var blocks = transformation.transform(files, this.props.updateBlockAttributes); this.props.insertBlocks(blocks, insertIndex); } } }, { key: "onHTMLDrop", value: function onHTMLDrop(HTML, position) { var blocks = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["rawHandler"])({ HTML: HTML, mode: 'BLOCKS' }); if (blocks.length) { this.props.insertBlocks(blocks, this.getInsertIndex(position)); } } }, { key: "onDrop", value: function onDrop(event, position) { var _this$props = this.props, dstRootClientId = _this$props.rootClientId, dstClientId = _this$props.clientId, dstIndex = _this$props.index, getClientIdsOfDescendants = _this$props.getClientIdsOfDescendants; var _parseDropEvent = parseDropEvent(event), srcRootClientId = _parseDropEvent.srcRootClientId, srcClientId = _parseDropEvent.srcClientId, srcIndex = _parseDropEvent.srcIndex, type = _parseDropEvent.type; var isBlockDropType = function isBlockDropType(dropType) { return dropType === 'block'; }; var isSameLevel = function isSameLevel(srcRoot, dstRoot) { // Note that rootClientId of top-level blocks will be undefined OR a void string, // so we also need to account for that case separately. return srcRoot === dstRoot || !srcRoot === true && !dstRoot === true; }; var isSameBlock = function isSameBlock(src, dst) { return src === dst; }; var isSrcBlockAnAncestorOfDstBlock = function isSrcBlockAnAncestorOfDstBlock(src, dst) { return getClientIdsOfDescendants([src]).some(function (id) { return id === dst; }); }; if (!isBlockDropType(type) || isSameBlock(srcClientId, dstClientId) || isSrcBlockAnAncestorOfDstBlock(srcClientId, dstClientId)) { return; } var positionIndex = this.getInsertIndex(position); // If the block is kept at the same level and moved downwards, // subtract to account for blocks shifting upward to occupy its old position. var insertIndex = dstIndex && srcIndex < dstIndex && isSameLevel(srcRootClientId, dstRootClientId) ? positionIndex - 1 : positionIndex; this.props.moveBlockToPosition(srcClientId, srcRootClientId, insertIndex); } }, { key: "render", value: function render() { var _this$props2 = this.props, isLocked = _this$props2.isLocked, index = _this$props2.index; if (isLocked) { return null; } var isAppender = index === undefined; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["DropZone"], { className: classnames__WEBPACK_IMPORTED_MODULE_8___default()('editor-block-drop-zone', { 'is-appender': isAppender }), onFilesDrop: this.onFilesDrop, onHTMLDrop: this.onHTMLDrop, onDrop: this.onDrop }); } }]); return BlockDropZone; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withDispatch"])(function (dispatch, ownProps) { var _dispatch = dispatch('core/editor'), _insertBlocks = _dispatch.insertBlocks, _updateBlockAttributes = _dispatch.updateBlockAttributes, _moveBlockToPosition = _dispatch.moveBlockToPosition; return { insertBlocks: function insertBlocks(blocks, index) { var rootClientId = ownProps.rootClientId, layout = ownProps.layout; if (layout) { // A block's transform function may return a single // transformed block or an array of blocks, so ensure // to first coerce to an array before mapping to inject // the layout attribute. blocks = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["castArray"])(blocks).map(function (block) { return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["cloneBlock"])(block, { layout: layout }); }); } _insertBlocks(blocks, index, rootClientId); }, updateBlockAttributes: function updateBlockAttributes() { _updateBlockAttributes.apply(void 0, arguments); }, moveBlockToPosition: function moveBlockToPosition(srcClientId, srcRootClientId, dstIndex) { var dstRootClientId = ownProps.rootClientId, layout = ownProps.layout; _moveBlockToPosition(srcClientId, srcRootClientId, dstRootClientId, layout, dstIndex); } }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withSelect"])(function (select, _ref) { var rootClientId = _ref.rootClientId; var _select = select('core/editor'), getClientIdsOfDescendants = _select.getClientIdsOfDescendants, getTemplateLock = _select.getTemplateLock; return { isLocked: !!getTemplateLock(rootClientId), getClientIdsOfDescendants: getClientIdsOfDescendants }; }))(BlockDropZone)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js": /*!**************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-edit/context.js ***! \**************************************************************************************/ /*! exports provided: BlockEditContextProvider, withBlockEditContext, ifBlockEditSelected */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockEditContextProvider", function() { return Provider; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withBlockEditContext", function() { return withBlockEditContext; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ifBlockEditSelected", function() { return ifBlockEditSelected; }); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); /** * External dependencies */ /** * WordPress dependencies */ var _createContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createContext"])({ name: '', isSelected: false, focusedElement: null, setFocusedElement: lodash__WEBPACK_IMPORTED_MODULE_2__["noop"], clientId: null }), Consumer = _createContext.Consumer, Provider = _createContext.Provider; /** * A Higher Order Component used to inject BlockEdit context to the * wrapped component. * * @param {Function} mapContextToProps Function called on every context change, * expected to return object of props to * merge with the component's own props. * * @return {Component} Enhanced component with injected context as props. */ var withBlockEditContext = function withBlockEditContext(mapContextToProps) { return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["createHigherOrderComponent"])(function (OriginalComponent) { return function (props) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(Consumer, null, function (context) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(OriginalComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, mapContextToProps(context, props))); }); }; }, 'withBlockEditContext'); }; /** * A Higher Order Component used to render conditionally the wrapped * component only when the BlockEdit has selected state set. * * @param {Component} OriginalComponent Component to wrap. * * @return {Component} Component which renders only when the BlockEdit is selected. */ var ifBlockEditSelected = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["createHigherOrderComponent"])(function (OriginalComponent) { return function (props) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(Consumer, null, function (_ref) { var isSelected = _ref.isSelected; return isSelected && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(OriginalComponent, props); }); }; }, 'ifBlockEditSelected'); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-edit/edit.js": /*!***********************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-edit/edit.js ***! \***********************************************************************************/ /*! exports provided: Edit, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Edit", function() { return Edit; }); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__); /** * External dependencies */ /** * WordPress dependencies */ var Edit = function Edit(props) { var _props$attributes = props.attributes, attributes = _props$attributes === void 0 ? {} : _props$attributes, name = props.name; var blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["getBlockType"])(name); if (!blockType) { return null; } // Generate a class name for the block's editable form var generatedClassName = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["hasBlockSupport"])(blockType, 'className', true) ? Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["getBlockDefaultClassName"])(name) : null; var className = classnames__WEBPACK_IMPORTED_MODULE_2___default()(generatedClassName, attributes.className); // `edit` and `save` are functions or components describing the markup // with which a block is displayed. If `blockType` is valid, assign // them preferentially as the render value for the block. var Component = blockType.edit || blockType.save; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, { className: className })); }; /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["withFilters"])('editor.BlockEdit')(Edit)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-edit/index.js": /*!************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-edit/index.js ***! \************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./edit */ "./node_modules/@wordpress/editor/build-module/components/block-edit/edit.js"); /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); /** * WordPress dependencies */ /** * Internal dependencies */ var BlockEdit = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockEdit, _Component); function BlockEdit(props) { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockEdit); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockEdit).call(this, props)); _this.setFocusedElement = _this.setFocusedElement.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.state = { focusedElement: null, setFocusedElement: _this.setFocusedElement }; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockEdit, [{ key: "setFocusedElement", value: function setFocusedElement(focusedElement) { this.setState(function (prevState) { if (prevState.focusedElement === focusedElement) { return null; } return { focusedElement: focusedElement }; }); } }, { key: "render", value: function render() { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_context__WEBPACK_IMPORTED_MODULE_8__["BlockEditContextProvider"], { value: this.state }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_edit__WEBPACK_IMPORTED_MODULE_7__["default"], this.props)); } }], [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(props) { var clientId = props.clientId, name = props.name, isSelected = props.isSelected; return { name: name, isSelected: isSelected, clientId: clientId }; } }]); return BlockEdit; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (BlockEdit); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-format-controls/index.js": /*!***********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-format-controls/index.js ***! \***********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); /** * WordPress dependencies */ /** * Internal dependencies */ var _createSlotFill = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('BlockFormatControls'), Fill = _createSlotFill.Fill, Slot = _createSlotFill.Slot; var BlockFormatControls = Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_1__["ifBlockEditSelected"])(Fill); BlockFormatControls.Slot = Slot; /* harmony default export */ __webpack_exports__["default"] = (BlockFormatControls); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-icon/index.js": /*!************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-icon/index.js ***! \************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockIcon; }); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); /** * External dependencies */ /** * WordPress dependencies */ function renderIcon(icon) { if ('string' === typeof icon) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Dashicon"], { icon: icon, size: 20 }); } else if ('function' === typeof icon) { if (icon.prototype instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_3__["Component"]) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(icon); } return icon(); } else if (icon && icon.type === 'svg') { var appliedProps = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, icon.props, { width: icon.props.width || 24, height: icon.props.height || 24 }); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["SVG"], appliedProps); } return icon || null; } function BlockIcon(_ref) { var icon = _ref.icon, _ref$showColors = _ref.showColors, showColors = _ref$showColors === void 0 ? false : _ref$showColors, className = _ref.className; var renderedIcon = renderIcon(icon && icon.src ? icon.src : icon); var style = showColors ? { backgroundColor: icon && icon.background, color: icon && icon.foreground } : {}; if (!renderedIcon) { return null; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", { style: style, className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('editor-block-icon', className, { 'has-colors': showColors }) }, renderedIcon); } /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-inspector/index.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-inspector/index.js ***! \*****************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _skip_to_selected_block__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../skip-to-selected-block */ "./node_modules/@wordpress/editor/build-module/components/skip-to-selected-block/index.js"); /* harmony import */ var _block_icon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../block-icon */ "./node_modules/@wordpress/editor/build-module/components/block-icon/index.js"); /* harmony import */ var _inspector_controls__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../inspector-controls */ "./node_modules/@wordpress/editor/build-module/components/inspector-controls/index.js"); /* harmony import */ var _inspector_advanced_controls__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../inspector-advanced-controls */ "./node_modules/@wordpress/editor/build-module/components/inspector-advanced-controls/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal Dependencies */ var BlockInspector = function BlockInspector(_ref) { var selectedBlock = _ref.selectedBlock, blockType = _ref.blockType, count = _ref.count; if (count > 1) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { className: "editor-block-inspector__multi-blocks" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Coming Soon')); } if (!selectedBlock) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { className: "editor-block-inspector__no-blocks" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('No block selected.')); } return [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-block-inspector__card", key: "card" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_icon__WEBPACK_IMPORTED_MODULE_7__["default"], { icon: blockType.icon, showColors: true }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-block-inspector__card-content" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-block-inspector__card-title" }, blockType.title), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-block-inspector__card-description" }, blockType.description))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { key: "inspector-controls" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inspector_controls__WEBPACK_IMPORTED_MODULE_8__["default"].Slot, null)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { key: "inspector-advanced-controls" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inspector_advanced_controls__WEBPACK_IMPORTED_MODULE_9__["default"].Slot, null, function (fills) { return !Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isEmpty"])(fills) && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["PanelBody"], { className: "editor-block-inspector__advanced", title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Advanced'), initialOpen: false }, fills); })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_skip_to_selected_block__WEBPACK_IMPORTED_MODULE_6__["default"], { key: "back" })]; }; /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select) { var _select = select('core/editor'), getSelectedBlock = _select.getSelectedBlock, getSelectedBlockCount = _select.getSelectedBlockCount; var selectedBlock = getSelectedBlock(); var blockType = selectedBlock && Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["getBlockType"])(selectedBlock.name); return { selectedBlock: selectedBlock, blockType: blockType, count: getSelectedBlockCount() }; })(BlockInspector)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-list-appender/index.js": /*!*********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-list-appender/index.js ***! \*********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _ignore_nested_events__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ignore-nested-events */ "./node_modules/@wordpress/editor/build-module/components/ignore-nested-events/index.js"); /* harmony import */ var _default_block_appender__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../default-block-appender */ "./node_modules/@wordpress/editor/build-module/components/default-block-appender/index.js"); /* harmony import */ var _inserter__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../inserter */ "./node_modules/@wordpress/editor/build-module/components/inserter/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function BlockListAppender(_ref) { var blockClientIds = _ref.blockClientIds, layout = _ref.layout, isGroupedByLayout = _ref.isGroupedByLayout, rootClientId = _ref.rootClientId, canInsertDefaultBlock = _ref.canInsertDefaultBlock, isLocked = _ref.isLocked; if (isLocked) { return null; } var defaultLayout = isGroupedByLayout ? layout : undefined; if (canInsertDefaultBlock) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_ignore_nested_events__WEBPACK_IMPORTED_MODULE_6__["default"], { childHandledEvents: ['onFocus', 'onClick', 'onKeyDown'] }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_default_block_appender__WEBPACK_IMPORTED_MODULE_7__["default"], { rootClientId: rootClientId, lastBlockClientId: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["last"])(blockClientIds), layout: defaultLayout })); } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "block-list-appender" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inserter__WEBPACK_IMPORTED_MODULE_8__["default"], { rootClientId: rootClientId, layout: defaultLayout, renderToggle: function renderToggle(_ref2) { var onToggle = _ref2.onToggle, disabled = _ref2.disabled, isOpen = _ref2.isOpen; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["Button"], { "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Add block'), onClick: onToggle, className: "block-list-appender__toggle", "aria-haspopup": "true", "aria-expanded": isOpen, disabled: disabled }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["Dashicon"], { icon: "insert" })); } })); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select, _ref3) { var rootClientId = _ref3.rootClientId; var _select = select('core/editor'), getBlockOrder = _select.getBlockOrder, canInsertBlockType = _select.canInsertBlockType, getTemplateLock = _select.getTemplateLock; return { isLocked: !!getTemplateLock(rootClientId), blockClientIds: getBlockOrder(rootClientId), canInsertDefaultBlock: canInsertBlockType(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["getDefaultBlockName"])(), rootClientId) }; })(BlockListAppender)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/block-contextual-toolbar.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-list/block-contextual-toolbar.js ***! \*******************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _navigable_toolbar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../navigable-toolbar */ "./node_modules/@wordpress/editor/build-module/components/navigable-toolbar/index.js"); /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ */ "./node_modules/@wordpress/editor/build-module/components/index.js"); /** * WordPress dependencies */ /** * Internal dependencies */ function BlockContextualToolbar() { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_navigable_toolbar__WEBPACK_IMPORTED_MODULE_2__["default"], { className: "editor-block-contextual-toolbar", "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Block Toolbar') }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_3__["BlockToolbar"], null)); } /* harmony default export */ __webpack_exports__["default"] = (BlockContextualToolbar); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/block-crash-boundary.js": /*!***************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-list/block-crash-boundary.js ***! \***************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); /** * WordPress dependencies */ var BlockCrashBoundary = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockCrashBoundary, _Component); function BlockCrashBoundary() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockCrashBoundary); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockCrashBoundary).apply(this, arguments)); _this.state = { hasError: false }; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockCrashBoundary, [{ key: "componentDidCatch", value: function componentDidCatch(error) { this.props.onError(error); this.setState({ hasError: true }); } }, { key: "render", value: function render() { if (this.state.hasError) { return null; } return this.props.children; } }]); return BlockCrashBoundary; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (BlockCrashBoundary); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/block-crash-warning.js": /*!**************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-list/block-crash-warning.js ***! \**************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _warning__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../warning */ "./node_modules/@wordpress/editor/build-module/components/warning/index.js"); /** * WordPress dependencies */ /** * Internal dependencies */ var warning = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_warning__WEBPACK_IMPORTED_MODULE_2__["default"], null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('This block has encountered an error and cannot be previewed.')); /* harmony default export */ __webpack_exports__["default"] = (function () { return warning; }); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/block-html.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-list/block-html.js ***! \*****************************************************************************************/ /*! exports provided: BlockHTML, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockHTML", function() { return BlockHTML; }); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-autosize-textarea */ "./node_modules/react-autosize-textarea/lib/index.js"); /* harmony import */ var react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__); /** * External Dependencies */ /** * WordPress Dependencies */ var BlockHTML = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockHTML, _Component); function BlockHTML(props) { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockHTML); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockHTML).apply(this, arguments)); _this.onChange = _this.onChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.onBlur = _this.onBlur.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.state = { html: props.block.isValid ? Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getBlockContent"])(props.block) : props.block.originalContent }; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockHTML, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (!Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isEqual"])(this.props.block.attributes, prevProps.block.attributes)) { this.setState({ html: Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getBlockContent"])(this.props.block) }); } } }, { key: "onBlur", value: function onBlur() { var html = this.state.html; var blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getBlockType"])(this.props.block.name); var attributes = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getBlockAttributes"])(blockType, html, this.props.block.attributes); // If html is empty we reset the block to the default HTML and mark it as valid to avoid triggering an error var content = html ? html : Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["getSaveContent"])(blockType, attributes); var isValid = html ? Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["isValidBlock"])(content, blockType, attributes) : true; this.props.onChange(this.props.clientId, attributes, content, isValid); // Ensure the state is updated if we reset so it displays the default content if (!html) { this.setState({ html: content }); } } }, { key: "onChange", value: function onChange(event) { this.setState({ html: event.target.value }); } }, { key: "render", value: function render() { var html = this.state.html; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7___default.a, { className: "editor-block-list__block-html-textarea", value: html, onBlur: this.onBlur, onChange: this.onChange }); } }]); return BlockHTML; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withSelect"])(function (select, ownProps) { return { block: select('core/editor').getBlock(ownProps.clientId) }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withDispatch"])(function (dispatch) { return { onChange: function onChange(clientId, attributes, originalContent, isValid) { dispatch('core/editor').updateBlock(clientId, { attributes: attributes, originalContent: originalContent, isValid: isValid }); } }; })])(BlockHTML)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/block-invalid-warning.js": /*!****************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-list/block-invalid-warning.js ***! \****************************************************************************************************/ /*! exports provided: BlockInvalidWarning, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockInvalidWarning", function() { return BlockInvalidWarning; }); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _warning__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../warning */ "./node_modules/@wordpress/editor/build-module/components/warning/index.js"); /* harmony import */ var _block_compare__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../block-compare */ "./node_modules/@wordpress/editor/build-module/components/block-compare/index.js"); /** * WordPress dependencies */ /** * Internal dependencies */ var BlockInvalidWarning = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockInvalidWarning, _Component); function BlockInvalidWarning(props) { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockInvalidWarning); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockInvalidWarning).call(this, props)); _this.state = { compare: false }; _this.onCompare = _this.onCompare.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.onCompareClose = _this.onCompareClose.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockInvalidWarning, [{ key: "onCompare", value: function onCompare() { this.setState({ compare: true }); } }, { key: "onCompareClose", value: function onCompareClose() { this.setState({ compare: false }); } }, { key: "render", value: function render() { var _this$props = this.props, convertToHTML = _this$props.convertToHTML, convertToBlocks = _this$props.convertToBlocks, convertToClassic = _this$props.convertToClassic, block = _this$props.block; var hasHTMLBlock = !!Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_9__["getBlockType"])('core/html'); var compare = this.state.compare; var hiddenActions = [{ title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Convert to Classic Block'), onClick: convertToClassic }]; if (compare) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Modal"], { title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Resolve Block'), onRequestClose: this.onCompareClose, className: "editor-block-compare" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_block_compare__WEBPACK_IMPORTED_MODULE_12__["default"], { block: block, onKeep: convertToHTML, onConvert: convertToBlocks, convertor: blockToBlocks, convertButtonText: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Convert to Blocks') })); } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_warning__WEBPACK_IMPORTED_MODULE_11__["default"], { actions: [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Button"], { key: "convert", onClick: this.onCompare, isLarge: true, isPrimary: !hasHTMLBlock }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Resolve')), hasHTMLBlock && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Button"], { key: "edit", onClick: convertToHTML, isLarge: true, isPrimary: true }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Convert to HTML'))], secondaryActions: hiddenActions }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('This block contains unexpected or invalid content.')); } }]); return BlockInvalidWarning; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); var blockToClassic = function blockToClassic(block) { return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_9__["createBlock"])('core/freeform', { content: block.originalContent }); }; var blockToHTML = function blockToHTML(block) { return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_9__["createBlock"])('core/html', { content: block.originalContent }); }; var blockToBlocks = function blockToBlocks(block) { return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_9__["rawHandler"])({ HTML: block.originalContent, mode: 'BLOCKS' }); }; /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withDispatch"])(function (dispatch, _ref) { var block = _ref.block; var _dispatch = dispatch('core/editor'), replaceBlock = _dispatch.replaceBlock; return { convertToClassic: function convertToClassic() { replaceBlock(block.clientId, blockToClassic(block)); }, convertToHTML: function convertToHTML() { replaceBlock(block.clientId, blockToHTML(block)); }, convertToBlocks: function convertToBlocks() { replaceBlock(block.clientId, blockToBlocks(block)); } }; })(BlockInvalidWarning)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/block-mobile-toolbar.js": /*!***************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-list/block-mobile-toolbar.js ***! \***************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/viewport */ "@wordpress/viewport"); /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _block_mover__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../block-mover */ "./node_modules/@wordpress/editor/build-module/components/block-mover/index.js"); /* harmony import */ var _inserter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../inserter */ "./node_modules/@wordpress/editor/build-module/components/inserter/index.js"); /** * WordPress dependencies */ /** * Internal dependencies */ function BlockMobileToolbar(_ref) { var clientId = _ref.clientId; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-block-list__block-mobile-toolbar" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inserter__WEBPACK_IMPORTED_MODULE_3__["default"], null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_mover__WEBPACK_IMPORTED_MODULE_2__["default"], { clientIds: [clientId] })); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_1__["ifViewportMatches"])('< small')(BlockMobileToolbar)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/block.js": /*!************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-list/block.js ***! \************************************************************************************/ /*! exports provided: BlockListBlock, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockListBlock", function() { return BlockListBlock; }); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @wordpress/viewport */ "@wordpress/viewport"); /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var _block_edit__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../block-edit */ "./node_modules/@wordpress/editor/build-module/components/block-edit/index.js"); /* harmony import */ var _block_mover__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../block-mover */ "./node_modules/@wordpress/editor/build-module/components/block-mover/index.js"); /* harmony import */ var _block_drop_zone__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../block-drop-zone */ "./node_modules/@wordpress/editor/build-module/components/block-drop-zone/index.js"); /* harmony import */ var _block_invalid_warning__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./block-invalid-warning */ "./node_modules/@wordpress/editor/build-module/components/block-list/block-invalid-warning.js"); /* harmony import */ var _block_crash_warning__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./block-crash-warning */ "./node_modules/@wordpress/editor/build-module/components/block-list/block-crash-warning.js"); /* harmony import */ var _block_crash_boundary__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./block-crash-boundary */ "./node_modules/@wordpress/editor/build-module/components/block-list/block-crash-boundary.js"); /* harmony import */ var _block_html__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./block-html */ "./node_modules/@wordpress/editor/build-module/components/block-list/block-html.js"); /* harmony import */ var _breadcrumb__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./breadcrumb */ "./node_modules/@wordpress/editor/build-module/components/block-list/breadcrumb.js"); /* harmony import */ var _block_contextual_toolbar__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./block-contextual-toolbar */ "./node_modules/@wordpress/editor/build-module/components/block-list/block-contextual-toolbar.js"); /* harmony import */ var _multi_controls__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./multi-controls */ "./node_modules/@wordpress/editor/build-module/components/block-list/multi-controls.js"); /* harmony import */ var _block_mobile_toolbar__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./block-mobile-toolbar */ "./node_modules/@wordpress/editor/build-module/components/block-list/block-mobile-toolbar.js"); /* harmony import */ var _insertion_point__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./insertion-point */ "./node_modules/@wordpress/editor/build-module/components/block-list/insertion-point.js"); /* harmony import */ var _ignore_nested_events__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../ignore-nested-events */ "./node_modules/@wordpress/editor/build-module/components/ignore-nested-events/index.js"); /* harmony import */ var _inserter_with_shortcuts__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../inserter-with-shortcuts */ "./node_modules/@wordpress/editor/build-module/components/inserter-with-shortcuts/index.js"); /* harmony import */ var _inserter__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../inserter */ "./node_modules/@wordpress/editor/build-module/components/inserter/index.js"); /* harmony import */ var _with_hover_areas__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./with-hover-areas */ "./node_modules/@wordpress/editor/build-module/components/block-list/with-hover-areas.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var BlockListBlock = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(BlockListBlock, _Component); function BlockListBlock() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, BlockListBlock); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(BlockListBlock).apply(this, arguments)); _this.setBlockListRef = _this.setBlockListRef.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.bindBlockNode = _this.bindBlockNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.setAttributes = _this.setAttributes.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.maybeHover = _this.maybeHover.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.hideHoverEffects = _this.hideHoverEffects.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.mergeBlocks = _this.mergeBlocks.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.insertBlocksAfter = _this.insertBlocksAfter.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.onFocus = _this.onFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.preventDrag = _this.preventDrag.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.onPointerDown = _this.onPointerDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.deleteOrInsertAfterWrapper = _this.deleteOrInsertAfterWrapper.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.onBlockError = _this.onBlockError.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.onTouchStart = _this.onTouchStart.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.onClick = _this.onClick.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.onDragStart = _this.onDragStart.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.onDragEnd = _this.onDragEnd.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.selectOnOpen = _this.selectOnOpen.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.hadTouchStart = false; _this.state = { error: null, dragging: false, isHovered: false }; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockListBlock, [{ key: "componentDidMount", value: function componentDidMount() { if (this.props.isSelected) { this.focusTabbable(); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.props.isTypingWithinBlock || this.props.isSelected) { this.hideHoverEffects(); } if (this.props.isSelected && !prevProps.isSelected) { this.focusTabbable(); } } }, { key: "setBlockListRef", value: function setBlockListRef(node) { // Disable reason: The root return element uses a component to manage // event nesting, but the parent block list layout needs the raw DOM // node to track multi-selection. // // eslint-disable-next-line react/no-find-dom-node node = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["findDOMNode"])(node); this.wrapperNode = node; this.props.blockRef(node, this.props.clientId); } }, { key: "bindBlockNode", value: function bindBlockNode(node) { // Disable reason: The block element uses a component to manage event // nesting, but we rely on a raw DOM node for focusing. // // eslint-disable-next-line react/no-find-dom-node this.node = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["findDOMNode"])(node); } /** * When a block becomes selected, transition focus to an inner tabbable. */ }, { key: "focusTabbable", value: function focusTabbable() { var initialPosition = this.props.initialPosition; // Focus is captured by the wrapper node, so while focus transition // should only consider tabbables within editable display, since it // may be the wrapper itself or a side control which triggered the // focus event, don't unnecessary transition to an inner tabbable. if (this.wrapperNode.contains(document.activeElement)) { return; } // Find all tabbables within node. var textInputs = _wordpress_dom__WEBPACK_IMPORTED_MODULE_11__["focus"].tabbable.find(this.node).filter(_wordpress_dom__WEBPACK_IMPORTED_MODULE_11__["isTextField"]); // If reversed (e.g. merge via backspace), use the last in the set of // tabbables. var isReverse = -1 === initialPosition; var target = (isReverse ? lodash__WEBPACK_IMPORTED_MODULE_10__["last"] : lodash__WEBPACK_IMPORTED_MODULE_10__["first"])(textInputs); if (!target) { this.wrapperNode.focus(); return; } target.focus(); // In reverse case, need to explicitly place caret position. if (isReverse) { Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_11__["placeCaretAtHorizontalEdge"])(target, true); Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_11__["placeCaretAtVerticalEdge"])(target, true); } } }, { key: "setAttributes", value: function setAttributes(attributes) { var _this$props = this.props, block = _this$props.block, onChange = _this$props.onChange; var type = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__["getBlockType"])(block.name); onChange(block.clientId, attributes); var metaAttributes = Object(lodash__WEBPACK_IMPORTED_MODULE_10__["reduce"])(attributes, function (result, value, key) { if (Object(lodash__WEBPACK_IMPORTED_MODULE_10__["get"])(type, ['attributes', key, 'source']) === 'meta') { result[type.attributes[key].meta] = value; } return result; }, {}); if (Object(lodash__WEBPACK_IMPORTED_MODULE_10__["size"])(metaAttributes)) { this.props.onMetaChange(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, this.props.meta, metaAttributes)); } } }, { key: "onTouchStart", value: function onTouchStart() { // Detect touchstart to disable hover on iOS this.hadTouchStart = true; } }, { key: "onClick", value: function onClick() { // Clear touchstart detection // Browser will try to emulate mouse events also see https://www.html5rocks.com/en/mobile/touchandmouse/ this.hadTouchStart = false; } /** * A mouseover event handler to apply hover effect when a pointer device is * placed within the bounds of the block. The mouseover event is preferred * over mouseenter because it may be the case that a previous mouseenter * event was blocked from being handled by a IgnoreNestedEvents component, * therefore transitioning out of a nested block to the bounds of the block * would otherwise not trigger a hover effect. * * @see https://developer.mozilla.org/en-US/docs/Web/Events/mouseenter */ }, { key: "maybeHover", value: function maybeHover() { var _this$props2 = this.props, isPartOfMultiSelection = _this$props2.isPartOfMultiSelection, isSelected = _this$props2.isSelected; var isHovered = this.state.isHovered; if (isHovered || isPartOfMultiSelection || isSelected || this.props.isMultiSelecting || this.hadTouchStart) { return; } this.setState({ isHovered: true }); } /** * Sets the block state as unhovered if currently hovering. There are cases * where mouseleave may occur but the block is not hovered (multi-select), * so to avoid unnecesary renders, the state is only set if hovered. */ }, { key: "hideHoverEffects", value: function hideHoverEffects() { if (this.state.isHovered) { this.setState({ isHovered: false }); } } }, { key: "mergeBlocks", value: function mergeBlocks() { var forward = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var _this$props3 = this.props, block = _this$props3.block, previousBlockClientId = _this$props3.previousBlockClientId, nextBlockClientId = _this$props3.nextBlockClientId, onMerge = _this$props3.onMerge; // Do nothing when it's the first block. if (!forward && !previousBlockClientId || forward && !nextBlockClientId) { return; } if (forward) { onMerge(block.clientId, nextBlockClientId); } else { onMerge(previousBlockClientId, block.clientId); } } }, { key: "insertBlocksAfter", value: function insertBlocksAfter(blocks) { this.props.onInsertBlocks(blocks, this.props.order + 1); } /** * Marks the block as selected when focused and not already selected. This * specifically handles the case where block does not set focus on its own * (via `setFocus`), typically if there is no focusable input in the block. * * @return {void} */ }, { key: "onFocus", value: function onFocus() { if (!this.props.isSelected && !this.props.isPartOfMultiSelection) { this.props.onSelect(); } } /** * Prevents default dragging behavior within a block to allow for multi- * selection to take effect unhampered. * * @param {DragEvent} event Drag event. * * @return {void} */ }, { key: "preventDrag", value: function preventDrag(event) { event.preventDefault(); } /** * Begins tracking cursor multi-selection when clicking down within block. * * @param {MouseEvent} event A mousedown event. * * @return {void} */ }, { key: "onPointerDown", value: function onPointerDown(event) { // Not the main button. // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button if (event.button !== 0) { return; } if (event.shiftKey) { if (!this.props.isSelected) { this.props.onShiftSelection(this.props.clientId); event.preventDefault(); } } else { this.props.onSelectionStart(this.props.clientId); // Allow user to escape out of a multi-selection to a singular // selection of a block via click. This is handled here since // onFocus excludes blocks involved in a multiselection, as // focus can be incurred by starting a multiselection (focus // moved to first block's multi-controls). if (this.props.isPartOfMultiSelection) { this.props.onSelect(); } } } /** * Interprets keydown event intent to remove or insert after block if key * event occurs on wrapper node. This can occur when the block has no text * fields of its own, particularly after initial insertion, to allow for * easy deletion and continuous writing flow to add additional content. * * @param {KeyboardEvent} event Keydown event. */ }, { key: "deleteOrInsertAfterWrapper", value: function deleteOrInsertAfterWrapper(event) { var keyCode = event.keyCode, target = event.target; if (target !== this.wrapperNode || this.props.isLocked) { return; } switch (keyCode) { case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["ENTER"]: // Insert default block after current block if enter and event // not already handled by descendant. this.props.onInsertDefaultBlockAfter(); event.preventDefault(); break; case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["BACKSPACE"]: case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["DELETE"]: // Remove block on backspace. var _this$props4 = this.props, clientId = _this$props4.clientId, onRemove = _this$props4.onRemove; onRemove(clientId); event.preventDefault(); break; } } }, { key: "onBlockError", value: function onBlockError(error) { this.setState({ error: error }); } }, { key: "onDragStart", value: function onDragStart() { this.setState({ dragging: true }); } }, { key: "onDragEnd", value: function onDragEnd() { this.setState({ dragging: false }); } }, { key: "selectOnOpen", value: function selectOnOpen(open) { if (open && !this.props.isSelected) { this.props.onSelect(); } } }, { key: "render", value: function render() { var _this$props5 = this.props, block = _this$props5.block, order = _this$props5.order, mode = _this$props5.mode, isFocusMode = _this$props5.isFocusMode, hasFixedToolbar = _this$props5.hasFixedToolbar, isLocked = _this$props5.isLocked, isFirst = _this$props5.isFirst, isLast = _this$props5.isLast, clientId = _this$props5.clientId, rootClientId = _this$props5.rootClientId, layout = _this$props5.layout, isSelected = _this$props5.isSelected, isPartOfMultiSelection = _this$props5.isPartOfMultiSelection, isFirstMultiSelected = _this$props5.isFirstMultiSelected, isTypingWithinBlock = _this$props5.isTypingWithinBlock, isMultiSelecting = _this$props5.isMultiSelecting, hoverArea = _this$props5.hoverArea, isEmptyDefaultBlock = _this$props5.isEmptyDefaultBlock, isMovable = _this$props5.isMovable, isPreviousBlockADefaultEmptyBlock = _this$props5.isPreviousBlockADefaultEmptyBlock, hasSelectedInnerBlock = _this$props5.hasSelectedInnerBlock, isParentOfSelectedBlock = _this$props5.isParentOfSelectedBlock, hasMultiSelection = _this$props5.hasMultiSelection, isDraggable = _this$props5.isDraggable; var isHovered = this.state.isHovered && !isMultiSelecting; var blockName = block.name, isValid = block.isValid; var blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__["getBlockType"])(blockName); // translators: %s: Type of block (i.e. Text, Image etc) var blockLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_15__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_15__["__"])('Block: %s'), blockType.title); // The block as rendered in the editor is composed of general block UI // (mover, toolbar, wrapper) and the display of the block content. // If the block is selected and we're typing the block should not appear. // Empty paragraph blocks should always show up as unselected. var showEmptyBlockSideInserter = (isSelected || isHovered) && isEmptyDefaultBlock && isValid; var showSideInserter = (isSelected || isHovered) && isEmptyDefaultBlock; var shouldAppearSelected = !isFocusMode && !hasFixedToolbar && !showSideInserter && isSelected && !isTypingWithinBlock; var shouldAppearSelectedParent = !isFocusMode && !hasFixedToolbar && !showSideInserter && hasSelectedInnerBlock && !isTypingWithinBlock && !hasMultiSelection; var shouldAppearHovered = !isFocusMode && !hasFixedToolbar && isHovered && !isEmptyDefaultBlock; // We render block movers and block settings to keep them tabbale even if hidden var shouldRenderMovers = !isFocusMode && (isSelected || hoverArea === 'left') && !showEmptyBlockSideInserter && !isMultiSelecting && !isPartOfMultiSelection && !isTypingWithinBlock; var shouldShowBreadcrumb = !isFocusMode && isHovered && !isEmptyDefaultBlock; var shouldShowContextualToolbar = !hasFixedToolbar && !showSideInserter && (isSelected && !isTypingWithinBlock || isFirstMultiSelected); var shouldShowMobileToolbar = shouldAppearSelected; var _this$state = this.state, error = _this$state.error, dragging = _this$state.dragging; // Insertion point can only be made visible when the side inserter is // not present, and either the block is at the extent of a selection or // is the first block in the top-level list rendering. var shouldShowInsertionPoint = isPartOfMultiSelection && isFirst || !isPartOfMultiSelection; var canShowInBetweenInserter = !isEmptyDefaultBlock && !isPreviousBlockADefaultEmptyBlock; // Generate the wrapper class names handling the different states of the block. var wrapperClassName = classnames__WEBPACK_IMPORTED_MODULE_9___default()('editor-block-list__block', { 'has-warning': !isValid || !!error, 'is-selected': shouldAppearSelected, 'is-multi-selected': isPartOfMultiSelection, 'is-selected-parent': shouldAppearSelectedParent, 'is-hovered': shouldAppearHovered, 'is-reusable': Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__["isReusableBlock"])(blockType), 'is-dragging': dragging, 'is-typing': isTypingWithinBlock, 'is-focused': isFocusMode && (isSelected || isParentOfSelectedBlock), 'is-focus-mode': isFocusMode }); var onReplace = this.props.onReplace; // Determine whether the block has props to apply to the wrapper. var wrapperProps = this.props.wrapperProps; if (blockType.getEditWrapperProps) { wrapperProps = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, wrapperProps, blockType.getEditWrapperProps(block.attributes)); } var blockElementId = "block-".concat(clientId); // We wrap the BlockEdit component in a div that hides it when editing in // HTML mode. This allows us to render all of the ancillary pieces // (InspectorControls, etc.) which are inside `BlockEdit` but not // `BlockHTML`, even in HTML mode. var blockEdit = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_edit__WEBPACK_IMPORTED_MODULE_19__["default"], { name: blockName, isSelected: isSelected, attributes: block.attributes, setAttributes: this.setAttributes, insertBlocksAfter: isLocked ? undefined : this.insertBlocksAfter, onReplace: isLocked ? undefined : onReplace, mergeBlocks: isLocked ? undefined : this.mergeBlocks, clientId: clientId, isSelectionEnabled: this.props.isSelectionEnabled, toggleSelection: this.props.toggleSelection }); if (mode !== 'visual') { blockEdit = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { style: { display: 'none' } }, blockEdit); } // Disable reasons: // // jsx-a11y/mouse-events-have-key-events: // - onMouseOver is explicitly handling hover effects // // jsx-a11y/no-static-element-interactions: // - Each block can be selected by clicking on it /* eslint-disable jsx-a11y/mouse-events-have-key-events, jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */ return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_ignore_nested_events__WEBPACK_IMPORTED_MODULE_31__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ id: blockElementId, ref: this.setBlockListRef, onMouseOver: this.maybeHover, onMouseOverHandled: this.hideHoverEffects, onMouseLeave: this.hideHoverEffects, className: wrapperClassName, "data-type": block.name, onTouchStart: this.onTouchStart, onFocus: this.onFocus, onClick: this.onClick, onKeyDown: this.deleteOrInsertAfterWrapper, tabIndex: "0", "aria-label": blockLabel, childHandledEvents: ['onDragStart', 'onMouseDown'] }, wrapperProps), shouldShowInsertionPoint && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_insertion_point__WEBPACK_IMPORTED_MODULE_30__["default"], { clientId: clientId, rootClientId: rootClientId, layout: layout, canShowInserter: canShowInBetweenInserter, onInsert: this.hideHoverEffects }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_drop_zone__WEBPACK_IMPORTED_MODULE_21__["default"], { index: order, clientId: clientId, rootClientId: rootClientId, layout: layout }), shouldRenderMovers && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_mover__WEBPACK_IMPORTED_MODULE_20__["default"], { clientIds: clientId, blockElementId: blockElementId, isFirst: isFirst, isLast: isLast, isHidden: !(isHovered || isSelected) || hoverArea !== 'left', isDraggable: isDraggable !== false && !isPartOfMultiSelection && isMovable, onDragStart: this.onDragStart, onDragEnd: this.onDragEnd }), shouldShowBreadcrumb && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_breadcrumb__WEBPACK_IMPORTED_MODULE_26__["default"], { clientId: clientId, isHidden: !(isHovered || isSelected) || hoverArea !== 'left' }), shouldShowContextualToolbar && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_contextual_toolbar__WEBPACK_IMPORTED_MODULE_27__["default"], null), isFirstMultiSelected && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_multi_controls__WEBPACK_IMPORTED_MODULE_28__["default"], { rootClientId: rootClientId }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_ignore_nested_events__WEBPACK_IMPORTED_MODULE_31__["default"], { ref: this.bindBlockNode, onDragStart: this.preventDrag, onMouseDown: this.onPointerDown, className: "editor-block-list__block-edit", "data-block": clientId }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_crash_boundary__WEBPACK_IMPORTED_MODULE_24__["default"], { onError: this.onBlockError }, isValid && blockEdit, isValid && mode === 'html' && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_html__WEBPACK_IMPORTED_MODULE_25__["default"], { clientId: clientId }), !isValid && [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_invalid_warning__WEBPACK_IMPORTED_MODULE_22__["default"], { key: "invalid-warning", block: block }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { key: "invalid-preview" }, Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__["getSaveElement"])(blockType, block.attributes))]), shouldShowMobileToolbar && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_mobile_toolbar__WEBPACK_IMPORTED_MODULE_29__["default"], { clientId: clientId }), !!error && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_crash_warning__WEBPACK_IMPORTED_MODULE_23__["default"], null)), showEmptyBlockSideInserter && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { className: "editor-block-list__side-inserter" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_inserter_with_shortcuts__WEBPACK_IMPORTED_MODULE_32__["default"], { clientId: clientId, rootClientId: rootClientId, layout: layout, onToggle: this.selectOnOpen })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { className: "editor-block-list__empty-block-inserter" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_inserter__WEBPACK_IMPORTED_MODULE_33__["default"], { position: "top right", onToggle: this.selectOnOpen })))); /* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */ } }]); return BlockListBlock; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]); var applyWithSelect = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_16__["withSelect"])(function (select, _ref) { var clientId = _ref.clientId, rootClientId = _ref.rootClientId, isLargeViewport = _ref.isLargeViewport; var _select = select('core/editor'), isBlockSelected = _select.isBlockSelected, getPreviousBlockClientId = _select.getPreviousBlockClientId, getNextBlockClientId = _select.getNextBlockClientId, getBlock = _select.getBlock, isAncestorMultiSelected = _select.isAncestorMultiSelected, isBlockMultiSelected = _select.isBlockMultiSelected, isFirstMultiSelectedBlock = _select.isFirstMultiSelectedBlock, isMultiSelecting = _select.isMultiSelecting, isTyping = _select.isTyping, getBlockIndex = _select.getBlockIndex, getEditedPostAttribute = _select.getEditedPostAttribute, getBlockMode = _select.getBlockMode, isSelectionEnabled = _select.isSelectionEnabled, getSelectedBlocksInitialCaretPosition = _select.getSelectedBlocksInitialCaretPosition, getEditorSettings = _select.getEditorSettings, hasSelectedInnerBlock = _select.hasSelectedInnerBlock, getTemplateLock = _select.getTemplateLock, hasMultiSelection = _select.hasMultiSelection; var isSelected = isBlockSelected(clientId); var _getEditorSettings = getEditorSettings(), hasFixedToolbar = _getEditorSettings.hasFixedToolbar, focusMode = _getEditorSettings.focusMode; var block = getBlock(clientId); var previousBlockClientId = getPreviousBlockClientId(clientId); var previousBlock = getBlock(previousBlockClientId); var templateLock = getTemplateLock(rootClientId); var isParentOfSelectedBlock = hasSelectedInnerBlock(clientId, true); return { nextBlockClientId: getNextBlockClientId(clientId), isPartOfMultiSelection: isBlockMultiSelected(clientId) || isAncestorMultiSelected(clientId), isFirstMultiSelected: isFirstMultiSelectedBlock(clientId), isMultiSelecting: isMultiSelecting(), hasSelectedInnerBlock: hasSelectedInnerBlock(clientId, false), // We only care about this prop when the block is selected // Thus to avoid unnecessary rerenders we avoid updating the prop if the block is not selected. isTypingWithinBlock: (isSelected || isParentOfSelectedBlock) && isTyping(), order: getBlockIndex(clientId, rootClientId), meta: getEditedPostAttribute('meta'), mode: getBlockMode(clientId), isSelectionEnabled: isSelectionEnabled(), initialPosition: getSelectedBlocksInitialCaretPosition(), isEmptyDefaultBlock: block && Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__["isUnmodifiedDefaultBlock"])(block), isPreviousBlockADefaultEmptyBlock: previousBlock && Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__["isUnmodifiedDefaultBlock"])(previousBlock), isMovable: 'all' !== templateLock, isLocked: !!templateLock, isFocusMode: focusMode && isLargeViewport, hasFixedToolbar: hasFixedToolbar && isLargeViewport, previousBlockClientId: previousBlockClientId, block: block, isSelected: isSelected, isParentOfSelectedBlock: isParentOfSelectedBlock, hasMultiSelection: hasMultiSelection() }; }); var applyWithDispatch = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_16__["withDispatch"])(function (dispatch, ownProps) { var _dispatch = dispatch('core/editor'), updateBlockAttributes = _dispatch.updateBlockAttributes, selectBlock = _dispatch.selectBlock, insertBlocks = _dispatch.insertBlocks, insertDefaultBlock = _dispatch.insertDefaultBlock, removeBlock = _dispatch.removeBlock, mergeBlocks = _dispatch.mergeBlocks, replaceBlocks = _dispatch.replaceBlocks, editPost = _dispatch.editPost, _toggleSelection = _dispatch.toggleSelection; return { onChange: function onChange(clientId, attributes) { updateBlockAttributes(clientId, attributes); }, onSelect: function onSelect() { var clientId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ownProps.clientId; var initialPosition = arguments.length > 1 ? arguments[1] : undefined; selectBlock(clientId, initialPosition); }, onInsertBlocks: function onInsertBlocks(blocks, index) { var rootClientId = ownProps.rootClientId, layout = ownProps.layout; blocks = blocks.map(function (block) { return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__["cloneBlock"])(block, { layout: layout }); }); insertBlocks(blocks, index, rootClientId); }, onInsertDefaultBlockAfter: function onInsertDefaultBlockAfter() { var order = ownProps.order, rootClientId = ownProps.rootClientId; insertDefaultBlock({}, rootClientId, order + 1); }, onRemove: function onRemove(clientId) { removeBlock(clientId); }, onMerge: function onMerge() { mergeBlocks.apply(void 0, arguments); }, onReplace: function onReplace(blocks) { var layout = ownProps.layout; blocks = Object(lodash__WEBPACK_IMPORTED_MODULE_10__["castArray"])(blocks).map(function (block) { return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_13__["cloneBlock"])(block, { layout: layout }); }); replaceBlocks([ownProps.clientId], blocks); }, onMetaChange: function onMetaChange(meta) { editPost({ meta: meta }); }, toggleSelection: function toggleSelection(selectionEnabled) { _toggleSelection(selectionEnabled); } }; }); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_18__["compose"])(Object(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_17__["withViewportMatch"])({ isLargeViewport: 'medium' }), applyWithSelect, applyWithDispatch, Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_14__["withFilters"])('editor.BlockListBlock'), _with_hover_areas__WEBPACK_IMPORTED_MODULE_34__["default"])(BlockListBlock)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/breadcrumb.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-list/breadcrumb.js ***! \*****************************************************************************************/ /*! exports provided: BlockBreadcrumb, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockBreadcrumb", function() { return BlockBreadcrumb; }); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _block_title__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../block-title */ "./node_modules/@wordpress/editor/build-module/components/block-title/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Block breadcrumb component, displaying the label of the block. If the block * descends from a root block, a button is displayed enabling the user to select * the root block. * * @param {string} props.clientId Client ID of block. * @param {string} props.rootClientId Client ID of block's root. * @param {Function} props.selectRootBlock Callback to select root block. */ var BlockBreadcrumb = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockBreadcrumb, _Component); function BlockBreadcrumb() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockBreadcrumb); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockBreadcrumb).apply(this, arguments)); _this.state = { isFocused: false }; _this.onFocus = _this.onFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.onBlur = _this.onBlur.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockBreadcrumb, [{ key: "onFocus", value: function onFocus(event) { this.setState({ isFocused: true }); // This is used for improved interoperability // with the block's `onFocus` handler which selects the block, thus conflicting // with the intention to select the root block. event.stopPropagation(); } }, { key: "onBlur", value: function onBlur() { this.setState({ isFocused: false }); } }, { key: "render", value: function render() { var _this$props = this.props, clientId = _this$props.clientId, rootClientId = _this$props.rootClientId, isLight = _this$props.isLight; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { className: classnames__WEBPACK_IMPORTED_MODULE_7___default()('editor-block-list__breadcrumb', { 'is-light': isLight }) }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Toolbar"], null, rootClientId && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_block_title__WEBPACK_IMPORTED_MODULE_11__["default"], { clientId: rootClientId }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", { className: "editor-block-list__descendant-arrow" })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_block_title__WEBPACK_IMPORTED_MODULE_11__["default"], { clientId: clientId }))); } }]); return BlockBreadcrumb; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withSelect"])(function (select, ownProps) { var _select = select('core/editor'), getBlockRootClientId = _select.getBlockRootClientId, getEditorSettings = _select.getEditorSettings; var clientId = ownProps.clientId; return { rootClientId: getBlockRootClientId(clientId), isLight: getEditorSettings().hasFixedToolbar }; })])(BlockBreadcrumb)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/index.js": /*!************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-list/index.js ***! \************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _block__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./block */ "./node_modules/@wordpress/editor/build-module/components/block-list/block.js"); /* harmony import */ var _block_list_appender__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../block-list-appender */ "./node_modules/@wordpress/editor/build-module/components/block-list-appender/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var BlockList = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(BlockList, _Component); function BlockList(props) { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, BlockList); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(BlockList).call(this, props)); _this.onSelectionStart = _this.onSelectionStart.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.onSelectionEnd = _this.onSelectionEnd.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.onShiftSelection = _this.onShiftSelection.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.setBlockRef = _this.setBlockRef.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.setLastClientY = _this.setLastClientY.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.onPointerMove = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["throttle"])(_this.onPointerMove.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))), 100); // Browser does not fire `*move` event when the pointer position changes // relative to the document, so fire it with the last known position. _this.onScroll = function () { return _this.onPointerMove({ clientY: _this.lastClientY }); }; _this.lastClientY = 0; _this.nodes = {}; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockList, [{ key: "componentDidMount", value: function componentDidMount() { window.addEventListener('mousemove', this.setLastClientY); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { window.removeEventListener('mousemove', this.setLastClientY); } }, { key: "setLastClientY", value: function setLastClientY(_ref) { var clientY = _ref.clientY; this.lastClientY = clientY; } }, { key: "setBlockRef", value: function setBlockRef(node, clientId) { if (node === null) { delete this.nodes[clientId]; } else { this.nodes = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, this.nodes, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, clientId, node)); } } /** * Handles a pointer move event to update the extent of the current cursor * multi-selection. * * @param {MouseEvent} event A mousemove event object. * * @return {void} */ }, { key: "onPointerMove", value: function onPointerMove(_ref2) { var clientY = _ref2.clientY; // We don't start multi-selection until the mouse starts moving, so as // to avoid dispatching multi-selection actions on an in-place click. if (!this.props.isMultiSelecting) { this.props.onStartMultiSelect(); } var boundaries = this.nodes[this.selectionAtStart].getBoundingClientRect(); var y = clientY - boundaries.top; var key = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["findLast"])(this.coordMapKeys, function (coordY) { return coordY < y; }); this.onSelectionChange(this.coordMap[key]); } /** * Binds event handlers to the document for tracking a pending multi-select * in response to a mousedown event occurring in a rendered block. * * @param {string} clientId Client ID of block where mousedown occurred. * * @return {void} */ }, { key: "onSelectionStart", value: function onSelectionStart(clientId) { if (!this.props.isSelectionEnabled) { return; } var boundaries = this.nodes[clientId].getBoundingClientRect(); // Create a clientId to Y coördinate map. var clientIdToCoordMap = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["mapValues"])(this.nodes, function (node) { return node.getBoundingClientRect().top - boundaries.top; }); // Cache a Y coördinate to clientId map for use in `onPointerMove`. this.coordMap = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["invert"])(clientIdToCoordMap); // Cache an array of the Y coördinates for use in `onPointerMove`. // Sort the coördinates, as `this.nodes` will not necessarily reflect // the current block sequence. this.coordMapKeys = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["sortBy"])(Object.values(clientIdToCoordMap)); this.selectionAtStart = clientId; window.addEventListener('mousemove', this.onPointerMove); // Capture scroll on all elements. window.addEventListener('scroll', this.onScroll, true); window.addEventListener('mouseup', this.onSelectionEnd); } /** * Handles multi-selection changes in response to pointer move. * * @param {string} clientId Client ID of block under cursor in multi-select * drag. */ }, { key: "onSelectionChange", value: function onSelectionChange(clientId) { var _this$props = this.props, onMultiSelect = _this$props.onMultiSelect, selectionStart = _this$props.selectionStart, selectionEnd = _this$props.selectionEnd; var selectionAtStart = this.selectionAtStart; var isAtStart = selectionAtStart === clientId; if (!selectionAtStart || !this.props.isSelectionEnabled) { return; } // If multi-selecting and cursor extent returns to the start of // selection, cancel multi-select. if (isAtStart && selectionStart) { onMultiSelect(null, null); } // Expand multi-selection to block under cursor. if (!isAtStart && selectionEnd !== clientId) { onMultiSelect(selectionAtStart, clientId); } } /** * Handles a mouseup event to end the current cursor multi-selection. * * @return {void} */ }, { key: "onSelectionEnd", value: function onSelectionEnd() { // Cancel throttled calls. this.onPointerMove.cancel(); delete this.coordMap; delete this.coordMapKeys; delete this.selectionAtStart; window.removeEventListener('mousemove', this.onPointerMove); window.removeEventListener('scroll', this.onScroll, true); window.removeEventListener('mouseup', this.onSelectionEnd); // We may or may not be in a multi-selection when mouseup occurs (e.g. // an in-place mouse click), so only trigger stop if multi-selecting. if (this.props.isMultiSelecting) { this.props.onStopMultiSelect(); } } }, { key: "onShiftSelection", value: function onShiftSelection(clientId) { if (!this.props.isSelectionEnabled) { return; } var _this$props2 = this.props, selectionStartClientId = _this$props2.selectionStartClientId, onMultiSelect = _this$props2.onMultiSelect, onSelect = _this$props2.onSelect; if (selectionStartClientId) { onMultiSelect(selectionStartClientId, clientId); } else { onSelect(clientId); } } }, { key: "render", value: function render() { var _this2 = this; var _this$props3 = this.props, blockClientIds = _this$props3.blockClientIds, layout = _this$props3.layout, isGroupedByLayout = _this$props3.isGroupedByLayout, rootClientId = _this$props3.rootClientId, isDraggable = _this$props3.isDraggable; var defaultLayout; if (isGroupedByLayout) { defaultLayout = layout; } var classes = classnames__WEBPACK_IMPORTED_MODULE_10___default()('editor-block-list__layout', Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, "layout-".concat(layout), layout)); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { className: classes }, Object(lodash__WEBPACK_IMPORTED_MODULE_9__["map"])(blockClientIds, function (clientId, blockIndex) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block__WEBPACK_IMPORTED_MODULE_13__["default"], { key: 'block-' + clientId, index: blockIndex, clientId: clientId, blockRef: _this2.setBlockRef, onSelectionStart: _this2.onSelectionStart, onShiftSelection: _this2.onShiftSelection, rootClientId: rootClientId, layout: defaultLayout, isFirst: blockIndex === 0, isLast: blockIndex === blockClientIds.length - 1, isDraggable: isDraggable }); }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_block_list_appender__WEBPACK_IMPORTED_MODULE_14__["default"], { rootClientId: rootClientId, layout: layout, isGroupedByLayout: isGroupedByLayout })); } }]); return BlockList; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withSelect"])(function (select, ownProps) { var _select = select('core/editor'), getBlockOrder = _select.getBlockOrder, isSelectionEnabled = _select.isSelectionEnabled, isMultiSelecting = _select.isMultiSelecting, getMultiSelectedBlocksStartClientId = _select.getMultiSelectedBlocksStartClientId, getMultiSelectedBlocksEndClientId = _select.getMultiSelectedBlocksEndClientId, getBlockSelectionStart = _select.getBlockSelectionStart; var rootClientId = ownProps.rootClientId; return { blockClientIds: getBlockOrder(rootClientId), selectionStart: getMultiSelectedBlocksStartClientId(), selectionEnd: getMultiSelectedBlocksEndClientId(), selectionStartClientId: getBlockSelectionStart(), isSelectionEnabled: isSelectionEnabled(), isMultiSelecting: isMultiSelecting() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), startMultiSelect = _dispatch.startMultiSelect, stopMultiSelect = _dispatch.stopMultiSelect, multiSelect = _dispatch.multiSelect, selectBlock = _dispatch.selectBlock; return { onStartMultiSelect: startMultiSelect, onStopMultiSelect: stopMultiSelect, onMultiSelect: multiSelect, onSelect: selectBlock }; })])(BlockList)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/insertion-point.js": /*!**********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-list/insertion-point.js ***! \**********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__); /** * External dependencies */ /** * WordPress dependencies */ var BlockInsertionPoint = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(BlockInsertionPoint, _Component); function BlockInsertionPoint() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, BlockInsertionPoint); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockInsertionPoint).apply(this, arguments)); _this.state = { isInserterFocused: false }; _this.onBlurInserter = _this.onBlurInserter.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.onFocusInserter = _this.onFocusInserter.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.onClick = _this.onClick.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(BlockInsertionPoint, [{ key: "onFocusInserter", value: function onFocusInserter(event) { // We stop propagation of the focus event to avoid selecting the current block // While we're trying to insert a new block event.stopPropagation(); this.setState({ isInserterFocused: true }); } }, { key: "onBlurInserter", value: function onBlurInserter() { this.setState({ isInserterFocused: false }); } }, { key: "onClick", value: function onClick() { var _this$props = this.props, layout = _this$props.layout, rootClientId = _this$props.rootClientId, index = _this$props.index, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__["default"])(_this$props, ["layout", "rootClientId", "index"]); props.insertDefaultBlock({ layout: layout }, rootClientId, index); props.startTyping(); this.onBlurInserter(); if (props.onInsert) { this.props.onInsert(); } } }, { key: "render", value: function render() { var isInserterFocused = this.state.isInserterFocused; var _this$props2 = this.props, showInsertionPoint = _this$props2.showInsertionPoint, showInserter = _this$props2.showInserter; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", { className: "editor-block-list__insertion-point" }, showInsertionPoint && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", { className: "editor-block-list__insertion-point-indicator" }), showInserter && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", { className: classnames__WEBPACK_IMPORTED_MODULE_8___default()('editor-block-list__insertion-point-inserter', { 'is-visible': isInserterFocused }) }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["IconButton"], { icon: "insert", className: "editor-block-list__insertion-point-button", onClick: this.onClick, label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Insert block'), onFocus: this.onFocusInserter, onBlur: this.onBlurInserter }))); } }]); return BlockInsertionPoint; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withSelect"])(function (select, _ref) { var clientId = _ref.clientId, rootClientId = _ref.rootClientId, canShowInserter = _ref.canShowInserter; var _select = select('core/editor'), canInsertBlockType = _select.canInsertBlockType, getBlockIndex = _select.getBlockIndex, getBlockInsertionPoint = _select.getBlockInsertionPoint, getBlock = _select.getBlock, isBlockInsertionPointVisible = _select.isBlockInsertionPointVisible, isTyping = _select.isTyping; var _select2 = select('core/blocks'), getDefaultBlockName = _select2.getDefaultBlockName; var blockIndex = clientId ? getBlockIndex(clientId, rootClientId) : -1; var insertIndex = blockIndex; var insertionPoint = getBlockInsertionPoint(); var block = clientId ? getBlock(clientId) : null; var showInsertionPoint = isBlockInsertionPointVisible() && insertionPoint.index === insertIndex && insertionPoint.rootClientId === rootClientId && (!block || !Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["isUnmodifiedDefaultBlock"])(block)); var defaultBlockName = getDefaultBlockName(); return { canInsertDefaultBlock: canInsertBlockType(defaultBlockName, rootClientId), showInserter: !isTyping() && canShowInserter, index: insertIndex, showInsertionPoint: showInsertionPoint }; }), Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__["ifCondition"])(function (_ref2) { var canInsertDefaultBlock = _ref2.canInsertDefaultBlock; return canInsertDefaultBlock; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), insertDefaultBlock = _dispatch.insertDefaultBlock, startTyping = _dispatch.startTyping; return { insertDefaultBlock: insertDefaultBlock, startTyping: startTyping }; }))(BlockInsertionPoint)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/multi-controls.js": /*!*********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-list/multi-controls.js ***! \*********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _block_mover__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../block-mover */ "./node_modules/@wordpress/editor/build-module/components/block-mover/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function BlockListMultiControls(_ref) { var multiSelectedBlockClientIds = _ref.multiSelectedBlockClientIds, clientId = _ref.clientId, isSelecting = _ref.isSelecting, isFirst = _ref.isFirst, isLast = _ref.isLast; if (isSelecting) { return null; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_mover__WEBPACK_IMPORTED_MODULE_3__["default"], { key: "mover", clientId: clientId, clientIds: multiSelectedBlockClientIds, isFirst: isFirst, isLast: isLast }); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select, _ref2) { var clientId = _ref2.clientId; var _select = select('core/editor'), getMultiSelectedBlockClientIds = _select.getMultiSelectedBlockClientIds, isMultiSelecting = _select.isMultiSelecting, getBlockIndex = _select.getBlockIndex, getBlockCount = _select.getBlockCount; var clientIds = getMultiSelectedBlockClientIds(); var firstIndex = getBlockIndex(Object(lodash__WEBPACK_IMPORTED_MODULE_1__["first"])(clientIds), clientId); var lastIndex = getBlockIndex(Object(lodash__WEBPACK_IMPORTED_MODULE_1__["last"])(clientIds), clientId); return { multiSelectedBlockClientIds: clientIds, isSelecting: isMultiSelecting(), isFirst: firstIndex === 0, isLast: lastIndex + 1 === getBlockCount() }; })(BlockListMultiControls)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-list/with-hover-areas.js": /*!***********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-list/with-hover-areas.js ***! \***********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__); /** * WordPress dependencies */ var withHoverAreas = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["createHigherOrderComponent"])(function (WrappedComponent) { var WithHoverAreasComponent = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(WithHoverAreasComponent, _Component); function WithHoverAreasComponent() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, WithHoverAreasComponent); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(WithHoverAreasComponent).apply(this, arguments)); _this.state = { hoverArea: null }; _this.onMouseLeave = _this.onMouseLeave.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.onMouseMove = _this.onMouseMove.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(WithHoverAreasComponent, [{ key: "componentDidMount", value: function componentDidMount() { // Disable reason: We use findDOMNode to avoid unnecessary extra dom Nodes // eslint-disable-next-line react/no-find-dom-node this.container = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["findDOMNode"])(this); this.container.addEventListener('mousemove', this.onMouseMove); this.container.addEventListener('mouseleave', this.onMouseLeave); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.container.removeEventListener('mousemove', this.onMouseMove); this.container.removeEventListener('mouseleave', this.onMouseLeave); } }, { key: "onMouseLeave", value: function onMouseLeave() { if (this.state.hoverArea) { this.setState({ hoverArea: null }); } } }, { key: "onMouseMove", value: function onMouseMove(event) { var isRTL = this.props.isRTL; var _this$container$getBo = this.container.getBoundingClientRect(), width = _this$container$getBo.width, left = _this$container$getBo.left, right = _this$container$getBo.right; var hoverArea = null; if (event.clientX - left < width / 3) { hoverArea = isRTL ? 'right' : 'left'; } else if (right - event.clientX < width / 3) { hoverArea = isRTL ? 'left' : 'right'; } if (hoverArea !== this.state.hoverArea) { this.setState({ hoverArea: hoverArea }); } } }, { key: "render", value: function render() { var hoverArea = this.state.hoverArea; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(WrappedComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, this.props, { hoverArea: hoverArea })); } }]); return WithHoverAreasComponent; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__["withSelect"])(function (select) { return { isRTL: select('core/editor').getEditorSettings().isRTL }; })(WithHoverAreasComponent); }); /* harmony default export */ __webpack_exports__["default"] = (withHoverAreas); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-mover/drag-handle.js": /*!*******************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-mover/drag-handle.js ***! \*******************************************************************************************/ /*! exports provided: IconDragHandle */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IconDragHandle", function() { return IconDragHandle; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _block_draggable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../block-draggable */ "./node_modules/@wordpress/editor/build-module/components/block-draggable/index.js"); /** * External dependencies */ /** * WordPress dependencies */ var IconDragHandle = function IconDragHandle(_ref) { var isVisible = _ref.isVisible, className = _ref.className, icon = _ref.icon, onDragStart = _ref.onDragStart, onDragEnd = _ref.onDragEnd, blockElementId = _ref.blockElementId, clientId = _ref.clientId; if (!isVisible) { return null; } var dragHandleClassNames = classnames__WEBPACK_IMPORTED_MODULE_1___default()('editor-block-mover__control-drag-handle', className); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_draggable__WEBPACK_IMPORTED_MODULE_2__["default"], { clientId: clientId, blockElementId: blockElementId, onDragStart: onDragStart, onDragEnd: onDragEnd }, function (_ref2) { var onDraggableStart = _ref2.onDraggableStart, onDraggableEnd = _ref2.onDraggableEnd; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: dragHandleClassNames, "aria-hidden": "true", onDragStart: onDraggableStart, onDragEnd: onDraggableEnd, draggable: true }, icon); }); }; /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-mover/icons.js": /*!*************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-mover/icons.js ***! \*************************************************************************************/ /*! exports provided: upArrow, downArrow, dragHandle */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "upArrow", function() { return upArrow; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downArrow", function() { return downArrow; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dragHandle", function() { return dragHandle; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ var upArrow = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["SVG"], { width: "18", height: "18", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 18 18" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Polygon"], { points: "9,4.5 3.3,10.1 4.8,11.5 9,7.3 13.2,11.5 14.7,10.1 " })); var downArrow = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["SVG"], { width: "18", height: "18", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 18 18" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Polygon"], { points: "9,13.5 14.7,7.9 13.2,6.5 9,10.7 4.8,6.5 3.3,7.9 " })); var dragHandle = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["SVG"], { width: "18", height: "18", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 18 18" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Path"], { d: "M13,8c0.6,0,1-0.4,1-1s-0.4-1-1-1s-1,0.4-1,1S12.4,8,13,8z M5,6C4.4,6,4,6.4,4,7s0.4,1,1,1s1-0.4,1-1S5.6,6,5,6z M5,10 c-0.6,0-1,0.4-1,1s0.4,1,1,1s1-0.4,1-1S5.6,10,5,10z M13,10c-0.6,0-1,0.4-1,1s0.4,1,1,1s1-0.4,1-1S13.6,10,13,10z M9,6 C8.4,6,8,6.4,8,7s0.4,1,1,1s1-0.4,1-1S9.6,6,9,6z M9,10c-0.6,0-1,0.4-1,1s0.4,1,1,1s1-0.4,1-1S9.6,10,9,10z" })); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-mover/index.js": /*!*************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-mover/index.js ***! \*************************************************************************************/ /*! exports provided: BlockMover, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockMover", function() { return BlockMover; }); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _mover_description__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./mover-description */ "./node_modules/@wordpress/editor/build-module/components/block-mover/mover-description.js"); /* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./icons */ "./node_modules/@wordpress/editor/build-module/components/block-mover/icons.js"); /* harmony import */ var _drag_handle__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./drag-handle */ "./node_modules/@wordpress/editor/build-module/components/block-mover/drag-handle.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var BlockMover = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockMover, _Component); function BlockMover() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockMover); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockMover).apply(this, arguments)); _this.state = { isFocused: false }; _this.onFocus = _this.onFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.onBlur = _this.onBlur.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockMover, [{ key: "onFocus", value: function onFocus() { this.setState({ isFocused: true }); } }, { key: "onBlur", value: function onBlur() { this.setState({ isFocused: false }); } }, { key: "render", value: function render() { var _this$props = this.props, onMoveUp = _this$props.onMoveUp, onMoveDown = _this$props.onMoveDown, isFirst = _this$props.isFirst, isLast = _this$props.isLast, isDraggable = _this$props.isDraggable, onDragStart = _this$props.onDragStart, onDragEnd = _this$props.onDragEnd, clientIds = _this$props.clientIds, blockElementId = _this$props.blockElementId, blockType = _this$props.blockType, firstIndex = _this$props.firstIndex, isLocked = _this$props.isLocked, instanceId = _this$props.instanceId, isHidden = _this$props.isHidden; var isFocused = this.state.isFocused; var blocksCount = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["castArray"])(clientIds).length; if (isLocked || isFirst && isLast) { return null; } // We emulate a disabled state because forcefully applying the `disabled` // attribute on the button while it has focus causes the screen to change // to an unfocused state (body as active element) without firing blur on, // the rendering parent, leaving it unable to react to focus out. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { className: classnames__WEBPACK_IMPORTED_MODULE_8___default()('editor-block-mover', { 'is-visible': isFocused || !isHidden }) }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["IconButton"], { className: "editor-block-mover__control", onClick: isFirst ? null : onMoveUp, icon: _icons__WEBPACK_IMPORTED_MODULE_15__["upArrow"], label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Move up'), "aria-describedby": "editor-block-mover__up-description-".concat(instanceId), "aria-disabled": isFirst, onFocus: this.onFocus, onBlur: this.onBlur }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_drag_handle__WEBPACK_IMPORTED_MODULE_16__["IconDragHandle"], { className: "editor-block-mover__control", icon: _icons__WEBPACK_IMPORTED_MODULE_15__["dragHandle"], clientId: clientIds, blockElementId: blockElementId, isVisible: isDraggable, onDragStart: onDragStart, onDragEnd: onDragEnd }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["IconButton"], { className: "editor-block-mover__control", onClick: isLast ? null : onMoveDown, icon: _icons__WEBPACK_IMPORTED_MODULE_15__["downArrow"], label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Move down'), "aria-describedby": "editor-block-mover__down-description-".concat(instanceId), "aria-disabled": isLast, onFocus: this.onFocus, onBlur: this.onBlur }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", { id: "editor-block-mover__up-description-".concat(instanceId), className: "editor-block-mover__description" }, Object(_mover_description__WEBPACK_IMPORTED_MODULE_14__["getBlockMoverDescription"])(blocksCount, blockType && blockType.title, firstIndex, isFirst, isLast, -1)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", { id: "editor-block-mover__down-description-".concat(instanceId), className: "editor-block-mover__description" }, Object(_mover_description__WEBPACK_IMPORTED_MODULE_14__["getBlockMoverDescription"])(blocksCount, blockType && blockType.title, firstIndex, isFirst, isLast, 1))); } }]); return BlockMover; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withSelect"])(function (select, _ref) { var clientIds = _ref.clientIds; var _select = select('core/editor'), getBlock = _select.getBlock, getBlockIndex = _select.getBlockIndex, getTemplateLock = _select.getTemplateLock, getBlockRootClientId = _select.getBlockRootClientId; var firstClientId = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["first"])(Object(lodash__WEBPACK_IMPORTED_MODULE_7__["castArray"])(clientIds)); var block = getBlock(firstClientId); var rootClientId = getBlockRootClientId(Object(lodash__WEBPACK_IMPORTED_MODULE_7__["first"])(Object(lodash__WEBPACK_IMPORTED_MODULE_7__["castArray"])(clientIds))); return { firstIndex: getBlockIndex(firstClientId, rootClientId), blockType: block ? Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__["getBlockType"])(block.name) : null, isLocked: getTemplateLock(rootClientId) === 'all', rootClientId: rootClientId }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withDispatch"])(function (dispatch, _ref2) { var clientIds = _ref2.clientIds, rootClientId = _ref2.rootClientId; var _dispatch = dispatch('core/editor'), moveBlocksDown = _dispatch.moveBlocksDown, moveBlocksUp = _dispatch.moveBlocksUp; return { onMoveDown: Object(lodash__WEBPACK_IMPORTED_MODULE_7__["partial"])(moveBlocksDown, clientIds, rootClientId), onMoveUp: Object(lodash__WEBPACK_IMPORTED_MODULE_7__["partial"])(moveBlocksUp, clientIds, rootClientId) }; }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__["withInstanceId"])(BlockMover)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-mover/mover-description.js": /*!*************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-mover/mover-description.js ***! \*************************************************************************************************/ /*! exports provided: getBlockMoverDescription, getMultiBlockMoverDescription */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlockMoverDescription", function() { return getBlockMoverDescription; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMultiBlockMoverDescription", function() { return getMultiBlockMoverDescription; }); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); /** * WordPress dependencies */ /** * Return a label for the block movement controls depending on block position. * * @param {number} selectedCount Number of blocks selected. * @param {string} type Block type - in the case of a single block, should * define its 'type'. I.e. 'Text', 'Heading', 'Image' etc. * @param {number} firstIndex The index (position - 1) of the first block selected. * @param {boolean} isFirst This is the first block. * @param {boolean} isLast This is the last block. * @param {number} dir Direction of movement (> 0 is considered to be going * down, < 0 is up). * * @return {string} Label for the block movement controls. */ function getBlockMoverDescription(selectedCount, type, firstIndex, isFirst, isLast, dir) { var position = firstIndex + 1; if (selectedCount > 1) { return getMultiBlockMoverDescription(selectedCount, firstIndex, isFirst, isLast, dir); } if (isFirst && isLast) { // translators: %s: Type of block (i.e. Text, Image etc) return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Block %s is the only block, and cannot be moved'), type); } if (dir > 0 && !isLast) { // moving down return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["sprintf"])( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Move %1$s block from position %2$d down to position %3$d'), type, position, position + 1); } if (dir > 0 && isLast) { // moving down, and is the last item // translators: %s: Type of block (i.e. Text, Image etc) return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Block %s is at the end of the content and can’t be moved down'), type); } if (dir < 0 && !isFirst) { // moving up return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["sprintf"])( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Move %1$s block from position %2$d up to position %3$d'), type, position, position - 1); } if (dir < 0 && isFirst) { // moving up, and is the first item // translators: %s: Type of block (i.e. Text, Image etc) return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Block %s is at the beginning of the content and can’t be moved up'), type); } } /** * Return a label for the block movement controls depending on block position. * * @param {number} selectedCount Number of blocks selected. * @param {number} firstIndex The index (position - 1) of the first block selected. * @param {boolean} isFirst This is the first block. * @param {boolean} isLast This is the last block. * @param {number} dir Direction of movement (> 0 is considered to be going * down, < 0 is up). * * @return {string} Label for the block movement controls. */ function getMultiBlockMoverDescription(selectedCount, firstIndex, isFirst, isLast, dir) { var position = firstIndex + 1; if (dir < 0 && isFirst) { return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Blocks cannot be moved up as they are already at the top'); } if (dir > 0 && isLast) { return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Blocks cannot be moved down as they are already at the bottom'); } if (dir < 0 && !isFirst) { return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["sprintf"])( // translators: 1: Number of selected blocks, 2: Position of selected blocks Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["_n"])('Move %1$d block from position %2$d up by one place', 'Move %1$d blocks from position %2$d up by one place', selectedCount), selectedCount, position); } if (dir > 0 && !isLast) { return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["sprintf"])( // translators: 1: Number of selected blocks, 2: Position of selected blocks Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["_n"])('Move %1$d block from position %2$d down by one place', 'Move %1$d blocks from position %2$d down by one place', selectedCount), selectedCount, position); } } /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-preview/index.js": /*!***************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-preview/index.js ***! \***************************************************************************************/ /*! exports provided: BlockPreviewContent, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockPreviewContent", function() { return BlockPreviewContent; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _block_edit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../block-edit */ "./node_modules/@wordpress/editor/build-module/components/block-edit/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Block Preview Component: It renders a preview given a block name and attributes. * * @param {Object} props Component props. * * @return {WPElement} Rendered element. */ function BlockPreview(props) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-block-preview" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-block-preview__title" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Preview')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(BlockPreviewContent, props)); } function BlockPreviewContent(_ref) { var name = _ref.name, attributes = _ref.attributes; var block = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["createBlock"])(name, attributes); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Disabled"], { className: "editor-block-preview__content", "aria-hidden": true }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_edit__WEBPACK_IMPORTED_MODULE_5__["default"], { name: name, focus: false, attributes: block.attributes, setAttributes: lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] })); } /* harmony default export */ __webpack_exports__["default"] = (BlockPreview); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-selection-clearer/index.js": /*!*************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-selection-clearer/index.js ***! \*************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__); /** * External dependencies */ /** * WordPress dependencies */ var BlockSelectionClearer = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(BlockSelectionClearer, _Component); function BlockSelectionClearer() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, BlockSelectionClearer); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockSelectionClearer).apply(this, arguments)); _this.bindContainer = _this.bindContainer.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.clearSelectionIfFocusTarget = _this.clearSelectionIfFocusTarget.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(BlockSelectionClearer, [{ key: "bindContainer", value: function bindContainer(ref) { this.container = ref; } /** * Clears the selected block on focus if the container is the target of the * focus. This assumes no other descendents have received focus until event * has bubbled to the container. * * @param {FocusEvent} event Focus event. */ }, { key: "clearSelectionIfFocusTarget", value: function clearSelectionIfFocusTarget(event) { var _this$props = this.props, hasSelectedBlock = _this$props.hasSelectedBlock, hasMultiSelection = _this$props.hasMultiSelection, clearSelectedBlock = _this$props.clearSelectedBlock; var hasSelection = hasSelectedBlock || hasMultiSelection; if (event.target === this.container && hasSelection) { clearSelectedBlock(); } } }, { key: "render", value: function render() { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ tabIndex: -1, onFocus: this.clearSelectionIfFocusTarget, ref: this.bindContainer }, Object(lodash__WEBPACK_IMPORTED_MODULE_8__["omit"])(this.props, ['clearSelectedBlock', 'hasSelectedBlock', 'hasMultiSelection']))); } }]); return BlockSelectionClearer; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withSelect"])(function (select) { var _select = select('core/editor'), hasSelectedBlock = _select.hasSelectedBlock, hasMultiSelection = _select.hasMultiSelection; return { hasSelectedBlock: hasSelectedBlock(), hasMultiSelection: hasMultiSelection() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), clearSelectedBlock = _dispatch.clearSelectedBlock; return { clearSelectedBlock: clearSelectedBlock }; })])(BlockSelectionClearer)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-convert-button.js": /*!************************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-convert-button.js ***! \************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockConvertButton; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); /** * WordPress dependencies */ function BlockConvertButton(_ref) { var shouldRender = _ref.shouldRender, onClick = _ref.onClick, small = _ref.small; if (!shouldRender) { return null; } var label = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Convert to Blocks'); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["MenuItem"], { className: "editor-block-settings-menu__control", onClick: onClick, icon: "screenoptions", label: small ? label : undefined }, !small && label); } /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-html-convert-button.js": /*!*****************************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-html-convert-button.js ***! \*****************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _block_convert_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block-convert-button */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-convert-button.js"); /** * WordPress dependencies */ /** * Internal dependencies */ /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select, _ref) { var clientId = _ref.clientId; var _select = select('core/editor'), getBlock = _select.getBlock, canUserUseUnfilteredHTML = _select.canUserUseUnfilteredHTML; var block = getBlock(clientId); return { block: block, canUserUseUnfilteredHTML: canUserUseUnfilteredHTML(), shouldRender: block && block.name === 'core/html' }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withDispatch"])(function (dispatch, _ref2) { var block = _ref2.block, canUserUseUnfilteredHTML = _ref2.canUserUseUnfilteredHTML; return { onClick: function onClick() { return dispatch('core/editor').replaceBlocks(block.clientId, Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["rawHandler"])({ HTML: Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["getBlockContent"])(block), mode: 'BLOCKS', canUserUseUnfilteredHTML: canUserUseUnfilteredHTML })); } }; }))(_block_convert_button__WEBPACK_IMPORTED_MODULE_3__["default"])); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-mode-toggle.js": /*!*********************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-mode-toggle.js ***! \*********************************************************************************************************/ /*! exports provided: BlockModeToggle, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockModeToggle", function() { return BlockModeToggle; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__); /** * External dependencies */ /** * WordPress dependencies */ function BlockModeToggle(_ref) { var blockType = _ref.blockType, mode = _ref.mode, onToggleMode = _ref.onToggleMode, _ref$small = _ref.small, small = _ref$small === void 0 ? false : _ref$small; if (!Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["hasBlockSupport"])(blockType, 'html', true)) { return null; } var label = mode === 'visual' ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Edit as HTML') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Edit visually'); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["MenuItem"], { className: "editor-block-settings-menu__control", onClick: onToggleMode, icon: "html", label: small ? label : undefined }, !small && label); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select, _ref2) { var clientId = _ref2.clientId; var _select = select('core/editor'), getBlock = _select.getBlock, getBlockMode = _select.getBlockMode; var block = getBlock(clientId); return { mode: getBlockMode(clientId), blockType: block ? Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["getBlockType"])(block.name) : null }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withDispatch"])(function (dispatch, _ref3) { var _ref3$onToggle = _ref3.onToggle, onToggle = _ref3$onToggle === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] : _ref3$onToggle, clientId = _ref3.clientId; return { onToggleMode: function onToggleMode() { dispatch('core/editor').toggleBlockMode(clientId); onToggle(); } }; })])(BlockModeToggle)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-settings-menu-first-item.js": /*!**********************************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-settings-menu-first-item.js ***! \**********************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); /** * WordPress dependencies */ var _createSlotFill = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('_BlockSettingsMenuFirstItem'), _BlockSettingsMenuFirstItem = _createSlotFill.Fill, Slot = _createSlotFill.Slot; _BlockSettingsMenuFirstItem.Slot = Slot; /* harmony default export */ __webpack_exports__["default"] = (_BlockSettingsMenuFirstItem); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-settings-menu-plugins-extension.js": /*!*****************************************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-settings-menu-plugins-extension.js ***! \*****************************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); /** * WordPress dependencies */ var _createSlotFill = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('_BlockSettingsMenuPluginsExtension'), _BlockSettingsMenuPluginsExtension = _createSlotFill.Fill, Slot = _createSlotFill.Slot; _BlockSettingsMenuPluginsExtension.Slot = Slot; /* harmony default export */ __webpack_exports__["default"] = (_BlockSettingsMenuPluginsExtension); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-unknown-convert-button.js": /*!********************************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-unknown-convert-button.js ***! \********************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _block_convert_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block-convert-button */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-convert-button.js"); /** * WordPress dependencies */ /** * Internal dependencies */ /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select, _ref) { var clientId = _ref.clientId; var _select = select('core/editor'), canUserUseUnfilteredHTML = _select.canUserUseUnfilteredHTML, getBlock = _select.getBlock; var block = getBlock(clientId); return { block: block, canUserUseUnfilteredHTML: canUserUseUnfilteredHTML(), shouldRender: block && block.name === Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["getUnknownTypeHandlerName"])() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withDispatch"])(function (dispatch, _ref2) { var block = _ref2.block, canUserUseUnfilteredHTML = _ref2.canUserUseUnfilteredHTML; return { onClick: function onClick() { return dispatch('core/editor').replaceBlocks(block.clientId, Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["rawHandler"])({ HTML: Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__["serialize"])(block), mode: 'BLOCKS', canUserUseUnfilteredHTML: canUserUseUnfilteredHTML })); } }; }))(_block_convert_button__WEBPACK_IMPORTED_MODULE_3__["default"])); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/index.js": /*!*********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/index.js ***! \*********************************************************************************************/ /*! exports provided: BlockSettingsMenu, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockSettingsMenu", function() { return BlockSettingsMenu; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _editor_global_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../editor-global-keyboard-shortcuts */ "./node_modules/@wordpress/editor/build-module/components/editor-global-keyboard-shortcuts/index.js"); /* harmony import */ var _block_actions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../block-actions */ "./node_modules/@wordpress/editor/build-module/components/block-actions/index.js"); /* harmony import */ var _block_mode_toggle__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./block-mode-toggle */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-mode-toggle.js"); /* harmony import */ var _reusable_block_convert_button__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./reusable-block-convert-button */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/reusable-block-convert-button.js"); /* harmony import */ var _reusable_block_delete_button__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./reusable-block-delete-button */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/reusable-block-delete-button.js"); /* harmony import */ var _block_html_convert_button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./block-html-convert-button */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-html-convert-button.js"); /* harmony import */ var _block_unknown_convert_button__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./block-unknown-convert-button */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-unknown-convert-button.js"); /* harmony import */ var _block_settings_menu_first_item__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./block-settings-menu-first-item */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-settings-menu-first-item.js"); /* harmony import */ var _block_settings_menu_plugins_extension__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./block-settings-menu-plugins-extension */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-settings-menu-plugins-extension.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function BlockSettingsMenu(_ref) { var clientIds = _ref.clientIds, onSelect = _ref.onSelect; var blockClientIds = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["castArray"])(clientIds); var count = blockClientIds.length; var firstBlockClientId = blockClientIds[0]; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_actions__WEBPACK_IMPORTED_MODULE_7__["default"], { clientIds: clientIds }, function (_ref2) { var onDuplicate = _ref2.onDuplicate, onRemove = _ref2.onRemove, onInsertAfter = _ref2.onInsertAfter, onInsertBefore = _ref2.onInsertBefore, canDuplicate = _ref2.canDuplicate, isLocked = _ref2.isLocked; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Dropdown"], { contentClassName: "editor-block-settings-menu__popover", position: "bottom right", renderToggle: function renderToggle(_ref3) { var onToggle = _ref3.onToggle, isOpen = _ref3.isOpen; var toggleClassname = classnames__WEBPACK_IMPORTED_MODULE_1___default()('editor-block-settings-menu__toggle', { 'is-opened': isOpen }); var label = isOpen ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Hide options') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('More options'); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Toolbar"], { controls: [{ icon: 'ellipsis', title: label, onClick: function onClick() { if (count === 1) { onSelect(firstBlockClientId); } onToggle(); }, className: toggleClassname, extraProps: { 'aria-expanded': isOpen } }] }); }, renderContent: function renderContent(_ref4) { var onClose = _ref4.onClose; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["NavigableMenu"], { className: "editor-block-settings-menu__content" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_settings_menu_first_item__WEBPACK_IMPORTED_MODULE_13__["default"].Slot, { fillProps: { onClose: onClose } }), count === 1 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_unknown_convert_button__WEBPACK_IMPORTED_MODULE_12__["default"], { clientId: firstBlockClientId }), count === 1 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_html_convert_button__WEBPACK_IMPORTED_MODULE_11__["default"], { clientId: firstBlockClientId }), !isLocked && canDuplicate && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["MenuItem"], { className: "editor-block-settings-menu__control", onClick: onDuplicate, icon: "admin-page", shortcut: _editor_global_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_6__["shortcuts"].duplicate.display }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Duplicate')), !isLocked && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["MenuItem"], { className: "editor-block-settings-menu__control", onClick: onInsertBefore, icon: "insert-before", shortcut: _editor_global_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_6__["shortcuts"].insertBefore.display }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Insert Before')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["MenuItem"], { className: "editor-block-settings-menu__control", onClick: onInsertAfter, icon: "insert-after", shortcut: _editor_global_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_6__["shortcuts"].insertAfter.display }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Insert After'))), count === 1 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_mode_toggle__WEBPACK_IMPORTED_MODULE_8__["default"], { clientId: firstBlockClientId, onToggle: onClose }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_reusable_block_convert_button__WEBPACK_IMPORTED_MODULE_9__["default"], { clientIds: clientIds, onToggle: onClose }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_settings_menu_plugins_extension__WEBPACK_IMPORTED_MODULE_14__["default"].Slot, { fillProps: { clientIds: clientIds, onClose: onClose } }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-block-settings-menu__separator" }), count === 1 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_reusable_block_delete_button__WEBPACK_IMPORTED_MODULE_10__["default"], { clientId: firstBlockClientId, onToggle: onClose }), !isLocked && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["MenuItem"], { className: "editor-block-settings-menu__control", onClick: onRemove, icon: "trash", shortcut: _editor_global_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_6__["shortcuts"].removeBlock.display }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Remove Block'))); } }); }); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), selectBlock = _dispatch.selectBlock; return { onSelect: function onSelect(clientId) { selectBlock(clientId); } }; })(BlockSettingsMenu)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/reusable-block-convert-button.js": /*!*********************************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/reusable-block-convert-button.js ***! \*********************************************************************************************************************/ /*! exports provided: ReusableBlockConvertButton, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReusableBlockConvertButton", function() { return ReusableBlockConvertButton; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__); /** * External dependencies */ /** * WordPress dependencies */ function ReusableBlockConvertButton(_ref) { var isVisible = _ref.isVisible, isStaticBlock = _ref.isStaticBlock, onConvertToStatic = _ref.onConvertToStatic, onConvertToReusable = _ref.onConvertToReusable; if (!isVisible) { return null; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, isStaticBlock && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["MenuItem"], { className: "editor-block-settings-menu__control", icon: "controls-repeat", onClick: onConvertToReusable }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Add to Reusable Blocks')), !isStaticBlock && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["MenuItem"], { className: "editor-block-settings-menu__control", icon: "controls-repeat", onClick: onConvertToStatic }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Convert to Regular Block'))); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select, _ref2) { var clientIds = _ref2.clientIds; var _select = select('core/editor'), getBlock = _select.getBlock, getReusableBlock = _select.getReusableBlock; var _select2 = select('core/blocks'), getFallbackBlockName = _select2.getFallbackBlockName; var blocks = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["map"])(clientIds, function (clientId) { return getBlock(clientId); }); // Hide 'Add to Reusable Blocks' on Classic blocks. Showing it causes a // confusing UX, because of its similarity to the 'Convert to Blocks' button. var isVisible = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["every"])(blocks, function (block) { return !!block; }) && (blocks.length !== 1 || blocks[0].name !== getFallbackBlockName()); return { isStaticBlock: isVisible && (blocks.length !== 1 || !Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["isReusableBlock"])(blocks[0]) || !getReusableBlock(blocks[0].attributes.ref)), isVisible: isVisible }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withDispatch"])(function (dispatch, _ref3) { var clientIds = _ref3.clientIds, _ref3$onToggle = _ref3.onToggle, onToggle = _ref3$onToggle === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] : _ref3$onToggle; var _dispatch = dispatch('core/editor'), convertBlockToReusable = _dispatch.convertBlockToReusable, convertBlockToStatic = _dispatch.convertBlockToStatic; return { onConvertToStatic: function onConvertToStatic() { if (clientIds.length !== 1) { return; } convertBlockToStatic(clientIds[0]); onToggle(); }, onConvertToReusable: function onConvertToReusable() { convertBlockToReusable(clientIds); onToggle(); } }; })])(ReusableBlockConvertButton)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/reusable-block-delete-button.js": /*!********************************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/reusable-block-delete-button.js ***! \********************************************************************************************************************/ /*! exports provided: ReusableBlockDeleteButton, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReusableBlockDeleteButton", function() { return ReusableBlockDeleteButton; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__); /** * External dependencies */ /** * WordPress dependencies */ function ReusableBlockDeleteButton(_ref) { var reusableBlock = _ref.reusableBlock, onDelete = _ref.onDelete; if (!reusableBlock) { return null; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["MenuItem"], { className: "editor-block-settings-menu__control", icon: "no", disabled: reusableBlock.isTemporary, onClick: function onClick() { return onDelete(reusableBlock.id); } }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Remove from Reusable Blocks')); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withSelect"])(function (select, _ref2) { var clientId = _ref2.clientId; var _select = select('core/editor'), getBlock = _select.getBlock, getReusableBlock = _select.getReusableBlock; var block = getBlock(clientId); return { reusableBlock: block && Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_5__["isReusableBlock"])(block) ? getReusableBlock(block.attributes.ref) : null }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withDispatch"])(function (dispatch, _ref3) { var _ref3$onToggle = _ref3.onToggle, onToggle = _ref3$onToggle === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] : _ref3$onToggle; var _dispatch = dispatch('core/editor'), deleteReusableBlock = _dispatch.deleteReusableBlock; return { onDelete: function onDelete(id) { // TODO: Make this a component or similar // eslint-disable-next-line no-alert var hasConfirmed = window.confirm(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Are you sure you want to delete this Reusable Block?\n\n' + 'It will be permanently removed from all posts and pages that use it.')); if (hasConfirmed) { deleteReusableBlock(id); onToggle(); } } }; })])(ReusableBlockDeleteButton)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-styles/index.js": /*!**************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-styles/index.js ***! \**************************************************************************************/ /*! exports provided: getActiveStyle, replaceActiveStyle, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActiveStyle", function() { return getActiveStyle; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "replaceActiveStyle", function() { return replaceActiveStyle; }); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_token_list__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/token-list */ "@wordpress/token-list"); /* harmony import */ var _wordpress_token_list__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_token_list__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _block_preview__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../block-preview */ "./node_modules/@wordpress/editor/build-module/components/block-preview/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Returns the active style from the given className. * * @param {Array} styles Block style variations. * @param {string} className Class name * * @return {Object?} The active style. */ function getActiveStyle(styles, className) { var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = new _wordpress_token_list__WEBPACK_IMPORTED_MODULE_8___default.a(className).values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var style = _step.value; if (style.indexOf('is-style-') === -1) { continue; } var potentialStyleName = style.substring(9); var activeStyle = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["find"])(styles, { name: potentialStyleName }); if (activeStyle) { return activeStyle; } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } return Object(lodash__WEBPACK_IMPORTED_MODULE_2__["find"])(styles, 'isDefault'); } /** * Replaces the active style in the block's className. * * @param {string} className Class name. * @param {Object?} activeStyle The replaced style. * @param {Object} newStyle The replacing style. * * @return {string} The updated className. */ function replaceActiveStyle(className, activeStyle, newStyle) { var list = new _wordpress_token_list__WEBPACK_IMPORTED_MODULE_8___default.a(className); if (activeStyle) { list.remove('is-style-' + activeStyle.name); } list.add('is-style-' + newStyle.name); return list.value; } function BlockStyles(_ref) { var styles = _ref.styles, className = _ref.className, onChangeClassName = _ref.onChangeClassName, name = _ref.name, attributes = _ref.attributes, onSwitch = _ref.onSwitch, onHoverClassName = _ref.onHoverClassName; if (!styles) { return null; } var activeStyle = getActiveStyle(styles, className); function updateClassName(style) { var updatedClassName = replaceActiveStyle(className, activeStyle, style); onChangeClassName(updatedClassName); onSwitch(); } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", { className: "editor-block-styles" }, styles.map(function (style) { var styleClassName = replaceActiveStyle(className, activeStyle, style); /* eslint-disable jsx-a11y/click-events-have-key-events */ return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", { key: style.name, className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('editor-block-styles__item', { 'is-active': activeStyle === style }), onClick: function onClick() { return updateClassName(style); }, onMouseEnter: function onMouseEnter() { return onHoverClassName(styleClassName); }, onMouseLeave: function onMouseLeave() { return onHoverClassName(null); }, role: "button", tabIndex: "0", "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Apply style variation "%s"'), style.label || style.name) }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", { className: "editor-block-styles__item-preview" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_block_preview__WEBPACK_IMPORTED_MODULE_9__["BlockPreviewContent"], { name: name, attributes: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, attributes, { className: styleClassName }) })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", { className: "editor-block-styles__item-label" }, style.label || style.name)); /* eslint-enable jsx-a11y/click-events-have-key-events */ })); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select, _ref2) { var clientId = _ref2.clientId; var block = select('core/editor').getBlock(clientId); return { name: block.name, attributes: block.attributes, className: block.attributes.className || '', styles: Object(lodash__WEBPACK_IMPORTED_MODULE_2__["get"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_6__["getBlockType"])(block.name), ['styles']) }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withDispatch"])(function (dispatch, _ref3) { var clientId = _ref3.clientId; return { onChangeClassName: function onChangeClassName(newClassName) { dispatch('core/editor').updateBlockAttributes(clientId, { className: newClassName }); } }; })])(BlockStyles)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-switcher/index.js": /*!****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-switcher/index.js ***! \****************************************************************************************/ /*! exports provided: BlockSwitcher, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockSwitcher", function() { return BlockSwitcher; }); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var _block_icon__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../block-icon */ "./node_modules/@wordpress/editor/build-module/components/block-icon/index.js"); /* harmony import */ var _block_styles__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../block-styles */ "./node_modules/@wordpress/editor/build-module/components/block-styles/index.js"); /* harmony import */ var _block_preview__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../block-preview */ "./node_modules/@wordpress/editor/build-module/components/block-preview/index.js"); /* harmony import */ var _block_types_list__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../block-types-list */ "./node_modules/@wordpress/editor/build-module/components/block-types-list/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var BlockSwitcher = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(BlockSwitcher, _Component); function BlockSwitcher() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, BlockSwitcher); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockSwitcher).apply(this, arguments)); _this.state = { hoveredClassName: null }; _this.onHoverClassName = _this.onHoverClassName.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(BlockSwitcher, [{ key: "onHoverClassName", value: function onHoverClassName(className) { this.setState({ hoveredClassName: className }); } }, { key: "render", value: function render() { var _this2 = this; var _this$props = this.props, blocks = _this$props.blocks, onTransform = _this$props.onTransform, inserterItems = _this$props.inserterItems; var hoveredClassName = this.state.hoveredClassName; if (!blocks || !blocks.length) { return null; } var itemsByName = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["mapKeys"])(inserterItems, function (_ref) { var name = _ref.name; return name; }); var possibleBlockTransformations = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["orderBy"])(Object(lodash__WEBPACK_IMPORTED_MODULE_8__["filter"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__["getPossibleBlockTransformations"])(blocks), function (block) { return !!itemsByName[block.name]; }), function (block) { return itemsByName[block.name].frecency; }, 'desc'); var sourceBlockName = blocks[0].name; var blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__["getBlockType"])(sourceBlockName); var hasStyles = blocks.length === 1 && Object(lodash__WEBPACK_IMPORTED_MODULE_8__["get"])(blockType, ['styles'], []).length !== 0; if (!hasStyles && !possibleBlockTransformations.length) { return null; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["Dropdown"], { position: "bottom right", className: "editor-block-switcher", contentClassName: "editor-block-switcher__popover", renderToggle: function renderToggle(_ref2) { var onToggle = _ref2.onToggle, isOpen = _ref2.isOpen; var openOnArrowDown = function openOnArrowDown(event) { if (!isOpen && event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["DOWN"]) { event.preventDefault(); event.stopPropagation(); onToggle(); } }; var label = 1 === blocks.length ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Change block type') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["_n"])('Change type of %d block', 'Change type of %d blocks', blocks.length), blocks.length); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["Toolbar"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["IconButton"], { className: "editor-block-switcher__toggle", onClick: onToggle, "aria-haspopup": "true", "aria-expanded": isOpen, label: label, tooltip: label, onKeyDown: openOnArrowDown }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_icon__WEBPACK_IMPORTED_MODULE_15__["default"], { icon: blockType.icon && blockType.icon.src, showColors: true }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["SVG"], { className: "editor-block-switcher__transform", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["Path"], { d: "M6.5 8.9c.6-.6 1.4-.9 2.2-.9h6.9l-1.3 1.3 1.4 1.4L19.4 7l-3.7-3.7-1.4 1.4L15.6 6H8.7c-1.4 0-2.6.5-3.6 1.5l-2.8 2.8 1.4 1.4 2.8-2.8zm13.8 2.4l-2.8 2.8c-.6.6-1.3.9-2.1.9h-7l1.3-1.3-1.4-1.4L4.6 16l3.7 3.7 1.4-1.4L8.4 17h6.9c1.3 0 2.6-.5 3.5-1.5l2.8-2.8-1.3-1.4z" })))); }, renderContent: function renderContent(_ref3) { var onClose = _ref3.onClose; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Fragment"], null, hasStyles && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["PanelBody"], { title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Block Styles'), initialOpen: true }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_styles__WEBPACK_IMPORTED_MODULE_16__["default"], { clientId: blocks[0].clientId, onSwitch: onClose, onHoverClassName: _this2.onHoverClassName })), possibleBlockTransformations.length !== 0 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["PanelBody"], { title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Transform To:'), initialOpen: true }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_types_list__WEBPACK_IMPORTED_MODULE_18__["default"], { items: possibleBlockTransformations.map(function (destinationBlockType) { return { id: destinationBlockType.name, icon: destinationBlockType.icon, title: destinationBlockType.title, hasChildBlocksWithInserterSupport: Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__["hasChildBlocksWithInserterSupport"])(destinationBlockType.name) }; }), onSelect: function onSelect(item) { onTransform(blocks, item.id); onClose(); } })), hoveredClassName !== null && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_preview__WEBPACK_IMPORTED_MODULE_17__["default"], { name: blocks[0].name, attributes: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blocks[0].attributes, { className: hoveredClassName }) })); } }); } }]); return BlockSwitcher; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withSelect"])(function (select, _ref4) { var clientIds = _ref4.clientIds; var _select = select('core/editor'), getBlocksByClientId = _select.getBlocksByClientId, getBlockRootClientId = _select.getBlockRootClientId, getInserterItems = _select.getInserterItems; var rootClientId = getBlockRootClientId(Object(lodash__WEBPACK_IMPORTED_MODULE_8__["first"])(Object(lodash__WEBPACK_IMPORTED_MODULE_8__["castArray"])(clientIds))); return { blocks: getBlocksByClientId(clientIds), inserterItems: getInserterItems(rootClientId) }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withDispatch"])(function (dispatch, ownProps) { return { onTransform: function onTransform(blocks, name) { dispatch('core/editor').replaceBlocks(ownProps.clientIds, Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__["switchToBlockType"])(blocks, name)); } }; }))(BlockSwitcher)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-switcher/multi-blocks-switcher.js": /*!********************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-switcher/multi-blocks-switcher.js ***! \********************************************************************************************************/ /*! exports provided: MultiBlocksSwitcher, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiBlocksSwitcher", function() { return MultiBlocksSwitcher; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ */ "./node_modules/@wordpress/editor/build-module/components/block-switcher/index.js"); /** * WordPress dependencies */ /** * Internal dependencies */ function MultiBlocksSwitcher(_ref) { var isMultiBlockSelection = _ref.isMultiBlockSelection, selectedBlockClientIds = _ref.selectedBlockClientIds; if (!isMultiBlockSelection) { return null; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_2__["default"], { key: "switcher", clientIds: selectedBlockClientIds }); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { var selectedBlockClientIds = select('core/editor').getMultiSelectedBlockClientIds(); return { isMultiBlockSelection: selectedBlockClientIds.length > 1, selectedBlockClientIds: selectedBlockClientIds }; })(MultiBlocksSwitcher)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-title/index.js": /*!*************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-title/index.js ***! \*************************************************************************************/ /*! exports provided: BlockTitle, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockTitle", function() { return BlockTitle; }); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ /** * Renders the block's configured title as a string, or empty if the title * cannot be determined. * * @example * * ```jsx * * ``` * * @param {?string} props.name Block name. * * @return {?string} Block title. */ function BlockTitle(_ref) { var name = _ref.name; if (!name) { return null; } var blockType = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__["getBlockType"])(name); if (!blockType) { return null; } return blockType.title; } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["withSelect"])(function (select, ownProps) { var _select = select('core/editor'), getBlockName = _select.getBlockName; var clientId = ownProps.clientId; return { name: getBlockName(clientId) }; })(BlockTitle)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-toolbar/index.js": /*!***************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-toolbar/index.js ***! \***************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _block_switcher__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../block-switcher */ "./node_modules/@wordpress/editor/build-module/components/block-switcher/index.js"); /* harmony import */ var _block_switcher_multi_blocks_switcher__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../block-switcher/multi-blocks-switcher */ "./node_modules/@wordpress/editor/build-module/components/block-switcher/multi-blocks-switcher.js"); /* harmony import */ var _block_controls__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../block-controls */ "./node_modules/@wordpress/editor/build-module/components/block-controls/index.js"); /* harmony import */ var _block_format_controls__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../block-format-controls */ "./node_modules/@wordpress/editor/build-module/components/block-format-controls/index.js"); /* harmony import */ var _block_settings_menu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../block-settings-menu */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/index.js"); /** * WordPress Dependencies */ /** * Internal Dependencies */ var BlockToolbar = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockToolbar, _Component); function BlockToolbar() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockToolbar); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockToolbar).apply(this, arguments)); _this.container = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createRef"])(); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockToolbar, [{ key: "componentDidMount", value: function componentDidMount() { if (this.props.blockClientIds.length > 1) { this.focusContainer(); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (prevProps.blockClientIds.length <= 1 && this.props.blockClientIds.length > 1) { this.focusContainer(); } } }, { key: "focusContainer", value: function focusContainer() { var tabbables = _wordpress_dom__WEBPACK_IMPORTED_MODULE_7__["focus"].tabbable.find(this.container.current); if (tabbables.length) { tabbables[0].focus(); } } }, { key: "render", value: function render() { var _this$props = this.props, blockClientIds = _this$props.blockClientIds, isValid = _this$props.isValid, mode = _this$props.mode; if (blockClientIds.length === 0) { return null; } if (blockClientIds.length > 1) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("div", { className: "editor-block-toolbar", ref: this.container }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_switcher_multi_blocks_switcher__WEBPACK_IMPORTED_MODULE_9__["default"], null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_settings_menu__WEBPACK_IMPORTED_MODULE_12__["default"], { clientIds: blockClientIds })); } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("div", { className: "editor-block-toolbar" }, mode === 'visual' && isValid && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_switcher__WEBPACK_IMPORTED_MODULE_8__["default"], { clientIds: blockClientIds }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_controls__WEBPACK_IMPORTED_MODULE_10__["default"].Slot, null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_format_controls__WEBPACK_IMPORTED_MODULE_11__["default"].Slot, null)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_settings_menu__WEBPACK_IMPORTED_MODULE_12__["default"], { clientIds: blockClientIds })); } }]); return BlockToolbar; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withSelect"])(function (select) { var _select = select('core/editor'), getSelectedBlock = _select.getSelectedBlock, getBlockMode = _select.getBlockMode, getMultiSelectedBlockClientIds = _select.getMultiSelectedBlockClientIds; var block = getSelectedBlock(); var blockClientIds = block ? [block.clientId] : getMultiSelectedBlockClientIds(); return { blockClientIds: blockClientIds, isValid: block ? block.isValid : null, mode: block ? getBlockMode(block.clientId) : null }; })(BlockToolbar)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/block-types-list/index.js": /*!******************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/block-types-list/index.js ***! \******************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _block_icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../block-icon */ "./node_modules/@wordpress/editor/build-module/components/block-icon/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var BlockTypesList = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(BlockTypesList, _Component); function BlockTypesList() { Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BlockTypesList); return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(BlockTypesList).apply(this, arguments)); } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BlockTypesList, [{ key: "render", value: function render() { var _this$props = this.props, items = _this$props.items, onSelect = _this$props.onSelect, _this$props$onHover = _this$props.onHover, onHover = _this$props$onHover === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$props$onHover; return ( /* * Disable reason: The `list` ARIA role is redundant but * Safari+VoiceOver won't announce the list otherwise. */ /* eslint-disable jsx-a11y/no-redundant-roles */ Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("ul", { role: "list", className: "editor-block-types-list" }, items.map(function (item) { var itemIconStyle = item.icon ? { backgroundColor: item.icon.background, color: item.icon.foreground } : {}; var itemIconStackStyle = item.icon && item.icon.shadowColor ? { backgroundColor: item.icon.shadowColor } : {}; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("li", { className: "editor-block-types-list__list-item", key: item.id }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("button", { className: classnames__WEBPACK_IMPORTED_MODULE_6___default()('editor-block-types-list__item', Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_8__["getBlockMenuDefaultClassName"])(item.id), { 'editor-block-types-list__item-has-children': item.hasChildBlocksWithInserterSupport }), onClick: function onClick() { onSelect(item); onHover(null); }, disabled: item.isDisabled, onMouseEnter: function onMouseEnter() { return onHover(item); }, onMouseLeave: function onMouseLeave() { return onHover(null); }, onFocus: function onFocus() { return onHover(item); }, onBlur: function onBlur() { return onHover(null); }, "aria-label": item.title // Fix for IE11 and JAWS 2018. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", { className: "editor-block-types-list__item-icon", style: itemIconStyle }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_block_icon__WEBPACK_IMPORTED_MODULE_9__["default"], { icon: item.icon && item.icon.src, showColors: true }), item.hasChildBlocksWithInserterSupport && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", { className: "editor-block-types-list__item-icon-stack", style: itemIconStackStyle })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", { className: "editor-block-types-list__item-title" }, item.title))); })) /* eslint-enable jsx-a11y/no-redundant-roles */ ); } }]); return BlockTypesList; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (BlockTypesList); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/color-palette/control.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/color-palette/control.js ***! \*****************************************************************************************/ /*! exports provided: ColorPaletteControl, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPaletteControl", function() { return ColorPaletteControl; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ */ "./node_modules/@wordpress/editor/build-module/components/color-palette/index.js"); /* harmony import */ var _with_color_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./with-color-context */ "./node_modules/@wordpress/editor/build-module/components/color-palette/with-color-context.js"); /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../colors */ "./node_modules/@wordpress/editor/build-module/components/colors/index.js"); /** * WordPress dependencies */ /** * Internal dependencies */ // translators: first %s: The type of color (e.g. background color), second %s: the color name or value (e.g. red or #ff0000) var colorIndicatorAriaLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('(current %s: %s)'); function ColorPaletteControl(_ref) { var label = _ref.label, value = _ref.value, onChange = _ref.onChange, colors = _ref.colors; var colorObject = Object(_colors__WEBPACK_IMPORTED_MODULE_5__["getColorObjectByColorValue"])(colors, value); var colorName = colorObject && colorObject.name; var ariaLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["sprintf"])(colorIndicatorAriaLabel, label.toLowerCase(), colorName || value); var labelElement = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, label, value && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["ColorIndicator"], { colorValue: value, "aria-label": ariaLabel })); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["BaseControl"], { className: "editor-color-palette-control", label: labelElement }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_3__["default"], { className: "editor-color-palette-control__color-palette", value: value, onChange: onChange })); } /* harmony default export */ __webpack_exports__["default"] = (Object(_with_color_context__WEBPACK_IMPORTED_MODULE_4__["default"])(ColorPaletteControl)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/color-palette/index.js": /*!***************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/color-palette/index.js ***! \***************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _with_color_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./with-color-context */ "./node_modules/@wordpress/editor/build-module/components/color-palette/with-color-context.js"); /** * WordPress dependencies */ /** * Internal dependencies */ /* harmony default export */ __webpack_exports__["default"] = (Object(_with_color_context__WEBPACK_IMPORTED_MODULE_1__["default"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["ColorPalette"])); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/color-palette/with-color-context.js": /*!****************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/color-palette/with-color-context.js ***! \****************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /** * External dependencies */ /** * WordPress dependencies */ /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["createHigherOrderComponent"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { var settings = select('core/editor').getEditorSettings(); var colors = settings.colors; var disableCustomColors = settings.disableCustomColors; return { colors: colors, disableCustomColors: disableCustomColors, hasColorsToChoose: !Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isEmpty"])(colors) || !disableCustomColors }; }), 'withColorContext')); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/colors/index.js": /*!********************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/colors/index.js ***! \********************************************************************************/ /*! exports provided: getColorClassName, getColorObjectByAttributeValues, getColorObjectByColorValue, withColors */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/editor/build-module/components/colors/utils.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getColorClassName", function() { return _utils__WEBPACK_IMPORTED_MODULE_0__["getColorClassName"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getColorObjectByAttributeValues", function() { return _utils__WEBPACK_IMPORTED_MODULE_0__["getColorObjectByAttributeValues"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getColorObjectByColorValue", function() { return _utils__WEBPACK_IMPORTED_MODULE_0__["getColorObjectByColorValue"]; }); /* harmony import */ var _with_colors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./with-colors */ "./node_modules/@wordpress/editor/build-module/components/colors/with-colors.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withColors", function() { return _with_colors__WEBPACK_IMPORTED_MODULE_1__["default"]; }); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/colors/utils.js": /*!********************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/colors/utils.js ***! \********************************************************************************/ /*! exports provided: getColorObjectByAttributeValues, getColorObjectByColorValue, getColorClassName, getMostReadableColor */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColorObjectByAttributeValues", function() { return getColorObjectByAttributeValues; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColorObjectByColorValue", function() { return getColorObjectByColorValue; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColorClassName", function() { return getColorClassName; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMostReadableColor", function() { return getMostReadableColor; }); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tinycolor2 */ "./node_modules/tinycolor2/tinycolor.js"); /* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(tinycolor2__WEBPACK_IMPORTED_MODULE_1__); /** * External dependencies */ /** * Provided an array of color objects as set by the theme or by the editor defaults, * and the values of the defined color or custom color returns a color object describing the color. * * @param {Array} colors Array of color objects as set by the theme or by the editor defaults. * @param {?string} definedColor A string containing the color slug. * @param {?string} customColor A string containing the customColor value. * * @return {?string} If definedColor is passed and the name is found in colors, * the color object exactly as set by the theme or editor defaults is returned. * Otherwise, an object that just sets the color is defined. */ var getColorObjectByAttributeValues = function getColorObjectByAttributeValues(colors, definedColor, customColor) { if (definedColor) { var colorObj = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(colors, { slug: definedColor }); if (colorObj) { return colorObj; } } return { color: customColor }; }; /** * Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined. * * @param {Array} colors Array of color objects as set by the theme or by the editor defaults. * @param {?string} colorValue A string containing the color value. * * @return {?string} Returns the color object included in the colors array whose color property equals colorValue. * Returns undefined if no color object matches this requirement. */ var getColorObjectByColorValue = function getColorObjectByColorValue(colors, colorValue) { return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(colors, { color: colorValue }); }; /** * Returns a class based on the context a color is being used and its slug. * * @param {string} colorContextName Context/place where color is being used e.g: background, text etc... * @param {string} colorSlug Slug of the color. * * @return {string} String with the class corresponding to the color in the provided context. */ function getColorClassName(colorContextName, colorSlug) { if (!colorContextName || !colorSlug) { return; } return "has-".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["kebabCase"])(colorSlug), "-").concat(colorContextName); } /** * Given an array of color objects and a color value returns the color value of the most readable color in the array. * * @param {Array} colors Array of color objects as set by the theme or by the editor defaults. * @param {?string} colorValue A string containing the color value. * * @return {string} String with the color value of the most readable color. */ function getMostReadableColor(colors, colorValue) { return tinycolor2__WEBPACK_IMPORTED_MODULE_1___default.a.mostReadable(colorValue, Object(lodash__WEBPACK_IMPORTED_MODULE_0__["map"])(colors, 'color')).toHexString(); } /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/colors/with-colors.js": /*!**************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/colors/with-colors.js ***! \**************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/editor/build-module/components/colors/utils.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var DEFAULT_COLORS = []; /** * Higher-order component, which handles color logic for class generation * color value, retrieval and color attribute setting. * * @param {...(object|string)} args The arguments can be strings or objects. If the argument is an object, * it should contain the color attribute name as key and the color context as value. * If the argument is a string the value should be the color attribute name, * the color context is computed by applying a kebab case transform to the value. * Color context represents the context/place where the color is going to be used. * The class name of the color is generated using 'has' followed by the color name * and ending with the color context all in kebab case e.g: has-green-background-color. * * * @return {Function} Higher-order component. */ /* harmony default export */ __webpack_exports__["default"] = (function () { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var colorMap = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["reduce"])(args, function (colorObject, arg) { return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_7__["default"])({}, colorObject, Object(lodash__WEBPACK_IMPORTED_MODULE_9__["isString"])(arg) ? Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_6__["default"])({}, arg, Object(lodash__WEBPACK_IMPORTED_MODULE_9__["kebabCase"])(arg)) : arg); }, {}); return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["createHigherOrderComponent"])(Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withSelect"])(function (select) { var settings = select('core/editor').getEditorSettings(); return { colors: Object(lodash__WEBPACK_IMPORTED_MODULE_9__["get"])(settings, ['colors'], DEFAULT_COLORS) }; }), function (WrappedComponent) { return ( /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(_class, _Component); function _class(props) { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, _class); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(_class).call(this, props)); _this.setters = _this.createSetters(); _this.colorUtils = { getMostReadableColor: _this.getMostReadableColor.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))) }; _this.state = {}; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(_class, [{ key: "getMostReadableColor", value: function getMostReadableColor(colorValue) { var colors = this.props.colors; return Object(_utils__WEBPACK_IMPORTED_MODULE_12__["getMostReadableColor"])(colors, colorValue); } }, { key: "createSetters", value: function createSetters() { var _this2 = this; return Object(lodash__WEBPACK_IMPORTED_MODULE_9__["reduce"])(colorMap, function (settersAccumulator, colorContext, colorAttributeName) { var upperFirstColorAttributeName = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["upperFirst"])(colorAttributeName); var customColorAttributeName = "custom".concat(upperFirstColorAttributeName); settersAccumulator["set".concat(upperFirstColorAttributeName)] = _this2.createSetColor(colorAttributeName, customColorAttributeName); return settersAccumulator; }, {}); } }, { key: "createSetColor", value: function createSetColor(colorAttributeName, customColorAttributeName) { var _this3 = this; return function (colorValue) { var _this3$props$setAttri; var colorObject = Object(_utils__WEBPACK_IMPORTED_MODULE_12__["getColorObjectByColorValue"])(_this3.props.colors, colorValue); _this3.props.setAttributes((_this3$props$setAttri = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_6__["default"])(_this3$props$setAttri, colorAttributeName, colorObject && colorObject.slug ? colorObject.slug : undefined), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_6__["default"])(_this3$props$setAttri, customColorAttributeName, colorObject && colorObject.slug ? undefined : colorValue), _this3$props$setAttri)); }; } }, { key: "render", value: function render() { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(WrappedComponent, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_7__["default"])({}, this.props, { colors: undefined }, this.state, this.setters, { colorUtils: this.colorUtils })); } }], [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(_ref2, previousState) { var attributes = _ref2.attributes, colors = _ref2.colors; return Object(lodash__WEBPACK_IMPORTED_MODULE_9__["reduce"])(colorMap, function (newState, colorContext, colorAttributeName) { var colorObject = Object(_utils__WEBPACK_IMPORTED_MODULE_12__["getColorObjectByAttributeValues"])(colors, attributes[colorAttributeName], attributes["custom".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_9__["upperFirst"])(colorAttributeName))]); var previousColorObject = previousState[colorAttributeName]; var previousColor = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["get"])(previousColorObject, ['color']); /** * The "and previousColorObject" condition checks that a previous color object was already computed. * At the start previousColorObject and colorValue are both equal to undefined * bus as previousColorObject does not exist we should compute the object. */ if (previousColor === colorObject.color && previousColorObject) { newState[colorAttributeName] = previousColorObject; } else { newState[colorAttributeName] = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_7__["default"])({}, colorObject, { class: Object(_utils__WEBPACK_IMPORTED_MODULE_12__["getColorClassName"])(colorContext, colorObject.slug) }); } return newState; }, {}); } }]); return _class; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]) ); }]), 'withColors'); }); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/contrast-checker/index.js": /*!******************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/contrast-checker/index.js ***! \******************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tinycolor2 */ "./node_modules/tinycolor2/tinycolor.js"); /* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(tinycolor2__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); /** * External dependencies */ /** * WordPress dependencies */ function ContrastChecker(_ref) { var backgroundColor = _ref.backgroundColor, fallbackBackgroundColor = _ref.fallbackBackgroundColor, fallbackTextColor = _ref.fallbackTextColor, fontSize = _ref.fontSize, isLargeText = _ref.isLargeText, textColor = _ref.textColor; if (!(backgroundColor || fallbackBackgroundColor) || !(textColor || fallbackTextColor)) { return null; } var tinyBackgroundColor = tinycolor2__WEBPACK_IMPORTED_MODULE_1___default()(backgroundColor || fallbackBackgroundColor); var tinyTextColor = tinycolor2__WEBPACK_IMPORTED_MODULE_1___default()(textColor || fallbackTextColor); var hasTransparency = tinyBackgroundColor.getAlpha() !== 1 || tinyTextColor.getAlpha() !== 1; if (hasTransparency || tinycolor2__WEBPACK_IMPORTED_MODULE_1___default.a.isReadable(tinyBackgroundColor, tinyTextColor, { level: 'AA', size: isLargeText || isLargeText !== false && fontSize >= 18 ? 'large' : 'small' })) { return null; } var msg = tinyBackgroundColor.getBrightness() < tinyTextColor.getBrightness() ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('This color combination may be hard for people to read. Try using a darker background color and/or a brighter text color.') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color.'); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-contrast-checker" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["Notice"], { status: "warning", isDismissible: false }, msg)); } /* harmony default export */ __webpack_exports__["default"] = (ContrastChecker); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/copy-handler/index.js": /*!**************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/copy-handler/index.js ***! \**************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__); /** * WordPress dependencies */ var CopyHandler = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(CopyHandler, _Component); function CopyHandler() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, CopyHandler); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(CopyHandler).apply(this, arguments)); _this.onCopy = _this.onCopy.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.onCut = _this.onCut.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(CopyHandler, [{ key: "componentDidMount", value: function componentDidMount() { document.addEventListener('copy', this.onCopy); document.addEventListener('cut', this.onCut); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { document.removeEventListener('copy', this.onCopy); document.removeEventListener('cut', this.onCut); } }, { key: "onCopy", value: function onCopy(event) { var _this$props = this.props, multiSelectedBlocks = _this$props.multiSelectedBlocks, selectedBlock = _this$props.selectedBlock; if (!multiSelectedBlocks.length && !selectedBlock) { return; } // Let native copy behaviour take over in input fields. if (selectedBlock && Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["documentHasSelection"])()) { return; } var serialized = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_7__["serialize"])(selectedBlock || multiSelectedBlocks); event.clipboardData.setData('text/plain', serialized); event.clipboardData.setData('text/html', serialized); event.preventDefault(); } }, { key: "onCut", value: function onCut(event) { var multiSelectedBlockClientIds = this.props.multiSelectedBlockClientIds; this.onCopy(event); if (multiSelectedBlockClientIds.length) { this.props.onRemove(multiSelectedBlockClientIds); } } }, { key: "render", value: function render() { return null; } }]); return CopyHandler; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withSelect"])(function (select) { var _select = select('core/editor'), getMultiSelectedBlocks = _select.getMultiSelectedBlocks, getMultiSelectedBlockClientIds = _select.getMultiSelectedBlockClientIds, getSelectedBlock = _select.getSelectedBlock; return { multiSelectedBlocks: getMultiSelectedBlocks(), multiSelectedBlockClientIds: getMultiSelectedBlockClientIds(), selectedBlock: getSelectedBlock() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withDispatch"])(function (dispatch) { return { onRemove: dispatch('core/editor').removeBlocks }; })])(CopyHandler)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/default-block-appender/index.js": /*!************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/default-block-appender/index.js ***! \************************************************************************************************/ /*! exports provided: DefaultBlockAppender, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultBlockAppender", function() { return DefaultBlockAppender; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _block_drop_zone__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../block-drop-zone */ "./node_modules/@wordpress/editor/build-module/components/block-drop-zone/index.js"); /* harmony import */ var _inserter_with_shortcuts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../inserter-with-shortcuts */ "./node_modules/@wordpress/editor/build-module/components/inserter-with-shortcuts/index.js"); /* harmony import */ var _inserter__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../inserter */ "./node_modules/@wordpress/editor/build-module/components/inserter/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function DefaultBlockAppender(_ref) { var isLocked = _ref.isLocked, isVisible = _ref.isVisible, onAppend = _ref.onAppend, showPrompt = _ref.showPrompt, placeholder = _ref.placeholder, layout = _ref.layout, rootClientId = _ref.rootClientId; if (isLocked || !isVisible) { return null; } var value = Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__["decodeEntities"])(placeholder) || Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Write your story'); // The appender "button" is in-fact a text field so as to support // transitions by WritingFlow occurring by arrow key press. WritingFlow // only supports tab transitions into text fields and to the block focus // boundary. // // See: https://github.com/WordPress/gutenberg/issues/4829#issuecomment-374213658 // // If it were ever to be made to be a proper `button` element, it is // important to note that `onFocus` alone would not be sufficient to // capture click events, notably in Firefox. // // See: https://gist.github.com/cvrebert/68659d0333a578d75372 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { "data-root-client-id": rootClientId || '', className: "editor-default-block-appender" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_drop_zone__WEBPACK_IMPORTED_MODULE_7__["default"], { rootClientId: rootClientId, layout: layout }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("input", { role: "button", "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Add block'), className: "editor-default-block-appender__content", type: "text", readOnly: true, onFocus: onAppend, value: showPrompt ? value : '' }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inserter_with_shortcuts__WEBPACK_IMPORTED_MODULE_8__["default"], { rootClientId: rootClientId, layout: layout }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_inserter__WEBPACK_IMPORTED_MODULE_9__["default"], { position: "top right" })); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withSelect"])(function (select, ownProps) { var _select = select('core/editor'), getBlockCount = _select.getBlockCount, getBlock = _select.getBlock, getEditorSettings = _select.getEditorSettings, getTemplateLock = _select.getTemplateLock; var isEmpty = !getBlockCount(ownProps.rootClientId); var lastBlock = getBlock(ownProps.lastBlockClientId); var isLastBlockDefault = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(lastBlock, ['name']) === Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["getDefaultBlockName"])(); var isLastBlockValid = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(lastBlock, ['isValid']); var _getEditorSettings = getEditorSettings(), bodyPlaceholder = _getEditorSettings.bodyPlaceholder; return { isVisible: isEmpty || !isLastBlockDefault || !isLastBlockValid, showPrompt: isEmpty, isLocked: !!getTemplateLock(ownProps.rootClientId), placeholder: bodyPlaceholder }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withDispatch"])(function (dispatch, ownProps) { var _dispatch = dispatch('core/editor'), insertDefaultBlock = _dispatch.insertDefaultBlock, startTyping = _dispatch.startTyping; return { onAppend: function onAppend() { var layout = ownProps.layout, rootClientId = ownProps.rootClientId; var attributes; if (layout) { attributes = { layout: layout }; } insertDefaultBlock(attributes, rootClientId); startTyping(); } }; }))(DefaultBlockAppender)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/document-outline/check.js": /*!******************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/document-outline/check.js ***! \******************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); /** * External dependencies */ /** * WordPress dependencies */ function DocumentOutlineCheck(_ref) { var blocks = _ref.blocks, children = _ref.children; var headings = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["filter"])(blocks, function (block) { return block.name === 'core/heading'; }); if (headings.length < 1) { return null; } return children; } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { return { blocks: select('core/editor').getBlocks() }; })(DocumentOutlineCheck)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/document-outline/index.js": /*!******************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/document-outline/index.js ***! \******************************************************************************************/ /*! exports provided: DocumentOutline, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentOutline", function() { return DocumentOutline; }); /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _item__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./item */ "./node_modules/@wordpress/editor/build-module/components/document-outline/item.js"); /* harmony import */ var _rich_text__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../rich-text */ "./node_modules/@wordpress/editor/build-module/components/rich-text/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Module constants */ var emptyHeadingContent = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("em", null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('(Empty heading)')); var incorrectLevelContent = [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("br", { key: "incorrect-break" }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("em", { key: "incorrect-message" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('(Incorrect heading level)'))]; var singleH1Headings = [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("br", { key: "incorrect-break-h1" }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("em", { key: "incorrect-message-h1" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('(Your theme may already use a H1 for the post title)'))]; var multipleH1Headings = [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("br", { key: "incorrect-break-multiple-h1" }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("em", { key: "incorrect-message-multiple-h1" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('(Multiple H1 headings are not recommended)'))]; /** * Returns an array of heading blocks enhanced with the following properties: * path - An array of blocks that are ancestors of the heading starting from a top-level node. * Can be an empty array if the heading is a top-level node (is not nested inside another block). * level - An integer with the heading level. * isEmpty - Flag indicating if the heading has no content. * * @param {?Array} blocks An array of blocks. * @param {?Array} path An array of blocks that are ancestors of the blocks passed as blocks. * * @return {Array} An array of heading blocks enhanced with the properties described above. */ var computeOutlineHeadings = function computeOutlineHeadings() { var blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["flatMap"])(blocks, function () { var block = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; if (block.name === 'core/heading') { return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, block, { path: path, level: block.attributes.level, isEmpty: isEmptyHeading(block) }); } return computeOutlineHeadings(block.innerBlocks, Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(path).concat([block])); }); }; var isEmptyHeading = function isEmptyHeading(heading) { return !heading.attributes.content || heading.attributes.content.length === 0; }; var DocumentOutline = function DocumentOutline(_ref) { var _ref$blocks = _ref.blocks, blocks = _ref$blocks === void 0 ? [] : _ref$blocks, title = _ref.title, onSelect = _ref.onSelect, isTitleSupported = _ref.isTitleSupported; var headings = computeOutlineHeadings(blocks); if (headings.length < 1) { return null; } var prevHeadingLevel = 1; // Select the corresponding block in the main editor // when clicking on a heading item from the list. var onSelectHeading = function onSelectHeading(clientId) { return onSelect(clientId); }; var focusTitle = function focusTitle() { // Not great but it's the simplest way to focus the title right now. var titleNode = document.querySelector('.editor-post-title__input'); if (titleNode) { titleNode.focus(); } }; var hasTitle = isTitleSupported && title; var countByLevel = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["countBy"])(headings, 'level'); var hasMultipleH1 = countByLevel[1] > 1; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", { className: "document-outline" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("ul", null, hasTitle && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_item__WEBPACK_IMPORTED_MODULE_7__["default"], { level: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Title'), isValid: true, onClick: focusTitle }, title), headings.map(function (item, index) { // Headings remain the same, go up by one, or down by any amount. // Otherwise there are missing levels. var isIncorrectLevel = item.level > prevHeadingLevel + 1; var isValid = !item.isEmpty && !isIncorrectLevel && !!item.level && (item.level !== 1 || !hasMultipleH1 && !hasTitle); prevHeadingLevel = item.level; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_item__WEBPACK_IMPORTED_MODULE_7__["default"], { key: index, level: "H".concat(item.level), isValid: isValid, onClick: function onClick() { return onSelectHeading(item.clientId); }, path: item.path }, item.isEmpty ? emptyHeadingContent : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_rich_text__WEBPACK_IMPORTED_MODULE_8__["default"].Content, { tagName: "span", value: item.attributes.content }), isIncorrectLevel && incorrectLevelContent, item.level === 1 && hasMultipleH1 && multipleH1Headings, hasTitle && item.level === 1 && !hasMultipleH1 && singleH1Headings); }))); }; /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withSelect"])(function (select) { var _select = select('core/editor'), getEditedPostAttribute = _select.getEditedPostAttribute, getBlocks = _select.getBlocks; var _select2 = select('core'), getPostType = _select2.getPostType; var postType = getPostType(getEditedPostAttribute('type')); return { title: getEditedPostAttribute('title'), blocks: getBlocks(), isTitleSupported: Object(lodash__WEBPACK_IMPORTED_MODULE_3__["get"])(postType, ['supports', 'title'], false) }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), selectBlock = _dispatch.selectBlock; return { onSelect: selectBlock }; }))(DocumentOutline)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/document-outline/item.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/document-outline/item.js ***! \*****************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _block_title__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../block-title */ "./node_modules/@wordpress/editor/build-module/components/block-title/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var TableOfContentsItem = function TableOfContentsItem(_ref) { var children = _ref.children, isValid = _ref.isValid, level = _ref.level, onClick = _ref.onClick, _ref$path = _ref.path, path = _ref$path === void 0 ? [] : _ref$path; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("li", { className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('document-outline__item', "is-".concat(level.toLowerCase()), { 'is-invalid': !isValid }) }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("button", { className: "document-outline__button", onClick: onClick }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { className: "document-outline__emdash", "aria-hidden": "true" }), // path is an array of nodes that are ancestors of the heading starting in the top level node. // This mapping renders each ancestor to make it easier for the user to know where the headings are nested. path.map(function (_ref2, index) { var clientId = _ref2.clientId; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("strong", { key: index, className: "document-outline__level" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_block_title__WEBPACK_IMPORTED_MODULE_3__["default"], { clientId: clientId })); }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("strong", { className: "document-outline__level" }, level), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { className: "document-outline__item-content" }, children), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { className: "screen-reader-text" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('(Click to focus this heading)')))); }; /* harmony default export */ __webpack_exports__["default"] = (TableOfContentsItem); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/editor-global-keyboard-shortcuts/index.js": /*!**********************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/editor-global-keyboard-shortcuts/index.js ***! \**********************************************************************************************************/ /*! exports provided: shortcuts, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shortcuts", function() { return shortcuts; }); /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _block_actions__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../block-actions */ "./node_modules/@wordpress/editor/build-module/components/block-actions/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var preventDefault = function preventDefault(event) { event.preventDefault(); return event; }; var shortcuts = { duplicate: { raw: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].primaryShift('d'), display: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["displayShortcut"].primaryShift('d') }, removeBlock: { raw: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].access('z'), display: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["displayShortcut"].access('z') }, insertBefore: { raw: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].primaryAlt('t'), display: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["displayShortcut"].primaryAlt('t') }, insertAfter: { raw: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].primaryAlt('y'), display: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["displayShortcut"].primaryAlt('y') } }; var EditorGlobalKeyboardShortcuts = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(EditorGlobalKeyboardShortcuts, _Component); function EditorGlobalKeyboardShortcuts() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, EditorGlobalKeyboardShortcuts); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(EditorGlobalKeyboardShortcuts).apply(this, arguments)); _this.selectAll = _this.selectAll.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.undoOrRedo = _this.undoOrRedo.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.save = _this.save.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.deleteSelectedBlocks = _this.deleteSelectedBlocks.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.clearMultiSelection = _this.clearMultiSelection.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(EditorGlobalKeyboardShortcuts, [{ key: "selectAll", value: function selectAll(event) { var _this$props = this.props, rootBlocksClientIds = _this$props.rootBlocksClientIds, onMultiSelect = _this$props.onMultiSelect; event.preventDefault(); onMultiSelect(Object(lodash__WEBPACK_IMPORTED_MODULE_8__["first"])(rootBlocksClientIds), Object(lodash__WEBPACK_IMPORTED_MODULE_8__["last"])(rootBlocksClientIds)); } }, { key: "undoOrRedo", value: function undoOrRedo(event) { var _this$props2 = this.props, onRedo = _this$props2.onRedo, onUndo = _this$props2.onUndo; if (event.shiftKey) { onRedo(); } else { onUndo(); } event.preventDefault(); } }, { key: "save", value: function save(event) { event.preventDefault(); this.props.onSave(); } }, { key: "deleteSelectedBlocks", value: function deleteSelectedBlocks(event) { var _this$props3 = this.props, selectedBlockClientIds = _this$props3.selectedBlockClientIds, hasMultiSelection = _this$props3.hasMultiSelection, onRemove = _this$props3.onRemove, isLocked = _this$props3.isLocked; if (hasMultiSelection) { event.preventDefault(); if (!isLocked) { onRemove(selectedBlockClientIds); } } } /** * Clears current multi-selection, if one exists. */ }, { key: "clearMultiSelection", value: function clearMultiSelection() { var _this$props4 = this.props, hasMultiSelection = _this$props4.hasMultiSelection, clearSelectedBlock = _this$props4.clearSelectedBlock; if (hasMultiSelection) { clearSelectedBlock(); window.getSelection().removeAllRanges(); } } }, { key: "render", value: function render() { var _ref; var selectedBlockClientIds = this.props.selectedBlockClientIds; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["KeyboardShortcuts"], { shortcuts: (_ref = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].primary('a'), this.selectAll), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].primary('z'), this.undoOrRedo), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].primaryShift('z'), this.undoOrRedo), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, "backspace", this.deleteSelectedBlocks), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, "del", this.deleteSelectedBlocks), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, "escape", this.clearMultiSelection), _ref) }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["KeyboardShortcuts"], { bindGlobal: true, shortcuts: Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].primary('s'), this.save) }), selectedBlockClientIds.length > 0 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_actions__WEBPACK_IMPORTED_MODULE_13__["default"], { clientIds: selectedBlockClientIds }, function (_ref3) { var _ref4; var onDuplicate = _ref3.onDuplicate, onRemove = _ref3.onRemove, onInsertAfter = _ref3.onInsertAfter, onInsertBefore = _ref3.onInsertBefore; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["KeyboardShortcuts"], { bindGlobal: true, shortcuts: (_ref4 = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref4, shortcuts.duplicate.raw, Object(lodash__WEBPACK_IMPORTED_MODULE_8__["flow"])(preventDefault, onDuplicate)), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref4, shortcuts.removeBlock.raw, Object(lodash__WEBPACK_IMPORTED_MODULE_8__["flow"])(preventDefault, onRemove)), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref4, shortcuts.insertBefore.raw, Object(lodash__WEBPACK_IMPORTED_MODULE_8__["flow"])(preventDefault, onInsertBefore)), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref4, shortcuts.insertAfter.raw, Object(lodash__WEBPACK_IMPORTED_MODULE_8__["flow"])(preventDefault, onInsertAfter)), _ref4) }); })); } }]); return EditorGlobalKeyboardShortcuts; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withSelect"])(function (select) { var _select = select('core/editor'), getBlockOrder = _select.getBlockOrder, getMultiSelectedBlockClientIds = _select.getMultiSelectedBlockClientIds, hasMultiSelection = _select.hasMultiSelection, isEditedPostDirty = _select.isEditedPostDirty, getBlockRootClientId = _select.getBlockRootClientId, getTemplateLock = _select.getTemplateLock, getSelectedBlock = _select.getSelectedBlock; var block = getSelectedBlock(); var selectedBlockClientIds = block ? [block.clientId] : getMultiSelectedBlockClientIds(); return { rootBlocksClientIds: getBlockOrder(), hasMultiSelection: hasMultiSelection(), isLocked: Object(lodash__WEBPACK_IMPORTED_MODULE_8__["some"])(selectedBlockClientIds, function (clientId) { return !!getTemplateLock(getBlockRootClientId(clientId)); }), isDirty: isEditedPostDirty(), selectedBlockClientIds: selectedBlockClientIds }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withDispatch"])(function (dispatch, ownProps) { var _dispatch = dispatch('core/editor'), clearSelectedBlock = _dispatch.clearSelectedBlock, multiSelect = _dispatch.multiSelect, redo = _dispatch.redo, undo = _dispatch.undo, removeBlocks = _dispatch.removeBlocks, savePost = _dispatch.savePost; return { onSave: function onSave() { // TODO: This should be handled in the `savePost` effect in // considering `isSaveable`. See note on `isEditedPostSaveable` // selector about dirtiness and meta-boxes. When removing, also // remember to remove `isDirty` prop passing from `withSelect`. // // See: `isEditedPostSaveable` if (!ownProps.isDirty) { return; } savePost(); }, clearSelectedBlock: clearSelectedBlock, onMultiSelect: multiSelect, onRedo: redo, onUndo: undo, onRemove: removeBlocks }; })])(EditorGlobalKeyboardShortcuts)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/editor-history/redo.js": /*!***************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/editor-history/redo.js ***! \***************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__); /** * WordPress dependencies */ function EditorHistoryRedo(_ref) { var hasRedo = _ref.hasRedo, redo = _ref.redo; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["IconButton"], { icon: "redo", label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Redo'), shortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__["displayShortcut"].primaryShift('z'), disabled: !hasRedo, onClick: redo, className: "editor-history__redo" }); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { return { hasRedo: select('core/editor').hasEditorRedo() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withDispatch"])(function (dispatch) { return { redo: function redo() { return dispatch('core/editor').redo(); } }; })])(EditorHistoryRedo)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/editor-history/undo.js": /*!***************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/editor-history/undo.js ***! \***************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__); /** * WordPress dependencies */ function EditorHistoryUndo(_ref) { var hasUndo = _ref.hasUndo, undo = _ref.undo; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["IconButton"], { icon: "undo", label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Undo'), shortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__["displayShortcut"].primary('z'), disabled: !hasUndo, onClick: undo, className: "editor-history__undo" }); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { return { hasUndo: select('core/editor').hasEditorUndo() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withDispatch"])(function (dispatch) { return { undo: function undo() { return dispatch('core/editor').undo(); } }; })])(EditorHistoryUndo)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/editor-notices/index.js": /*!****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/editor-notices/index.js ***! \****************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _template_validation_notice__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../template-validation-notice */ "./node_modules/@wordpress/editor/build-module/components/template-validation-notice/index.js"); /** * WordPress dependencies */ /** * Internal dependencies */ function EditorNotices(props) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["NoticeList"], props, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_template_validation_notice__WEBPACK_IMPORTED_MODULE_4__["default"], null)); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { return { notices: select('core/editor').getNotices() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withDispatch"])(function (dispatch) { return { onRemove: dispatch('core/editor').removeNotice }; })])(EditorNotices)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/error-boundary/index.js": /*!****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/error-boundary/index.js ***! \****************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../ */ "./node_modules/@wordpress/editor/build-module/components/index.js"); /* harmony import */ var _store_selectors__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../store/selectors */ "./node_modules/@wordpress/editor/build-module/store/selectors.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var ErrorBoundary = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(ErrorBoundary, _Component); function ErrorBoundary() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, ErrorBoundary); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(ErrorBoundary).apply(this, arguments)); _this.reboot = _this.reboot.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.getContent = _this.getContent.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.state = { error: null }; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(ErrorBoundary, [{ key: "componentDidCatch", value: function componentDidCatch(error) { this.setState({ error: error }); } }, { key: "reboot", value: function reboot() { this.props.onError(); } }, { key: "getContent", value: function getContent() { try { return Object(_store_selectors__WEBPACK_IMPORTED_MODULE_11__["getEditedPostContent"])(this.context.store.getState()); } catch (error) {} } }, { key: "render", value: function render() { var error = this.state.error; if (!error) { return this.props.children; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(___WEBPACK_IMPORTED_MODULE_10__["Warning"], { className: "editor-error-boundary", actions: [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["Button"], { key: "recovery", onClick: this.reboot, isLarge: true }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Attempt Recovery')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["ClipboardButton"], { key: "copy-post", text: this.getContent, isLarge: true }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Copy Post Text')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["ClipboardButton"], { key: "copy-error", text: error.stack, isLarge: true }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Copy Error'))] }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('The editor has encountered an unexpected error.')); } }]); return ErrorBoundary; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); ErrorBoundary.contextTypes = { store: lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] }; /* harmony default export */ __webpack_exports__["default"] = (ErrorBoundary); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/font-sizes/font-size-picker.js": /*!***********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/font-sizes/font-size-picker.js ***! \***********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { var _select$getEditorSett = select('core/editor').getEditorSettings(), fontSizes = _select$getEditorSett.fontSizes; return { fontSizes: fontSizes }; })(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["FontSizePicker"])); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/font-sizes/index.js": /*!************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/font-sizes/index.js ***! \************************************************************************************/ /*! exports provided: getFontSize, getFontSizeClass, FontSizePicker, withFontSizes */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/editor/build-module/components/font-sizes/utils.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFontSize", function() { return _utils__WEBPACK_IMPORTED_MODULE_0__["getFontSize"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFontSizeClass", function() { return _utils__WEBPACK_IMPORTED_MODULE_0__["getFontSizeClass"]; }); /* harmony import */ var _font_size_picker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./font-size-picker */ "./node_modules/@wordpress/editor/build-module/components/font-sizes/font-size-picker.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FontSizePicker", function() { return _font_size_picker__WEBPACK_IMPORTED_MODULE_1__["default"]; }); /* harmony import */ var _with_font_sizes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./with-font-sizes */ "./node_modules/@wordpress/editor/build-module/components/font-sizes/with-font-sizes.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withFontSizes", function() { return _with_font_sizes__WEBPACK_IMPORTED_MODULE_2__["default"]; }); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/font-sizes/utils.js": /*!************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/font-sizes/utils.js ***! \************************************************************************************/ /*! exports provided: getFontSize, getFontSizeClass */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFontSize", function() { return getFontSize; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFontSizeClass", function() { return getFontSizeClass; }); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /** * External dependencies */ /** * Returns the font size object based on an array of named font sizes and the namedFontSize and customFontSize values. * If namedFontSize is undefined or not found in fontSizes an object with just the size value based on customFontSize is returned. * * @param {Array} fontSizes Array of font size objects containing at least the "name" and "size" values as properties. * @param {?string} fontSizeAttribute Content of the font size attribute (slug). * @param {?number} customFontSizeAttribute Contents of the custom font size attribute (value). * * @return {?string} If fontSizeAttribute is set and an equal slug is found in fontSizes it returns the font size object for that slug. * Otherwise, an object with just the size value based on customFontSize is returned. */ var getFontSize = function getFontSize(fontSizes, fontSizeAttribute, customFontSizeAttribute) { if (fontSizeAttribute) { var fontSizeObject = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(fontSizes, { slug: fontSizeAttribute }); if (fontSizeObject) { return fontSizeObject; } } return { size: customFontSizeAttribute }; }; /** * Returns a class based on fontSizeName. * * @param {string} fontSizeSlug Slug of the fontSize. * * @return {string} String with the class corresponding to the fontSize passed. * The class is generated by appending 'has-' followed by fontSizeSlug in kebabCase and ending with '-font-size'. */ function getFontSizeClass(fontSizeSlug) { if (!fontSizeSlug) { return; } return "has-".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["kebabCase"])(fontSizeSlug), "-font-size"); } /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/font-sizes/with-font-sizes.js": /*!**********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/font-sizes/with-font-sizes.js ***! \**********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/editor/build-module/components/font-sizes/utils.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Higher-order component, which handles font size logic for class generation, * font size value retrieval, and font size change handling. * * @param {...(object|string)} args The arguments should all be strings * Each string contains the font size attribute name e.g: 'fontSize'. * * @return {Function} Higher-order component. */ /* harmony default export */ __webpack_exports__["default"] = (function () { for (var _len = arguments.length, fontSizeNames = new Array(_len), _key = 0; _key < _len; _key++) { fontSizeNames[_key] = arguments[_key]; } /* * Computes an object whose key is the font size attribute name as passed in the array, * and the value is the custom font size attribute name. * Custom font size is automatically compted by appending custom followed by the font size attribute name in with the first letter capitalized. */ var fontSizeAttributeNames = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["reduce"])(fontSizeNames, function (fontSizeAttributeNamesAccumulator, fontSizeAttributeName) { fontSizeAttributeNamesAccumulator[fontSizeAttributeName] = "custom".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_8__["upperFirst"])(fontSizeAttributeName)); return fontSizeAttributeNamesAccumulator; }, {}); return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["createHigherOrderComponent"])(Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withSelect"])(function (select) { var _select$getEditorSett = select('core/editor').getEditorSettings(), fontSizes = _select$getEditorSett.fontSizes; return { fontSizes: fontSizes }; }), function (WrappedComponent) { return ( /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(_class, _Component); function _class(props) { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, _class); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(_class).call(this, props)); _this.setters = _this.createSetters(); _this.state = {}; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(_class, [{ key: "createSetters", value: function createSetters() { var _this2 = this; return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["reduce"])(fontSizeAttributeNames, function (settersAccumulator, customFontSizeAttributeName, fontSizeAttributeName) { var upperFirstFontSizeAttributeName = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["upperFirst"])(fontSizeAttributeName); settersAccumulator["set".concat(upperFirstFontSizeAttributeName)] = _this2.createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName); return settersAccumulator; }, {}); } }, { key: "createSetFontSize", value: function createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName) { var _this3 = this; return function (fontSizeValue) { var _this3$props$setAttri; var fontSizeObject = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["find"])(_this3.props.fontSizes, { size: fontSizeValue }); _this3.props.setAttributes((_this3$props$setAttri = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_this3$props$setAttri, fontSizeAttributeName, fontSizeObject && fontSizeObject.slug ? fontSizeObject.slug : undefined), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_this3$props$setAttri, customFontSizeAttributeName, fontSizeObject && fontSizeObject.slug ? undefined : fontSizeValue), _this3$props$setAttri)); }; } }, { key: "render", value: function render() { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(WrappedComponent, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, this.props, { fontSizes: undefined }, this.state, this.setters)); } }], [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(_ref, previousState) { var attributes = _ref.attributes, fontSizes = _ref.fontSizes; var didAttributesChange = function didAttributesChange(customFontSizeAttributeName, fontSizeAttributeName) { if (previousState[fontSizeAttributeName]) { // if new font size is name compare with the previous slug if (attributes[fontSizeAttributeName]) { return attributes[fontSizeAttributeName] !== previousState[fontSizeAttributeName].slug; } // if font size is not named, update when the font size value changes. return previousState[fontSizeAttributeName].size !== attributes[customFontSizeAttributeName]; } // in this case we need to build the font size object return true; }; if (!Object(lodash__WEBPACK_IMPORTED_MODULE_8__["some"])(fontSizeAttributeNames, didAttributesChange)) { return null; } var newState = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["reduce"])(Object(lodash__WEBPACK_IMPORTED_MODULE_8__["pickBy"])(fontSizeAttributeNames, didAttributesChange), function (newStateAccumulator, customFontSizeAttributeName, fontSizeAttributeName) { var fontSizeAttributeValue = attributes[fontSizeAttributeName]; var fontSizeObject = Object(_utils__WEBPACK_IMPORTED_MODULE_11__["getFontSize"])(fontSizes, fontSizeAttributeValue, attributes[customFontSizeAttributeName]); newStateAccumulator[fontSizeAttributeName] = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, fontSizeObject, { class: Object(_utils__WEBPACK_IMPORTED_MODULE_11__["getFontSizeClass"])(fontSizeAttributeValue) }); return newStateAccumulator; }, {}); return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, previousState, newState); } }]); return _class; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]) ); }]), 'withFontSizes'); }); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/ignore-nested-events/index.js": /*!**********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/ignore-nested-events/index.js ***! \**********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_10__); /** * External dependencies */ /** * WordPress dependencies */ /** * Component which renders a div with passed props applied except the optional * `childHandledEvents` prop. Event prop handlers are replaced with a proxying * event handler to capture and prevent events from being handled by ancestor * `IgnoreNestedEvents` elements by testing the presence of a private property * assigned on the event object. * * Optionally accepts an `childHandledEvents` prop array, which can be used in * instances where an inner `IgnoreNestedEvents` element exists and the outer * element should stop propagation but not invoke a callback handler, since it * would be assumed these are invoked by the child element. * * @type {Component} */ var IgnoreNestedEvents = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__["default"])(IgnoreNestedEvents, _Component); function IgnoreNestedEvents() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_3__["default"])(this, IgnoreNestedEvents); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__["default"])(IgnoreNestedEvents).apply(this, arguments)); _this.proxyEvent = _this.proxyEvent.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); // The event map is responsible for tracking an event type to a React // component prop name, since it is easy to determine event type from // a React prop name, but not the other way around. _this.eventMap = {}; return _this; } /** * General event handler which only calls to its original props callback if * it has not already been handled by a descendant IgnoreNestedEvents. * * @param {Event} event Event object. * * @return {void} */ Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__["default"])(IgnoreNestedEvents, [{ key: "proxyEvent", value: function proxyEvent(event) { var isHandled = !!event.nativeEvent._blockHandled; // Assign into the native event, since React will reuse their synthetic // event objects and this property assignment could otherwise leak. // // See: https://reactjs.org/docs/events.html#event-pooling event.nativeEvent._blockHandled = true; // Invoke original prop handler var propKey = this.eventMap[event.type]; // If already handled (i.e. assume nested block), only invoke a // corresponding "Handled"-suffixed prop callback. if (isHandled) { propKey += 'Handled'; } if (this.props[propKey]) { this.props[propKey](event); } } }, { key: "render", value: function render() { var _this2 = this; var _this$props = this.props, _this$props$childHand = _this$props.childHandledEvents, childHandledEvents = _this$props$childHand === void 0 ? [] : _this$props$childHand, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__["default"])(_this$props, ["childHandledEvents"]); var eventHandlers = Object(lodash__WEBPACK_IMPORTED_MODULE_10__["reduce"])(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(childHandledEvents).concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(Object.keys(props))), function (result, key) { // Try to match prop key as event handler var match = key.match(/^on([A-Z][a-zA-Z]+?)(Handled)?$/); if (match) { var isHandledProp = !!match[2]; if (isHandledProp) { // Avoid assigning through the invalid prop key. This // assumes mutation of shallow clone by above spread. delete props[key]; } // Re-map the prop to the local proxy handler to check whether // the event has already been handled. var proxiedPropName = 'on' + match[1]; result[proxiedPropName] = _this2.proxyEvent; // Assign event -> propName into an instance variable, so as to // avoid re-renders which could be incurred either by setState // or in mapping values to a newly created function. _this2.eventMap[match[1].toLowerCase()] = proxiedPropName; } return result; }, {}); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, eventHandlers)); } }]); return IgnoreNestedEvents; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (IgnoreNestedEvents); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/index.js": /*!*************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/index.js ***! \*************************************************************************/ /*! exports provided: Autocomplete, AlignmentToolbar, BlockAlignmentToolbar, BlockControls, BlockEdit, BlockFormatControls, BlockIcon, ColorPalette, withColorContext, ContrastChecker, InnerBlocks, InspectorAdvancedControls, InspectorControls, PanelColor, PanelColorSettings, PlainText, RichText, ServerSideRender, MediaPlaceholder, MediaUpload, URLInput, URLInputButton, AutosaveMonitor, DocumentOutline, DocumentOutlineCheck, EditorGlobalKeyboardShortcuts, EditorHistoryRedo, EditorHistoryUndo, EditorNotices, PageAttributesCheck, PageAttributesOrder, PageAttributesParent, PageTemplate, PostAuthor, PostAuthorCheck, PostComments, PostExcerpt, PostExcerptCheck, PostFeaturedImage, PostFeaturedImageCheck, PostFormat, PostFormatCheck, PostLastRevision, PostLastRevisionCheck, PostLockedModal, PostPendingStatus, PostPendingStatusCheck, PostPingbacks, PostPreviewButton, PostPublishButton, PostPublishButtonLabel, PostPublishPanel, PostPublishPanelToggle, PostSavedState, PostSchedule, PostScheduleCheck, PostScheduleLabel, PostSticky, PostStickyCheck, PostSwitchToDraftButton, PostTaxonomies, PostTaxonomiesCheck, PostTextEditor, PostTitle, PostTrash, PostTrashCheck, PostTypeSupportCheck, PostVisibility, PostVisibilityLabel, PostVisibilityCheck, TableOfContents, UnsavedChangesWarning, WordCount, BlockInspector, BlockList, BlockMover, BlockSelectionClearer, BlockSettingsMenu, _BlockSettingsMenuFirstItem, _BlockSettingsMenuPluginsExtension, BlockTitle, BlockToolbar, CopyHandler, DefaultBlockAppender, ErrorBoundary, Inserter, MultiBlocksSwitcher, MultiSelectScrollIntoView, NavigableToolbar, ObserveTyping, PreserveScrollInReorder, SkipToSelectedBlock, Warning, WritingFlow, EditorProvider, blockAutocompleter, userAutocompleter, getColorClassName, getColorObjectByAttributeValues, getColorObjectByColorValue, withColors, getFontSize, getFontSizeClass, FontSizePicker, withFontSizes */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _autocomplete__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./autocomplete */ "./node_modules/@wordpress/editor/build-module/components/autocomplete/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Autocomplete", function() { return _autocomplete__WEBPACK_IMPORTED_MODULE_0__["default"]; }); /* harmony import */ var _autocompleters__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./autocompleters */ "./node_modules/@wordpress/editor/build-module/components/autocompleters/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "blockAutocompleter", function() { return _autocompleters__WEBPACK_IMPORTED_MODULE_1__["blockAutocompleter"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "userAutocompleter", function() { return _autocompleters__WEBPACK_IMPORTED_MODULE_1__["userAutocompleter"]; }); /* harmony import */ var _alignment_toolbar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./alignment-toolbar */ "./node_modules/@wordpress/editor/build-module/components/alignment-toolbar/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AlignmentToolbar", function() { return _alignment_toolbar__WEBPACK_IMPORTED_MODULE_2__["default"]; }); /* harmony import */ var _block_alignment_toolbar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block-alignment-toolbar */ "./node_modules/@wordpress/editor/build-module/components/block-alignment-toolbar/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockAlignmentToolbar", function() { return _block_alignment_toolbar__WEBPACK_IMPORTED_MODULE_3__["default"]; }); /* harmony import */ var _block_controls__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block-controls */ "./node_modules/@wordpress/editor/build-module/components/block-controls/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockControls", function() { return _block_controls__WEBPACK_IMPORTED_MODULE_4__["default"]; }); /* harmony import */ var _block_edit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./block-edit */ "./node_modules/@wordpress/editor/build-module/components/block-edit/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockEdit", function() { return _block_edit__WEBPACK_IMPORTED_MODULE_5__["default"]; }); /* harmony import */ var _block_format_controls__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./block-format-controls */ "./node_modules/@wordpress/editor/build-module/components/block-format-controls/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockFormatControls", function() { return _block_format_controls__WEBPACK_IMPORTED_MODULE_6__["default"]; }); /* harmony import */ var _block_icon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./block-icon */ "./node_modules/@wordpress/editor/build-module/components/block-icon/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockIcon", function() { return _block_icon__WEBPACK_IMPORTED_MODULE_7__["default"]; }); /* harmony import */ var _color_palette__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./color-palette */ "./node_modules/@wordpress/editor/build-module/components/color-palette/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorPalette", function() { return _color_palette__WEBPACK_IMPORTED_MODULE_8__["default"]; }); /* harmony import */ var _color_palette_with_color_context__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./color-palette/with-color-context */ "./node_modules/@wordpress/editor/build-module/components/color-palette/with-color-context.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withColorContext", function() { return _color_palette_with_color_context__WEBPACK_IMPORTED_MODULE_9__["default"]; }); /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./colors */ "./node_modules/@wordpress/editor/build-module/components/colors/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getColorClassName", function() { return _colors__WEBPACK_IMPORTED_MODULE_10__["getColorClassName"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getColorObjectByAttributeValues", function() { return _colors__WEBPACK_IMPORTED_MODULE_10__["getColorObjectByAttributeValues"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getColorObjectByColorValue", function() { return _colors__WEBPACK_IMPORTED_MODULE_10__["getColorObjectByColorValue"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withColors", function() { return _colors__WEBPACK_IMPORTED_MODULE_10__["withColors"]; }); /* harmony import */ var _contrast_checker__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./contrast-checker */ "./node_modules/@wordpress/editor/build-module/components/contrast-checker/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContrastChecker", function() { return _contrast_checker__WEBPACK_IMPORTED_MODULE_11__["default"]; }); /* harmony import */ var _font_sizes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./font-sizes */ "./node_modules/@wordpress/editor/build-module/components/font-sizes/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFontSize", function() { return _font_sizes__WEBPACK_IMPORTED_MODULE_12__["getFontSize"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFontSizeClass", function() { return _font_sizes__WEBPACK_IMPORTED_MODULE_12__["getFontSizeClass"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FontSizePicker", function() { return _font_sizes__WEBPACK_IMPORTED_MODULE_12__["FontSizePicker"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withFontSizes", function() { return _font_sizes__WEBPACK_IMPORTED_MODULE_12__["withFontSizes"]; }); /* harmony import */ var _inner_blocks__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./inner-blocks */ "./node_modules/@wordpress/editor/build-module/components/inner-blocks/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InnerBlocks", function() { return _inner_blocks__WEBPACK_IMPORTED_MODULE_13__["default"]; }); /* harmony import */ var _inspector_advanced_controls__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./inspector-advanced-controls */ "./node_modules/@wordpress/editor/build-module/components/inspector-advanced-controls/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InspectorAdvancedControls", function() { return _inspector_advanced_controls__WEBPACK_IMPORTED_MODULE_14__["default"]; }); /* harmony import */ var _inspector_controls__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./inspector-controls */ "./node_modules/@wordpress/editor/build-module/components/inspector-controls/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InspectorControls", function() { return _inspector_controls__WEBPACK_IMPORTED_MODULE_15__["default"]; }); /* harmony import */ var _panel_color__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./panel-color */ "./node_modules/@wordpress/editor/build-module/components/panel-color/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PanelColor", function() { return _panel_color__WEBPACK_IMPORTED_MODULE_16__["default"]; }); /* harmony import */ var _panel_color_settings__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./panel-color-settings */ "./node_modules/@wordpress/editor/build-module/components/panel-color-settings/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PanelColorSettings", function() { return _panel_color_settings__WEBPACK_IMPORTED_MODULE_17__["default"]; }); /* harmony import */ var _plain_text__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./plain-text */ "./node_modules/@wordpress/editor/build-module/components/plain-text/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PlainText", function() { return _plain_text__WEBPACK_IMPORTED_MODULE_18__["default"]; }); /* harmony import */ var _rich_text__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./rich-text */ "./node_modules/@wordpress/editor/build-module/components/rich-text/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RichText", function() { return _rich_text__WEBPACK_IMPORTED_MODULE_19__["default"]; }); /* harmony import */ var _server_side_render__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./server-side-render */ "./node_modules/@wordpress/editor/build-module/components/server-side-render/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ServerSideRender", function() { return _server_side_render__WEBPACK_IMPORTED_MODULE_20__["default"]; }); /* harmony import */ var _media_placeholder__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./media-placeholder */ "./node_modules/@wordpress/editor/build-module/components/media-placeholder/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MediaPlaceholder", function() { return _media_placeholder__WEBPACK_IMPORTED_MODULE_21__["default"]; }); /* harmony import */ var _media_upload__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./media-upload */ "./node_modules/@wordpress/editor/build-module/components/media-upload/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MediaUpload", function() { return _media_upload__WEBPACK_IMPORTED_MODULE_22__["default"]; }); /* harmony import */ var _url_input__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./url-input */ "./node_modules/@wordpress/editor/build-module/components/url-input/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "URLInput", function() { return _url_input__WEBPACK_IMPORTED_MODULE_23__["default"]; }); /* harmony import */ var _url_input_button__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./url-input/button */ "./node_modules/@wordpress/editor/build-module/components/url-input/button.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "URLInputButton", function() { return _url_input_button__WEBPACK_IMPORTED_MODULE_24__["default"]; }); /* harmony import */ var _autosave_monitor__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./autosave-monitor */ "./node_modules/@wordpress/editor/build-module/components/autosave-monitor/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AutosaveMonitor", function() { return _autosave_monitor__WEBPACK_IMPORTED_MODULE_25__["default"]; }); /* harmony import */ var _document_outline__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./document-outline */ "./node_modules/@wordpress/editor/build-module/components/document-outline/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentOutline", function() { return _document_outline__WEBPACK_IMPORTED_MODULE_26__["default"]; }); /* harmony import */ var _document_outline_check__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./document-outline/check */ "./node_modules/@wordpress/editor/build-module/components/document-outline/check.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentOutlineCheck", function() { return _document_outline_check__WEBPACK_IMPORTED_MODULE_27__["default"]; }); /* harmony import */ var _editor_global_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./editor-global-keyboard-shortcuts */ "./node_modules/@wordpress/editor/build-module/components/editor-global-keyboard-shortcuts/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorGlobalKeyboardShortcuts", function() { return _editor_global_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_28__["default"]; }); /* harmony import */ var _editor_history_redo__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./editor-history/redo */ "./node_modules/@wordpress/editor/build-module/components/editor-history/redo.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorHistoryRedo", function() { return _editor_history_redo__WEBPACK_IMPORTED_MODULE_29__["default"]; }); /* harmony import */ var _editor_history_undo__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./editor-history/undo */ "./node_modules/@wordpress/editor/build-module/components/editor-history/undo.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorHistoryUndo", function() { return _editor_history_undo__WEBPACK_IMPORTED_MODULE_30__["default"]; }); /* harmony import */ var _editor_notices__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./editor-notices */ "./node_modules/@wordpress/editor/build-module/components/editor-notices/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorNotices", function() { return _editor_notices__WEBPACK_IMPORTED_MODULE_31__["default"]; }); /* harmony import */ var _page_attributes_check__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./page-attributes/check */ "./node_modules/@wordpress/editor/build-module/components/page-attributes/check.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PageAttributesCheck", function() { return _page_attributes_check__WEBPACK_IMPORTED_MODULE_32__["default"]; }); /* harmony import */ var _page_attributes_order__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./page-attributes/order */ "./node_modules/@wordpress/editor/build-module/components/page-attributes/order.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PageAttributesOrder", function() { return _page_attributes_order__WEBPACK_IMPORTED_MODULE_33__["default"]; }); /* harmony import */ var _page_attributes_parent__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./page-attributes/parent */ "./node_modules/@wordpress/editor/build-module/components/page-attributes/parent.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PageAttributesParent", function() { return _page_attributes_parent__WEBPACK_IMPORTED_MODULE_34__["default"]; }); /* harmony import */ var _page_attributes_template__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./page-attributes/template */ "./node_modules/@wordpress/editor/build-module/components/page-attributes/template.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PageTemplate", function() { return _page_attributes_template__WEBPACK_IMPORTED_MODULE_35__["default"]; }); /* harmony import */ var _post_author__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./post-author */ "./node_modules/@wordpress/editor/build-module/components/post-author/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostAuthor", function() { return _post_author__WEBPACK_IMPORTED_MODULE_36__["default"]; }); /* harmony import */ var _post_author_check__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./post-author/check */ "./node_modules/@wordpress/editor/build-module/components/post-author/check.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostAuthorCheck", function() { return _post_author_check__WEBPACK_IMPORTED_MODULE_37__["default"]; }); /* harmony import */ var _post_comments__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./post-comments */ "./node_modules/@wordpress/editor/build-module/components/post-comments/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostComments", function() { return _post_comments__WEBPACK_IMPORTED_MODULE_38__["default"]; }); /* harmony import */ var _post_excerpt__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./post-excerpt */ "./node_modules/@wordpress/editor/build-module/components/post-excerpt/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostExcerpt", function() { return _post_excerpt__WEBPACK_IMPORTED_MODULE_39__["default"]; }); /* harmony import */ var _post_excerpt_check__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./post-excerpt/check */ "./node_modules/@wordpress/editor/build-module/components/post-excerpt/check.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostExcerptCheck", function() { return _post_excerpt_check__WEBPACK_IMPORTED_MODULE_40__["default"]; }); /* harmony import */ var _post_featured_image__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./post-featured-image */ "./node_modules/@wordpress/editor/build-module/components/post-featured-image/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostFeaturedImage", function() { return _post_featured_image__WEBPACK_IMPORTED_MODULE_41__["default"]; }); /* harmony import */ var _post_featured_image_check__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./post-featured-image/check */ "./node_modules/@wordpress/editor/build-module/components/post-featured-image/check.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostFeaturedImageCheck", function() { return _post_featured_image_check__WEBPACK_IMPORTED_MODULE_42__["default"]; }); /* harmony import */ var _post_format__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./post-format */ "./node_modules/@wordpress/editor/build-module/components/post-format/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostFormat", function() { return _post_format__WEBPACK_IMPORTED_MODULE_43__["default"]; }); /* harmony import */ var _post_format_check__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./post-format/check */ "./node_modules/@wordpress/editor/build-module/components/post-format/check.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostFormatCheck", function() { return _post_format_check__WEBPACK_IMPORTED_MODULE_44__["default"]; }); /* harmony import */ var _post_last_revision__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./post-last-revision */ "./node_modules/@wordpress/editor/build-module/components/post-last-revision/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostLastRevision", function() { return _post_last_revision__WEBPACK_IMPORTED_MODULE_45__["default"]; }); /* harmony import */ var _post_last_revision_check__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./post-last-revision/check */ "./node_modules/@wordpress/editor/build-module/components/post-last-revision/check.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostLastRevisionCheck", function() { return _post_last_revision_check__WEBPACK_IMPORTED_MODULE_46__["default"]; }); /* harmony import */ var _post_locked_modal__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./post-locked-modal */ "./node_modules/@wordpress/editor/build-module/components/post-locked-modal/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostLockedModal", function() { return _post_locked_modal__WEBPACK_IMPORTED_MODULE_47__["default"]; }); /* harmony import */ var _post_pending_status__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./post-pending-status */ "./node_modules/@wordpress/editor/build-module/components/post-pending-status/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPendingStatus", function() { return _post_pending_status__WEBPACK_IMPORTED_MODULE_48__["default"]; }); /* harmony import */ var _post_pending_status_check__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./post-pending-status/check */ "./node_modules/@wordpress/editor/build-module/components/post-pending-status/check.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPendingStatusCheck", function() { return _post_pending_status_check__WEBPACK_IMPORTED_MODULE_49__["default"]; }); /* harmony import */ var _post_pingbacks__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./post-pingbacks */ "./node_modules/@wordpress/editor/build-module/components/post-pingbacks/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPingbacks", function() { return _post_pingbacks__WEBPACK_IMPORTED_MODULE_50__["default"]; }); /* harmony import */ var _post_preview_button__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./post-preview-button */ "./node_modules/@wordpress/editor/build-module/components/post-preview-button/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPreviewButton", function() { return _post_preview_button__WEBPACK_IMPORTED_MODULE_51__["default"]; }); /* harmony import */ var _post_publish_button__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./post-publish-button */ "./node_modules/@wordpress/editor/build-module/components/post-publish-button/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPublishButton", function() { return _post_publish_button__WEBPACK_IMPORTED_MODULE_52__["default"]; }); /* harmony import */ var _post_publish_button_label__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./post-publish-button/label */ "./node_modules/@wordpress/editor/build-module/components/post-publish-button/label.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPublishButtonLabel", function() { return _post_publish_button_label__WEBPACK_IMPORTED_MODULE_53__["default"]; }); /* harmony import */ var _post_publish_panel__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./post-publish-panel */ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPublishPanel", function() { return _post_publish_panel__WEBPACK_IMPORTED_MODULE_54__["default"]; }); /* harmony import */ var _post_publish_panel_toggle__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./post-publish-panel/toggle */ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/toggle.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostPublishPanelToggle", function() { return _post_publish_panel_toggle__WEBPACK_IMPORTED_MODULE_55__["default"]; }); /* harmony import */ var _post_saved_state__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./post-saved-state */ "./node_modules/@wordpress/editor/build-module/components/post-saved-state/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostSavedState", function() { return _post_saved_state__WEBPACK_IMPORTED_MODULE_56__["default"]; }); /* harmony import */ var _post_schedule__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./post-schedule */ "./node_modules/@wordpress/editor/build-module/components/post-schedule/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostSchedule", function() { return _post_schedule__WEBPACK_IMPORTED_MODULE_57__["default"]; }); /* harmony import */ var _post_schedule_check__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./post-schedule/check */ "./node_modules/@wordpress/editor/build-module/components/post-schedule/check.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostScheduleCheck", function() { return _post_schedule_check__WEBPACK_IMPORTED_MODULE_58__["default"]; }); /* harmony import */ var _post_schedule_label__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./post-schedule/label */ "./node_modules/@wordpress/editor/build-module/components/post-schedule/label.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostScheduleLabel", function() { return _post_schedule_label__WEBPACK_IMPORTED_MODULE_59__["default"]; }); /* harmony import */ var _post_sticky__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./post-sticky */ "./node_modules/@wordpress/editor/build-module/components/post-sticky/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostSticky", function() { return _post_sticky__WEBPACK_IMPORTED_MODULE_60__["default"]; }); /* harmony import */ var _post_sticky_check__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./post-sticky/check */ "./node_modules/@wordpress/editor/build-module/components/post-sticky/check.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostStickyCheck", function() { return _post_sticky_check__WEBPACK_IMPORTED_MODULE_61__["default"]; }); /* harmony import */ var _post_switch_to_draft_button__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./post-switch-to-draft-button */ "./node_modules/@wordpress/editor/build-module/components/post-switch-to-draft-button/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostSwitchToDraftButton", function() { return _post_switch_to_draft_button__WEBPACK_IMPORTED_MODULE_62__["default"]; }); /* harmony import */ var _post_taxonomies__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./post-taxonomies */ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTaxonomies", function() { return _post_taxonomies__WEBPACK_IMPORTED_MODULE_63__["default"]; }); /* harmony import */ var _post_taxonomies_check__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./post-taxonomies/check */ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/check.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTaxonomiesCheck", function() { return _post_taxonomies_check__WEBPACK_IMPORTED_MODULE_64__["default"]; }); /* harmony import */ var _post_text_editor__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./post-text-editor */ "./node_modules/@wordpress/editor/build-module/components/post-text-editor/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTextEditor", function() { return _post_text_editor__WEBPACK_IMPORTED_MODULE_65__["default"]; }); /* harmony import */ var _post_title__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./post-title */ "./node_modules/@wordpress/editor/build-module/components/post-title/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTitle", function() { return _post_title__WEBPACK_IMPORTED_MODULE_66__["default"]; }); /* harmony import */ var _post_trash__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./post-trash */ "./node_modules/@wordpress/editor/build-module/components/post-trash/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTrash", function() { return _post_trash__WEBPACK_IMPORTED_MODULE_67__["default"]; }); /* harmony import */ var _post_trash_check__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./post-trash/check */ "./node_modules/@wordpress/editor/build-module/components/post-trash/check.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTrashCheck", function() { return _post_trash_check__WEBPACK_IMPORTED_MODULE_68__["default"]; }); /* harmony import */ var _post_type_support_check__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./post-type-support-check */ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostTypeSupportCheck", function() { return _post_type_support_check__WEBPACK_IMPORTED_MODULE_69__["default"]; }); /* harmony import */ var _post_visibility__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./post-visibility */ "./node_modules/@wordpress/editor/build-module/components/post-visibility/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostVisibility", function() { return _post_visibility__WEBPACK_IMPORTED_MODULE_70__["default"]; }); /* harmony import */ var _post_visibility_label__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./post-visibility/label */ "./node_modules/@wordpress/editor/build-module/components/post-visibility/label.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostVisibilityLabel", function() { return _post_visibility_label__WEBPACK_IMPORTED_MODULE_71__["default"]; }); /* harmony import */ var _post_visibility_check__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./post-visibility/check */ "./node_modules/@wordpress/editor/build-module/components/post-visibility/check.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostVisibilityCheck", function() { return _post_visibility_check__WEBPACK_IMPORTED_MODULE_72__["default"]; }); /* harmony import */ var _table_of_contents__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./table-of-contents */ "./node_modules/@wordpress/editor/build-module/components/table-of-contents/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TableOfContents", function() { return _table_of_contents__WEBPACK_IMPORTED_MODULE_73__["default"]; }); /* harmony import */ var _unsaved_changes_warning__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./unsaved-changes-warning */ "./node_modules/@wordpress/editor/build-module/components/unsaved-changes-warning/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnsavedChangesWarning", function() { return _unsaved_changes_warning__WEBPACK_IMPORTED_MODULE_74__["default"]; }); /* harmony import */ var _word_count__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./word-count */ "./node_modules/@wordpress/editor/build-module/components/word-count/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WordCount", function() { return _word_count__WEBPACK_IMPORTED_MODULE_75__["default"]; }); /* harmony import */ var _block_inspector__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./block-inspector */ "./node_modules/@wordpress/editor/build-module/components/block-inspector/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockInspector", function() { return _block_inspector__WEBPACK_IMPORTED_MODULE_76__["default"]; }); /* harmony import */ var _block_list__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./block-list */ "./node_modules/@wordpress/editor/build-module/components/block-list/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockList", function() { return _block_list__WEBPACK_IMPORTED_MODULE_77__["default"]; }); /* harmony import */ var _block_mover__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ./block-mover */ "./node_modules/@wordpress/editor/build-module/components/block-mover/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockMover", function() { return _block_mover__WEBPACK_IMPORTED_MODULE_78__["default"]; }); /* harmony import */ var _block_selection_clearer__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ./block-selection-clearer */ "./node_modules/@wordpress/editor/build-module/components/block-selection-clearer/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockSelectionClearer", function() { return _block_selection_clearer__WEBPACK_IMPORTED_MODULE_79__["default"]; }); /* harmony import */ var _block_settings_menu__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ./block-settings-menu */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockSettingsMenu", function() { return _block_settings_menu__WEBPACK_IMPORTED_MODULE_80__["default"]; }); /* harmony import */ var _block_settings_menu_block_settings_menu_first_item__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ./block-settings-menu/block-settings-menu-first-item */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-settings-menu-first-item.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_BlockSettingsMenuFirstItem", function() { return _block_settings_menu_block_settings_menu_first_item__WEBPACK_IMPORTED_MODULE_81__["default"]; }); /* harmony import */ var _block_settings_menu_block_settings_menu_plugins_extension__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ./block-settings-menu/block-settings-menu-plugins-extension */ "./node_modules/@wordpress/editor/build-module/components/block-settings-menu/block-settings-menu-plugins-extension.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_BlockSettingsMenuPluginsExtension", function() { return _block_settings_menu_block_settings_menu_plugins_extension__WEBPACK_IMPORTED_MODULE_82__["default"]; }); /* harmony import */ var _block_title__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ./block-title */ "./node_modules/@wordpress/editor/build-module/components/block-title/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockTitle", function() { return _block_title__WEBPACK_IMPORTED_MODULE_83__["default"]; }); /* harmony import */ var _block_toolbar__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ./block-toolbar */ "./node_modules/@wordpress/editor/build-module/components/block-toolbar/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockToolbar", function() { return _block_toolbar__WEBPACK_IMPORTED_MODULE_84__["default"]; }); /* harmony import */ var _copy_handler__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ./copy-handler */ "./node_modules/@wordpress/editor/build-module/components/copy-handler/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CopyHandler", function() { return _copy_handler__WEBPACK_IMPORTED_MODULE_85__["default"]; }); /* harmony import */ var _default_block_appender__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./default-block-appender */ "./node_modules/@wordpress/editor/build-module/components/default-block-appender/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DefaultBlockAppender", function() { return _default_block_appender__WEBPACK_IMPORTED_MODULE_86__["default"]; }); /* harmony import */ var _error_boundary__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./error-boundary */ "./node_modules/@wordpress/editor/build-module/components/error-boundary/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ErrorBoundary", function() { return _error_boundary__WEBPACK_IMPORTED_MODULE_87__["default"]; }); /* harmony import */ var _inserter__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./inserter */ "./node_modules/@wordpress/editor/build-module/components/inserter/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Inserter", function() { return _inserter__WEBPACK_IMPORTED_MODULE_88__["default"]; }); /* harmony import */ var _block_switcher_multi_blocks_switcher__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./block-switcher/multi-blocks-switcher */ "./node_modules/@wordpress/editor/build-module/components/block-switcher/multi-blocks-switcher.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiBlocksSwitcher", function() { return _block_switcher_multi_blocks_switcher__WEBPACK_IMPORTED_MODULE_89__["default"]; }); /* harmony import */ var _multi_select_scroll_into_view__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ./multi-select-scroll-into-view */ "./node_modules/@wordpress/editor/build-module/components/multi-select-scroll-into-view/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiSelectScrollIntoView", function() { return _multi_select_scroll_into_view__WEBPACK_IMPORTED_MODULE_90__["default"]; }); /* harmony import */ var _navigable_toolbar__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ./navigable-toolbar */ "./node_modules/@wordpress/editor/build-module/components/navigable-toolbar/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NavigableToolbar", function() { return _navigable_toolbar__WEBPACK_IMPORTED_MODULE_91__["default"]; }); /* harmony import */ var _observe_typing__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ./observe-typing */ "./node_modules/@wordpress/editor/build-module/components/observe-typing/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ObserveTyping", function() { return _observe_typing__WEBPACK_IMPORTED_MODULE_92__["default"]; }); /* harmony import */ var _preserve_scroll_in_reorder__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ./preserve-scroll-in-reorder */ "./node_modules/@wordpress/editor/build-module/components/preserve-scroll-in-reorder/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PreserveScrollInReorder", function() { return _preserve_scroll_in_reorder__WEBPACK_IMPORTED_MODULE_93__["default"]; }); /* harmony import */ var _skip_to_selected_block__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ./skip-to-selected-block */ "./node_modules/@wordpress/editor/build-module/components/skip-to-selected-block/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SkipToSelectedBlock", function() { return _skip_to_selected_block__WEBPACK_IMPORTED_MODULE_94__["default"]; }); /* harmony import */ var _warning__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ./warning */ "./node_modules/@wordpress/editor/build-module/components/warning/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Warning", function() { return _warning__WEBPACK_IMPORTED_MODULE_95__["default"]; }); /* harmony import */ var _writing_flow__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ./writing-flow */ "./node_modules/@wordpress/editor/build-module/components/writing-flow/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WritingFlow", function() { return _writing_flow__WEBPACK_IMPORTED_MODULE_96__["default"]; }); /* harmony import */ var _provider__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ./provider */ "./node_modules/@wordpress/editor/build-module/components/provider/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorProvider", function() { return _provider__WEBPACK_IMPORTED_MODULE_97__["default"]; }); // Block Creation Components // Post Related Components // Content Related Components // State Related Components /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/inner-blocks/index.js": /*!**************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/inner-blocks/index.js ***! \**************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/viewport */ "@wordpress/viewport"); /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/is-shallow-equal */ "@wordpress/is-shallow-equal"); /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _block_list__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../block-list */ "./node_modules/@wordpress/editor/build-module/components/block-list/index.js"); /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var InnerBlocks = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(InnerBlocks, _Component); function InnerBlocks() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, InnerBlocks); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(InnerBlocks).apply(this, arguments)); _this.updateNestedSettings(); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(InnerBlocks, [{ key: "getTemplateLock", value: function getTemplateLock() { var _this$props = this.props, templateLock = _this$props.templateLock, parentLock = _this$props.parentLock; return templateLock === undefined ? parentLock : templateLock; } }, { key: "componentDidMount", value: function componentDidMount() { var innerBlocks = this.props.block.innerBlocks; // only synchronize innerBlocks with template if innerBlocks are empty or a locking all exists if (innerBlocks.length === 0 || this.getTemplateLock() === 'all') { return this.synchronizeBlocksWithTemplate(); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this$props2 = this.props, template = _this$props2.template, block = _this$props2.block; var innerBlocks = block.innerBlocks; this.updateNestedSettings(); // only synchronize innerBlocks with template if innerBlocks are empty or a locking all exists if (innerBlocks.length === 0 || this.getTemplateLock() === 'all') { var hasTemplateChanged = !Object(lodash__WEBPACK_IMPORTED_MODULE_7__["isEqual"])(template, prevProps.template); if (hasTemplateChanged) { this.synchronizeBlocksWithTemplate(); } } } /** * Called on mount or when a mismatch exists between the templates and * inner blocks, synchronizes inner blocks with the template, replacing * current blocks. */ }, { key: "synchronizeBlocksWithTemplate", value: function synchronizeBlocksWithTemplate() { var _this$props3 = this.props, template = _this$props3.template, block = _this$props3.block, replaceInnerBlocks = _this$props3.replaceInnerBlocks; var innerBlocks = block.innerBlocks; // Synchronize with templates. If the next set differs, replace. var nextBlocks = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__["synchronizeBlocksWithTemplate"])(innerBlocks, template); if (!Object(lodash__WEBPACK_IMPORTED_MODULE_7__["isEqual"])(nextBlocks, innerBlocks)) { replaceInnerBlocks(nextBlocks); } } }, { key: "updateNestedSettings", value: function updateNestedSettings() { var _this$props4 = this.props, blockListSettings = _this$props4.blockListSettings, allowedBlocks = _this$props4.allowedBlocks, updateNestedSettings = _this$props4.updateNestedSettings; var newSettings = { allowedBlocks: allowedBlocks, templateLock: this.getTemplateLock() }; if (!_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_12___default()(blockListSettings, newSettings)) { updateNestedSettings(newSettings); } } }, { key: "render", value: function render() { var _this$props5 = this.props, clientId = _this$props5.clientId, layouts = _this$props5.layouts, allowedBlocks = _this$props5.allowedBlocks, templateLock = _this$props5.templateLock, template = _this$props5.template, isSmallScreen = _this$props5.isSmallScreen, isSelectedBlockInRoot = _this$props5.isSelectedBlockInRoot; var classes = classnames__WEBPACK_IMPORTED_MODULE_8___default()('editor-inner-blocks', { 'has-overlay': isSmallScreen && !isSelectedBlockInRoot }); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { className: classes }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_block_list__WEBPACK_IMPORTED_MODULE_14__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ rootClientId: clientId }, { layouts: layouts, allowedBlocks: allowedBlocks, templateLock: templateLock, template: template }))); } }]); return InnerBlocks; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); InnerBlocks = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__["compose"])([Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_15__["withBlockEditContext"])(function (context) { return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["pick"])(context, ['clientId']); }), Object(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_9__["withViewportMatch"])({ isSmallScreen: '< medium' }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withSelect"])(function (select, ownProps) { var _select = select('core/editor'), isBlockSelected = _select.isBlockSelected, hasSelectedInnerBlock = _select.hasSelectedInnerBlock, getBlock = _select.getBlock, getBlockListSettings = _select.getBlockListSettings, getBlockRootClientId = _select.getBlockRootClientId, getTemplateLock = _select.getTemplateLock; var clientId = ownProps.clientId; var parentClientId = getBlockRootClientId(clientId); return { isSelectedBlockInRoot: isBlockSelected(clientId) || hasSelectedInnerBlock(clientId), block: getBlock(clientId), blockListSettings: getBlockListSettings(clientId), parentLock: getTemplateLock(parentClientId) }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withDispatch"])(function (dispatch, ownProps) { var _dispatch = dispatch('core/editor'), replaceBlocks = _dispatch.replaceBlocks, insertBlocks = _dispatch.insertBlocks, updateBlockListSettings = _dispatch.updateBlockListSettings; var block = ownProps.block, clientId = ownProps.clientId; return { replaceInnerBlocks: function replaceInnerBlocks(blocks) { var clientIds = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["map"])(block.innerBlocks, 'clientId'); if (clientIds.length) { replaceBlocks(clientIds, blocks); } else { insertBlocks(blocks, undefined, clientId); } }, updateNestedSettings: function updateNestedSettings(settings) { dispatch(updateBlockListSettings(clientId, settings)); } }; })])(InnerBlocks); InnerBlocks.Content = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_11__["withBlockContentContext"])(function (_ref) { var BlockContent = _ref.BlockContent; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(BlockContent, null); }); /* harmony default export */ __webpack_exports__["default"] = (InnerBlocks); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/inserter-with-shortcuts/index.js": /*!*************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/inserter-with-shortcuts/index.js ***! \*************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _block_icon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../block-icon */ "./node_modules/@wordpress/editor/build-module/components/block-icon/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function InserterWithShortcuts(_ref) { var items = _ref.items, isLocked = _ref.isLocked, onInsert = _ref.onInsert; if (isLocked) { return null; } var itemsWithoutDefaultBlock = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["filter"])(items, function (item) { return !item.isDisabled && (item.name !== Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["getDefaultBlockName"])() || !Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isEmpty"])(item.initialAttributes)); }).slice(0, 3); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", { className: "editor-inserter-with-shortcuts" }, itemsWithoutDefaultBlock.map(function (item) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["IconButton"], { key: item.id, className: "editor-inserter-with-shortcuts__block", onClick: function onClick() { return onInsert(item); } // translators: %s: block title/name to be added , label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Add %s'), item.title), icon: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_block_icon__WEBPACK_IMPORTED_MODULE_8__["default"], { icon: item.icon && item.icon.src }) }); })); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withSelect"])(function (select, _ref2) { var rootClientId = _ref2.rootClientId; var _select = select('core/editor'), getInserterItems = _select.getInserterItems, getTemplateLock = _select.getTemplateLock; return { items: getInserterItems(rootClientId), isLocked: !!getTemplateLock(rootClientId) }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withDispatch"])(function (dispatch, ownProps) { var clientId = ownProps.clientId, rootClientId = ownProps.rootClientId, layout = ownProps.layout; return { onInsert: function onInsert(_ref3) { var name = _ref3.name, initialAttributes = _ref3.initialAttributes; var block = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["createBlock"])(name, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, initialAttributes, { layout: layout })); if (clientId) { dispatch('core/editor').replaceBlocks(clientId, block); } else { dispatch('core/editor').insertBlock(block, undefined, rootClientId); } } }; }))(InserterWithShortcuts)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/inserter/child-blocks.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/inserter/child-blocks.js ***! \*****************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _block_types_list__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../block-types-list */ "./node_modules/@wordpress/editor/build-module/components/block-types-list/index.js"); /* harmony import */ var _block_icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../block-icon */ "./node_modules/@wordpress/editor/build-module/components/block-icon/index.js"); /** * WordPress dependencies */ /** * Internal dependencies */ function ChildBlocks(_ref) { var rootBlockIcon = _ref.rootBlockIcon, rootBlockTitle = _ref.rootBlockTitle, items = _ref.items, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["rootBlockIcon", "rootBlockTitle", "items"]); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", { className: "editor-inserter__child-blocks" }, (rootBlockIcon || rootBlockTitle) && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", { className: "editor-inserter__parent-block-header" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_block_icon__WEBPACK_IMPORTED_MODULE_6__["default"], { icon: rootBlockIcon, showColors: true }), rootBlockTitle && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("h2", null, rootBlockTitle)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_block_types_list__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ items: items }, props))); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])(Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["ifCondition"])(function (_ref2) { var items = _ref2.items; return items && items.length > 0; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select, _ref3) { var rootClientId = _ref3.rootClientId; var _select = select('core/blocks'), getBlockType = _select.getBlockType; var _select2 = select('core/editor'), getBlockName = _select2.getBlockName; var rootBlockName = getBlockName(rootClientId); var rootBlockType = getBlockType(rootBlockName); return { rootBlockTitle: rootBlockType && rootBlockType.title, rootBlockIcon: rootBlockType && rootBlockType.icon }; }))(ChildBlocks)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/inserter/index.js": /*!**********************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/inserter/index.js ***! \**********************************************************************************/ /*! exports provided: InserterResultsPortal, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./menu */ "./node_modules/@wordpress/editor/build-module/components/inserter/menu.js"); /* harmony import */ var _results_portal__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./results-portal */ "./node_modules/@wordpress/editor/build-module/components/inserter/results-portal.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InserterResultsPortal", function() { return _results_portal__WEBPACK_IMPORTED_MODULE_14__["default"]; }); /** * WordPress dependencies */ /** * Internal dependencies */ var defaultRenderToggle = function defaultRenderToggle(_ref) { var onToggle = _ref.onToggle, disabled = _ref.disabled, isOpen = _ref.isOpen; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["IconButton"], { icon: "insert", label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Add block'), onClick: onToggle, className: "editor-inserter__toggle", "aria-haspopup": "true", "aria-expanded": isOpen, disabled: disabled }); }; var Inserter = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(Inserter, _Component); function Inserter() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, Inserter); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(Inserter).apply(this, arguments)); _this.onToggle = _this.onToggle.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(Inserter, [{ key: "onToggle", value: function onToggle(isOpen) { var onToggle = this.props.onToggle; // Surface toggle callback to parent component if (onToggle) { onToggle(isOpen); } } }, { key: "render", value: function render() { var _this$props = this.props, items = _this$props.items, position = _this$props.position, title = _this$props.title, onInsertBlock = _this$props.onInsertBlock, rootClientId = _this$props.rootClientId, disabled = _this$props.disabled, _this$props$renderTog = _this$props.renderToggle, _renderToggle = _this$props$renderTog === void 0 ? defaultRenderToggle : _this$props$renderTog; if (items.length === 0) { return null; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["Dropdown"], { className: "editor-inserter", contentClassName: "editor-inserter__popover", position: position, onToggle: this.onToggle, expandOnMobile: true, headerTitle: title, renderToggle: function renderToggle(_ref2) { var onToggle = _ref2.onToggle, isOpen = _ref2.isOpen; return _renderToggle({ onToggle: onToggle, isOpen: isOpen, disabled: disabled }); }, renderContent: function renderContent(_ref3) { var onClose = _ref3.onClose; var onSelect = function onSelect(item) { onInsertBlock(item); onClose(); }; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_menu__WEBPACK_IMPORTED_MODULE_13__["default"], { items: items, onSelect: onSelect, rootClientId: rootClientId }); } }); } }]); return Inserter; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withSelect"])(function (select, _ref4) { var rootClientId = _ref4.rootClientId, layout = _ref4.layout; var _select = select('core/editor'), getEditedPostAttribute = _select.getEditedPostAttribute, getBlockInsertionPoint = _select.getBlockInsertionPoint, getSelectedBlock = _select.getSelectedBlock, getInserterItems = _select.getInserterItems, getBlockOrder = _select.getBlockOrder; var insertionPoint = getBlockInsertionPoint(); var parentId = rootClientId || insertionPoint.rootClientId; return { title: getEditedPostAttribute('title'), insertionPoint: { rootClientId: parentId, layout: rootClientId ? layout : insertionPoint.layout, index: rootClientId ? getBlockOrder(rootClientId).length : insertionPoint.index }, selectedBlock: getSelectedBlock(), items: getInserterItems(parentId), rootClientId: parentId }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withDispatch"])(function (dispatch, ownProps) { return { onInsertBlock: function onInsertBlock(item) { var selectedBlock = ownProps.selectedBlock, insertionPoint = ownProps.insertionPoint; var index = insertionPoint.index, rootClientId = insertionPoint.rootClientId, layout = insertionPoint.layout; var name = item.name, initialAttributes = item.initialAttributes; var insertedBlock = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["createBlock"])(name, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, initialAttributes, { layout: layout })); if (selectedBlock && Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["isUnmodifiedDefaultBlock"])(selectedBlock)) { return dispatch('core/editor').replaceBlocks(selectedBlock.clientId, insertedBlock); } return dispatch('core/editor').insertBlock(insertedBlock, index, rootClientId); } }; })])(Inserter)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/inserter/menu.js": /*!*********************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/inserter/menu.js ***! \*********************************************************************************/ /*! exports provided: searchItems, normalizeTerm, InserterMenu, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "searchItems", function() { return searchItems; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeTerm", function() { return normalizeTerm; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InserterMenu", function() { return InserterMenu; }); /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! dom-scroll-into-view */ "./node_modules/dom-scroll-into-view/lib/index.js"); /* harmony import */ var dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var _block_preview__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../block-preview */ "./node_modules/@wordpress/editor/build-module/components/block-preview/index.js"); /* harmony import */ var _block_types_list__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../block-types-list */ "./node_modules/@wordpress/editor/build-module/components/block-types-list/index.js"); /* harmony import */ var _child_blocks__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./child-blocks */ "./node_modules/@wordpress/editor/build-module/components/inserter/child-blocks.js"); /* harmony import */ var _results_portal__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./results-portal */ "./node_modules/@wordpress/editor/build-module/components/inserter/results-portal.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var MAX_SUGGESTED_ITEMS = 9; /** * Filters an item list given a search term. * * @param {Array} items Item list * @param {string} searchTerm Search term. * * @return {Array} Filtered item list. */ var searchItems = function searchItems(items, searchTerm) { var normalizedSearchTerm = normalizeTerm(searchTerm); var matchSearch = function matchSearch(string) { return normalizeTerm(string).indexOf(normalizedSearchTerm) !== -1; }; return items.filter(function (item) { return matchSearch(item.title) || Object(lodash__WEBPACK_IMPORTED_MODULE_8__["some"])(item.keywords, matchSearch); }); }; /** * Converts the search term into a normalized term. * * @param {string} term The search term to normalize. * * @return {string} The normalized search term. */ var normalizeTerm = function normalizeTerm(term) { // Disregard diacritics. // Input: "média" term = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["deburr"])(term); // Accommodate leading slash, matching autocomplete expectations. // Input: "/media" term = term.replace(/^\//, ''); // Lowercase. // Input: "MEDIA" term = term.toLowerCase(); // Strip leading and trailing whitespace. // Input: " media " term = term.trim(); return term; }; var InserterMenu = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(InserterMenu, _Component); function InserterMenu() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, InserterMenu); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(InserterMenu).apply(this, arguments)); _this.state = { childItems: [], filterValue: '', hoveredItem: null, suggestedItems: [], reusableItems: [], itemsPerCategory: {}, openPanels: ['suggested'] }; _this.onChangeSearchInput = _this.onChangeSearchInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.onHover = _this.onHover.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.panels = {}; _this.inserterResults = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createRef"])(); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(InserterMenu, [{ key: "componentDidMount", value: function componentDidMount() { // This could be replaced by a resolver. this.props.fetchReusableBlocks(); this.filter(); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (prevProps.items !== this.props.items) { this.filter(this.state.filterValue); } } }, { key: "onChangeSearchInput", value: function onChangeSearchInput(event) { this.filter(event.target.value); } }, { key: "onHover", value: function onHover(item) { this.setState({ hoveredItem: item }); if (item) { this.props.showInsertionPoint(); } else { this.props.hideInsertionPoint(); } } }, { key: "bindPanel", value: function bindPanel(name) { var _this2 = this; return function (ref) { _this2.panels[name] = ref; }; } }, { key: "onTogglePanel", value: function onTogglePanel(panel) { var _this3 = this; return function () { var isOpened = _this3.state.openPanels.indexOf(panel) !== -1; if (isOpened) { _this3.setState({ openPanels: Object(lodash__WEBPACK_IMPORTED_MODULE_8__["without"])(_this3.state.openPanels, panel) }); } else { _this3.setState({ openPanels: Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_this3.state.openPanels).concat([panel]) }); _this3.props.setTimeout(function () { // We need a generic way to access the panel's container // eslint-disable-next-line react/no-find-dom-node dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_9___default()(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["findDOMNode"])(_this3.panels[panel]), _this3.inserterResults.current, { alignWithTop: true }); }); } }; } }, { key: "filter", value: function filter() { var filterValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; var _this$props = this.props, items = _this$props.items, rootChildBlocks = _this$props.rootChildBlocks; var filteredItems = searchItems(items, filterValue); var childItems = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["filter"])(filteredItems, function (_ref) { var name = _ref.name; return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["includes"])(rootChildBlocks, name); }); var suggestedItems = []; if (!filterValue) { var maxSuggestedItems = this.props.maxSuggestedItems || MAX_SUGGESTED_ITEMS; suggestedItems = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["filter"])(items, function (item) { return item.utility > 0; }).slice(0, maxSuggestedItems); } var reusableItems = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["filter"])(filteredItems, { category: 'reusable' }); var getCategoryIndex = function getCategoryIndex(item) { return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["findIndex"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_12__["getCategories"])(), function (category) { return category.slug === item.category; }); }; var itemsPerCategory = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["flow"])(function (itemList) { return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["filter"])(itemList, function (item) { return item.category !== 'reusable'; }); }, function (itemList) { return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["sortBy"])(itemList, getCategoryIndex); }, function (itemList) { return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["groupBy"])(itemList, 'category'); })(filteredItems); var openPanels = this.state.openPanels; if (filterValue !== this.state.filterValue) { if (!filterValue) { openPanels = ['suggested']; } else if (reusableItems.length) { openPanels = ['reusable']; } else if (filteredItems.length) { var firstCategory = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["find"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_12__["getCategories"])(), function (_ref2) { var slug = _ref2.slug; return itemsPerCategory[slug] && itemsPerCategory[slug].length; }); openPanels = [firstCategory.slug]; } } this.setState({ hoveredItem: null, childItems: childItems, filterValue: filterValue, suggestedItems: suggestedItems, reusableItems: reusableItems, itemsPerCategory: itemsPerCategory, openPanels: openPanels }); } }, { key: "render", value: function render() { var _this4 = this; var _this$props2 = this.props, instanceId = _this$props2.instanceId, onSelect = _this$props2.onSelect, rootClientId = _this$props2.rootClientId; var _this$state = this.state, childItems = _this$state.childItems, filterValue = _this$state.filterValue, hoveredItem = _this$state.hoveredItem, suggestedItems = _this$state.suggestedItems, reusableItems = _this$state.reusableItems, itemsPerCategory = _this$state.itemsPerCategory, openPanels = _this$state.openPanels; var isPanelOpen = function isPanelOpen(panel) { return openPanels.indexOf(panel) !== -1; }; var isSearching = !!filterValue; // Disable reason: The inserter menu is a modal display, not one which // is always visible, and one which already incurs this behavior of // autoFocus via Popover's focusOnMount. /* eslint-disable jsx-a11y/no-autofocus */ return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", { className: "editor-inserter__menu" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("label", { htmlFor: "editor-inserter__search-".concat(instanceId), className: "screen-reader-text" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Search for a block')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("input", { id: "editor-inserter__search-".concat(instanceId), type: "search", placeholder: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Search for a block'), className: "editor-inserter__search", autoFocus: true, onChange: this.onChangeSearchInput }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", { className: "editor-inserter__results", ref: this.inserterResults, tabIndex: "0", role: "region", "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Available block types') }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_child_blocks__WEBPACK_IMPORTED_MODULE_17__["default"], { rootClientId: rootClientId, items: childItems, onSelect: onSelect, onHover: this.onHover }), !!suggestedItems.length && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["PanelBody"], { title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Most Used'), opened: isPanelOpen('suggested'), onToggle: this.onTogglePanel('suggested'), ref: this.bindPanel('suggested') }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_types_list__WEBPACK_IMPORTED_MODULE_16__["default"], { items: suggestedItems, onSelect: onSelect, onHover: this.onHover })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_results_portal__WEBPACK_IMPORTED_MODULE_18__["default"].Slot, { fillProps: { filterValue: filterValue } }), Object(lodash__WEBPACK_IMPORTED_MODULE_8__["map"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_12__["getCategories"])(), function (category) { var categoryItems = itemsPerCategory[category.slug]; if (!categoryItems || !categoryItems.length) { return null; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["PanelBody"], { key: category.slug, title: category.title, opened: isSearching || isPanelOpen(category.slug), onToggle: _this4.onTogglePanel(category.slug), ref: _this4.bindPanel(category.slug) }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_types_list__WEBPACK_IMPORTED_MODULE_16__["default"], { items: categoryItems, onSelect: onSelect, onHover: _this4.onHover })); }), !!reusableItems.length && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["PanelBody"], { className: "editor-inserter__reusable-blocks-panel", title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Reusable'), opened: isPanelOpen('reusable'), onToggle: this.onTogglePanel('reusable'), icon: "controls-repeat", ref: this.bindPanel('reusable') }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_types_list__WEBPACK_IMPORTED_MODULE_16__["default"], { items: reusableItems, onSelect: onSelect, onHover: this.onHover }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("a", { className: "editor-inserter__manage-reusable-blocks", href: "edit.php?post_type=wp_block" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Manage All Reusable Blocks'))), Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isEmpty"])(suggestedItems) && Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isEmpty"])(reusableItems) && Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isEmpty"])(itemsPerCategory) && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("p", { className: "editor-inserter__no-results" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('No blocks found.'))), hoveredItem && Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_12__["isReusableBlock"])(hoveredItem) && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_block_preview__WEBPACK_IMPORTED_MODULE_15__["default"], { name: hoveredItem.name, attributes: hoveredItem.initialAttributes })); /* eslint-enable jsx-a11y/no-autofocus */ } }]); return InserterMenu; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withSelect"])(function (select, _ref3) { var rootClientId = _ref3.rootClientId; var _select = select('core/blocks'), getChildBlockNames = _select.getChildBlockNames; var _select2 = select('core/editor'), getBlockName = _select2.getBlockName; var rootBlockName = getBlockName(rootClientId); return { rootChildBlocks: getChildBlockNames(rootBlockName) }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withDispatch"])(function (dispatch) { return { fetchReusableBlocks: dispatch('core/editor').fetchReusableBlocks, showInsertionPoint: dispatch('core/editor').showInsertionPoint, hideInsertionPoint: dispatch('core/editor').hideInsertionPoint }; }), _wordpress_components__WEBPACK_IMPORTED_MODULE_11__["withSpokenMessages"], _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["withInstanceId"], _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["withSafeTimeout"])(InserterMenu)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/inserter/results-portal.js": /*!*******************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/inserter/results-portal.js ***! \*******************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _block_types_list__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../block-types-list */ "./node_modules/@wordpress/editor/build-module/components/block-types-list/index.js"); /* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./menu */ "./node_modules/@wordpress/editor/build-module/components/inserter/menu.js"); /** * WordPress dependencies */ /** * Internal dependencies */ var _createSlotFill = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["createSlotFill"])('InserterResultsPortal'), Fill = _createSlotFill.Fill, Slot = _createSlotFill.Slot; var InserterResultsPortal = function InserterResultsPortal(_ref) { var items = _ref.items, title = _ref.title, onSelect = _ref.onSelect, onHover = _ref.onHover, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["items", "title", "onSelect", "onHover"]); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(Fill, null, function (_ref2) { var filterValue = _ref2.filterValue; var filteredItems = Object(_menu__WEBPACK_IMPORTED_MODULE_5__["searchItems"])(items, filterValue); if (!filteredItems.length) { return null; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["PanelBody"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ title: title }, props, { className: "editor-inserter__results-portal" }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_block_types_list__WEBPACK_IMPORTED_MODULE_4__["default"], { items: filteredItems, onSelect: onSelect, onHover: onHover })); }); }; InserterResultsPortal.Slot = Slot; /* harmony default export */ __webpack_exports__["default"] = (InserterResultsPortal); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/inspector-advanced-controls/index.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/inspector-advanced-controls/index.js ***! \*****************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); /** * WordPress dependencies */ /** * Internal dependencies */ var _createSlotFill = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('InspectorAdvancedControls'), Fill = _createSlotFill.Fill, Slot = _createSlotFill.Slot; var InspectorAdvancedControls = Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_1__["ifBlockEditSelected"])(Fill); InspectorAdvancedControls.Slot = Slot; /* harmony default export */ __webpack_exports__["default"] = (InspectorAdvancedControls); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/inspector-controls/index.js": /*!********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/inspector-controls/index.js ***! \********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); /** * WordPress dependencies */ /** * Internal dependencies */ var _createSlotFill = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('InspectorControls'), Fill = _createSlotFill.Fill, Slot = _createSlotFill.Slot; var InspectorControls = Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_1__["ifBlockEditSelected"])(Fill); InspectorControls.Slot = Slot; /* harmony default export */ __webpack_exports__["default"] = (InspectorControls); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/media-placeholder/index.js": /*!*******************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/media-placeholder/index.js ***! \*******************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/deprecated */ "@wordpress/deprecated"); /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _media_upload__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../media-upload */ "./node_modules/@wordpress/editor/build-module/components/media-upload/index.js"); /* harmony import */ var _utils___WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../utils/ */ "./node_modules/@wordpress/editor/build-module/utils/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var MediaPlaceholder = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(MediaPlaceholder, _Component); function MediaPlaceholder() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, MediaPlaceholder); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(MediaPlaceholder).apply(this, arguments)); _this.state = { src: '' }; _this.onChangeSrc = _this.onChangeSrc.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.onSubmitSrc = _this.onSubmitSrc.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.onUpload = _this.onUpload.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.onFilesUpload = _this.onFilesUpload.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(MediaPlaceholder, [{ key: "getAllowedTypes", value: function getAllowedTypes() { var _this$props = this.props, allowedTypes = _this$props.allowedTypes, deprecatedType = _this$props.type; var allowedTypesToUse = allowedTypes; if (!allowedTypes && deprecatedType) { _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_12___default()('type property of wp.editor.MediaPlaceholder', { version: '4.2', alternative: 'allowedTypes property containing an array with the allowedTypes or do not pass any property if all types are allowed' }); if (deprecatedType === '*') { allowedTypesToUse = undefined; } else { allowedTypesToUse = [deprecatedType]; } } return allowedTypesToUse; } }, { key: "onlyAllowsImages", value: function onlyAllowsImages() { var allowedTypes = this.getAllowedTypes(); if (!allowedTypes) { return false; } return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["every"])(allowedTypes, function (allowedType) { return allowedType === 'image' || Object(lodash__WEBPACK_IMPORTED_MODULE_8__["startsWith"])(allowedType, 'image/'); }); } }, { key: "componentDidMount", value: function componentDidMount() { this.setState({ src: Object(lodash__WEBPACK_IMPORTED_MODULE_8__["get"])(this.props.value, ['src'], '') }); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (Object(lodash__WEBPACK_IMPORTED_MODULE_8__["get"])(prevProps.value, ['src'], '') !== Object(lodash__WEBPACK_IMPORTED_MODULE_8__["get"])(this.props.value, ['src'], '')) { this.setState({ src: Object(lodash__WEBPACK_IMPORTED_MODULE_8__["get"])(this.props.value, ['src'], '') }); } } }, { key: "onChangeSrc", value: function onChangeSrc(event) { this.setState({ src: event.target.value }); } }, { key: "onSubmitSrc", value: function onSubmitSrc(event) { event.preventDefault(); if (this.state.src && this.props.onSelectURL) { this.props.onSelectURL(this.state.src); } } }, { key: "onUpload", value: function onUpload(event) { this.onFilesUpload(event.target.files); } }, { key: "onFilesUpload", value: function onFilesUpload(files) { var _this$props2 = this.props, onSelect = _this$props2.onSelect, multiple = _this$props2.multiple, onError = _this$props2.onError; var allowedTypes = this.getAllowedTypes(); var setMedia = multiple ? onSelect : function (_ref) { var _ref2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, 1), media = _ref2[0]; return onSelect(media); }; Object(_utils___WEBPACK_IMPORTED_MODULE_14__["mediaUpload"])({ allowedTypes: allowedTypes, filesList: files, onFileChange: setMedia, onError: onError }); } }, { key: "render", value: function render() { var _this$props3 = this.props, accept = _this$props3.accept, icon = _this$props3.icon, className = _this$props3.className, labels = _this$props3.labels, onSelect = _this$props3.onSelect, _this$props3$value = _this$props3.value, value = _this$props3$value === void 0 ? {} : _this$props3$value, onSelectURL = _this$props3.onSelectURL, _this$props3$onHTMLDr = _this$props3.onHTMLDrop, onHTMLDrop = _this$props3$onHTMLDr === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_8__["noop"] : _this$props3$onHTMLDr, _this$props3$multiple = _this$props3.multiple, multiple = _this$props3$multiple === void 0 ? false : _this$props3$multiple, notices = _this$props3.notices; var allowedTypes = this.getAllowedTypes(); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["Placeholder"], { icon: icon, label: labels.title // translators: %s: media name label e.g: "an audio","an image", "a video" , instructions: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Drag %s, upload a new one or select a file from your library.'), labels.name), className: classnames__WEBPACK_IMPORTED_MODULE_9___default()('editor-media-placeholder', className), notices: notices }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["DropZone"], { onFilesDrop: this.onFilesUpload, onHTMLDrop: onHTMLDrop }), onSelectURL && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("form", { onSubmit: this.onSubmitSrc }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("input", { type: "url", className: "components-placeholder__input", "aria-label": labels.title, placeholder: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Enter URL here…'), onChange: this.onChangeSrc, value: this.state.src }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["Button"], { isLarge: true, type: "submit" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Use URL'))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["FormFileUpload"], { isLarge: true, className: "editor-media-placeholder__upload-button", onChange: this.onUpload, accept: accept, multiple: multiple }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Upload')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_media_upload__WEBPACK_IMPORTED_MODULE_13__["default"], { gallery: multiple && this.onlyAllowsImages(), multiple: multiple, onSelect: onSelect, allowedTypes: allowedTypes, value: value.id, render: function render(_ref3) { var open = _ref3.open; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["Button"], { isLarge: true, onClick: open }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Media Library')); } })); } }]); return MediaPlaceholder; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (MediaPlaceholder); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/media-upload/index.js": /*!**************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/media-upload/index.js ***! \**************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); /** * WordPress dependencies */ /** * This is a placeholder for the media upload component necessary to make it possible to provide * an integration with the core blocks that handle media files. By default it renders nothing but * it provides a way to have it overridden with the `editor.MediaUpload` filter. * * @return {WPElement} Media upload element. */ var MediaUpload = function MediaUpload() { return null; }; // Todo: rename the filter /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["withFilters"])('editor.MediaUpload')(MediaUpload)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/multi-select-scroll-into-view/index.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/multi-select-scroll-into-view/index.js ***! \*******************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! dom-scroll-into-view */ "./node_modules/dom-scroll-into-view/lib/index.js"); /* harmony import */ var dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/dom */ "./node_modules/@wordpress/editor/build-module/utils/dom.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var MultiSelectScrollIntoView = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(MultiSelectScrollIntoView, _Component); function MultiSelectScrollIntoView() { Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, MultiSelectScrollIntoView); return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(MultiSelectScrollIntoView).apply(this, arguments)); } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(MultiSelectScrollIntoView, [{ key: "componentDidUpdate", value: function componentDidUpdate() { // Relies on expectation that `componentDidUpdate` will only be called // if value of `extentClientId` changes. this.scrollIntoView(); } /** * Ensures that if a multi-selection exists, the extent of the selection is * visible within the nearest scrollable container. * * @return {void} */ }, { key: "scrollIntoView", value: function scrollIntoView() { var extentClientId = this.props.extentClientId; if (!extentClientId) { return; } var extentNode = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_9__["getBlockDOMNode"])(extentClientId); if (!extentNode) { return; } var scrollContainer = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["getScrollContainer"])(extentNode); // If there's no scroll container, it follows that there's no scrollbar // and thus there's no need to try to scroll into view. if (!scrollContainer) { return; } dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_5___default()(extentNode, scrollContainer, { onlyScrollIfNeeded: true }); } }, { key: "render", value: function render() { return null; } }]); return MultiSelectScrollIntoView; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withSelect"])(function (select) { var _select = select('core/editor'), getLastMultiSelectedBlockClientId = _select.getLastMultiSelectedBlockClientId; return { extentClientId: getLastMultiSelectedBlockClientId() }; })(MultiSelectScrollIntoView)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/navigable-toolbar/index.js": /*!*******************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/navigable-toolbar/index.js ***! \*******************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__); /** * External dependencies */ /** * WordPress dependencies */ /** * Browser dependencies */ var _window = window, Node = _window.Node, getSelection = _window.getSelection; var NavigableToolbar = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(NavigableToolbar, _Component); function NavigableToolbar() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, NavigableToolbar); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(NavigableToolbar).apply(this, arguments)); _this.bindNode = _this.bindNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.focusToolbar = _this.focusToolbar.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.focusSelection = _this.focusSelection.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.switchOnKeyDown = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["cond"])([[Object(lodash__WEBPACK_IMPORTED_MODULE_9__["matchesProperty"])(['keyCode'], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["ESCAPE"]), _this.focusSelection]]); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(NavigableToolbar, [{ key: "bindNode", value: function bindNode(ref) { // Disable reason: Need DOM node for finding first focusable element // on keyboard interaction to shift to toolbar. // eslint-disable-next-line react/no-find-dom-node this.toolbar = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["findDOMNode"])(ref); } }, { key: "focusToolbar", value: function focusToolbar() { var tabbables = _wordpress_dom__WEBPACK_IMPORTED_MODULE_11__["focus"].tabbable.find(this.toolbar); if (tabbables.length) { tabbables[0].focus(); } } /** * Programmatically shifts focus to the element where the current selection * exists, if there is a selection. */ }, { key: "focusSelection", value: function focusSelection() { // Ensure that a selection exists. var selection = getSelection(); if (!selection) { return; } // Focus node may be a text node, which cannot be focused directly. // Find its parent element instead. var focusNode = selection.focusNode; var focusElement = focusNode; if (focusElement.nodeType !== Node.ELEMENT_NODE) { focusElement = focusElement.parentElement; } if (focusElement) { focusElement.focus(); } } }, { key: "render", value: function render() { var _this$props = this.props, children = _this$props.children, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["children"]); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["NavigableMenu"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ orientation: "horizontal", role: "toolbar", ref: this.bindNode, onKeyDown: this.switchOnKeyDown }, props), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["KeyboardShortcuts"], { bindGlobal: true // Use the same event that TinyMCE uses in the Classic block for its own `alt+f10` shortcut. , eventName: "keydown", shortcuts: { 'alt+f10': this.focusToolbar } }), children); } }]); return NavigableToolbar; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (NavigableToolbar); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/observe-typing/index.js": /*!****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/observe-typing/index.js ***! \****************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__); /** * External dependencies */ /** * WordPress dependencies */ /** * Set of key codes upon which typing is to be initiated on a keydown event. * * @type {number[]} */ var KEY_DOWN_ELIGIBLE_KEY_CODES = [_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["UP"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["RIGHT"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["DOWN"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["LEFT"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["ENTER"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["BACKSPACE"]]; /** * Returns true if a given keydown event can be inferred as intent to start * typing, or false otherwise. A keydown is considered eligible if it is a * text navigation without shift active. * * @param {KeyboardEvent} event Keydown event to test. * * @return {boolean} Whether event is eligible to start typing. */ function isKeyDownEligibleForStartTyping(event) { var keyCode = event.keyCode, shiftKey = event.shiftKey; return !shiftKey && Object(lodash__WEBPACK_IMPORTED_MODULE_7__["includes"])(KEY_DOWN_ELIGIBLE_KEY_CODES, keyCode); } var ObserveTyping = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(ObserveTyping, _Component); function ObserveTyping() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, ObserveTyping); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(ObserveTyping).apply(this, arguments)); _this.stopTypingOnSelectionUncollapse = _this.stopTypingOnSelectionUncollapse.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.stopTypingOnMouseMove = _this.stopTypingOnMouseMove.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.startTypingInTextField = _this.startTypingInTextField.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.stopTypingOnNonTextField = _this.stopTypingOnNonTextField.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.lastMouseMove = null; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(ObserveTyping, [{ key: "componentDidMount", value: function componentDidMount() { this.toggleEventBindings(this.props.isTyping); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.props.isTyping !== prevProps.isTyping) { this.toggleEventBindings(this.props.isTyping); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.toggleEventBindings(false); } /** * Bind or unbind events to the document when typing has started or stopped * respectively, or when component has become unmounted. * * @param {boolean} isBound Whether event bindings should be applied. */ }, { key: "toggleEventBindings", value: function toggleEventBindings(isBound) { var bindFn = isBound ? 'addEventListener' : 'removeEventListener'; document[bindFn]('selectionchange', this.stopTypingOnSelectionUncollapse); document[bindFn]('mousemove', this.stopTypingOnMouseMove); } /** * On mouse move, unset typing flag if user has moved cursor. * * @param {MouseEvent} event Mousemove event. */ }, { key: "stopTypingOnMouseMove", value: function stopTypingOnMouseMove(event) { var clientX = event.clientX, clientY = event.clientY; // We need to check that the mouse really moved because Safari triggers // mousemove events when shift or ctrl are pressed. if (this.lastMouseMove) { var _this$lastMouseMove = this.lastMouseMove, lastClientX = _this$lastMouseMove.clientX, lastClientY = _this$lastMouseMove.clientY; if (lastClientX !== clientX || lastClientY !== clientY) { this.props.onStopTyping(); } } this.lastMouseMove = { clientX: clientX, clientY: clientY }; } /** * On selection change, unset typing flag if user has made an uncollapsed * (shift) selection. */ }, { key: "stopTypingOnSelectionUncollapse", value: function stopTypingOnSelectionUncollapse() { var selection = window.getSelection(); var isCollapsed = selection.rangeCount > 0 && selection.getRangeAt(0).collapsed; if (!isCollapsed) { this.props.onStopTyping(); } } /** * Handles a keypress or keydown event to infer intention to start typing. * * @param {KeyboardEvent} event Keypress or keydown event to interpret. */ }, { key: "startTypingInTextField", value: function startTypingInTextField(event) { var _this$props = this.props, isTyping = _this$props.isTyping, onStartTyping = _this$props.onStartTyping; var type = event.type, target = event.target; // Abort early if already typing, or key press is incurred outside a // text field (e.g. arrow-ing through toolbar buttons). // Ignore typing in a block toolbar if (isTyping || !Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_9__["isTextField"])(target) || target.closest('.editor-block-toolbar')) { return; } // Special-case keydown because certain keys do not emit a keypress // event. Conversely avoid keydown as the canonical event since there // are many keydown which are explicitly not targeted for typing. if (type === 'keydown' && !isKeyDownEligibleForStartTyping(event)) { return; } onStartTyping(); } /** * Stops typing when focus transitions to a non-text field element. * * @param {FocusEvent} event Focus event. */ }, { key: "stopTypingOnNonTextField", value: function stopTypingOnNonTextField(event) { var _this2 = this; event.persist(); // Since focus to a non-text field via arrow key will trigger before // the keydown event, wait until after current stack before evaluating // whether typing is to be stopped. Otherwise, typing will re-start. this.props.setTimeout(function () { var _this2$props = _this2.props, isTyping = _this2$props.isTyping, onStopTyping = _this2$props.onStopTyping; var target = event.target; if (isTyping && !Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_9__["isTextField"])(target)) { onStopTyping(); } }); } }, { key: "render", value: function render() { var children = this.props.children; // Disable reason: This component is responsible for capturing bubbled // keyboard events which are interpreted as typing intent. /* eslint-disable jsx-a11y/no-static-element-interactions */ return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { onFocus: this.stopTypingOnNonTextField, onKeyPress: this.startTypingInTextField, onKeyDown: this.startTypingInTextField }, children); /* eslint-enable jsx-a11y/no-static-element-interactions */ } }]); return ObserveTyping; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__["withSelect"])(function (select) { var _select = select('core/editor'), isTyping = _select.isTyping; return { isTyping: isTyping() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), startTyping = _dispatch.startTyping, stopTyping = _dispatch.stopTyping; return { onStartTyping: startTyping, onStopTyping: stopTyping }; }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["withSafeTimeout"]])(ObserveTyping)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/page-attributes/check.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/page-attributes/check.js ***! \*****************************************************************************************/ /*! exports provided: PageAttributesCheck, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PageAttributesCheck", function() { return PageAttributesCheck; }); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); /** * External dependencies */ /** * WordPress dependencies */ function PageAttributesCheck(_ref) { var availableTemplates = _ref.availableTemplates, postType = _ref.postType, children = _ref.children; var supportsPageAttributes = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(postType, ['supports', 'page-attributes'], false); // Only render fields if post type supports page attributes or available templates exist. if (!supportsPageAttributes && Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isEmpty"])(availableTemplates)) { return null; } return children; } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { var _select = select('core/editor'), getEditedPostAttribute = _select.getEditedPostAttribute, getEditorSettings = _select.getEditorSettings; var _select2 = select('core'), getPostType = _select2.getPostType; var _getEditorSettings = getEditorSettings(), availableTemplates = _getEditorSettings.availableTemplates; return { postType: getPostType(getEditedPostAttribute('type')), availableTemplates: availableTemplates }; })(PageAttributesCheck)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/page-attributes/order.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/page-attributes/order.js ***! \*****************************************************************************************/ /*! exports provided: PageAttributesOrder, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PageAttributesOrder", function() { return PageAttributesOrder; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _post_type_support_check__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../post-type-support-check */ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var PageAttributesOrder = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["withState"])({ orderInput: null })(function (_ref) { var onUpdateOrder = _ref.onUpdateOrder, _ref$order = _ref.order, order = _ref$order === void 0 ? 0 : _ref$order, orderInput = _ref.orderInput, setState = _ref.setState; var setUpdatedOrder = function setUpdatedOrder(value) { setState({ orderInput: value }); var newOrder = Number(value); if (Number.isInteger(newOrder) && Object(lodash__WEBPACK_IMPORTED_MODULE_1__["invoke"])(value, ['trim']) !== '') { onUpdateOrder(Number(value)); } }; var value = orderInput === null ? order : orderInput; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["TextControl"], { className: "editor-page-attributes__order", type: "number", label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Order'), value: value, onChange: setUpdatedOrder, size: 6, onBlur: function onBlur() { setState({ orderInput: null }); } }); }); function PageAttributesOrderWithChecks(props) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_type_support_check__WEBPACK_IMPORTED_MODULE_6__["default"], { supportKeys: "page-attributes" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(PageAttributesOrder, props)); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])(function (select) { return { order: select('core/editor').getEditedPostAttribute('menu_order') }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withDispatch"])(function (dispatch) { return { onUpdateOrder: function onUpdateOrder(order) { dispatch('core/editor').editPost({ menu_order: order }); } }; })])(PageAttributesOrderWithChecks)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/page-attributes/parent.js": /*!******************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/page-attributes/parent.js ***! \******************************************************************************************/ /*! exports provided: PageAttributesParent, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PageAttributesParent", function() { return PageAttributesParent; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/terms */ "./node_modules/@wordpress/editor/build-module/utils/terms.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function PageAttributesParent(_ref) { var parent = _ref.parent, postType = _ref.postType, items = _ref.items, onUpdateParent = _ref.onUpdateParent; var isHierarchical = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(postType, ['hierarchical'], false); var parentPageLabel = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(postType, ['labels', 'parent_item_colon']); var pageItems = items || []; if (!isHierarchical || !parentPageLabel || !pageItems.length) { return null; } var pagesTree = Object(_utils_terms__WEBPACK_IMPORTED_MODULE_6__["buildTermsTree"])(pageItems.map(function (item) { return { id: item.id, parent: item.parent, name: item.title.raw ? item.title.raw : "#".concat(item.id, " (").concat(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('no title'), ")") }; })); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["TreeSelect"], { label: parentPageLabel, noOptionLabel: "(".concat(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('no parent'), ")"), tree: pagesTree, selectedId: parent, onChange: onUpdateParent }); } var applyWithSelect = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select) { var _select = select('core'), getPostType = _select.getPostType, getEntityRecords = _select.getEntityRecords; var _select2 = select('core/editor'), getCurrentPostId = _select2.getCurrentPostId, getEditedPostAttribute = _select2.getEditedPostAttribute; var postTypeSlug = getEditedPostAttribute('type'); var postType = getPostType(postTypeSlug); var postId = getCurrentPostId(); var isHierarchical = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(postType, ['hierarchical'], false); var query = { per_page: -1, exclude: postId, parent_exclude: postId, orderby: 'menu_order', order: 'asc' }; return { parent: getEditedPostAttribute('parent'), items: isHierarchical ? getEntityRecords('postType', postTypeSlug, query) : [], postType: postType }; }); var applyWithDispatch = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), editPost = _dispatch.editPost; return { onUpdateParent: function onUpdateParent(parent) { editPost({ parent: parent || 0 }); } }; }); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])([applyWithSelect, applyWithDispatch])(PageAttributesParent)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/page-attributes/template.js": /*!********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/page-attributes/template.js ***! \********************************************************************************************/ /*! exports provided: PageTemplate, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PageTemplate", function() { return PageTemplate; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); /** * External dependencies */ /** * WordPress dependencies */ function PageTemplate(_ref) { var availableTemplates = _ref.availableTemplates, selectedTemplate = _ref.selectedTemplate, onUpdate = _ref.onUpdate; if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isEmpty"])(availableTemplates)) { return null; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["SelectControl"], { label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Template:'), value: selectedTemplate, onChange: onUpdate, className: "editor-page-attributes__template", options: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["map"])(availableTemplates, function (templateName, templateSlug) { return { value: templateSlug, label: templateName }; }) }); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select) { var _select = select('core/editor'), getEditedPostAttribute = _select.getEditedPostAttribute, getEditorSettings = _select.getEditorSettings; var _getEditorSettings = getEditorSettings(), availableTemplates = _getEditorSettings.availableTemplates; return { selectedTemplate: getEditedPostAttribute('template'), availableTemplates: availableTemplates }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withDispatch"])(function (dispatch) { return { onUpdate: function onUpdate(templateSlug) { dispatch('core/editor').editPost({ template: templateSlug || '' }); } }; }))(PageTemplate)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/panel-color-settings/index.js": /*!**********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/panel-color-settings/index.js ***! \**********************************************************************************************/ /*! exports provided: PanelColorSettings, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PanelColorSettings", function() { return PanelColorSettings; }); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _color_palette_control__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../color-palette/control */ "./node_modules/@wordpress/editor/build-module/components/color-palette/control.js"); /* harmony import */ var _color_palette_with_color_context__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../color-palette/with-color-context */ "./node_modules/@wordpress/editor/build-module/components/color-palette/with-color-context.js"); /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../colors */ "./node_modules/@wordpress/editor/build-module/components/colors/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ // translators: first %s: The type of color (e.g. background color), second %s: the color name or value (e.g. red or #ff0000) var colorIndicatorAriaLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('(%s: %s)'); var renderColorIndicators = function renderColorIndicators(colorSettings, colors) { return colorSettings.map(function (_ref, index) { var value = _ref.value, label = _ref.label; if (!value) { return null; } var colorObject = Object(_colors__WEBPACK_IMPORTED_MODULE_9__["getColorObjectByColorValue"])(colors, value); var colorName = colorObject && colorObject.name; var ariaLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["sprintf"])(colorIndicatorAriaLabel, label.toLowerCase(), colorName || value); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["ColorIndicator"], { key: index, colorValue: value, "aria-label": ariaLabel }); }); }; // colorSettings is passed as an array of props so that it can be used for // mapping both ColorIndicator and ColorPaletteControl components. Passing // an array of components/nodes here wouldn't be feasible. function PanelColorSettings(_ref2) { var title = _ref2.title, colorSettings = _ref2.colorSettings, colors = _ref2.colors, children = _ref2.children, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref2, ["title", "colorSettings", "colors", "children"]); var className = 'editor-panel-color-settings'; var titleElement = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", { className: "".concat(className, "__panel-title") }, title, renderColorIndicators(colorSettings, colors)); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["PanelBody"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ className: className, title: titleElement }, Object(lodash__WEBPACK_IMPORTED_MODULE_3__["omit"])(props, 'colors')), colorSettings.map(function (settings, index) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_color_palette_control__WEBPACK_IMPORTED_MODULE_7__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ key: index }, settings)); }), children); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])([_color_palette_with_color_context__WEBPACK_IMPORTED_MODULE_8__["default"], Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["ifCondition"])(function (_ref3) { var hasColorsToChoose = _ref3.hasColorsToChoose; return hasColorsToChoose; })])(PanelColorSettings)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/panel-color/index.js": /*!*************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/panel-color/index.js ***! \*************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _color_palette__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../color-palette */ "./node_modules/@wordpress/editor/build-module/components/color-palette/index.js"); /* harmony import */ var _color_palette_with_color_context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../color-palette/with-color-context */ "./node_modules/@wordpress/editor/build-module/components/color-palette/with-color-context.js"); /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../colors */ "./node_modules/@wordpress/editor/build-module/components/colors/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function PanelColor(_ref) { var colors = _ref.colors, title = _ref.title, colorValue = _ref.colorValue, initialOpen = _ref.initialOpen, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["colors", "title", "colorValue", "initialOpen"]); var colorObject = Object(_colors__WEBPACK_IMPORTED_MODULE_8__["getColorObjectByColorValue"])(colors, colorValue); var colorName = colorObject && colorObject.name; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["PanelColor"], { title: title, colorName: colorName, colorValue: colorValue, initialOpen: initialOpen }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_color_palette__WEBPACK_IMPORTED_MODULE_6__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ value: colorValue }, Object(lodash__WEBPACK_IMPORTED_MODULE_3__["omit"])(props, ['disableCustomColors'])))); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])([_color_palette_with_color_context__WEBPACK_IMPORTED_MODULE_7__["default"], Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["ifCondition"])(function (_ref2) { var hasColorsToChoose = _ref2.hasColorsToChoose; return hasColorsToChoose; })])(PanelColor)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/plain-text/index.js": /*!************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/plain-text/index.js ***! \************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_autosize_textarea__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-autosize-textarea */ "./node_modules/react-autosize-textarea/lib/index.js"); /* harmony import */ var react_autosize_textarea__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_autosize_textarea__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__); /** * External dependencies */ function PlainText(_ref) { var _onChange = _ref.onChange, className = _ref.className, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["onChange", "className"]); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(react_autosize_textarea__WEBPACK_IMPORTED_MODULE_3___default.a, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ className: classnames__WEBPACK_IMPORTED_MODULE_4___default()('editor-plain-text', className), onChange: function onChange(event) { return _onChange(event.target.value); } }, props)); } /* harmony default export */ __webpack_exports__["default"] = (PlainText); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-author/check.js": /*!*************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-author/check.js ***! \*************************************************************************************/ /*! exports provided: PostAuthorCheck, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostAuthorCheck", function() { return PostAuthorCheck; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _post_type_support_check__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../post-type-support-check */ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function PostAuthorCheck(_ref) { var hasAssignAuthorAction = _ref.hasAssignAuthorAction, authors = _ref.authors, children = _ref.children; if (!hasAssignAuthorAction || authors.length < 2) { return null; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_type_support_check__WEBPACK_IMPORTED_MODULE_4__["default"], { supportKeys: "author" }, children); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { var post = select('core/editor').getCurrentPost(); return { hasAssignAuthorAction: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(post, ['_links', 'wp:action-assign-author'], false), postType: select('core/editor').getCurrentPostType(), authors: select('core').getAuthors() }; }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["withInstanceId"]])(PostAuthorCheck)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-author/index.js": /*!*************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-author/index.js ***! \*************************************************************************************/ /*! exports provided: PostAuthor, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostAuthor", function() { return PostAuthor; }); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _check__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./check */ "./node_modules/@wordpress/editor/build-module/components/post-author/check.js"); /** * WordPress dependencies */ /** * Internal dependencies */ var PostAuthor = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostAuthor, _Component); function PostAuthor() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostAuthor); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostAuthor).apply(this, arguments)); _this.setAuthorId = _this.setAuthorId.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostAuthor, [{ key: "setAuthorId", value: function setAuthorId(event) { var onUpdateAuthor = this.props.onUpdateAuthor; var value = event.target.value; onUpdateAuthor(Number(value)); } }, { key: "render", value: function render() { var _this$props = this.props, postAuthor = _this$props.postAuthor, instanceId = _this$props.instanceId, authors = _this$props.authors; var selectId = 'post-author-selector-' + instanceId; // Disable reason: A select with an onchange throws a warning /* eslint-disable jsx-a11y/no-onchange */ return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_check__WEBPACK_IMPORTED_MODULE_10__["default"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("label", { htmlFor: selectId }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Author')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("select", { id: selectId, value: postAuthor, onChange: this.setAuthorId, className: "editor-post-author__select" }, authors.map(function (author) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("option", { key: author.id, value: author.id }, author.name); }))); /* eslint-enable jsx-a11y/no-onchange */ } }]); return PostAuthor; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withSelect"])(function (select) { return { postAuthor: select('core/editor').getEditedPostAttribute('author'), authors: select('core').getAuthors() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withDispatch"])(function (dispatch) { return { onUpdateAuthor: function onUpdateAuthor(author) { dispatch('core/editor').editPost({ author: author }); } }; }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["withInstanceId"]])(PostAuthor)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-comments/index.js": /*!***************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-comments/index.js ***! \***************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); /** * WordPress dependencies */ function PostComments(_ref) { var _ref$commentStatus = _ref.commentStatus, commentStatus = _ref$commentStatus === void 0 ? 'open' : _ref$commentStatus, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, ["commentStatus"]); var onToggleComments = function onToggleComments() { return props.editPost({ comment_status: commentStatus === 'open' ? 'closed' : 'open' }); }; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["CheckboxControl"], { label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Allow Comments'), checked: commentStatus === 'open', onChange: onToggleComments }); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select) { return { commentStatus: select('core/editor').getEditedPostAttribute('comment_status') }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withDispatch"])(function (dispatch) { return { editPost: dispatch('core/editor').editPost }; })])(PostComments)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-excerpt/check.js": /*!**************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-excerpt/check.js ***! \**************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _post_type_support_check__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../post-type-support-check */ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js"); /** * Internal dependencies */ function PostExcerptCheck(props) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_post_type_support_check__WEBPACK_IMPORTED_MODULE_2__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, { supportKeys: "excerpt" })); } /* harmony default export */ __webpack_exports__["default"] = (PostExcerptCheck); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-excerpt/index.js": /*!**************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-excerpt/index.js ***! \**************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); /** * WordPress dependencies */ function PostExcerpt(_ref) { var excerpt = _ref.excerpt, onUpdateExcerpt = _ref.onUpdateExcerpt; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-post-excerpt" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["TextareaControl"], { label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Write an excerpt (optional)'), className: "editor-post-excerpt__textarea", onChange: function onChange(value) { return onUpdateExcerpt(value); }, value: excerpt }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["ExternalLink"], { href: "https://codex.wordpress.org/Excerpt" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Learn more about manual excerpts'))); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { return { excerpt: select('core/editor').getEditedPostAttribute('excerpt') }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withDispatch"])(function (dispatch) { return { onUpdateExcerpt: function onUpdateExcerpt(excerpt) { dispatch('core/editor').editPost({ excerpt: excerpt }); } }; })])(PostExcerpt)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-featured-image/check.js": /*!*********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-featured-image/check.js ***! \*********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _post_type_support_check__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../post-type-support-check */ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js"); /* harmony import */ var _theme_support_check__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme-support-check */ "./node_modules/@wordpress/editor/build-module/components/theme-support-check/index.js"); /** * Internal dependencies */ function PostFeaturedImageCheck(props) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_theme_support_check__WEBPACK_IMPORTED_MODULE_3__["default"], { supportKeys: "post-thumbnails" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_post_type_support_check__WEBPACK_IMPORTED_MODULE_2__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, { supportKeys: "thumbnail" }))); } /* harmony default export */ __webpack_exports__["default"] = (PostFeaturedImageCheck); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-featured-image/index.js": /*!*********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-featured-image/index.js ***! \*********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _check__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./check */ "./node_modules/@wordpress/editor/build-module/components/post-featured-image/check.js"); /* harmony import */ var _media_upload__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../media-upload */ "./node_modules/@wordpress/editor/build-module/components/media-upload/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var ALLOWED_MEDIA_TYPES = ['image']; // Used when labels from post type were not yet loaded or when they are not present. var DEFAULT_SET_FEATURE_IMAGE_LABEL = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Set featured image'); var DEFAULT_REMOVE_FEATURE_IMAGE_LABEL = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Remove image'); function PostFeaturedImage(_ref) { var currentPostId = _ref.currentPostId, featuredImageId = _ref.featuredImageId, onUpdateImage = _ref.onUpdateImage, onRemoveImage = _ref.onRemoveImage, media = _ref.media, postType = _ref.postType; var postLabel = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(postType, ['labels'], {}); var mediaWidth, mediaHeight, mediaSourceUrl; if (media) { var mediaSize = Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_3__["applyFilters"])('editor.PostFeaturedImage.imageSize', 'post-thumbnail', media.id, currentPostId); if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["has"])(media, ['media_details', 'sizes', mediaSize])) { mediaWidth = media.media_details.sizes[mediaSize].width; mediaHeight = media.media_details.sizes[mediaSize].height; mediaSourceUrl = media.media_details.sizes[mediaSize].source_url; } else { mediaWidth = media.media_details.width; mediaHeight = media.media_details.height; mediaSourceUrl = media.source_url; } } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_check__WEBPACK_IMPORTED_MODULE_7__["default"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-post-featured-image" }, !!featuredImageId && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_media_upload__WEBPACK_IMPORTED_MODULE_8__["default"], { title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Set featured image'), onSelect: onUpdateImage, allowedTypes: ALLOWED_MEDIA_TYPES, modalClass: "editor-post-featured-image__media-modal", render: function render(_ref2) { var open = _ref2.open; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Button"], { className: "editor-post-featured-image__preview", onClick: open }, media && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["ResponsiveWrapper"], { naturalWidth: mediaWidth, naturalHeight: mediaHeight }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("img", { src: mediaSourceUrl, alt: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Featured image') })), !media && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Spinner"], null)); }, value: featuredImageId }), !!featuredImageId && media && !media.isLoading && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_media_upload__WEBPACK_IMPORTED_MODULE_8__["default"], { title: postLabel.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL, onSelect: onUpdateImage, allowedTypes: ALLOWED_MEDIA_TYPES, modalClass: "editor-post-featured-image__media-modal", render: function render(_ref3) { var open = _ref3.open; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Button"], { onClick: open, isDefault: true, isLarge: true }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Replace image')); } }), !featuredImageId && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_media_upload__WEBPACK_IMPORTED_MODULE_8__["default"], { title: postLabel.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL, onSelect: onUpdateImage, allowedTypes: ALLOWED_MEDIA_TYPES, modalClass: "editor-post-featured-image__media-modal", render: function render(_ref4) { var open = _ref4.open; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Button"], { className: "editor-post-featured-image__toggle", onClick: open }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Set featured image')); } })), !!featuredImageId && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["Button"], { onClick: onRemoveImage, isLink: true, isDestructive: true }, postLabel.remove_featured_image || DEFAULT_REMOVE_FEATURE_IMAGE_LABEL))); } var applyWithSelect = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withSelect"])(function (select) { var _select = select('core'), getMedia = _select.getMedia, getPostType = _select.getPostType; var _select2 = select('core/editor'), getCurrentPostId = _select2.getCurrentPostId, getEditedPostAttribute = _select2.getEditedPostAttribute; var featuredImageId = getEditedPostAttribute('featured_media'); return { media: featuredImageId ? getMedia(featuredImageId) : null, currentPostId: getCurrentPostId(), postType: getPostType(getEditedPostAttribute('type')), featuredImageId: featuredImageId }; }); var applyWithDispatch = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), editPost = _dispatch.editPost; return { onUpdateImage: function onUpdateImage(image) { editPost({ featured_media: image.id }); }, onRemoveImage: function onRemoveImage() { editPost({ featured_media: 0 }); } }; }); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])(applyWithSelect, applyWithDispatch, Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["withFilters"])('editor.PostFeaturedImage'))(PostFeaturedImage)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-format/check.js": /*!*************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-format/check.js ***! \*************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _post_type_support_check__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../post-type-support-check */ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js"); /** * WordPress dependencies */ /** * Internal dependencies */ function PostFormatCheck(_ref) { var disablePostFormats = _ref.disablePostFormats, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["disablePostFormats"]); return !disablePostFormats && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_post_type_support_check__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, { supportKeys: "post-formats" })); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { var editorSettings = select('core/editor').getEditorSettings(); return { disablePostFormats: editorSettings.disablePostFormats }; })(PostFormatCheck)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-format/index.js": /*!*************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-format/index.js ***! \*************************************************************************************/ /*! exports provided: POST_FORMATS, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "POST_FORMATS", function() { return POST_FORMATS; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _check__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./check */ "./node_modules/@wordpress/editor/build-module/components/post-format/check.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var POST_FORMATS = [{ id: 'aside', caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Aside') }, { id: 'gallery', caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Gallery') }, { id: 'link', caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Link') }, { id: 'image', caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Image') }, { id: 'quote', caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Quote') }, { id: 'standard', caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Standard') }, { id: 'status', caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Status') }, { id: 'video', caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Video') }, { id: 'audio', caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Audio') }, { id: 'chat', caption: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Chat') }]; function PostFormat(_ref) { var onUpdatePostFormat = _ref.onUpdatePostFormat, _ref$postFormat = _ref.postFormat, postFormat = _ref$postFormat === void 0 ? 'standard' : _ref$postFormat, supportedFormats = _ref.supportedFormats, suggestedFormat = _ref.suggestedFormat, instanceId = _ref.instanceId; var postFormatSelectorId = 'post-format-selector-' + instanceId; var formats = POST_FORMATS.filter(function (format) { return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["includes"])(supportedFormats, format.id); }); var suggestion = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["find"])(formats, function (format) { return format.id === suggestedFormat; }); // Disable reason: We need to change the value immiediately to show/hide the suggestion if needed /* eslint-disable jsx-a11y/no-onchange */ return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_check__WEBPACK_IMPORTED_MODULE_6__["default"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-post-format" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-post-format__content" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("label", { htmlFor: postFormatSelectorId }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Post Format')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("select", { value: postFormat, onChange: function onChange(event) { return onUpdatePostFormat(event.target.value); }, id: postFormatSelectorId }, formats.map(function (format) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("option", { key: format.id, value: format.id }, format.caption); }))), suggestion && suggestion.id !== postFormat && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-post-format__suggestion" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Suggestion:'), ' ', Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["Button"], { isLink: true, onClick: function onClick() { return onUpdatePostFormat(suggestion.id); } }, suggestion.caption)))); /* eslint-enable jsx-a11y/no-onchange */ } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])(function (select) { var _select = select('core/editor'), getEditedPostAttribute = _select.getEditedPostAttribute, getSuggestedPostFormat = _select.getSuggestedPostFormat; var postFormat = getEditedPostAttribute('format'); var themeSupports = select('core').getThemeSupports(); // Ensure current format is always in the set. // The current format may not be a format supported by the theme. var supportedFormats = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["union"])([postFormat], Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(themeSupports, ['formats'], [])); return { postFormat: postFormat, supportedFormats: supportedFormats, suggestedFormat: getSuggestedPostFormat() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withDispatch"])(function (dispatch) { return { onUpdatePostFormat: function onUpdatePostFormat(postFormat) { dispatch('core/editor').editPost({ format: postFormat }); } }; }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["withInstanceId"]])(PostFormat)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-last-revision/check.js": /*!********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-last-revision/check.js ***! \********************************************************************************************/ /*! exports provided: PostLastRevisionCheck, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostLastRevisionCheck", function() { return PostLastRevisionCheck; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _post_type_support_check__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../post-type-support-check */ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js"); /** * WordPress dependencies */ /** * Internal dependencies */ function PostLastRevisionCheck(_ref) { var lastRevisionId = _ref.lastRevisionId, revisionsCount = _ref.revisionsCount, children = _ref.children; if (!lastRevisionId || revisionsCount < 2) { return null; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_type_support_check__WEBPACK_IMPORTED_MODULE_2__["default"], { supportKeys: "revisions" }, children); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { var _select = select('core/editor'), getCurrentPostLastRevisionId = _select.getCurrentPostLastRevisionId, getCurrentPostRevisionsCount = _select.getCurrentPostRevisionsCount; return { lastRevisionId: getCurrentPostLastRevisionId(), revisionsCount: getCurrentPostRevisionsCount() }; })(PostLastRevisionCheck)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-last-revision/index.js": /*!********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-last-revision/index.js ***! \********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _check__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./check */ "./node_modules/@wordpress/editor/build-module/components/post-last-revision/check.js"); /* harmony import */ var _utils_url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/url */ "./node_modules/@wordpress/editor/build-module/utils/url.js"); /** * WordPress dependencies */ /** * Internal dependencies */ function LastRevision(_ref) { var lastRevisionId = _ref.lastRevisionId, revisionsCount = _ref.revisionsCount; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_check__WEBPACK_IMPORTED_MODULE_4__["default"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["IconButton"], { href: Object(_utils_url__WEBPACK_IMPORTED_MODULE_5__["getWPAdminURL"])('revision.php', { revision: lastRevisionId, gutenberg: true }), className: "editor-post-last-revision__title", icon: "backup" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["_n"])('%d Revision', '%d Revisions', revisionsCount), revisionsCount))); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { var _select = select('core/editor'), getCurrentPostLastRevisionId = _select.getCurrentPostLastRevisionId, getCurrentPostRevisionsCount = _select.getCurrentPostRevisionsCount; return { lastRevisionId: getCurrentPostLastRevisionId(), revisionsCount: getCurrentPostRevisionsCount() }; })(LastRevision)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-locked-modal/index.js": /*!*******************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-locked-modal/index.js ***! \*******************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! jquery */ "jquery"); /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _utils_url__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../utils/url */ "./node_modules/@wordpress/editor/build-module/utils/url.js"); /* harmony import */ var _post_preview_button__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../post-preview-button */ "./node_modules/@wordpress/editor/build-module/components/post-preview-button/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var PostLockedModal = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostLockedModal, _Component); function PostLockedModal() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostLockedModal); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostLockedModal).apply(this, arguments)); _this.sendPostLock = _this.sendPostLock.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.receivePostLock = _this.receivePostLock.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.releasePostLock = _this.releasePostLock.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostLockedModal, [{ key: "componentDidMount", value: function componentDidMount() { // Details on these events on the Heartbeat API docs // https://developer.wordpress.org/plugins/javascript/heartbeat-api/ jquery__WEBPACK_IMPORTED_MODULE_7___default()(document).on('heartbeat-send.refresh-lock', this.sendPostLock).on('heartbeat-tick.refresh-lock', this.receivePostLock); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { jquery__WEBPACK_IMPORTED_MODULE_7___default()(document).off('heartbeat-send.refresh-lock', this.sendPostLock).off('heartbeat-tick.refresh-lock', this.receivePostLock); } /** * 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} event Event. * @param {Object} data Data to send in the heartbeat request. */ }, { key: "sendPostLock", value: function sendPostLock(event, data) { var _this$props = this.props, isLocked = _this$props.isLocked, activePostLock = _this$props.activePostLock, postId = _this$props.postId; 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} event Event. * @param {Object} data Data received in the heartbeat request */ }, { key: "receivePostLock", value: function receivePostLock(event, data) { if (!data['wp-refresh-post-lock']) { return; } var _this$props2 = this.props, autosave = _this$props2.autosave, updatePostLock = _this$props2.updatePostLock; var received = data['wp-refresh-post-lock']; if (received.lock_error) { // Auto save and display the takeover modal. autosave(); updatePostLock({ isLocked: true, isTakeover: true, user: { avatar: received.lock_error.avatar_src } }); } else if (received.new_lock) { updatePostLock({ isLocked: false, activePostLock: received.new_lock }); } } /** * Unlock the post before the window is exited. */ }, { key: "releasePostLock", value: function releasePostLock() { var _this$props3 = this.props, isLocked = _this$props3.isLocked, activePostLock = _this$props3.activePostLock, postLockUtils = _this$props3.postLockUtils, postId = _this$props3.postId; if (isLocked || !activePostLock) { return; } var data = { action: 'wp-remove-post-lock', _wpnonce: postLockUtils.unlockNonce, post_ID: postId, active_post_lock: activePostLock }; jquery__WEBPACK_IMPORTED_MODULE_7___default.a.post({ async: false, url: postLockUtils.ajaxUrl, data: data }); } }, { key: "render", value: function render() { var _this$props4 = this.props, user = _this$props4.user, postId = _this$props4.postId, isLocked = _this$props4.isLocked, isTakeover = _this$props4.isTakeover, postLockUtils = _this$props4.postLockUtils; if (!isLocked) { return null; } var userDisplayName = user.name; var userAvatar = user.avatar; var unlockUrl = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_11__["addQueryArgs"])('post.php', { 'get-post-lock': '1', lockKey: true, post: postId, action: 'edit', _wpnonce: postLockUtils.nonce }); var allPosts = Object(_utils_url__WEBPACK_IMPORTED_MODULE_13__["getWPAdminURL"])('edit.php'); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["Modal"], { title: isTakeover ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Someone else has taken over this post.') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('This post is already being edited.'), focusOnMount: true, shouldCloseOnClickOutside: false, shouldCloseOnEsc: false, isDismissable: false, className: "editor-post-locked-modal" }, !!userAvatar && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("img", { src: userAvatar, alt: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Avatar'), className: "editor-post-locked-modal__avatar" }), !!isTakeover && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", null, userDisplayName ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["sprintf"])( /* translators: 'post' is generic and may be of any type (post, page, etc.). */ Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('%s now has editing control of this post. Don\'t worry, your changes up to this moment have been saved'), userDisplayName) : /* translators: 'post' is generic and may be of any type (post, page, etc.). */ Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Another user now has editing control of this post. Don\'t worry, your changes up to this moment have been saved')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("p", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("a", { href: allPosts }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('View all posts')))), !isTakeover && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", null, userDisplayName ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["sprintf"])( /* translators: 'post' is generic and may be of any type (post, page, etc.). */ Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('%s is currently working on this post, which means you cannot make changes, unless you take over.'), userDisplayName) : /* translators: 'post' is generic and may be of any type (post, page, etc.). */ Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Another user is currently working on this post, which means you cannot make changes, unless you take over.')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { className: "editor-post-locked-modal__buttons" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["Button"], { isDefault: true, isLarge: true, href: allPosts }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('All Posts')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_post_preview_button__WEBPACK_IMPORTED_MODULE_14__["default"], null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["Button"], { isPrimary: true, isLarge: true, href: unlockUrl }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Take Over'))))); } }]); return PostLockedModal; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withSelect"])(function (select) { var _select = select('core/editor'), getEditorSettings = _select.getEditorSettings, isPostLocked = _select.isPostLocked, isPostLockTakeover = _select.isPostLockTakeover, getPostLockUser = _select.getPostLockUser, getCurrentPostId = _select.getCurrentPostId, getActivePostLock = _select.getActivePostLock; return { isLocked: isPostLocked(), isTakeover: isPostLockTakeover(), user: getPostLockUser(), postId: getCurrentPostId(), postLockUtils: getEditorSettings().postLockUtils, activePostLock: getActivePostLock() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), autosave = _dispatch.autosave, updatePostLock = _dispatch.updatePostLock; return { autosave: autosave, updatePostLock: updatePostLock }; }), Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["withGlobalEvents"])({ beforeunload: 'releasePostLock' }))(PostLockedModal)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-pending-status/check.js": /*!*********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-pending-status/check.js ***! \*********************************************************************************************/ /*! exports provided: PostPendingStatusCheck, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostPendingStatusCheck", function() { return PostPendingStatusCheck; }); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /** * External dependencies */ /** * WordPress dependencies */ function PostPendingStatusCheck(_ref) { var hasPublishAction = _ref.hasPublishAction, isPublished = _ref.isPublished, children = _ref.children; if (isPublished || !hasPublishAction) { return null; } return children; } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { var _select = select('core/editor'), isCurrentPostPublished = _select.isCurrentPostPublished, getCurrentPostType = _select.getCurrentPostType, getCurrentPost = _select.getCurrentPost; return { hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(getCurrentPost(), ['_links', 'wp:action-publish'], false), isPublished: isCurrentPostPublished(), postType: getCurrentPostType() }; }))(PostPendingStatusCheck)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-pending-status/index.js": /*!*********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-pending-status/index.js ***! \*********************************************************************************************/ /*! exports provided: PostPendingStatus, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostPendingStatus", function() { return PostPendingStatus; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _check__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./check */ "./node_modules/@wordpress/editor/build-module/components/post-pending-status/check.js"); /** * WordPress dependencies */ /** * Internal dependencies */ function PostPendingStatus(_ref) { var status = _ref.status, onUpdateStatus = _ref.onUpdateStatus; var togglePendingStatus = function togglePendingStatus() { var updatedStatus = status === 'pending' ? 'draft' : 'pending'; onUpdateStatus(updatedStatus); }; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_check__WEBPACK_IMPORTED_MODULE_5__["default"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["CheckboxControl"], { label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Pending Review'), checked: status === 'pending', onChange: togglePendingStatus })); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { return { status: select('core/editor').getEditedPostAttribute('status') }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withDispatch"])(function (dispatch) { return { onUpdateStatus: function onUpdateStatus(status) { dispatch('core/editor').editPost({ status: status }); } }; }))(PostPendingStatus)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-permalink/editor.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-permalink/editor.js ***! \*****************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__); /** * WordPress dependencies */ var PostPermalinkEditor = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostPermalinkEditor, _Component); function PostPermalinkEditor(_ref) { var _this; var permalinkParts = _ref.permalinkParts; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostPermalinkEditor); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostPermalinkEditor).apply(this, arguments)); _this.state = { editedPostName: permalinkParts.postName }; _this.onSavePermalink = _this.onSavePermalink.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostPermalinkEditor, [{ key: "onSavePermalink", value: function onSavePermalink(event) { var postName = this.state.editedPostName.replace(/\s+/g, '-'); event.preventDefault(); this.props.onSave(); if (postName === this.props.postName) { return; } this.props.editPost({ slug: postName }); this.setState({ editedPostName: postName }); } }, { key: "render", value: function render() { var _this2 = this; var _this$props$permalink = this.props.permalinkParts, prefix = _this$props$permalink.prefix, suffix = _this$props$permalink.suffix; var editedPostName = this.state.editedPostName; /* eslint-disable jsx-a11y/no-autofocus */ // Autofocus is allowed here, as this mini-UI is only loaded when the user clicks to open it. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("form", { className: "editor-post-permalink-editor", onSubmit: this.onSavePermalink }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", { className: "editor-post-permalink__editor-container" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", { className: "editor-post-permalink-editor__prefix" }, prefix), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", { className: "editor-post-permalink-editor__edit", "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Edit post permalink'), value: editedPostName, onChange: function onChange(event) { return _this2.setState({ editedPostName: event.target.value }); }, type: "text", autoFocus: true }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", { className: "editor-post-permalink-editor__suffix" }, suffix), "\u200E"), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["Button"], { className: "editor-post-permalink-editor__save", isLarge: true, onClick: this.onSavePermalink }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Save'))); /* eslint-enable jsx-a11y/no-autofocus */ } }]); return PostPermalinkEditor; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withSelect"])(function (select) { var _select = select('core/editor'), getPermalinkParts = _select.getPermalinkParts; return { permalinkParts: getPermalinkParts() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), editPost = _dispatch.editPost; return { editPost: editPost }; })])(PostPermalinkEditor)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-permalink/index.js": /*!****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-permalink/index.js ***! \****************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _editor_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./editor.js */ "./node_modules/@wordpress/editor/build-module/components/post-permalink/editor.js"); /* harmony import */ var _utils_url__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../utils/url */ "./node_modules/@wordpress/editor/build-module/utils/url.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal Dependencies */ var PostPermalink = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostPermalink, _Component); function PostPermalink() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostPermalink); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostPermalink).apply(this, arguments)); _this.addVisibilityCheck = _this.addVisibilityCheck.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.onVisibilityChange = _this.onVisibilityChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.state = { isCopied: false, isEditingPermalink: false }; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostPermalink, [{ key: "addVisibilityCheck", value: function addVisibilityCheck() { window.addEventListener('visibilitychange', this.onVisibilityChange); } }, { key: "onVisibilityChange", value: function onVisibilityChange() { var _this$props = this.props, isEditable = _this$props.isEditable, refreshPost = _this$props.refreshPost; // If the user just returned after having clicked the "Change Permalinks" button, // fetch a new copy of the post from the server, just in case they enabled permalinks. if (!isEditable && 'visible' === document.visibilityState) { refreshPost(); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps, prevState) { // If we've just stopped editing the permalink, focus on the new permalink. if (prevState.isEditingPermalink && !this.state.isEditingPermalink) { this.linkElement.focus(); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { window.removeEventListener('visibilitychange', this.addVisibilityCheck); } }, { key: "render", value: function render() { var _this2 = this; var _this$props2 = this.props, isNew = _this$props2.isNew, postLink = _this$props2.postLink, isEditable = _this$props2.isEditable, samplePermalink = _this$props2.samplePermalink, isPublished = _this$props2.isPublished; var _this$state = this.state, isCopied = _this$state.isCopied, isEditingPermalink = _this$state.isEditingPermalink; var ariaLabel = isCopied ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Permalink copied') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Copy the permalink'); if (isNew || !postLink) { return null; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { className: "editor-post-permalink" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["ClipboardButton"], { className: classnames__WEBPACK_IMPORTED_MODULE_7___default()('editor-post-permalink__copy', { 'is-copied': isCopied }), text: samplePermalink, label: ariaLabel, onCopy: function onCopy() { return _this2.setState({ isCopied: true }); }, "aria-disabled": isCopied, icon: "admin-links" }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", { className: "editor-post-permalink__label" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Permalink:')), !isEditingPermalink && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["ExternalLink"], { className: "editor-post-permalink__link", href: !isPublished ? postLink : samplePermalink, target: "_blank", ref: function ref(linkElement) { return _this2.linkElement = linkElement; } }, decodeURI(samplePermalink), "\u200E"), isEditingPermalink && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_editor_js__WEBPACK_IMPORTED_MODULE_12__["default"], { onSave: function onSave() { return _this2.setState({ isEditingPermalink: false }); } }), isEditable && !isEditingPermalink && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["Button"], { className: "editor-post-permalink__edit", isLarge: true, onClick: function onClick() { return _this2.setState({ isEditingPermalink: true }); } }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Edit')), !isEditable && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["Button"], { className: "editor-post-permalink__change", isLarge: true, href: Object(_utils_url__WEBPACK_IMPORTED_MODULE_13__["getWPAdminURL"])('options-permalink.php'), onClick: this.addVisibilityCheck, target: "_blank" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Change Permalinks'))); } }]); return PostPermalink; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__["withSelect"])(function (select) { var _select = select('core/editor'), isEditedPostNew = _select.isEditedPostNew, isPermalinkEditable = _select.isPermalinkEditable, getCurrentPost = _select.getCurrentPost, getPermalink = _select.getPermalink, isCurrentPostPublished = _select.isCurrentPostPublished; var _getCurrentPost = getCurrentPost(), link = _getCurrentPost.link; return { isNew: isEditedPostNew(), postLink: link, isEditable: isPermalinkEditable(), samplePermalink: getPermalink(), isPublished: isCurrentPostPublished() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), refreshPost = _dispatch.refreshPost; return { refreshPost: refreshPost }; })])(PostPermalink)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-pingbacks/index.js": /*!****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-pingbacks/index.js ***! \****************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); /** * WordPress dependencies */ function PostPingbacks(_ref) { var _ref$pingStatus = _ref.pingStatus, pingStatus = _ref$pingStatus === void 0 ? 'open' : _ref$pingStatus, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, ["pingStatus"]); var onTogglePingback = function onTogglePingback() { return props.editPost({ ping_status: pingStatus === 'open' ? 'closed' : 'open' }); }; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["CheckboxControl"], { label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Allow Pingbacks & Trackbacks'), checked: pingStatus === 'open', onChange: onTogglePingback }); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])(function (select) { return { pingStatus: select('core/editor').getEditedPostAttribute('ping_status') }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withDispatch"])(function (dispatch) { return { editPost: dispatch('core/editor').editPost }; })])(PostPingbacks)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-preview-button/index.js": /*!*********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-preview-button/index.js ***! \*********************************************************************************************/ /*! exports provided: PostPreviewButton, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostPreviewButton", function() { return PostPreviewButton; }); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_nux__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/nux */ "@wordpress/nux"); /* harmony import */ var _wordpress_nux__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_nux__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__); /** * External dependencies */ /** * WordPress dependencies */ var PostPreviewButton = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostPreviewButton, _Component); function PostPreviewButton() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostPreviewButton); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostPreviewButton).apply(this, arguments)); _this.openPreviewWindow = _this.openPreviewWindow.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostPreviewButton, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var previewLink = this.props.previewLink; // This relies on the window being responsible to unset itself when // navigation occurs or a new preview window is opened, to avoid // unintentional forceful redirects. if (previewLink && !prevProps.previewLink) { this.setPreviewWindowLink(previewLink); // Once popup redirect is evaluated, even if already closed, delete // reference to avoid later assignment of location in post update. delete this.previewWindow; } } /** * Sets the preview window's location to the given URL, if a preview window * exists and is not closed. * * @param {string} url URL to assign as preview window location. */ }, { key: "setPreviewWindowLink", value: function setPreviewWindowLink(url) { var previewWindow = this.previewWindow; if (previewWindow && !previewWindow.closed) { previewWindow.location = url; } } }, { key: "getWindowTarget", value: function getWindowTarget() { var postId = this.props.postId; return "wp-preview-".concat(postId); } /** * Opens a popup window, navigating user to a preview of the current post. * Triggers autosave if post is autosaveable. */ }, { key: "openPreviewWindow", value: function openPreviewWindow() { var _this$props = this.props, isAutosaveable = _this$props.isAutosaveable, previewLink = _this$props.previewLink, currentPostLink = _this$props.currentPostLink; // Open a popup, BUT: Set it to a blank page until save completes. This // is necessary because popups can only be opened in response to user // interaction (click), but we must still wait for the post to save. if (!this.previewWindow || this.previewWindow.closed) { this.previewWindow = window.open('', this.getWindowTarget()); } // Ask the browser to bring the preview tab to the front // This can work or not depending on the browser's user preferences // https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus this.previewWindow.focus(); // If there are no changes to autosave, we cannot perform the save, but // if there is an existing preview link (e.g. previous published post // autosave), it should be reused as the popup destination. if (!isAutosaveable && !previewLink && currentPostLink) { this.setPreviewWindowLink(currentPostLink); return; } if (!isAutosaveable) { this.setPreviewWindowLink(previewLink); return; } this.props.autosave(); var markup = "\n\t\t\t
\n\t\t\t\t

Please wait…

\n\t\t\t\t

Generating preview.

\n\t\t\t
\n\t\t\t"; this.previewWindow.document.write(markup); this.previewWindow.document.close(); } }, { key: "render", value: function render() { var isSaveable = this.props.isSaveable; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Button"], { className: "editor-post-preview", isLarge: true, onClick: this.openPreviewWindow, disabled: !isSaveable }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["_x"])('Preview', 'imperative verb'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_nux__WEBPACK_IMPORTED_MODULE_11__["DotTip"], { id: "core/editor.preview" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Click “Preview” to load a preview of this page, so you can make sure you’re happy with your blocks.'))); } }]); return PostPreviewButton; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withSelect"])(function (select) { var _select = select('core/editor'), getCurrentPostId = _select.getCurrentPostId, getCurrentPostAttribute = _select.getCurrentPostAttribute, getAutosaveAttribute = _select.getAutosaveAttribute, getEditedPostAttribute = _select.getEditedPostAttribute, isEditedPostDirty = _select.isEditedPostDirty, isEditedPostNew = _select.isEditedPostNew, isEditedPostSaveable = _select.isEditedPostSaveable, isEditedPostAutosaveable = _select.isEditedPostAutosaveable; var _select2 = select('core'), getPostType = _select2.getPostType; var postType = getPostType(getEditedPostAttribute('type')); return { postId: getCurrentPostId(), currentPostLink: getCurrentPostAttribute('link'), previewLink: getAutosaveAttribute('preview_link'), isDirty: isEditedPostDirty(), isNew: isEditedPostNew(), isSaveable: isEditedPostSaveable(), isAutosaveable: isEditedPostAutosaveable(), isViewable: Object(lodash__WEBPACK_IMPORTED_MODULE_7__["get"])(postType, ['viewable'], false) }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withDispatch"])(function (dispatch) { return { autosave: dispatch('core/editor').autosave }; }), Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["ifCondition"])(function (_ref) { var isViewable = _ref.isViewable; return isViewable; })])(PostPreviewButton)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-publish-button/index.js": /*!*********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-publish-button/index.js ***! \*********************************************************************************************/ /*! exports provided: PostPublishButton, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostPublishButton", function() { return PostPublishButton; }); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _label__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./label */ "./node_modules/@wordpress/editor/build-module/components/post-publish-button/label.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var PostPublishButton = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostPublishButton, _Component); function PostPublishButton(props) { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostPublishButton); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostPublishButton).call(this, props)); _this.buttonNode = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createRef"])(); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostPublishButton, [{ key: "componentDidMount", value: function componentDidMount() { if (this.props.focusOnMount) { this.buttonNode.current.focus(); } } }, { key: "render", value: function render() { var _this$props = this.props, isSaving = _this$props.isSaving, onStatusChange = _this$props.onStatusChange, onSave = _this$props.onSave, isBeingScheduled = _this$props.isBeingScheduled, visibility = _this$props.visibility, isPublishable = _this$props.isPublishable, isSaveable = _this$props.isSaveable, hasPublishAction = _this$props.hasPublishAction, _this$props$onSubmit = _this$props.onSubmit, onSubmit = _this$props$onSubmit === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_6__["noop"] : _this$props$onSubmit, forceIsSaving = _this$props.forceIsSaving; var isButtonEnabled = isPublishable && isSaveable; var publishStatus; if (!hasPublishAction) { publishStatus = 'pending'; } else if (isBeingScheduled) { publishStatus = 'future'; } else if (visibility === 'private') { publishStatus = 'private'; } else { publishStatus = 'publish'; } var onClick = function onClick() { onSubmit(); onStatusChange(publishStatus); onSave(); }; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_7__["Button"], { ref: this.buttonNode, className: "editor-post-publish-button", isPrimary: true, isLarge: true, onClick: onClick, disabled: !isButtonEnabled, isBusy: isSaving }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_label__WEBPACK_IMPORTED_MODULE_10__["default"], { forceIsSaving: forceIsSaving })); } }]); return PostPublishButton; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__["withSelect"])(function (select, _ref) { var forceIsSaving = _ref.forceIsSaving, forceIsDirty = _ref.forceIsDirty; var _select = select('core/editor'), isSavingPost = _select.isSavingPost, isEditedPostBeingScheduled = _select.isEditedPostBeingScheduled, getEditedPostVisibility = _select.getEditedPostVisibility, isEditedPostSaveable = _select.isEditedPostSaveable, isEditedPostPublishable = _select.isEditedPostPublishable, getCurrentPost = _select.getCurrentPost, getCurrentPostType = _select.getCurrentPostType; return { isSaving: forceIsSaving || isSavingPost(), isBeingScheduled: isEditedPostBeingScheduled(), visibility: getEditedPostVisibility(), isSaveable: isEditedPostSaveable(), isPublishable: forceIsDirty || isEditedPostPublishable(), hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_6__["get"])(getCurrentPost(), ['_links', 'wp:action-publish'], false), postType: getCurrentPostType() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), editPost = _dispatch.editPost, savePost = _dispatch.savePost; return { onStatusChange: function onStatusChange(status) { return editPost({ status: status }); }, onSave: savePost }; })])(PostPublishButton)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-publish-button/label.js": /*!*********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-publish-button/label.js ***! \*********************************************************************************************/ /*! exports provided: PublishButtonLabel, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PublishButtonLabel", function() { return PublishButtonLabel; }); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); /** * External dependencies */ /** * WordPress dependencies */ function PublishButtonLabel(_ref) { var isPublished = _ref.isPublished, isBeingScheduled = _ref.isBeingScheduled, isSaving = _ref.isSaving, isPublishing = _ref.isPublishing, hasPublishAction = _ref.hasPublishAction, isAutosaving = _ref.isAutosaving; if (isPublishing) { return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Publishing…'); } else if (isPublished && isSaving && !isAutosaving) { return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Updating…'); } else if (isBeingScheduled && isSaving && !isAutosaving) { return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Scheduling…'); } if (!hasPublishAction) { return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Submit for Review'); } else if (isPublished) { return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Update'); } else if (isBeingScheduled) { return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Schedule'); } return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Publish'); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select, _ref2) { var forceIsSaving = _ref2.forceIsSaving; var _select = select('core/editor'), isCurrentPostPublished = _select.isCurrentPostPublished, isEditedPostBeingScheduled = _select.isEditedPostBeingScheduled, isSavingPost = _select.isSavingPost, isPublishingPost = _select.isPublishingPost, getCurrentPost = _select.getCurrentPost, getCurrentPostType = _select.getCurrentPostType, isAutosavingPost = _select.isAutosavingPost; return { isPublished: isCurrentPostPublished(), isBeingScheduled: isEditedPostBeingScheduled(), isSaving: forceIsSaving || isSavingPost(), isPublishing: isPublishingPost(), hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(getCurrentPost(), ['_links', 'wp:action-publish'], false), postType: getCurrentPostType(), isAutosaving: isAutosavingPost() }; })])(PublishButtonLabel)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/index.js": /*!********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/index.js ***! \********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _post_publish_button__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../post-publish-button */ "./node_modules/@wordpress/editor/build-module/components/post-publish-button/index.js"); /* harmony import */ var _prepublish__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./prepublish */ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/prepublish.js"); /* harmony import */ var _postpublish__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./postpublish */ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/postpublish.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal Dependencies */ var PostPublishPanel = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(PostPublishPanel, _Component); function PostPublishPanel() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, PostPublishPanel); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(PostPublishPanel).apply(this, arguments)); _this.onSubmit = _this.onSubmit.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.state = { loading: false, submitted: false }; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(PostPublishPanel, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { // Automatically collapse the publish sidebar when a post // is published and the user makes an edit. if (prevProps.isPublished && !this.props.isSaving && this.props.isDirty) { this.props.onClose(); } } }, { key: "onSubmit", value: function onSubmit() { var _this$props = this.props, onClose = _this$props.onClose, hasPublishAction = _this$props.hasPublishAction; if (!hasPublishAction) { onClose(); return; } this.setState({ loading: true }); } }, { key: "render", value: function render() { var _this$props2 = this.props, isScheduled = _this$props2.isScheduled, isPublishSidebarEnabled = _this$props2.isPublishSidebarEnabled, onClose = _this$props2.onClose, onTogglePublishSidebar = _this$props2.onTogglePublishSidebar, forceIsDirty = _this$props2.forceIsDirty, forceIsSaving = _this$props2.forceIsSaving, PrePublishExtension = _this$props2.PrePublishExtension, PostPublishExtension = _this$props2.PostPublishExtension, additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props2, ["isScheduled", "isPublishSidebarEnabled", "onClose", "onTogglePublishSidebar", "forceIsDirty", "forceIsSaving", "PrePublishExtension", "PostPublishExtension"]); var _this$state = this.state, loading = _this$state.loading, submitted = _this$state.submitted; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ className: "editor-post-publish-panel" }, additionalProps), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { className: "editor-post-publish-panel__header" }, !submitted && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { className: "editor-post-publish-panel__header-publish-button" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_post_publish_button__WEBPACK_IMPORTED_MODULE_14__["default"], { focusOnMount: true, onSubmit: this.onSubmit, forceIsDirty: forceIsDirty, forceIsSaving: forceIsSaving }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("span", { className: "editor-post-publish-panel__spacer" })), submitted && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { className: "editor-post-publish-panel__header-published" }, isScheduled ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Scheduled') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Published')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["IconButton"], { "aria-expanded": true, onClick: onClose, icon: "no-alt", label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Close panel') })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { className: "editor-post-publish-panel__content" }, !loading && !submitted && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_prepublish__WEBPACK_IMPORTED_MODULE_15__["default"], null, PrePublishExtension && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(PrePublishExtension, null)), loading && !submitted && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["Spinner"], null), submitted && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_postpublish__WEBPACK_IMPORTED_MODULE_16__["default"], null, PostPublishExtension && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(PostPublishExtension, null))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", { className: "editor-post-publish-panel__footer" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["CheckboxControl"], { label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Always show pre-publish checks.'), checked: isPublishSidebarEnabled, onChange: onTogglePublishSidebar }))); } }], [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(props, state) { if (state.submitted || props.isSaving || !props.isPublished && !props.isScheduled) { return null; } return { submitted: true, loading: false }; } }]); return PostPublishPanel; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withSelect"])(function (select) { var _select = select('core/editor'), getCurrentPost = _select.getCurrentPost, getCurrentPostType = _select.getCurrentPostType, isCurrentPostPublished = _select.isCurrentPostPublished, isCurrentPostScheduled = _select.isCurrentPostScheduled, isSavingPost = _select.isSavingPost, isEditedPostDirty = _select.isEditedPostDirty; var _select2 = select('core/editor'), isPublishSidebarEnabled = _select2.isPublishSidebarEnabled; return { postType: getCurrentPostType(), hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_9__["get"])(getCurrentPost(), ['_links', 'wp:action-publish'], false), isPublished: isCurrentPostPublished(), isScheduled: isCurrentPostScheduled(), isSaving: isSavingPost(), isDirty: isEditedPostDirty(), isPublishSidebarEnabled: isPublishSidebarEnabled() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withDispatch"])(function (dispatch, _ref) { var isPublishSidebarEnabled = _ref.isPublishSidebarEnabled; var _dispatch = dispatch('core/editor'), disablePublishSidebar = _dispatch.disablePublishSidebar, enablePublishSidebar = _dispatch.enablePublishSidebar; return { onTogglePublishSidebar: function onTogglePublishSidebar() { if (isPublishSidebarEnabled) { disablePublishSidebar(); } else { enablePublishSidebar(); } } }; })])(PostPublishPanel)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-post-format-panel.js": /*!**************************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-post-format-panel.js ***! \**************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _post_format__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../post-format */ "./node_modules/@wordpress/editor/build-module/components/post-format/index.js"); /** * External dependencies */ /** * WordPress dependencies. */ /** * Internal dependencies. */ var PostFormatSuggestion = function PostFormatSuggestion(_ref) { var suggestedPostFormat = _ref.suggestedPostFormat, suggestionText = _ref.suggestionText, onUpdatePostFormat = _ref.onUpdatePostFormat; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["Button"], { isLink: true, onClick: function onClick() { return onUpdatePostFormat(suggestedPostFormat); } }, suggestionText); }; var PostFormatPanel = function PostFormatPanel(_ref2) { var suggestion = _ref2.suggestion, onUpdatePostFormat = _ref2.onUpdatePostFormat; var panelBodyTitle = [Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Suggestion:'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { className: "editor-post-publish-panel__link", key: "label" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Use a post format'))]; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__["PanelBody"], { initialOpen: false, title: panelBodyTitle }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("p", null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("p", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(PostFormatSuggestion, { onUpdatePostFormat: onUpdatePostFormat, suggestedPostFormat: suggestion.id, suggestionText: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Apply the "%1$s" format.'), suggestion.caption) }))); }; var getSuggestion = function getSuggestion(supportedFormats, suggestedPostFormat) { var formats = _post_format__WEBPACK_IMPORTED_MODULE_6__["POST_FORMATS"].filter(function (format) { return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["includes"])(supportedFormats, format.id); }); return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["find"])(formats, function (format) { return format.id === suggestedPostFormat; }); }; /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])(function (select) { var _select = select('core/editor'), getEditedPostAttribute = _select.getEditedPostAttribute, getSuggestedPostFormat = _select.getSuggestedPostFormat; var supportedFormats = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(select('core').getThemeSupports(), ['formats'], []); return { currentPostFormat: getEditedPostAttribute('format'), suggestion: getSuggestion(supportedFormats, getSuggestedPostFormat()) }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withDispatch"])(function (dispatch) { return { onUpdatePostFormat: function onUpdatePostFormat(postFormat) { dispatch('core/editor').editPost({ format: postFormat }); } }; }), Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["ifCondition"])(function (_ref3) { var suggestion = _ref3.suggestion, currentPostFormat = _ref3.currentPostFormat; return suggestion && suggestion.id !== currentPostFormat; }))(PostFormatPanel)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-tags-panel.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-tags-panel.js ***! \*******************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _post_taxonomies_flat_term_selector__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../post-taxonomies/flat-term-selector */ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/flat-term-selector.js"); /** * External dependencies */ /** * WordPress dependencies */ var TagsPanel = function TagsPanel() { var panelBodyTitle = [Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Suggestion:'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", { className: "editor-post-publish-panel__link", key: "label" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Add tags'))]; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_10__["PanelBody"], { initialOpen: false, title: panelBodyTitle }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("p", null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_post_taxonomies_flat_term_selector__WEBPACK_IMPORTED_MODULE_11__["default"], { slug: 'post_tag' })); }; var MaybeTagsPanel = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(MaybeTagsPanel, _Component); function MaybeTagsPanel(props) { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, MaybeTagsPanel); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(MaybeTagsPanel).call(this, props)); _this.state = { hadTagsWhenOpeningThePanel: props.hasTags }; return _this; } /* * We only want to show the tag panel if the post didn't have * any tags when the user hit the Publish button. * * We can't use the prop.hasTags because it'll change to true * if the user adds a new tag within the pre-publish panel. * This would force a re-render and a new prop.hasTags check, * hiding this panel and keeping the user from adding * more than one tag. */ Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(MaybeTagsPanel, [{ key: "render", value: function render() { if (!this.state.hadTagsWhenOpeningThePanel) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(TagsPanel, null); } return null; } }]); return MaybeTagsPanel; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withSelect"])(function (select) { var postType = select('core/editor').getCurrentPostType(); var tagsTaxonomy = select('core').getTaxonomy('post_tag'); var tags = tagsTaxonomy && select('core/editor').getEditedPostAttribute(tagsTaxonomy.rest_base); return { areTagsFetched: tagsTaxonomy !== undefined, isPostTypeSupported: tagsTaxonomy && Object(lodash__WEBPACK_IMPORTED_MODULE_6__["some"])(tagsTaxonomy.types, function (type) { return type === postType; }), hasTags: tags && tags.length }; }), Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["ifCondition"])(function (_ref) { var areTagsFetched = _ref.areTagsFetched, isPostTypeSupported = _ref.isPostTypeSupported; return isPostTypeSupported && areTagsFetched; }))(MaybeTagsPanel)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/postpublish.js": /*!**************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/postpublish.js ***! \**************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _post_schedule_label__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../post-schedule/label */ "./node_modules/@wordpress/editor/build-module/components/post-schedule/label.js"); /** * External Dependencies */ /** * WordPress Dependencies */ /** * Internal dependencies */ var PostPublishPanelPostpublish = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostPublishPanelPostpublish, _Component); function PostPublishPanelPostpublish() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostPublishPanelPostpublish); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostPublishPanelPostpublish).apply(this, arguments)); _this.state = { showCopyConfirmation: false }; _this.onCopy = _this.onCopy.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.onSelectInput = _this.onSelectInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostPublishPanelPostpublish, [{ key: "componentWillUnmount", value: function componentWillUnmount() { clearTimeout(this.dismissCopyConfirmation); } }, { key: "onCopy", value: function onCopy() { var _this2 = this; this.setState({ showCopyConfirmation: true }); clearTimeout(this.dismissCopyConfirmation); this.dismissCopyConfirmation = setTimeout(function () { _this2.setState({ showCopyConfirmation: false }); }, 4000); } }, { key: "onSelectInput", value: function onSelectInput(event) { event.target.select(); } }, { key: "render", value: function render() { var _this$props = this.props, children = _this$props.children, isScheduled = _this$props.isScheduled, post = _this$props.post, postType = _this$props.postType; var viewPostLabel = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["get"])(postType, ['labels', 'view_item']); var postPublishNonLinkHeader = isScheduled ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Fragment"], null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('is now scheduled. It will go live on'), " ", Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_post_schedule_label__WEBPACK_IMPORTED_MODULE_11__["default"], null), ".") : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('is now live.'); var postPublishBodyText = isScheduled ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('The post address will be:') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('What’s next?'); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { className: "post-publish-panel__postpublish" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["PanelBody"], { className: "post-publish-panel__postpublish-header" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("a", { href: post.link }, post.title || Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('(no title)')), " ", postPublishNonLinkHeader), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["PanelBody"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("strong", null, postPublishBodyText)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", { className: "post-publish-panel__postpublish-link-input", readOnly: true, value: post.link, onFocus: this.onSelectInput, type: "text" }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { className: "post-publish-panel__postpublish-buttons" }, !isScheduled && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Button"], { isDefault: true, href: post.link }, viewPostLabel), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["ClipboardButton"], { isDefault: true, text: post.link, onCopy: this.onCopy }, this.state.showCopyConfirmation ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Copied!') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Copy Link')))), children); } }]); return PostPublishPanelPostpublish; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withSelect"])(function (select) { var _select = select('core/editor'), getEditedPostAttribute = _select.getEditedPostAttribute, getCurrentPost = _select.getCurrentPost, isCurrentPostScheduled = _select.isCurrentPostScheduled; var _select2 = select('core'), getPostType = _select2.getPostType; return { post: getCurrentPost(), postType: getPostType(getEditedPostAttribute('type')), isScheduled: isCurrentPostScheduled() }; })(PostPublishPanelPostpublish)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/prepublish.js": /*!*************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/prepublish.js ***! \*************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _post_visibility__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../post-visibility */ "./node_modules/@wordpress/editor/build-module/components/post-visibility/index.js"); /* harmony import */ var _post_visibility_label__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../post-visibility/label */ "./node_modules/@wordpress/editor/build-module/components/post-visibility/label.js"); /* harmony import */ var _post_schedule__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../post-schedule */ "./node_modules/@wordpress/editor/build-module/components/post-schedule/index.js"); /* harmony import */ var _post_schedule_label__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../post-schedule/label */ "./node_modules/@wordpress/editor/build-module/components/post-schedule/label.js"); /* harmony import */ var _maybe_tags_panel__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./maybe-tags-panel */ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-tags-panel.js"); /* harmony import */ var _maybe_post_format_panel__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./maybe-post-format-panel */ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-post-format-panel.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal Dependencies */ function PostPublishPanelPrepublish(_ref) { var hasPublishAction = _ref.hasPublishAction, isBeingScheduled = _ref.isBeingScheduled, children = _ref.children; var prePublishTitle, prePublishBodyText; if (!hasPublishAction) { prePublishTitle = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Are you ready to submit for review?'); prePublishBodyText = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('When you’re ready, submit your work for review, and an Editor will be able to approve it for you.'); } else if (isBeingScheduled) { prePublishTitle = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Are you ready to schedule?'); prePublishBodyText = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Your post will be published at the specified date and time.'); } else { prePublishTitle = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Are you ready to publish?'); prePublishBodyText = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Double-check your settings, then use the button to publish your post.'); } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-post-publish-panel__prepublish" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("strong", null, prePublishTitle)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("p", null, prePublishBodyText), hasPublishAction && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["PanelBody"], { initialOpen: false, title: [Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Visibility:'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { className: "editor-post-publish-panel__link", key: "label" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_visibility_label__WEBPACK_IMPORTED_MODULE_6__["default"], null))] }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_visibility__WEBPACK_IMPORTED_MODULE_5__["default"], null)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["PanelBody"], { initialOpen: false, title: [Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Publish:'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { className: "editor-post-publish-panel__link", key: "label" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_schedule_label__WEBPACK_IMPORTED_MODULE_8__["default"], null))] }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_schedule__WEBPACK_IMPORTED_MODULE_7__["default"], null)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_maybe_post_format_panel__WEBPACK_IMPORTED_MODULE_10__["default"], null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_maybe_tags_panel__WEBPACK_IMPORTED_MODULE_9__["default"], null), children)); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])(function (select) { var _select = select('core/editor'), getCurrentPost = _select.getCurrentPost, isEditedPostBeingScheduled = _select.isEditedPostBeingScheduled; return { hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(getCurrentPost(), ['_links', 'wp:action-publish'], false), isBeingScheduled: isEditedPostBeingScheduled() }; })(PostPublishPanelPrepublish)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-publish-panel/toggle.js": /*!*********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/toggle.js ***! \*********************************************************************************************/ /*! exports provided: PostPublishPanelToggle, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostPublishPanelToggle", function() { return PostPublishPanelToggle; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_nux__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/nux */ "@wordpress/nux"); /* harmony import */ var _wordpress_nux__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_nux__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _post_publish_button__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../post-publish-button */ "./node_modules/@wordpress/editor/build-module/components/post-publish-button/index.js"); /** * External Dependencies */ /** * WordPress Dependencies */ /** * Internal Dependencies */ function PostPublishPanelToggle(_ref) { var hasPublishAction = _ref.hasPublishAction, isSaving = _ref.isSaving, isPublishable = _ref.isPublishable, isSaveable = _ref.isSaveable, isPublished = _ref.isPublished, isBeingScheduled = _ref.isBeingScheduled, isPending = _ref.isPending, isScheduled = _ref.isScheduled, onToggle = _ref.onToggle, isOpen = _ref.isOpen, forceIsDirty = _ref.forceIsDirty, forceIsSaving = _ref.forceIsSaving; var isButtonEnabled = !isSaving && !forceIsSaving && isPublishable && isSaveable || isPublished; var showToggle = !isPublished && !(isScheduled && isBeingScheduled) && !(isPending && !hasPublishAction); if (!showToggle) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_publish_button__WEBPACK_IMPORTED_MODULE_7__["default"], { forceIsDirty: forceIsDirty, forceIsSaving: forceIsSaving }); } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Button"], { className: "editor-post-publish-panel__toggle", isPrimary: true, onClick: onToggle, "aria-expanded": isOpen, disabled: !isButtonEnabled, isBusy: isSaving && isPublished }, isBeingScheduled ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Schedule…') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Publish…'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_nux__WEBPACK_IMPORTED_MODULE_6__["DotTip"], { id: "core/editor.publish" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Finished writing? That’s great, let’s get this published right now. Just click “Publish” and you’re good to go.'))); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select) { var _select = select('core/editor'), isSavingPost = _select.isSavingPost, isEditedPostSaveable = _select.isEditedPostSaveable, isEditedPostPublishable = _select.isEditedPostPublishable, isCurrentPostPending = _select.isCurrentPostPending, isCurrentPostPublished = _select.isCurrentPostPublished, isEditedPostBeingScheduled = _select.isEditedPostBeingScheduled, isCurrentPostScheduled = _select.isCurrentPostScheduled, getCurrentPost = _select.getCurrentPost, getCurrentPostType = _select.getCurrentPostType; return { hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(getCurrentPost(), ['_links', 'wp:action-publish'], false), isSaving: isSavingPost(), isSaveable: isEditedPostSaveable(), isPublishable: isEditedPostPublishable(), isPending: isCurrentPostPending(), isPublished: isCurrentPostPublished(), isScheduled: isCurrentPostScheduled(), isBeingScheduled: isEditedPostBeingScheduled(), postType: getCurrentPostType() }; })])(PostPublishPanelToggle)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-saved-state/index.js": /*!******************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-saved-state/index.js ***! \******************************************************************************************/ /*! exports provided: PostSavedState, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostSavedState", function() { return PostSavedState; }); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _post_switch_to_draft_button__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../post-switch-to-draft-button */ "./node_modules/@wordpress/editor/build-module/components/post-switch-to-draft-button/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Component showing whether the post is saved or not and displaying save links. * * @param {Object} Props Component Props. */ var PostSavedState = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostSavedState, _Component); function PostSavedState() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostSavedState); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostSavedState).apply(this, arguments)); _this.state = { forceSavedMessage: false }; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostSavedState, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this2 = this; if (prevProps.isSaving && !this.props.isSaving) { this.setState({ forceSavedMessage: true }); this.props.setTimeout(function () { _this2.setState({ forceSavedMessage: false }); }, 1000); } } }, { key: "render", value: function render() { var _this$props = this.props, isNew = _this$props.isNew, isScheduled = _this$props.isScheduled, isPublished = _this$props.isPublished, isDirty = _this$props.isDirty, isSaving = _this$props.isSaving, isSaveable = _this$props.isSaveable, onSave = _this$props.onSave, isAutosaving = _this$props.isAutosaving; var forceSavedMessage = this.state.forceSavedMessage; if (isSaving) { // TODO: Classes generation should be common across all return // paths of this function, including proper naming convention for // the "Save Draft" button. var classes = classnames__WEBPACK_IMPORTED_MODULE_6___default()('editor-post-saved-state', 'is-saving', { 'is-autosaving': isAutosaving }); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", { className: classes }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Dashicon"], { icon: "cloud" }), isAutosaving ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Autosaving') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Saving')); } if (isPublished || isScheduled) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_post_switch_to_draft_button__WEBPACK_IMPORTED_MODULE_12__["default"], null); } if (!isSaveable) { return null; } if (forceSavedMessage || !isNew && !isDirty) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("span", { className: "editor-post-saved-state is-saved" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Dashicon"], { icon: "saved" }), Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Saved')); } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["IconButton"], { className: "editor-post-save-draft", onClick: onSave, icon: "cloud-upload", shortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["displayShortcut"].primary('s') }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Save Draft')); } }]); return PostSavedState; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withSelect"])(function (select, _ref) { var forceIsDirty = _ref.forceIsDirty, forceIsSaving = _ref.forceIsSaving; var _select = select('core/editor'), isEditedPostNew = _select.isEditedPostNew, isCurrentPostPublished = _select.isCurrentPostPublished, isCurrentPostScheduled = _select.isCurrentPostScheduled, isEditedPostDirty = _select.isEditedPostDirty, isSavingPost = _select.isSavingPost, isEditedPostSaveable = _select.isEditedPostSaveable, getCurrentPost = _select.getCurrentPost, isAutosavingPost = _select.isAutosavingPost; return { post: getCurrentPost(), isNew: isEditedPostNew(), isPublished: isCurrentPostPublished(), isScheduled: isCurrentPostScheduled(), isDirty: forceIsDirty || isEditedPostDirty(), isSaving: forceIsSaving || isSavingPost(), isSaveable: isEditedPostSaveable(), isAutosaving: isAutosavingPost() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withDispatch"])(function (dispatch) { return { onSave: dispatch('core/editor').savePost }; }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["withSafeTimeout"]])(PostSavedState)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-schedule/check.js": /*!***************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-schedule/check.js ***! \***************************************************************************************/ /*! exports provided: PostScheduleCheck, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostScheduleCheck", function() { return PostScheduleCheck; }); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /** * External dependencies */ /** * WordPress dependencies */ function PostScheduleCheck(_ref) { var hasPublishAction = _ref.hasPublishAction, children = _ref.children; if (!hasPublishAction) { return null; } return children; } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { var _select = select('core/editor'), getCurrentPost = _select.getCurrentPost, getCurrentPostType = _select.getCurrentPostType; return { hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(getCurrentPost(), ['_links', 'wp:action-publish'], false), postType: getCurrentPostType() }; })])(PostScheduleCheck)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-schedule/index.js": /*!***************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-schedule/index.js ***! \***************************************************************************************/ /*! exports provided: PostSchedule, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostSchedule", function() { return PostSchedule; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date"); /* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); /** * WordPress dependencies */ function PostSchedule(_ref) { var date = _ref.date, onUpdateDate = _ref.onUpdateDate; var settings = Object(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__["getSettings"])(); // To know if the current timezone is a 12 hour time with look for "a" in the time format // We also make sure this a is not escaped by a "/" var is12HourTime = /a(?!\\)/i.test(settings.formats.time.toLowerCase() // Test only the lower case a .replace(/\\\\/g, '') // Replace "//" with empty strings .split('').reverse().join('') // Reverse the string and test for "a" not followed by a slash ); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["DateTimePicker"], { key: "date-time-picker", currentDate: date, onChange: onUpdateDate, locale: settings.l10n.locale, is12Hour: is12HourTime }); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { return { date: select('core/editor').getEditedPostAttribute('date') }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withDispatch"])(function (dispatch) { return { onUpdateDate: function onUpdateDate(date) { dispatch('core/editor').editPost({ date: date }); } }; })])(PostSchedule)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-schedule/label.js": /*!***************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-schedule/label.js ***! \***************************************************************************************/ /*! exports provided: PostScheduleLabel, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostScheduleLabel", function() { return PostScheduleLabel; }); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date"); /* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /** * WordPress dependencies */ function PostScheduleLabel(_ref) { var date = _ref.date, isFloating = _ref.isFloating; var settings = Object(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__["getSettings"])(); return date && !isFloating ? Object(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__["dateI18n"])(settings.formats.datetime, date) : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Immediately'); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { return { date: select('core/editor').getEditedPostAttribute('date'), isFloating: select('core/editor').isEditedPostDateFloating() }; })(PostScheduleLabel)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-sticky/check.js": /*!*************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-sticky/check.js ***! \*************************************************************************************/ /*! exports provided: PostStickyCheck, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostStickyCheck", function() { return PostStickyCheck; }); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /** * External dependencies */ /** * WordPress dependencies */ function PostStickyCheck(_ref) { var hasStickyAction = _ref.hasStickyAction, postType = _ref.postType, children = _ref.children; if (postType !== 'post' || !hasStickyAction) { return null; } return children; } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { var post = select('core/editor').getCurrentPost(); return { hasStickyAction: Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(post, ['_links', 'wp:action-sticky'], false), postType: select('core/editor').getCurrentPostType() }; })])(PostStickyCheck)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-sticky/index.js": /*!*************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-sticky/index.js ***! \*************************************************************************************/ /*! exports provided: PostSticky, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostSticky", function() { return PostSticky; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _check__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./check */ "./node_modules/@wordpress/editor/build-module/components/post-sticky/check.js"); /** * WordPress dependencies */ /** * Internal dependencies */ function PostSticky(_ref) { var onUpdateSticky = _ref.onUpdateSticky, _ref$postSticky = _ref.postSticky, postSticky = _ref$postSticky === void 0 ? false : _ref$postSticky; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_check__WEBPACK_IMPORTED_MODULE_5__["default"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["CheckboxControl"], { label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Stick to the Front Page'), checked: postSticky, onChange: function onChange() { return onUpdateSticky(!postSticky); } })); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { return { postSticky: select('core/editor').getEditedPostAttribute('sticky') }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withDispatch"])(function (dispatch) { return { onUpdateSticky: function onUpdateSticky(postSticky) { dispatch('core/editor').editPost({ sticky: postSticky }); } }; })])(PostSticky)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-switch-to-draft-button/index.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-switch-to-draft-button/index.js ***! \*****************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); /** * WordPress dependencies */ function PostSwitchToDraftButton(_ref) { var isSaving = _ref.isSaving, isPublished = _ref.isPublished, isScheduled = _ref.isScheduled, onClick = _ref.onClick; if (!isPublished && !isScheduled) { return null; } var onSwitch = function onSwitch() { var alertMessage; if (isPublished) { alertMessage = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Are you sure you want to unpublish this post?'); } else if (isScheduled) { alertMessage = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Are you sure you want to unschedule this post?'); } // eslint-disable-next-line no-alert if (window.confirm(alertMessage)) { onClick(); } }; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Button"], { className: "editor-post-switch-to-draft", isLarge: true, onClick: onSwitch, disabled: isSaving }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Switch to Draft')); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) { var _select = select('core/editor'), isSavingPost = _select.isSavingPost, isCurrentPostPublished = _select.isCurrentPostPublished, isCurrentPostScheduled = _select.isCurrentPostScheduled; return { isSaving: isSavingPost(), isPublished: isCurrentPostPublished(), isScheduled: isCurrentPostScheduled() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), editPost = _dispatch.editPost, savePost = _dispatch.savePost; return { onClick: function onClick() { editPost({ status: 'draft' }); savePost(); } }; })])(PostSwitchToDraftButton)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/check.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/check.js ***! \*****************************************************************************************/ /*! exports provided: PostTaxonomiesCheck, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostTaxonomiesCheck", function() { return PostTaxonomiesCheck; }); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /** * External Dependencies */ /** * WordPress dependencies */ function PostTaxonomiesCheck(_ref) { var postType = _ref.postType, taxonomies = _ref.taxonomies, children = _ref.children; var hasTaxonomies = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["some"])(taxonomies, function (taxonomy) { return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(taxonomy.types, postType); }); if (!hasTaxonomies) { return null; } return children; } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { return { postType: select('core/editor').getCurrentPostType(), taxonomies: select('core').getTaxonomies() }; })])(PostTaxonomiesCheck)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/flat-term-selector.js": /*!******************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/flat-term-selector.js ***! \******************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_15__); /** * External dependencies */ /** * WordPress dependencies */ /** * Module constants */ var DEFAULT_QUERY = { per_page: -1, orderby: 'count', order: 'desc', _fields: 'id,name' }; var MAX_TERMS_SUGGESTIONS = 20; var isSameTermName = function isSameTermName(termA, termB) { return termA.toLowerCase() === termB.toLowerCase(); }; var FlatTermSelector = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(FlatTermSelector, _Component); function FlatTermSelector() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, FlatTermSelector); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(FlatTermSelector).apply(this, arguments)); _this.onChange = _this.onChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.searchTerms = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["throttle"])(_this.searchTerms.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))), 500); _this.findOrCreateTerm = _this.findOrCreateTerm.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); _this.state = { loading: false, availableTerms: [], selectedTerms: [] }; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(FlatTermSelector, [{ key: "componentDidMount", value: function componentDidMount() { var _this2 = this; if (!Object(lodash__WEBPACK_IMPORTED_MODULE_9__["isEmpty"])(this.props.terms)) { this.setState({ loading: false }); this.initRequest = this.fetchTerms({ include: this.props.terms.join(','), per_page: 100 }); this.initRequest.then(function () { _this2.setState({ loading: false }); }, function (xhr) { if (xhr.statusText === 'abort') { return; } _this2.setState({ loading: false }); }); } this.searchTerms(); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { Object(lodash__WEBPACK_IMPORTED_MODULE_9__["invoke"])(this.initRequest, ['abort']); Object(lodash__WEBPACK_IMPORTED_MODULE_9__["invoke"])(this.searchRequest, ['abort']); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (prevProps.terms !== this.props.terms) { this.updateSelectedTerms(this.props.terms); } } }, { key: "fetchTerms", value: function fetchTerms() { var _this3 = this; var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var taxonomy = this.props.taxonomy; var query = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, DEFAULT_QUERY, params); var request = _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_14___default()({ path: Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_15__["addQueryArgs"])("/wp/v2/".concat(taxonomy.rest_base), query) }); request.then(function (terms) { _this3.setState(function (state) { return { availableTerms: state.availableTerms.concat(terms.filter(function (term) { return !Object(lodash__WEBPACK_IMPORTED_MODULE_9__["find"])(state.availableTerms, function (availableTerm) { return availableTerm.id === term.id; }); })) }; }); _this3.updateSelectedTerms(_this3.props.terms); }); return request; } }, { key: "updateSelectedTerms", value: function updateSelectedTerms() { var _this4 = this; var terms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var selectedTerms = terms.reduce(function (result, termId) { var termObject = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["find"])(_this4.state.availableTerms, function (term) { return term.id === termId; }); if (termObject) { result.push(termObject.name); } return result; }, []); this.setState({ selectedTerms: selectedTerms }); } }, { key: "findOrCreateTerm", value: function findOrCreateTerm(termName) { var _this5 = this; var taxonomy = this.props.taxonomy; // Tries to create a term or fetch it if it already exists. return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_14___default()({ path: "/wp/v2/".concat(taxonomy.rest_base), method: 'POST', data: { name: termName } }).catch(function (error) { var errorCode = error.code; if (errorCode === 'term_exists') { // If the terms exist, fetch it instead of creating a new one. _this5.addRequest = _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_14___default()({ path: Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_15__["addQueryArgs"])("/wp/v2/".concat(taxonomy.rest_base), Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, DEFAULT_QUERY, { search: termName })) }); return _this5.addRequest.then(function (searchResult) { return Object(lodash__WEBPACK_IMPORTED_MODULE_9__["find"])(searchResult, function (result) { return isSameTermName(result.name, termName); }); }); } return Promise.reject(error); }); } }, { key: "onChange", value: function onChange(termNames) { var _this6 = this; var uniqueTerms = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["uniqBy"])(termNames, function (term) { return term.toLowerCase(); }); this.setState({ selectedTerms: uniqueTerms }); var newTermNames = uniqueTerms.filter(function (termName) { return !Object(lodash__WEBPACK_IMPORTED_MODULE_9__["find"])(_this6.state.availableTerms, function (term) { return isSameTermName(term.name, termName); }); }); var termNamesToIds = function termNamesToIds(names, availableTerms) { return names.map(function (termName) { return Object(lodash__WEBPACK_IMPORTED_MODULE_9__["find"])(availableTerms, function (term) { return isSameTermName(term.name, termName); }).id; }); }; if (newTermNames.length === 0) { return this.props.onUpdateTerms(termNamesToIds(uniqueTerms, this.state.availableTerms), this.props.taxonomy.rest_base); } Promise.all(newTermNames.map(this.findOrCreateTerm)).then(function (newTerms) { var newAvailableTerms = _this6.state.availableTerms.concat(newTerms); _this6.setState({ availableTerms: newAvailableTerms }); return _this6.props.onUpdateTerms(termNamesToIds(uniqueTerms, newAvailableTerms), _this6.props.taxonomy.rest_base); }); } }, { key: "searchTerms", value: function searchTerms() { var search = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; Object(lodash__WEBPACK_IMPORTED_MODULE_9__["invoke"])(this.searchRequest, ['abort']); this.searchRequest = this.fetchTerms({ search: search }); } }, { key: "render", value: function render() { var _this$props = this.props, slug = _this$props.slug, taxonomy = _this$props.taxonomy, hasAssignAction = _this$props.hasAssignAction; if (!hasAssignAction) { return null; } var _this$state = this.state, loading = _this$state.loading, availableTerms = _this$state.availableTerms, selectedTerms = _this$state.selectedTerms; var termNames = availableTerms.map(function (term) { return term.name; }); var newTermPlaceholderLabel = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["get"])(taxonomy, ['data', 'labels', 'add_new_item'], slug === 'post_tag' ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Add New Tag') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Add New Term')); var singularName = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["get"])(taxonomy, ['data', 'labels', 'singular_name'], slug === 'post_tag' ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Tag') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Term')); var termAddedLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["_x"])('%s added', 'term'), singularName); var termRemovedLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["_x"])('%s removed', 'term'), singularName); var removeTermLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["_x"])('Remove %s', 'term'), singularName); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["FormTokenField"], { value: selectedTerms, displayTransform: lodash__WEBPACK_IMPORTED_MODULE_9__["unescape"], suggestions: termNames, onChange: this.onChange, onInputChange: this.searchTerms, maxSuggestions: MAX_TERMS_SUGGESTIONS, disabled: loading, placeholder: newTermPlaceholderLabel, messages: { added: termAddedLabel, removed: termRemovedLabel, remove: removeTermLabel } }); } }]); return FlatTermSelector; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withSelect"])(function (select, _ref) { var slug = _ref.slug; var _select = select('core/editor'), getCurrentPost = _select.getCurrentPost; var _select2 = select('core'), getTaxonomy = _select2.getTaxonomy; var taxonomy = getTaxonomy(slug); return { hasCreateAction: taxonomy ? Object(lodash__WEBPACK_IMPORTED_MODULE_9__["get"])(getCurrentPost(), ['_links', 'wp:action-create-' + taxonomy.rest_base], false) : false, hasAssignAction: taxonomy ? Object(lodash__WEBPACK_IMPORTED_MODULE_9__["get"])(getCurrentPost(), ['_links', 'wp:action-assign-' + taxonomy.rest_base], false) : false, terms: taxonomy ? select('core/editor').getEditedPostAttribute(taxonomy.rest_base) : [], taxonomy: taxonomy }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withDispatch"])(function (dispatch) { return { onUpdateTerms: function onUpdateTerms(terms, restBase) { dispatch('core/editor').editPost(Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, restBase, terms)); } }; }), Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__["withFilters"])('editor.PostTaxonomyType'))(FlatTermSelector)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/hierarchical-term-selector.js": /*!**************************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/hierarchical-term-selector.js ***! \**************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../utils/terms */ "./node_modules/@wordpress/editor/build-module/utils/terms.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Module Constants */ var DEFAULT_QUERY = { per_page: -1, orderby: 'name', order: 'asc', _fields: 'id,name,parent' }; var MIN_TERMS_COUNT_FOR_FILTER = 8; var HierarchicalTermSelector = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__["default"])(HierarchicalTermSelector, _Component); function HierarchicalTermSelector() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_3__["default"])(this, HierarchicalTermSelector); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__["default"])(HierarchicalTermSelector).apply(this, arguments)); _this.findTerm = _this.findTerm.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); _this.onChange = _this.onChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); _this.onChangeFormName = _this.onChangeFormName.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); _this.onChangeFormParent = _this.onChangeFormParent.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); _this.onAddTerm = _this.onAddTerm.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); _this.onToggleForm = _this.onToggleForm.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); _this.setFilterValue = _this.setFilterValue.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); _this.sortBySelected = _this.sortBySelected.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this))); _this.state = { loading: true, availableTermsTree: [], availableTerms: [], adding: false, formName: '', formParent: '', showForm: false, filterValue: '', filteredTermsTree: [] }; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__["default"])(HierarchicalTermSelector, [{ key: "onChange", value: function onChange(event) { var _this$props = this.props, onUpdateTerms = _this$props.onUpdateTerms, _this$props$terms = _this$props.terms, terms = _this$props$terms === void 0 ? [] : _this$props$terms, taxonomy = _this$props.taxonomy; var termId = parseInt(event.target.value, 10); var hasTerm = terms.indexOf(termId) !== -1; var newTerms = hasTerm ? Object(lodash__WEBPACK_IMPORTED_MODULE_10__["without"])(terms, termId) : Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__["default"])(terms).concat([termId]); onUpdateTerms(newTerms, taxonomy.rest_base); } }, { key: "onChangeFormName", value: function onChangeFormName(event) { var newValue = event.target.value.trim() === '' ? '' : event.target.value; this.setState({ formName: newValue }); } }, { key: "onChangeFormParent", value: function onChangeFormParent(newParent) { this.setState({ formParent: newParent }); } }, { key: "onToggleForm", value: function onToggleForm() { this.setState(function (state) { return { showForm: !state.showForm }; }); } }, { key: "findTerm", value: function findTerm(terms, parent, name) { return Object(lodash__WEBPACK_IMPORTED_MODULE_10__["find"])(terms, function (term) { return (!term.parent && !parent || parseInt(term.parent) === parseInt(parent)) && term.name.toLowerCase() === name.toLowerCase(); }); } }, { key: "onAddTerm", value: function onAddTerm(event) { var _this2 = this; event.preventDefault(); var _this$props2 = this.props, onUpdateTerms = _this$props2.onUpdateTerms, taxonomy = _this$props2.taxonomy, terms = _this$props2.terms, slug = _this$props2.slug; var _this$state = this.state, formName = _this$state.formName, formParent = _this$state.formParent, adding = _this$state.adding, availableTerms = _this$state.availableTerms; if (formName === '' || adding) { return; } // check if the term we are adding already exists var existingTerm = this.findTerm(availableTerms, formParent, formName); if (existingTerm) { // if the term we are adding exists but is not selected select it if (!Object(lodash__WEBPACK_IMPORTED_MODULE_10__["some"])(terms, function (term) { return term === existingTerm.id; })) { onUpdateTerms(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__["default"])(terms).concat([existingTerm.id]), taxonomy.rest_base); } this.setState({ formName: '', formParent: '' }); return; } this.setState({ adding: true }); this.addRequest = _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_15___default()({ path: "/wp/v2/".concat(taxonomy.rest_base), method: 'POST', data: { name: formName, parent: formParent ? formParent : undefined } }); // Tries to create a term or fetch it if it already exists var findOrCreatePromise = this.addRequest.catch(function (error) { var errorCode = error.code; if (errorCode === 'term_exists') { // search the new category created since last fetch _this2.addRequest = _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_15___default()({ path: Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_16__["addQueryArgs"])("/wp/v2/".concat(taxonomy.rest_base), Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, DEFAULT_QUERY, { parent: formParent || 0, search: formName })) }); return _this2.addRequest.then(function (searchResult) { return _this2.findTerm(searchResult, formParent, formName); }); } return Promise.reject(error); }); findOrCreatePromise.then(function (term) { var hasTerm = !!Object(lodash__WEBPACK_IMPORTED_MODULE_10__["find"])(_this2.state.availableTerms, function (availableTerm) { return availableTerm.id === term.id; }); var newAvailableTerms = hasTerm ? _this2.state.availableTerms : [term].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_this2.state.availableTerms)); var termAddedMessage = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["_x"])('%s added', 'term'), Object(lodash__WEBPACK_IMPORTED_MODULE_10__["get"])(_this2.props.taxonomy, ['data', 'labels', 'singular_name'], slug === 'category' ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Category') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Term'))); _this2.props.speak(termAddedMessage, 'assertive'); _this2.addRequest = null; _this2.setState({ adding: false, formName: '', formParent: '', availableTerms: newAvailableTerms, availableTermsTree: _this2.sortBySelected(Object(_utils_terms__WEBPACK_IMPORTED_MODULE_17__["buildTermsTree"])(newAvailableTerms)) }); onUpdateTerms(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__["default"])(terms).concat([term.id]), taxonomy.rest_base); }, function (xhr) { if (xhr.statusText === 'abort') { return; } _this2.addRequest = null; _this2.setState({ adding: false }); }); } }, { key: "componentDidMount", value: function componentDidMount() { this.fetchTerms(); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { Object(lodash__WEBPACK_IMPORTED_MODULE_10__["invoke"])(this.fetchRequest, ['abort']); Object(lodash__WEBPACK_IMPORTED_MODULE_10__["invoke"])(this.addRequest, ['abort']); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.props.taxonomy !== prevProps.taxonomy) { this.fetchTerms(); } } }, { key: "fetchTerms", value: function fetchTerms() { var _this3 = this; var taxonomy = this.props.taxonomy; if (!taxonomy) { return; } this.fetchRequest = _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_15___default()({ path: Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_16__["addQueryArgs"])("/wp/v2/".concat(taxonomy.rest_base), DEFAULT_QUERY) }); this.fetchRequest.then(function (terms) { // resolve var availableTermsTree = _this3.sortBySelected(Object(_utils_terms__WEBPACK_IMPORTED_MODULE_17__["buildTermsTree"])(terms)); _this3.fetchRequest = null; _this3.setState({ loading: false, availableTermsTree: availableTermsTree, availableTerms: terms }); }, function (xhr) { // reject if (xhr.statusText === 'abort') { return; } _this3.fetchRequest = null; _this3.setState({ loading: false }); }); } }, { key: "sortBySelected", value: function sortBySelected(termsTree) { var terms = this.props.terms; var treeHasSelection = function treeHasSelection(termTree) { if (terms.indexOf(termTree.id) !== -1) { return true; } if (undefined === termTree.children) { return false; } var anyChildIsSelected = termTree.children.map(treeHasSelection).filter(function (child) { return child; }).length > 0; if (anyChildIsSelected) { return true; } return false; }; var termOrChildIsSelected = function termOrChildIsSelected(termA, termB) { var termASelected = treeHasSelection(termA); var termBSelected = treeHasSelection(termB); if (termASelected === termBSelected) { return 0; } if (termASelected && !termBSelected) { return -1; } if (!termASelected && termBSelected) { return 1; } return 0; }; termsTree.sort(termOrChildIsSelected); return termsTree; } }, { key: "setFilterValue", value: function setFilterValue(event) { var availableTermsTree = this.state.availableTermsTree; var filterValue = event.target.value; var filteredTermsTree = availableTermsTree.map(this.getFilterMatcher(filterValue)).filter(function (term) { return term; }); var getResultCount = function getResultCount(terms) { var count = 0; for (var i = 0; i < terms.length; i++) { count++; if (undefined !== terms[i].children) { count += getResultCount(terms[i].children); } } return count; }; this.setState({ filterValue: filterValue, filteredTermsTree: filteredTermsTree }); var resultCount = getResultCount(filteredTermsTree); var resultsFoundMessage = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["_n"])('%d result found.', '%d results found.', resultCount, 'term'), resultCount); this.props.debouncedSpeak(resultsFoundMessage, 'assertive'); } }, { key: "getFilterMatcher", value: function getFilterMatcher(filterValue) { var matchTermsForFilter = function matchTermsForFilter(originalTerm) { if ('' === filterValue) { return originalTerm; } // Shallow clone, because we'll be filtering the term's children and // don't want to modify the original term. var term = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, originalTerm); // Map and filter the children, recursive so we deal with grandchildren // and any deeper levels. if (term.children.length > 0) { term.children = term.children.map(matchTermsForFilter).filter(function (child) { return child; }); } // If the term's name contains the filterValue, or it has children // (i.e. some child matched at some point in the tree) then return it. if (-1 !== term.name.toLowerCase().indexOf(filterValue) || term.children.length > 0) { return term; } // Otherwise, return false. After mapping, the list of terms will need // to have false values filtered out. return false; }; return matchTermsForFilter; } }, { key: "renderTerms", value: function renderTerms(renderedTerms) { var _this4 = this; var _this$props$terms2 = this.props.terms, terms = _this$props$terms2 === void 0 ? [] : _this$props$terms2; return renderedTerms.map(function (term) { var id = "editor-post-taxonomies-hierarchical-term-".concat(term.id); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("div", { key: term.id, className: "editor-post-taxonomies__hierarchical-terms-choice" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("input", { id: id, className: "editor-post-taxonomies__hierarchical-terms-input", type: "checkbox", checked: terms.indexOf(term.id) !== -1, value: term.id, onChange: _this4.onChange }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("label", { htmlFor: id }, Object(lodash__WEBPACK_IMPORTED_MODULE_10__["unescape"])(term.name)), !!term.children.length && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("div", { className: "editor-post-taxonomies__hierarchical-terms-subchoices" }, _this4.renderTerms(term.children))); }); } }, { key: "render", value: function render() { var _this$props3 = this.props, slug = _this$props3.slug, taxonomy = _this$props3.taxonomy, instanceId = _this$props3.instanceId, hasCreateAction = _this$props3.hasCreateAction, hasAssignAction = _this$props3.hasAssignAction; if (!hasAssignAction) { return null; } var _this$state2 = this.state, availableTermsTree = _this$state2.availableTermsTree, availableTerms = _this$state2.availableTerms, filteredTermsTree = _this$state2.filteredTermsTree, formName = _this$state2.formName, formParent = _this$state2.formParent, loading = _this$state2.loading, showForm = _this$state2.showForm, filterValue = _this$state2.filterValue; var labelWithFallback = function labelWithFallback(labelProperty, fallbackIsCategory, fallbackIsNotCategory) { return Object(lodash__WEBPACK_IMPORTED_MODULE_10__["get"])(taxonomy, ['data', 'labels', labelProperty], slug === 'category' ? fallbackIsCategory : fallbackIsNotCategory); }; var newTermButtonLabel = labelWithFallback('add_new_item', Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Add new category'), Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Add new term')); var newTermLabel = labelWithFallback('new_item_name', Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Add new category'), Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Add new term')); var parentSelectLabel = labelWithFallback('parent_item', Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Parent Category'), Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Parent Term')); var noParentOption = "\u2014 ".concat(parentSelectLabel, " \u2014"); var newTermSubmitLabel = newTermButtonLabel; var inputId = "editor-post-taxonomies__hierarchical-terms-input-".concat(instanceId); var filterInputId = "editor-post-taxonomies__hierarchical-terms-filter-".concat(instanceId); var filterLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["_x"])('Search %s', 'term'), Object(lodash__WEBPACK_IMPORTED_MODULE_10__["get"])(this.props.taxonomy, ['name'], slug === 'category' ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Categories') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Terms'))); var groupLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["_x"])('Available %s', 'term'), Object(lodash__WEBPACK_IMPORTED_MODULE_10__["get"])(this.props.taxonomy, ['name'], slug === 'category' ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Categories') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Terms'))); var showFilter = availableTerms.length >= MIN_TERMS_COUNT_FOR_FILTER; return [showFilter && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("label", { key: "filter-label", htmlFor: filterInputId }, filterLabel), showFilter && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("input", { type: "search", id: filterInputId, value: filterValue, onChange: this.setFilterValue, className: "editor-post-taxonomies__hierarchical-terms-filter", key: "term-filter-input" }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("div", { className: "editor-post-taxonomies__hierarchical-terms-list", key: "term-list", tabIndex: "0", role: "group", "aria-label": groupLabel }, this.renderTerms('' !== filterValue ? filteredTermsTree : availableTermsTree)), !loading && hasCreateAction && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_12__["Button"], { key: "term-add-button", onClick: this.onToggleForm, className: "editor-post-taxonomies__hierarchical-terms-add", "aria-expanded": showForm, isLink: true }, newTermButtonLabel), showForm && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("form", { onSubmit: this.onAddTerm, key: "hierarchical-terms-form" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("label", { htmlFor: inputId, className: "editor-post-taxonomies__hierarchical-terms-label" }, newTermLabel), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("input", { type: "text", id: inputId, className: "editor-post-taxonomies__hierarchical-terms-input", value: formName, onChange: this.onChangeFormName, required: true }), !!availableTerms.length && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_12__["TreeSelect"], { label: parentSelectLabel, noOptionLabel: noParentOption, onChange: this.onChangeFormParent, selectedId: formParent, tree: availableTermsTree }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_12__["Button"], { isDefault: true, type: "submit", className: "editor-post-taxonomies__hierarchical-terms-submit" }, newTermSubmitLabel))]; /* eslint-enable jsx-a11y/no-onchange */ } }]); return HierarchicalTermSelector; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withSelect"])(function (select, _ref) { var slug = _ref.slug; var _select = select('core/editor'), getCurrentPost = _select.getCurrentPost; var _select2 = select('core'), getTaxonomy = _select2.getTaxonomy; var taxonomy = getTaxonomy(slug); return { hasCreateAction: taxonomy ? Object(lodash__WEBPACK_IMPORTED_MODULE_10__["get"])(getCurrentPost(), ['_links', 'wp:action-create-' + taxonomy.rest_base], false) : false, hasAssignAction: taxonomy ? Object(lodash__WEBPACK_IMPORTED_MODULE_10__["get"])(getCurrentPost(), ['_links', 'wp:action-assign-' + taxonomy.rest_base], false) : false, terms: taxonomy ? select('core/editor').getEditedPostAttribute(taxonomy.rest_base) : [], taxonomy: taxonomy }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withDispatch"])(function (dispatch) { return { onUpdateTerms: function onUpdateTerms(terms, restBase) { dispatch('core/editor').editPost(Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, restBase, terms)); } }; }), _wordpress_components__WEBPACK_IMPORTED_MODULE_12__["withSpokenMessages"], _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["withInstanceId"], Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_12__["withFilters"])('editor.PostTaxonomyType')])(HierarchicalTermSelector)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/index.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/index.js ***! \*****************************************************************************************/ /*! exports provided: PostTaxonomies, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostTaxonomies", function() { return PostTaxonomies; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _hierarchical_term_selector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hierarchical-term-selector */ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/hierarchical-term-selector.js"); /* harmony import */ var _flat_term_selector__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./flat-term-selector */ "./node_modules/@wordpress/editor/build-module/components/post-taxonomies/flat-term-selector.js"); /** * External Dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function PostTaxonomies(_ref) { var postType = _ref.postType, taxonomies = _ref.taxonomies, _ref$taxonomyWrapper = _ref.taxonomyWrapper, taxonomyWrapper = _ref$taxonomyWrapper === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["identity"] : _ref$taxonomyWrapper; var availableTaxonomies = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["filter"])(taxonomies, function (taxonomy) { return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["includes"])(taxonomy.types, postType); }); var visibleTaxonomies = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["filter"])(availableTaxonomies, function (taxonomy) { return taxonomy.visibility.show_ui; }); return visibleTaxonomies.map(function (taxonomy) { var TaxonomyComponent = taxonomy.hierarchical ? _hierarchical_term_selector__WEBPACK_IMPORTED_MODULE_4__["default"] : _flat_term_selector__WEBPACK_IMPORTED_MODULE_5__["default"]; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], { key: "taxonomy-".concat(taxonomy.slug) }, taxonomyWrapper(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(TaxonomyComponent, { slug: taxonomy.slug }), taxonomy)); }); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { return { postType: select('core/editor').getCurrentPostType(), taxonomies: select('core').getTaxonomies({ per_page: -1 }) }; })])(PostTaxonomies)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-text-editor/index.js": /*!******************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-text-editor/index.js ***! \******************************************************************************************/ /*! exports provided: PostTextEditor, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostTextEditor", function() { return PostTextEditor; }); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-autosize-textarea */ "./node_modules/react-autosize-textarea/lib/index.js"); /* harmony import */ var react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__); /** * External dependencies */ /** * WordPress dependencies */ var PostTextEditor = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostTextEditor, _Component); function PostTextEditor() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostTextEditor); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostTextEditor).apply(this, arguments)); _this.edit = _this.edit.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.stopEditing = _this.stopEditing.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.state = {}; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostTextEditor, [{ key: "edit", /** * Handles a textarea change event to notify the onChange prop callback and * reflect the new value in the component's own state. This marks the start * of the user's edits, if not already changed, preventing future props * changes to value from replacing the rendered value. This is expected to * be followed by a reset to dirty state via `stopEditing`. * * @see stopEditing * * @param {Event} event Change event. */ value: function edit(event) { var value = event.target.value; this.props.onChange(value); this.setState({ value: value, isDirty: true }); } /** * Function called when the user has completed their edits, responsible for * ensuring that changes, if made, are surfaced to the onPersist prop * callback and resetting dirty state. */ }, { key: "stopEditing", value: function stopEditing() { if (this.state.isDirty) { this.props.onPersist(this.state.value); this.setState({ isDirty: false }); } } }, { key: "render", value: function render() { var value = this.state.value; var _this$props = this.props, placeholder = _this$props.placeholder, instanceId = _this$props.instanceId; var decodedPlaceholder = Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_9__["decodeEntities"])(placeholder); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("label", { htmlFor: "post-content-".concat(instanceId), className: "screen-reader-text" }, decodedPlaceholder || Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Write your story')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7___default.a, { autoComplete: "off", value: value, onChange: this.edit, onBlur: this.stopEditing, className: "editor-post-text-editor", id: "post-content-".concat(instanceId), placeholder: decodedPlaceholder || Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Write your story') })); } }], [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(props, state) { if (state.isDirty) { return null; } return { value: props.value, isDirty: false }; } }]); return PostTextEditor; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withSelect"])(function (select) { var _select = select('core/editor'), getEditedPostContent = _select.getEditedPostContent, getEditorSettings = _select.getEditorSettings; var _getEditorSettings = getEditorSettings(), bodyPlaceholder = _getEditorSettings.bodyPlaceholder; return { value: getEditedPostContent(), placeholder: bodyPlaceholder }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), editPost = _dispatch.editPost, resetBlocks = _dispatch.resetBlocks; return { onChange: function onChange(content) { editPost({ content: content }); }, onPersist: function onPersist(content) { resetBlocks(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_10__["parse"])(content)); } }; }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["withInstanceId"]])(PostTextEditor)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-title/index.js": /*!************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-title/index.js ***! \************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-autosize-textarea */ "./node_modules/react-autosize-textarea/lib/index.js"); /* harmony import */ var react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var _post_permalink__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../post-permalink */ "./node_modules/@wordpress/editor/build-module/components/post-permalink/index.js"); /* harmony import */ var _post_type_support_check__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../post-type-support-check */ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Constants */ var REGEXP_NEWLINES = /[\r\n]+/g; var PostTitle = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostTitle, _Component); function PostTitle() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostTitle); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostTitle).apply(this, arguments)); _this.onChange = _this.onChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.onSelect = _this.onSelect.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.onUnselect = _this.onUnselect.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.onKeyDown = _this.onKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.redirectHistory = _this.redirectHistory.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.state = { isSelected: false }; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostTitle, [{ key: "handleFocusOutside", value: function handleFocusOutside() { this.onUnselect(); } }, { key: "onSelect", value: function onSelect() { this.setState({ isSelected: true }); this.props.clearSelectedBlock(); } }, { key: "onUnselect", value: function onUnselect() { this.setState({ isSelected: false }); } }, { key: "onChange", value: function onChange(event) { var newTitle = event.target.value.replace(REGEXP_NEWLINES, ' '); this.props.onUpdate(newTitle); } }, { key: "onKeyDown", value: function onKeyDown(event) { if (event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["ENTER"]) { event.preventDefault(); this.props.onEnterPress(); } } /** * Emulates behavior of an undo or redo on its corresponding key press * combination. This is a workaround to React's treatment of undo in a * controlled textarea where characters are updated one at a time. * Instead, leverage the store's undo handling of title changes. * * @see https://github.com/facebook/react/issues/8514 * * @param {KeyboardEvent} event Key event. */ }, { key: "redirectHistory", value: function redirectHistory(event) { if (event.shiftKey) { this.props.onRedo(); } else { this.props.onUndo(); } event.preventDefault(); } }, { key: "render", value: function render() { var _this$props = this.props, hasFixedToolbar = _this$props.hasFixedToolbar, isCleanNewPost = _this$props.isCleanNewPost, isFocusMode = _this$props.isFocusMode, isPostTypeViewable = _this$props.isPostTypeViewable, instanceId = _this$props.instanceId, placeholder = _this$props.placeholder, title = _this$props.title; var isSelected = this.state.isSelected; var className = classnames__WEBPACK_IMPORTED_MODULE_8___default()('editor-post-title__block', { 'is-selected': isSelected, 'is-focus-mode': isFocusMode, 'has-fixed-toolbar': hasFixedToolbar }); var decodedPlaceholder = Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_11__["decodeEntities"])(placeholder); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_post_type_support_check__WEBPACK_IMPORTED_MODULE_17__["default"], { supportKeys: "title" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { className: "editor-post-title" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { className: className }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_14__["KeyboardShortcuts"], { shortcuts: { 'mod+z': this.redirectHistory, 'mod+shift+z': this.redirectHistory } }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("label", { htmlFor: "post-title-".concat(instanceId), className: "screen-reader-text" }, decodedPlaceholder || Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Add title')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(react_autosize_textarea__WEBPACK_IMPORTED_MODULE_7___default.a, { id: "post-title-".concat(instanceId), className: "editor-post-title__input", value: title, onChange: this.onChange, placeholder: decodedPlaceholder || Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Add title'), onFocus: this.onSelect, onKeyDown: this.onKeyDown, onKeyPress: this.onUnselect /* Only autofocus the title when the post is entirely empty. This should only happen for a new post, which means we focus the title on new post so the author can start typing right away, without needing to click anything. */ /* eslint-disable jsx-a11y/no-autofocus */ , autoFocus: isCleanNewPost /* eslint-enable jsx-a11y/no-autofocus */ })), isSelected && isPostTypeViewable && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_post_permalink__WEBPACK_IMPORTED_MODULE_16__["default"], null)))); } }]); return PostTitle; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); var applyWithSelect = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withSelect"])(function (select) { var _select = select('core/editor'), getEditedPostAttribute = _select.getEditedPostAttribute, getEditorSettings = _select.getEditorSettings, isCleanNewPost = _select.isCleanNewPost; var _select2 = select('core'), getPostType = _select2.getPostType; var postType = getPostType(getEditedPostAttribute('type')); var _getEditorSettings = getEditorSettings(), titlePlaceholder = _getEditorSettings.titlePlaceholder, focusMode = _getEditorSettings.focusMode, hasFixedToolbar = _getEditorSettings.hasFixedToolbar; return { isCleanNewPost: isCleanNewPost(), title: getEditedPostAttribute('title'), isPostTypeViewable: Object(lodash__WEBPACK_IMPORTED_MODULE_9__["get"])(postType, ['viewable'], false), placeholder: titlePlaceholder, isFocusMode: focusMode, hasFixedToolbar: hasFixedToolbar }; }); var applyWithDispatch = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), insertDefaultBlock = _dispatch.insertDefaultBlock, editPost = _dispatch.editPost, clearSelectedBlock = _dispatch.clearSelectedBlock, undo = _dispatch.undo, redo = _dispatch.redo; return { onEnterPress: function onEnterPress() { insertDefaultBlock(undefined, undefined, 0); }, onUpdate: function onUpdate(title) { editPost({ title: title }); }, onUndo: undo, onRedo: redo, clearSelectedBlock: clearSelectedBlock }; }); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_15__["compose"])(applyWithSelect, applyWithDispatch, _wordpress_compose__WEBPACK_IMPORTED_MODULE_15__["withInstanceId"], _wordpress_components__WEBPACK_IMPORTED_MODULE_14__["withFocusOutside"])(PostTitle)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-trash/check.js": /*!************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-trash/check.js ***! \************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); /** * WordPress dependencies */ function PostTrashCheck(_ref) { var isNew = _ref.isNew, postId = _ref.postId, children = _ref.children; if (isNew || !postId) { return null; } return children; } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["withSelect"])(function (select) { var _select = select('core/editor'), isEditedPostNew = _select.isEditedPostNew, getCurrentPostId = _select.getCurrentPostId; return { isNew: isEditedPostNew(), postId: getCurrentPostId() }; })(PostTrashCheck)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-trash/index.js": /*!************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-trash/index.js ***! \************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); /** * WordPress dependencies */ function PostTrash(_ref) { var isNew = _ref.isNew, postId = _ref.postId, postType = _ref.postType, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, ["isNew", "postId", "postType"]); if (isNew || !postId) { return null; } var onClick = function onClick() { return props.trashPost(postId, postType); }; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["Button"], { isLink: true, className: "editor-post-trash button-link-delete", onClick: onClick }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Move to trash'), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["Dashicon"], { icon: "trash" })); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])(function (select) { var _select = select('core/editor'), isEditedPostNew = _select.isEditedPostNew, getCurrentPostId = _select.getCurrentPostId, getCurrentPostType = _select.getCurrentPostType; return { isNew: isEditedPostNew(), postId: getCurrentPostId(), postType: getCurrentPostType() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withDispatch"])(function (dispatch) { return { trashPost: dispatch('core/editor').trashPost }; })])(PostTrash)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js": /*!*************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js ***! \*************************************************************************************************/ /*! exports provided: PostTypeSupportCheck, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostTypeSupportCheck", function() { return PostTypeSupportCheck; }); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); /** * 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.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 {WPElement} Rendered element. */ function PostTypeSupportCheck(_ref) { var postType = _ref.postType, children = _ref.children, supportKeys = _ref.supportKeys; var isSupported = true; if (postType) { isSupported = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["some"])(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["castArray"])(supportKeys), function (key) { return !!postType.supports[key]; }); } if (!isSupported) { return null; } return children; } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { var _select = select('core/editor'), getEditedPostAttribute = _select.getEditedPostAttribute; var _select2 = select('core'), getPostType = _select2.getPostType; return { postType: getPostType(getEditedPostAttribute('type')) }; })(PostTypeSupportCheck)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-visibility/check.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-visibility/check.js ***! \*****************************************************************************************/ /*! exports provided: PostVisibilityCheck, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostVisibilityCheck", function() { return PostVisibilityCheck; }); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /** * External dependencies */ /** * WordPress dependencies */ function PostVisibilityCheck(_ref) { var hasPublishAction = _ref.hasPublishAction, render = _ref.render; var canEdit = hasPublishAction; return render({ canEdit: canEdit }); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) { var _select = select('core/editor'), getCurrentPost = _select.getCurrentPost, getCurrentPostType = _select.getCurrentPostType; return { hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(getCurrentPost(), ['_links', 'wp:action-publish'], false), postType: getCurrentPostType() }; })])(PostVisibilityCheck)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-visibility/index.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-visibility/index.js ***! \*****************************************************************************************/ /*! exports provided: PostVisibility, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostVisibility", function() { return PostVisibility; }); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/editor/build-module/components/post-visibility/utils.js"); /** * WordPress dependencies */ /** * Internal Dependencies */ var PostVisibility = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PostVisibility, _Component); function PostVisibility(props) { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PostVisibility); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PostVisibility).apply(this, arguments)); _this.setPublic = _this.setPublic.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.setPrivate = _this.setPrivate.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.setPasswordProtected = _this.setPasswordProtected.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.updatePassword = _this.updatePassword.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.state = { hasPassword: !!props.password }; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PostVisibility, [{ key: "setPublic", value: function setPublic() { var _this$props = this.props, visibility = _this$props.visibility, onUpdateVisibility = _this$props.onUpdateVisibility, status = _this$props.status; onUpdateVisibility(visibility === 'private' ? 'draft' : status); this.setState({ hasPassword: false }); } }, { key: "setPrivate", value: function setPrivate() { if (!window.confirm(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Would you like to privately publish this post now?'))) { // eslint-disable-line no-alert return; } var _this$props2 = this.props, onUpdateVisibility = _this$props2.onUpdateVisibility, onSave = _this$props2.onSave; onUpdateVisibility('private'); this.setState({ hasPassword: false }); onSave(); } }, { key: "setPasswordProtected", value: function setPasswordProtected() { var _this$props3 = this.props, visibility = _this$props3.visibility, onUpdateVisibility = _this$props3.onUpdateVisibility, status = _this$props3.status, password = _this$props3.password; onUpdateVisibility(visibility === 'private' ? 'draft' : status, password || ''); this.setState({ hasPassword: true }); } }, { key: "updatePassword", value: function updatePassword(event) { var _this$props4 = this.props, status = _this$props4.status, onUpdateVisibility = _this$props4.onUpdateVisibility; onUpdateVisibility(status, event.target.value); } }, { key: "render", value: function render() { var _this$props5 = this.props, visibility = _this$props5.visibility, password = _this$props5.password, instanceId = _this$props5.instanceId; var visibilityHandlers = { public: { onSelect: this.setPublic, checked: visibility === 'public' && !this.state.hasPassword }, private: { onSelect: this.setPrivate, checked: visibility === 'private' }, password: { onSelect: this.setPasswordProtected, checked: this.state.hasPassword } }; return [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("fieldset", { key: "visibility-selector", className: "editor-post-visibility__dialog-fieldset" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("legend", { className: "editor-post-visibility__dialog-legend" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Post Visibility')), _utils__WEBPACK_IMPORTED_MODULE_10__["visibilityOptions"].map(function (_ref) { var value = _ref.value, label = _ref.label, info = _ref.info; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { key: value, className: "editor-post-visibility__choice" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", { type: "radio", name: "editor-post-visibility__setting-".concat(instanceId), value: value, onChange: visibilityHandlers[value].onSelect, checked: visibilityHandlers[value].checked, id: "editor-post-".concat(value, "-").concat(instanceId), "aria-describedby": "editor-post-".concat(value, "-").concat(instanceId, "-description"), className: "editor-post-visibility__dialog-radio" }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("label", { htmlFor: "editor-post-".concat(value, "-").concat(instanceId), className: "editor-post-visibility__dialog-label" }, label), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("p", { id: "editor-post-".concat(value, "-").concat(instanceId, "-description"), className: "editor-post-visibility__dialog-info" }, info)); })), this.state.hasPassword && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { className: "editor-post-visibility__dialog-password", key: "password-selector" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("label", { htmlFor: "editor-post-visibility__dialog-password-input-".concat(instanceId), className: "screen-reader-text" }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Create password')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", { className: "editor-post-visibility__dialog-password-input", id: "editor-post-visibility__dialog-password-input-".concat(instanceId), type: "text", onChange: this.updatePassword, value: password, placeholder: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Use a secure password') }))]; } }]); return PostVisibility; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withSelect"])(function (select) { var _select = select('core/editor'), getEditedPostAttribute = _select.getEditedPostAttribute, getEditedPostVisibility = _select.getEditedPostVisibility; return { status: getEditedPostAttribute('status'), visibility: getEditedPostVisibility(), password: getEditedPostAttribute('password') }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_9__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), savePost = _dispatch.savePost, editPost = _dispatch.editPost; return { onSave: savePost, onUpdateVisibility: function onUpdateVisibility(status) { var password = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; editPost({ status: status, password: password }); } }; }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["withInstanceId"]])(PostVisibility)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-visibility/label.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-visibility/label.js ***! \*****************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/editor/build-module/components/post-visibility/utils.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal Dependencies */ function PostVisibilityLabel(_ref) { var visibility = _ref.visibility; var getVisibilityLabel = function getVisibilityLabel() { return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(_utils__WEBPACK_IMPORTED_MODULE_2__["visibilityOptions"], { value: visibility }).label; }; return getVisibilityLabel(visibility); } /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) { return { visibility: select('core/editor').getEditedPostVisibility() }; })(PostVisibilityLabel)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/post-visibility/utils.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/post-visibility/utils.js ***! \*****************************************************************************************/ /*! exports provided: visibilityOptions */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "visibilityOptions", function() { return visibilityOptions; }); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); /** * WordPress Dependencies */ var visibilityOptions = [{ value: 'public', label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Public'), info: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Visible to everyone.') }, { value: 'private', label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Private'), info: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Only visible to site admins and editors.') }, { value: 'password', label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Password Protected'), info: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Protected with a password you choose. Only those with the password can view this post.') }]; /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/preserve-scroll-in-reorder/index.js": /*!****************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/preserve-scroll-in-reorder/index.js ***! \****************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/dom */ "./node_modules/@wordpress/editor/build-module/utils/dom.js"); /** * WordPress dependencies */ /** * Internal dependencies */ /** * Non-visual component which preserves offset of selected block within nearest * scrollable container while reordering. * * @example * * ```jsx * * ``` */ var PreserveScrollInReorder = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PreserveScrollInReorder, _Component); function PreserveScrollInReorder() { Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PreserveScrollInReorder); return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PreserveScrollInReorder).apply(this, arguments)); } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PreserveScrollInReorder, [{ key: "getSnapshotBeforeUpdate", value: function getSnapshotBeforeUpdate(prevProps) { var _this$props = this.props, blockOrder = _this$props.blockOrder, selectionStart = _this$props.selectionStart; if (blockOrder !== prevProps.blockOrder && selectionStart) { return this.getOffset(selectionStart); } return null; } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps, prevState, snapshot) { if (snapshot) { this.restorePreviousOffset(snapshot); } } /** * Given the block client ID of the start of the selection, saves the * block's top offset as an instance property before a reorder is to occur. * * @param {string} selectionStart Client ID of selected block. * * @return {number?} The scroll offset. */ }, { key: "getOffset", value: function getOffset(selectionStart) { var blockNode = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_8__["getBlockDOMNode"])(selectionStart); if (!blockNode) { return null; } return blockNode.getBoundingClientRect().top; } /** * After a block reordering, restores the previous viewport top offset. * * @param {number} offset The scroll offset. */ }, { key: "restorePreviousOffset", value: function restorePreviousOffset(offset) { var selectionStart = this.props.selectionStart; var blockNode = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_8__["getBlockDOMNode"])(selectionStart); if (blockNode) { var scrollContainer = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_7__["getScrollContainer"])(blockNode); if (scrollContainer) { scrollContainer.scrollTop = scrollContainer.scrollTop + blockNode.getBoundingClientRect().top - offset; } } } }, { key: "render", value: function render() { return null; } }]); return PreserveScrollInReorder; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["withSelect"])(function (select) { return { blockOrder: select('core/editor').getBlockOrder(), selectionStart: select('core/editor').getBlockSelectionStart() }; })(PreserveScrollInReorder)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/provider/index.js": /*!**********************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/provider/index.js ***! \**********************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _editor_styles__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../editor-styles */ "./node_modules/@wordpress/editor/build-module/editor-styles/index.js"); /** * External dependencies */ /** * WordPress Dependencies */ /** * Internal dependencies */ var EditorProvider = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(EditorProvider, _Component); function EditorProvider(props) { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, EditorProvider); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(EditorProvider).apply(this, arguments)); // Assume that we don't need to initialize in the case of an error recovery. if (!props.recovery) { _this.props.updateEditorSettings(props.settings); _this.props.updatePostLock(props.settings.postLock); _this.props.setupEditor(props.post, props.settings.autosave); } return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(EditorProvider, [{ key: "componentDidMount", value: function componentDidMount() { if (!this.props.settings.styles) { return; } Object(lodash__WEBPACK_IMPORTED_MODULE_6__["map"])(this.props.settings.styles, function (_ref) { var css = _ref.css, baseURL = _ref.baseURL; var transforms = [_editor_styles__WEBPACK_IMPORTED_MODULE_11__["editorWidth"], Object(_editor_styles__WEBPACK_IMPORTED_MODULE_11__["wrap"])('.editor-block-list__block', ['.wp-block'])]; if (baseURL) { transforms.push(Object(_editor_styles__WEBPACK_IMPORTED_MODULE_11__["urlRewrite"])(baseURL)); } var updatedCSS = Object(_editor_styles__WEBPACK_IMPORTED_MODULE_11__["traverse"])(css, Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__["compose"])(transforms)); if (updatedCSS) { var node = document.createElement('style'); node.innerHTML = updatedCSS; document.body.appendChild(node); } }); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { if (this.props.settings !== prevProps.settings) { this.props.updateEditorSettings(this.props.settings); } } }, { key: "render", value: function render() { var children = this.props.children; var providers = [// Slot / Fill provider: // // - context.getSlot // - context.registerSlot // - context.unregisterSlot [_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["SlotFillProvider"]], // DropZone provider: [_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["DropZoneProvider"]]]; var createEditorElement = Object(lodash__WEBPACK_IMPORTED_MODULE_6__["flow"])(providers.map(function (_ref2) { var _ref3 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref2, 2), Provider = _ref3[0], props = _ref3[1]; return function (arg) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(Provider, props, arg); }; })); return createEditorElement(children); } }]); return EditorProvider; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_10__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), setupEditor = _dispatch.setupEditor, updateEditorSettings = _dispatch.updateEditorSettings, updatePostLock = _dispatch.updatePostLock; return { setupEditor: setupEditor, updateEditorSettings: updateEditorSettings, updatePostLock: updatePostLock }; })(EditorProvider)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/aria.js": /*!**********************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/aria.js ***! \**********************************************************************************/ /*! exports provided: pickAriaProps, diffAriaProps */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pickAriaProps", function() { return pickAriaProps; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "diffAriaProps", function() { return diffAriaProps; }); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /** * External dependencies */ var isAriaPropName = function isAriaPropName(name) { return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["startsWith"])(name, 'aria-'); }; var pickAriaProps = function pickAriaProps(props) { return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["pickBy"])(props, function (value, key) { return isAriaPropName(key) && !Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isNil"])(value); }); }; var diffAriaProps = function diffAriaProps(props, nextProps) { var prevAriaKeys = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["keys"])(pickAriaProps(props)); var nextAriaKeys = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["keys"])(pickAriaProps(nextProps)); var removedKeys = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["difference"])(prevAriaKeys, nextAriaKeys); var updatedKeys = nextAriaKeys.filter(function (key) { return !Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isEqual"])(props[key], nextProps[key]); }); return { removedKeys: removedKeys, updatedKeys: updatedKeys }; }; /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/core-tokens/image/index.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/core-tokens/image/index.js ***! \*****************************************************************************************************/ /*! exports provided: name, settings */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "name", function() { return name; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "settings", function() { return settings; }); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _media_upload__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../media-upload */ "./node_modules/@wordpress/editor/build-module/components/media-upload/index.js"); /** * WordPress dependencies */ /** * Internal dependencies */ var name = 'core/image'; var ALLOWED_MEDIA_TYPES = ['image']; var settings = { id: 'image', title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Inline Image'), type: 'image', icon: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("path", { d: "M4 16h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2zM4 5h10v9H4V5zm14 9v2h4v-2h-4zM2 20h20v-2H2v2zm6.4-8.8L7 9.4 5 12h8l-2.6-3.4-2 2.6z" })), edit: function edit(_ref) { var onSave = _ref.onSave; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_media_upload__WEBPACK_IMPORTED_MODULE_2__["default"], { allowedTypes: ALLOWED_MEDIA_TYPES, onSelect: function onSelect(media) { return onSave(media); }, onClose: function onClose() { return onSave(null); }, render: function render(_ref2) { var open = _ref2.open; open(); return null; } }); }, save: function save(_ref3) { var id = _ref3.id, url = _ref3.url, alt = _ref3.alt, width = _ref3.width; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("img", { className: "wp-image-".concat(id) // set width in style attribute to prevent Block CSS from overriding it , style: { width: "".concat(Math.min(width, 150), "px") }, src: url, alt: alt }); } }; /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/core-tokens/index.js": /*!***********************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/core-tokens/index.js ***! \***********************************************************************************************/ /*! exports provided: image */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _image__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./image */ "./node_modules/@wordpress/editor/build-module/components/rich-text/core-tokens/image/index.js"); /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "image", function() { return _image__WEBPACK_IMPORTED_MODULE_0__; }); /** * Internal dependencies */ /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/index.js": /*!**************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/index.js ***! \**************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _formatting_controls__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../formatting-controls */ "./node_modules/@wordpress/editor/build-module/components/rich-text/formatting-controls.js"); /* harmony import */ var _link_container__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./link-container */ "./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/link-container.js"); /* harmony import */ var _toolbar_container__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./toolbar-container */ "./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/toolbar-container.js"); /** * WordPress dependencies */ /** * Internal dependencies */ var FormatToolbar = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(FormatToolbar, _Component); function FormatToolbar(_ref) { var _this; var toggleFormat = _ref.toggleFormat, editor = _ref.editor; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, FormatToolbar); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(FormatToolbar).apply(this, arguments)); _this.removeLink = _this.removeLink.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.addLink = _this.addLink.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.stopAddingLink = _this.stopAddingLink.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.applyFormat = _this.applyFormat.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.removeFormat = _this.removeFormat.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.getActiveFormat = _this.getActiveFormat.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.toggleFormat = _this.toggleFormat.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))); _this.state = { addingLink: false }; if (editor) { editor.shortcuts.add(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["rawShortcut"].primary('k'), '', _this.addLink); editor.shortcuts.add(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["rawShortcut"].access('a'), '', _this.addLink); editor.shortcuts.add(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["rawShortcut"].access('s'), '', _this.removeLink); editor.shortcuts.add(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["rawShortcut"].access('d'), '', function () { return toggleFormat({ type: 'del' }); }); editor.shortcuts.add(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["rawShortcut"].access('x'), '', function () { return toggleFormat({ type: 'code' }); }); } return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(FormatToolbar, [{ key: "removeLink", value: function removeLink() { this.removeFormat('a'); } }, { key: "addLink", value: function addLink() { var text = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["getTextContent"])(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["slice"])(this.props.record)); if (text && Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_12__["isURL"])(text)) { this.applyFormat({ type: 'a', attributes: { href: text } }); } else { this.setState({ addingLink: true }); } } }, { key: "stopAddingLink", value: function stopAddingLink() { this.setState({ addingLink: false }); } /** * Apply a format with the current value and selection. * * @param {Object} format The format to apply. */ }, { key: "applyFormat", value: function applyFormat(format) { this.props.onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["applyFormat"])(this.props.record, format)); } /** * Remove a format from the current value with the current selection. * * @param {string} formatType The type of format to remove. */ }, { key: "removeFormat", value: function removeFormat(formatType) { this.props.onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["removeFormat"])(this.props.record, formatType)); } /** * Get the current format based on the selection * * @param {string} formatType The type of format to check. * * @return {boolean} Whether the format is active or not. */ }, { key: "getActiveFormat", value: function getActiveFormat(formatType) { return Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["getActiveFormat"])(this.props.record, formatType); } /** * Toggle a format based on the selection. * * @param {Object} format The format to toggle. */ }, { key: "toggleFormat", value: function toggleFormat(format) { if (this.getActiveFormat(format.type)) { this.removeFormat(format.type); } else { this.applyFormat(format); } } }, { key: "render", value: function render() { var _this2 = this; var link = this.getActiveFormat('a'); var toolbarControls = _formatting_controls__WEBPACK_IMPORTED_MODULE_13__["FORMATTING_CONTROLS"].filter(function (control) { return _this2.props.enabledControls.indexOf(control.format) !== -1; }).map(function (control) { if (control.format === 'link') { var linkIsActive = link !== undefined; return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, control, { shortcut: linkIsActive ? control.activeShortcut : control.shortcut, icon: linkIsActive ? 'editor-unlink' : 'admin-links', // TODO: Need proper unlink icon title: linkIsActive ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Unlink') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Link'), onClick: linkIsActive ? _this2.removeLink : _this2.addLink, isActive: !!linkIsActive }); } return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, control, { onClick: function onClick() { return _this2.toggleFormat({ type: control.selector }); }, isActive: _this2.getActiveFormat(control.selector) !== undefined }); }); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_toolbar_container__WEBPACK_IMPORTED_MODULE_15__["default"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["Toolbar"], { controls: toolbarControls }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_link_container__WEBPACK_IMPORTED_MODULE_14__["default"], { link: link, record: this.props.record, onChange: this.props.onChange, applyFormat: this.applyFormat, removeFormat: this.removeFormat, getActiveFormat: this.getActiveFormat, toggleFormat: this.toggleFormat, addingLink: this.state.addingLink, stopAddingLink: this.stopAddingLink })); } }]); return FormatToolbar; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (FormatToolbar); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/link-container.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/link-container.js ***! \***********************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _positioned_at_selection__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./positioned-at-selection */ "./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/positioned-at-selection.js"); /* harmony import */ var _url_input__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../url-input */ "./node_modules/@wordpress/editor/build-module/components/url-input/index.js"); /* harmony import */ var _utils_url__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../utils/url */ "./node_modules/@wordpress/editor/build-module/utils/url.js"); /** * WordPress dependencies */ /** * Internal dependencies */ var stopKeyPropagation = function stopKeyPropagation(event) { return event.stopPropagation(); }; function getLinkAttributesFromFormat() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, _ref$attributes = _ref.attributes; _ref$attributes = _ref$attributes === void 0 ? {} : _ref$attributes; var _ref$attributes$href = _ref$attributes.href, href = _ref$attributes$href === void 0 ? '' : _ref$attributes$href, target = _ref$attributes.target; return { href: href, target: target }; } function createLinkFormat(_ref2) { var href = _ref2.href, opensInNewWindow = _ref2.opensInNewWindow; var format = { type: 'a', attributes: { href: href } }; if (opensInNewWindow) { format.attributes.target = '_blank'; format.attributes.rel = 'noreferrer noopener'; } return format; } function isShowingInput(props, state) { return props.addingLink || state.editLink; } var LinkContainer = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(LinkContainer, _Component); function LinkContainer() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, LinkContainer); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(LinkContainer).apply(this, arguments)); _this.editLink = _this.editLink.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.submitLink = _this.submitLink.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.onKeyDown = _this.onKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.onChangeInputValue = _this.onChangeInputValue.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.toggleLinkSettingsVisibility = _this.toggleLinkSettingsVisibility.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.setLinkTarget = _this.setLinkTarget.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.resetState = _this.resetState.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this))); _this.state = {}; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(LinkContainer, [{ key: "onKeyDown", value: function onKeyDown(event) { if (event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["ESCAPE"]) { event.stopPropagation(); this.resetState(); } if ([_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["LEFT"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["DOWN"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["RIGHT"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["UP"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["BACKSPACE"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["ENTER"]].indexOf(event.keyCode) > -1) { // Stop the key event from propagating up to maybeStartTyping in BlockListBlock. event.stopPropagation(); } } }, { key: "onChangeInputValue", value: function onChangeInputValue(inputValue) { this.setState({ inputValue: inputValue }); } }, { key: "toggleLinkSettingsVisibility", value: function toggleLinkSettingsVisibility() { this.setState(function (state) { return { settingsVisible: !state.settingsVisible }; }); } }, { key: "setLinkTarget", value: function setLinkTarget(opensInNewWindow) { this.setState({ opensInNewWindow: opensInNewWindow }); // Apply now if URL is not being edited. if (!isShowingInput(this.props, this.state)) { var _getLinkAttributesFro = getLinkAttributesFromFormat(this.props.link), href = _getLinkAttributesFro.href; this.props.applyFormat(createLinkFormat({ href: href, opensInNewWindow: opensInNewWindow })); } } }, { key: "editLink", value: function editLink(event) { this.setState({ editLink: true }); event.preventDefault(); } }, { key: "submitLink", value: function submitLink(event) { var _this$props = this.props, link = _this$props.link, record = _this$props.record; var _this$state = this.state, inputValue = _this$state.inputValue, opensInNewWindow = _this$state.opensInNewWindow; var href = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_10__["prependHTTP"])(inputValue); var format = createLinkFormat({ href: href, opensInNewWindow: opensInNewWindow }); if (Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["isCollapsed"])(record) && link === undefined) { var toInsert = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["applyFormat"])(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["create"])({ text: href }), format, 0, href.length); this.props.onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["insert"])(record, toInsert)); } else { this.props.applyFormat(format); } this.resetState(); if (!link) { this.props.speak(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Link added.'), 'assertive'); } event.preventDefault(); } }, { key: "resetState", value: function resetState() { this.props.stopAddingLink(); this.setState({ editLink: false }); } }, { key: "render", value: function render() { var _this$props2 = this.props, link = _this$props2.link, addingLink = _this$props2.addingLink, record = _this$props2.record; if (!link && !addingLink) { return null; } var _this$state2 = this.state, inputValue = _this$state2.inputValue, settingsVisible = _this$state2.settingsVisible, opensInNewWindow = _this$state2.opensInNewWindow; var _getLinkAttributesFro2 = getLinkAttributesFromFormat(link), href = _getLinkAttributesFro2.href; var showInput = isShowingInput(this.props, this.state); var linkSettings = settingsVisible && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { className: "editor-format-toolbar__link-modal-line editor-format-toolbar__link-settings" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["ToggleControl"], { label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Open in New Window'), checked: opensInNewWindow, onChange: this.setLinkTarget })); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Fill"], { name: "RichText.Siblings" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_positioned_at_selection__WEBPACK_IMPORTED_MODULE_12__["default"], { className: "editor-format-toolbar__link-container", key: "".concat(record.start).concat(record.end) /* Used to force rerender on selection change */ }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["Popover"], { position: "bottom center", focusOnMount: showInput ? 'firstElement' : false, onClickOutside: this.resetState }, showInput && // Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */ Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("form", { className: "editor-format-toolbar__link-modal", onKeyPress: stopKeyPropagation, onKeyDown: this.onKeyDown, onSubmit: this.submitLink }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { className: "editor-format-toolbar__link-modal-line" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_url_input__WEBPACK_IMPORTED_MODULE_13__["default"], { value: inputValue, onChange: this.onChangeInputValue }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["IconButton"], { icon: "editor-break", label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Apply'), type: "submit" }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["IconButton"], { className: "editor-format-toolbar__link-settings-toggle", icon: "ellipsis", label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Link Settings'), onClick: this.toggleLinkSettingsVisibility, "aria-expanded": settingsVisible })), linkSettings) /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */ , !showInput && // Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar /* eslint-disable jsx-a11y/no-static-element-interactions */ Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { className: "editor-format-toolbar__link-modal", onKeyPress: stopKeyPropagation }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { className: "editor-format-toolbar__link-modal-line" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["ExternalLink"], { className: "editor-format-toolbar__link-value", href: href }, Object(_utils_url__WEBPACK_IMPORTED_MODULE_14__["filterURLForDisplay"])(decodeURI(href))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["IconButton"], { icon: "edit", label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Edit'), onClick: this.editLink }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["IconButton"], { className: "editor-format-toolbar__link-settings-toggle", icon: "ellipsis", label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Link Settings'), onClick: this.toggleLinkSettingsVisibility, "aria-expanded": settingsVisible })), linkSettings) /* eslint-enable jsx-a11y/no-static-element-interactions */ ))); } }], [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(props, state) { var _getLinkAttributesFro3 = getLinkAttributesFromFormat(props.link), href = _getLinkAttributesFro3.href, target = _getLinkAttributesFro3.target; var opensInNewWindow = target === '_blank'; if (!isShowingInput(props, state)) { if (href !== state.inputValue) { return { inputValue: href }; } if (opensInNewWindow !== state.opensInNewWindow) { return { opensInNewWindow: opensInNewWindow }; } } return null; } }]); return LinkContainer; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["withSpokenMessages"])(LinkContainer)); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/positioned-at-selection.js": /*!********************************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/positioned-at-selection.js ***! \********************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_6__); /** * WordPress dependencies */ /** * Returns a style object for applying as `position: absolute` for an element * relative to the bottom-center of the current selection. Includes `top` and * `left` style properties. * * @return {Object} Style object. */ function getCurrentCaretPositionStyle() { var selection = window.getSelection(); // Unlikely, but in the case there is no selection, return empty styles so // as to avoid a thrown error by `Selection#getRangeAt` on invalid index. if (selection.rangeCount === 0) { return {}; } // Get position relative viewport. var rect = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_6__["getRectangleFromRange"])(selection.getRangeAt(0)); var top = rect.top + rect.height; var left = rect.left + rect.width / 2; // Offset by positioned parent, if one exists. var offsetParent = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_6__["getOffsetParent"])(selection.anchorNode); if (offsetParent) { var parentRect = offsetParent.getBoundingClientRect(); top -= parentRect.top; left -= parentRect.left; } return { top: top, left: left }; } /** * Component which renders itself positioned under the current caret selection. * The position is calculated at the time of the component being mounted, so it * should only be mounted after the desired selection has been made. * * @type {WPComponent} */ var PositionedAtSelection = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PositionedAtSelection, _Component); function PositionedAtSelection() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PositionedAtSelection); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PositionedAtSelection).apply(this, arguments)); _this.state = { style: getCurrentCaretPositionStyle() }; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PositionedAtSelection, [{ key: "render", value: function render() { var _this$props = this.props, className = _this$props.className, children = _this$props.children; var style = this.state.style; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("div", { className: className, style: style }, children); } }]); return PositionedAtSelection; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); /* harmony default export */ __webpack_exports__["default"] = (PositionedAtSelection); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/toolbar-container.js": /*!**************************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/toolbar-container.js ***! \**************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); var ToolbarContainer = function ToolbarContainer(props) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "editor-format-toolbar" }, props.children); }; /* harmony default export */ __webpack_exports__["default"] = (ToolbarContainer); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/formatting-controls.js": /*!*************************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/formatting-controls.js ***! \*************************************************************************************************/ /*! exports provided: FORMATTING_CONTROLS */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FORMATTING_CONTROLS", function() { return FORMATTING_CONTROLS; }); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ var FORMATTING_CONTROLS = [{ icon: 'editor-bold', title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Bold'), shortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["displayShortcut"].primary('b'), format: 'bold', selector: 'strong' }, { icon: 'editor-italic', title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Italic'), shortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["displayShortcut"].primary('i'), format: 'italic', selector: 'em' }, { icon: 'admin-links', title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Link'), shortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["displayShortcut"].primary('k'), activeShortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["displayShortcut"].access('s'), format: 'link', selector: 'a' }, { icon: 'editor-strikethrough', title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Strikethrough'), shortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["displayShortcut"].access('d'), format: 'strikethrough', selector: 'del' }]; /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/index.js": /*!***********************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/index.js ***! \***********************************************************************************/ /*! exports provided: RichText, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RichText", function() { return RichText; }); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"); /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! memize */ "./node_modules/memize/index.js"); /* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(memize__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom"); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var _wordpress_blob__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @wordpress/blob */ "@wordpress/blob"); /* harmony import */ var _wordpress_blob__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blob__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_22__); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var _autocomplete__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../autocomplete */ "./node_modules/@wordpress/editor/build-module/components/autocomplete/index.js"); /* harmony import */ var _block_format_controls__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../block-format-controls */ "./node_modules/@wordpress/editor/build-module/components/block-format-controls/index.js"); /* harmony import */ var _formatting_controls__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./formatting-controls */ "./node_modules/@wordpress/editor/build-module/components/rich-text/formatting-controls.js"); /* harmony import */ var _format_toolbar__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./format-toolbar */ "./node_modules/@wordpress/editor/build-module/components/rich-text/format-toolbar/index.js"); /* harmony import */ var _tinymce__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./tinymce */ "./node_modules/@wordpress/editor/build-module/components/rich-text/tinymce.js"); /* harmony import */ var _aria__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./aria */ "./node_modules/@wordpress/editor/build-module/components/rich-text/aria.js"); /* harmony import */ var _patterns__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./patterns */ "./node_modules/@wordpress/editor/build-module/components/rich-text/patterns.js"); /* harmony import */ var _block_edit_context__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../block-edit/context */ "./node_modules/@wordpress/editor/build-module/components/block-edit/context.js"); /* harmony import */ var _tokens_ui__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./tokens/ui */ "./node_modules/@wordpress/editor/build-module/components/rich-text/tokens/ui/index.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Browser dependencies */ var _window = window, Node = _window.Node, getSelection = _window.getSelection; /** * Zero-width space character used by TinyMCE as a caret landing point for * inline boundary nodes. * * @see tinymce/src/core/main/ts/text/Zwsp.ts * * @type {string} */ var TINYMCE_ZWSP = "\uFEFF"; var RichText = /*#__PURE__*/ function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_9__["default"])(RichText, _Component); function RichText(_ref) { var _this; var value = _ref.value, onReplace = _ref.onReplace, multiline = _ref.multiline; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_5__["default"])(this, RichText); _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_7__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_8__["default"])(RichText).apply(this, arguments)); _this.onInit = _this.onInit.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.getSettings = _this.getSettings.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.onSetup = _this.onSetup.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.onFocus = _this.onFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.onChange = _this.onChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.onNodeChange = _this.onNodeChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.onDeleteKeyDown = _this.onDeleteKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.onHorizontalNavigationKeyDown = _this.onHorizontalNavigationKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.onKeyDown = _this.onKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.onKeyUp = _this.onKeyUp.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.onPropagateUndo = _this.onPropagateUndo.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.onPaste = _this.onPaste.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.onCreateUndoLevel = _this.onCreateUndoLevel.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.setFocusedElement = _this.setFocusedElement.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.onInput = _this.onInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.onSelectionChange = _this.onSelectionChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.getRecord = _this.getRecord.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.createRecord = _this.createRecord.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.applyRecord = _this.applyRecord.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.isEmpty = _this.isEmpty.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.valueToFormat = _this.valueToFormat.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.setRef = _this.setRef.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.isActive = _this.isActive.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))); _this.formatToValue = memize__WEBPACK_IMPORTED_MODULE_14___default()(_this.formatToValue.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_10__["default"])(_this))), { size: 1 }); _this.savedContent = value; _this.containerRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createRef"])(); _this.patterns = Object(_patterns__WEBPACK_IMPORTED_MODULE_31__["getPatterns"])({ onReplace: onReplace, multiline: multiline }); _this.enterPatterns = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__["getBlockTransforms"])('from').filter(function (_ref2) { var type = _ref2.type, trigger = _ref2.trigger; return type === 'pattern' && trigger === 'enter'; }); _this.state = {}; _this.usedDeprecatedChildrenSource = Array.isArray(value); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_6__["default"])(RichText, [{ key: "componentDidMount", value: function componentDidMount() { document.addEventListener('selectionchange', this.onSelectionChange); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { document.removeEventListener('selectionchange', this.onSelectionChange); } }, { key: "setRef", value: function setRef(node) { this.editableRef = node; } }, { key: "isActive", value: function isActive() { return this.editableRef === document.activeElement; } /** * Retrieves the settings for this block. * * Allows passing in settings which will be overwritten. * * @param {Object} settings The settings to overwrite. * @return {Object} The settings for this block. */ }, { key: "getSettings", value: function getSettings(settings) { settings = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_4__["default"])({}, settings, { forced_root_block: this.props.multiline || false, // Allow TinyMCE to keep one undo level for comparing changes. // Prevent it otherwise from accumulating any history. custom_undo_redo_levels: 1 }); var unstableGetSettings = this.props.unstableGetSettings; if (unstableGetSettings) { settings = unstableGetSettings(settings); } return settings; } /** * Handles the onSetup event for the TinyMCE component. * * Will setup event handlers for the TinyMCE instance. * An `onSetup` function in the props will be called if it is present. * * @param {tinymce} editor The editor instance as passed by TinyMCE. */ }, { key: "onSetup", value: function onSetup(editor) { this.editor = editor; editor.on('init', this.onInit); editor.on('nodechange', this.onNodeChange); editor.on('keydown', this.onKeyDown); editor.on('keyup', this.onKeyUp); editor.on('BeforeExecCommand', this.onPropagateUndo); editor.on('focus', this.onFocus); // The change event in TinyMCE fires every time an undo level is added. editor.on('change', this.onCreateUndoLevel); var unstableOnSetup = this.props.unstableOnSetup; if (unstableOnSetup) { unstableOnSetup(editor); } } }, { key: "setFocusedElement", value: function setFocusedElement() { if (this.props.setFocusedElement) { this.props.setFocusedElement(this.props.instanceId); } } }, { key: "onInit", value: function onInit() { this.editor.shortcuts.add(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["rawShortcut"].primary('z'), '', 'Undo'); this.editor.shortcuts.add(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["rawShortcut"].primaryShift('z'), '', 'Redo'); // Remove TinyMCE Core shortcut for consistency with global editor // shortcuts. Also clashes with Mac browsers. this.editor.shortcuts.remove('meta+y', '', 'Redo'); } /** * Handles an undo event from TinyMCE. * * @param {UndoEvent} event The undo event as triggered by TinyMCE. */ }, { key: "onPropagateUndo", value: function onPropagateUndo(event) { var _this$props = this.props, onUndo = _this$props.onUndo, onRedo = _this$props.onRedo; var command = event.command; if (command === 'Undo' && onUndo) { Object(lodash__WEBPACK_IMPORTED_MODULE_13__["defer"])(onUndo); event.preventDefault(); } if (command === 'Redo' && onRedo) { Object(lodash__WEBPACK_IMPORTED_MODULE_13__["defer"])(onRedo); event.preventDefault(); } } /** * Get the current record (value and selection) from props and state. * * @return {Object} The current record (value and selection). */ }, { key: "getRecord", value: function getRecord() { var _this$formatToValue = this.formatToValue(this.props.value), formats = _this$formatToValue.formats, text = _this$formatToValue.text; var _this$state = this.state, start = _this$state.start, end = _this$state.end; return { formats: formats, text: text, start: start, end: end }; } }, { key: "createRecord", value: function createRecord() { var multiline = this.props.multiline; var range = window.getSelection().getRangeAt(0); return Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["create"])({ element: this.editableRef, range: range, multilineTag: multiline, removeNode: function removeNode(node) { return node.getAttribute('data-mce-bogus') === 'all'; }, unwrapNode: function unwrapNode(node) { return !!node.getAttribute('data-mce-bogus'); }, removeAttribute: function removeAttribute(attribute) { return attribute.indexOf('data-mce-') === 0; }, filterString: function filterString(string) { return string.replace(TINYMCE_ZWSP, ''); } }); } }, { key: "applyRecord", value: function applyRecord(record) { var multiline = this.props.multiline; Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["apply"])(record, this.editableRef, multiline); } }, { key: "isEmpty", value: function isEmpty() { return Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["isEmpty"])(this.formatToValue(this.props.value)); } /** * Handles a paste event from TinyMCE. * * Saves the pasted data as plain text in `pastedPlainText`. * * @param {PasteEvent} event The paste event as triggered by TinyMCE. */ }, { key: "onPaste", value: function onPaste(event) { var _this2 = this; var clipboardData = event.clipboardData; var items = clipboardData.items, files = clipboardData.files; // In Edge these properties can be null instead of undefined, so a more // rigorous test is required over using default values. items = Object(lodash__WEBPACK_IMPORTED_MODULE_13__["isNil"])(items) ? [] : items; files = Object(lodash__WEBPACK_IMPORTED_MODULE_13__["isNil"])(files) ? [] : files; var item = Object(lodash__WEBPACK_IMPORTED_MODULE_13__["find"])(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(items).concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(files)), function (_ref3) { var type = _ref3.type; return /^image\/(?:jpe?g|png|gif)$/.test(type); }); var plainText = ''; var html = ''; // IE11 only supports `Text` as an argument for `getData` and will // otherwise throw an invalid argument error, so we try the standard // arguments first, then fallback to `Text` if they fail. try { plainText = clipboardData.getData('text/plain'); html = clipboardData.getData('text/html'); } catch (error1) { try { html = clipboardData.getData('Text'); } catch (error2) { // Some browsers like UC Browser paste plain text by default and // don't support clipboardData at all, so allow default // behaviour. return; } } event.preventDefault(); // Allows us to ask for this information when we get a report. window.console.log('Received HTML:\n\n', html); window.console.log('Received plain text:\n\n', plainText); // Only process file if no HTML is present. // Note: a pasted file may have the URL as plain text. if (item && !html) { var file = item.getAsFile ? item.getAsFile() : item; var _content = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__["rawHandler"])({ HTML: ""), mode: 'BLOCKS', tagName: this.props.tagName }); var _shouldReplace = this.props.onReplace && this.isEmpty(); // Allows us to ask for this information when we get a report. window.console.log('Received item:\n\n', file); if (_shouldReplace) { // Necessary to allow the paste bin to be removed without errors. this.props.setTimeout(function () { return _this2.props.onReplace(_content); }); } else if (this.props.onSplit) { // Necessary to get the right range. // Also done in the TinyMCE paste plugin. this.props.setTimeout(function () { return _this2.splitContent(_content); }); } return; } // There is a selection, check if a URL is pasted. if (!this.editor.selection.isCollapsed()) { var pastedText = (html || plainText).replace(/<[^>]+>/g, '').trim(); // A URL was pasted, turn the selection into a link if (Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_22__["isURL"])(pastedText)) { this.onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["applyFormat"])(this.getRecord(), { type: 'a', attributes: { href: Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_24__["decodeEntities"])(pastedText) } })); // Allows us to ask for this information when we get a report. window.console.log('Created link:\n\n', pastedText); return; } } var shouldReplace = this.props.onReplace && this.isEmpty(); var mode = 'INLINE'; if (shouldReplace) { mode = 'BLOCKS'; } else if (this.props.onSplit) { mode = 'AUTO'; } var content = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__["rawHandler"])({ HTML: html, plainText: plainText, mode: mode, tagName: this.props.tagName, canUserUseUnfilteredHTML: this.props.canUserUseUnfilteredHTML }); if (typeof content === 'string') { var recordToInsert = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["create"])({ html: content }); this.onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["insert"])(this.getRecord(), recordToInsert)); } else if (this.props.onSplit) { if (!content.length) { return; } if (shouldReplace) { this.props.onReplace(content); } else { this.splitContent(content, { paste: true }); } } } /** * Handles a focus event on the contenteditable field, calling the * `unstableOnFocus` prop callback if one is defined. The callback does not * receive any arguments. * * This is marked as a private API and the `unstableOnFocus` prop is not * documented, as the current requirements where it is used are subject to * future refactoring following `isSelected` handling. * * In contrast with `setFocusedElement`, this is only triggered in response * to focus within the contenteditable field, whereas `setFocusedElement` * is triggered on focus within any `RichText` descendent element. * * @see setFocusedElement * * @private */ }, { key: "onFocus", value: function onFocus() { var unstableOnFocus = this.props.unstableOnFocus; if (unstableOnFocus) { unstableOnFocus(); } } /** * Handle input on the next selection change event. */ }, { key: "onInput", value: function onInput() { var record = this.createRecord(); var transformed = this.patterns.reduce(function (accumlator, transform) { return transform(accumlator); }, record); // Don't apply changes if there's no transform. Content will be up to // date. In the future we could always let it flow back in the live DOM // if there are no performance issues. this.onChange(transformed, record === transformed); } /** * Handles the `selectionchange` event: sync the selection to local state. */ }, { key: "onSelectionChange", value: function onSelectionChange() { // Ensure it's the active element. This is a global event. if (!this.isActive()) { return; } var _this$createRecord = this.createRecord(), start = _this$createRecord.start, end = _this$createRecord.end; if (start !== this.state.start || end !== this.state.end) { this.setState({ start: start, end: end }); } } /** * Sync the value to global state. The node tree and selection will also be * updated if differences are found. * * @param {Object} record The record to sync and apply. * @param {boolean} _withoutApply If true, the record won't be applied to * the live DOM. */ }, { key: "onChange", value: function onChange(record, _withoutApply) { if (!_withoutApply) { this.applyRecord(record); } var start = record.start, end = record.end; this.savedContent = this.valueToFormat(record); this.props.onChange(this.savedContent); this.setState({ start: start, end: end }); } }, { key: "onCreateUndoLevel", value: function onCreateUndoLevel(event) { // TinyMCE fires a `change` event when the first letter in an instance // is typed. This should not create a history record in Gutenberg. // https://github.com/tinymce/tinymce/blob/4.7.11/src/core/main/ts/api/UndoManager.ts#L116-L125 // In other cases TinyMCE won't fire a `change` with at least a previous // record present, so this is a reliable check. // https://github.com/tinymce/tinymce/blob/4.7.11/src/core/main/ts/api/UndoManager.ts#L272-L275 if (event && event.lastLevel === null) { return; } // Always ensure the content is up-to-date. This is needed because e.g. // making something bold will trigger a TinyMCE change event but no // input event. Avoid dispatching an action if the original event is // blur because the content will already be up-to-date. if (!event || !event.originalEvent || event.originalEvent.type !== 'blur') { this.onChange(this.createRecord(), true); } this.props.onCreateUndoLevel(); } /** * Handles a delete keyDown event to handle merge or removal for collapsed * selection where caret is at directional edge: forward for a delete key, * reverse for a backspace key. * * @link https://en.wikipedia.org/wiki/Caret_navigation * * @param {tinymce.EditorEvent} event Keydown event. */ }, { key: "onDeleteKeyDown", value: function onDeleteKeyDown(event) { var _this$props2 = this.props, onMerge = _this$props2.onMerge, onRemove = _this$props2.onRemove; if (!onMerge && !onRemove) { return; } var keyCode = event.keyCode; var isReverse = keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["BACKSPACE"]; var _getSelection = getSelection(), isCollapsed = _getSelection.isCollapsed; // Only process delete if the key press occurs at uncollapsed edge. if (!isCollapsed) { return; } var empty = this.isEmpty(); // It is important to consider emptiness because an empty container // will include a bogus TinyMCE BR node _after_ the caret, so in a // forward deletion the isHorizontalEdge function will incorrectly // interpret the presence of the bogus node as not being at the edge. var isEdge = empty || Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_15__["isHorizontalEdge"])(this.editableRef, isReverse); if (!isEdge) { return; } if (onMerge) { onMerge(!isReverse); } // Only handle remove on Backspace. This serves dual-purpose of being // an intentional user interaction distinguishing between Backspace and // Delete to remove the empty field, but also to avoid merge & remove // causing destruction of two fields (merge, then removed merged). if (onRemove && empty && isReverse) { onRemove(!isReverse); } event.preventDefault(); // Calling onMerge() or onRemove() will destroy the editor, so it's // important that we stop other handlers (e.g. ones registered by // TinyMCE) from also handling this event. event.stopImmediatePropagation(); } /** * Handles a horizontal navigation key down event to handle the case where * TinyMCE attempts to preventDefault when on the outside edge of an inline * boundary when arrowing _away_ from the boundary, not within it. Replaces * the TinyMCE event `preventDefault` behavior with a noop, such that those * relying on `defaultPrevented` are not misinformed about the arrow event. * * If TinyMCE#4476 is resolved, this handling may be removed. * * @see https://github.com/tinymce/tinymce/issues/4476 * * @param {tinymce.EditorEvent} event Keydown event. */ }, { key: "onHorizontalNavigationKeyDown", value: function onHorizontalNavigationKeyDown(event) { var _getSelection2 = getSelection(), focusNode = _getSelection2.focusNode; var nodeType = focusNode.nodeType, nodeValue = focusNode.nodeValue; if (nodeType !== Node.TEXT_NODE) { return; } if (nodeValue.length !== 1 || nodeValue[0] !== TINYMCE_ZWSP) { return; } var keyCode = event.keyCode; // Consider to be moving away from inline boundary based on: // // 1. Within a text fragment consisting only of ZWSP. // 2. If in reverse, there is no previous sibling. If forward, there is // no next sibling (i.e. end of node). var isReverse = keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["LEFT"]; var edgeSibling = isReverse ? 'previousSibling' : 'nextSibling'; if (!focusNode[edgeSibling]) { // Note: This is not reassigning on the native event, rather the // "fixed" TinyMCE copy, which proxies its preventDefault to the // native event. By reassigning here, we're effectively preventing // the proxied call on the native event, but not otherwise mutating // the original event object. event.preventDefault = lodash__WEBPACK_IMPORTED_MODULE_13__["noop"]; } } /** * Handles a keydown event from TinyMCE. * * @param {KeydownEvent} event The keydown event as triggered by TinyMCE. */ }, { key: "onKeyDown", value: function onKeyDown(event) { var keyCode = event.keyCode; var isDelete = keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["DELETE"] || keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["BACKSPACE"]; if (isDelete) { this.onDeleteKeyDown(event); } var isHorizontalNavigation = keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["LEFT"] || keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["RIGHT"]; if (isHorizontalNavigation) { this.onHorizontalNavigationKeyDown(event); } // If we click shift+Enter on inline RichTexts, we avoid creating two contenteditables // We also split the content and call the onSplit prop if provided. if (keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["ENTER"]) { event.preventDefault(); if (this.props.onReplace) { var text = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["getTextContent"])(this.getRecord()); var transformation = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__["findTransform"])(this.enterPatterns, function (item) { return item.regExp.test(text); }); if (transformation) { // Calling onReplace() will destroy the editor, so it's // important that we stop other handlers (e.g. ones // registered by TinyMCE) from also handling this event. event.stopImmediatePropagation(); this.props.onReplace([transformation.transform({ content: text })]); return; } } if (this.props.multiline) { var record = this.getRecord(); if (this.props.onSplit && Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["isEmptyLine"])(record)) { var _this$props3; (_this$props3 = this.props).onSplit.apply(_this$props3, Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["split"])(record).map(this.valueToFormat))); } else { // Character is used to separate lines in multiline values. this.onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["insert"])(record, "\u2028")); } } else if (event.shiftKey || !this.props.onSplit) { var _record = this.getRecord(); var _text = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["getTextContent"])(_record); var length = _text.length; var toInsert = '\n'; // If the caret is at the end of the text, and there is no // trailing line break or no text at all, we have to insert two // line breaks in order to create a new line visually and place // the caret there. if (_record.end === length && (_text.charAt(length - 1) !== '\n' || length === 0)) { toInsert = '\n\n'; } this.onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["insert"])(this.getRecord(), toInsert)); } else { this.splitContent(); } } } /** * Handles TinyMCE key up event. * * @param {number} keyCode The key code that has been pressed on the keyboard. */ }, { key: "onKeyUp", value: function onKeyUp(_ref4) { var keyCode = _ref4.keyCode; // The input event does not fire when the whole field is selected and // BACKSPACE is pressed. if (keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["BACKSPACE"]) { this.onChange(this.createRecord(), true); } // `scrollToRect` is called on `nodechange`, whereas calling it on // `keyup` *when* moving to a new RichText element results in incorrect // scrolling. Though the following allows false positives, it results // in much smoother scrolling. if (this.props.isViewportSmall && keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["BACKSPACE"] && keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_17__["ENTER"]) { this.scrollToRect(Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_15__["getRectangleFromRange"])(this.editor.selection.getRng())); } } }, { key: "scrollToRect", value: function scrollToRect(rect) { var caretTop = rect.top; var container = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_15__["getScrollContainer"])(this.editableRef); if (!container) { return; } // When scrolling, avoid positioning the caret at the very top of // the viewport, providing some "air" and some textual context for // the user, and avoiding toolbars. var graceOffset = 100; // Avoid pointless scrolling by establishing a threshold under // which scrolling should be skipped; var epsilon = 10; var delta = caretTop - graceOffset; if (Math.abs(delta) > epsilon) { container.scrollTo(container.scrollLeft, container.scrollTop + delta); } } /** * Splits the content at the location of the selection. * * Replaces the content of the editor inside this element with the contents * before the selection. Sends the elements after the selection to the `onSplit` * handler. * * @param {Array} blocks The blocks to add after the split point. * @param {Object} context The context for splitting. */ }, { key: "splitContent", value: function splitContent() { var blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var onSplit = this.props.onSplit; var record = this.createRecord(); if (!onSplit) { return; } var _split = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["split"])(record), _split2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_split, 2), before = _split2[0], after = _split2[1]; // In case split occurs at the trailing or leading edge of the field, // assume that the before/after values respectively reflect the current // value. This also provides an opportunity for the parent component to // determine whether the before/after value has changed using a trivial // strict equality operation. if (Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["isEmpty"])(after)) { before = record; } else if (Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["isEmpty"])(before)) { after = record; } // If pasting and the split would result in no content other than the // pasted blocks, remove the before and after blocks. if (context.paste) { before = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["isEmpty"])(before) ? null : before; after = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["isEmpty"])(after) ? null : after; } if (before) { before = this.valueToFormat(before); } if (after) { after = this.valueToFormat(after); } onSplit.apply(void 0, [before, after].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(blocks))); } }, { key: "onNodeChange", value: function onNodeChange(_ref5) { var parents = _ref5.parents; if (!this.isActive()) { return; } if (this.props.isViewportSmall) { var rect; var selectedAnchor = Object(lodash__WEBPACK_IMPORTED_MODULE_13__["find"])(parents, function (node) { return node.tagName === 'A'; }); if (selectedAnchor) { // If we selected a link, position the Link UI below the link rect = selectedAnchor.getBoundingClientRect(); } else { // Otherwise, position the Link UI below the cursor or text selection rect = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_15__["getRectangleFromRange"])(this.editor.selection.getRng()); } // Originally called on `focusin`, that hook turned out to be // premature. On `nodechange` we can work with the finalized TinyMCE // instance and scroll to proper position. this.scrollToRect(rect); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this$props4 = this.props, tagName = _this$props4.tagName, value = _this$props4.value; if (tagName === prevProps.tagName && value !== prevProps.value && value !== this.savedContent) { // Handle deprecated `children` and `node` sources. // The old way of passing a value with the `node` matcher required // the value to be mapped first, creating a new array each time, so // a shallow check wouldn't work. We need to check deep equality. // This is only executed for a deprecated API and will eventually be // removed. if (Array.isArray(value) && Object(lodash__WEBPACK_IMPORTED_MODULE_13__["isEqual"])(value, this.savedContent)) { return; } var record = this.formatToValue(value); if (this.isActive()) { var prevRecord = this.formatToValue(prevProps.value); var length = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["getTextContent"])(prevRecord).length; record.start = length; record.end = length; } this.applyRecord(record); this.savedContent = value; } } }, { key: "formatToValue", value: function formatToValue(value) { var _this$props5 = this.props, format = _this$props5.format, multiline = _this$props5.multiline; // Handle deprecated `children` and `node` sources. if (Array.isArray(value)) { return Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["create"])({ html: _wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__["children"].toHTML(value), multilineTag: multiline }); } if (format === 'string') { return Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["create"])({ html: value, multilineTag: multiline }); } // Guard for blocks passing `null` in onSplit callbacks. May be removed // if onSplit is revised to not pass a `null` value. if (value === null) { return Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["create"])(); } return value; } }, { key: "valueToFormat", value: function valueToFormat(_ref6) { var formats = _ref6.formats, text = _ref6.text; var _this$props6 = this.props, format = _this$props6.format, multiline = _this$props6.multiline; // Handle deprecated `children` and `node` sources. if (this.usedDeprecatedChildrenSource) { return _wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__["children"].fromDOM(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["unstableToDom"])({ formats: formats, text: text }, multiline).body.childNodes); } if (format === 'string') { return Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_23__["toHTMLString"])({ formats: formats, text: text }, multiline); } return { formats: formats, text: text }; } }, { key: "render", value: function render() { var _this3 = this; var _this$props7 = this.props, _this$props7$tagName = _this$props7.tagName, Tagname = _this$props7$tagName === void 0 ? 'div' : _this$props7$tagName, style = _this$props7.style, value = _this$props7.value, wrapperClassName = _this$props7.wrapperClassName, className = _this$props7.className, _this$props7$inlineTo = _this$props7.inlineToolbar, inlineToolbar = _this$props7$inlineTo === void 0 ? false : _this$props7$inlineTo, formattingControls = _this$props7.formattingControls, placeholder = _this$props7.placeholder, MultilineTag = _this$props7.multiline, _this$props7$keepPlac = _this$props7.keepPlaceholderOnFocus, keepPlaceholderOnFocus = _this$props7$keepPlac === void 0 ? false : _this$props7$keepPlac, isSelected = _this$props7.isSelected, autocompleters = _this$props7.autocompleters; var ariaProps = Object(_aria__WEBPACK_IMPORTED_MODULE_30__["pickAriaProps"])(this.props); // Generating a key that includes `tagName` ensures that if the tag // changes, we unmount and destroy the previous TinyMCE element, then // mount and initialize a new child element in its place. var key = ['editor', Tagname].join(); var isPlaceholderVisible = placeholder && (!isSelected || keepPlaceholderOnFocus) && this.isEmpty(); var classes = classnames__WEBPACK_IMPORTED_MODULE_12___default()(wrapperClassName, 'editor-rich-text'); var record = this.getRecord(); var formatToolbar = this.editor && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(_format_toolbar__WEBPACK_IMPORTED_MODULE_28__["default"], { record: record, onChange: this.onChange, enabledControls: formattingControls, editor: this.editor }); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])("div", { className: classes, ref: this.containerRef, onFocus: this.setFocusedElement }, isSelected && !inlineToolbar && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(_block_format_controls__WEBPACK_IMPORTED_MODULE_26__["default"], null, formatToolbar), isSelected && inlineToolbar && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])("div", { className: "editor-rich-text__inline-toolbar" }, formatToolbar), isSelected && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(_tokens_ui__WEBPACK_IMPORTED_MODULE_33__["default"], { editor: this.editor, containerRef: this.containerRef }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(_autocomplete__WEBPACK_IMPORTED_MODULE_25__["default"], { onReplace: this.props.onReplace, completers: autocompleters, record: record, onChange: this.onChange }, function (_ref7) { var isExpanded = _ref7.isExpanded, listBoxId = _ref7.listBoxId, activeId = _ref7.activeId; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(_tinymce__WEBPACK_IMPORTED_MODULE_29__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({ tagName: Tagname, getSettings: _this3.getSettings, onSetup: _this3.onSetup, style: style, defaultValue: value, isPlaceholderVisible: isPlaceholderVisible, "aria-label": placeholder, "aria-autocomplete": "list", "aria-expanded": isExpanded, "aria-owns": listBoxId, "aria-activedescendant": activeId }, ariaProps, { className: className, key: key, onPaste: _this3.onPaste, onInput: _this3.onInput, multilineTag: MultilineTag, setRef: _this3.setRef })), isPlaceholderVisible && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(Tagname, { className: classnames__WEBPACK_IMPORTED_MODULE_12___default()('editor-rich-text__tinymce', className), style: style }, MultilineTag ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(MultilineTag, null, placeholder) : placeholder), isSelected && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_18__["Slot"], { name: "RichText.Siblings" })); })); } }]); return RichText; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["Component"]); RichText.defaultProps = { formattingControls: _formatting_controls__WEBPACK_IMPORTED_MODULE_27__["FORMATTING_CONTROLS"].map(function (_ref8) { var format = _ref8.format; return format; }), format: 'string', value: '' }; var RichTextContainer = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_21__["compose"])([_wordpress_compose__WEBPACK_IMPORTED_MODULE_21__["withInstanceId"], Object(_block_edit_context__WEBPACK_IMPORTED_MODULE_32__["withBlockEditContext"])(function (context, ownProps) { // When explicitly set as not selected, do nothing. if (ownProps.isSelected === false) { return {}; } // When explicitly set as selected, use the value stored in the context instead. if (ownProps.isSelected === true) { return { isSelected: context.isSelected }; } // Ensures that only one RichText component can be focused. return { isSelected: context.isSelected && context.focusedElement === ownProps.instanceId, setFocusedElement: context.setFocusedElement }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_19__["withSelect"])(function (select) { var _ref9 = select('core/viewport') || {}, _ref9$isViewportMatch = _ref9.isViewportMatch, isViewportMatch = _ref9$isViewportMatch === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_13__["identity"] : _ref9$isViewportMatch; var _select = select('core/editor'), canUserUseUnfilteredHTML = _select.canUserUseUnfilteredHTML; return { isViewportSmall: isViewportMatch('< small'), canUserUseUnfilteredHTML: canUserUseUnfilteredHTML() }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_19__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/editor'), createUndoLevel = _dispatch.createUndoLevel, redo = _dispatch.redo, undo = _dispatch.undo; return { onCreateUndoLevel: createUndoLevel, onRedo: redo, onUndo: undo }; }), _wordpress_compose__WEBPACK_IMPORTED_MODULE_21__["withSafeTimeout"]])(RichText); RichTextContainer.Content = function (_ref10) { var value = _ref10.value, Tag = _ref10.tagName, MultilineTag = _ref10.multiline, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref10, ["value", "tagName", "multiline"]); var html = value; // Handle deprecated `children` and `node` sources. if (Array.isArray(value)) { html = _wordpress_blocks__WEBPACK_IMPORTED_MODULE_20__["children"].toHTML(value); } if (!html && MultilineTag) { html = "<".concat(MultilineTag, ">"); } var content = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["RawHTML"], null, html); if (Tag) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["createElement"])(Tag, Object(lodash__WEBPACK_IMPORTED_MODULE_13__["omit"])(props, ['format']), content); } return content; }; RichTextContainer.isEmpty = function () { var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; // Handle deprecated `children` and `node` sources. if (Array.isArray(value)) { return !value || value.length === 0; } return value.length === 0; }; RichTextContainer.Content.defaultProps = { format: 'string', value: '' }; /* harmony default export */ __webpack_exports__["default"] = (RichTextContainer); /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/patterns.js": /*!**************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/patterns.js ***! \**************************************************************************************/ /*! exports provided: getPatterns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPatterns", function() { return getPatterns; }); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__); /** * External dependencies */ /** * WordPress dependencies */ function getPatterns(_ref) { var onReplace = _ref.onReplace, multiline = _ref.multiline; var patterns = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["filter"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__["getBlockTransforms"])('from'), function (_ref2) { var type = _ref2.type, trigger = _ref2.trigger; return type === 'pattern' && trigger === undefined; }); return [function (record) { if (!onReplace) { return record; } var text = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["getTextContent"])(record); var transformation = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__["findTransform"])(patterns, function (item) { return item.regExp.test(text); }); if (!transformation) { return record; } var result = text.match(transformation.regExp); var block = transformation.transform({ content: Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["remove"])(record, 0, result[0].length), match: result }); onReplace([block]); return record; }, function (record) { if (multiline) { return record; } var text = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["getTextContent"])(record); // Quick check the text for the necessary character. if (text.indexOf('`') === -1) { return record; } var match = text.match(/`([^`]+)`/); if (!match) { return record; } var start = match.index; var end = start + match[1].length; record = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["remove"])(record, start, start + 1); record = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["remove"])(record, end, end + 1); record = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["applyFormat"])(record, { type: 'code' }, start, end); return record; }]; } /***/ }), /***/ "./node_modules/@wordpress/editor/build-module/components/rich-text/tinymce.js": /*!*************************************************************************************!*\ !*** ./node_modules/@wordpress/editor/build-module/components/rich-text/tinymce.js ***! \*************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TinyMCE; }); /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var tinymce__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! tinymce */ "tinymce"); /* harmony import */ var tinymce__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(tinymce__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var _aria__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./aria */ "./node_modules/@wordpress/editor/build-module/components/rich-text/aria.js"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Determines whether we need a fix to provide `input` events for contenteditable. * * @param {Element} editorNode The root editor node. * * @return {boolean} A boolean indicating whether the fix is needed. */ function needsInternetExplorerInputFix(editorNode) { return (// Rely on userAgent in the absence of a reasonable feature test for contenteditable `input` events. /Trident/.test(window.navigator.userAgent) && // IE11 dispatches input events for `` and `