mirror of
https://github.com/WordPress/WordPress.git
synced 2024-06-25 06:14:58 +02:00
Scripts: Add a missing date format to the wp-date
config.
`wp-date` recently added the `datetimeAbbreviated` format, but the config wasn't sending it on page load. Fixes #45158. Built from https://develop.svn.wordpress.org/branches/5.0@43818 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f99db02983
commit
50ef6331e7
268
wp-includes/js/dist/a11y.js
vendored
Normal file
268
wp-includes/js/dist/a11y.js
vendored
Normal file
|
@ -0,0 +1,268 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["a11y"] =
|
||||||
|
/******/ (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/a11y/build-module/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/a11y/build-module/addContainer.js":
|
||||||
|
/*!*******************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/a11y/build-module/addContainer.js ***!
|
||||||
|
\*******************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Build the live regions markup.
|
||||||
|
*
|
||||||
|
* @param {string} ariaLive Optional. Value for the 'aria-live' attribute, default 'polite'.
|
||||||
|
*
|
||||||
|
* @return {Object} $container The ARIA live region jQuery object.
|
||||||
|
*/
|
||||||
|
var addContainer = function addContainer(ariaLive) {
|
||||||
|
ariaLive = ariaLive || 'polite';
|
||||||
|
var container = document.createElement('div');
|
||||||
|
container.id = 'a11y-speak-' + ariaLive;
|
||||||
|
container.className = 'a11y-speak-region';
|
||||||
|
container.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;');
|
||||||
|
container.setAttribute('aria-live', ariaLive);
|
||||||
|
container.setAttribute('aria-relevant', 'additions text');
|
||||||
|
container.setAttribute('aria-atomic', 'true');
|
||||||
|
document.querySelector('body').appendChild(container);
|
||||||
|
return container;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (addContainer);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/a11y/build-module/clear.js":
|
||||||
|
/*!************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/a11y/build-module/clear.js ***!
|
||||||
|
\************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Clear the a11y-speak-region elements.
|
||||||
|
*/
|
||||||
|
var clear = function clear() {
|
||||||
|
var regions = document.querySelectorAll('.a11y-speak-region');
|
||||||
|
|
||||||
|
for (var i = 0; i < regions.length; i++) {
|
||||||
|
regions[i].textContent = '';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (clear);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/a11y/build-module/filterMessage.js":
|
||||||
|
/*!********************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/a11y/build-module/filterMessage.js ***!
|
||||||
|
\********************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
var previousMessage = '';
|
||||||
|
/**
|
||||||
|
* Filter the message to be announced to the screenreader.
|
||||||
|
*
|
||||||
|
* @param {string} message The message to be announced.
|
||||||
|
*
|
||||||
|
* @return {string} The filtered message.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var filterMessage = function filterMessage(message) {
|
||||||
|
/*
|
||||||
|
* Strip HTML tags (if any) from the message string. Ideally, messages should
|
||||||
|
* be simple strings, carefully crafted for specific use with A11ySpeak.
|
||||||
|
* When re-using already existing strings this will ensure simple HTML to be
|
||||||
|
* stripped out and replaced with a space. Browsers will collapse multiple
|
||||||
|
* spaces natively.
|
||||||
|
*/
|
||||||
|
message = message.replace(/<[^<>]+>/g, ' ');
|
||||||
|
|
||||||
|
if (previousMessage === message) {
|
||||||
|
message += "\xA0";
|
||||||
|
}
|
||||||
|
|
||||||
|
previousMessage = message;
|
||||||
|
return message;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (filterMessage);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/a11y/build-module/index.js":
|
||||||
|
/*!************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/a11y/build-module/index.js ***!
|
||||||
|
\************************************************************/
|
||||||
|
/*! exports provided: setup, speak */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setup", function() { return setup; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "speak", function() { return speak; });
|
||||||
|
/* harmony import */ var _addContainer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addContainer */ "./node_modules/@wordpress/a11y/build-module/addContainer.js");
|
||||||
|
/* harmony import */ var _clear__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clear */ "./node_modules/@wordpress/a11y/build-module/clear.js");
|
||||||
|
/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready");
|
||||||
|
/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
|
/* harmony import */ var _filterMessage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./filterMessage */ "./node_modules/@wordpress/a11y/build-module/filterMessage.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the live regions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var setup = function setup() {
|
||||||
|
var containerPolite = document.getElementById('a11y-speak-polite');
|
||||||
|
var containerAssertive = document.getElementById('a11y-speak-assertive');
|
||||||
|
|
||||||
|
if (containerPolite === null) {
|
||||||
|
containerPolite = Object(_addContainer__WEBPACK_IMPORTED_MODULE_0__["default"])('polite');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (containerAssertive === null) {
|
||||||
|
containerAssertive = Object(_addContainer__WEBPACK_IMPORTED_MODULE_0__["default"])('assertive');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Run setup on domReady.
|
||||||
|
*/
|
||||||
|
|
||||||
|
_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2___default()(setup);
|
||||||
|
/**
|
||||||
|
* Update the ARIA live notification area text node.
|
||||||
|
*
|
||||||
|
* @param {string} message The message to be announced by Assistive Technologies.
|
||||||
|
* @param {string} ariaLive Optional. The politeness level for aria-live. Possible values:
|
||||||
|
* polite or assertive. Default polite.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var speak = function speak(message, ariaLive) {
|
||||||
|
// Clear previous messages to allow repeated strings being read out.
|
||||||
|
Object(_clear__WEBPACK_IMPORTED_MODULE_1__["default"])();
|
||||||
|
message = Object(_filterMessage__WEBPACK_IMPORTED_MODULE_3__["default"])(message);
|
||||||
|
var containerPolite = document.getElementById('a11y-speak-polite');
|
||||||
|
var containerAssertive = document.getElementById('a11y-speak-assertive');
|
||||||
|
|
||||||
|
if (containerAssertive && 'assertive' === ariaLive) {
|
||||||
|
containerAssertive.textContent = message;
|
||||||
|
} else if (containerPolite) {
|
||||||
|
containerPolite.textContent = message;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/dom-ready":
|
||||||
|
/*!*******************************************!*\
|
||||||
|
!*** external {"this":["wp","domReady"]} ***!
|
||||||
|
\*******************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["domReady"]; }());
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=a11y.js.map
|
1
wp-includes/js/dist/a11y.js.map
vendored
Normal file
1
wp-includes/js/dist/a11y.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
890
wp-includes/js/dist/api-fetch.js
vendored
Normal file
890
wp-includes/js/dist/api-fetch.js
vendored
Normal file
|
@ -0,0 +1,890 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["apiFetch"] =
|
||||||
|
/******/ (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/api-fetch/build-module/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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/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/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/@wordpress/api-fetch/build-module/index.js":
|
||||||
|
/*!*****************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/api-fetch/build-module/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_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
|
||||||
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
|
||||||
|
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
||||||
|
/* harmony import */ var _wordpress_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 _middlewares_nonce__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./middlewares/nonce */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/nonce.js");
|
||||||
|
/* harmony import */ var _middlewares_root_url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./middlewares/root-url */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/root-url.js");
|
||||||
|
/* harmony import */ var _middlewares_preloading__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./middlewares/preloading */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/preloading.js");
|
||||||
|
/* harmony import */ var _middlewares_fetch_all_middleware__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./middlewares/fetch-all-middleware */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/fetch-all-middleware.js");
|
||||||
|
/* harmony import */ var _middlewares_namespace_endpoint__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./middlewares/namespace-endpoint */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js");
|
||||||
|
/* harmony import */ var _middlewares_http_v1__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./middlewares/http-v1 */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/http-v1.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var middlewares = [];
|
||||||
|
|
||||||
|
function registerMiddleware(middleware) {
|
||||||
|
middlewares.push(middleware);
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkCloudflareError(error) {
|
||||||
|
if (typeof error === 'string' && error.indexOf('Cloudflare Ray ID') >= 0) {
|
||||||
|
throw {
|
||||||
|
code: 'cloudflare_error'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function apiFetch(options) {
|
||||||
|
var raw = function raw(nextOptions) {
|
||||||
|
var url = nextOptions.url,
|
||||||
|
path = nextOptions.path,
|
||||||
|
body = nextOptions.body,
|
||||||
|
data = nextOptions.data,
|
||||||
|
_nextOptions$parse = nextOptions.parse,
|
||||||
|
parse = _nextOptions$parse === void 0 ? true : _nextOptions$parse,
|
||||||
|
remainingOptions = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__["default"])(nextOptions, ["url", "path", "body", "data", "parse"]);
|
||||||
|
|
||||||
|
var headers = remainingOptions.headers || {};
|
||||||
|
|
||||||
|
if (!headers['Content-Type'] && data) {
|
||||||
|
headers['Content-Type'] = 'application/json';
|
||||||
|
}
|
||||||
|
|
||||||
|
var responsePromise = window.fetch(url || path, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, remainingOptions, {
|
||||||
|
credentials: 'include',
|
||||||
|
body: body || JSON.stringify(data),
|
||||||
|
headers: headers
|
||||||
|
}));
|
||||||
|
|
||||||
|
var checkStatus = function checkStatus(response) {
|
||||||
|
if (response.status >= 200 && response.status < 300) {
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw response;
|
||||||
|
};
|
||||||
|
|
||||||
|
var parseResponse = function parseResponse(response) {
|
||||||
|
if (parse) {
|
||||||
|
return response.json ? response.json() : Promise.reject(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
};
|
||||||
|
|
||||||
|
return responsePromise.then(checkStatus).then(parseResponse).catch(function (response) {
|
||||||
|
if (!parse) {
|
||||||
|
throw response;
|
||||||
|
}
|
||||||
|
|
||||||
|
var invalidJsonError = {
|
||||||
|
code: 'invalid_json',
|
||||||
|
message: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('The response is not a valid JSON response.')
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!response || !response.json) {
|
||||||
|
throw invalidJsonError;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Response data is a stream, which will be consumed by the .json() call.
|
||||||
|
* If we need to re-use this data to send to the Cloudflare error handler,
|
||||||
|
* we need a clone of the original response, so the stream can be consumed
|
||||||
|
* in the .text() call, instead.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
var responseClone = response.clone();
|
||||||
|
return response.json().catch(
|
||||||
|
/*#__PURE__*/
|
||||||
|
Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])(
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(function _callee() {
|
||||||
|
var text;
|
||||||
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context.prev = _context.next) {
|
||||||
|
case 0:
|
||||||
|
_context.next = 2;
|
||||||
|
return responseClone.text();
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
text = _context.sent;
|
||||||
|
checkCloudflareError(text);
|
||||||
|
throw invalidJsonError;
|
||||||
|
|
||||||
|
case 5:
|
||||||
|
case "end":
|
||||||
|
return _context.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _callee, this);
|
||||||
|
}))).then(function (error) {
|
||||||
|
var unknownError = {
|
||||||
|
code: 'unknown_error',
|
||||||
|
message: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('An unknown error occurred.')
|
||||||
|
};
|
||||||
|
checkCloudflareError(error);
|
||||||
|
throw error || unknownError;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var steps = [raw, _middlewares_fetch_all_middleware__WEBPACK_IMPORTED_MODULE_7__["default"], _middlewares_http_v1__WEBPACK_IMPORTED_MODULE_9__["default"], _middlewares_namespace_endpoint__WEBPACK_IMPORTED_MODULE_8__["default"]].concat(middlewares).reverse();
|
||||||
|
|
||||||
|
var runMiddleware = function runMiddleware(index) {
|
||||||
|
return function (nextOptions) {
|
||||||
|
var nextMiddleware = steps[index];
|
||||||
|
var next = runMiddleware(index + 1);
|
||||||
|
return nextMiddleware(nextOptions, next);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
return runMiddleware(0)(options);
|
||||||
|
}
|
||||||
|
|
||||||
|
apiFetch.use = registerMiddleware;
|
||||||
|
apiFetch.createNonceMiddleware = _middlewares_nonce__WEBPACK_IMPORTED_MODULE_4__["default"];
|
||||||
|
apiFetch.createPreloadingMiddleware = _middlewares_preloading__WEBPACK_IMPORTED_MODULE_6__["default"];
|
||||||
|
apiFetch.createRootURLMiddleware = _middlewares_root_url__WEBPACK_IMPORTED_MODULE_5__["default"];
|
||||||
|
apiFetch.fetchAllMiddleware = _middlewares_fetch_all_middleware__WEBPACK_IMPORTED_MODULE_7__["default"];
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (apiFetch);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/api-fetch/build-module/middlewares/fetch-all-middleware.js":
|
||||||
|
/*!********************************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/api-fetch/build-module/middlewares/fetch-all-middleware.js ***!
|
||||||
|
\********************************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
|
||||||
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
|
||||||
|
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
||||||
|
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
|
||||||
|
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
// Apply query arguments to both URL and Path, whichever is present.
|
||||||
|
|
||||||
|
var modifyQuery = function modifyQuery(_ref, queryArgs) {
|
||||||
|
var path = _ref.path,
|
||||||
|
url = _ref.url,
|
||||||
|
options = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__["default"])(_ref, ["path", "url"]);
|
||||||
|
|
||||||
|
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, options, {
|
||||||
|
url: url && Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_3__["addQueryArgs"])(url, queryArgs),
|
||||||
|
path: path && Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_3__["addQueryArgs"])(path, queryArgs)
|
||||||
|
});
|
||||||
|
}; // Duplicates parsing functionality from apiFetch.
|
||||||
|
|
||||||
|
|
||||||
|
var parseResponse = function parseResponse(response) {
|
||||||
|
return response.json ? response.json() : Promise.reject(response);
|
||||||
|
};
|
||||||
|
|
||||||
|
var parseLinkHeader = function parseLinkHeader(linkHeader) {
|
||||||
|
if (!linkHeader) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
var match = linkHeader.match(/<([^>]+)>; rel="next"/);
|
||||||
|
return match ? {
|
||||||
|
next: match[1]
|
||||||
|
} : {};
|
||||||
|
};
|
||||||
|
|
||||||
|
var getNextPageUrl = function getNextPageUrl(response) {
|
||||||
|
var _parseLinkHeader = parseLinkHeader(response.headers.get('link')),
|
||||||
|
next = _parseLinkHeader.next;
|
||||||
|
|
||||||
|
return next;
|
||||||
|
};
|
||||||
|
|
||||||
|
var requestContainsUnboundedQuery = function requestContainsUnboundedQuery(options) {
|
||||||
|
var pathIsUnbounded = options.path && options.path.indexOf('per_page=-1') !== -1;
|
||||||
|
var urlIsUnbounded = options.url && options.url.indexOf('per_page=-1') !== -1;
|
||||||
|
return pathIsUnbounded || urlIsUnbounded;
|
||||||
|
}; // The REST API enforces an upper limit on the per_page option. To handle large
|
||||||
|
// collections, apiFetch consumers can pass `per_page=-1`; this middleware will
|
||||||
|
// then recursively assemble a full response array from all available pages.
|
||||||
|
|
||||||
|
|
||||||
|
var fetchAllMiddleware =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function () {
|
||||||
|
var _ref2 = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])(
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(function _callee(options, next) {
|
||||||
|
var response, results, nextPage, mergedResults, nextResponse, nextResults;
|
||||||
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context.prev = _context.next) {
|
||||||
|
case 0:
|
||||||
|
if (!(options.parse === false)) {
|
||||||
|
_context.next = 2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _context.abrupt("return", next(options));
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
if (requestContainsUnboundedQuery(options)) {
|
||||||
|
_context.next = 4;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _context.abrupt("return", next(options));
|
||||||
|
|
||||||
|
case 4:
|
||||||
|
_context.next = 6;
|
||||||
|
return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, modifyQuery(options, {
|
||||||
|
per_page: 100
|
||||||
|
}), {
|
||||||
|
// Ensure headers are returned for page 1.
|
||||||
|
parse: false
|
||||||
|
}));
|
||||||
|
|
||||||
|
case 6:
|
||||||
|
response = _context.sent;
|
||||||
|
_context.next = 9;
|
||||||
|
return parseResponse(response);
|
||||||
|
|
||||||
|
case 9:
|
||||||
|
results = _context.sent;
|
||||||
|
|
||||||
|
if (Array.isArray(results)) {
|
||||||
|
_context.next = 12;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _context.abrupt("return", results);
|
||||||
|
|
||||||
|
case 12:
|
||||||
|
nextPage = getNextPageUrl(response);
|
||||||
|
|
||||||
|
if (nextPage) {
|
||||||
|
_context.next = 15;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _context.abrupt("return", results);
|
||||||
|
|
||||||
|
case 15:
|
||||||
|
// Iteratively fetch all remaining pages until no "next" header is found.
|
||||||
|
mergedResults = [].concat(results);
|
||||||
|
|
||||||
|
case 16:
|
||||||
|
if (!nextPage) {
|
||||||
|
_context.next = 27;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
_context.next = 19;
|
||||||
|
return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, options, {
|
||||||
|
// Ensure the URL for the next page is used instead of any provided path.
|
||||||
|
path: undefined,
|
||||||
|
url: nextPage,
|
||||||
|
// Ensure we still get headers so we can identify the next page.
|
||||||
|
parse: false
|
||||||
|
}));
|
||||||
|
|
||||||
|
case 19:
|
||||||
|
nextResponse = _context.sent;
|
||||||
|
_context.next = 22;
|
||||||
|
return parseResponse(nextResponse);
|
||||||
|
|
||||||
|
case 22:
|
||||||
|
nextResults = _context.sent;
|
||||||
|
mergedResults = mergedResults.concat(nextResults);
|
||||||
|
nextPage = getNextPageUrl(nextResponse);
|
||||||
|
_context.next = 16;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 27:
|
||||||
|
return _context.abrupt("return", mergedResults);
|
||||||
|
|
||||||
|
case 28:
|
||||||
|
case "end":
|
||||||
|
return _context.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _callee, this);
|
||||||
|
}));
|
||||||
|
|
||||||
|
return function fetchAllMiddleware(_x, _x2) {
|
||||||
|
return _ref2.apply(this, arguments);
|
||||||
|
};
|
||||||
|
}();
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (fetchAllMiddleware);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/api-fetch/build-module/middlewares/http-v1.js":
|
||||||
|
/*!*******************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/api-fetch/build-module/middlewares/http-v1.js ***!
|
||||||
|
\*******************************************************************************/
|
||||||
|
/*! 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");
|
||||||
|
|
||||||
|
|
||||||
|
function httpV1Middleware(options, next) {
|
||||||
|
var newOptions = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options);
|
||||||
|
|
||||||
|
if (newOptions.method) {
|
||||||
|
if (['PATCH', 'PUT', 'DELETE'].indexOf(newOptions.method.toUpperCase()) >= 0) {
|
||||||
|
if (!newOptions.headers) {
|
||||||
|
newOptions.headers = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
newOptions.headers['X-HTTP-Method-Override'] = newOptions.method;
|
||||||
|
newOptions.headers['Content-Type'] = 'application/json';
|
||||||
|
newOptions.method = 'POST';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return next(newOptions, next);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (httpV1Middleware);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js":
|
||||||
|
/*!******************************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.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");
|
||||||
|
|
||||||
|
|
||||||
|
var namespaceAndEndpointMiddleware = function namespaceAndEndpointMiddleware(options, next) {
|
||||||
|
var path = options.path;
|
||||||
|
var namespaceTrimmed, endpointTrimmed;
|
||||||
|
|
||||||
|
if (typeof options.namespace === 'string' && typeof options.endpoint === 'string') {
|
||||||
|
namespaceTrimmed = options.namespace.replace(/^\/|\/$/g, '');
|
||||||
|
endpointTrimmed = options.endpoint.replace(/^\//, '');
|
||||||
|
|
||||||
|
if (endpointTrimmed) {
|
||||||
|
path = namespaceTrimmed + '/' + endpointTrimmed;
|
||||||
|
} else {
|
||||||
|
path = namespaceTrimmed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delete options.namespace;
|
||||||
|
delete options.endpoint;
|
||||||
|
return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options, {
|
||||||
|
path: path
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (namespaceAndEndpointMiddleware);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/api-fetch/build-module/middlewares/nonce.js":
|
||||||
|
/*!*****************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/api-fetch/build-module/middlewares/nonce.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_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
|
||||||
|
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* External dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
var createNonceMiddleware = function createNonceMiddleware(nonce) {
|
||||||
|
return function (options, next) {
|
||||||
|
var usedNonce = nonce;
|
||||||
|
/**
|
||||||
|
* This is not ideal but it's fine for now.
|
||||||
|
*
|
||||||
|
* Configure heartbeat to refresh the wp-api nonce, keeping the editor
|
||||||
|
* authorization intact.
|
||||||
|
*/
|
||||||
|
|
||||||
|
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__["addAction"])('heartbeat.tick', 'core/api-fetch/create-nonce-middleware', function (response) {
|
||||||
|
if (response['rest-nonce']) {
|
||||||
|
usedNonce = response['rest-nonce'];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var headers = options.headers || {}; // If an 'X-WP-Nonce' header (or any case-insensitive variation
|
||||||
|
// thereof) was specified, no need to add a nonce header.
|
||||||
|
|
||||||
|
var addNonceHeader = true;
|
||||||
|
|
||||||
|
for (var headerName in headers) {
|
||||||
|
if (headers.hasOwnProperty(headerName)) {
|
||||||
|
if (headerName.toLowerCase() === 'x-wp-nonce') {
|
||||||
|
addNonceHeader = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (addNonceHeader) {
|
||||||
|
// Do not mutate the original headers object, if any.
|
||||||
|
headers = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, headers, {
|
||||||
|
'X-WP-Nonce': usedNonce
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options, {
|
||||||
|
headers: headers
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (createNonceMiddleware);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/api-fetch/build-module/middlewares/preloading.js":
|
||||||
|
/*!**********************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/api-fetch/build-module/middlewares/preloading.js ***!
|
||||||
|
\**********************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
var createPreloadingMiddleware = function createPreloadingMiddleware(preloadedData) {
|
||||||
|
return function (options, next) {
|
||||||
|
function getStablePath(path) {
|
||||||
|
var splitted = path.split('?');
|
||||||
|
var query = splitted[1];
|
||||||
|
var base = splitted[0];
|
||||||
|
|
||||||
|
if (!query) {
|
||||||
|
return base;
|
||||||
|
} // 'b=1&c=2&a=5'
|
||||||
|
|
||||||
|
|
||||||
|
return base + '?' + query // [ 'b=1', 'c=2', 'a=5' ]
|
||||||
|
.split('&') // [ [ 'b, '1' ], [ 'c', '2' ], [ 'a', '5' ] ]
|
||||||
|
.map(function (entry) {
|
||||||
|
return entry.split('=');
|
||||||
|
}) // [ [ 'a', '5' ], [ 'b, '1' ], [ 'c', '2' ] ]
|
||||||
|
.sort(function (a, b) {
|
||||||
|
return a[0].localeCompare(b[0]);
|
||||||
|
}) // [ 'a=5', 'b=1', 'c=2' ]
|
||||||
|
.map(function (pair) {
|
||||||
|
return pair.join('=');
|
||||||
|
}) // 'a=5&b=1&c=2'
|
||||||
|
.join('&');
|
||||||
|
}
|
||||||
|
|
||||||
|
var _options$parse = options.parse,
|
||||||
|
parse = _options$parse === void 0 ? true : _options$parse;
|
||||||
|
|
||||||
|
if (typeof options.path === 'string' && parse) {
|
||||||
|
var method = options.method || 'GET';
|
||||||
|
var path = getStablePath(options.path);
|
||||||
|
|
||||||
|
if ('GET' === method && preloadedData[path]) {
|
||||||
|
return Promise.resolve(preloadedData[path].body);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return next(options);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (createPreloadingMiddleware);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/api-fetch/build-module/middlewares/root-url.js":
|
||||||
|
/*!********************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/api-fetch/build-module/middlewares/root-url.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 _namespace_endpoint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./namespace-endpoint */ "./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
var createRootURLMiddleware = function createRootURLMiddleware(rootURL) {
|
||||||
|
return function (options, next) {
|
||||||
|
return Object(_namespace_endpoint__WEBPACK_IMPORTED_MODULE_1__["default"])(options, function (optionsWithPath) {
|
||||||
|
var url = optionsWithPath.url;
|
||||||
|
var path = optionsWithPath.path;
|
||||||
|
var apiRoot;
|
||||||
|
|
||||||
|
if (typeof path === 'string') {
|
||||||
|
apiRoot = rootURL;
|
||||||
|
|
||||||
|
if (-1 !== rootURL.indexOf('?')) {
|
||||||
|
path = path.replace('?', '&');
|
||||||
|
}
|
||||||
|
|
||||||
|
path = path.replace(/^\//, ''); // API root may already include query parameter prefix if site is
|
||||||
|
// configured to use plain permalinks.
|
||||||
|
|
||||||
|
if ('string' === typeof apiRoot && -1 !== apiRoot.indexOf('?')) {
|
||||||
|
path = path.replace('?', '&');
|
||||||
|
}
|
||||||
|
|
||||||
|
url = apiRoot + path;
|
||||||
|
}
|
||||||
|
|
||||||
|
return next(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, optionsWithPath, {
|
||||||
|
url: url
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (createRootURLMiddleware);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/hooks":
|
||||||
|
/*!****************************************!*\
|
||||||
|
!*** external {"this":["wp","hooks"]} ***!
|
||||||
|
\****************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["hooks"]; }());
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/i18n":
|
||||||
|
/*!***************************************!*\
|
||||||
|
!*** external {"this":["wp","i18n"]} ***!
|
||||||
|
\***************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["i18n"]; }());
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/url":
|
||||||
|
/*!**************************************!*\
|
||||||
|
!*** external {"this":["wp","url"]} ***!
|
||||||
|
\**************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["url"]; }());
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ })["default"];
|
||||||
|
//# sourceMappingURL=api-fetch.js.map
|
1
wp-includes/js/dist/api-fetch.js.map
vendored
Normal file
1
wp-includes/js/dist/api-fetch.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
577
wp-includes/js/dist/autop.js
vendored
Normal file
577
wp-includes/js/dist/autop.js
vendored
Normal file
|
@ -0,0 +1,577 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["autop"] =
|
||||||
|
/******/ (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/autop/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/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/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/@wordpress/autop/build-module/index.js":
|
||||||
|
/*!*************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/autop/build-module/index.js ***!
|
||||||
|
\*************************************************************/
|
||||||
|
/*! exports provided: autop, removep */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autop", function() { return autop; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removep", function() { return removep; });
|
||||||
|
/* 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");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The regular expression for an HTML element.
|
||||||
|
*
|
||||||
|
* @type {String}
|
||||||
|
*/
|
||||||
|
var htmlSplitRegex = function () {
|
||||||
|
/* eslint-disable no-multi-spaces */
|
||||||
|
var comments = '!' + // Start of comment, after the <.
|
||||||
|
'(?:' + // Unroll the loop: Consume everything until --> is found.
|
||||||
|
'-(?!->)' + // Dash not followed by end of comment.
|
||||||
|
'[^\\-]*' + // Consume non-dashes.
|
||||||
|
')*' + // Loop possessively.
|
||||||
|
'(?:-->)?'; // End of comment. If not found, match all input.
|
||||||
|
|
||||||
|
var cdata = '!\\[CDATA\\[' + // Start of comment, after the <.
|
||||||
|
'[^\\]]*' + // Consume non-].
|
||||||
|
'(?:' + // Unroll the loop: Consume everything until ]]> is found.
|
||||||
|
'](?!]>)' + // One ] not followed by end of comment.
|
||||||
|
'[^\\]]*' + // Consume non-].
|
||||||
|
')*?' + // Loop possessively.
|
||||||
|
'(?:]]>)?'; // End of comment. If not found, match all input.
|
||||||
|
|
||||||
|
var escaped = '(?=' + // Is the element escaped?
|
||||||
|
'!--' + '|' + '!\\[CDATA\\[' + ')' + '((?=!-)' + // If yes, which type?
|
||||||
|
comments + '|' + cdata + ')';
|
||||||
|
var regex = '(' + // Capture the entire match.
|
||||||
|
'<' + // Find start of element.
|
||||||
|
'(' + // Conditional expression follows.
|
||||||
|
escaped + // Find end of escaped element.
|
||||||
|
'|' + // ... else ...
|
||||||
|
'[^>]*>?' + // Find end of normal element.
|
||||||
|
')' + ')';
|
||||||
|
return new RegExp(regex);
|
||||||
|
/* eslint-enable no-multi-spaces */
|
||||||
|
}();
|
||||||
|
/**
|
||||||
|
* Separate HTML elements and comments from the text.
|
||||||
|
*
|
||||||
|
* @param {string} input The text which has to be formatted.
|
||||||
|
* @return {Array} The formatted text.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function htmlSplit(input) {
|
||||||
|
var parts = [];
|
||||||
|
var workingInput = input;
|
||||||
|
var match;
|
||||||
|
|
||||||
|
while (match = workingInput.match(htmlSplitRegex)) {
|
||||||
|
parts.push(workingInput.slice(0, match.index));
|
||||||
|
parts.push(match[0]);
|
||||||
|
workingInput = workingInput.slice(match.index + match[0].length);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (workingInput.length) {
|
||||||
|
parts.push(workingInput);
|
||||||
|
}
|
||||||
|
|
||||||
|
return parts;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Replace characters or phrases within HTML elements only.
|
||||||
|
*
|
||||||
|
* @param {string} haystack The text which has to be formatted.
|
||||||
|
* @param {Object} replacePairs In the form {from: 'to', ...}.
|
||||||
|
* @return {string} The formatted text.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function replaceInHtmlTags(haystack, replacePairs) {
|
||||||
|
// Find all elements.
|
||||||
|
var textArr = htmlSplit(haystack);
|
||||||
|
var changed = false; // Extract all needles.
|
||||||
|
|
||||||
|
var needles = Object.keys(replacePairs); // Loop through delimiters (elements) only.
|
||||||
|
|
||||||
|
for (var i = 1; i < textArr.length; i += 2) {
|
||||||
|
for (var j = 0; j < needles.length; j++) {
|
||||||
|
var needle = needles[j];
|
||||||
|
|
||||||
|
if (-1 !== textArr[i].indexOf(needle)) {
|
||||||
|
textArr[i] = textArr[i].replace(new RegExp(needle, 'g'), replacePairs[needle]);
|
||||||
|
changed = true; // After one strtr() break out of the foreach loop and look at next element.
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
haystack = textArr.join('');
|
||||||
|
}
|
||||||
|
|
||||||
|
return haystack;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Replaces double line-breaks with paragraph elements.
|
||||||
|
*
|
||||||
|
* A group of regex replaces used to identify text formatted with newlines and
|
||||||
|
* replace double line-breaks with HTML paragraph tags. The remaining line-
|
||||||
|
* breaks after conversion become <<br />> tags, unless br is set to 'false'.
|
||||||
|
*
|
||||||
|
* @param {string} text The text which has to be formatted.
|
||||||
|
* @param {boolean} br Optional. If set, will convert all remaining line-
|
||||||
|
* breaks after paragraphing. Default true.
|
||||||
|
* @return {string} Text which has been converted into paragraph tags.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function autop(text) {
|
||||||
|
var br = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
||||||
|
var preTags = [];
|
||||||
|
|
||||||
|
if (text.trim() === '') {
|
||||||
|
return '';
|
||||||
|
} // Just to make things a little easier, pad the end.
|
||||||
|
|
||||||
|
|
||||||
|
text = text + '\n';
|
||||||
|
/*
|
||||||
|
* Pre tags shouldn't be touched by autop.
|
||||||
|
* Replace pre tags with placeholders and bring them back after autop.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (text.indexOf('<pre') !== -1) {
|
||||||
|
var textParts = text.split('</pre>');
|
||||||
|
var lastText = textParts.pop();
|
||||||
|
text = '';
|
||||||
|
|
||||||
|
for (var i = 0; i < textParts.length; i++) {
|
||||||
|
var textPart = textParts[i];
|
||||||
|
var start = textPart.indexOf('<pre'); // Malformed html?
|
||||||
|
|
||||||
|
if (start === -1) {
|
||||||
|
text += textPart;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var name = '<pre wp-pre-tag-' + i + '></pre>';
|
||||||
|
preTags.push([name, textPart.substr(start) + '</pre>']);
|
||||||
|
text += textPart.substr(0, start) + name;
|
||||||
|
}
|
||||||
|
|
||||||
|
text += lastText;
|
||||||
|
} // Change multiple <br>s into two line breaks, which will turn into paragraphs.
|
||||||
|
|
||||||
|
|
||||||
|
text = text.replace(/<br\s*\/?>\s*<br\s*\/?>/g, '\n\n');
|
||||||
|
var allBlocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)'; // Add a double line break above block-level opening tags.
|
||||||
|
|
||||||
|
text = text.replace(new RegExp('(<' + allBlocks + '[\s\/>])', 'g'), '\n\n$1'); // Add a double line break below block-level closing tags.
|
||||||
|
|
||||||
|
text = text.replace(new RegExp('(<\/' + allBlocks + '>)', 'g'), '$1\n\n'); // Standardize newline characters to "\n".
|
||||||
|
|
||||||
|
text = text.replace(/\r\n|\r/g, '\n'); // Find newlines in all elements and add placeholders.
|
||||||
|
|
||||||
|
text = replaceInHtmlTags(text, {
|
||||||
|
'\n': ' <!-- wpnl --> '
|
||||||
|
}); // Collapse line breaks before and after <option> elements so they don't get autop'd.
|
||||||
|
|
||||||
|
if (text.indexOf('<option') !== -1) {
|
||||||
|
text = text.replace(/\s*<option/g, '<option');
|
||||||
|
text = text.replace(/<\/option>\s*/g, '</option>');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Collapse line breaks inside <object> elements, before <param> and <embed> elements
|
||||||
|
* so they don't get autop'd.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
if (text.indexOf('</object>') !== -1) {
|
||||||
|
text = text.replace(/(<object[^>]*>)\s*/g, '$1');
|
||||||
|
text = text.replace(/\s*<\/object>/g, '</object>');
|
||||||
|
text = text.replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g, '$1');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Collapse line breaks inside <audio> and <video> elements,
|
||||||
|
* before and after <source> and <track> elements.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
if (text.indexOf('<source') !== -1 || text.indexOf('<track') !== -1) {
|
||||||
|
text = text.replace(/([<\[](?:audio|video)[^>\]]*[>\]])\s*/g, '$1');
|
||||||
|
text = text.replace(/\s*([<\[]\/(?:audio|video)[>\]])/g, '$1');
|
||||||
|
text = text.replace(/\s*(<(?:source|track)[^>]*>)\s*/g, '$1');
|
||||||
|
} // Collapse line breaks before and after <figcaption> elements.
|
||||||
|
|
||||||
|
|
||||||
|
if (text.indexOf('<figcaption') !== -1) {
|
||||||
|
text = text.replace(/\s*(<figcaption[^>]*>)/, '$1');
|
||||||
|
text = text.replace(/<\/figcaption>\s*/, '</figcaption>');
|
||||||
|
} // Remove more than two contiguous line breaks.
|
||||||
|
|
||||||
|
|
||||||
|
text = text.replace(/\n\n+/g, '\n\n'); // Split up the contents into an array of strings, separated by double line breaks.
|
||||||
|
|
||||||
|
var texts = text.split(/\n\s*\n/).filter(Boolean); // Reset text prior to rebuilding.
|
||||||
|
|
||||||
|
text = ''; // Rebuild the content as a string, wrapping every bit with a <p>.
|
||||||
|
|
||||||
|
texts.forEach(function (textPiece) {
|
||||||
|
text += '<p>' + textPiece.replace(/^\n*|\n*$/g, '') + '</p>\n';
|
||||||
|
}); // Under certain strange conditions it could create a P of entirely whitespace.
|
||||||
|
|
||||||
|
text = text.replace(/<p>\s*<\/p>/g, ''); // Add a closing <p> inside <div>, <address>, or <form> tag if missing.
|
||||||
|
|
||||||
|
text = text.replace(/<p>([^<]+)<\/(div|address|form)>/g, '<p>$1</p></$2>'); // If an opening or closing block element tag is wrapped in a <p>, unwrap it.
|
||||||
|
|
||||||
|
text = text.replace(new RegExp('<p>\s*(<\/?' + allBlocks + '[^>]*>)\s*<\/p>', 'g'), '$1'); // In some cases <li> may get wrapped in <p>, fix them.
|
||||||
|
|
||||||
|
text = text.replace(/<p>(<li.+?)<\/p>/g, '$1'); // If a <blockquote> is wrapped with a <p>, move it inside the <blockquote>.
|
||||||
|
|
||||||
|
text = text.replace(/<p><blockquote([^>]*)>/gi, '<blockquote$1><p>');
|
||||||
|
text = text.replace(/<\/blockquote><\/p>/g, '</p></blockquote>'); // If an opening or closing block element tag is preceded by an opening <p> tag, remove it.
|
||||||
|
|
||||||
|
text = text.replace(new RegExp('<p>\s*(<\/?' + allBlocks + '[^>]*>)', 'g'), '$1'); // If an opening or closing block element tag is followed by a closing <p> tag, remove it.
|
||||||
|
|
||||||
|
text = text.replace(new RegExp('(<\/?' + allBlocks + '[^>]*>)\s*<\/p>', 'g'), '$1'); // Optionally insert line breaks.
|
||||||
|
|
||||||
|
if (br) {
|
||||||
|
// Replace newlines that shouldn't be touched with a placeholder.
|
||||||
|
text = text.replace(/<(script|style).*?<\/\\1>/g, function (match) {
|
||||||
|
return match[0].replace(/\n/g, '<WPPreserveNewline />');
|
||||||
|
}); // Normalize <br>
|
||||||
|
|
||||||
|
text = text.replace(/<br>|<br\/>/g, '<br />'); // Replace any new line characters that aren't preceded by a <br /> with a <br />.
|
||||||
|
|
||||||
|
text = text.replace(/(<br \/>)?\s*\n/g, function (a, b) {
|
||||||
|
return b ? a : '<br />\n';
|
||||||
|
}); // Replace newline placeholders with newlines.
|
||||||
|
|
||||||
|
text = text.replace(/<WPPreserveNewline \/>/g, '\n');
|
||||||
|
} // If a <br /> tag is after an opening or closing block tag, remove it.
|
||||||
|
|
||||||
|
|
||||||
|
text = text.replace(new RegExp('(<\/?' + allBlocks + '[^>]*>)\s*<br \/>', 'g'), '$1'); // If a <br /> tag is before a subset of opening or closing block tags, remove it.
|
||||||
|
|
||||||
|
text = text.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g, '$1');
|
||||||
|
text = text.replace(/\n<\/p>$/g, '</p>'); // Replace placeholder <pre> tags with their original content.
|
||||||
|
|
||||||
|
preTags.forEach(function (preTag) {
|
||||||
|
var _preTag = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(preTag, 2),
|
||||||
|
name = _preTag[0],
|
||||||
|
original = _preTag[1];
|
||||||
|
|
||||||
|
text = text.replace(name, original);
|
||||||
|
}); // Restore newlines in all elements.
|
||||||
|
|
||||||
|
if (-1 !== text.indexOf('<!-- wpnl -->')) {
|
||||||
|
text = text.replace(/\s?<!-- wpnl -->\s?/g, '\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Replaces <p> tags with two line breaks. "Opposite" of autop().
|
||||||
|
*
|
||||||
|
* Replaces <p> tags with two line breaks except where the <p> has attributes.
|
||||||
|
* Unifies whitespace. Indents <li>, <dt> and <dd> for better readability.
|
||||||
|
*
|
||||||
|
* @param {string} html The content from the editor.
|
||||||
|
* @return {string} The content with stripped paragraph tags.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function removep(html) {
|
||||||
|
var blocklist = 'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure';
|
||||||
|
var blocklist1 = blocklist + '|div|p';
|
||||||
|
var blocklist2 = blocklist + '|pre';
|
||||||
|
var preserve = [];
|
||||||
|
var preserveLinebreaks = false;
|
||||||
|
var preserveBr = false;
|
||||||
|
|
||||||
|
if (!html) {
|
||||||
|
return '';
|
||||||
|
} // Protect script and style tags.
|
||||||
|
|
||||||
|
|
||||||
|
if (html.indexOf('<script') !== -1 || html.indexOf('<style') !== -1) {
|
||||||
|
html = html.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g, function (match) {
|
||||||
|
preserve.push(match);
|
||||||
|
return '<wp-preserve>';
|
||||||
|
});
|
||||||
|
} // Protect pre tags.
|
||||||
|
|
||||||
|
|
||||||
|
if (html.indexOf('<pre') !== -1) {
|
||||||
|
preserveLinebreaks = true;
|
||||||
|
html = html.replace(/<pre[^>]*>[\s\S]+?<\/pre>/g, function (a) {
|
||||||
|
a = a.replace(/<br ?\/?>(\r\n|\n)?/g, '<wp-line-break>');
|
||||||
|
a = a.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g, '<wp-line-break>');
|
||||||
|
return a.replace(/\r?\n/g, '<wp-line-break>');
|
||||||
|
});
|
||||||
|
} // Remove line breaks but keep <br> tags inside image captions.
|
||||||
|
|
||||||
|
|
||||||
|
if (html.indexOf('[caption') !== -1) {
|
||||||
|
preserveBr = true;
|
||||||
|
html = html.replace(/\[caption[\s\S]+?\[\/caption\]/g, function (a) {
|
||||||
|
return a.replace(/<br([^>]*)>/g, '<wp-temp-br$1>').replace(/[\r\n\t]+/, '');
|
||||||
|
});
|
||||||
|
} // Normalize white space characters before and after block tags.
|
||||||
|
|
||||||
|
|
||||||
|
html = html.replace(new RegExp('\\s*</(' + blocklist1 + ')>\\s*', 'g'), '</$1>\n');
|
||||||
|
html = html.replace(new RegExp('\\s*<((?:' + blocklist1 + ')(?: [^>]*)?)>', 'g'), '\n<$1>'); // Mark </p> if it has any attributes.
|
||||||
|
|
||||||
|
html = html.replace(/(<p [^>]+>.*?)<\/p>/g, '$1</p#>'); // Preserve the first <p> inside a <div>.
|
||||||
|
|
||||||
|
html = html.replace(/<div( [^>]*)?>\s*<p>/gi, '<div$1>\n\n'); // Remove paragraph tags.
|
||||||
|
|
||||||
|
html = html.replace(/\s*<p>/gi, '');
|
||||||
|
html = html.replace(/\s*<\/p>\s*/gi, '\n\n'); // Normalize white space chars and remove multiple line breaks.
|
||||||
|
|
||||||
|
html = html.replace(/\n[\s\u00a0]+\n/g, '\n\n'); // Replace <br> tags with line breaks.
|
||||||
|
|
||||||
|
html = html.replace(/(\s*)<br ?\/?>\s*/gi, function (match, space) {
|
||||||
|
if (space && space.indexOf('\n') !== -1) {
|
||||||
|
return '\n\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '\n';
|
||||||
|
}); // Fix line breaks around <div>.
|
||||||
|
|
||||||
|
html = html.replace(/\s*<div/g, '\n<div');
|
||||||
|
html = html.replace(/<\/div>\s*/g, '</div>\n'); // Fix line breaks around caption shortcodes.
|
||||||
|
|
||||||
|
html = html.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi, '\n\n[caption$1[/caption]\n\n');
|
||||||
|
html = html.replace(/caption\]\n\n+\[caption/g, 'caption]\n\n[caption'); // Pad block elements tags with a line break.
|
||||||
|
|
||||||
|
html = html.replace(new RegExp('\\s*<((?:' + blocklist2 + ')(?: [^>]*)?)\\s*>', 'g'), '\n<$1>');
|
||||||
|
html = html.replace(new RegExp('\\s*</(' + blocklist2 + ')>\\s*', 'g'), '</$1>\n'); // Indent <li>, <dt> and <dd> tags.
|
||||||
|
|
||||||
|
html = html.replace(/<((li|dt|dd)[^>]*)>/g, ' \t<$1>'); // Fix line breaks around <select> and <option>.
|
||||||
|
|
||||||
|
if (html.indexOf('<option') !== -1) {
|
||||||
|
html = html.replace(/\s*<option/g, '\n<option');
|
||||||
|
html = html.replace(/\s*<\/select>/g, '\n</select>');
|
||||||
|
} // Pad <hr> with two line breaks.
|
||||||
|
|
||||||
|
|
||||||
|
if (html.indexOf('<hr') !== -1) {
|
||||||
|
html = html.replace(/\s*<hr( [^>]*)?>\s*/g, '\n\n<hr$1>\n\n');
|
||||||
|
} // Remove line breaks in <object> tags.
|
||||||
|
|
||||||
|
|
||||||
|
if (html.indexOf('<object') !== -1) {
|
||||||
|
html = html.replace(/<object[\s\S]+?<\/object>/g, function (a) {
|
||||||
|
return a.replace(/[\r\n]+/g, '');
|
||||||
|
});
|
||||||
|
} // Unmark special paragraph closing tags.
|
||||||
|
|
||||||
|
|
||||||
|
html = html.replace(/<\/p#>/g, '</p>\n'); // Pad remaining <p> tags whit a line break.
|
||||||
|
|
||||||
|
html = html.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g, '\n$1'); // Trim.
|
||||||
|
|
||||||
|
html = html.replace(/^\s+/, '');
|
||||||
|
html = html.replace(/[\s\u00a0]+$/, '');
|
||||||
|
|
||||||
|
if (preserveLinebreaks) {
|
||||||
|
html = html.replace(/<wp-line-break>/g, '\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preserveBr) {
|
||||||
|
html = html.replace(/<wp-temp-br([^>]*)>/g, '<br$1>');
|
||||||
|
} // Restore preserved tags.
|
||||||
|
|
||||||
|
|
||||||
|
if (preserve.length) {
|
||||||
|
html = html.replace(/<wp-preserve>/g, function () {
|
||||||
|
return preserve.shift();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=autop.js.map
|
1
wp-includes/js/dist/autop.js.map
vendored
Normal file
1
wp-includes/js/dist/autop.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
169
wp-includes/js/dist/blob.js
vendored
Normal file
169
wp-includes/js/dist/blob.js
vendored
Normal file
|
@ -0,0 +1,169 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["blob"] =
|
||||||
|
/******/ (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/blob/build-module/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/blob/build-module/index.js":
|
||||||
|
/*!************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/blob/build-module/index.js ***!
|
||||||
|
\************************************************************/
|
||||||
|
/*! exports provided: createBlobURL, getBlobByURL, revokeBlobURL, isBlobURL */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createBlobURL", function() { return createBlobURL; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlobByURL", function() { return getBlobByURL; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "revokeBlobURL", function() { return revokeBlobURL; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBlobURL", function() { return isBlobURL; });
|
||||||
|
/**
|
||||||
|
* Browser dependencies
|
||||||
|
*/
|
||||||
|
var _window$URL = window.URL,
|
||||||
|
createObjectURL = _window$URL.createObjectURL,
|
||||||
|
revokeObjectURL = _window$URL.revokeObjectURL;
|
||||||
|
var cache = {};
|
||||||
|
/**
|
||||||
|
* Create a blob URL from a file.
|
||||||
|
*
|
||||||
|
* @param {File} file The file to create a blob URL for.
|
||||||
|
*
|
||||||
|
* @return {string} The blob URL.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function createBlobURL(file) {
|
||||||
|
var url = createObjectURL(file);
|
||||||
|
cache[url] = file;
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Retrieve a file based on a blob URL. The file must have been created by
|
||||||
|
* `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return
|
||||||
|
* `undefined`.
|
||||||
|
*
|
||||||
|
* @param {string} url The blob URL.
|
||||||
|
*
|
||||||
|
* @return {?File} The file for the blob URL.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function getBlobByURL(url) {
|
||||||
|
return cache[url];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Remove the resource and file cache from memory.
|
||||||
|
*
|
||||||
|
* @param {string} url The blob URL.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function revokeBlobURL(url) {
|
||||||
|
if (cache[url]) {
|
||||||
|
revokeObjectURL(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
delete cache[url];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Check whether a url is a blob url.
|
||||||
|
*
|
||||||
|
* @param {string} url The URL.
|
||||||
|
*
|
||||||
|
* @return {boolean} Is the url a blob url?
|
||||||
|
*/
|
||||||
|
|
||||||
|
function isBlobURL(url) {
|
||||||
|
if (!url || !url.indexOf) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return url.indexOf('blob:') === 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=blob.js.map
|
1
wp-includes/js/dist/blob.js.map
vendored
Normal file
1
wp-includes/js/dist/blob.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
15682
wp-includes/js/dist/block-library.js
vendored
Normal file
15682
wp-includes/js/dist/block-library.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
wp-includes/js/dist/block-library.js.map
vendored
Normal file
1
wp-includes/js/dist/block-library.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
444
wp-includes/js/dist/block-serialization-default-parser.js
vendored
Normal file
444
wp-includes/js/dist/block-serialization-default-parser.js
vendored
Normal file
|
@ -0,0 +1,444 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["blockSerializationDefaultParser"] =
|
||||||
|
/******/ (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/block-serialization-default-parser/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/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/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/@wordpress/block-serialization-default-parser/build-module/index.js":
|
||||||
|
/*!******************************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/block-serialization-default-parser/build-module/index.js ***!
|
||||||
|
\******************************************************************************************/
|
||||||
|
/*! exports provided: parse */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return parse; });
|
||||||
|
/* 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");
|
||||||
|
|
||||||
|
var document;
|
||||||
|
var offset;
|
||||||
|
var output;
|
||||||
|
var stack;
|
||||||
|
var tokenizer = /<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?!}\s+-->)[^])+?}\s+)?(\/)?-->/g;
|
||||||
|
|
||||||
|
function Block(blockName, attrs, innerBlocks, innerHTML) {
|
||||||
|
return {
|
||||||
|
blockName: blockName,
|
||||||
|
attrs: attrs,
|
||||||
|
innerBlocks: innerBlocks,
|
||||||
|
innerHTML: innerHTML
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function Freeform(innerHTML) {
|
||||||
|
return Block(null, {}, [], innerHTML);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Frame(block, tokenStart, tokenLength, prevOffset, leadingHtmlStart) {
|
||||||
|
return {
|
||||||
|
block: block,
|
||||||
|
tokenStart: tokenStart,
|
||||||
|
tokenLength: tokenLength,
|
||||||
|
prevOffset: prevOffset || tokenStart + tokenLength,
|
||||||
|
leadingHtmlStart: leadingHtmlStart
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var parse = function parse(doc) {
|
||||||
|
document = doc;
|
||||||
|
offset = 0;
|
||||||
|
output = [];
|
||||||
|
stack = [];
|
||||||
|
tokenizer.lastIndex = 0;
|
||||||
|
|
||||||
|
do {// twiddle our thumbs
|
||||||
|
} while (proceed());
|
||||||
|
|
||||||
|
return output;
|
||||||
|
};
|
||||||
|
|
||||||
|
function proceed() {
|
||||||
|
var next = nextToken();
|
||||||
|
|
||||||
|
var _next = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(next, 5),
|
||||||
|
tokenType = _next[0],
|
||||||
|
blockName = _next[1],
|
||||||
|
attrs = _next[2],
|
||||||
|
startOffset = _next[3],
|
||||||
|
tokenLength = _next[4];
|
||||||
|
|
||||||
|
var stackDepth = stack.length; // we may have some HTML soup before the next block
|
||||||
|
|
||||||
|
var leadingHtmlStart = startOffset > offset ? offset : null;
|
||||||
|
|
||||||
|
switch (tokenType) {
|
||||||
|
case 'no-more-tokens':
|
||||||
|
// if not in a block then flush output
|
||||||
|
if (0 === stackDepth) {
|
||||||
|
addFreeform();
|
||||||
|
return false;
|
||||||
|
} // Otherwise we have a problem
|
||||||
|
// This is an error
|
||||||
|
// we have options
|
||||||
|
// - treat it all as freeform text
|
||||||
|
// - assume an implicit closer (easiest when not nesting)
|
||||||
|
// for the easy case we'll assume an implicit closer
|
||||||
|
|
||||||
|
|
||||||
|
if (1 === stackDepth) {
|
||||||
|
addBlockFromStack();
|
||||||
|
return false;
|
||||||
|
} // for the nested case where it's more difficult we'll
|
||||||
|
// have to assume that multiple closers are missing
|
||||||
|
// and so we'll collapse the whole stack piecewise
|
||||||
|
|
||||||
|
|
||||||
|
while (0 < stack.length) {
|
||||||
|
addBlockFromStack();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
case 'void-block':
|
||||||
|
// easy case is if we stumbled upon a void block
|
||||||
|
// in the top-level of the document
|
||||||
|
if (0 === stackDepth) {
|
||||||
|
if (null !== leadingHtmlStart) {
|
||||||
|
output.push(Freeform(document.substr(leadingHtmlStart, startOffset - leadingHtmlStart)));
|
||||||
|
}
|
||||||
|
|
||||||
|
output.push(Block(blockName, attrs, [], ''));
|
||||||
|
offset = startOffset + tokenLength;
|
||||||
|
return true;
|
||||||
|
} // otherwise we found an inner block
|
||||||
|
|
||||||
|
|
||||||
|
addInnerBlock(Block(blockName, attrs, [], ''), startOffset, tokenLength);
|
||||||
|
offset = startOffset + tokenLength;
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case 'block-opener':
|
||||||
|
// track all newly-opened blocks on the stack
|
||||||
|
stack.push(Frame(Block(blockName, attrs, [], ''), startOffset, tokenLength, startOffset + tokenLength, leadingHtmlStart));
|
||||||
|
offset = startOffset + tokenLength;
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case 'block-closer':
|
||||||
|
// if we're missing an opener we're in trouble
|
||||||
|
// This is an error
|
||||||
|
if (0 === stackDepth) {
|
||||||
|
// we have options
|
||||||
|
// - assume an implicit opener
|
||||||
|
// - assume _this_ is the opener
|
||||||
|
// - give up and close out the document
|
||||||
|
addFreeform();
|
||||||
|
return false;
|
||||||
|
} // if we're not nesting then this is easy - close the block
|
||||||
|
|
||||||
|
|
||||||
|
if (1 === stackDepth) {
|
||||||
|
addBlockFromStack(startOffset);
|
||||||
|
offset = startOffset + tokenLength;
|
||||||
|
return true;
|
||||||
|
} // otherwise we're nested and we have to close out the current
|
||||||
|
// block and add it as a innerBlock to the parent
|
||||||
|
|
||||||
|
|
||||||
|
var stackTop = stack.pop();
|
||||||
|
stackTop.block.innerHTML += document.substr(stackTop.prevOffset, startOffset - stackTop.prevOffset);
|
||||||
|
stackTop.prevOffset = startOffset + tokenLength;
|
||||||
|
addInnerBlock(stackTop.block, stackTop.tokenStart, stackTop.tokenLength, startOffset + tokenLength);
|
||||||
|
offset = startOffset + tokenLength;
|
||||||
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// This is an error
|
||||||
|
addFreeform();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Parse JSON if valid, otherwise return null
|
||||||
|
*
|
||||||
|
* Note that JSON coming from the block comment
|
||||||
|
* delimiters is constrained to be an object
|
||||||
|
* and cannot be things like `true` or `null`
|
||||||
|
*
|
||||||
|
* @param {string} input JSON input string to parse
|
||||||
|
* @return {Object|null} parsed JSON if valid
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function parseJSON(input) {
|
||||||
|
try {
|
||||||
|
return JSON.parse(input);
|
||||||
|
} catch (e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function nextToken() {
|
||||||
|
// aye the magic
|
||||||
|
// we're using a single RegExp to tokenize the block comment delimiters
|
||||||
|
// we're also using a trick here because the only difference between a
|
||||||
|
// block opener and a block closer is the leading `/` before `wp:` (and
|
||||||
|
// a closer has no attributes). we can trap them both and process the
|
||||||
|
// match back in Javascript to see which one it was.
|
||||||
|
var matches = tokenizer.exec(document); // we have no more tokens
|
||||||
|
|
||||||
|
if (null === matches) {
|
||||||
|
return ['no-more-tokens'];
|
||||||
|
}
|
||||||
|
|
||||||
|
var startedAt = matches.index;
|
||||||
|
|
||||||
|
var _matches = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(matches, 6),
|
||||||
|
match = _matches[0],
|
||||||
|
closerMatch = _matches[1],
|
||||||
|
namespaceMatch = _matches[2],
|
||||||
|
nameMatch = _matches[3],
|
||||||
|
attrsMatch = _matches[4],
|
||||||
|
voidMatch = _matches[5];
|
||||||
|
|
||||||
|
var length = match.length;
|
||||||
|
var isCloser = !!closerMatch;
|
||||||
|
var isVoid = !!voidMatch;
|
||||||
|
var namespace = namespaceMatch || 'core/';
|
||||||
|
var name = namespace + nameMatch;
|
||||||
|
var hasAttrs = !!attrsMatch;
|
||||||
|
var attrs = hasAttrs ? parseJSON(attrsMatch) : {}; // This state isn't allowed
|
||||||
|
// This is an error
|
||||||
|
|
||||||
|
if (isCloser && (isVoid || hasAttrs)) {// we can ignore them since they don't hurt anything
|
||||||
|
// we may warn against this at some point or reject it
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isVoid) {
|
||||||
|
return ['void-block', name, attrs, startedAt, length];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isCloser) {
|
||||||
|
return ['block-closer', name, null, startedAt, length];
|
||||||
|
}
|
||||||
|
|
||||||
|
return ['block-opener', name, attrs, startedAt, length];
|
||||||
|
}
|
||||||
|
|
||||||
|
function addFreeform(rawLength) {
|
||||||
|
var length = rawLength ? rawLength : document.length - offset;
|
||||||
|
|
||||||
|
if (0 === length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
output.push(Freeform(document.substr(offset, length)));
|
||||||
|
}
|
||||||
|
|
||||||
|
function addInnerBlock(block, tokenStart, tokenLength, lastOffset) {
|
||||||
|
var parent = stack[stack.length - 1];
|
||||||
|
parent.block.innerBlocks.push(block);
|
||||||
|
parent.block.innerHTML += document.substr(parent.prevOffset, tokenStart - parent.prevOffset);
|
||||||
|
parent.prevOffset = lastOffset ? lastOffset : tokenStart + tokenLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
function addBlockFromStack(endOffset) {
|
||||||
|
var _stack$pop = stack.pop(),
|
||||||
|
block = _stack$pop.block,
|
||||||
|
leadingHtmlStart = _stack$pop.leadingHtmlStart,
|
||||||
|
prevOffset = _stack$pop.prevOffset,
|
||||||
|
tokenStart = _stack$pop.tokenStart;
|
||||||
|
|
||||||
|
if (endOffset) {
|
||||||
|
block.innerHTML += document.substr(prevOffset, endOffset - prevOffset);
|
||||||
|
} else {
|
||||||
|
block.innerHTML += document.substr(prevOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null !== leadingHtmlStart) {
|
||||||
|
output.push(Freeform(document.substr(leadingHtmlStart, tokenStart - leadingHtmlStart)));
|
||||||
|
}
|
||||||
|
|
||||||
|
output.push(block);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=block-serialization-default-parser.js.map
|
1
wp-includes/js/dist/block-serialization-default-parser.js.map
vendored
Normal file
1
wp-includes/js/dist/block-serialization-default-parser.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
12772
wp-includes/js/dist/blocks.js
vendored
Normal file
12772
wp-includes/js/dist/blocks.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
wp-includes/js/dist/blocks.js.map
vendored
Normal file
1
wp-includes/js/dist/blocks.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
42942
wp-includes/js/dist/components.js
vendored
Normal file
42942
wp-includes/js/dist/components.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
wp-includes/js/dist/components.js.map
vendored
Normal file
1
wp-includes/js/dist/components.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1198
wp-includes/js/dist/compose.js
vendored
Normal file
1198
wp-includes/js/dist/compose.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
wp-includes/js/dist/compose.js.map
vendored
Normal file
1
wp-includes/js/dist/compose.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
3617
wp-includes/js/dist/core-data.js
vendored
Normal file
3617
wp-includes/js/dist/core-data.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
wp-includes/js/dist/core-data.js.map
vendored
Normal file
1
wp-includes/js/dist/core-data.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
3890
wp-includes/js/dist/data.js
vendored
Normal file
3890
wp-includes/js/dist/data.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
wp-includes/js/dist/data.js.map
vendored
Normal file
1
wp-includes/js/dist/data.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1496
wp-includes/js/dist/date.js
vendored
Normal file
1496
wp-includes/js/dist/date.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
wp-includes/js/dist/date.js.map
vendored
Normal file
1
wp-includes/js/dist/date.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
179
wp-includes/js/dist/deprecated.js
vendored
Normal file
179
wp-includes/js/dist/deprecated.js
vendored
Normal file
|
@ -0,0 +1,179 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["deprecated"] =
|
||||||
|
/******/ (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/deprecated/build-module/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/deprecated/build-module/index.js":
|
||||||
|
/*!******************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/deprecated/build-module/index.js ***!
|
||||||
|
\******************************************************************/
|
||||||
|
/*! exports provided: logged, default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logged", function() { return logged; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return deprecated; });
|
||||||
|
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
|
||||||
|
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Object map tracking messages which have been logged, for use in ensuring a
|
||||||
|
* message is only logged once.
|
||||||
|
*
|
||||||
|
* @type {Object}
|
||||||
|
*/
|
||||||
|
|
||||||
|
var logged = Object.create(null);
|
||||||
|
/**
|
||||||
|
* Logs a message to notify developers about a deprecated feature.
|
||||||
|
*
|
||||||
|
* @param {string} feature Name of the deprecated feature.
|
||||||
|
* @param {?Object} options Personalisation options
|
||||||
|
* @param {?string} options.version Version in which the feature will be removed.
|
||||||
|
* @param {?string} options.alternative Feature to use instead
|
||||||
|
* @param {?string} options.plugin Plugin name if it's a plugin feature
|
||||||
|
* @param {?string} options.link Link to documentation
|
||||||
|
* @param {?string} options.hint Additional message to help transition away from the deprecated feature.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function deprecated(feature) {
|
||||||
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||||
|
var version = options.version,
|
||||||
|
alternative = options.alternative,
|
||||||
|
plugin = options.plugin,
|
||||||
|
link = options.link,
|
||||||
|
hint = options.hint;
|
||||||
|
var pluginMessage = plugin ? " from ".concat(plugin) : '';
|
||||||
|
var versionMessage = version ? "".concat(pluginMessage, " in ").concat(version) : '';
|
||||||
|
var useInsteadMessage = alternative ? " Please use ".concat(alternative, " instead.") : '';
|
||||||
|
var linkMessage = link ? " See: ".concat(link) : '';
|
||||||
|
var hintMessage = hint ? " Note: ".concat(hint) : '';
|
||||||
|
var message = "".concat(feature, " is deprecated and will be removed").concat(versionMessage, ".").concat(useInsteadMessage).concat(linkMessage).concat(hintMessage); // Skip if already logged.
|
||||||
|
|
||||||
|
if (message in logged) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fires whenever a deprecated feature is encountered
|
||||||
|
*
|
||||||
|
* @param {string} feature Name of the deprecated feature.
|
||||||
|
* @param {?Object} options Personalisation options
|
||||||
|
* @param {?string} options.version Version in which the feature will be removed.
|
||||||
|
* @param {?string} options.alternative Feature to use instead
|
||||||
|
* @param {?string} options.plugin Plugin name if it's a plugin feature
|
||||||
|
* @param {?string} options.link Link to documentation
|
||||||
|
* @param {?string} options.hint Additional message to help transition away from the deprecated feature.
|
||||||
|
* @param {?string} message Message sent to console.warn
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__["doAction"])('deprecated', feature, options, message); // eslint-disable-next-line no-console
|
||||||
|
|
||||||
|
console.warn(message);
|
||||||
|
logged[message] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/hooks":
|
||||||
|
/*!****************************************!*\
|
||||||
|
!*** external {"this":["wp","hooks"]} ***!
|
||||||
|
\****************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["hooks"]; }());
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ })["default"];
|
||||||
|
//# sourceMappingURL=deprecated.js.map
|
1
wp-includes/js/dist/deprecated.js.map
vendored
Normal file
1
wp-includes/js/dist/deprecated.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
123
wp-includes/js/dist/dom-ready.js
vendored
Normal file
123
wp-includes/js/dist/dom-ready.js
vendored
Normal file
|
@ -0,0 +1,123 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["domReady"] =
|
||||||
|
/******/ (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/dom-ready/build-module/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/dom-ready/build-module/index.js":
|
||||||
|
/*!*****************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/dom-ready/build-module/index.js ***!
|
||||||
|
\*****************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Specify a function to execute when the DOM is fully loaded.
|
||||||
|
*
|
||||||
|
* @param {Function} callback A function to execute after the DOM is ready.
|
||||||
|
*
|
||||||
|
* @return {void}
|
||||||
|
*/
|
||||||
|
var domReady = function domReady(callback) {
|
||||||
|
if (document.readyState === 'complete' || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.
|
||||||
|
document.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.
|
||||||
|
) {
|
||||||
|
return callback();
|
||||||
|
} // DOMContentLoaded has not fired yet, delay callback until then.
|
||||||
|
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', callback);
|
||||||
|
};
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (domReady);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ })["default"];
|
||||||
|
//# sourceMappingURL=dom-ready.js.map
|
1
wp-includes/js/dist/dom-ready.js.map
vendored
Normal file
1
wp-includes/js/dist/dom-ready.js.map
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"sources":["webpack://wp.[name]/webpack/bootstrap","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/dom-ready/src/index.js"],"names":["domReady","callback","document","readyState","addEventListener"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFA;AAAA;;;;;;;AAOA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAAUC,QAAV,EAAqB;AACrC,MACCC,QAAQ,CAACC,UAAT,KAAwB,UAAxB,IAAsC;AACtCD,UAAQ,CAACC,UAAT,KAAwB,aAFzB,CAEuC;AAFvC,IAGE;AACD,aAAOF,QAAQ,EAAf;AACA,KANoC,CAQrC;;;AACAC,UAAQ,CAACE,gBAAT,CAA2B,kBAA3B,EAA+CH,QAA/C;AACA,CAVD;;AAYeD,uEAAf","file":"dom-ready.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./node_modules/@wordpress/dom-ready/build-module/index.js\");\n","/**\n * Specify a function to execute when the DOM is fully loaded.\n *\n * @param {Function} callback A function to execute after the DOM is ready.\n *\n * @return {void}\n */\nconst domReady = function( callback ) {\n\tif (\n\t\tdocument.readyState === 'complete' || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.\n\t\tdocument.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.\n\t) {\n\t\treturn callback();\n\t}\n\n\t// DOMContentLoaded has not fired yet, delay callback until then.\n\tdocument.addEventListener( 'DOMContentLoaded', callback );\n};\n\nexport default domReady;\n"],"sourceRoot":""}
|
1092
wp-includes/js/dist/dom.js
vendored
Normal file
1092
wp-includes/js/dist/dom.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
wp-includes/js/dist/dom.js.map
vendored
Normal file
1
wp-includes/js/dist/dom.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
7393
wp-includes/js/dist/edit-post.js
vendored
Normal file
7393
wp-includes/js/dist/edit-post.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
wp-includes/js/dist/edit-post.js.map
vendored
Normal file
1
wp-includes/js/dist/edit-post.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
39611
wp-includes/js/dist/editor.js
vendored
Normal file
39611
wp-includes/js/dist/editor.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
wp-includes/js/dist/editor.js.map
vendored
Normal file
1
wp-includes/js/dist/editor.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1176
wp-includes/js/dist/element.js
vendored
Normal file
1176
wp-includes/js/dist/element.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
wp-includes/js/dist/element.js.map
vendored
Normal file
1
wp-includes/js/dist/element.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
205
wp-includes/js/dist/escape-html.js
vendored
Normal file
205
wp-includes/js/dist/escape-html.js
vendored
Normal file
|
@ -0,0 +1,205 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["escapeHtml"] =
|
||||||
|
/******/ (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/escape-html/build-module/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/escape-html/build-module/index.js":
|
||||||
|
/*!*******************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/escape-html/build-module/index.js ***!
|
||||||
|
\*******************************************************************/
|
||||||
|
/*! exports provided: escapeAmpersand, escapeQuotationMark, escapeLessThan, escapeAttribute, escapeHTML, isValidAttributeName */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeAmpersand", function() { return escapeAmpersand; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeQuotationMark", function() { return escapeQuotationMark; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeLessThan", function() { return escapeLessThan; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeAttribute", function() { return escapeAttribute; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeHTML", function() { return escapeHTML; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidAttributeName", function() { return isValidAttributeName; });
|
||||||
|
/**
|
||||||
|
* Regular expression matching invalid attribute names.
|
||||||
|
*
|
||||||
|
* "Attribute names must consist of one or more characters other than controls,
|
||||||
|
* U+0020 SPACE, U+0022 ("), U+0027 ('), U+003E (>), U+002F (/), U+003D (=),
|
||||||
|
* and noncharacters."
|
||||||
|
*
|
||||||
|
* @link https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
|
||||||
|
*
|
||||||
|
* @type {RegExp}
|
||||||
|
*/
|
||||||
|
var REGEXP_INVALID_ATTRIBUTE_NAME = /[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/;
|
||||||
|
/**
|
||||||
|
* Returns a string with ampersands escaped. Note that this is an imperfect
|
||||||
|
* implementation, where only ampersands which do not appear as a pattern of
|
||||||
|
* named, decimal, or hexadecimal character references are escaped. Invalid
|
||||||
|
* named references (i.e. ambiguous ampersand) are are still permitted.
|
||||||
|
*
|
||||||
|
* @link https://w3c.github.io/html/syntax.html#character-references
|
||||||
|
* @link https://w3c.github.io/html/syntax.html#ambiguous-ampersand
|
||||||
|
* @link https://w3c.github.io/html/syntax.html#named-character-references
|
||||||
|
*
|
||||||
|
* @param {string} value Original string.
|
||||||
|
*
|
||||||
|
* @return {string} Escaped string.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function escapeAmpersand(value) {
|
||||||
|
return value.replace(/&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi, '&');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns a string with quotation marks replaced.
|
||||||
|
*
|
||||||
|
* @param {string} value Original string.
|
||||||
|
*
|
||||||
|
* @return {string} Escaped string.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function escapeQuotationMark(value) {
|
||||||
|
return value.replace(/"/g, '"');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns a string with less-than sign replaced.
|
||||||
|
*
|
||||||
|
* @param {string} value Original string.
|
||||||
|
*
|
||||||
|
* @return {string} Escaped string.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function escapeLessThan(value) {
|
||||||
|
return value.replace(/</g, '<');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns an escaped attribute value.
|
||||||
|
*
|
||||||
|
* @link https://w3c.github.io/html/syntax.html#elements-attributes
|
||||||
|
*
|
||||||
|
* "[...] the text cannot contain an ambiguous ampersand [...] must not contain
|
||||||
|
* any literal U+0022 QUOTATION MARK characters (")"
|
||||||
|
*
|
||||||
|
* @param {string} value Attribute value.
|
||||||
|
*
|
||||||
|
* @return {string} Escaped attribute value.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function escapeAttribute(value) {
|
||||||
|
return escapeQuotationMark(escapeAmpersand(value));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns an escaped HTML element value.
|
||||||
|
*
|
||||||
|
* @link https://w3c.github.io/html/syntax.html#writing-html-documents-elements
|
||||||
|
*
|
||||||
|
* "the text must not contain the character U+003C LESS-THAN SIGN (<) or an
|
||||||
|
* ambiguous ampersand."
|
||||||
|
*
|
||||||
|
* @param {string} value Element value.
|
||||||
|
*
|
||||||
|
* @return {string} Escaped HTML element value.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function escapeHTML(value) {
|
||||||
|
return escapeLessThan(escapeAmpersand(value));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns true if the given attribute name is valid, or false otherwise.
|
||||||
|
*
|
||||||
|
* @param {string} name Attribute name to test.
|
||||||
|
*
|
||||||
|
* @return {boolean} Whether attribute is valid.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function isValidAttributeName(name) {
|
||||||
|
return !REGEXP_INVALID_ATTRIBUTE_NAME.test(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=escape-html.js.map
|
1
wp-includes/js/dist/escape-html.js.map
vendored
Normal file
1
wp-includes/js/dist/escape-html.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
740
wp-includes/js/dist/hooks.js
vendored
Normal file
740
wp-includes/js/dist/hooks.js
vendored
Normal file
|
@ -0,0 +1,740 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["hooks"] =
|
||||||
|
/******/ (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/hooks/build-module/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/hooks/build-module/createAddHook.js":
|
||||||
|
/*!*********************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/hooks/build-module/createAddHook.js ***!
|
||||||
|
\*********************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _validateNamespace_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validateNamespace.js */ "./node_modules/@wordpress/hooks/build-module/validateNamespace.js");
|
||||||
|
/* harmony import */ var _validateHookName_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./validateHookName.js */ "./node_modules/@wordpress/hooks/build-module/validateHookName.js");
|
||||||
|
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ */ "./node_modules/@wordpress/hooks/build-module/index.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a function which, when invoked, will add a hook.
|
||||||
|
*
|
||||||
|
* @param {Object} hooks Stored hooks, keyed by hook name.
|
||||||
|
*
|
||||||
|
* @return {Function} Function that adds a new hook.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function createAddHook(hooks) {
|
||||||
|
/**
|
||||||
|
* Adds the hook to the appropriate hooks container.
|
||||||
|
*
|
||||||
|
* @param {string} hookName Name of hook to add
|
||||||
|
* @param {string} namespace The unique namespace identifying the callback in the form `vendor/plugin/function`.
|
||||||
|
* @param {Function} callback Function to call when the hook is run
|
||||||
|
* @param {?number} priority Priority of this hook (default=10)
|
||||||
|
*/
|
||||||
|
return function addHook(hookName, namespace, callback) {
|
||||||
|
var priority = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 10;
|
||||||
|
|
||||||
|
if (!Object(_validateHookName_js__WEBPACK_IMPORTED_MODULE_1__["default"])(hookName)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Object(_validateNamespace_js__WEBPACK_IMPORTED_MODULE_0__["default"])(namespace)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('function' !== typeof callback) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.error('The hook callback must be a function.');
|
||||||
|
return;
|
||||||
|
} // Validate numeric priority
|
||||||
|
|
||||||
|
|
||||||
|
if ('number' !== typeof priority) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.error('If specified, the hook priority must be a number.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var handler = {
|
||||||
|
callback: callback,
|
||||||
|
priority: priority,
|
||||||
|
namespace: namespace
|
||||||
|
};
|
||||||
|
|
||||||
|
if (hooks[hookName]) {
|
||||||
|
// Find the correct insert index of the new hook.
|
||||||
|
var handlers = hooks[hookName].handlers;
|
||||||
|
var i = 0;
|
||||||
|
|
||||||
|
while (i < handlers.length) {
|
||||||
|
if (handlers[i].priority > priority) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
i++;
|
||||||
|
} // Insert (or append) the new hook.
|
||||||
|
|
||||||
|
|
||||||
|
handlers.splice(i, 0, handler); // We may also be currently executing this hook. If the callback
|
||||||
|
// we're adding would come after the current callback, there's no
|
||||||
|
// problem; otherwise we need to increase the execution index of
|
||||||
|
// any other runs by 1 to account for the added element.
|
||||||
|
|
||||||
|
(hooks.__current || []).forEach(function (hookInfo) {
|
||||||
|
if (hookInfo.name === hookName && hookInfo.currentIndex >= i) {
|
||||||
|
hookInfo.currentIndex++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// This is the first hook of its type.
|
||||||
|
hooks[hookName] = {
|
||||||
|
handlers: [handler],
|
||||||
|
runs: 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hookName !== 'hookAdded') {
|
||||||
|
Object(___WEBPACK_IMPORTED_MODULE_2__["doAction"])('hookAdded', hookName, namespace, callback, priority);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (createAddHook);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/hooks/build-module/createCurrentHook.js":
|
||||||
|
/*!*************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/hooks/build-module/createCurrentHook.js ***!
|
||||||
|
\*************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Returns a function which, when invoked, will return the name of the
|
||||||
|
* currently running hook, or `null` if no hook of the given type is currently
|
||||||
|
* running.
|
||||||
|
*
|
||||||
|
* @param {Object} hooks Stored hooks, keyed by hook name.
|
||||||
|
*
|
||||||
|
* @return {Function} Function that returns the current hook.
|
||||||
|
*/
|
||||||
|
function createCurrentHook(hooks) {
|
||||||
|
/**
|
||||||
|
* Returns the name of the currently running hook, or `null` if no hook of
|
||||||
|
* the given type is currently running.
|
||||||
|
*
|
||||||
|
* @return {?string} The name of the currently running hook, or
|
||||||
|
* `null` if no hook is currently running.
|
||||||
|
*/
|
||||||
|
return function currentHook() {
|
||||||
|
if (!hooks.__current || !hooks.__current.length) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return hooks.__current[hooks.__current.length - 1].name;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (createCurrentHook);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/hooks/build-module/createDidHook.js":
|
||||||
|
/*!*********************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/hooks/build-module/createDidHook.js ***!
|
||||||
|
\*********************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _validateHookName_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validateHookName.js */ "./node_modules/@wordpress/hooks/build-module/validateHookName.js");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a function which, when invoked, will return the number of times a
|
||||||
|
* hook has been called.
|
||||||
|
*
|
||||||
|
* @param {Object} hooks Stored hooks, keyed by hook name.
|
||||||
|
*
|
||||||
|
* @return {Function} Function that returns a hook's call count.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function createDidHook(hooks) {
|
||||||
|
/**
|
||||||
|
* Returns the number of times an action has been fired.
|
||||||
|
*
|
||||||
|
* @param {string} hookName The hook name to check.
|
||||||
|
*
|
||||||
|
* @return {number} The number of times the hook has run.
|
||||||
|
*/
|
||||||
|
return function didHook(hookName) {
|
||||||
|
if (!Object(_validateHookName_js__WEBPACK_IMPORTED_MODULE_0__["default"])(hookName)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return hooks[hookName] && hooks[hookName].runs ? hooks[hookName].runs : 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (createDidHook);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/hooks/build-module/createDoingHook.js":
|
||||||
|
/*!***********************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/hooks/build-module/createDoingHook.js ***!
|
||||||
|
\***********************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Returns a function which, when invoked, will return whether a hook is
|
||||||
|
* currently being executed.
|
||||||
|
*
|
||||||
|
* @param {Object} hooks Stored hooks, keyed by hook name.
|
||||||
|
*
|
||||||
|
* @return {Function} Function that returns whether a hook is currently
|
||||||
|
* being executed.
|
||||||
|
*/
|
||||||
|
function createDoingHook(hooks) {
|
||||||
|
/**
|
||||||
|
* Returns whether a hook is currently being executed.
|
||||||
|
*
|
||||||
|
* @param {?string} hookName The name of the hook to check for. If
|
||||||
|
* omitted, will check for any hook being executed.
|
||||||
|
*
|
||||||
|
* @return {boolean} Whether the hook is being executed.
|
||||||
|
*/
|
||||||
|
return function doingHook(hookName) {
|
||||||
|
// If the hookName was not passed, check for any current hook.
|
||||||
|
if ('undefined' === typeof hookName) {
|
||||||
|
return 'undefined' !== typeof hooks.__current[0];
|
||||||
|
} // Return the __current hook.
|
||||||
|
|
||||||
|
|
||||||
|
return hooks.__current[0] ? hookName === hooks.__current[0].name : false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (createDoingHook);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/hooks/build-module/createHasHook.js":
|
||||||
|
/*!*********************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/hooks/build-module/createHasHook.js ***!
|
||||||
|
\*********************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Returns a function which, when invoked, will return whether any handlers are
|
||||||
|
* attached to a particular hook.
|
||||||
|
*
|
||||||
|
* @param {Object} hooks Stored hooks, keyed by hook name.
|
||||||
|
*
|
||||||
|
* @return {Function} Function that returns whether any handlers are
|
||||||
|
* attached to a particular hook.
|
||||||
|
*/
|
||||||
|
function createHasHook(hooks) {
|
||||||
|
/**
|
||||||
|
* Returns how many handlers are attached for the given hook.
|
||||||
|
*
|
||||||
|
* @param {string} hookName The name of the hook to check for.
|
||||||
|
*
|
||||||
|
* @return {boolean} Whether there are handlers that are attached to the given hook.
|
||||||
|
*/
|
||||||
|
return function hasHook(hookName) {
|
||||||
|
return hookName in hooks;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (createHasHook);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/hooks/build-module/createHooks.js":
|
||||||
|
/*!*******************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/hooks/build-module/createHooks.js ***!
|
||||||
|
\*******************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _createAddHook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createAddHook */ "./node_modules/@wordpress/hooks/build-module/createAddHook.js");
|
||||||
|
/* harmony import */ var _createRemoveHook__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./createRemoveHook */ "./node_modules/@wordpress/hooks/build-module/createRemoveHook.js");
|
||||||
|
/* harmony import */ var _createHasHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./createHasHook */ "./node_modules/@wordpress/hooks/build-module/createHasHook.js");
|
||||||
|
/* harmony import */ var _createRunHook__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./createRunHook */ "./node_modules/@wordpress/hooks/build-module/createRunHook.js");
|
||||||
|
/* harmony import */ var _createCurrentHook__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./createCurrentHook */ "./node_modules/@wordpress/hooks/build-module/createCurrentHook.js");
|
||||||
|
/* harmony import */ var _createDoingHook__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./createDoingHook */ "./node_modules/@wordpress/hooks/build-module/createDoingHook.js");
|
||||||
|
/* harmony import */ var _createDidHook__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./createDidHook */ "./node_modules/@wordpress/hooks/build-module/createDidHook.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an instance of the hooks object.
|
||||||
|
*
|
||||||
|
* @return {Object} Object that contains all hooks.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function createHooks() {
|
||||||
|
var actions = Object.create(null);
|
||||||
|
var filters = Object.create(null);
|
||||||
|
actions.__current = [];
|
||||||
|
filters.__current = [];
|
||||||
|
return {
|
||||||
|
addAction: Object(_createAddHook__WEBPACK_IMPORTED_MODULE_0__["default"])(actions),
|
||||||
|
addFilter: Object(_createAddHook__WEBPACK_IMPORTED_MODULE_0__["default"])(filters),
|
||||||
|
removeAction: Object(_createRemoveHook__WEBPACK_IMPORTED_MODULE_1__["default"])(actions),
|
||||||
|
removeFilter: Object(_createRemoveHook__WEBPACK_IMPORTED_MODULE_1__["default"])(filters),
|
||||||
|
hasAction: Object(_createHasHook__WEBPACK_IMPORTED_MODULE_2__["default"])(actions),
|
||||||
|
hasFilter: Object(_createHasHook__WEBPACK_IMPORTED_MODULE_2__["default"])(filters),
|
||||||
|
removeAllActions: Object(_createRemoveHook__WEBPACK_IMPORTED_MODULE_1__["default"])(actions, true),
|
||||||
|
removeAllFilters: Object(_createRemoveHook__WEBPACK_IMPORTED_MODULE_1__["default"])(filters, true),
|
||||||
|
doAction: Object(_createRunHook__WEBPACK_IMPORTED_MODULE_3__["default"])(actions),
|
||||||
|
applyFilters: Object(_createRunHook__WEBPACK_IMPORTED_MODULE_3__["default"])(filters, true),
|
||||||
|
currentAction: Object(_createCurrentHook__WEBPACK_IMPORTED_MODULE_4__["default"])(actions),
|
||||||
|
currentFilter: Object(_createCurrentHook__WEBPACK_IMPORTED_MODULE_4__["default"])(filters),
|
||||||
|
doingAction: Object(_createDoingHook__WEBPACK_IMPORTED_MODULE_5__["default"])(actions),
|
||||||
|
doingFilter: Object(_createDoingHook__WEBPACK_IMPORTED_MODULE_5__["default"])(filters),
|
||||||
|
didAction: Object(_createDidHook__WEBPACK_IMPORTED_MODULE_6__["default"])(actions),
|
||||||
|
didFilter: Object(_createDidHook__WEBPACK_IMPORTED_MODULE_6__["default"])(filters),
|
||||||
|
actions: actions,
|
||||||
|
filters: filters
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (createHooks);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/hooks/build-module/createRemoveHook.js":
|
||||||
|
/*!************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/hooks/build-module/createRemoveHook.js ***!
|
||||||
|
\************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _validateNamespace_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validateNamespace.js */ "./node_modules/@wordpress/hooks/build-module/validateNamespace.js");
|
||||||
|
/* harmony import */ var _validateHookName_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./validateHookName.js */ "./node_modules/@wordpress/hooks/build-module/validateHookName.js");
|
||||||
|
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ */ "./node_modules/@wordpress/hooks/build-module/index.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a function which, when invoked, will remove a specified hook or all
|
||||||
|
* hooks by the given name.
|
||||||
|
*
|
||||||
|
* @param {Object} hooks Stored hooks, keyed by hook name.
|
||||||
|
* @param {boolean} removeAll Whether to remove all callbacks for a hookName, without regard to namespace. Used to create `removeAll*` functions.
|
||||||
|
*
|
||||||
|
* @return {Function} Function that removes hooks.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function createRemoveHook(hooks, removeAll) {
|
||||||
|
/**
|
||||||
|
* Removes the specified callback (or all callbacks) from the hook with a
|
||||||
|
* given hookName and namespace.
|
||||||
|
*
|
||||||
|
* @param {string} hookName The name of the hook to modify.
|
||||||
|
* @param {string} namespace The unique namespace identifying the callback in the form `vendor/plugin/function`.
|
||||||
|
*
|
||||||
|
* @return {number} The number of callbacks removed.
|
||||||
|
*/
|
||||||
|
return function removeHook(hookName, namespace) {
|
||||||
|
if (!Object(_validateHookName_js__WEBPACK_IMPORTED_MODULE_1__["default"])(hookName)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!removeAll && !Object(_validateNamespace_js__WEBPACK_IMPORTED_MODULE_0__["default"])(namespace)) {
|
||||||
|
return;
|
||||||
|
} // Bail if no hooks exist by this name
|
||||||
|
|
||||||
|
|
||||||
|
if (!hooks[hookName]) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
var handlersRemoved = 0;
|
||||||
|
|
||||||
|
if (removeAll) {
|
||||||
|
handlersRemoved = hooks[hookName].handlers.length;
|
||||||
|
hooks[hookName] = {
|
||||||
|
runs: hooks[hookName].runs,
|
||||||
|
handlers: []
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// Try to find the specified callback to remove.
|
||||||
|
var handlers = hooks[hookName].handlers;
|
||||||
|
|
||||||
|
var _loop = function _loop(i) {
|
||||||
|
if (handlers[i].namespace === namespace) {
|
||||||
|
handlers.splice(i, 1);
|
||||||
|
handlersRemoved++; // This callback may also be part of a hook that is
|
||||||
|
// currently executing. If the callback we're removing
|
||||||
|
// comes after the current callback, there's no problem;
|
||||||
|
// otherwise we need to decrease the execution index of any
|
||||||
|
// other runs by 1 to account for the removed element.
|
||||||
|
|
||||||
|
(hooks.__current || []).forEach(function (hookInfo) {
|
||||||
|
if (hookInfo.name === hookName && hookInfo.currentIndex >= i) {
|
||||||
|
hookInfo.currentIndex--;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
for (var i = handlers.length - 1; i >= 0; i--) {
|
||||||
|
_loop(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hookName !== 'hookRemoved') {
|
||||||
|
Object(___WEBPACK_IMPORTED_MODULE_2__["doAction"])('hookRemoved', hookName, namespace);
|
||||||
|
}
|
||||||
|
|
||||||
|
return handlersRemoved;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (createRemoveHook);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/hooks/build-module/createRunHook.js":
|
||||||
|
/*!*********************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/hooks/build-module/createRunHook.js ***!
|
||||||
|
\*********************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Returns a function which, when invoked, will execute all callbacks
|
||||||
|
* registered to a hook of the specified type, optionally returning the final
|
||||||
|
* value of the call chain.
|
||||||
|
*
|
||||||
|
* @param {Object} hooks Stored hooks, keyed by hook name.
|
||||||
|
* @param {?boolean} returnFirstArg Whether each hook callback is expected to
|
||||||
|
* return its first argument.
|
||||||
|
*
|
||||||
|
* @return {Function} Function that runs hook callbacks.
|
||||||
|
*/
|
||||||
|
function createRunHook(hooks, returnFirstArg) {
|
||||||
|
/**
|
||||||
|
* Runs all callbacks for the specified hook.
|
||||||
|
*
|
||||||
|
* @param {string} hookName The name of the hook to run.
|
||||||
|
* @param {...*} args Arguments to pass to the hook callbacks.
|
||||||
|
*
|
||||||
|
* @return {*} Return value of runner, if applicable.
|
||||||
|
*/
|
||||||
|
return function runHooks(hookName) {
|
||||||
|
if (!hooks[hookName]) {
|
||||||
|
hooks[hookName] = {
|
||||||
|
handlers: [],
|
||||||
|
runs: 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
hooks[hookName].runs++;
|
||||||
|
var handlers = hooks[hookName].handlers;
|
||||||
|
|
||||||
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||||
|
args[_key - 1] = arguments[_key];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!handlers || !handlers.length) {
|
||||||
|
return returnFirstArg ? args[0] : undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
var hookInfo = {
|
||||||
|
name: hookName,
|
||||||
|
currentIndex: 0
|
||||||
|
};
|
||||||
|
|
||||||
|
hooks.__current.push(hookInfo);
|
||||||
|
|
||||||
|
if (!hooks[hookName]) {
|
||||||
|
hooks[hookName] = {
|
||||||
|
runs: 0,
|
||||||
|
handlers: []
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
while (hookInfo.currentIndex < handlers.length) {
|
||||||
|
var handler = handlers[hookInfo.currentIndex];
|
||||||
|
var result = handler.callback.apply(null, args);
|
||||||
|
|
||||||
|
if (returnFirstArg) {
|
||||||
|
args[0] = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
hookInfo.currentIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
hooks.__current.pop();
|
||||||
|
|
||||||
|
if (returnFirstArg) {
|
||||||
|
return args[0];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (createRunHook);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/hooks/build-module/index.js":
|
||||||
|
/*!*************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/hooks/build-module/index.js ***!
|
||||||
|
\*************************************************************/
|
||||||
|
/*! exports provided: createHooks, addAction, addFilter, removeAction, removeFilter, hasAction, hasFilter, removeAllActions, removeAllFilters, doAction, applyFilters, currentAction, currentFilter, doingAction, doingFilter, didAction, didFilter, actions, filters */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addAction", function() { return addAction; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addFilter", function() { return addFilter; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAction", function() { return removeAction; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFilter", function() { return removeFilter; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasAction", function() { return hasAction; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasFilter", function() { return hasFilter; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAllActions", function() { return removeAllActions; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAllFilters", function() { return removeAllFilters; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doAction", function() { return doAction; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyFilters", function() { return applyFilters; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "currentAction", function() { return currentAction; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "currentFilter", function() { return currentFilter; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doingAction", function() { return doingAction; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doingFilter", function() { return doingFilter; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "didAction", function() { return didAction; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "didFilter", function() { return didFilter; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "actions", function() { return actions; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filters", function() { return filters; });
|
||||||
|
/* harmony import */ var _createHooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createHooks */ "./node_modules/@wordpress/hooks/build-module/createHooks.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createHooks", function() { return _createHooks__WEBPACK_IMPORTED_MODULE_0__["default"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var _createHooks = Object(_createHooks__WEBPACK_IMPORTED_MODULE_0__["default"])(),
|
||||||
|
addAction = _createHooks.addAction,
|
||||||
|
addFilter = _createHooks.addFilter,
|
||||||
|
removeAction = _createHooks.removeAction,
|
||||||
|
removeFilter = _createHooks.removeFilter,
|
||||||
|
hasAction = _createHooks.hasAction,
|
||||||
|
hasFilter = _createHooks.hasFilter,
|
||||||
|
removeAllActions = _createHooks.removeAllActions,
|
||||||
|
removeAllFilters = _createHooks.removeAllFilters,
|
||||||
|
doAction = _createHooks.doAction,
|
||||||
|
applyFilters = _createHooks.applyFilters,
|
||||||
|
currentAction = _createHooks.currentAction,
|
||||||
|
currentFilter = _createHooks.currentFilter,
|
||||||
|
doingAction = _createHooks.doingAction,
|
||||||
|
doingFilter = _createHooks.doingFilter,
|
||||||
|
didAction = _createHooks.didAction,
|
||||||
|
didFilter = _createHooks.didFilter,
|
||||||
|
actions = _createHooks.actions,
|
||||||
|
filters = _createHooks.filters;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/hooks/build-module/validateHookName.js":
|
||||||
|
/*!************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/hooks/build-module/validateHookName.js ***!
|
||||||
|
\************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Validate a hookName string.
|
||||||
|
*
|
||||||
|
* @param {string} hookName The hook name to validate. Should be a non empty string containing
|
||||||
|
* only numbers, letters, dashes, periods and underscores. Also,
|
||||||
|
* the hook name cannot begin with `__`.
|
||||||
|
*
|
||||||
|
* @return {boolean} Whether the hook name is valid.
|
||||||
|
*/
|
||||||
|
function validateHookName(hookName) {
|
||||||
|
if ('string' !== typeof hookName || '' === hookName) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.error('The hook name must be a non-empty string.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (/^__/.test(hookName)) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.error('The hook name cannot begin with `__`.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(hookName)) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.error('The hook name can only contain numbers, letters, dashes, periods and underscores.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (validateHookName);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/hooks/build-module/validateNamespace.js":
|
||||||
|
/*!*************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/hooks/build-module/validateNamespace.js ***!
|
||||||
|
\*************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Validate a namespace string.
|
||||||
|
*
|
||||||
|
* @param {string} namespace The namespace to validate - should take the form
|
||||||
|
* `vendor/plugin/function`.
|
||||||
|
*
|
||||||
|
* @return {boolean} Whether the namespace is valid.
|
||||||
|
*/
|
||||||
|
function validateNamespace(namespace) {
|
||||||
|
if ('string' !== typeof namespace || '' === namespace) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.error('The namespace must be a non-empty string.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(namespace)) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.error('The namespace can only contain numbers, letters, dashes, periods, underscores and slashes.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (validateNamespace);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=hooks.js.map
|
1
wp-includes/js/dist/hooks.js.map
vendored
Normal file
1
wp-includes/js/dist/hooks.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
127
wp-includes/js/dist/html-entities.js
vendored
Normal file
127
wp-includes/js/dist/html-entities.js
vendored
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["htmlEntities"] =
|
||||||
|
/******/ (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/html-entities/build-module/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/html-entities/build-module/index.js":
|
||||||
|
/*!*********************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/html-entities/build-module/index.js ***!
|
||||||
|
\*********************************************************************/
|
||||||
|
/*! exports provided: decodeEntities */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decodeEntities", function() { return decodeEntities; });
|
||||||
|
var _decodeTextArea;
|
||||||
|
|
||||||
|
function decodeEntities(html) {
|
||||||
|
// not a string, or no entities to decode
|
||||||
|
if ('string' !== typeof html || -1 === html.indexOf('&')) {
|
||||||
|
return html;
|
||||||
|
} // create a textarea for decoding entities, that we can reuse
|
||||||
|
|
||||||
|
|
||||||
|
if (undefined === _decodeTextArea) {
|
||||||
|
if (document.implementation && document.implementation.createHTMLDocument) {
|
||||||
|
_decodeTextArea = document.implementation.createHTMLDocument('').createElement('textarea');
|
||||||
|
} else {
|
||||||
|
_decodeTextArea = document.createElement('textarea');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_decodeTextArea.innerHTML = html;
|
||||||
|
var decoded = _decodeTextArea.textContent;
|
||||||
|
_decodeTextArea.innerHTML = '';
|
||||||
|
return decoded;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=html-entities.js.map
|
1
wp-includes/js/dist/html-entities.js.map
vendored
Normal file
1
wp-includes/js/dist/html-entities.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1445
wp-includes/js/dist/i18n.js
vendored
Normal file
1445
wp-includes/js/dist/i18n.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
wp-includes/js/dist/i18n.js.map
vendored
Normal file
1
wp-includes/js/dist/i18n.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
231
wp-includes/js/dist/is-shallow-equal.js
vendored
Normal file
231
wp-includes/js/dist/is-shallow-equal.js
vendored
Normal file
|
@ -0,0 +1,231 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["isShallowEqual"] =
|
||||||
|
/******/ (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/is-shallow-equal/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/is-shallow-equal/arrays.js":
|
||||||
|
/*!************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/is-shallow-equal/arrays.js ***!
|
||||||
|
\************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the two arrays are shallow equal, or false otherwise.
|
||||||
|
*
|
||||||
|
* @param {Array} a First array to compare.
|
||||||
|
* @param {Array} b Second array to compare.
|
||||||
|
*
|
||||||
|
* @return {boolean} Whether the two arrays are shallow equal.
|
||||||
|
*/
|
||||||
|
function isShallowEqualArrays( a, b ) {
|
||||||
|
var i;
|
||||||
|
|
||||||
|
if ( a === b ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( a.length !== b.length ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( i = 0; i < a.length; i++ ) {
|
||||||
|
if ( a[ i ] !== b[ i ] ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = isShallowEqualArrays;
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/is-shallow-equal/index.js":
|
||||||
|
/*!***********************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/is-shallow-equal/index.js ***!
|
||||||
|
\***********************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies;
|
||||||
|
*/
|
||||||
|
var isShallowEqualObjects = __webpack_require__( /*! ./objects */ "./node_modules/@wordpress/is-shallow-equal/objects.js" );
|
||||||
|
var isShallowEqualArrays = __webpack_require__( /*! ./arrays */ "./node_modules/@wordpress/is-shallow-equal/arrays.js" );
|
||||||
|
|
||||||
|
var isArray = Array.isArray;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the two arrays or objects are shallow equal, or false
|
||||||
|
* otherwise.
|
||||||
|
*
|
||||||
|
* @param {(Array|Object)} a First object or array to compare.
|
||||||
|
* @param {(Array|Object)} b Second object or array to compare.
|
||||||
|
*
|
||||||
|
* @return {boolean} Whether the two values are shallow equal.
|
||||||
|
*/
|
||||||
|
function isShallowEqual( a, b ) {
|
||||||
|
if ( a && b ) {
|
||||||
|
if ( a.constructor === Object && b.constructor === Object ) {
|
||||||
|
return isShallowEqualObjects( a, b );
|
||||||
|
} else if ( isArray( a ) && isArray( b ) ) {
|
||||||
|
return isShallowEqualArrays( a, b );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return a === b;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = isShallowEqual;
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/is-shallow-equal/objects.js":
|
||||||
|
/*!*************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/is-shallow-equal/objects.js ***!
|
||||||
|
\*************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
|
||||||
|
var keys = Object.keys;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the two objects are shallow equal, or false otherwise.
|
||||||
|
*
|
||||||
|
* @param {Object} a First object to compare.
|
||||||
|
* @param {Object} b Second object to compare.
|
||||||
|
*
|
||||||
|
* @return {boolean} Whether the two objects are shallow equal.
|
||||||
|
*/
|
||||||
|
function isShallowEqualObjects( a, b ) {
|
||||||
|
var aKeys, bKeys, i, key;
|
||||||
|
|
||||||
|
if ( a === b ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
aKeys = keys( a );
|
||||||
|
bKeys = keys( b );
|
||||||
|
|
||||||
|
if ( aKeys.length !== bKeys.length ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
while ( i < aKeys.length ) {
|
||||||
|
key = aKeys[ i ];
|
||||||
|
if ( a[ key ] !== b[ key ] ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = isShallowEqualObjects;
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=is-shallow-equal.js.map
|
1
wp-includes/js/dist/is-shallow-equal.js.map
vendored
Normal file
1
wp-includes/js/dist/is-shallow-equal.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
468
wp-includes/js/dist/keycodes.js
vendored
Normal file
468
wp-includes/js/dist/keycodes.js
vendored
Normal file
|
@ -0,0 +1,468 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["keycodes"] =
|
||||||
|
/******/ (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/keycodes/build-module/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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/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/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/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/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/@wordpress/keycodes/build-module/index.js":
|
||||||
|
/*!****************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/keycodes/build-module/index.js ***!
|
||||||
|
\****************************************************************/
|
||||||
|
/*! exports provided: BACKSPACE, TAB, ENTER, ESCAPE, SPACE, LEFT, UP, RIGHT, DOWN, DELETE, F10, ALT, CTRL, COMMAND, SHIFT, rawShortcut, displayShortcutList, displayShortcut, shortcutAriaLabel, isKeyboardEvent */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BACKSPACE", function() { return BACKSPACE; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TAB", function() { return TAB; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ENTER", function() { return ENTER; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ESCAPE", function() { return ESCAPE; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SPACE", function() { return SPACE; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LEFT", function() { return LEFT; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UP", function() { return UP; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RIGHT", function() { return RIGHT; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOWN", function() { return DOWN; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DELETE", function() { return DELETE; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F10", function() { return F10; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ALT", function() { return ALT; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CTRL", function() { return CTRL; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMMAND", function() { return COMMAND; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SHIFT", function() { return SHIFT; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rawShortcut", function() { return rawShortcut; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "displayShortcutList", function() { return displayShortcutList; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "displayShortcut", function() { return displayShortcut; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shortcutAriaLabel", function() { return shortcutAriaLabel; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isKeyboardEvent", function() { return isKeyboardEvent; });
|
||||||
|
/* 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_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
|
||||||
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_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 _platform__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./platform */ "./node_modules/@wordpress/keycodes/build-module/platform.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Note: The order of the modifier keys in many of the [foo]Shortcut()
|
||||||
|
* functions in this file are intentional and should not be changed. They're
|
||||||
|
* designed to fit with the standard menu keyboard shortcuts shown in the
|
||||||
|
* user's platform.
|
||||||
|
*
|
||||||
|
* For example, on MacOS menu shortcuts will place Shift before Command, but
|
||||||
|
* on Windows Control will usually come first. So don't provide your own
|
||||||
|
* shortcut combos directly to keyboardShortcut().
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* External dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
var BACKSPACE = 8;
|
||||||
|
var TAB = 9;
|
||||||
|
var ENTER = 13;
|
||||||
|
var ESCAPE = 27;
|
||||||
|
var SPACE = 32;
|
||||||
|
var LEFT = 37;
|
||||||
|
var UP = 38;
|
||||||
|
var RIGHT = 39;
|
||||||
|
var DOWN = 40;
|
||||||
|
var DELETE = 46;
|
||||||
|
var F10 = 121;
|
||||||
|
var ALT = 'alt';
|
||||||
|
var CTRL = 'ctrl'; // Understood in both Mousetrap and TinyMCE.
|
||||||
|
|
||||||
|
var COMMAND = 'meta';
|
||||||
|
var SHIFT = 'shift';
|
||||||
|
var modifiers = {
|
||||||
|
primary: function primary(_isApple) {
|
||||||
|
return _isApple() ? [COMMAND] : [CTRL];
|
||||||
|
},
|
||||||
|
primaryShift: function primaryShift(_isApple) {
|
||||||
|
return _isApple() ? [SHIFT, COMMAND] : [CTRL, SHIFT];
|
||||||
|
},
|
||||||
|
primaryAlt: function primaryAlt(_isApple) {
|
||||||
|
return _isApple() ? [ALT, COMMAND] : [CTRL, ALT];
|
||||||
|
},
|
||||||
|
secondary: function secondary(_isApple) {
|
||||||
|
return _isApple() ? [SHIFT, ALT, COMMAND] : [CTRL, SHIFT, ALT];
|
||||||
|
},
|
||||||
|
access: function access(_isApple) {
|
||||||
|
return _isApple() ? [CTRL, ALT] : [SHIFT, ALT];
|
||||||
|
},
|
||||||
|
ctrl: function ctrl() {
|
||||||
|
return [CTRL];
|
||||||
|
},
|
||||||
|
ctrlShift: function ctrlShift() {
|
||||||
|
return [CTRL, SHIFT];
|
||||||
|
},
|
||||||
|
shift: function shift() {
|
||||||
|
return [SHIFT];
|
||||||
|
},
|
||||||
|
shiftAlt: function shiftAlt() {
|
||||||
|
return [SHIFT, ALT];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* An object that contains functions to get raw shortcuts.
|
||||||
|
* E.g. rawShortcut.primary( 'm' ) will return 'meta+m' on Mac.
|
||||||
|
* These are intended for user with the KeyboardShortcuts component or TinyMCE.
|
||||||
|
*
|
||||||
|
* @type {Object} Keyed map of functions to raw shortcuts.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var rawShortcut = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["mapValues"])(modifiers, function (modifier) {
|
||||||
|
return function (character) {
|
||||||
|
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _platform__WEBPACK_IMPORTED_MODULE_4__["isAppleOS"];
|
||||||
|
|
||||||
|
return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(modifier(_isApple)).concat([character.toLowerCase()]).join('+');
|
||||||
|
};
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* Return an array of the parts of a keyboard shortcut chord for display
|
||||||
|
* E.g displayShortcutList.primary( 'm' ) will return [ '⌘', 'M' ] on Mac.
|
||||||
|
*
|
||||||
|
* @type {Object} keyed map of functions to shortcut sequences
|
||||||
|
*/
|
||||||
|
|
||||||
|
var displayShortcutList = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["mapValues"])(modifiers, function (modifier) {
|
||||||
|
return function (character) {
|
||||||
|
var _replacementKeyMap;
|
||||||
|
|
||||||
|
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _platform__WEBPACK_IMPORTED_MODULE_4__["isAppleOS"];
|
||||||
|
|
||||||
|
var isApple = _isApple();
|
||||||
|
|
||||||
|
var replacementKeyMap = (_replacementKeyMap = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap, ALT, isApple ? '⌥' : 'Alt'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap, CTRL, isApple ? '^' : 'Ctrl'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap, COMMAND, '⌘'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap, SHIFT, isApple ? '⇧' : 'Shift'), _replacementKeyMap);
|
||||||
|
var modifierKeys = modifier(_isApple).reduce(function (accumulator, key) {
|
||||||
|
var replacementKey = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["get"])(replacementKeyMap, key, key); // If on the Mac, adhere to platform convention and don't show plus between keys.
|
||||||
|
|
||||||
|
if (isApple) {
|
||||||
|
return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(accumulator).concat([replacementKey]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(accumulator).concat([replacementKey, '+']);
|
||||||
|
}, []);
|
||||||
|
var capitalizedCharacter = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["capitalize"])(character);
|
||||||
|
return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(modifierKeys).concat([capitalizedCharacter]);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* An object that contains functions to display shortcuts.
|
||||||
|
* E.g. displayShortcut.primary( 'm' ) will return '⌘M' on Mac.
|
||||||
|
*
|
||||||
|
* @type {Object} Keyed map of functions to display shortcuts.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var displayShortcut = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["mapValues"])(displayShortcutList, function (shortcutList) {
|
||||||
|
return function (character) {
|
||||||
|
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _platform__WEBPACK_IMPORTED_MODULE_4__["isAppleOS"];
|
||||||
|
|
||||||
|
return shortcutList(character, _isApple).join('');
|
||||||
|
};
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* An object that contains functions to return an aria label for a keyboard shortcut.
|
||||||
|
* E.g. shortcutAriaLabel.primary( '.' ) will return 'Command + Period' on Mac.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var shortcutAriaLabel = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["mapValues"])(modifiers, function (modifier) {
|
||||||
|
return function (character) {
|
||||||
|
var _replacementKeyMap2;
|
||||||
|
|
||||||
|
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _platform__WEBPACK_IMPORTED_MODULE_4__["isAppleOS"];
|
||||||
|
|
||||||
|
var isApple = _isApple();
|
||||||
|
|
||||||
|
var replacementKeyMap = (_replacementKeyMap2 = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap2, SHIFT, 'Shift'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap2, COMMAND, isApple ? 'Command' : 'Control'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap2, CTRL, 'Control'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap2, ALT, isApple ? 'Option' : 'Alt'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap2, ',', Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Comma')), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap2, '.', Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Period')), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap2, '`', Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Backtick')), _replacementKeyMap2);
|
||||||
|
return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(modifier(_isApple)).concat([character]).map(function (key) {
|
||||||
|
return Object(lodash__WEBPACK_IMPORTED_MODULE_2__["capitalize"])(Object(lodash__WEBPACK_IMPORTED_MODULE_2__["get"])(replacementKeyMap, key, key));
|
||||||
|
}).join(isApple ? ' ' : ' + ');
|
||||||
|
};
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* An object that contains functions to check if a keyboard event matches a
|
||||||
|
* predefined shortcut combination.
|
||||||
|
* E.g. isKeyboardEvent.primary( event, 'm' ) will return true if the event
|
||||||
|
* signals pressing ⌘M.
|
||||||
|
*
|
||||||
|
* @type {Object} Keyed map of functions to match events.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var isKeyboardEvent = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["mapValues"])(modifiers, function (getModifiers) {
|
||||||
|
return function (event, character) {
|
||||||
|
var _isApple = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _platform__WEBPACK_IMPORTED_MODULE_4__["isAppleOS"];
|
||||||
|
|
||||||
|
var mods = getModifiers(_isApple);
|
||||||
|
|
||||||
|
if (!mods.every(function (key) {
|
||||||
|
return event["".concat(key, "Key")];
|
||||||
|
})) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!character) {
|
||||||
|
return Object(lodash__WEBPACK_IMPORTED_MODULE_2__["includes"])(mods, event.key.toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
return event.key === character;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/keycodes/build-module/platform.js":
|
||||||
|
/*!*******************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/keycodes/build-module/platform.js ***!
|
||||||
|
\*******************************************************************/
|
||||||
|
/*! exports provided: isAppleOS */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAppleOS", function() { return isAppleOS; });
|
||||||
|
/* 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
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if platform is MacOS.
|
||||||
|
*
|
||||||
|
* @param {Object} _window window object by default; used for DI testing.
|
||||||
|
*
|
||||||
|
* @return {boolean} True if MacOS; false otherwise.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function isAppleOS() {
|
||||||
|
var _window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
|
||||||
|
|
||||||
|
var platform = _window.navigator.platform;
|
||||||
|
return platform.indexOf('Mac') !== -1 || Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(['iPad', 'iPhone'], platform);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/i18n":
|
||||||
|
/*!***************************************!*\
|
||||||
|
!*** external {"this":["wp","i18n"]} ***!
|
||||||
|
\***************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["i18n"]; }());
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "lodash":
|
||||||
|
/*!*************************!*\
|
||||||
|
!*** external "lodash" ***!
|
||||||
|
\*************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["lodash"]; }());
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=keycodes.js.map
|
1
wp-includes/js/dist/keycodes.js.map
vendored
Normal file
1
wp-includes/js/dist/keycodes.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
954
wp-includes/js/dist/list-reusable-blocks.js
vendored
Normal file
954
wp-includes/js/dist/list-reusable-blocks.js
vendored
Normal file
|
@ -0,0 +1,954 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["listReusableBlocks"] =
|
||||||
|
/******/ (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/list-reusable-blocks/build-module/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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/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/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/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/list-reusable-blocks/build-module/components/import-dropdown/index.js":
|
||||||
|
/*!*******************************************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-dropdown/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_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 _import_form__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../import-form */ "./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-form/index.js");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* External dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function ImportDropdown(_ref) {
|
||||||
|
var onUpload = _ref.onUpload;
|
||||||
|
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["Dropdown"], {
|
||||||
|
position: "bottom right",
|
||||||
|
contentClassName: "list-reusable-blocks-import-dropdown__content",
|
||||||
|
renderToggle: function renderToggle(_ref2) {
|
||||||
|
var isOpen = _ref2.isOpen,
|
||||||
|
onToggle = _ref2.onToggle;
|
||||||
|
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__["Button"], {
|
||||||
|
type: "button",
|
||||||
|
"aria-expanded": isOpen,
|
||||||
|
onClick: onToggle,
|
||||||
|
isPrimary: true
|
||||||
|
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Import from JSON'));
|
||||||
|
},
|
||||||
|
renderContent: function renderContent(_ref3) {
|
||||||
|
var onClose = _ref3.onClose;
|
||||||
|
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_import_form__WEBPACK_IMPORTED_MODULE_4__["default"], {
|
||||||
|
onUpload: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["flow"])(onClose, onUpload)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (ImportDropdown);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-form/index.js":
|
||||||
|
/*!***************************************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-form/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_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_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 _utils_import__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utils/import */ "./node_modules/@wordpress/list-reusable-blocks/build-module/utils/import.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var ImportForm =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Component) {
|
||||||
|
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(ImportForm, _Component);
|
||||||
|
|
||||||
|
function ImportForm() {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, ImportForm);
|
||||||
|
|
||||||
|
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(ImportForm).apply(this, arguments));
|
||||||
|
_this.state = {
|
||||||
|
isLoading: false,
|
||||||
|
error: null,
|
||||||
|
file: null
|
||||||
|
};
|
||||||
|
_this.isStillMounted = true;
|
||||||
|
_this.onChangeFile = _this.onChangeFile.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.onSubmit = _this.onSubmit.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"])(ImportForm, [{
|
||||||
|
key: "componentWillUnmount",
|
||||||
|
value: function componentWillUnmount() {
|
||||||
|
this.isStillMounted = false;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "onChangeFile",
|
||||||
|
value: function onChangeFile(event) {
|
||||||
|
this.setState({
|
||||||
|
file: event.target.files[0]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "onSubmit",
|
||||||
|
value: function onSubmit(event) {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
var file = this.state.file;
|
||||||
|
var onUpload = this.props.onUpload;
|
||||||
|
|
||||||
|
if (!file) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
isLoading: true
|
||||||
|
});
|
||||||
|
Object(_utils_import__WEBPACK_IMPORTED_MODULE_10__["default"])(file).then(function (reusableBlock) {
|
||||||
|
if (!_this2.isStillMounted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_this2.setState({
|
||||||
|
isLoading: false
|
||||||
|
});
|
||||||
|
|
||||||
|
onUpload(reusableBlock);
|
||||||
|
}).catch(function (error) {
|
||||||
|
if (!_this2.isStillMounted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var uiMessage;
|
||||||
|
|
||||||
|
switch (error.message) {
|
||||||
|
case 'Invalid JSON file':
|
||||||
|
uiMessage = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Invalid JSON file');
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Invalid Reusable Block JSON file':
|
||||||
|
uiMessage = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Invalid Reusable Block JSON file');
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
uiMessage = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Unknown error');
|
||||||
|
}
|
||||||
|
|
||||||
|
_this2.setState({
|
||||||
|
isLoading: false,
|
||||||
|
error: uiMessage
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var instanceId = this.props.instanceId;
|
||||||
|
var _this$state = this.state,
|
||||||
|
file = _this$state.file,
|
||||||
|
isLoading = _this$state.isLoading,
|
||||||
|
error = _this$state.error;
|
||||||
|
var inputId = 'list-reusable-blocks-import-form-' + instanceId;
|
||||||
|
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("form", {
|
||||||
|
className: "list-reusable-blocks-import-form",
|
||||||
|
onSubmit: this.onSubmit
|
||||||
|
}, error && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["Notice"], {
|
||||||
|
status: "error"
|
||||||
|
}, error), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("label", {
|
||||||
|
htmlFor: inputId,
|
||||||
|
className: "list-reusable-blocks-import-form__label"
|
||||||
|
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('File')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", {
|
||||||
|
id: inputId,
|
||||||
|
type: "file",
|
||||||
|
onChange: this.onChangeFile
|
||||||
|
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["Button"], {
|
||||||
|
type: "submit",
|
||||||
|
isBusy: isLoading,
|
||||||
|
disabled: !file || isLoading,
|
||||||
|
isDefault: true,
|
||||||
|
className: "list-reusable-blocks-import-form__button"
|
||||||
|
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Import')));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return ImportForm;
|
||||||
|
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__["withInstanceId"])(ImportForm));
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/list-reusable-blocks/build-module/index.js":
|
||||||
|
/*!****************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/list-reusable-blocks/build-module/index.js ***!
|
||||||
|
\****************************************************************************/
|
||||||
|
/*! no exports provided */
|
||||||
|
/***/ (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 _utils_export__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/export */ "./node_modules/@wordpress/list-reusable-blocks/build-module/utils/export.js");
|
||||||
|
/* harmony import */ var _components_import_dropdown__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/import-dropdown */ "./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-dropdown/index.js");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// Setup Export Links
|
||||||
|
|
||||||
|
document.body.addEventListener('click', function (event) {
|
||||||
|
if (!event.target.classList.contains('wp-list-reusable-blocks__export')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
Object(_utils_export__WEBPACK_IMPORTED_MODULE_2__["default"])(event.target.dataset.id);
|
||||||
|
}); // Setup Import Form
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
var button = document.querySelector('.page-title-action');
|
||||||
|
|
||||||
|
if (!button) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var showNotice = function showNotice() {
|
||||||
|
var notice = document.createElement('div');
|
||||||
|
notice.className = 'notice notice-success is-dismissible';
|
||||||
|
notice.innerHTML = "<p>".concat(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Reusable block imported successfully!'), "</p>");
|
||||||
|
var headerEnd = document.querySelector('.wp-header-end');
|
||||||
|
|
||||||
|
if (!headerEnd) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
headerEnd.parentNode.insertBefore(notice, headerEnd);
|
||||||
|
};
|
||||||
|
|
||||||
|
var container = document.createElement('div');
|
||||||
|
container.className = 'list-reusable-blocks__container';
|
||||||
|
button.parentNode.insertBefore(container, button);
|
||||||
|
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["render"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_components_import_dropdown__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
||||||
|
onUpload: showNotice
|
||||||
|
}), container);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/list-reusable-blocks/build-module/utils/export.js":
|
||||||
|
/*!***********************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/export.js ***!
|
||||||
|
\***********************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
|
||||||
|
/* harmony import */ var 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_api_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
|
||||||
|
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
|
/* harmony import */ var _file__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./file */ "./node_modules/@wordpress/list-reusable-blocks/build-module/utils/file.js");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* External dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Export a reusable block as a JSON file.
|
||||||
|
*
|
||||||
|
* @param {number} id
|
||||||
|
*/
|
||||||
|
|
||||||
|
function exportReusableBlock(_x) {
|
||||||
|
return _exportReusableBlock.apply(this, arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
function _exportReusableBlock() {
|
||||||
|
_exportReusableBlock = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])(
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(function _callee(id) {
|
||||||
|
var postType, post, title, content, fileContent, fileName;
|
||||||
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context.prev = _context.next) {
|
||||||
|
case 0:
|
||||||
|
_context.next = 2;
|
||||||
|
return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({
|
||||||
|
path: "/wp/v2/types/wp_block"
|
||||||
|
});
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
postType = _context.sent;
|
||||||
|
_context.next = 5;
|
||||||
|
return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({
|
||||||
|
path: "/wp/v2/".concat(postType.rest_base, "/").concat(id, "?context=edit")
|
||||||
|
});
|
||||||
|
|
||||||
|
case 5:
|
||||||
|
post = _context.sent;
|
||||||
|
title = post.title.raw;
|
||||||
|
content = post.content.raw;
|
||||||
|
fileContent = JSON.stringify({
|
||||||
|
__file: 'wp_block',
|
||||||
|
title: title,
|
||||||
|
content: content
|
||||||
|
}, null, 2);
|
||||||
|
fileName = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["kebabCase"])(title) + '.json';
|
||||||
|
Object(_file__WEBPACK_IMPORTED_MODULE_3__["download"])(fileName, fileContent, 'application/json');
|
||||||
|
|
||||||
|
case 11:
|
||||||
|
case "end":
|
||||||
|
return _context.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _callee, this);
|
||||||
|
}));
|
||||||
|
return _exportReusableBlock.apply(this, arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (exportReusableBlock);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/list-reusable-blocks/build-module/utils/file.js":
|
||||||
|
/*!*********************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/file.js ***!
|
||||||
|
\*********************************************************************************/
|
||||||
|
/*! exports provided: download, readTextFile */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "download", function() { return download; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readTextFile", function() { return readTextFile; });
|
||||||
|
/**
|
||||||
|
* Downloads a file.
|
||||||
|
*
|
||||||
|
* @param {string} fileName File Name.
|
||||||
|
* @param {string} content File Content.
|
||||||
|
* @param {string} contentType File mime type.
|
||||||
|
*/
|
||||||
|
function download(fileName, content, contentType) {
|
||||||
|
var file = new window.Blob([content], {
|
||||||
|
type: contentType
|
||||||
|
}); // IE11 can't use the click to download technique
|
||||||
|
// we use a specific IE11 technique instead.
|
||||||
|
|
||||||
|
if (window.navigator.msSaveOrOpenBlob) {
|
||||||
|
window.navigator.msSaveOrOpenBlob(file, fileName);
|
||||||
|
} else {
|
||||||
|
var a = document.createElement('a');
|
||||||
|
a.href = URL.createObjectURL(file);
|
||||||
|
a.download = fileName;
|
||||||
|
a.style.display = 'none';
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
document.body.removeChild(a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Reads the textual content of the given file.
|
||||||
|
*
|
||||||
|
* @param {File} file File.
|
||||||
|
* @return {Promise<string>} Content of the file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function readTextFile(file) {
|
||||||
|
var reader = new window.FileReader();
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
reader.onload = function () {
|
||||||
|
resolve(reader.result);
|
||||||
|
};
|
||||||
|
|
||||||
|
reader.readAsText(file);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/list-reusable-blocks/build-module/utils/import.js":
|
||||||
|
/*!***********************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/import.js ***!
|
||||||
|
\***********************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
|
||||||
|
/* harmony import */ var 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_api_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
|
||||||
|
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
|
/* harmony import */ var _file__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./file */ "./node_modules/@wordpress/list-reusable-blocks/build-module/utils/file.js");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* External dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Import a reusable block from a JSON file.
|
||||||
|
*
|
||||||
|
* @param {File} file File.
|
||||||
|
* @return {Promise} Promise returning the imported reusable block.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function importReusableBlock(_x) {
|
||||||
|
return _importReusableBlock.apply(this, arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
function _importReusableBlock() {
|
||||||
|
_importReusableBlock = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])(
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(function _callee(file) {
|
||||||
|
var fileContent, parsedContent, postType, reusableBlock;
|
||||||
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context.prev = _context.next) {
|
||||||
|
case 0:
|
||||||
|
_context.next = 2;
|
||||||
|
return Object(_file__WEBPACK_IMPORTED_MODULE_3__["readTextFile"])(file);
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
fileContent = _context.sent;
|
||||||
|
_context.prev = 3;
|
||||||
|
parsedContent = JSON.parse(fileContent);
|
||||||
|
_context.next = 10;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 7:
|
||||||
|
_context.prev = 7;
|
||||||
|
_context.t0 = _context["catch"](3);
|
||||||
|
throw new Error('Invalid JSON file');
|
||||||
|
|
||||||
|
case 10:
|
||||||
|
if (!(parsedContent.__file !== 'wp_block' || !parsedContent.title || !parsedContent.content || !Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isString"])(parsedContent.title) || !Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isString"])(parsedContent.content))) {
|
||||||
|
_context.next = 12;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error('Invalid Reusable Block JSON file');
|
||||||
|
|
||||||
|
case 12:
|
||||||
|
_context.next = 14;
|
||||||
|
return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({
|
||||||
|
path: "/wp/v2/types/wp_block"
|
||||||
|
});
|
||||||
|
|
||||||
|
case 14:
|
||||||
|
postType = _context.sent;
|
||||||
|
_context.next = 17;
|
||||||
|
return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({
|
||||||
|
path: "/wp/v2/".concat(postType.rest_base),
|
||||||
|
data: {
|
||||||
|
title: parsedContent.title,
|
||||||
|
content: parsedContent.content,
|
||||||
|
status: 'publish'
|
||||||
|
},
|
||||||
|
method: 'POST'
|
||||||
|
});
|
||||||
|
|
||||||
|
case 17:
|
||||||
|
reusableBlock = _context.sent;
|
||||||
|
return _context.abrupt("return", reusableBlock);
|
||||||
|
|
||||||
|
case 19:
|
||||||
|
case "end":
|
||||||
|
return _context.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _callee, this, [[3, 7]]);
|
||||||
|
}));
|
||||||
|
return _importReusableBlock.apply(this, arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (importReusableBlock);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/api-fetch":
|
||||||
|
/*!*******************************************!*\
|
||||||
|
!*** external {"this":["wp","apiFetch"]} ***!
|
||||||
|
\*******************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["apiFetch"]; }());
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/components":
|
||||||
|
/*!*********************************************!*\
|
||||||
|
!*** external {"this":["wp","components"]} ***!
|
||||||
|
\*********************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["components"]; }());
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/compose":
|
||||||
|
/*!******************************************!*\
|
||||||
|
!*** external {"this":["wp","compose"]} ***!
|
||||||
|
\******************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["compose"]; }());
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/element":
|
||||||
|
/*!******************************************!*\
|
||||||
|
!*** external {"this":["wp","element"]} ***!
|
||||||
|
\******************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["element"]; }());
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/i18n":
|
||||||
|
/*!***************************************!*\
|
||||||
|
!*** external {"this":["wp","i18n"]} ***!
|
||||||
|
\***************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["i18n"]; }());
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "lodash":
|
||||||
|
/*!*************************!*\
|
||||||
|
!*** external "lodash" ***!
|
||||||
|
\*************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["lodash"]; }());
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=list-reusable-blocks.js.map
|
1
wp-includes/js/dist/list-reusable-blocks.js.map
vendored
Normal file
1
wp-includes/js/dist/list-reusable-blocks.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1138
wp-includes/js/dist/nux.js
vendored
Normal file
1138
wp-includes/js/dist/nux.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
wp-includes/js/dist/nux.js.map
vendored
Normal file
1
wp-includes/js/dist/nux.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
778
wp-includes/js/dist/plugins.js
vendored
Normal file
778
wp-includes/js/dist/plugins.js
vendored
Normal file
|
@ -0,0 +1,778 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["plugins"] =
|
||||||
|
/******/ (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/plugins/build-module/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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/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/objectSpread.js":
|
||||||
|
/*!*****************************************************************!*\
|
||||||
|
!*** ./node_modules/@babel/runtime/helpers/esm/objectSpread.js ***!
|
||||||
|
\*****************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectSpread; });
|
||||||
|
/* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
|
||||||
|
|
||||||
|
function _objectSpread(target) {
|
||||||
|
for (var i = 1; i < arguments.length; i++) {
|
||||||
|
var source = arguments[i] != null ? arguments[i] : {};
|
||||||
|
var ownKeys = Object.keys(source);
|
||||||
|
|
||||||
|
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||||
|
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
||||||
|
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
ownKeys.forEach(function (key) {
|
||||||
|
Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js":
|
||||||
|
/*!******************************************************************************!*\
|
||||||
|
!*** ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js ***!
|
||||||
|
\******************************************************************************/
|
||||||
|
/*! 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/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/plugins/build-module/api/index.js":
|
||||||
|
/*!*******************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/plugins/build-module/api/index.js ***!
|
||||||
|
\*******************************************************************/
|
||||||
|
/*! exports provided: registerPlugin, unregisterPlugin, getPlugin, getPlugins */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerPlugin", function() { return registerPlugin; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unregisterPlugin", function() { return unregisterPlugin; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPlugin", function() { return getPlugin; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPlugins", function() { return getPlugins; });
|
||||||
|
/* 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_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
|
||||||
|
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
|
||||||
|
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__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__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* eslint no-console: [ 'error', { allow: [ 'error' ] } ] */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* External dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Plugin definitions keyed by plugin name.
|
||||||
|
*
|
||||||
|
* @type {Object.<string,WPPlugin>}
|
||||||
|
*/
|
||||||
|
|
||||||
|
var plugins = {};
|
||||||
|
/**
|
||||||
|
* Registers a plugin to the editor.
|
||||||
|
*
|
||||||
|
* @param {string} name The name of the plugin.
|
||||||
|
* @param {Object} settings The settings for this plugin.
|
||||||
|
* @param {Function} settings.render The function that renders the plugin.
|
||||||
|
* @param {string|WPElement|Function} settings.icon An icon to be shown in the UI.
|
||||||
|
*
|
||||||
|
* @return {Object} The final plugin settings object.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function registerPlugin(name, settings) {
|
||||||
|
if (Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_1__["default"])(settings) !== 'object') {
|
||||||
|
console.error('No settings object provided!');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof name !== 'string') {
|
||||||
|
console.error('Plugin names must be strings.');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!/^[a-z][a-z0-9-]*$/.test(name)) {
|
||||||
|
console.error('Plugin names must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (plugins[name]) {
|
||||||
|
console.error("Plugin \"".concat(name, "\" is already registered."));
|
||||||
|
}
|
||||||
|
|
||||||
|
settings = Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__["applyFilters"])('plugins.registerPlugin', settings, name);
|
||||||
|
|
||||||
|
if (!Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isFunction"])(settings.render)) {
|
||||||
|
console.error('The "render" property must be specified and must be a valid function.');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins[name] = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({
|
||||||
|
name: name,
|
||||||
|
icon: 'admin-plugins'
|
||||||
|
}, settings);
|
||||||
|
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__["doAction"])('plugins.pluginRegistered', settings, name);
|
||||||
|
return settings;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Unregisters a plugin by name.
|
||||||
|
*
|
||||||
|
* @param {string} name Plugin name.
|
||||||
|
*
|
||||||
|
* @return {?WPPlugin} The previous plugin settings object, if it has been
|
||||||
|
* successfully unregistered; otherwise `undefined`.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function unregisterPlugin(name) {
|
||||||
|
if (!plugins[name]) {
|
||||||
|
console.error('Plugin "' + name + '" is not registered.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var oldPlugin = plugins[name];
|
||||||
|
delete plugins[name];
|
||||||
|
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__["doAction"])('plugins.pluginUnregistered', oldPlugin, name);
|
||||||
|
return oldPlugin;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns a registered plugin settings.
|
||||||
|
*
|
||||||
|
* @param {string} name Plugin name.
|
||||||
|
*
|
||||||
|
* @return {?Object} Plugin setting.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function getPlugin(name) {
|
||||||
|
return plugins[name];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns all registered plugins.
|
||||||
|
*
|
||||||
|
* @return {Array} Plugin settings.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function getPlugins() {
|
||||||
|
return Object.values(plugins);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/plugins/build-module/components/index.js":
|
||||||
|
/*!**************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/plugins/build-module/components/index.js ***!
|
||||||
|
\**************************************************************************/
|
||||||
|
/*! exports provided: PluginArea, withPluginContext */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _plugin_area__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./plugin-area */ "./node_modules/@wordpress/plugins/build-module/components/plugin-area/index.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PluginArea", function() { return _plugin_area__WEBPACK_IMPORTED_MODULE_0__["default"]; });
|
||||||
|
|
||||||
|
/* harmony import */ var _plugin_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./plugin-context */ "./node_modules/@wordpress/plugins/build-module/components/plugin-context/index.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withPluginContext", function() { return _plugin_context__WEBPACK_IMPORTED_MODULE_1__["withPluginContext"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/plugins/build-module/components/plugin-area/index.js":
|
||||||
|
/*!**************************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/plugins/build-module/components/plugin-area/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_hooks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
|
||||||
|
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_8__);
|
||||||
|
/* harmony import */ var _plugin_context__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../plugin-context */ "./node_modules/@wordpress/plugins/build-module/components/plugin-context/index.js");
|
||||||
|
/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../api */ "./node_modules/@wordpress/plugins/build-module/api/index.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* External dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A component that renders all plugin fills in a hidden div.
|
||||||
|
*
|
||||||
|
* @return {WPElement} Plugin area.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var PluginArea =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Component) {
|
||||||
|
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PluginArea, _Component);
|
||||||
|
|
||||||
|
function PluginArea() {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PluginArea);
|
||||||
|
|
||||||
|
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PluginArea).apply(this, arguments));
|
||||||
|
_this.setPlugins = _this.setPlugins.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 = _this.getCurrentPluginsState();
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PluginArea, [{
|
||||||
|
key: "getCurrentPluginsState",
|
||||||
|
value: function getCurrentPluginsState() {
|
||||||
|
return {
|
||||||
|
plugins: Object(lodash__WEBPACK_IMPORTED_MODULE_7__["map"])(Object(_api__WEBPACK_IMPORTED_MODULE_10__["getPlugins"])(), function (_ref) {
|
||||||
|
var icon = _ref.icon,
|
||||||
|
name = _ref.name,
|
||||||
|
render = _ref.render;
|
||||||
|
return {
|
||||||
|
Plugin: render,
|
||||||
|
context: {
|
||||||
|
name: name,
|
||||||
|
icon: icon
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "componentDidMount",
|
||||||
|
value: function componentDidMount() {
|
||||||
|
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_8__["addAction"])('plugins.pluginRegistered', 'core/plugins/plugin-area/plugins-registered', this.setPlugins);
|
||||||
|
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_8__["addAction"])('plugins.pluginUnregistered', 'core/plugins/plugin-area/plugins-unregistered', this.setPlugins);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "componentWillUnmount",
|
||||||
|
value: function componentWillUnmount() {
|
||||||
|
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_8__["removeAction"])('plugins.pluginRegistered', 'core/plugins/plugin-area/plugins-registered');
|
||||||
|
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_8__["removeAction"])('plugins.pluginUnregistered', 'core/plugins/plugin-area/plugins-unregistered');
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "setPlugins",
|
||||||
|
value: function setPlugins() {
|
||||||
|
this.setState(this.getCurrentPluginsState);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
|
||||||
|
style: {
|
||||||
|
display: 'none'
|
||||||
|
}
|
||||||
|
}, Object(lodash__WEBPACK_IMPORTED_MODULE_7__["map"])(this.state.plugins, function (_ref2) {
|
||||||
|
var context = _ref2.context,
|
||||||
|
Plugin = _ref2.Plugin;
|
||||||
|
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_plugin_context__WEBPACK_IMPORTED_MODULE_9__["PluginContextProvider"], {
|
||||||
|
key: context.name,
|
||||||
|
value: context
|
||||||
|
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(Plugin, null));
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return PluginArea;
|
||||||
|
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (PluginArea);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/plugins/build-module/components/plugin-context/index.js":
|
||||||
|
/*!*****************************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/plugins/build-module/components/plugin-context/index.js ***!
|
||||||
|
\*****************************************************************************************/
|
||||||
|
/*! exports provided: PluginContextProvider, withPluginContext */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PluginContextProvider", function() { return Provider; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withPluginContext", function() { return withPluginContext; });
|
||||||
|
/* 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 _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__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var _createContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createContext"])({
|
||||||
|
name: null,
|
||||||
|
icon: null
|
||||||
|
}),
|
||||||
|
Consumer = _createContext.Consumer,
|
||||||
|
Provider = _createContext.Provider;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Higher Order Component used to inject Plugin 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 withPluginContext = function withPluginContext(mapContextToProps) {
|
||||||
|
return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["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)));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}, 'withPluginContext');
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/plugins/build-module/index.js":
|
||||||
|
/*!***************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/plugins/build-module/index.js ***!
|
||||||
|
\***************************************************************/
|
||||||
|
/*! exports provided: PluginArea, withPluginContext, registerPlugin, unregisterPlugin, getPlugin, getPlugins */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./components */ "./node_modules/@wordpress/plugins/build-module/components/index.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PluginArea", function() { return _components__WEBPACK_IMPORTED_MODULE_0__["PluginArea"]; });
|
||||||
|
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withPluginContext", function() { return _components__WEBPACK_IMPORTED_MODULE_0__["withPluginContext"]; });
|
||||||
|
|
||||||
|
/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./api */ "./node_modules/@wordpress/plugins/build-module/api/index.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerPlugin", function() { return _api__WEBPACK_IMPORTED_MODULE_1__["registerPlugin"]; });
|
||||||
|
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unregisterPlugin", function() { return _api__WEBPACK_IMPORTED_MODULE_1__["unregisterPlugin"]; });
|
||||||
|
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getPlugin", function() { return _api__WEBPACK_IMPORTED_MODULE_1__["getPlugin"]; });
|
||||||
|
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getPlugins", function() { return _api__WEBPACK_IMPORTED_MODULE_1__["getPlugins"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/compose":
|
||||||
|
/*!******************************************!*\
|
||||||
|
!*** external {"this":["wp","compose"]} ***!
|
||||||
|
\******************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["compose"]; }());
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/element":
|
||||||
|
/*!******************************************!*\
|
||||||
|
!*** external {"this":["wp","element"]} ***!
|
||||||
|
\******************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["element"]; }());
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/hooks":
|
||||||
|
/*!****************************************!*\
|
||||||
|
!*** external {"this":["wp","hooks"]} ***!
|
||||||
|
\****************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["hooks"]; }());
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "lodash":
|
||||||
|
/*!*************************!*\
|
||||||
|
!*** external "lodash" ***!
|
||||||
|
\*************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["lodash"]; }());
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=plugins.js.map
|
1
wp-includes/js/dist/plugins.js.map
vendored
Normal file
1
wp-includes/js/dist/plugins.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1082
wp-includes/js/dist/redux-routine.js
vendored
Normal file
1082
wp-includes/js/dist/redux-routine.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
wp-includes/js/dist/redux-routine.js.map
vendored
Normal file
1
wp-includes/js/dist/redux-routine.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
2244
wp-includes/js/dist/rich-text.js
vendored
Normal file
2244
wp-includes/js/dist/rich-text.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
wp-includes/js/dist/rich-text.js.map
vendored
Normal file
1
wp-includes/js/dist/rich-text.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
598
wp-includes/js/dist/shortcode.js
vendored
Normal file
598
wp-includes/js/dist/shortcode.js
vendored
Normal file
|
@ -0,0 +1,598 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["shortcode"] =
|
||||||
|
/******/ (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/shortcode/build-module/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/shortcode/build-module/index.js":
|
||||||
|
/*!*****************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/shortcode/build-module/index.js ***!
|
||||||
|
\*****************************************************************/
|
||||||
|
/*! exports provided: next, replace, string, regexp, attrs, fromMatch, default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "next", function() { return next; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return replace; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "string", function() { return string; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regexp", function() { return regexp; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "attrs", function() { return attrs; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromMatch", function() { return fromMatch; });
|
||||||
|
/* 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 memize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! memize */ "./node_modules/memize/index.js");
|
||||||
|
/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(memize__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shortcode attributes object.
|
||||||
|
*
|
||||||
|
* @typedef {Object} WPShortcodeAttrs
|
||||||
|
*
|
||||||
|
* @property {Object} named Object with named attributes.
|
||||||
|
* @property {Array} numeric Array with numeric attributes.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shortcode object.
|
||||||
|
*
|
||||||
|
* @typedef {Object} WPShortcode
|
||||||
|
*
|
||||||
|
* @property {string} tag Shortcode tag.
|
||||||
|
* @property {WPShortcodeAttrs} attrs Shortcode attributes.
|
||||||
|
* @property {string} content Shortcode content.
|
||||||
|
* @property {string} type Shortcode type: `self-closing`,
|
||||||
|
* `closed`, or `single`.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} WPShortcodeMatch
|
||||||
|
*
|
||||||
|
* @property {number} index Index the shortcode is found at.
|
||||||
|
* @property {string} content Matched content.
|
||||||
|
* @property {WPShortcode} shortcode Shortcode instance of the match.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find the next matching shortcode.
|
||||||
|
*
|
||||||
|
* @param {string} tag Shortcode tag.
|
||||||
|
* @param {string} text Text to search.
|
||||||
|
* @param {number} index Index to start search from.
|
||||||
|
*
|
||||||
|
* @return {?WPShortcodeMatch} Matched information.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function next(tag, text) {
|
||||||
|
var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
||||||
|
var re = regexp(tag);
|
||||||
|
re.lastIndex = index;
|
||||||
|
var match = re.exec(text);
|
||||||
|
|
||||||
|
if (!match) {
|
||||||
|
return;
|
||||||
|
} // If we matched an escaped shortcode, try again.
|
||||||
|
|
||||||
|
|
||||||
|
if ('[' === match[1] && ']' === match[7]) {
|
||||||
|
return next(tag, text, re.lastIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = {
|
||||||
|
index: match.index,
|
||||||
|
content: match[0],
|
||||||
|
shortcode: fromMatch(match)
|
||||||
|
}; // If we matched a leading `[`, strip it from the match and increment the
|
||||||
|
// index accordingly.
|
||||||
|
|
||||||
|
if (match[1]) {
|
||||||
|
result.content = result.content.slice(1);
|
||||||
|
result.index++;
|
||||||
|
} // If we matched a trailing `]`, strip it from the match.
|
||||||
|
|
||||||
|
|
||||||
|
if (match[7]) {
|
||||||
|
result.content = result.content.slice(0, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Replace matching shortcodes in a block of text.
|
||||||
|
*
|
||||||
|
* @param {string} tag Shortcode tag.
|
||||||
|
* @param {string} text Text to search.
|
||||||
|
* @param {Function} callback Function to process the match and return
|
||||||
|
* replacement string.
|
||||||
|
*
|
||||||
|
* @return {string} Text with shortcodes replaced.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function replace(tag, text, callback) {
|
||||||
|
var _arguments = arguments;
|
||||||
|
return text.replace(regexp(tag), function (match, left, $3, attrs, slash, content, closing, right) {
|
||||||
|
// If both extra brackets exist, the shortcode has been properly
|
||||||
|
// escaped.
|
||||||
|
if (left === '[' && right === ']') {
|
||||||
|
return match;
|
||||||
|
} // Create the match object and pass it through the callback.
|
||||||
|
|
||||||
|
|
||||||
|
var result = callback(fromMatch(_arguments)); // Make sure to return any of the extra brackets if they weren't used to
|
||||||
|
// escape the shortcode.
|
||||||
|
|
||||||
|
return result ? left + result + right : match;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Generate a string from shortcode parameters.
|
||||||
|
*
|
||||||
|
* Creates a shortcode instance and returns a string.
|
||||||
|
*
|
||||||
|
* Accepts the same `options` as the `shortcode()` constructor, containing a
|
||||||
|
* `tag` string, a string or object of `attrs`, a boolean indicating whether to
|
||||||
|
* format the shortcode using a `single` tag, and a `content` string.
|
||||||
|
*
|
||||||
|
* @param {Object} options
|
||||||
|
*
|
||||||
|
* @return {string} String representation of the shortcode.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function string(options) {
|
||||||
|
return new shortcode(options).string();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Generate a RegExp to identify a shortcode.
|
||||||
|
*
|
||||||
|
* The base regex is functionally equivalent to the one found in
|
||||||
|
* `get_shortcode_regex()` in `wp-includes/shortcodes.php`.
|
||||||
|
*
|
||||||
|
* Capture groups:
|
||||||
|
*
|
||||||
|
* 1. An extra `[` to allow for escaping shortcodes with double `[[]]`
|
||||||
|
* 2. The shortcode name
|
||||||
|
* 3. The shortcode argument list
|
||||||
|
* 4. The self closing `/`
|
||||||
|
* 5. The content of a shortcode when it wraps some content.
|
||||||
|
* 6. The closing tag.
|
||||||
|
* 7. An extra `]` to allow for escaping shortcodes with double `[[]]`
|
||||||
|
*
|
||||||
|
* @param {string} tag Shortcode tag.
|
||||||
|
*
|
||||||
|
* @return {RegExp} Shortcode RegExp.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function regexp(tag) {
|
||||||
|
return new RegExp('\\[(\\[?)(' + tag + ')(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)', 'g');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Parse shortcode attributes.
|
||||||
|
*
|
||||||
|
* Shortcodes accept many types of attributes. These can chiefly be divided into
|
||||||
|
* named and numeric attributes:
|
||||||
|
*
|
||||||
|
* Named attributes are assigned on a key/value basis, while numeric attributes
|
||||||
|
* are treated as an array.
|
||||||
|
*
|
||||||
|
* Named attributes can be formatted as either `name="value"`, `name='value'`,
|
||||||
|
* or `name=value`. Numeric attributes can be formatted as `"value"` or just
|
||||||
|
* `value`.
|
||||||
|
*
|
||||||
|
* @param {string} text Serialised shortcode attributes.
|
||||||
|
*
|
||||||
|
* @return {WPShortcodeAttrs} Parsed shortcode attributes.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var attrs = memize__WEBPACK_IMPORTED_MODULE_1___default()(function (text) {
|
||||||
|
var named = {};
|
||||||
|
var numeric = []; // This regular expression is reused from `shortcode_parse_atts()` in
|
||||||
|
// `wp-includes/shortcodes.php`.
|
||||||
|
//
|
||||||
|
// Capture groups:
|
||||||
|
//
|
||||||
|
// 1. An attribute name, that corresponds to...
|
||||||
|
// 2. a value in double quotes.
|
||||||
|
// 3. An attribute name, that corresponds to...
|
||||||
|
// 4. a value in single quotes.
|
||||||
|
// 5. An attribute name, that corresponds to...
|
||||||
|
// 6. an unquoted value.
|
||||||
|
// 7. A numeric attribute in double quotes.
|
||||||
|
// 8. A numeric attribute in single quotes.
|
||||||
|
// 9. An unquoted numeric attribute.
|
||||||
|
|
||||||
|
var pattern = /([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g; // Map zero-width spaces to actual spaces.
|
||||||
|
|
||||||
|
text = text.replace(/[\u00a0\u200b]/g, ' ');
|
||||||
|
var match; // Match and normalize attributes.
|
||||||
|
|
||||||
|
while (match = pattern.exec(text)) {
|
||||||
|
if (match[1]) {
|
||||||
|
named[match[1].toLowerCase()] = match[2];
|
||||||
|
} else if (match[3]) {
|
||||||
|
named[match[3].toLowerCase()] = match[4];
|
||||||
|
} else if (match[5]) {
|
||||||
|
named[match[5].toLowerCase()] = match[6];
|
||||||
|
} else if (match[7]) {
|
||||||
|
numeric.push(match[7]);
|
||||||
|
} else if (match[8]) {
|
||||||
|
numeric.push(match[8]);
|
||||||
|
} else if (match[9]) {
|
||||||
|
numeric.push(match[9]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
named: named,
|
||||||
|
numeric: numeric
|
||||||
|
};
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* Generate a Shortcode Object from a RegExp match.
|
||||||
|
*
|
||||||
|
* Accepts a `match` object from calling `regexp.exec()` on a `RegExp` generated
|
||||||
|
* by `regexp()`. `match` can also be set to the `arguments` from a callback
|
||||||
|
* passed to `regexp.replace()`.
|
||||||
|
*
|
||||||
|
* @param {Array} match Match array.
|
||||||
|
*
|
||||||
|
* @return {WPShortcode} Shortcode instance.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function fromMatch(match) {
|
||||||
|
var type;
|
||||||
|
|
||||||
|
if (match[4]) {
|
||||||
|
type = 'self-closing';
|
||||||
|
} else if (match[6]) {
|
||||||
|
type = 'closed';
|
||||||
|
} else {
|
||||||
|
type = 'single';
|
||||||
|
}
|
||||||
|
|
||||||
|
return new shortcode({
|
||||||
|
tag: match[2],
|
||||||
|
attrs: match[3],
|
||||||
|
type: type,
|
||||||
|
content: match[5]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Creates a shortcode instance.
|
||||||
|
*
|
||||||
|
* To access a raw representation of a shortcode, pass an `options` object,
|
||||||
|
* containing a `tag` string, a string or object of `attrs`, a string indicating
|
||||||
|
* the `type` of the shortcode ('single', 'self-closing', or 'closed'), and a
|
||||||
|
* `content` string.
|
||||||
|
*
|
||||||
|
* @param {Object} options Options as described.
|
||||||
|
*
|
||||||
|
* @return {WPShortcode} Shortcode instance.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var shortcode = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["extend"])(function (options) {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
Object(lodash__WEBPACK_IMPORTED_MODULE_0__["extend"])(this, Object(lodash__WEBPACK_IMPORTED_MODULE_0__["pick"])(options || {}, 'tag', 'attrs', 'type', 'content'));
|
||||||
|
var attributes = this.attrs; // Ensure we have a correctly formatted `attrs` object.
|
||||||
|
|
||||||
|
this.attrs = {
|
||||||
|
named: {},
|
||||||
|
numeric: []
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!attributes) {
|
||||||
|
return;
|
||||||
|
} // Parse a string of attributes.
|
||||||
|
|
||||||
|
|
||||||
|
if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isString"])(attributes)) {
|
||||||
|
this.attrs = attrs(attributes); // Identify a correctly formatted `attrs` object.
|
||||||
|
} else if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isEqual"])(Object.keys(attributes), ['named', 'numeric'])) {
|
||||||
|
this.attrs = attributes; // Handle a flat object of attributes.
|
||||||
|
} else {
|
||||||
|
Object(lodash__WEBPACK_IMPORTED_MODULE_0__["forEach"])(attributes, function (value, key) {
|
||||||
|
_this.set(key, value);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
next: next,
|
||||||
|
replace: replace,
|
||||||
|
string: string,
|
||||||
|
regexp: regexp,
|
||||||
|
attrs: attrs,
|
||||||
|
fromMatch: fromMatch
|
||||||
|
});
|
||||||
|
Object(lodash__WEBPACK_IMPORTED_MODULE_0__["extend"])(shortcode.prototype, {
|
||||||
|
/**
|
||||||
|
* Get a shortcode attribute.
|
||||||
|
*
|
||||||
|
* Automatically detects whether `attr` is named or numeric and routes it
|
||||||
|
* accordingly.
|
||||||
|
*
|
||||||
|
* @param {(number|string)} attr Attribute key.
|
||||||
|
*
|
||||||
|
* @return {string} Attribute value.
|
||||||
|
*/
|
||||||
|
get: function get(attr) {
|
||||||
|
return this.attrs[Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isNumber"])(attr) ? 'numeric' : 'named'][attr];
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set a shortcode attribute.
|
||||||
|
*
|
||||||
|
* Automatically detects whether `attr` is named or numeric and routes it
|
||||||
|
* accordingly.
|
||||||
|
*
|
||||||
|
* @param {(number|string)} attr Attribute key.
|
||||||
|
* @param {string} value Attribute value.
|
||||||
|
*
|
||||||
|
* @return {WPShortcode} Shortcode instance.
|
||||||
|
*/
|
||||||
|
set: function set(attr, value) {
|
||||||
|
this.attrs[Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isNumber"])(attr) ? 'numeric' : 'named'][attr] = value;
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transform the shortcode into a string.
|
||||||
|
*
|
||||||
|
* @return {string} String representation of the shortcode.
|
||||||
|
*/
|
||||||
|
string: function string() {
|
||||||
|
var text = '[' + this.tag;
|
||||||
|
Object(lodash__WEBPACK_IMPORTED_MODULE_0__["forEach"])(this.attrs.numeric, function (value) {
|
||||||
|
if (/\s/.test(value)) {
|
||||||
|
text += ' "' + value + '"';
|
||||||
|
} else {
|
||||||
|
text += ' ' + value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Object(lodash__WEBPACK_IMPORTED_MODULE_0__["forEach"])(this.attrs.named, function (value, name) {
|
||||||
|
text += ' ' + name + '="' + value + '"';
|
||||||
|
}); // If the tag is marked as `single` or `self-closing`, close the tag and
|
||||||
|
// ignore any additional content.
|
||||||
|
|
||||||
|
if ('single' === this.type) {
|
||||||
|
return text + ']';
|
||||||
|
} else if ('self-closing' === this.type) {
|
||||||
|
return text + ' /]';
|
||||||
|
} // Complete the opening tag.
|
||||||
|
|
||||||
|
|
||||||
|
text += ']';
|
||||||
|
|
||||||
|
if (this.content) {
|
||||||
|
text += this.content;
|
||||||
|
} // Add the closing tag.
|
||||||
|
|
||||||
|
|
||||||
|
return text + '[/' + this.tag + ']';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (shortcode);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/memize/index.js":
|
||||||
|
/*!**************************************!*\
|
||||||
|
!*** ./node_modules/memize/index.js ***!
|
||||||
|
\**************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = function memize( fn, options ) {
|
||||||
|
var size = 0,
|
||||||
|
maxSize, head, tail;
|
||||||
|
|
||||||
|
if ( options && options.maxSize ) {
|
||||||
|
maxSize = options.maxSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
function memoized( /* ...args */ ) {
|
||||||
|
var node = head,
|
||||||
|
len = arguments.length,
|
||||||
|
args, i;
|
||||||
|
|
||||||
|
searchCache: while ( node ) {
|
||||||
|
// Perform a shallow equality test to confirm that whether the node
|
||||||
|
// under test is a candidate for the arguments passed. Two arrays
|
||||||
|
// are shallowly equal if their length matches and each entry is
|
||||||
|
// strictly equal between the two sets. Avoid abstracting to a
|
||||||
|
// function which could incur an arguments leaking deoptimization.
|
||||||
|
|
||||||
|
// Check whether node arguments match arguments length
|
||||||
|
if ( node.args.length !== arguments.length ) {
|
||||||
|
node = node.next;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check whether node arguments match arguments values
|
||||||
|
for ( i = 0; i < len; i++ ) {
|
||||||
|
if ( node.args[ i ] !== arguments[ i ] ) {
|
||||||
|
node = node.next;
|
||||||
|
continue searchCache;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// At this point we can assume we've found a match
|
||||||
|
|
||||||
|
// Surface matched node to head if not already
|
||||||
|
if ( node !== head ) {
|
||||||
|
// As tail, shift to previous. Must only shift if not also
|
||||||
|
// head, since if both head and tail, there is no previous.
|
||||||
|
if ( node === tail ) {
|
||||||
|
tail = node.prev;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Adjust siblings to point to each other. If node was tail,
|
||||||
|
// this also handles new tail's empty `next` assignment.
|
||||||
|
node.prev.next = node.next;
|
||||||
|
if ( node.next ) {
|
||||||
|
node.next.prev = node.prev;
|
||||||
|
}
|
||||||
|
|
||||||
|
node.next = head;
|
||||||
|
node.prev = null;
|
||||||
|
head.prev = node;
|
||||||
|
head = node;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return immediately
|
||||||
|
return node.val;
|
||||||
|
}
|
||||||
|
|
||||||
|
// No cached value found. Continue to insertion phase:
|
||||||
|
|
||||||
|
// Create a copy of arguments (avoid leaking deoptimization)
|
||||||
|
args = new Array( len );
|
||||||
|
for ( i = 0; i < len; i++ ) {
|
||||||
|
args[ i ] = arguments[ i ];
|
||||||
|
}
|
||||||
|
|
||||||
|
node = {
|
||||||
|
args: args,
|
||||||
|
|
||||||
|
// Generate the result from original function
|
||||||
|
val: fn.apply( null, args )
|
||||||
|
};
|
||||||
|
|
||||||
|
// Don't need to check whether node is already head, since it would
|
||||||
|
// have been returned above already if it was
|
||||||
|
|
||||||
|
// Shift existing head down list
|
||||||
|
if ( head ) {
|
||||||
|
head.prev = node;
|
||||||
|
node.next = head;
|
||||||
|
} else {
|
||||||
|
// If no head, follows that there's no tail (at initial or reset)
|
||||||
|
tail = node;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trim tail if we're reached max size and are pending cache insertion
|
||||||
|
if ( size === maxSize ) {
|
||||||
|
tail = tail.prev;
|
||||||
|
tail.next = null;
|
||||||
|
} else {
|
||||||
|
size++;
|
||||||
|
}
|
||||||
|
|
||||||
|
head = node;
|
||||||
|
|
||||||
|
return node.val;
|
||||||
|
}
|
||||||
|
|
||||||
|
memoized.clear = function() {
|
||||||
|
head = null;
|
||||||
|
tail = null;
|
||||||
|
size = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
if ( false ) {}
|
||||||
|
|
||||||
|
return memoized;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "lodash":
|
||||||
|
/*!*************************!*\
|
||||||
|
!*** external "lodash" ***!
|
||||||
|
\*************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["lodash"]; }());
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=shortcode.js.map
|
1
wp-includes/js/dist/shortcode.js.map
vendored
Normal file
1
wp-includes/js/dist/shortcode.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
381
wp-includes/js/dist/token-list.js
vendored
Normal file
381
wp-includes/js/dist/token-list.js
vendored
Normal file
|
@ -0,0 +1,381 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["tokenList"] =
|
||||||
|
/******/ (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/token-list/build-module/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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/@wordpress/token-list/build-module/index.js":
|
||||||
|
/*!******************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/token-list/build-module/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 TokenList; });
|
||||||
|
/* 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 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__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* External dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A set of tokens.
|
||||||
|
*
|
||||||
|
* @link https://dom.spec.whatwg.org/#domtokenlist
|
||||||
|
*/
|
||||||
|
|
||||||
|
var TokenList =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function () {
|
||||||
|
/**
|
||||||
|
* Constructs a new instance of TokenList.
|
||||||
|
*
|
||||||
|
* @param {string} initialValue Initial value to assign.
|
||||||
|
*/
|
||||||
|
function TokenList() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
var initialValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
||||||
|
|
||||||
|
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, TokenList);
|
||||||
|
|
||||||
|
this.value = initialValue;
|
||||||
|
['entries', 'forEach', 'keys', 'values'].forEach(function (fn) {
|
||||||
|
_this[fn] = function () {
|
||||||
|
var _this$_valueAsArray;
|
||||||
|
|
||||||
|
return (_this$_valueAsArray = this._valueAsArray)[fn].apply(_this$_valueAsArray, arguments);
|
||||||
|
}.bind(_this);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns the associated set as string.
|
||||||
|
*
|
||||||
|
* @link https://dom.spec.whatwg.org/#dom-domtokenlist-value
|
||||||
|
*
|
||||||
|
* @return {string} Token set as string.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(TokenList, [{
|
||||||
|
key: "item",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the token with index `index`.
|
||||||
|
*
|
||||||
|
* @link https://dom.spec.whatwg.org/#dom-domtokenlist-item
|
||||||
|
*
|
||||||
|
* @param {number} index Index at which to return token.
|
||||||
|
*
|
||||||
|
* @return {?string} Token at index.
|
||||||
|
*/
|
||||||
|
value: function item(index) {
|
||||||
|
return this._valueAsArray[index];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns true if `token` is present, and false otherwise.
|
||||||
|
*
|
||||||
|
* @link https://dom.spec.whatwg.org/#dom-domtokenlist-contains
|
||||||
|
*
|
||||||
|
* @param {string} item Token to test.
|
||||||
|
*
|
||||||
|
* @return {boolean} Whether token is present.
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "contains",
|
||||||
|
value: function contains(item) {
|
||||||
|
return this._valueAsArray.indexOf(item) !== -1;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds all arguments passed, except those already present.
|
||||||
|
*
|
||||||
|
* @link https://dom.spec.whatwg.org/#dom-domtokenlist-add
|
||||||
|
*
|
||||||
|
* @param {...string} items Items to add.
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "add",
|
||||||
|
value: function add() {
|
||||||
|
for (var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||||
|
items[_key] = arguments[_key];
|
||||||
|
}
|
||||||
|
|
||||||
|
this.value += ' ' + items.join(' ');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Removes arguments passed, if they are present.
|
||||||
|
*
|
||||||
|
* @link https://dom.spec.whatwg.org/#dom-domtokenlist-remove
|
||||||
|
*
|
||||||
|
* @param {...string} items Items to remove.
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "remove",
|
||||||
|
value: function remove() {
|
||||||
|
for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||||
|
items[_key2] = arguments[_key2];
|
||||||
|
}
|
||||||
|
|
||||||
|
this.value = lodash__WEBPACK_IMPORTED_MODULE_2__["without"].apply(void 0, [this._valueAsArray].concat(items)).join(' ');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* If `force` is not given, "toggles" `token`, removing it if it’s present
|
||||||
|
* and adding it if it’s not present. If `force` is true, adds token (same
|
||||||
|
* as add()). If force is false, removes token (same as remove()). Returns
|
||||||
|
* true if `token` is now present, and false otherwise.
|
||||||
|
*
|
||||||
|
* @link https://dom.spec.whatwg.org/#dom-domtokenlist-toggle
|
||||||
|
*
|
||||||
|
* @param {string} token Token to toggle.
|
||||||
|
* @param {?boolean} force Presence to force.
|
||||||
|
*
|
||||||
|
* @return {boolean} Whether token is present after toggle.
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "toggle",
|
||||||
|
value: function toggle(token, force) {
|
||||||
|
if (undefined === force) {
|
||||||
|
force = !this.contains(token);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (force) {
|
||||||
|
this.add(token);
|
||||||
|
} else {
|
||||||
|
this.remove(token);
|
||||||
|
}
|
||||||
|
|
||||||
|
return force;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Replaces `token` with `newToken`. Returns true if `token` was replaced
|
||||||
|
* with `newToken`, and false otherwise.
|
||||||
|
*
|
||||||
|
* @link https://dom.spec.whatwg.org/#dom-domtokenlist-replace
|
||||||
|
*
|
||||||
|
* @param {string} token Token to replace with `newToken`.
|
||||||
|
* @param {string} newToken Token to use in place of `token`.
|
||||||
|
*
|
||||||
|
* @return {boolean} Whether replacement occurred.
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "replace",
|
||||||
|
value: function replace(token, newToken) {
|
||||||
|
if (!this.contains(token)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.remove(token);
|
||||||
|
this.add(newToken);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns true if `token` is in the associated attribute’s supported
|
||||||
|
* tokens. Returns false otherwise.
|
||||||
|
*
|
||||||
|
* Always returns `true` in this implementation.
|
||||||
|
*
|
||||||
|
* @link https://dom.spec.whatwg.org/#dom-domtokenlist-supports
|
||||||
|
*
|
||||||
|
* @return {boolean} Whether token is supported.
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "supports",
|
||||||
|
value: function supports() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "value",
|
||||||
|
get: function get() {
|
||||||
|
return this._currentValue;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Replaces the associated set with a new string value.
|
||||||
|
*
|
||||||
|
* @link https://dom.spec.whatwg.org/#dom-domtokenlist-value
|
||||||
|
*
|
||||||
|
* @param {string} value New token set as string.
|
||||||
|
*/
|
||||||
|
,
|
||||||
|
set: function set(value) {
|
||||||
|
value = String(value);
|
||||||
|
this._valueAsArray = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["uniq"])(Object(lodash__WEBPACK_IMPORTED_MODULE_2__["compact"])(value.split(/\s+/g)));
|
||||||
|
this._currentValue = this._valueAsArray.join(' ');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns the number of tokens.
|
||||||
|
*
|
||||||
|
* @link https://dom.spec.whatwg.org/#dom-domtokenlist-length
|
||||||
|
*
|
||||||
|
* @return {number} Number of tokens.
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "length",
|
||||||
|
get: function get() {
|
||||||
|
return this._valueAsArray.length;
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return TokenList;
|
||||||
|
}();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "lodash":
|
||||||
|
/*!*************************!*\
|
||||||
|
!*** external "lodash" ***!
|
||||||
|
\*************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["lodash"]; }());
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=token-list.js.map
|
1
wp-includes/js/dist/token-list.js.map
vendored
Normal file
1
wp-includes/js/dist/token-list.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
923
wp-includes/js/dist/url.js
vendored
Normal file
923
wp-includes/js/dist/url.js
vendored
Normal file
|
@ -0,0 +1,923 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["url"] =
|
||||||
|
/******/ (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/url/build-module/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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/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/@wordpress/url/build-module/index.js":
|
||||||
|
/*!***********************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/url/build-module/index.js ***!
|
||||||
|
\***********************************************************/
|
||||||
|
/*! exports provided: isURL, addQueryArgs, prependHTTP, safeDecodeURI */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isURL", function() { return isURL; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addQueryArgs", function() { return addQueryArgs; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prependHTTP", function() { return prependHTTP; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeDecodeURI", function() { return safeDecodeURI; });
|
||||||
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
|
||||||
|
/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! qs */ "./node_modules/qs/lib/index.js");
|
||||||
|
/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* External dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
var URL_REGEXP = /^(?:https?:)?\/\/\S+$/i;
|
||||||
|
var EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;
|
||||||
|
var USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\?|\.|\/)/i;
|
||||||
|
/**
|
||||||
|
* Determines whether the given string looks like a URL.
|
||||||
|
*
|
||||||
|
* @param {string} url The string to scrutinise.
|
||||||
|
*
|
||||||
|
* @return {boolean} Whether or not it looks like a URL.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function isURL(url) {
|
||||||
|
return URL_REGEXP.test(url);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Appends arguments to the query string of the url
|
||||||
|
*
|
||||||
|
* @param {string} url URL
|
||||||
|
* @param {Object} args Query Args
|
||||||
|
*
|
||||||
|
* @return {string} Updated URL
|
||||||
|
*/
|
||||||
|
|
||||||
|
function addQueryArgs(url, args) {
|
||||||
|
var queryStringIndex = url.indexOf('?');
|
||||||
|
var query = queryStringIndex !== -1 ? Object(qs__WEBPACK_IMPORTED_MODULE_1__["parse"])(url.substr(queryStringIndex + 1)) : {};
|
||||||
|
var baseUrl = queryStringIndex !== -1 ? url.substr(0, queryStringIndex) : url;
|
||||||
|
return baseUrl + '?' + Object(qs__WEBPACK_IMPORTED_MODULE_1__["stringify"])(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, query, args));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Prepends "http://" to a url, if it looks like something that is meant to be a TLD.
|
||||||
|
*
|
||||||
|
* @param {string} url The URL to test
|
||||||
|
*
|
||||||
|
* @return {string} The updated URL
|
||||||
|
*/
|
||||||
|
|
||||||
|
function prependHTTP(url) {
|
||||||
|
if (!USABLE_HREF_REGEXP.test(url) && !EMAIL_REGEXP.test(url)) {
|
||||||
|
return 'http://' + url;
|
||||||
|
}
|
||||||
|
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Safely decodes a URI with `decodeURI`. Returns the URI unmodified if
|
||||||
|
* `decodeURI` throws an error.
|
||||||
|
*
|
||||||
|
* @param {string} uri URI to decode.
|
||||||
|
*
|
||||||
|
* @return {string} Decoded URI if possible.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function safeDecodeURI(uri) {
|
||||||
|
try {
|
||||||
|
return decodeURI(uri);
|
||||||
|
} catch (uriError) {
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/qs/lib/formats.js":
|
||||||
|
/*!****************************************!*\
|
||||||
|
!*** ./node_modules/qs/lib/formats.js ***!
|
||||||
|
\****************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
|
||||||
|
var replace = String.prototype.replace;
|
||||||
|
var percentTwenties = /%20/g;
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
'default': 'RFC3986',
|
||||||
|
formatters: {
|
||||||
|
RFC1738: function (value) {
|
||||||
|
return replace.call(value, percentTwenties, '+');
|
||||||
|
},
|
||||||
|
RFC3986: function (value) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
RFC1738: 'RFC1738',
|
||||||
|
RFC3986: 'RFC3986'
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/qs/lib/index.js":
|
||||||
|
/*!**************************************!*\
|
||||||
|
!*** ./node_modules/qs/lib/index.js ***!
|
||||||
|
\**************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
|
||||||
|
var stringify = __webpack_require__(/*! ./stringify */ "./node_modules/qs/lib/stringify.js");
|
||||||
|
var parse = __webpack_require__(/*! ./parse */ "./node_modules/qs/lib/parse.js");
|
||||||
|
var formats = __webpack_require__(/*! ./formats */ "./node_modules/qs/lib/formats.js");
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
formats: formats,
|
||||||
|
parse: parse,
|
||||||
|
stringify: stringify
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/qs/lib/parse.js":
|
||||||
|
/*!**************************************!*\
|
||||||
|
!*** ./node_modules/qs/lib/parse.js ***!
|
||||||
|
\**************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
|
||||||
|
var utils = __webpack_require__(/*! ./utils */ "./node_modules/qs/lib/utils.js");
|
||||||
|
|
||||||
|
var has = Object.prototype.hasOwnProperty;
|
||||||
|
|
||||||
|
var defaults = {
|
||||||
|
allowDots: false,
|
||||||
|
allowPrototypes: false,
|
||||||
|
arrayLimit: 20,
|
||||||
|
decoder: utils.decode,
|
||||||
|
delimiter: '&',
|
||||||
|
depth: 5,
|
||||||
|
parameterLimit: 1000,
|
||||||
|
plainObjects: false,
|
||||||
|
strictNullHandling: false
|
||||||
|
};
|
||||||
|
|
||||||
|
var parseValues = function parseQueryStringValues(str, options) {
|
||||||
|
var obj = {};
|
||||||
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
||||||
|
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
||||||
|
var parts = cleanStr.split(options.delimiter, limit);
|
||||||
|
|
||||||
|
for (var i = 0; i < parts.length; ++i) {
|
||||||
|
var part = parts[i];
|
||||||
|
|
||||||
|
var bracketEqualsPos = part.indexOf(']=');
|
||||||
|
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
||||||
|
|
||||||
|
var key, val;
|
||||||
|
if (pos === -1) {
|
||||||
|
key = options.decoder(part, defaults.decoder);
|
||||||
|
val = options.strictNullHandling ? null : '';
|
||||||
|
} else {
|
||||||
|
key = options.decoder(part.slice(0, pos), defaults.decoder);
|
||||||
|
val = options.decoder(part.slice(pos + 1), defaults.decoder);
|
||||||
|
}
|
||||||
|
if (has.call(obj, key)) {
|
||||||
|
obj[key] = [].concat(obj[key]).concat(val);
|
||||||
|
} else {
|
||||||
|
obj[key] = val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
};
|
||||||
|
|
||||||
|
var parseObject = function (chain, val, options) {
|
||||||
|
var leaf = val;
|
||||||
|
|
||||||
|
for (var i = chain.length - 1; i >= 0; --i) {
|
||||||
|
var obj;
|
||||||
|
var root = chain[i];
|
||||||
|
|
||||||
|
if (root === '[]') {
|
||||||
|
obj = [];
|
||||||
|
obj = obj.concat(leaf);
|
||||||
|
} else {
|
||||||
|
obj = options.plainObjects ? Object.create(null) : {};
|
||||||
|
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
||||||
|
var index = parseInt(cleanRoot, 10);
|
||||||
|
if (
|
||||||
|
!isNaN(index)
|
||||||
|
&& root !== cleanRoot
|
||||||
|
&& String(index) === cleanRoot
|
||||||
|
&& index >= 0
|
||||||
|
&& (options.parseArrays && index <= options.arrayLimit)
|
||||||
|
) {
|
||||||
|
obj = [];
|
||||||
|
obj[index] = leaf;
|
||||||
|
} else {
|
||||||
|
obj[cleanRoot] = leaf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
leaf = obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
return leaf;
|
||||||
|
};
|
||||||
|
|
||||||
|
var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
|
||||||
|
if (!givenKey) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Transform dot notation to bracket notation
|
||||||
|
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
||||||
|
|
||||||
|
// The regex chunks
|
||||||
|
|
||||||
|
var brackets = /(\[[^[\]]*])/;
|
||||||
|
var child = /(\[[^[\]]*])/g;
|
||||||
|
|
||||||
|
// Get the parent
|
||||||
|
|
||||||
|
var segment = brackets.exec(key);
|
||||||
|
var parent = segment ? key.slice(0, segment.index) : key;
|
||||||
|
|
||||||
|
// Stash the parent if it exists
|
||||||
|
|
||||||
|
var keys = [];
|
||||||
|
if (parent) {
|
||||||
|
// If we aren't using plain objects, optionally prefix keys
|
||||||
|
// that would overwrite object prototype properties
|
||||||
|
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
||||||
|
if (!options.allowPrototypes) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
keys.push(parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Loop through children appending to the array until we hit depth
|
||||||
|
|
||||||
|
var i = 0;
|
||||||
|
while ((segment = child.exec(key)) !== null && i < options.depth) {
|
||||||
|
i += 1;
|
||||||
|
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
||||||
|
if (!options.allowPrototypes) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
keys.push(segment[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there's a remainder, just add whatever is left
|
||||||
|
|
||||||
|
if (segment) {
|
||||||
|
keys.push('[' + key.slice(segment.index) + ']');
|
||||||
|
}
|
||||||
|
|
||||||
|
return parseObject(keys, val, options);
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = function (str, opts) {
|
||||||
|
var options = opts ? utils.assign({}, opts) : {};
|
||||||
|
|
||||||
|
if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {
|
||||||
|
throw new TypeError('Decoder has to be a function.');
|
||||||
|
}
|
||||||
|
|
||||||
|
options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;
|
||||||
|
options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;
|
||||||
|
options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;
|
||||||
|
options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;
|
||||||
|
options.parseArrays = options.parseArrays !== false;
|
||||||
|
options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;
|
||||||
|
options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;
|
||||||
|
options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;
|
||||||
|
options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
|
||||||
|
options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
|
||||||
|
options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
||||||
|
|
||||||
|
if (str === '' || str === null || typeof str === 'undefined') {
|
||||||
|
return options.plainObjects ? Object.create(null) : {};
|
||||||
|
}
|
||||||
|
|
||||||
|
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
||||||
|
var obj = options.plainObjects ? Object.create(null) : {};
|
||||||
|
|
||||||
|
// Iterate over the keys and setup the new object
|
||||||
|
|
||||||
|
var keys = Object.keys(tempObj);
|
||||||
|
for (var i = 0; i < keys.length; ++i) {
|
||||||
|
var key = keys[i];
|
||||||
|
var newObj = parseKeys(key, tempObj[key], options);
|
||||||
|
obj = utils.merge(obj, newObj, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
return utils.compact(obj);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/qs/lib/stringify.js":
|
||||||
|
/*!******************************************!*\
|
||||||
|
!*** ./node_modules/qs/lib/stringify.js ***!
|
||||||
|
\******************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
|
||||||
|
var utils = __webpack_require__(/*! ./utils */ "./node_modules/qs/lib/utils.js");
|
||||||
|
var formats = __webpack_require__(/*! ./formats */ "./node_modules/qs/lib/formats.js");
|
||||||
|
|
||||||
|
var arrayPrefixGenerators = {
|
||||||
|
brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
|
||||||
|
return prefix + '[]';
|
||||||
|
},
|
||||||
|
indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
|
||||||
|
return prefix + '[' + key + ']';
|
||||||
|
},
|
||||||
|
repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
|
||||||
|
return prefix;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var toISO = Date.prototype.toISOString;
|
||||||
|
|
||||||
|
var defaults = {
|
||||||
|
delimiter: '&',
|
||||||
|
encode: true,
|
||||||
|
encoder: utils.encode,
|
||||||
|
encodeValuesOnly: false,
|
||||||
|
serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
|
||||||
|
return toISO.call(date);
|
||||||
|
},
|
||||||
|
skipNulls: false,
|
||||||
|
strictNullHandling: false
|
||||||
|
};
|
||||||
|
|
||||||
|
var stringify = function stringify( // eslint-disable-line func-name-matching
|
||||||
|
object,
|
||||||
|
prefix,
|
||||||
|
generateArrayPrefix,
|
||||||
|
strictNullHandling,
|
||||||
|
skipNulls,
|
||||||
|
encoder,
|
||||||
|
filter,
|
||||||
|
sort,
|
||||||
|
allowDots,
|
||||||
|
serializeDate,
|
||||||
|
formatter,
|
||||||
|
encodeValuesOnly
|
||||||
|
) {
|
||||||
|
var obj = object;
|
||||||
|
if (typeof filter === 'function') {
|
||||||
|
obj = filter(prefix, obj);
|
||||||
|
} else if (obj instanceof Date) {
|
||||||
|
obj = serializeDate(obj);
|
||||||
|
} else if (obj === null) {
|
||||||
|
if (strictNullHandling) {
|
||||||
|
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
obj = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
|
||||||
|
if (encoder) {
|
||||||
|
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);
|
||||||
|
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];
|
||||||
|
}
|
||||||
|
return [formatter(prefix) + '=' + formatter(String(obj))];
|
||||||
|
}
|
||||||
|
|
||||||
|
var values = [];
|
||||||
|
|
||||||
|
if (typeof obj === 'undefined') {
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
|
||||||
|
var objKeys;
|
||||||
|
if (Array.isArray(filter)) {
|
||||||
|
objKeys = filter;
|
||||||
|
} else {
|
||||||
|
var keys = Object.keys(obj);
|
||||||
|
objKeys = sort ? keys.sort(sort) : keys;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = 0; i < objKeys.length; ++i) {
|
||||||
|
var key = objKeys[i];
|
||||||
|
|
||||||
|
if (skipNulls && obj[key] === null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(obj)) {
|
||||||
|
values = values.concat(stringify(
|
||||||
|
obj[key],
|
||||||
|
generateArrayPrefix(prefix, key),
|
||||||
|
generateArrayPrefix,
|
||||||
|
strictNullHandling,
|
||||||
|
skipNulls,
|
||||||
|
encoder,
|
||||||
|
filter,
|
||||||
|
sort,
|
||||||
|
allowDots,
|
||||||
|
serializeDate,
|
||||||
|
formatter,
|
||||||
|
encodeValuesOnly
|
||||||
|
));
|
||||||
|
} else {
|
||||||
|
values = values.concat(stringify(
|
||||||
|
obj[key],
|
||||||
|
prefix + (allowDots ? '.' + key : '[' + key + ']'),
|
||||||
|
generateArrayPrefix,
|
||||||
|
strictNullHandling,
|
||||||
|
skipNulls,
|
||||||
|
encoder,
|
||||||
|
filter,
|
||||||
|
sort,
|
||||||
|
allowDots,
|
||||||
|
serializeDate,
|
||||||
|
formatter,
|
||||||
|
encodeValuesOnly
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return values;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = function (object, opts) {
|
||||||
|
var obj = object;
|
||||||
|
var options = opts ? utils.assign({}, opts) : {};
|
||||||
|
|
||||||
|
if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
|
||||||
|
throw new TypeError('Encoder has to be a function.');
|
||||||
|
}
|
||||||
|
|
||||||
|
var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;
|
||||||
|
var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
||||||
|
var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;
|
||||||
|
var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;
|
||||||
|
var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;
|
||||||
|
var sort = typeof options.sort === 'function' ? options.sort : null;
|
||||||
|
var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
|
||||||
|
var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;
|
||||||
|
var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;
|
||||||
|
if (typeof options.format === 'undefined') {
|
||||||
|
options.format = formats['default'];
|
||||||
|
} else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {
|
||||||
|
throw new TypeError('Unknown format option provided.');
|
||||||
|
}
|
||||||
|
var formatter = formats.formatters[options.format];
|
||||||
|
var objKeys;
|
||||||
|
var filter;
|
||||||
|
|
||||||
|
if (typeof options.filter === 'function') {
|
||||||
|
filter = options.filter;
|
||||||
|
obj = filter('', obj);
|
||||||
|
} else if (Array.isArray(options.filter)) {
|
||||||
|
filter = options.filter;
|
||||||
|
objKeys = filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
var keys = [];
|
||||||
|
|
||||||
|
if (typeof obj !== 'object' || obj === null) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
var arrayFormat;
|
||||||
|
if (options.arrayFormat in arrayPrefixGenerators) {
|
||||||
|
arrayFormat = options.arrayFormat;
|
||||||
|
} else if ('indices' in options) {
|
||||||
|
arrayFormat = options.indices ? 'indices' : 'repeat';
|
||||||
|
} else {
|
||||||
|
arrayFormat = 'indices';
|
||||||
|
}
|
||||||
|
|
||||||
|
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
||||||
|
|
||||||
|
if (!objKeys) {
|
||||||
|
objKeys = Object.keys(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sort) {
|
||||||
|
objKeys.sort(sort);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = 0; i < objKeys.length; ++i) {
|
||||||
|
var key = objKeys[i];
|
||||||
|
|
||||||
|
if (skipNulls && obj[key] === null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
keys = keys.concat(stringify(
|
||||||
|
obj[key],
|
||||||
|
key,
|
||||||
|
generateArrayPrefix,
|
||||||
|
strictNullHandling,
|
||||||
|
skipNulls,
|
||||||
|
encode ? encoder : null,
|
||||||
|
filter,
|
||||||
|
sort,
|
||||||
|
allowDots,
|
||||||
|
serializeDate,
|
||||||
|
formatter,
|
||||||
|
encodeValuesOnly
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
var joined = keys.join(delimiter);
|
||||||
|
var prefix = options.addQueryPrefix === true ? '?' : '';
|
||||||
|
|
||||||
|
return joined.length > 0 ? prefix + joined : '';
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/qs/lib/utils.js":
|
||||||
|
/*!**************************************!*\
|
||||||
|
!*** ./node_modules/qs/lib/utils.js ***!
|
||||||
|
\**************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
|
||||||
|
var has = Object.prototype.hasOwnProperty;
|
||||||
|
|
||||||
|
var hexTable = (function () {
|
||||||
|
var array = [];
|
||||||
|
for (var i = 0; i < 256; ++i) {
|
||||||
|
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
return array;
|
||||||
|
}());
|
||||||
|
|
||||||
|
var compactQueue = function compactQueue(queue) {
|
||||||
|
var obj;
|
||||||
|
|
||||||
|
while (queue.length) {
|
||||||
|
var item = queue.pop();
|
||||||
|
obj = item.obj[item.prop];
|
||||||
|
|
||||||
|
if (Array.isArray(obj)) {
|
||||||
|
var compacted = [];
|
||||||
|
|
||||||
|
for (var j = 0; j < obj.length; ++j) {
|
||||||
|
if (typeof obj[j] !== 'undefined') {
|
||||||
|
compacted.push(obj[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
item.obj[item.prop] = compacted;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
};
|
||||||
|
|
||||||
|
var arrayToObject = function arrayToObject(source, options) {
|
||||||
|
var obj = options && options.plainObjects ? Object.create(null) : {};
|
||||||
|
for (var i = 0; i < source.length; ++i) {
|
||||||
|
if (typeof source[i] !== 'undefined') {
|
||||||
|
obj[i] = source[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
};
|
||||||
|
|
||||||
|
var merge = function merge(target, source, options) {
|
||||||
|
if (!source) {
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof source !== 'object') {
|
||||||
|
if (Array.isArray(target)) {
|
||||||
|
target.push(source);
|
||||||
|
} else if (typeof target === 'object') {
|
||||||
|
if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {
|
||||||
|
target[source] = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return [target, source];
|
||||||
|
}
|
||||||
|
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof target !== 'object') {
|
||||||
|
return [target].concat(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
var mergeTarget = target;
|
||||||
|
if (Array.isArray(target) && !Array.isArray(source)) {
|
||||||
|
mergeTarget = arrayToObject(target, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(target) && Array.isArray(source)) {
|
||||||
|
source.forEach(function (item, i) {
|
||||||
|
if (has.call(target, i)) {
|
||||||
|
if (target[i] && typeof target[i] === 'object') {
|
||||||
|
target[i] = merge(target[i], item, options);
|
||||||
|
} else {
|
||||||
|
target.push(item);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
target[i] = item;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Object.keys(source).reduce(function (acc, key) {
|
||||||
|
var value = source[key];
|
||||||
|
|
||||||
|
if (has.call(acc, key)) {
|
||||||
|
acc[key] = merge(acc[key], value, options);
|
||||||
|
} else {
|
||||||
|
acc[key] = value;
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
|
}, mergeTarget);
|
||||||
|
};
|
||||||
|
|
||||||
|
var assign = function assignSingleSource(target, source) {
|
||||||
|
return Object.keys(source).reduce(function (acc, key) {
|
||||||
|
acc[key] = source[key];
|
||||||
|
return acc;
|
||||||
|
}, target);
|
||||||
|
};
|
||||||
|
|
||||||
|
var decode = function (str) {
|
||||||
|
try {
|
||||||
|
return decodeURIComponent(str.replace(/\+/g, ' '));
|
||||||
|
} catch (e) {
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var encode = function encode(str) {
|
||||||
|
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
||||||
|
// It has been adapted here for stricter adherence to RFC 3986
|
||||||
|
if (str.length === 0) {
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
var string = typeof str === 'string' ? str : String(str);
|
||||||
|
|
||||||
|
var out = '';
|
||||||
|
for (var i = 0; i < string.length; ++i) {
|
||||||
|
var c = string.charCodeAt(i);
|
||||||
|
|
||||||
|
if (
|
||||||
|
c === 0x2D // -
|
||||||
|
|| c === 0x2E // .
|
||||||
|
|| c === 0x5F // _
|
||||||
|
|| c === 0x7E // ~
|
||||||
|
|| (c >= 0x30 && c <= 0x39) // 0-9
|
||||||
|
|| (c >= 0x41 && c <= 0x5A) // a-z
|
||||||
|
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
||||||
|
) {
|
||||||
|
out += string.charAt(i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c < 0x80) {
|
||||||
|
out = out + hexTable[c];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c < 0x800) {
|
||||||
|
out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c < 0xD800 || c >= 0xE000) {
|
||||||
|
out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
i += 1;
|
||||||
|
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
||||||
|
out += hexTable[0xF0 | (c >> 18)]
|
||||||
|
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
||||||
|
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
||||||
|
+ hexTable[0x80 | (c & 0x3F)];
|
||||||
|
}
|
||||||
|
|
||||||
|
return out;
|
||||||
|
};
|
||||||
|
|
||||||
|
var compact = function compact(value) {
|
||||||
|
var queue = [{ obj: { o: value }, prop: 'o' }];
|
||||||
|
var refs = [];
|
||||||
|
|
||||||
|
for (var i = 0; i < queue.length; ++i) {
|
||||||
|
var item = queue[i];
|
||||||
|
var obj = item.obj[item.prop];
|
||||||
|
|
||||||
|
var keys = Object.keys(obj);
|
||||||
|
for (var j = 0; j < keys.length; ++j) {
|
||||||
|
var key = keys[j];
|
||||||
|
var val = obj[key];
|
||||||
|
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
||||||
|
queue.push({ obj: obj, prop: key });
|
||||||
|
refs.push(val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return compactQueue(queue);
|
||||||
|
};
|
||||||
|
|
||||||
|
var isRegExp = function isRegExp(obj) {
|
||||||
|
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
||||||
|
};
|
||||||
|
|
||||||
|
var isBuffer = function isBuffer(obj) {
|
||||||
|
if (obj === null || typeof obj === 'undefined') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
arrayToObject: arrayToObject,
|
||||||
|
assign: assign,
|
||||||
|
compact: compact,
|
||||||
|
decode: decode,
|
||||||
|
encode: encode,
|
||||||
|
isBuffer: isBuffer,
|
||||||
|
isRegExp: isRegExp,
|
||||||
|
merge: merge
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=url.js.map
|
1
wp-includes/js/dist/url.js.map
vendored
Normal file
1
wp-includes/js/dist/url.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
17107
wp-includes/js/dist/vendor/lodash.js
vendored
Normal file
17107
wp-includes/js/dist/vendor/lodash.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4506
wp-includes/js/dist/vendor/moment.js
vendored
Normal file
4506
wp-includes/js/dist/vendor/moment.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
18382
wp-includes/js/dist/vendor/react-dom.js
vendored
Normal file
18382
wp-includes/js/dist/vendor/react-dom.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2703
wp-includes/js/dist/vendor/react.js
vendored
Normal file
2703
wp-includes/js/dist/vendor/react.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6568
wp-includes/js/dist/vendor/wp-polyfill-ecmascript.js
vendored
Normal file
6568
wp-includes/js/dist/vendor/wp-polyfill-ecmascript.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
33
wp-includes/js/dist/vendor/wp-polyfill-element-closest.js
vendored
Normal file
33
wp-includes/js/dist/vendor/wp-polyfill-element-closest.js
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
// element-closest | CC0-1.0 | github.com/jonathantneal/closest
|
||||||
|
|
||||||
|
(function (ElementProto) {
|
||||||
|
if (typeof ElementProto.matches !== 'function') {
|
||||||
|
ElementProto.matches = ElementProto.msMatchesSelector || ElementProto.mozMatchesSelector || ElementProto.webkitMatchesSelector || function matches(selector) {
|
||||||
|
var element = this;
|
||||||
|
var elements = (element.document || element.ownerDocument).querySelectorAll(selector);
|
||||||
|
var index = 0;
|
||||||
|
|
||||||
|
while (elements[index] && elements[index] !== element) {
|
||||||
|
++index;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Boolean(elements[index]);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof ElementProto.closest !== 'function') {
|
||||||
|
ElementProto.closest = function closest(selector) {
|
||||||
|
var element = this;
|
||||||
|
|
||||||
|
while (element && element.nodeType === 1) {
|
||||||
|
if (element.matches(selector)) {
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
|
||||||
|
element = element.parentNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
})(window.Element.prototype);
|
531
wp-includes/js/dist/vendor/wp-polyfill-fetch.js
vendored
Normal file
531
wp-includes/js/dist/vendor/wp-polyfill-fetch.js
vendored
Normal file
|
@ -0,0 +1,531 @@
|
||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||||
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||||
|
(factory((global.WHATWGFetch = {})));
|
||||||
|
}(this, (function (exports) { 'use strict';
|
||||||
|
|
||||||
|
var support = {
|
||||||
|
searchParams: 'URLSearchParams' in self,
|
||||||
|
iterable: 'Symbol' in self && 'iterator' in Symbol,
|
||||||
|
blob:
|
||||||
|
'FileReader' in self &&
|
||||||
|
'Blob' in self &&
|
||||||
|
(function() {
|
||||||
|
try {
|
||||||
|
new Blob();
|
||||||
|
return true
|
||||||
|
} catch (e) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})(),
|
||||||
|
formData: 'FormData' in self,
|
||||||
|
arrayBuffer: 'ArrayBuffer' in self
|
||||||
|
};
|
||||||
|
|
||||||
|
function isDataView(obj) {
|
||||||
|
return obj && DataView.prototype.isPrototypeOf(obj)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (support.arrayBuffer) {
|
||||||
|
var viewClasses = [
|
||||||
|
'[object Int8Array]',
|
||||||
|
'[object Uint8Array]',
|
||||||
|
'[object Uint8ClampedArray]',
|
||||||
|
'[object Int16Array]',
|
||||||
|
'[object Uint16Array]',
|
||||||
|
'[object Int32Array]',
|
||||||
|
'[object Uint32Array]',
|
||||||
|
'[object Float32Array]',
|
||||||
|
'[object Float64Array]'
|
||||||
|
];
|
||||||
|
|
||||||
|
var isArrayBufferView =
|
||||||
|
ArrayBuffer.isView ||
|
||||||
|
function(obj) {
|
||||||
|
return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeName(name) {
|
||||||
|
if (typeof name !== 'string') {
|
||||||
|
name = String(name);
|
||||||
|
}
|
||||||
|
if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
|
||||||
|
throw new TypeError('Invalid character in header field name')
|
||||||
|
}
|
||||||
|
return name.toLowerCase()
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeValue(value) {
|
||||||
|
if (typeof value !== 'string') {
|
||||||
|
value = String(value);
|
||||||
|
}
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build a destructive iterator for the value list
|
||||||
|
function iteratorFor(items) {
|
||||||
|
var iterator = {
|
||||||
|
next: function() {
|
||||||
|
var value = items.shift();
|
||||||
|
return {done: value === undefined, value: value}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (support.iterable) {
|
||||||
|
iterator[Symbol.iterator] = function() {
|
||||||
|
return iterator
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return iterator
|
||||||
|
}
|
||||||
|
|
||||||
|
function Headers(headers) {
|
||||||
|
this.map = {};
|
||||||
|
|
||||||
|
if (headers instanceof Headers) {
|
||||||
|
headers.forEach(function(value, name) {
|
||||||
|
this.append(name, value);
|
||||||
|
}, this);
|
||||||
|
} else if (Array.isArray(headers)) {
|
||||||
|
headers.forEach(function(header) {
|
||||||
|
this.append(header[0], header[1]);
|
||||||
|
}, this);
|
||||||
|
} else if (headers) {
|
||||||
|
Object.getOwnPropertyNames(headers).forEach(function(name) {
|
||||||
|
this.append(name, headers[name]);
|
||||||
|
}, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Headers.prototype.append = function(name, value) {
|
||||||
|
name = normalizeName(name);
|
||||||
|
value = normalizeValue(value);
|
||||||
|
var oldValue = this.map[name];
|
||||||
|
this.map[name] = oldValue ? oldValue + ', ' + value : value;
|
||||||
|
};
|
||||||
|
|
||||||
|
Headers.prototype['delete'] = function(name) {
|
||||||
|
delete this.map[normalizeName(name)];
|
||||||
|
};
|
||||||
|
|
||||||
|
Headers.prototype.get = function(name) {
|
||||||
|
name = normalizeName(name);
|
||||||
|
return this.has(name) ? this.map[name] : null
|
||||||
|
};
|
||||||
|
|
||||||
|
Headers.prototype.has = function(name) {
|
||||||
|
return this.map.hasOwnProperty(normalizeName(name))
|
||||||
|
};
|
||||||
|
|
||||||
|
Headers.prototype.set = function(name, value) {
|
||||||
|
this.map[normalizeName(name)] = normalizeValue(value);
|
||||||
|
};
|
||||||
|
|
||||||
|
Headers.prototype.forEach = function(callback, thisArg) {
|
||||||
|
for (var name in this.map) {
|
||||||
|
if (this.map.hasOwnProperty(name)) {
|
||||||
|
callback.call(thisArg, this.map[name], name, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Headers.prototype.keys = function() {
|
||||||
|
var items = [];
|
||||||
|
this.forEach(function(value, name) {
|
||||||
|
items.push(name);
|
||||||
|
});
|
||||||
|
return iteratorFor(items)
|
||||||
|
};
|
||||||
|
|
||||||
|
Headers.prototype.values = function() {
|
||||||
|
var items = [];
|
||||||
|
this.forEach(function(value) {
|
||||||
|
items.push(value);
|
||||||
|
});
|
||||||
|
return iteratorFor(items)
|
||||||
|
};
|
||||||
|
|
||||||
|
Headers.prototype.entries = function() {
|
||||||
|
var items = [];
|
||||||
|
this.forEach(function(value, name) {
|
||||||
|
items.push([name, value]);
|
||||||
|
});
|
||||||
|
return iteratorFor(items)
|
||||||
|
};
|
||||||
|
|
||||||
|
if (support.iterable) {
|
||||||
|
Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
function consumed(body) {
|
||||||
|
if (body.bodyUsed) {
|
||||||
|
return Promise.reject(new TypeError('Already read'))
|
||||||
|
}
|
||||||
|
body.bodyUsed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fileReaderReady(reader) {
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
reader.onload = function() {
|
||||||
|
resolve(reader.result);
|
||||||
|
};
|
||||||
|
reader.onerror = function() {
|
||||||
|
reject(reader.error);
|
||||||
|
};
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function readBlobAsArrayBuffer(blob) {
|
||||||
|
var reader = new FileReader();
|
||||||
|
var promise = fileReaderReady(reader);
|
||||||
|
reader.readAsArrayBuffer(blob);
|
||||||
|
return promise
|
||||||
|
}
|
||||||
|
|
||||||
|
function readBlobAsText(blob) {
|
||||||
|
var reader = new FileReader();
|
||||||
|
var promise = fileReaderReady(reader);
|
||||||
|
reader.readAsText(blob);
|
||||||
|
return promise
|
||||||
|
}
|
||||||
|
|
||||||
|
function readArrayBufferAsText(buf) {
|
||||||
|
var view = new Uint8Array(buf);
|
||||||
|
var chars = new Array(view.length);
|
||||||
|
|
||||||
|
for (var i = 0; i < view.length; i++) {
|
||||||
|
chars[i] = String.fromCharCode(view[i]);
|
||||||
|
}
|
||||||
|
return chars.join('')
|
||||||
|
}
|
||||||
|
|
||||||
|
function bufferClone(buf) {
|
||||||
|
if (buf.slice) {
|
||||||
|
return buf.slice(0)
|
||||||
|
} else {
|
||||||
|
var view = new Uint8Array(buf.byteLength);
|
||||||
|
view.set(new Uint8Array(buf));
|
||||||
|
return view.buffer
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Body() {
|
||||||
|
this.bodyUsed = false;
|
||||||
|
|
||||||
|
this._initBody = function(body) {
|
||||||
|
this._bodyInit = body;
|
||||||
|
if (!body) {
|
||||||
|
this._bodyText = '';
|
||||||
|
} else if (typeof body === 'string') {
|
||||||
|
this._bodyText = body;
|
||||||
|
} else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
|
||||||
|
this._bodyBlob = body;
|
||||||
|
} else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
|
||||||
|
this._bodyFormData = body;
|
||||||
|
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
||||||
|
this._bodyText = body.toString();
|
||||||
|
} else if (support.arrayBuffer && support.blob && isDataView(body)) {
|
||||||
|
this._bodyArrayBuffer = bufferClone(body.buffer);
|
||||||
|
// IE 10-11 can't handle a DataView body.
|
||||||
|
this._bodyInit = new Blob([this._bodyArrayBuffer]);
|
||||||
|
} else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
|
||||||
|
this._bodyArrayBuffer = bufferClone(body);
|
||||||
|
} else {
|
||||||
|
this._bodyText = body = Object.prototype.toString.call(body);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.headers.get('content-type')) {
|
||||||
|
if (typeof body === 'string') {
|
||||||
|
this.headers.set('content-type', 'text/plain;charset=UTF-8');
|
||||||
|
} else if (this._bodyBlob && this._bodyBlob.type) {
|
||||||
|
this.headers.set('content-type', this._bodyBlob.type);
|
||||||
|
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
||||||
|
this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (support.blob) {
|
||||||
|
this.blob = function() {
|
||||||
|
var rejected = consumed(this);
|
||||||
|
if (rejected) {
|
||||||
|
return rejected
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._bodyBlob) {
|
||||||
|
return Promise.resolve(this._bodyBlob)
|
||||||
|
} else if (this._bodyArrayBuffer) {
|
||||||
|
return Promise.resolve(new Blob([this._bodyArrayBuffer]))
|
||||||
|
} else if (this._bodyFormData) {
|
||||||
|
throw new Error('could not read FormData body as blob')
|
||||||
|
} else {
|
||||||
|
return Promise.resolve(new Blob([this._bodyText]))
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.arrayBuffer = function() {
|
||||||
|
if (this._bodyArrayBuffer) {
|
||||||
|
return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
|
||||||
|
} else {
|
||||||
|
return this.blob().then(readBlobAsArrayBuffer)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
this.text = function() {
|
||||||
|
var rejected = consumed(this);
|
||||||
|
if (rejected) {
|
||||||
|
return rejected
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._bodyBlob) {
|
||||||
|
return readBlobAsText(this._bodyBlob)
|
||||||
|
} else if (this._bodyArrayBuffer) {
|
||||||
|
return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
|
||||||
|
} else if (this._bodyFormData) {
|
||||||
|
throw new Error('could not read FormData body as text')
|
||||||
|
} else {
|
||||||
|
return Promise.resolve(this._bodyText)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (support.formData) {
|
||||||
|
this.formData = function() {
|
||||||
|
return this.text().then(decode)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
this.json = function() {
|
||||||
|
return this.text().then(JSON.parse)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
// HTTP methods whose capitalization should be normalized
|
||||||
|
var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
|
||||||
|
|
||||||
|
function normalizeMethod(method) {
|
||||||
|
var upcased = method.toUpperCase();
|
||||||
|
return methods.indexOf(upcased) > -1 ? upcased : method
|
||||||
|
}
|
||||||
|
|
||||||
|
function Request(input, options) {
|
||||||
|
options = options || {};
|
||||||
|
var body = options.body;
|
||||||
|
|
||||||
|
if (input instanceof Request) {
|
||||||
|
if (input.bodyUsed) {
|
||||||
|
throw new TypeError('Already read')
|
||||||
|
}
|
||||||
|
this.url = input.url;
|
||||||
|
this.credentials = input.credentials;
|
||||||
|
if (!options.headers) {
|
||||||
|
this.headers = new Headers(input.headers);
|
||||||
|
}
|
||||||
|
this.method = input.method;
|
||||||
|
this.mode = input.mode;
|
||||||
|
this.signal = input.signal;
|
||||||
|
if (!body && input._bodyInit != null) {
|
||||||
|
body = input._bodyInit;
|
||||||
|
input.bodyUsed = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.url = String(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.credentials = options.credentials || this.credentials || 'same-origin';
|
||||||
|
if (options.headers || !this.headers) {
|
||||||
|
this.headers = new Headers(options.headers);
|
||||||
|
}
|
||||||
|
this.method = normalizeMethod(options.method || this.method || 'GET');
|
||||||
|
this.mode = options.mode || this.mode || null;
|
||||||
|
this.signal = options.signal || this.signal;
|
||||||
|
this.referrer = null;
|
||||||
|
|
||||||
|
if ((this.method === 'GET' || this.method === 'HEAD') && body) {
|
||||||
|
throw new TypeError('Body not allowed for GET or HEAD requests')
|
||||||
|
}
|
||||||
|
this._initBody(body);
|
||||||
|
}
|
||||||
|
|
||||||
|
Request.prototype.clone = function() {
|
||||||
|
return new Request(this, {body: this._bodyInit})
|
||||||
|
};
|
||||||
|
|
||||||
|
function decode(body) {
|
||||||
|
var form = new FormData();
|
||||||
|
body
|
||||||
|
.trim()
|
||||||
|
.split('&')
|
||||||
|
.forEach(function(bytes) {
|
||||||
|
if (bytes) {
|
||||||
|
var split = bytes.split('=');
|
||||||
|
var name = split.shift().replace(/\+/g, ' ');
|
||||||
|
var value = split.join('=').replace(/\+/g, ' ');
|
||||||
|
form.append(decodeURIComponent(name), decodeURIComponent(value));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return form
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseHeaders(rawHeaders) {
|
||||||
|
var headers = new Headers();
|
||||||
|
// Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
|
||||||
|
// https://tools.ietf.org/html/rfc7230#section-3.2
|
||||||
|
var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
|
||||||
|
preProcessedHeaders.split(/\r?\n/).forEach(function(line) {
|
||||||
|
var parts = line.split(':');
|
||||||
|
var key = parts.shift().trim();
|
||||||
|
if (key) {
|
||||||
|
var value = parts.join(':').trim();
|
||||||
|
headers.append(key, value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return headers
|
||||||
|
}
|
||||||
|
|
||||||
|
Body.call(Request.prototype);
|
||||||
|
|
||||||
|
function Response(bodyInit, options) {
|
||||||
|
if (!options) {
|
||||||
|
options = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
this.type = 'default';
|
||||||
|
this.status = options.status === undefined ? 200 : options.status;
|
||||||
|
this.ok = this.status >= 200 && this.status < 300;
|
||||||
|
this.statusText = 'statusText' in options ? options.statusText : 'OK';
|
||||||
|
this.headers = new Headers(options.headers);
|
||||||
|
this.url = options.url || '';
|
||||||
|
this._initBody(bodyInit);
|
||||||
|
}
|
||||||
|
|
||||||
|
Body.call(Response.prototype);
|
||||||
|
|
||||||
|
Response.prototype.clone = function() {
|
||||||
|
return new Response(this._bodyInit, {
|
||||||
|
status: this.status,
|
||||||
|
statusText: this.statusText,
|
||||||
|
headers: new Headers(this.headers),
|
||||||
|
url: this.url
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
Response.error = function() {
|
||||||
|
var response = new Response(null, {status: 0, statusText: ''});
|
||||||
|
response.type = 'error';
|
||||||
|
return response
|
||||||
|
};
|
||||||
|
|
||||||
|
var redirectStatuses = [301, 302, 303, 307, 308];
|
||||||
|
|
||||||
|
Response.redirect = function(url, status) {
|
||||||
|
if (redirectStatuses.indexOf(status) === -1) {
|
||||||
|
throw new RangeError('Invalid status code')
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Response(null, {status: status, headers: {location: url}})
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.DOMException = self.DOMException;
|
||||||
|
try {
|
||||||
|
new exports.DOMException();
|
||||||
|
} catch (err) {
|
||||||
|
exports.DOMException = function(message, name) {
|
||||||
|
this.message = message;
|
||||||
|
this.name = name;
|
||||||
|
var error = Error(message);
|
||||||
|
this.stack = error.stack;
|
||||||
|
};
|
||||||
|
exports.DOMException.prototype = Object.create(Error.prototype);
|
||||||
|
exports.DOMException.prototype.constructor = exports.DOMException;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fetch(input, init) {
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
var request = new Request(input, init);
|
||||||
|
|
||||||
|
if (request.signal && request.signal.aborted) {
|
||||||
|
return reject(new exports.DOMException('Aborted', 'AbortError'))
|
||||||
|
}
|
||||||
|
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
|
||||||
|
function abortXhr() {
|
||||||
|
xhr.abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
xhr.onload = function() {
|
||||||
|
var options = {
|
||||||
|
status: xhr.status,
|
||||||
|
statusText: xhr.statusText,
|
||||||
|
headers: parseHeaders(xhr.getAllResponseHeaders() || '')
|
||||||
|
};
|
||||||
|
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
|
||||||
|
var body = 'response' in xhr ? xhr.response : xhr.responseText;
|
||||||
|
resolve(new Response(body, options));
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.onerror = function() {
|
||||||
|
reject(new TypeError('Network request failed'));
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.ontimeout = function() {
|
||||||
|
reject(new TypeError('Network request failed'));
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.onabort = function() {
|
||||||
|
reject(new exports.DOMException('Aborted', 'AbortError'));
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.open(request.method, request.url, true);
|
||||||
|
|
||||||
|
if (request.credentials === 'include') {
|
||||||
|
xhr.withCredentials = true;
|
||||||
|
} else if (request.credentials === 'omit') {
|
||||||
|
xhr.withCredentials = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('responseType' in xhr && support.blob) {
|
||||||
|
xhr.responseType = 'blob';
|
||||||
|
}
|
||||||
|
|
||||||
|
request.headers.forEach(function(value, name) {
|
||||||
|
xhr.setRequestHeader(name, value);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (request.signal) {
|
||||||
|
request.signal.addEventListener('abort', abortXhr);
|
||||||
|
|
||||||
|
xhr.onreadystatechange = function() {
|
||||||
|
// DONE (success or failure)
|
||||||
|
if (xhr.readyState === 4) {
|
||||||
|
request.signal.removeEventListener('abort', abortXhr);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch.polyfill = true;
|
||||||
|
|
||||||
|
if (!self.fetch) {
|
||||||
|
self.fetch = fetch;
|
||||||
|
self.Headers = Headers;
|
||||||
|
self.Request = Request;
|
||||||
|
self.Response = Response;
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.Headers = Headers;
|
||||||
|
exports.Request = Request;
|
||||||
|
exports.Response = Response;
|
||||||
|
exports.fetch = fetch;
|
||||||
|
|
||||||
|
Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
|
||||||
|
})));
|
390
wp-includes/js/dist/vendor/wp-polyfill-formdata.js
vendored
Normal file
390
wp-includes/js/dist/vendor/wp-polyfill-formdata.js
vendored
Normal file
|
@ -0,0 +1,390 @@
|
||||||
|
if (typeof FormData === 'undefined' || !FormData.prototype.keys) {
|
||||||
|
const global = typeof window === 'object'
|
||||||
|
? window : typeof self === 'object'
|
||||||
|
? self : this
|
||||||
|
|
||||||
|
// keep a reference to native implementation
|
||||||
|
const _FormData = global.FormData
|
||||||
|
|
||||||
|
// To be monkey patched
|
||||||
|
const _send = global.XMLHttpRequest && global.XMLHttpRequest.prototype.send
|
||||||
|
const _fetch = global.Request && global.fetch
|
||||||
|
|
||||||
|
// Unable to patch Request constructor correctly
|
||||||
|
// const _Request = global.Request
|
||||||
|
// only way is to use ES6 class extend
|
||||||
|
// https://github.com/babel/babel/issues/1966
|
||||||
|
|
||||||
|
const stringTag = global.Symbol && Symbol.toStringTag
|
||||||
|
const map = new WeakMap
|
||||||
|
const wm = o => map.get(o)
|
||||||
|
const arrayFrom = Array.from || (obj => [].slice.call(obj))
|
||||||
|
|
||||||
|
// Add missing stringTags to blob and files
|
||||||
|
if (stringTag) {
|
||||||
|
if (!Blob.prototype[stringTag]) {
|
||||||
|
Blob.prototype[stringTag] = 'Blob'
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('File' in global && !File.prototype[stringTag]) {
|
||||||
|
File.prototype[stringTag] = 'File'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fix so you can construct your own File
|
||||||
|
try {
|
||||||
|
new File([], '')
|
||||||
|
} catch (a) {
|
||||||
|
global.File = function(b, d, c) {
|
||||||
|
const blob = new Blob(b, c)
|
||||||
|
const t = c && void 0 !== c.lastModified ? new Date(c.lastModified) : new Date
|
||||||
|
|
||||||
|
Object.defineProperties(blob, {
|
||||||
|
name: {
|
||||||
|
value: d
|
||||||
|
},
|
||||||
|
lastModifiedDate: {
|
||||||
|
value: t
|
||||||
|
},
|
||||||
|
lastModified: {
|
||||||
|
value: +t
|
||||||
|
},
|
||||||
|
toString: {
|
||||||
|
value() {
|
||||||
|
return '[object File]'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (stringTag) {
|
||||||
|
Object.defineProperty(blob, stringTag, {
|
||||||
|
value: 'File'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return blob
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeValue([value, filename]) {
|
||||||
|
if (value instanceof Blob)
|
||||||
|
// Should always returns a new File instance
|
||||||
|
// console.assert(fd.get(x) !== fd.get(x))
|
||||||
|
value = new File([value], filename, {
|
||||||
|
type: value.type,
|
||||||
|
lastModified: value.lastModified
|
||||||
|
})
|
||||||
|
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
|
function stringify(name) {
|
||||||
|
if (!arguments.length)
|
||||||
|
throw new TypeError('1 argument required, but only 0 present.')
|
||||||
|
|
||||||
|
return [name + '']
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeArgs(name, value, filename) {
|
||||||
|
if (arguments.length < 2)
|
||||||
|
throw new TypeError(
|
||||||
|
`2 arguments required, but only ${arguments.length} present.`
|
||||||
|
)
|
||||||
|
|
||||||
|
return value instanceof Blob
|
||||||
|
// normalize name and filename if adding an attachment
|
||||||
|
? [name + '', value, filename !== undefined
|
||||||
|
? filename + '' // Cast filename to string if 3th arg isn't undefined
|
||||||
|
: typeof value.name === 'string' // if name prop exist
|
||||||
|
? value.name // Use File.name
|
||||||
|
: 'blob'] // otherwise fallback to Blob
|
||||||
|
|
||||||
|
// If no attachment, just cast the args to strings
|
||||||
|
: [name + '', value + '']
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @implements {Iterable}
|
||||||
|
*/
|
||||||
|
class FormDataPolyfill {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FormData class
|
||||||
|
*
|
||||||
|
* @param {HTMLElement=} form
|
||||||
|
*/
|
||||||
|
constructor(form) {
|
||||||
|
map.set(this, Object.create(null))
|
||||||
|
|
||||||
|
if (!form)
|
||||||
|
return this
|
||||||
|
|
||||||
|
for (let elm of arrayFrom(form.elements)) {
|
||||||
|
if (!elm.name || elm.disabled) continue
|
||||||
|
|
||||||
|
if (elm.type === 'file')
|
||||||
|
for (let file of arrayFrom(elm.files || []))
|
||||||
|
this.append(elm.name, file)
|
||||||
|
else if (elm.type === 'select-multiple' || elm.type === 'select-one')
|
||||||
|
for (let opt of arrayFrom(elm.options))
|
||||||
|
!opt.disabled && opt.selected && this.append(elm.name, opt.value)
|
||||||
|
else if (elm.type === 'checkbox' || elm.type === 'radio') {
|
||||||
|
if (elm.checked) this.append(elm.name, elm.value)
|
||||||
|
} else
|
||||||
|
this.append(elm.name, elm.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Append a field
|
||||||
|
*
|
||||||
|
* @param {String} name field name
|
||||||
|
* @param {String|Blob|File} value string / blob / file
|
||||||
|
* @param {String=} filename filename to use with blob
|
||||||
|
* @return {Undefined}
|
||||||
|
*/
|
||||||
|
append(name, value, filename) {
|
||||||
|
const map = wm(this)
|
||||||
|
|
||||||
|
if (!map[name])
|
||||||
|
map[name] = []
|
||||||
|
|
||||||
|
map[name].push([value, filename])
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete all fields values given name
|
||||||
|
*
|
||||||
|
* @param {String} name Field name
|
||||||
|
* @return {Undefined}
|
||||||
|
*/
|
||||||
|
delete(name) {
|
||||||
|
delete wm(this)[name]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Iterate over all fields as [name, value]
|
||||||
|
*
|
||||||
|
* @return {Iterator}
|
||||||
|
*/
|
||||||
|
*entries() {
|
||||||
|
const map = wm(this)
|
||||||
|
|
||||||
|
for (let name in map)
|
||||||
|
for (let value of map[name])
|
||||||
|
yield [name, normalizeValue(value)]
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Iterate over all fields
|
||||||
|
*
|
||||||
|
* @param {Function} callback Executed for each item with parameters (value, name, thisArg)
|
||||||
|
* @param {Object=} thisArg `this` context for callback function
|
||||||
|
* @return {Undefined}
|
||||||
|
*/
|
||||||
|
forEach(callback, thisArg) {
|
||||||
|
for (let [name, value] of this)
|
||||||
|
callback.call(thisArg, value, name, this)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return first field value given name
|
||||||
|
* or null if non existen
|
||||||
|
*
|
||||||
|
* @param {String} name Field name
|
||||||
|
* @return {String|File|null} value Fields value
|
||||||
|
*/
|
||||||
|
get(name) {
|
||||||
|
const map = wm(this)
|
||||||
|
return map[name] ? normalizeValue(map[name][0]) : null
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return all fields values given name
|
||||||
|
*
|
||||||
|
* @param {String} name Fields name
|
||||||
|
* @return {Array} [{String|File}]
|
||||||
|
*/
|
||||||
|
getAll(name) {
|
||||||
|
return (wm(this)[name] || []).map(normalizeValue)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check for field name existence
|
||||||
|
*
|
||||||
|
* @param {String} name Field name
|
||||||
|
* @return {boolean}
|
||||||
|
*/
|
||||||
|
has(name) {
|
||||||
|
return name in wm(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Iterate over all fields name
|
||||||
|
*
|
||||||
|
* @return {Iterator}
|
||||||
|
*/
|
||||||
|
*keys() {
|
||||||
|
for (let [name] of this)
|
||||||
|
yield name
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Overwrite all values given name
|
||||||
|
*
|
||||||
|
* @param {String} name Filed name
|
||||||
|
* @param {String} value Field value
|
||||||
|
* @param {String=} filename Filename (optional)
|
||||||
|
* @return {Undefined}
|
||||||
|
*/
|
||||||
|
set(name, value, filename) {
|
||||||
|
wm(this)[name] = [[value, filename]]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Iterate over all fields
|
||||||
|
*
|
||||||
|
* @return {Iterator}
|
||||||
|
*/
|
||||||
|
*values() {
|
||||||
|
for (let [name, value] of this)
|
||||||
|
yield value
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a native (perhaps degraded) FormData with only a `append` method
|
||||||
|
* Can throw if it's not supported
|
||||||
|
*
|
||||||
|
* @return {FormData}
|
||||||
|
*/
|
||||||
|
['_asNative']() {
|
||||||
|
const fd = new _FormData
|
||||||
|
|
||||||
|
for (let [name, value] of this)
|
||||||
|
fd.append(name, value)
|
||||||
|
|
||||||
|
return fd
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [_blob description]
|
||||||
|
*
|
||||||
|
* @return {Blob} [description]
|
||||||
|
*/
|
||||||
|
['_blob']() {
|
||||||
|
const boundary = '----formdata-polyfill-' + Math.random()
|
||||||
|
const chunks = []
|
||||||
|
|
||||||
|
for (let [name, value] of this) {
|
||||||
|
chunks.push(`--${boundary}\r\n`)
|
||||||
|
|
||||||
|
if (value instanceof Blob) {
|
||||||
|
chunks.push(
|
||||||
|
`Content-Disposition: form-data; name="${name}"; filename="${value.name}"\r\n`,
|
||||||
|
`Content-Type: ${value.type || 'application/octet-stream'}\r\n\r\n`,
|
||||||
|
value,
|
||||||
|
'\r\n'
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
chunks.push(
|
||||||
|
`Content-Disposition: form-data; name="${name}"\r\n\r\n${value}\r\n`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
chunks.push(`--${boundary}--`)
|
||||||
|
|
||||||
|
return new Blob(chunks, {type: 'multipart/form-data; boundary=' + boundary})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The class itself is iterable
|
||||||
|
* alias for formdata.entries()
|
||||||
|
*
|
||||||
|
* @return {Iterator}
|
||||||
|
*/
|
||||||
|
[Symbol.iterator]() {
|
||||||
|
return this.entries()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the default string description.
|
||||||
|
*
|
||||||
|
* @return {String} [object FormData]
|
||||||
|
*/
|
||||||
|
toString() {
|
||||||
|
return '[object FormData]'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (stringTag) {
|
||||||
|
/**
|
||||||
|
* Create the default string description.
|
||||||
|
* It is accessed internally by the Object.prototype.toString().
|
||||||
|
*
|
||||||
|
* @return {String} FormData
|
||||||
|
*/
|
||||||
|
FormDataPolyfill.prototype[stringTag] = 'FormData'
|
||||||
|
}
|
||||||
|
|
||||||
|
const decorations = [
|
||||||
|
['append', normalizeArgs],
|
||||||
|
['delete', stringify],
|
||||||
|
['get', stringify],
|
||||||
|
['getAll', stringify],
|
||||||
|
['has', stringify],
|
||||||
|
['set', normalizeArgs]
|
||||||
|
]
|
||||||
|
|
||||||
|
decorations.forEach(arr => {
|
||||||
|
const orig = FormDataPolyfill.prototype[arr[0]]
|
||||||
|
FormDataPolyfill.prototype[arr[0]] = function() {
|
||||||
|
return orig.apply(this, arr[1].apply(this, arrayFrom(arguments)))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// Patch xhr's send method to call _blob transparently
|
||||||
|
if (_send) {
|
||||||
|
XMLHttpRequest.prototype.send = function(data) {
|
||||||
|
// I would check if Content-Type isn't already set
|
||||||
|
// But xhr lacks getRequestHeaders functionallity
|
||||||
|
// https://github.com/jimmywarting/FormData/issues/44
|
||||||
|
if (data instanceof FormDataPolyfill) {
|
||||||
|
const blob = data['_blob']()
|
||||||
|
this.setRequestHeader('Content-Type', blob.type)
|
||||||
|
_send.call(this, blob)
|
||||||
|
} else {
|
||||||
|
_send.call(this, data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Patch fetch's function to call _blob transparently
|
||||||
|
if (_fetch) {
|
||||||
|
const _fetch = global.fetch
|
||||||
|
|
||||||
|
global.fetch = function(input, init) {
|
||||||
|
if (init && init.body && init.body instanceof FormDataPolyfill) {
|
||||||
|
init.body = init.body['_blob']()
|
||||||
|
}
|
||||||
|
|
||||||
|
return _fetch(input, init)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
global['FormData'] = FormDataPolyfill
|
||||||
|
}
|
30
wp-includes/js/dist/vendor/wp-polyfill-node-contains.js
vendored
Normal file
30
wp-includes/js/dist/vendor/wp-polyfill-node-contains.js
vendored
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
function contains(node) {
|
||||||
|
if (!(0 in arguments)) {
|
||||||
|
throw new TypeError('1 argument is required');
|
||||||
|
}
|
||||||
|
|
||||||
|
do {
|
||||||
|
if (this === node) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} while (node = node && node.parentNode);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// IE
|
||||||
|
if ('HTMLElement' in this && 'contains' in HTMLElement.prototype) {
|
||||||
|
try {
|
||||||
|
delete HTMLElement.prototype.contains;
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('Node' in this) {
|
||||||
|
Node.prototype.contains = contains;
|
||||||
|
} else {
|
||||||
|
document.contains = Element.prototype.contains = contains;
|
||||||
|
}
|
||||||
|
|
||||||
|
}());
|
540
wp-includes/js/dist/viewport.js
vendored
Normal file
540
wp-includes/js/dist/viewport.js
vendored
Normal file
|
@ -0,0 +1,540 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["viewport"] =
|
||||||
|
/******/ (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/viewport/build-module/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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/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/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/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/@wordpress/viewport/build-module/if-viewport-matches.js":
|
||||||
|
/*!******************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/viewport/build-module/if-viewport-matches.js ***!
|
||||||
|
\******************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
|
||||||
|
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony import */ var _with_viewport_match__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./with-viewport-match */ "./node_modules/@wordpress/viewport/build-module/with-viewport-match.js");
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Higher-order component creator, creating a new component which renders if
|
||||||
|
* the viewport query is satisfied.
|
||||||
|
*
|
||||||
|
* @param {string} query Viewport query.
|
||||||
|
*
|
||||||
|
* @see withViewportMatches
|
||||||
|
*
|
||||||
|
* @return {Function} Higher-order component.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var ifViewportMatches = function ifViewportMatches(query) {
|
||||||
|
return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__["createHigherOrderComponent"])(Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__["compose"])([Object(_with_viewport_match__WEBPACK_IMPORTED_MODULE_1__["default"])({
|
||||||
|
isViewportMatch: query
|
||||||
|
}), Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__["ifCondition"])(function (props) {
|
||||||
|
return props.isViewportMatch;
|
||||||
|
})]), 'ifViewportMatches');
|
||||||
|
};
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (ifViewportMatches);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/viewport/build-module/index.js":
|
||||||
|
/*!****************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/viewport/build-module/index.js ***!
|
||||||
|
\****************************************************************/
|
||||||
|
/*! exports provided: ifViewportMatches, withViewportMatch */
|
||||||
|
/***/ (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 _store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./store */ "./node_modules/@wordpress/viewport/build-module/store/index.js");
|
||||||
|
/* harmony import */ var _if_viewport_matches__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./if-viewport-matches */ "./node_modules/@wordpress/viewport/build-module/if-viewport-matches.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ifViewportMatches", function() { return _if_viewport_matches__WEBPACK_IMPORTED_MODULE_3__["default"]; });
|
||||||
|
|
||||||
|
/* harmony import */ var _with_viewport_match__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./with-viewport-match */ "./node_modules/@wordpress/viewport/build-module/with-viewport-match.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withViewportMatch", function() { return _with_viewport_match__WEBPACK_IMPORTED_MODULE_4__["default"]; });
|
||||||
|
|
||||||
|
/**
|
||||||
|
* External dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hash of breakpoint names with pixel width at which it becomes effective.
|
||||||
|
*
|
||||||
|
* @see _breakpoints.scss
|
||||||
|
*
|
||||||
|
* @type {Object}
|
||||||
|
*/
|
||||||
|
|
||||||
|
var BREAKPOINTS = {
|
||||||
|
huge: 1440,
|
||||||
|
wide: 1280,
|
||||||
|
large: 960,
|
||||||
|
medium: 782,
|
||||||
|
small: 600,
|
||||||
|
mobile: 480
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Hash of query operators with corresponding condition for media query.
|
||||||
|
*
|
||||||
|
* @type {Object}
|
||||||
|
*/
|
||||||
|
|
||||||
|
var OPERATORS = {
|
||||||
|
'<': 'max-width',
|
||||||
|
'>=': 'min-width'
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Callback invoked when media query state should be updated. Is invoked a
|
||||||
|
* maximum of one time per call stack.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var setIsMatching = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["debounce"])(function () {
|
||||||
|
var values = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["mapValues"])(queries, function (query) {
|
||||||
|
return query.matches;
|
||||||
|
});
|
||||||
|
Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["dispatch"])('core/viewport').setIsMatching(values);
|
||||||
|
}, {
|
||||||
|
leading: true
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* Hash of breakpoint names with generated MediaQueryList for corresponding
|
||||||
|
* media query.
|
||||||
|
*
|
||||||
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia
|
||||||
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList
|
||||||
|
*
|
||||||
|
* @type {Object<string,MediaQueryList>}
|
||||||
|
*/
|
||||||
|
|
||||||
|
var queries = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["reduce"])(BREAKPOINTS, function (result, width, name) {
|
||||||
|
Object(lodash__WEBPACK_IMPORTED_MODULE_0__["forEach"])(OPERATORS, function (condition, operator) {
|
||||||
|
var list = window.matchMedia("(".concat(condition, ": ").concat(width, "px)"));
|
||||||
|
list.addListener(setIsMatching);
|
||||||
|
var key = [operator, name].join(' ');
|
||||||
|
result[key] = list;
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}, {});
|
||||||
|
window.addEventListener('orientationchange', setIsMatching); // Set initial values
|
||||||
|
|
||||||
|
setIsMatching();
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/viewport/build-module/store/actions.js":
|
||||||
|
/*!************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/viewport/build-module/store/actions.js ***!
|
||||||
|
\************************************************************************/
|
||||||
|
/*! exports provided: setIsMatching */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setIsMatching", function() { return setIsMatching; });
|
||||||
|
/**
|
||||||
|
* Returns an action object used in signalling that viewport queries have been
|
||||||
|
* updated. Values are specified as an object of breakpoint query keys where
|
||||||
|
* value represents whether query matches.
|
||||||
|
*
|
||||||
|
* @param {Object} values Breakpoint query matches.
|
||||||
|
*
|
||||||
|
* @return {Object} Action object.
|
||||||
|
*/
|
||||||
|
function setIsMatching(values) {
|
||||||
|
return {
|
||||||
|
type: 'SET_IS_MATCHING',
|
||||||
|
values: values
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/viewport/build-module/store/index.js":
|
||||||
|
/*!**********************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/viewport/build-module/store/index.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__);
|
||||||
|
/* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reducer */ "./node_modules/@wordpress/viewport/build-module/store/reducer.js");
|
||||||
|
/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./actions */ "./node_modules/@wordpress/viewport/build-module/store/actions.js");
|
||||||
|
/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./selectors */ "./node_modules/@wordpress/viewport/build-module/store/selectors.js");
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["registerStore"])('core/viewport', {
|
||||||
|
reducer: _reducer__WEBPACK_IMPORTED_MODULE_1__["default"],
|
||||||
|
actions: _actions__WEBPACK_IMPORTED_MODULE_2__,
|
||||||
|
selectors: _selectors__WEBPACK_IMPORTED_MODULE_3__
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/viewport/build-module/store/reducer.js":
|
||||||
|
/*!************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/viewport/build-module/store/reducer.js ***!
|
||||||
|
\************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Reducer returning the viewport state, as keys of breakpoint queries with
|
||||||
|
* boolean value representing whether query is matched.
|
||||||
|
*
|
||||||
|
* @param {Object} state Current state.
|
||||||
|
* @param {Object} action Dispatched action.
|
||||||
|
*
|
||||||
|
* @return {Object} Updated state.
|
||||||
|
*/
|
||||||
|
function reducer() {
|
||||||
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||||
|
var action = arguments.length > 1 ? arguments[1] : undefined;
|
||||||
|
|
||||||
|
switch (action.type) {
|
||||||
|
case 'SET_IS_MATCHING':
|
||||||
|
return action.values;
|
||||||
|
}
|
||||||
|
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (reducer);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/viewport/build-module/store/selectors.js":
|
||||||
|
/*!**************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/viewport/build-module/store/selectors.js ***!
|
||||||
|
\**************************************************************************/
|
||||||
|
/*! exports provided: isViewportMatch */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isViewportMatch", function() { return isViewportMatch; });
|
||||||
|
/* 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 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__);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* External dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the viewport matches the given query, or false otherwise.
|
||||||
|
*
|
||||||
|
* @param {Object} state Viewport state object.
|
||||||
|
* @param {string} query Query string. Includes operator and breakpoint name,
|
||||||
|
* space separated. Operator defaults to >=.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* ```js
|
||||||
|
* isViewportMatch( state, '< huge' );
|
||||||
|
* isViewPortMatch( state, 'medium' );
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @return {boolean} Whether viewport matches query.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function isViewportMatch(state, query) {
|
||||||
|
// Pad to _at least_ two elements to take from the right, effectively
|
||||||
|
// defaulting the left-most value.
|
||||||
|
var key = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["takeRight"])(['>='].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(query.split(' '))), 2).join(' ');
|
||||||
|
return !!state[key];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/viewport/build-module/with-viewport-match.js":
|
||||||
|
/*!******************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/viewport/build-module/with-viewport-match.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
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Higher-order component creator, creating a new component which renders with
|
||||||
|
* the given prop names, where the value passed to the underlying component is
|
||||||
|
* the result of the query assigned as the object's value.
|
||||||
|
*
|
||||||
|
* @param {Object} queries Object of prop name to viewport query.
|
||||||
|
*
|
||||||
|
* @see isViewportMatch
|
||||||
|
*
|
||||||
|
* @return {Function} Higher-order component.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var withViewportMatch = function withViewportMatch(queries) {
|
||||||
|
return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["createHigherOrderComponent"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["withSelect"])(function (select) {
|
||||||
|
return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["mapValues"])(queries, function (query) {
|
||||||
|
return select('core/viewport').isViewportMatch(query);
|
||||||
|
});
|
||||||
|
}), 'withViewportMatch');
|
||||||
|
};
|
||||||
|
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (withViewportMatch);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/compose":
|
||||||
|
/*!******************************************!*\
|
||||||
|
!*** external {"this":["wp","compose"]} ***!
|
||||||
|
\******************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["compose"]; }());
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/data":
|
||||||
|
/*!***************************************!*\
|
||||||
|
!*** external {"this":["wp","data"]} ***!
|
||||||
|
\***************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["wp"]["data"]; }());
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "lodash":
|
||||||
|
/*!*************************!*\
|
||||||
|
!*** external "lodash" ***!
|
||||||
|
\*************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["lodash"]; }());
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=viewport.js.map
|
1
wp-includes/js/dist/viewport.js.map
vendored
Normal file
1
wp-includes/js/dist/viewport.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
539
wp-includes/js/dist/wordcount.js
vendored
Normal file
539
wp-includes/js/dist/wordcount.js
vendored
Normal file
|
@ -0,0 +1,539 @@
|
||||||
|
this["wp"] = this["wp"] || {}; this["wp"]["wordcount"] =
|
||||||
|
/******/ (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/wordcount/build-module/index.js");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/wordcount/build-module/defaultSettings.js":
|
||||||
|
/*!***************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/wordcount/build-module/defaultSettings.js ***!
|
||||||
|
\***************************************************************************/
|
||||||
|
/*! exports provided: defaultSettings */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultSettings", function() { return defaultSettings; });
|
||||||
|
var defaultSettings = {
|
||||||
|
HTMLRegExp: /<\/?[a-z][^>]*?>/gi,
|
||||||
|
HTMLcommentRegExp: /<!--[\s\S]*?-->/g,
|
||||||
|
spaceRegExp: / | /gi,
|
||||||
|
HTMLEntityRegExp: /&\S+?;/g,
|
||||||
|
// \u2014 = em-dash
|
||||||
|
connectorRegExp: /--|\u2014/g,
|
||||||
|
// Characters to be removed from input text.
|
||||||
|
removeRegExp: new RegExp(['[', // Basic Latin (extract)
|
||||||
|
"!-@[-`{-~", // Latin-1 Supplement (extract)
|
||||||
|
"\x80-\xBF\xD7\xF7",
|
||||||
|
/*
|
||||||
|
* The following range consists of:
|
||||||
|
* General Punctuation
|
||||||
|
* Superscripts and Subscripts
|
||||||
|
* Currency Symbols
|
||||||
|
* Combining Diacritical Marks for Symbols
|
||||||
|
* Letterlike Symbols
|
||||||
|
* Number Forms
|
||||||
|
* Arrows
|
||||||
|
* Mathematical Operators
|
||||||
|
* Miscellaneous Technical
|
||||||
|
* Control Pictures
|
||||||
|
* Optical Character Recognition
|
||||||
|
* Enclosed Alphanumerics
|
||||||
|
* Box Drawing
|
||||||
|
* Block Elements
|
||||||
|
* Geometric Shapes
|
||||||
|
* Miscellaneous Symbols
|
||||||
|
* Dingbats
|
||||||
|
* Miscellaneous Mathematical Symbols-A
|
||||||
|
* Supplemental Arrows-A
|
||||||
|
* Braille Patterns
|
||||||
|
* Supplemental Arrows-B
|
||||||
|
* Miscellaneous Mathematical Symbols-B
|
||||||
|
* Supplemental Mathematical Operators
|
||||||
|
* Miscellaneous Symbols and Arrows
|
||||||
|
*/
|
||||||
|
"\u2000-\u2BFF", // Supplemental Punctuation
|
||||||
|
"\u2E00-\u2E7F", ']'].join(''), 'g'),
|
||||||
|
// Remove UTF-16 surrogate points, see https://en.wikipedia.org/wiki/UTF-16#U.2BD800_to_U.2BDFFF
|
||||||
|
astralRegExp: /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
|
||||||
|
wordsRegExp: /\S\s+/g,
|
||||||
|
characters_excluding_spacesRegExp: /\S/g,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Match anything that is not a formatting character, excluding:
|
||||||
|
* \f = form feed
|
||||||
|
* \n = new line
|
||||||
|
* \r = carriage return
|
||||||
|
* \t = tab
|
||||||
|
* \v = vertical tab
|
||||||
|
* \u00AD = soft hyphen
|
||||||
|
* \u2028 = line separator
|
||||||
|
* \u2029 = paragraph separator
|
||||||
|
*/
|
||||||
|
characters_including_spacesRegExp: /[^\f\n\r\t\v\u00AD\u2028\u2029]/g,
|
||||||
|
l10n: {
|
||||||
|
type: 'words'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/wordcount/build-module/index.js":
|
||||||
|
/*!*****************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/wordcount/build-module/index.js ***!
|
||||||
|
\*****************************************************************/
|
||||||
|
/*! exports provided: count */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "count", function() { return count; });
|
||||||
|
/* 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 _defaultSettings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./defaultSettings */ "./node_modules/@wordpress/wordcount/build-module/defaultSettings.js");
|
||||||
|
/* harmony import */ var _stripTags__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stripTags */ "./node_modules/@wordpress/wordcount/build-module/stripTags.js");
|
||||||
|
/* harmony import */ var _transposeAstralsToCountableChar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./transposeAstralsToCountableChar */ "./node_modules/@wordpress/wordcount/build-module/transposeAstralsToCountableChar.js");
|
||||||
|
/* harmony import */ var _stripHTMLEntities__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./stripHTMLEntities */ "./node_modules/@wordpress/wordcount/build-module/stripHTMLEntities.js");
|
||||||
|
/* harmony import */ var _stripConnectors__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./stripConnectors */ "./node_modules/@wordpress/wordcount/build-module/stripConnectors.js");
|
||||||
|
/* harmony import */ var _stripRemovables__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./stripRemovables */ "./node_modules/@wordpress/wordcount/build-module/stripRemovables.js");
|
||||||
|
/* harmony import */ var _stripHTMLComments__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./stripHTMLComments */ "./node_modules/@wordpress/wordcount/build-module/stripHTMLComments.js");
|
||||||
|
/* harmony import */ var _stripShortcodes__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./stripShortcodes */ "./node_modules/@wordpress/wordcount/build-module/stripShortcodes.js");
|
||||||
|
/* harmony import */ var _stripSpaces__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./stripSpaces */ "./node_modules/@wordpress/wordcount/build-module/stripSpaces.js");
|
||||||
|
/* harmony import */ var _transposeHTMLEntitiesToCountableChars__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./transposeHTMLEntitiesToCountableChars */ "./node_modules/@wordpress/wordcount/build-module/transposeHTMLEntitiesToCountableChars.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Private function to manage the settings.
|
||||||
|
*
|
||||||
|
* @param {string} type The type of count to be done.
|
||||||
|
* @param {Object} userSettings Custom settings for the count.
|
||||||
|
*
|
||||||
|
* @return {void|Object|*} The combined settings object to be used.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function loadSettings(type, userSettings) {
|
||||||
|
var settings = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["extend"])(_defaultSettings__WEBPACK_IMPORTED_MODULE_1__["defaultSettings"], userSettings);
|
||||||
|
settings.shortcodes = settings.l10n.shortcodes || {};
|
||||||
|
|
||||||
|
if (settings.shortcodes && settings.shortcodes.length) {
|
||||||
|
settings.shortcodesRegExp = new RegExp('\\[\\/?(?:' + settings.shortcodes.join('|') + ')[^\\]]*?\\]', 'g');
|
||||||
|
}
|
||||||
|
|
||||||
|
settings.type = type || settings.l10n.type;
|
||||||
|
|
||||||
|
if (settings.type !== 'characters_excluding_spaces' && settings.type !== 'characters_including_spaces') {
|
||||||
|
settings.type = 'words';
|
||||||
|
}
|
||||||
|
|
||||||
|
return settings;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Match the regex for the type 'words'
|
||||||
|
*
|
||||||
|
* @param {string} text The text being processed
|
||||||
|
* @param {string} regex The regular expression pattern being matched
|
||||||
|
* @param {Object} settings Settings object containing regular expressions for each strip function
|
||||||
|
*
|
||||||
|
* @return {Array|{index: number, input: string}} The matched string.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function matchWords(text, regex, settings) {
|
||||||
|
text = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["flow"])(_stripTags__WEBPACK_IMPORTED_MODULE_2__["default"].bind(this, settings), _stripHTMLComments__WEBPACK_IMPORTED_MODULE_7__["default"].bind(this, settings), _stripShortcodes__WEBPACK_IMPORTED_MODULE_8__["default"].bind(this, settings), _stripSpaces__WEBPACK_IMPORTED_MODULE_9__["default"].bind(this, settings), _stripHTMLEntities__WEBPACK_IMPORTED_MODULE_4__["default"].bind(this, settings), _stripConnectors__WEBPACK_IMPORTED_MODULE_5__["default"].bind(this, settings), _stripRemovables__WEBPACK_IMPORTED_MODULE_6__["default"].bind(this, settings))(text);
|
||||||
|
text = text + '\n';
|
||||||
|
return text.match(regex);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Match the regex for either 'characters_excluding_spaces' or 'characters_including_spaces'
|
||||||
|
*
|
||||||
|
* @param {string} text The text being processed
|
||||||
|
* @param {string} regex The regular expression pattern being matched
|
||||||
|
* @param {Object} settings Settings object containing regular expressions for each strip function
|
||||||
|
*
|
||||||
|
* @return {Array|{index: number, input: string}} The matched string.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function matchCharacters(text, regex, settings) {
|
||||||
|
text = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["flow"])(_stripTags__WEBPACK_IMPORTED_MODULE_2__["default"].bind(this, settings), _stripHTMLComments__WEBPACK_IMPORTED_MODULE_7__["default"].bind(this, settings), _stripShortcodes__WEBPACK_IMPORTED_MODULE_8__["default"].bind(this, settings), _stripSpaces__WEBPACK_IMPORTED_MODULE_9__["default"].bind(this, settings), _transposeAstralsToCountableChar__WEBPACK_IMPORTED_MODULE_3__["default"].bind(this, settings), _transposeHTMLEntitiesToCountableChars__WEBPACK_IMPORTED_MODULE_10__["default"].bind(this, settings))(text);
|
||||||
|
text = text + '\n';
|
||||||
|
return text.match(regex);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Count some words.
|
||||||
|
*
|
||||||
|
* @param {String} text The text being processed
|
||||||
|
* @param {String} type The type of count. Accepts ;words', 'characters_excluding_spaces', or 'characters_including_spaces'.
|
||||||
|
* @param {Object} userSettings Custom settings object.
|
||||||
|
*
|
||||||
|
* @return {Number} The word or character count.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function count(text, type, userSettings) {
|
||||||
|
var settings = loadSettings(type, userSettings);
|
||||||
|
|
||||||
|
if (text) {
|
||||||
|
var matchRegExp = settings[type + 'RegExp'];
|
||||||
|
var results = 'words' === settings.type ? matchWords(text, matchRegExp, settings) : matchCharacters(text, matchRegExp, settings);
|
||||||
|
return results ? results.length : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/wordcount/build-module/stripConnectors.js":
|
||||||
|
/*!***************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/wordcount/build-module/stripConnectors.js ***!
|
||||||
|
\***************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Replaces items matched in the regex with spaces.
|
||||||
|
*
|
||||||
|
* @param {Object} settings The main settings object containing regular expressions
|
||||||
|
* @param {string} text The string being counted.
|
||||||
|
*
|
||||||
|
* @return {string} The manipulated text.
|
||||||
|
*/
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (function (settings, text) {
|
||||||
|
if (settings.connectorRegExp) {
|
||||||
|
return text.replace(settings.connectorRegExp, ' ');
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/wordcount/build-module/stripHTMLComments.js":
|
||||||
|
/*!*****************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/wordcount/build-module/stripHTMLComments.js ***!
|
||||||
|
\*****************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Removes items matched in the regex.
|
||||||
|
*
|
||||||
|
* @param {Object} settings The main settings object containing regular expressions
|
||||||
|
* @param {string} text The string being counted.
|
||||||
|
*
|
||||||
|
* @return {string} The manipulated text.
|
||||||
|
*/
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (function (settings, text) {
|
||||||
|
if (settings.HTMLcommentRegExp) {
|
||||||
|
return text.replace(settings.HTMLcommentRegExp, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/wordcount/build-module/stripHTMLEntities.js":
|
||||||
|
/*!*****************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/wordcount/build-module/stripHTMLEntities.js ***!
|
||||||
|
\*****************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Removes items matched in the regex.
|
||||||
|
*
|
||||||
|
* @param {Object} settings The main settings object containing regular expressions
|
||||||
|
* @param {string} text The string being counted.
|
||||||
|
*
|
||||||
|
* @return {string} The manipulated text.
|
||||||
|
*/
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (function (settings, text) {
|
||||||
|
if (settings.HTMLEntityRegExp) {
|
||||||
|
return text.replace(settings.HTMLEntityRegExp, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/wordcount/build-module/stripRemovables.js":
|
||||||
|
/*!***************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/wordcount/build-module/stripRemovables.js ***!
|
||||||
|
\***************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Removes items matched in the regex.
|
||||||
|
*
|
||||||
|
* @param {Object} settings The main settings object containing regular expressions
|
||||||
|
* @param {string} text The string being counted.
|
||||||
|
*
|
||||||
|
* @return {string} The manipulated text.
|
||||||
|
*/
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (function (settings, text) {
|
||||||
|
if (settings.removeRegExp) {
|
||||||
|
return text.replace(settings.removeRegExp, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/wordcount/build-module/stripShortcodes.js":
|
||||||
|
/*!***************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/wordcount/build-module/stripShortcodes.js ***!
|
||||||
|
\***************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Replaces items matched in the regex with a new line.
|
||||||
|
*
|
||||||
|
* @param {Object} settings The main settings object containing regular expressions
|
||||||
|
* @param {string} text The string being counted.
|
||||||
|
*
|
||||||
|
* @return {string} The manipulated text.
|
||||||
|
*/
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (function (settings, text) {
|
||||||
|
if (settings.shortcodesRegExp) {
|
||||||
|
return text.replace(settings.shortcodesRegExp, '\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/wordcount/build-module/stripSpaces.js":
|
||||||
|
/*!***********************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/wordcount/build-module/stripSpaces.js ***!
|
||||||
|
\***********************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Replaces items matched in the regex with spaces.
|
||||||
|
*
|
||||||
|
* @param {Object} settings The main settings object containing regular expressions
|
||||||
|
* @param {string} text The string being counted.
|
||||||
|
*
|
||||||
|
* @return {string} The manipulated text.
|
||||||
|
*/
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (function (settings, text) {
|
||||||
|
if (settings.spaceRegExp) {
|
||||||
|
return text.replace(settings.spaceRegExp, ' ');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/wordcount/build-module/stripTags.js":
|
||||||
|
/*!*********************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/wordcount/build-module/stripTags.js ***!
|
||||||
|
\*********************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Replaces items matched in the regex with new line
|
||||||
|
*
|
||||||
|
* @param {Object} settings The main settings object containing regular expressions
|
||||||
|
* @param {string} text The string being counted.
|
||||||
|
*
|
||||||
|
* @return {string} The manipulated text.
|
||||||
|
*/
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (function (settings, text) {
|
||||||
|
if (settings.HTMLRegExp) {
|
||||||
|
return text.replace(settings.HTMLRegExp, '\n');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/wordcount/build-module/transposeAstralsToCountableChar.js":
|
||||||
|
/*!*******************************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/wordcount/build-module/transposeAstralsToCountableChar.js ***!
|
||||||
|
\*******************************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Replaces items matched in the regex with character.
|
||||||
|
*
|
||||||
|
* @param {Object} settings The main settings object containing regular expressions
|
||||||
|
* @param {string} text The string being counted.
|
||||||
|
*
|
||||||
|
* @return {string} The manipulated text.
|
||||||
|
*/
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (function (settings, text) {
|
||||||
|
if (settings.astralRegExp) {
|
||||||
|
return text.replace(settings.astralRegExp, 'a');
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@wordpress/wordcount/build-module/transposeHTMLEntitiesToCountableChars.js":
|
||||||
|
/*!*************************************************************************************************!*\
|
||||||
|
!*** ./node_modules/@wordpress/wordcount/build-module/transposeHTMLEntitiesToCountableChars.js ***!
|
||||||
|
\*************************************************************************************************/
|
||||||
|
/*! exports provided: default */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/**
|
||||||
|
* Replaces items matched in the regex with a single character.
|
||||||
|
*
|
||||||
|
* @param {Object} settings The main settings object containing regular expressions
|
||||||
|
* @param {string} text The string being counted.
|
||||||
|
*
|
||||||
|
* @return {string} The manipulated text.
|
||||||
|
*/
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (function (settings, text) {
|
||||||
|
if (settings.HTMLEntityRegExp) {
|
||||||
|
return text.replace(settings.HTMLEntityRegExp, 'a');
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "lodash":
|
||||||
|
/*!*************************!*\
|
||||||
|
!*** external "lodash" ***!
|
||||||
|
\*************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = this["lodash"]; }());
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=wordcount.js.map
|
1
wp-includes/js/dist/wordcount.js.map
vendored
Normal file
1
wp-includes/js/dist/wordcount.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -408,9 +408,10 @@ function wp_default_packages_inline_scripts( &$scripts ) {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'formats' => array(
|
'formats' => array(
|
||||||
'time' => get_option( 'time_format', __( 'g:i a', 'default' ) ),
|
'time' => get_option( 'time_format', __( 'g:i a', 'default' ) ),
|
||||||
'date' => get_option( 'date_format', __( 'F j, Y', 'default' ) ),
|
'date' => get_option( 'date_format', __( 'F j, Y', 'default' ) ),
|
||||||
'datetime' => __( 'F j, Y g:i a', 'default' ),
|
'datetime' => __( 'F j, Y g:i a', 'default' ),
|
||||||
|
'datetimeAbbreviated' => __( 'M j, Y g:i a', 'default' ),
|
||||||
),
|
),
|
||||||
'timezone' => array(
|
'timezone' => array(
|
||||||
'offset' => get_option( 'gmt_offset', 0 ),
|
'offset' => get_option( 'gmt_offset', 0 ),
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.0-alpha-43817';
|
$wp_version = '5.0-alpha-43818';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user