Build Tools: Don't include `.map` files in the build.
These files are fairly large, and while they're useful in development, they're not needed in the final build. Props pento, mcsf. See #45201. Built from https://develop.svn.wordpress.org/branches/5.0@43931 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2c86860c5e
commit
b93a84709d
File diff suppressed because one or more lines are too long
|
@ -95,29 +95,7 @@ this["wp"] = this["wp"] || {}; this["wp"]["a11y"] =
|
|||
/***/ (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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Build the live regions markup.\n *\n * @param {string} ariaLive Optional. Value for the 'aria-live' attribute, default 'polite'.\n *\n * @return {Object} $container The ARIA live region jQuery object.\n */\nvar addContainer = function addContainer(ariaLive) {\n ariaLive = ariaLive || 'polite';\n var container = document.createElement('div');\n container.id = 'a11y-speak-' + ariaLive;\n container.className = 'a11y-speak-region';\n 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;');\n container.setAttribute('aria-live', ariaLive);\n container.setAttribute('aria-relevant', 'additions text');\n container.setAttribute('aria-atomic', 'true');\n document.querySelector('body').appendChild(container);\n return container;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (addContainer);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/a11y/build-module/addContainer.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -129,20 +107,7 @@ var addContainer = function addContainer(ariaLive) {
|
|||
/***/ (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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Clear the a11y-speak-region elements.\n */\nvar clear = function clear() {\n var regions = document.querySelectorAll('.a11y-speak-region');\n\n for (var i = 0; i < regions.length; i++) {\n regions[i].textContent = '';\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (clear);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/a11y/build-module/clear.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -154,36 +119,7 @@ var clear = function clear() {
|
|||
/***/ (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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\nvar previousMessage = '';\n/**\n * Filter the message to be announced to the screenreader.\n *\n * @param {string} message The message to be announced.\n *\n * @return {string} The filtered message.\n */\n\nvar filterMessage = function filterMessage(message) {\n /*\n * Strip HTML tags (if any) from the message string. Ideally, messages should\n * be simple strings, carefully crafted for specific use with A11ySpeak.\n * When re-using already existing strings this will ensure simple HTML to be\n * stripped out and replaced with a space. Browsers will collapse multiple\n * spaces natively.\n */\n message = message.replace(/<[^<>]+>/g, ' ');\n\n if (previousMessage === message) {\n message += \"\\xA0\";\n }\n\n previousMessage = message;\n return message;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (filterMessage);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/a11y/build-module/filterMessage.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -195,61 +131,7 @@ var filterMessage = function filterMessage(message) {
|
|||
/***/ (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;
|
||||
}
|
||||
};
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setup\", function() { return setup; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"speak\", function() { return speak; });\n/* harmony import */ var _addContainer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addContainer */ \"./node_modules/@wordpress/a11y/build-module/addContainer.js\");\n/* harmony import */ var _clear__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clear */ \"./node_modules/@wordpress/a11y/build-module/clear.js\");\n/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/dom-ready */ \"@wordpress/dom-ready\");\n/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _filterMessage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./filterMessage */ \"./node_modules/@wordpress/a11y/build-module/filterMessage.js\");\n\n\n\n\n/**\n * Create the live regions.\n */\n\nvar setup = function setup() {\n var containerPolite = document.getElementById('a11y-speak-polite');\n var containerAssertive = document.getElementById('a11y-speak-assertive');\n\n if (containerPolite === null) {\n containerPolite = Object(_addContainer__WEBPACK_IMPORTED_MODULE_0__[\"default\"])('polite');\n }\n\n if (containerAssertive === null) {\n containerAssertive = Object(_addContainer__WEBPACK_IMPORTED_MODULE_0__[\"default\"])('assertive');\n }\n};\n/**\n * Run setup on domReady.\n */\n\n_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_2___default()(setup);\n/**\n * Update the ARIA live notification area text node.\n *\n * @param {string} message The message to be announced by Assistive Technologies.\n * @param {string} ariaLive Optional. The politeness level for aria-live. Possible values:\n * polite or assertive. Default polite.\n */\n\nvar speak = function speak(message, ariaLive) {\n // Clear previous messages to allow repeated strings being read out.\n Object(_clear__WEBPACK_IMPORTED_MODULE_1__[\"default\"])();\n message = Object(_filterMessage__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(message);\n var containerPolite = document.getElementById('a11y-speak-polite');\n var containerAssertive = document.getElementById('a11y-speak-assertive');\n\n if (containerAssertive && 'assertive' === ariaLive) {\n containerAssertive.textContent = message;\n } else if (containerPolite) {\n containerPolite.textContent = message;\n }\n};\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/a11y/build-module/index.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -260,9 +142,8 @@ var speak = function speak(message, ariaLive) {
|
|||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
(function() { module.exports = this["wp"]["domReady"]; }());
|
||||
eval("(function() { module.exports = this[\"wp\"][\"domReady\"]; }());\n\n//# sourceURL=webpack://wp.%5Bname%5D/external_%7B%22this%22:%5B%22wp%22,%22domReady%22%5D%7D?");
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
//# sourceMappingURL=a11y.js.map
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -95,75 +95,8 @@ this["wp"] = this["wp"] || {}; this["wp"]["blob"] =
|
|||
/***/ (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;
|
||||
}
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createBlobURL\", function() { return createBlobURL; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBlobByURL\", function() { return getBlobByURL; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"revokeBlobURL\", function() { return revokeBlobURL; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBlobURL\", function() { return isBlobURL; });\n/**\n * Browser dependencies\n */\nvar _window$URL = window.URL,\n createObjectURL = _window$URL.createObjectURL,\n revokeObjectURL = _window$URL.revokeObjectURL;\nvar cache = {};\n/**\n * Create a blob URL from a file.\n *\n * @param {File} file The file to create a blob URL for.\n *\n * @return {string} The blob URL.\n */\n\nfunction createBlobURL(file) {\n var url = createObjectURL(file);\n cache[url] = file;\n return url;\n}\n/**\n * Retrieve a file based on a blob URL. The file must have been created by\n * `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return\n * `undefined`.\n *\n * @param {string} url The blob URL.\n *\n * @return {?File} The file for the blob URL.\n */\n\nfunction getBlobByURL(url) {\n return cache[url];\n}\n/**\n * Remove the resource and file cache from memory.\n *\n * @param {string} url The blob URL.\n */\n\nfunction revokeBlobURL(url) {\n if (cache[url]) {\n revokeObjectURL(url);\n }\n\n delete cache[url];\n}\n/**\n * Check whether a url is a blob url.\n *\n * @param {string} url The URL.\n *\n * @return {boolean} Is the url a blob url?\n */\n\nfunction isBlobURL(url) {\n if (!url || !url.indexOf) {\n return false;\n }\n\n return url.indexOf('blob:') === 0;\n}\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/blob/build-module/index.js?");
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
//# sourceMappingURL=blob.js.map
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -95,72 +95,7 @@ this["wp"] = this["wp"] || {}; this["wp"]["deprecated"] =
|
|||
/***/ (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;
|
||||
}
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"logged\", function() { return logged; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return deprecated; });\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/hooks */ \"@wordpress/hooks\");\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__);\n/**\n * WordPress dependencies\n */\n\n/**\n * Object map tracking messages which have been logged, for use in ensuring a\n * message is only logged once.\n *\n * @type {Object}\n */\n\nvar logged = Object.create(null);\n/**\n * Logs a message to notify developers about a deprecated feature.\n *\n * @param {string} feature Name of the deprecated feature.\n * @param {?Object} options Personalisation options\n * @param {?string} options.version Version in which the feature will be removed.\n * @param {?string} options.alternative Feature to use instead\n * @param {?string} options.plugin Plugin name if it's a plugin feature\n * @param {?string} options.link Link to documentation\n * @param {?string} options.hint Additional message to help transition away from the deprecated feature.\n */\n\nfunction deprecated(feature) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var version = options.version,\n alternative = options.alternative,\n plugin = options.plugin,\n link = options.link,\n hint = options.hint;\n var pluginMessage = plugin ? \" from \".concat(plugin) : '';\n var versionMessage = version ? \"\".concat(pluginMessage, \" in \").concat(version) : '';\n var useInsteadMessage = alternative ? \" Please use \".concat(alternative, \" instead.\") : '';\n var linkMessage = link ? \" See: \".concat(link) : '';\n var hintMessage = hint ? \" Note: \".concat(hint) : '';\n var message = \"\".concat(feature, \" is deprecated and will be removed\").concat(versionMessage, \".\").concat(useInsteadMessage).concat(linkMessage).concat(hintMessage); // Skip if already logged.\n\n if (message in logged) {\n return;\n }\n /**\n * Fires whenever a deprecated feature is encountered\n *\n * @param {string} feature Name of the deprecated feature.\n * @param {?Object} options Personalisation options\n * @param {?string} options.version Version in which the feature will be removed.\n * @param {?string} options.alternative Feature to use instead\n * @param {?string} options.plugin Plugin name if it's a plugin feature\n * @param {?string} options.link Link to documentation\n * @param {?string} options.hint Additional message to help transition away from the deprecated feature.\n * @param {?string} message Message sent to console.warn\n */\n\n\n Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__[\"doAction\"])('deprecated', feature, options, message); // eslint-disable-next-line no-console\n\n console.warn(message);\n logged[message] = true;\n}\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/deprecated/build-module/index.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -171,9 +106,8 @@ function deprecated(feature) {
|
|||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
(function() { module.exports = this["wp"]["hooks"]; }());
|
||||
eval("(function() { module.exports = this[\"wp\"][\"hooks\"]; }());\n\n//# sourceURL=webpack://wp.%5Bname%5D/external_%7B%22this%22:%5B%22wp%22,%22hooks%22%5D%7D?");
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ })["default"];
|
||||
//# sourceMappingURL=deprecated.js.map
|
||||
/******/ })["default"];
|
File diff suppressed because one or more lines are too long
|
@ -95,29 +95,8 @@ this["wp"] = this["wp"] || {}; this["wp"]["domReady"] =
|
|||
/***/ (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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\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 */\nvar domReady = function domReady(callback) {\n if (document.readyState === 'complete' || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.\n document.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.\n ) {\n return callback();\n } // DOMContentLoaded has not fired yet, delay callback until then.\n\n\n document.addEventListener('DOMContentLoaded', callback);\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (domReady);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/dom-ready/build-module/index.js?");
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ })["default"];
|
||||
//# sourceMappingURL=dom-ready.js.map
|
||||
/******/ })["default"];
|
|
@ -1 +0,0 @@
|
|||
{"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":""}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -95,111 +95,8 @@ this["wp"] = this["wp"] || {}; this["wp"]["escapeHtml"] =
|
|||
/***/ (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);
|
||||
}
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"escapeAmpersand\", function() { return escapeAmpersand; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"escapeQuotationMark\", function() { return escapeQuotationMark; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"escapeLessThan\", function() { return escapeLessThan; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"escapeAttribute\", function() { return escapeAttribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"escapeHTML\", function() { return escapeHTML; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isValidAttributeName\", function() { return isValidAttributeName; });\n/**\n * Regular expression matching invalid attribute names.\n *\n * \"Attribute names must consist of one or more characters other than controls,\n * U+0020 SPACE, U+0022 (\"), U+0027 ('), U+003E (>), U+002F (/), U+003D (=),\n * and noncharacters.\"\n *\n * @link https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n *\n * @type {RegExp}\n */\nvar REGEXP_INVALID_ATTRIBUTE_NAME = /[\\u007F-\\u009F \"'>/=\"\\uFDD0-\\uFDEF]/;\n/**\n * Returns a string with ampersands escaped. Note that this is an imperfect\n * implementation, where only ampersands which do not appear as a pattern of\n * named, decimal, or hexadecimal character references are escaped. Invalid\n * named references (i.e. ambiguous ampersand) are are still permitted.\n *\n * @link https://w3c.github.io/html/syntax.html#character-references\n * @link https://w3c.github.io/html/syntax.html#ambiguous-ampersand\n * @link https://w3c.github.io/html/syntax.html#named-character-references\n *\n * @param {string} value Original string.\n *\n * @return {string} Escaped string.\n */\n\nfunction escapeAmpersand(value) {\n return value.replace(/&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi, '&');\n}\n/**\n * Returns a string with quotation marks replaced.\n *\n * @param {string} value Original string.\n *\n * @return {string} Escaped string.\n */\n\nfunction escapeQuotationMark(value) {\n return value.replace(/\"/g, '"');\n}\n/**\n * Returns a string with less-than sign replaced.\n *\n * @param {string} value Original string.\n *\n * @return {string} Escaped string.\n */\n\nfunction escapeLessThan(value) {\n return value.replace(/</g, '<');\n}\n/**\n * Returns an escaped attribute value.\n *\n * @link https://w3c.github.io/html/syntax.html#elements-attributes\n *\n * \"[...] the text cannot contain an ambiguous ampersand [...] must not contain\n * any literal U+0022 QUOTATION MARK characters (\")\"\n *\n * @param {string} value Attribute value.\n *\n * @return {string} Escaped attribute value.\n */\n\nfunction escapeAttribute(value) {\n return escapeQuotationMark(escapeAmpersand(value));\n}\n/**\n * Returns an escaped HTML element value.\n *\n * @link https://w3c.github.io/html/syntax.html#writing-html-documents-elements\n *\n * \"the text must not contain the character U+003C LESS-THAN SIGN (<) or an\n * ambiguous ampersand.\"\n *\n * @param {string} value Element value.\n *\n * @return {string} Escaped HTML element value.\n */\n\nfunction escapeHTML(value) {\n return escapeLessThan(escapeAmpersand(value));\n}\n/**\n * Returns true if the given attribute name is valid, or false otherwise.\n *\n * @param {string} name Attribute name to test.\n *\n * @return {boolean} Whether attribute is valid.\n */\n\nfunction isValidAttributeName(name) {\n return !REGEXP_INVALID_ATTRIBUTE_NAME.test(name);\n}\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/escape-html/build-module/index.js?");
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
//# sourceMappingURL=escape-html.js.map
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -95,100 +95,7 @@ this["wp"] = this["wp"] || {}; this["wp"]["hooks"] =
|
|||
/***/ (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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _validateNamespace_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validateNamespace.js */ \"./node_modules/@wordpress/hooks/build-module/validateNamespace.js\");\n/* harmony import */ var _validateHookName_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./validateHookName.js */ \"./node_modules/@wordpress/hooks/build-module/validateHookName.js\");\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ */ \"./node_modules/@wordpress/hooks/build-module/index.js\");\n\n\n\n/**\n * Returns a function which, when invoked, will add a hook.\n *\n * @param {Object} hooks Stored hooks, keyed by hook name.\n *\n * @return {Function} Function that adds a new hook.\n */\n\nfunction createAddHook(hooks) {\n /**\n * Adds the hook to the appropriate hooks container.\n *\n * @param {string} hookName Name of hook to add\n * @param {string} namespace The unique namespace identifying the callback in the form `vendor/plugin/function`.\n * @param {Function} callback Function to call when the hook is run\n * @param {?number} priority Priority of this hook (default=10)\n */\n return function addHook(hookName, namespace, callback) {\n var priority = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 10;\n\n if (!Object(_validateHookName_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(hookName)) {\n return;\n }\n\n if (!Object(_validateNamespace_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(namespace)) {\n return;\n }\n\n if ('function' !== typeof callback) {\n // eslint-disable-next-line no-console\n console.error('The hook callback must be a function.');\n return;\n } // Validate numeric priority\n\n\n if ('number' !== typeof priority) {\n // eslint-disable-next-line no-console\n console.error('If specified, the hook priority must be a number.');\n return;\n }\n\n var handler = {\n callback: callback,\n priority: priority,\n namespace: namespace\n };\n\n if (hooks[hookName]) {\n // Find the correct insert index of the new hook.\n var handlers = hooks[hookName].handlers;\n var i = 0;\n\n while (i < handlers.length) {\n if (handlers[i].priority > priority) {\n break;\n }\n\n i++;\n } // Insert (or append) the new hook.\n\n\n handlers.splice(i, 0, handler); // We may also be currently executing this hook. If the callback\n // we're adding would come after the current callback, there's no\n // problem; otherwise we need to increase the execution index of\n // any other runs by 1 to account for the added element.\n\n (hooks.__current || []).forEach(function (hookInfo) {\n if (hookInfo.name === hookName && hookInfo.currentIndex >= i) {\n hookInfo.currentIndex++;\n }\n });\n } else {\n // This is the first hook of its type.\n hooks[hookName] = {\n handlers: [handler],\n runs: 0\n };\n }\n\n if (hookName !== 'hookAdded') {\n Object(___WEBPACK_IMPORTED_MODULE_2__[\"doAction\"])('hookAdded', hookName, namespace, callback, priority);\n }\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (createAddHook);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/hooks/build-module/createAddHook.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -200,35 +107,7 @@ function createAddHook(hooks) {
|
|||
/***/ (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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Returns a function which, when invoked, will return the name of the\n * currently running hook, or `null` if no hook of the given type is currently\n * running.\n *\n * @param {Object} hooks Stored hooks, keyed by hook name.\n *\n * @return {Function} Function that returns the current hook.\n */\nfunction createCurrentHook(hooks) {\n /**\n * Returns the name of the currently running hook, or `null` if no hook of\n * the given type is currently running.\n *\n * @return {?string} The name of the currently running hook, or\n * `null` if no hook is currently running.\n */\n return function currentHook() {\n if (!hooks.__current || !hooks.__current.length) {\n return null;\n }\n\n return hooks.__current[hooks.__current.length - 1].name;\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (createCurrentHook);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/hooks/build-module/createCurrentHook.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -240,37 +119,7 @@ function createCurrentHook(hooks) {
|
|||
/***/ (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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _validateHookName_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validateHookName.js */ \"./node_modules/@wordpress/hooks/build-module/validateHookName.js\");\n\n/**\n * Returns a function which, when invoked, will return the number of times a\n * hook has been called.\n *\n * @param {Object} hooks Stored hooks, keyed by hook name.\n *\n * @return {Function} Function that returns a hook's call count.\n */\n\nfunction createDidHook(hooks) {\n /**\n * Returns the number of times an action has been fired.\n *\n * @param {string} hookName The hook name to check.\n *\n * @return {number} The number of times the hook has run.\n */\n return function didHook(hookName) {\n if (!Object(_validateHookName_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(hookName)) {\n return;\n }\n\n return hooks[hookName] && hooks[hookName].runs ? hooks[hookName].runs : 0;\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (createDidHook);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/hooks/build-module/createDidHook.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -282,38 +131,7 @@ function createDidHook(hooks) {
|
|||
/***/ (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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Returns a function which, when invoked, will return whether a hook is\n * currently being executed.\n *\n * @param {Object} hooks Stored hooks, keyed by hook name.\n *\n * @return {Function} Function that returns whether a hook is currently\n * being executed.\n */\nfunction createDoingHook(hooks) {\n /**\n * Returns whether a hook is currently being executed.\n *\n * @param {?string} hookName The name of the hook to check for. If\n * omitted, will check for any hook being executed.\n *\n * @return {boolean} Whether the hook is being executed.\n */\n return function doingHook(hookName) {\n // If the hookName was not passed, check for any current hook.\n if ('undefined' === typeof hookName) {\n return 'undefined' !== typeof hooks.__current[0];\n } // Return the __current hook.\n\n\n return hooks.__current[0] ? hookName === hooks.__current[0].name : false;\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (createDoingHook);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/hooks/build-module/createDoingHook.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -325,31 +143,7 @@ function createDoingHook(hooks) {
|
|||
/***/ (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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Returns a function which, when invoked, will return whether any handlers are\n * attached to a particular hook.\n *\n * @param {Object} hooks Stored hooks, keyed by hook name.\n *\n * @return {Function} Function that returns whether any handlers are\n * attached to a particular hook.\n */\nfunction createHasHook(hooks) {\n /**\n * Returns how many handlers are attached for the given hook.\n *\n * @param {string} hookName The name of the hook to check for.\n *\n * @return {boolean} Whether there are handlers that are attached to the given hook.\n */\n return function hasHook(hookName) {\n return hookName in hooks;\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (createHasHook);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/hooks/build-module/createHasHook.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -361,56 +155,7 @@ function createHasHook(hooks) {
|
|||
/***/ (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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _createAddHook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createAddHook */ \"./node_modules/@wordpress/hooks/build-module/createAddHook.js\");\n/* harmony import */ var _createRemoveHook__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./createRemoveHook */ \"./node_modules/@wordpress/hooks/build-module/createRemoveHook.js\");\n/* harmony import */ var _createHasHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./createHasHook */ \"./node_modules/@wordpress/hooks/build-module/createHasHook.js\");\n/* harmony import */ var _createRunHook__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./createRunHook */ \"./node_modules/@wordpress/hooks/build-module/createRunHook.js\");\n/* harmony import */ var _createCurrentHook__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./createCurrentHook */ \"./node_modules/@wordpress/hooks/build-module/createCurrentHook.js\");\n/* harmony import */ var _createDoingHook__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./createDoingHook */ \"./node_modules/@wordpress/hooks/build-module/createDoingHook.js\");\n/* harmony import */ var _createDidHook__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./createDidHook */ \"./node_modules/@wordpress/hooks/build-module/createDidHook.js\");\n\n\n\n\n\n\n\n/**\n * Returns an instance of the hooks object.\n *\n * @return {Object} Object that contains all hooks.\n */\n\nfunction createHooks() {\n var actions = Object.create(null);\n var filters = Object.create(null);\n actions.__current = [];\n filters.__current = [];\n return {\n addAction: Object(_createAddHook__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(actions),\n addFilter: Object(_createAddHook__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(filters),\n removeAction: Object(_createRemoveHook__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(actions),\n removeFilter: Object(_createRemoveHook__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(filters),\n hasAction: Object(_createHasHook__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(actions),\n hasFilter: Object(_createHasHook__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(filters),\n removeAllActions: Object(_createRemoveHook__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(actions, true),\n removeAllFilters: Object(_createRemoveHook__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(filters, true),\n doAction: Object(_createRunHook__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(actions),\n applyFilters: Object(_createRunHook__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(filters, true),\n currentAction: Object(_createCurrentHook__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(actions),\n currentFilter: Object(_createCurrentHook__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(filters),\n doingAction: Object(_createDoingHook__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(actions),\n doingFilter: Object(_createDoingHook__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(filters),\n didAction: Object(_createDidHook__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(actions),\n didFilter: Object(_createDidHook__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(filters),\n actions: actions,\n filters: filters\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (createHooks);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/hooks/build-module/createHooks.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -422,91 +167,7 @@ function createHooks() {
|
|||
/***/ (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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _validateNamespace_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validateNamespace.js */ \"./node_modules/@wordpress/hooks/build-module/validateNamespace.js\");\n/* harmony import */ var _validateHookName_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./validateHookName.js */ \"./node_modules/@wordpress/hooks/build-module/validateHookName.js\");\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ */ \"./node_modules/@wordpress/hooks/build-module/index.js\");\n\n\n\n/**\n * Returns a function which, when invoked, will remove a specified hook or all\n * hooks by the given name.\n *\n * @param {Object} hooks Stored hooks, keyed by hook name.\n * @param {boolean} removeAll Whether to remove all callbacks for a hookName, without regard to namespace. Used to create `removeAll*` functions.\n *\n * @return {Function} Function that removes hooks.\n */\n\nfunction createRemoveHook(hooks, removeAll) {\n /**\n * Removes the specified callback (or all callbacks) from the hook with a\n * given hookName and namespace.\n *\n * @param {string} hookName The name of the hook to modify.\n * @param {string} namespace The unique namespace identifying the callback in the form `vendor/plugin/function`.\n *\n * @return {number} The number of callbacks removed.\n */\n return function removeHook(hookName, namespace) {\n if (!Object(_validateHookName_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(hookName)) {\n return;\n }\n\n if (!removeAll && !Object(_validateNamespace_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(namespace)) {\n return;\n } // Bail if no hooks exist by this name\n\n\n if (!hooks[hookName]) {\n return 0;\n }\n\n var handlersRemoved = 0;\n\n if (removeAll) {\n handlersRemoved = hooks[hookName].handlers.length;\n hooks[hookName] = {\n runs: hooks[hookName].runs,\n handlers: []\n };\n } else {\n // Try to find the specified callback to remove.\n var handlers = hooks[hookName].handlers;\n\n var _loop = function _loop(i) {\n if (handlers[i].namespace === namespace) {\n handlers.splice(i, 1);\n handlersRemoved++; // This callback may also be part of a hook that is\n // currently executing. If the callback we're removing\n // comes after the current callback, there's no problem;\n // otherwise we need to decrease the execution index of any\n // other runs by 1 to account for the removed element.\n\n (hooks.__current || []).forEach(function (hookInfo) {\n if (hookInfo.name === hookName && hookInfo.currentIndex >= i) {\n hookInfo.currentIndex--;\n }\n });\n }\n };\n\n for (var i = handlers.length - 1; i >= 0; i--) {\n _loop(i);\n }\n }\n\n if (hookName !== 'hookRemoved') {\n Object(___WEBPACK_IMPORTED_MODULE_2__[\"doAction\"])('hookRemoved', hookName, namespace);\n }\n\n return handlersRemoved;\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (createRemoveHook);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/hooks/build-module/createRemoveHook.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -518,74 +179,7 @@ function createRemoveHook(hooks, removeAll) {
|
|||
/***/ (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);
|
||||
|
||||
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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Returns a function which, when invoked, will execute all callbacks\n * registered to a hook of the specified type, optionally returning the final\n * value of the call chain.\n *\n * @param {Object} hooks Stored hooks, keyed by hook name.\n * @param {?boolean} returnFirstArg Whether each hook callback is expected to\n * return its first argument.\n *\n * @return {Function} Function that runs hook callbacks.\n */\nfunction createRunHook(hooks, returnFirstArg) {\n /**\n * Runs all callbacks for the specified hook.\n *\n * @param {string} hookName The name of the hook to run.\n * @param {...*} args Arguments to pass to the hook callbacks.\n *\n * @return {*} Return value of runner, if applicable.\n */\n return function runHooks(hookName) {\n if (!hooks[hookName]) {\n hooks[hookName] = {\n handlers: [],\n runs: 0\n };\n }\n\n hooks[hookName].runs++;\n var handlers = hooks[hookName].handlers;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n if (!handlers || !handlers.length) {\n return returnFirstArg ? args[0] : undefined;\n }\n\n var hookInfo = {\n name: hookName,\n currentIndex: 0\n };\n\n hooks.__current.push(hookInfo);\n\n while (hookInfo.currentIndex < handlers.length) {\n var handler = handlers[hookInfo.currentIndex];\n var result = handler.callback.apply(null, args);\n\n if (returnFirstArg) {\n args[0] = result;\n }\n\n hookInfo.currentIndex++;\n }\n\n hooks.__current.pop();\n\n if (returnFirstArg) {\n return args[0];\n }\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (createRunHook);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/hooks/build-module/createRunHook.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -597,52 +191,7 @@ function createRunHook(hooks, returnFirstArg) {
|
|||
/***/ (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;
|
||||
|
||||
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addAction\", function() { return addAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addFilter\", function() { return addFilter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"removeAction\", function() { return removeAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"removeFilter\", function() { return removeFilter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hasAction\", function() { return hasAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hasFilter\", function() { return hasFilter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"removeAllActions\", function() { return removeAllActions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"removeAllFilters\", function() { return removeAllFilters; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"doAction\", function() { return doAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"applyFilters\", function() { return applyFilters; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"currentAction\", function() { return currentAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"currentFilter\", function() { return currentFilter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"doingAction\", function() { return doingAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"doingFilter\", function() { return doingFilter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"didAction\", function() { return didAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"didFilter\", function() { return didFilter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"actions\", function() { return actions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filters\", function() { return filters; });\n/* harmony import */ var _createHooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createHooks */ \"./node_modules/@wordpress/hooks/build-module/createHooks.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"createHooks\", function() { return _createHooks__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n\n\nvar _createHooks = Object(_createHooks__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(),\n addAction = _createHooks.addAction,\n addFilter = _createHooks.addFilter,\n removeAction = _createHooks.removeAction,\n removeFilter = _createHooks.removeFilter,\n hasAction = _createHooks.hasAction,\n hasFilter = _createHooks.hasFilter,\n removeAllActions = _createHooks.removeAllActions,\n removeAllFilters = _createHooks.removeAllFilters,\n doAction = _createHooks.doAction,\n applyFilters = _createHooks.applyFilters,\n currentAction = _createHooks.currentAction,\n currentFilter = _createHooks.currentFilter,\n doingAction = _createHooks.doingAction,\n doingFilter = _createHooks.doingFilter,\n didAction = _createHooks.didAction,\n didFilter = _createHooks.didFilter,\n actions = _createHooks.actions,\n filters = _createHooks.filters;\n\n\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/hooks/build-module/index.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -654,40 +203,7 @@ var _createHooks = Object(_createHooks__WEBPACK_IMPORTED_MODULE_0__["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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Validate a hookName string.\n *\n * @param {string} hookName The hook name to validate. Should be a non empty string containing\n * only numbers, letters, dashes, periods and underscores. Also,\n * the hook name cannot begin with `__`.\n *\n * @return {boolean} Whether the hook name is valid.\n */\nfunction validateHookName(hookName) {\n if ('string' !== typeof hookName || '' === hookName) {\n // eslint-disable-next-line no-console\n console.error('The hook name must be a non-empty string.');\n return false;\n }\n\n if (/^__/.test(hookName)) {\n // eslint-disable-next-line no-console\n console.error('The hook name cannot begin with `__`.');\n return false;\n }\n\n if (!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(hookName)) {\n // eslint-disable-next-line no-console\n console.error('The hook name can only contain numbers, letters, dashes, periods and underscores.');\n return false;\n }\n\n return true;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (validateHookName);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/hooks/build-module/validateHookName.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -699,35 +215,8 @@ function validateHookName(hookName) {
|
|||
/***/ (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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Validate a namespace string.\n *\n * @param {string} namespace The namespace to validate - should take the form\n * `vendor/plugin/function`.\n *\n * @return {boolean} Whether the namespace is valid.\n */\nfunction validateNamespace(namespace) {\n if ('string' !== typeof namespace || '' === namespace) {\n // eslint-disable-next-line no-console\n console.error('The namespace must be a non-empty string.');\n return false;\n }\n\n if (!/^[a-zA-Z][a-zA-Z0-9_.\\-\\/]*$/.test(namespace)) {\n // eslint-disable-next-line no-console\n console.error('The namespace can only contain numbers, letters, dashes, periods, underscores and slashes.');\n return false;\n }\n\n return true;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (validateNamespace);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/hooks/build-module/validateNamespace.js?");
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
//# sourceMappingURL=hooks.js.map
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
|
@ -95,33 +95,8 @@ this["wp"] = this["wp"] || {}; this["wp"]["htmlEntities"] =
|
|||
/***/ (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;
|
||||
}
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeEntities\", function() { return decodeEntities; });\nvar _decodeTextArea;\n\nfunction decodeEntities(html) {\n // not a string, or no entities to decode\n if ('string' !== typeof html || -1 === html.indexOf('&')) {\n return html;\n } // create a textarea for decoding entities, that we can reuse\n\n\n if (undefined === _decodeTextArea) {\n if (document.implementation && document.implementation.createHTMLDocument) {\n _decodeTextArea = document.implementation.createHTMLDocument('').createElement('textarea');\n } else {\n _decodeTextArea = document.createElement('textarea');\n }\n }\n\n _decodeTextArea.innerHTML = html;\n var decoded = _decodeTextArea.textContent;\n _decodeTextArea.innerHTML = '';\n return decoded;\n}\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/html-entities/build-module/index.js?");
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
//# sourceMappingURL=html-entities.js.map
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -95,38 +95,7 @@ this["wp"] = this["wp"] || {}; this["wp"]["isShallowEqual"] =
|
|||
/***/ (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;
|
||||
|
||||
eval("\n\n/**\n * Returns true if the two arrays are shallow equal, or false otherwise.\n *\n * @param {Array} a First array to compare.\n * @param {Array} b Second array to compare.\n *\n * @return {boolean} Whether the two arrays are shallow equal.\n */\nfunction isShallowEqualArrays( a, b ) {\n\tvar i;\n\n\tif ( a === b ) {\n\t\treturn true;\n\t}\n\n\tif ( a.length !== b.length ) {\n\t\treturn false;\n\t}\n\n\tfor ( i = 0; i < a.length; i++ ) {\n\t\tif ( a[ i ] !== b[ i ] ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nmodule.exports = isShallowEqualArrays;\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/is-shallow-equal/arrays.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -138,39 +107,7 @@ module.exports = isShallowEqualArrays;
|
|||
/***/ (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;
|
||||
|
||||
eval("\n\n/**\n * Internal dependencies;\n */\nvar isShallowEqualObjects = __webpack_require__( /*! ./objects */ \"./node_modules/@wordpress/is-shallow-equal/objects.js\" );\nvar isShallowEqualArrays = __webpack_require__( /*! ./arrays */ \"./node_modules/@wordpress/is-shallow-equal/arrays.js\" );\n\nvar isArray = Array.isArray;\n\n/**\n * Returns true if the two arrays or objects are shallow equal, or false\n * otherwise.\n *\n * @param {(Array|Object)} a First object or array to compare.\n * @param {(Array|Object)} b Second object or array to compare.\n *\n * @return {boolean} Whether the two values are shallow equal.\n */\nfunction isShallowEqual( a, b ) {\n\tif ( a && b ) {\n\t\tif ( a.constructor === Object && b.constructor === Object ) {\n\t\t\treturn isShallowEqualObjects( a, b );\n\t\t} else if ( isArray( a ) && isArray( b ) ) {\n\t\t\treturn isShallowEqualArrays( a, b );\n\t\t}\n\t}\n\n\treturn a === b;\n}\n\nmodule.exports = isShallowEqual;\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/is-shallow-equal/index.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -182,50 +119,8 @@ module.exports = isShallowEqual;
|
|||
/***/ (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;
|
||||
|
||||
eval("\n\nvar keys = Object.keys;\n\n/**\n * Returns true if the two objects are shallow equal, or false otherwise.\n *\n * @param {Object} a First object to compare.\n * @param {Object} b Second object to compare.\n *\n * @return {boolean} Whether the two objects are shallow equal.\n */\nfunction isShallowEqualObjects( a, b ) {\n\tvar aKeys, bKeys, i, key;\n\n\tif ( a === b ) {\n\t\treturn true;\n\t}\n\n\taKeys = keys( a );\n\tbKeys = keys( b );\n\n\tif ( aKeys.length !== bKeys.length ) {\n\t\treturn false;\n\t}\n\n\ti = 0;\n\n\twhile ( i < aKeys.length ) {\n\t\tkey = aKeys[ i ];\n\t\tif ( a[ key ] !== b[ key ] ) {\n\t\t\treturn false;\n\t\t}\n\n\t\ti++;\n\t}\n\n\treturn true;\n}\n\nmodule.exports = isShallowEqualObjects;\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/is-shallow-equal/objects.js?");
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
//# sourceMappingURL=is-shallow-equal.js.map
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -95,23 +95,7 @@ this["wp"] = this["wp"] || {}; this["wp"]["reduxRoutine"] =
|
|||
/***/ (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);
|
||||
}
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _typeof; });\nfunction _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); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/typeof.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -123,23 +107,7 @@ function _typeof(obj) {
|
|||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return castError; });
|
||||
/**
|
||||
* Casts value as an error if it's not one.
|
||||
*
|
||||
* @param {*} error The value to cast.
|
||||
*
|
||||
* @return {Error} The cast error.
|
||||
*/
|
||||
function castError(error) {
|
||||
if (!(error instanceof Error)) {
|
||||
error = new Error(error);
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return castError; });\n/**\n * Casts value as an error if it's not one.\n *\n * @param {*} error The value to cast.\n *\n * @return {Error} The cast error.\n */\nfunction castError(error) {\n if (!(error instanceof Error)) {\n error = new Error(error);\n }\n\n return error;\n}\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/redux-routine/build-module/cast-error.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -151,44 +119,7 @@ function castError(error) {
|
|||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createMiddleware; });
|
||||
/* harmony import */ var _is_generator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-generator */ "./node_modules/@wordpress/redux-routine/build-module/is-generator.js");
|
||||
/* harmony import */ var _runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./runtime */ "./node_modules/@wordpress/redux-routine/build-module/runtime.js");
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Creates a Redux middleware, given an object of controls where each key is an
|
||||
* action type for which to act upon, the value a function which returns either
|
||||
* a promise which is to resolve when evaluation of the action should continue,
|
||||
* or a value. The value or resolved promise value is assigned on the return
|
||||
* value of the yield assignment. If the control handler returns undefined, the
|
||||
* execution is not continued.
|
||||
*
|
||||
* @param {Object} controls Object of control handlers.
|
||||
*
|
||||
* @return {Function} Co-routine runtime
|
||||
*/
|
||||
|
||||
function createMiddleware() {
|
||||
var controls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
return function (store) {
|
||||
var runtime = Object(_runtime__WEBPACK_IMPORTED_MODULE_1__["default"])(controls, store.dispatch);
|
||||
return function (next) {
|
||||
return function (action) {
|
||||
if (!Object(_is_generator__WEBPACK_IMPORTED_MODULE_0__["default"])(action)) {
|
||||
return next(action);
|
||||
}
|
||||
|
||||
return runtime(action);
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return createMiddleware; });\n/* harmony import */ var _is_generator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-generator */ \"./node_modules/@wordpress/redux-routine/build-module/is-generator.js\");\n/* harmony import */ var _runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./runtime */ \"./node_modules/@wordpress/redux-routine/build-module/runtime.js\");\n/**\n * Internal dependencies\n */\n\n\n/**\n * Creates a Redux middleware, given an object of controls where each key is an\n * action type for which to act upon, the value a function which returns either\n * a promise which is to resolve when evaluation of the action should continue,\n * or a value. The value or resolved promise value is assigned on the return\n * value of the yield assignment. If the control handler returns undefined, the\n * execution is not continued.\n *\n * @param {Object} controls Object of control handlers.\n *\n * @return {Function} Co-routine runtime\n */\n\nfunction createMiddleware() {\n var controls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return function (store) {\n var runtime = Object(_runtime__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(controls, store.dispatch);\n return function (next) {\n return function (action) {\n if (!Object(_is_generator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(action)) {\n return next(action);\n }\n\n return runtime(action);\n };\n };\n };\n}\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/redux-routine/build-module/index.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -200,40 +131,7 @@ function createMiddleware() {
|
|||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAction", function() { return isAction; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isActionOfType", function() { return isActionOfType; });
|
||||
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash");
|
||||
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/**
|
||||
* External imports
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns true if the given object quacks like an action.
|
||||
*
|
||||
* @param {*} object Object to test
|
||||
*
|
||||
* @return {boolean} Whether object is an action.
|
||||
*/
|
||||
|
||||
function isAction(object) {
|
||||
return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])(object) && Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isString"])(object.type);
|
||||
}
|
||||
/**
|
||||
* Returns true if the given object quacks like an action and has a specific
|
||||
* action type
|
||||
*
|
||||
* @param {*} object Object to test
|
||||
* @param {string} expectedType The expected type for the action.
|
||||
*
|
||||
* @return {boolean} Whether object is an action and is of specific type.
|
||||
*/
|
||||
|
||||
function isActionOfType(object, expectedType) {
|
||||
return isAction(object) && object.type === expectedType;
|
||||
}
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isActionOfType\", function() { return isActionOfType; });\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);\n/**\n * External imports\n */\n\n/**\n * Returns true if the given object quacks like an action.\n *\n * @param {*} object Object to test\n *\n * @return {boolean} Whether object is an action.\n */\n\nfunction isAction(object) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"isPlainObject\"])(object) && Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(object.type);\n}\n/**\n * Returns true if the given object quacks like an action and has a specific\n * action type\n *\n * @param {*} object Object to test\n * @param {string} expectedType The expected type for the action.\n *\n * @return {boolean} Whether object is an action and is of specific type.\n */\n\nfunction isActionOfType(object, expectedType) {\n return isAction(object) && object.type === expectedType;\n}\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/redux-routine/build-module/is-action.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -245,21 +143,7 @@ function isActionOfType(object, expectedType) {
|
|||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isGenerator; });
|
||||
/**
|
||||
* Returns true if the given object is a generator, or false otherwise.
|
||||
*
|
||||
* @link https://www.ecma-international.org/ecma-262/6.0/#sec-generator-objects
|
||||
*
|
||||
* @param {*} object Object to test.
|
||||
*
|
||||
* @return {boolean} Whether object is a generator.
|
||||
*/
|
||||
function isGenerator(object) {
|
||||
return !!object && object[Symbol.toStringTag] === 'Generator';
|
||||
}
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return isGenerator; });\n/**\n * Returns true if the given object is a generator, or false otherwise.\n *\n * @link https://www.ecma-international.org/ecma-262/6.0/#sec-generator-objects\n *\n * @param {*} object Object to test.\n *\n * @return {boolean} Whether object is a generator.\n */\nfunction isGenerator(object) {\n return !!object && object[Symbol.toStringTag] === 'Generator';\n}\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/redux-routine/build-module/is-generator.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -271,89 +155,7 @@ function isGenerator(object) {
|
|||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createRuntime; });
|
||||
/* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
|
||||
/* harmony import */ var rungen__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rungen */ "./node_modules/rungen/dist/index.js");
|
||||
/* harmony import */ var rungen__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(rungen__WEBPACK_IMPORTED_MODULE_1__);
|
||||
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash");
|
||||
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
|
||||
/* harmony import */ var is_promise__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! is-promise */ "./node_modules/is-promise/index.js");
|
||||
/* harmony import */ var is_promise__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(is_promise__WEBPACK_IMPORTED_MODULE_3__);
|
||||
/* harmony import */ var _cast_error__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cast-error */ "./node_modules/@wordpress/redux-routine/build-module/cast-error.js");
|
||||
/* harmony import */ var _is_action__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./is-action */ "./node_modules/@wordpress/redux-routine/build-module/is-action.js");
|
||||
|
||||
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a co-routine runtime.
|
||||
*
|
||||
* @param {Object} controls Object of control handlers.
|
||||
* @param {function} dispatch Unhandled action dispatch.
|
||||
*
|
||||
* @return {function} co-routine runtime
|
||||
*/
|
||||
|
||||
function createRuntime() {
|
||||
var controls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
var dispatch = arguments.length > 1 ? arguments[1] : undefined;
|
||||
var rungenControls = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["map"])(controls, function (control, actionType) {
|
||||
return function (value, next, iterate, yieldNext, yieldError) {
|
||||
if (!Object(_is_action__WEBPACK_IMPORTED_MODULE_5__["isActionOfType"])(value, actionType)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var routine = control(value);
|
||||
|
||||
if (is_promise__WEBPACK_IMPORTED_MODULE_3___default()(routine)) {
|
||||
// Async control routine awaits resolution.
|
||||
routine.then(yieldNext, function (error) {
|
||||
return yieldError(Object(_cast_error__WEBPACK_IMPORTED_MODULE_4__["default"])(error));
|
||||
});
|
||||
} else {
|
||||
next(routine);
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
});
|
||||
|
||||
var unhandledActionControl = function unhandledActionControl(value, next) {
|
||||
if (!Object(_is_action__WEBPACK_IMPORTED_MODULE_5__["isAction"])(value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
dispatch(value);
|
||||
next();
|
||||
return true;
|
||||
};
|
||||
|
||||
rungenControls.push(unhandledActionControl);
|
||||
var rungenRuntime = Object(rungen__WEBPACK_IMPORTED_MODULE_1__["create"])(rungenControls);
|
||||
return function (action) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
return rungenRuntime(action, function (result) {
|
||||
if (Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(result) === 'object' && Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isString"])(result.type)) {
|
||||
dispatch(result);
|
||||
}
|
||||
|
||||
resolve(result);
|
||||
}, reject);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return createRuntime; });\n/* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ \"./node_modules/@babel/runtime/helpers/esm/typeof.js\");\n/* harmony import */ var rungen__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rungen */ \"./node_modules/rungen/dist/index.js\");\n/* harmony import */ var rungen__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(rungen__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var is_promise__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! is-promise */ \"./node_modules/is-promise/index.js\");\n/* harmony import */ var is_promise__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(is_promise__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _cast_error__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cast-error */ \"./node_modules/@wordpress/redux-routine/build-module/cast-error.js\");\n/* harmony import */ var _is_action__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./is-action */ \"./node_modules/@wordpress/redux-routine/build-module/is-action.js\");\n\n\n/**\n * External dependencies\n */\n\n\n\n/**\n * Internal dependencies\n */\n\n\n\n/**\n * Create a co-routine runtime.\n *\n * @param {Object} controls Object of control handlers.\n * @param {function} dispatch Unhandled action dispatch.\n *\n * @return {function} co-routine runtime\n */\n\nfunction createRuntime() {\n var controls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var dispatch = arguments.length > 1 ? arguments[1] : undefined;\n var rungenControls = Object(lodash__WEBPACK_IMPORTED_MODULE_2__[\"map\"])(controls, function (control, actionType) {\n return function (value, next, iterate, yieldNext, yieldError) {\n if (!Object(_is_action__WEBPACK_IMPORTED_MODULE_5__[\"isActionOfType\"])(value, actionType)) {\n return false;\n }\n\n var routine = control(value);\n\n if (is_promise__WEBPACK_IMPORTED_MODULE_3___default()(routine)) {\n // Async control routine awaits resolution.\n routine.then(yieldNext, function (error) {\n return yieldError(Object(_cast_error__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(error));\n });\n } else {\n next(routine);\n }\n\n return true;\n };\n });\n\n var unhandledActionControl = function unhandledActionControl(value, next) {\n if (!Object(_is_action__WEBPACK_IMPORTED_MODULE_5__[\"isAction\"])(value)) {\n return false;\n }\n\n dispatch(value);\n next();\n return true;\n };\n\n rungenControls.push(unhandledActionControl);\n var rungenRuntime = Object(rungen__WEBPACK_IMPORTED_MODULE_1__[\"create\"])(rungenControls);\n return function (action) {\n return new Promise(function (resolve, reject) {\n return rungenRuntime(action, function (result) {\n if (Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(result) === 'object' && Object(lodash__WEBPACK_IMPORTED_MODULE_2__[\"isString\"])(result.type)) {\n dispatch(result);\n }\n\n resolve(result);\n }, reject);\n });\n };\n}\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/redux-routine/build-module/runtime.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -364,12 +166,7 @@ function createRuntime() {
|
|||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = isPromise;
|
||||
|
||||
function isPromise(obj) {
|
||||
return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
|
||||
}
|
||||
|
||||
eval("module.exports = isPromise;\n\nfunction isPromise(obj) {\n return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';\n}\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/is-promise/index.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -381,121 +178,7 @@ function isPromise(obj) {
|
|||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.race = exports.join = exports.fork = exports.promise = undefined;
|
||||
|
||||
var _is = __webpack_require__(/*! ../utils/is */ "./node_modules/rungen/dist/utils/is.js");
|
||||
|
||||
var _is2 = _interopRequireDefault(_is);
|
||||
|
||||
var _helpers = __webpack_require__(/*! ../utils/helpers */ "./node_modules/rungen/dist/utils/helpers.js");
|
||||
|
||||
var _dispatcher = __webpack_require__(/*! ../utils/dispatcher */ "./node_modules/rungen/dist/utils/dispatcher.js");
|
||||
|
||||
var _dispatcher2 = _interopRequireDefault(_dispatcher);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var promise = exports.promise = function promise(value, next, rungen, yieldNext, raiseNext) {
|
||||
if (!_is2.default.promise(value)) return false;
|
||||
value.then(next, raiseNext);
|
||||
return true;
|
||||
};
|
||||
|
||||
var forkedTasks = new Map();
|
||||
var fork = exports.fork = function fork(value, next, rungen) {
|
||||
if (!_is2.default.fork(value)) return false;
|
||||
var task = Symbol('fork');
|
||||
var dispatcher = (0, _dispatcher2.default)();
|
||||
forkedTasks.set(task, dispatcher);
|
||||
rungen(value.iterator.apply(null, value.args), function (result) {
|
||||
return dispatcher.dispatch(result);
|
||||
}, function (err) {
|
||||
return dispatcher.dispatch((0, _helpers.error)(err));
|
||||
});
|
||||
var unsubscribe = dispatcher.subscribe(function () {
|
||||
unsubscribe();
|
||||
forkedTasks.delete(task);
|
||||
});
|
||||
next(task);
|
||||
return true;
|
||||
};
|
||||
|
||||
var join = exports.join = function join(value, next, rungen, yieldNext, raiseNext) {
|
||||
if (!_is2.default.join(value)) return false;
|
||||
var dispatcher = forkedTasks.get(value.task);
|
||||
if (!dispatcher) {
|
||||
raiseNext('join error : task not found');
|
||||
} else {
|
||||
(function () {
|
||||
var unsubscribe = dispatcher.subscribe(function (result) {
|
||||
unsubscribe();
|
||||
next(result);
|
||||
});
|
||||
})();
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
var race = exports.race = function race(value, next, rungen, yieldNext, raiseNext) {
|
||||
if (!_is2.default.race(value)) return false;
|
||||
var finished = false;
|
||||
var success = function success(result, k, v) {
|
||||
if (finished) return;
|
||||
finished = true;
|
||||
result[k] = v;
|
||||
next(result);
|
||||
};
|
||||
|
||||
var fail = function fail(err) {
|
||||
if (finished) return;
|
||||
raiseNext(err);
|
||||
};
|
||||
if (_is2.default.array(value.competitors)) {
|
||||
(function () {
|
||||
var result = value.competitors.map(function () {
|
||||
return false;
|
||||
});
|
||||
value.competitors.forEach(function (competitor, index) {
|
||||
rungen(competitor, function (output) {
|
||||
return success(result, index, output);
|
||||
}, fail);
|
||||
});
|
||||
})();
|
||||
} else {
|
||||
(function () {
|
||||
var result = Object.keys(value.competitors).reduce(function (p, c) {
|
||||
p[c] = false;
|
||||
return p;
|
||||
}, {});
|
||||
Object.keys(value.competitors).forEach(function (index) {
|
||||
rungen(value.competitors[index], function (output) {
|
||||
return success(result, index, output);
|
||||
}, fail);
|
||||
});
|
||||
})();
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
var subscribe = function subscribe(value, next) {
|
||||
if (!_is2.default.subscribe(value)) return false;
|
||||
if (!_is2.default.channel(value.channel)) {
|
||||
throw new Error('the first argument of "subscribe" must be a valid channel');
|
||||
}
|
||||
var unsubscribe = value.channel.subscribe(function (ret) {
|
||||
unsubscribe && unsubscribe();
|
||||
next(ret);
|
||||
});
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
exports.default = [promise, fork, join, race, subscribe];
|
||||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.race = exports.join = exports.fork = exports.promise = undefined;\n\nvar _is = __webpack_require__(/*! ../utils/is */ \"./node_modules/rungen/dist/utils/is.js\");\n\nvar _is2 = _interopRequireDefault(_is);\n\nvar _helpers = __webpack_require__(/*! ../utils/helpers */ \"./node_modules/rungen/dist/utils/helpers.js\");\n\nvar _dispatcher = __webpack_require__(/*! ../utils/dispatcher */ \"./node_modules/rungen/dist/utils/dispatcher.js\");\n\nvar _dispatcher2 = _interopRequireDefault(_dispatcher);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar promise = exports.promise = function promise(value, next, rungen, yieldNext, raiseNext) {\n if (!_is2.default.promise(value)) return false;\n value.then(next, raiseNext);\n return true;\n};\n\nvar forkedTasks = new Map();\nvar fork = exports.fork = function fork(value, next, rungen) {\n if (!_is2.default.fork(value)) return false;\n var task = Symbol('fork');\n var dispatcher = (0, _dispatcher2.default)();\n forkedTasks.set(task, dispatcher);\n rungen(value.iterator.apply(null, value.args), function (result) {\n return dispatcher.dispatch(result);\n }, function (err) {\n return dispatcher.dispatch((0, _helpers.error)(err));\n });\n var unsubscribe = dispatcher.subscribe(function () {\n unsubscribe();\n forkedTasks.delete(task);\n });\n next(task);\n return true;\n};\n\nvar join = exports.join = function join(value, next, rungen, yieldNext, raiseNext) {\n if (!_is2.default.join(value)) return false;\n var dispatcher = forkedTasks.get(value.task);\n if (!dispatcher) {\n raiseNext('join error : task not found');\n } else {\n (function () {\n var unsubscribe = dispatcher.subscribe(function (result) {\n unsubscribe();\n next(result);\n });\n })();\n }\n return true;\n};\n\nvar race = exports.race = function race(value, next, rungen, yieldNext, raiseNext) {\n if (!_is2.default.race(value)) return false;\n var finished = false;\n var success = function success(result, k, v) {\n if (finished) return;\n finished = true;\n result[k] = v;\n next(result);\n };\n\n var fail = function fail(err) {\n if (finished) return;\n raiseNext(err);\n };\n if (_is2.default.array(value.competitors)) {\n (function () {\n var result = value.competitors.map(function () {\n return false;\n });\n value.competitors.forEach(function (competitor, index) {\n rungen(competitor, function (output) {\n return success(result, index, output);\n }, fail);\n });\n })();\n } else {\n (function () {\n var result = Object.keys(value.competitors).reduce(function (p, c) {\n p[c] = false;\n return p;\n }, {});\n Object.keys(value.competitors).forEach(function (index) {\n rungen(value.competitors[index], function (output) {\n return success(result, index, output);\n }, fail);\n });\n })();\n }\n return true;\n};\n\nvar subscribe = function subscribe(value, next) {\n if (!_is2.default.subscribe(value)) return false;\n if (!_is2.default.channel(value.channel)) {\n throw new Error('the first argument of \"subscribe\" must be a valid channel');\n }\n var unsubscribe = value.channel.subscribe(function (ret) {\n unsubscribe && unsubscribe();\n next(ret);\n });\n\n return true;\n};\n\nexports.default = [promise, fork, join, race, subscribe];\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/rungen/dist/controls/async.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -507,100 +190,7 @@ exports.default = [promise, fork, join, race, subscribe];
|
|||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.iterator = exports.array = exports.object = exports.error = exports.any = undefined;
|
||||
|
||||
var _is = __webpack_require__(/*! ../utils/is */ "./node_modules/rungen/dist/utils/is.js");
|
||||
|
||||
var _is2 = _interopRequireDefault(_is);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var any = exports.any = function any(value, next, rungen, yieldNext) {
|
||||
yieldNext(value);
|
||||
return true;
|
||||
};
|
||||
|
||||
var error = exports.error = function error(value, next, rungen, yieldNext, raiseNext) {
|
||||
if (!_is2.default.error(value)) return false;
|
||||
raiseNext(value.error);
|
||||
return true;
|
||||
};
|
||||
|
||||
var object = exports.object = function object(value, next, rungen, yieldNext, raiseNext) {
|
||||
if (!_is2.default.all(value) || !_is2.default.obj(value.value)) return false;
|
||||
var result = {};
|
||||
var keys = Object.keys(value.value);
|
||||
var count = 0;
|
||||
var hasError = false;
|
||||
var gotResultSuccess = function gotResultSuccess(key, ret) {
|
||||
if (hasError) return;
|
||||
result[key] = ret;
|
||||
count++;
|
||||
if (count === keys.length) {
|
||||
yieldNext(result);
|
||||
}
|
||||
};
|
||||
|
||||
var gotResultError = function gotResultError(key, error) {
|
||||
if (hasError) return;
|
||||
hasError = true;
|
||||
raiseNext(error);
|
||||
};
|
||||
|
||||
keys.map(function (key) {
|
||||
rungen(value.value[key], function (ret) {
|
||||
return gotResultSuccess(key, ret);
|
||||
}, function (err) {
|
||||
return gotResultError(key, err);
|
||||
});
|
||||
});
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
var array = exports.array = function array(value, next, rungen, yieldNext, raiseNext) {
|
||||
if (!_is2.default.all(value) || !_is2.default.array(value.value)) return false;
|
||||
var result = [];
|
||||
var count = 0;
|
||||
var hasError = false;
|
||||
var gotResultSuccess = function gotResultSuccess(key, ret) {
|
||||
if (hasError) return;
|
||||
result[key] = ret;
|
||||
count++;
|
||||
if (count === value.value.length) {
|
||||
yieldNext(result);
|
||||
}
|
||||
};
|
||||
|
||||
var gotResultError = function gotResultError(key, error) {
|
||||
if (hasError) return;
|
||||
hasError = true;
|
||||
raiseNext(error);
|
||||
};
|
||||
|
||||
value.value.map(function (v, key) {
|
||||
rungen(v, function (ret) {
|
||||
return gotResultSuccess(key, ret);
|
||||
}, function (err) {
|
||||
return gotResultError(key, err);
|
||||
});
|
||||
});
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
var iterator = exports.iterator = function iterator(value, next, rungen, yieldNext, raiseNext) {
|
||||
if (!_is2.default.iterator(value)) return false;
|
||||
rungen(value, next, raiseNext);
|
||||
return true;
|
||||
};
|
||||
|
||||
exports.default = [error, iterator, array, object, any];
|
||||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.iterator = exports.array = exports.object = exports.error = exports.any = undefined;\n\nvar _is = __webpack_require__(/*! ../utils/is */ \"./node_modules/rungen/dist/utils/is.js\");\n\nvar _is2 = _interopRequireDefault(_is);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar any = exports.any = function any(value, next, rungen, yieldNext) {\n yieldNext(value);\n return true;\n};\n\nvar error = exports.error = function error(value, next, rungen, yieldNext, raiseNext) {\n if (!_is2.default.error(value)) return false;\n raiseNext(value.error);\n return true;\n};\n\nvar object = exports.object = function object(value, next, rungen, yieldNext, raiseNext) {\n if (!_is2.default.all(value) || !_is2.default.obj(value.value)) return false;\n var result = {};\n var keys = Object.keys(value.value);\n var count = 0;\n var hasError = false;\n var gotResultSuccess = function gotResultSuccess(key, ret) {\n if (hasError) return;\n result[key] = ret;\n count++;\n if (count === keys.length) {\n yieldNext(result);\n }\n };\n\n var gotResultError = function gotResultError(key, error) {\n if (hasError) return;\n hasError = true;\n raiseNext(error);\n };\n\n keys.map(function (key) {\n rungen(value.value[key], function (ret) {\n return gotResultSuccess(key, ret);\n }, function (err) {\n return gotResultError(key, err);\n });\n });\n\n return true;\n};\n\nvar array = exports.array = function array(value, next, rungen, yieldNext, raiseNext) {\n if (!_is2.default.all(value) || !_is2.default.array(value.value)) return false;\n var result = [];\n var count = 0;\n var hasError = false;\n var gotResultSuccess = function gotResultSuccess(key, ret) {\n if (hasError) return;\n result[key] = ret;\n count++;\n if (count === value.value.length) {\n yieldNext(result);\n }\n };\n\n var gotResultError = function gotResultError(key, error) {\n if (hasError) return;\n hasError = true;\n raiseNext(error);\n };\n\n value.value.map(function (v, key) {\n rungen(v, function (ret) {\n return gotResultSuccess(key, ret);\n }, function (err) {\n return gotResultError(key, err);\n });\n });\n\n return true;\n};\n\nvar iterator = exports.iterator = function iterator(value, next, rungen, yieldNext, raiseNext) {\n if (!_is2.default.iterator(value)) return false;\n rungen(value, next, raiseNext);\n return true;\n};\n\nexports.default = [error, iterator, array, object, any];\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/rungen/dist/controls/builtin.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -612,42 +202,7 @@ exports.default = [error, iterator, array, object, any];
|
|||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.cps = exports.call = undefined;
|
||||
|
||||
var _is = __webpack_require__(/*! ../utils/is */ "./node_modules/rungen/dist/utils/is.js");
|
||||
|
||||
var _is2 = _interopRequireDefault(_is);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
||||
|
||||
var call = exports.call = function call(value, next, rungen, yieldNext, raiseNext) {
|
||||
if (!_is2.default.call(value)) return false;
|
||||
try {
|
||||
next(value.func.apply(value.context, value.args));
|
||||
} catch (err) {
|
||||
raiseNext(err);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
var cps = exports.cps = function cps(value, next, rungen, yieldNext, raiseNext) {
|
||||
var _value$func;
|
||||
|
||||
if (!_is2.default.cps(value)) return false;
|
||||
(_value$func = value.func).call.apply(_value$func, [null].concat(_toConsumableArray(value.args), [function (err, result) {
|
||||
if (err) raiseNext(err);else next(result);
|
||||
}]));
|
||||
return true;
|
||||
};
|
||||
|
||||
exports.default = [call, cps];
|
||||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.cps = exports.call = undefined;\n\nvar _is = __webpack_require__(/*! ../utils/is */ \"./node_modules/rungen/dist/utils/is.js\");\n\nvar _is2 = _interopRequireDefault(_is);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar call = exports.call = function call(value, next, rungen, yieldNext, raiseNext) {\n if (!_is2.default.call(value)) return false;\n try {\n next(value.func.apply(value.context, value.args));\n } catch (err) {\n raiseNext(err);\n }\n return true;\n};\n\nvar cps = exports.cps = function cps(value, next, rungen, yieldNext, raiseNext) {\n var _value$func;\n\n if (!_is2.default.cps(value)) return false;\n (_value$func = value.func).call.apply(_value$func, [null].concat(_toConsumableArray(value.args), [function (err, result) {\n if (err) raiseNext(err);else next(result);\n }]));\n return true;\n};\n\nexports.default = [call, cps];\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/rungen/dist/controls/wrap.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -659,85 +214,7 @@ exports.default = [call, cps];
|
|||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _builtin = __webpack_require__(/*! ./controls/builtin */ "./node_modules/rungen/dist/controls/builtin.js");
|
||||
|
||||
var _builtin2 = _interopRequireDefault(_builtin);
|
||||
|
||||
var _is = __webpack_require__(/*! ./utils/is */ "./node_modules/rungen/dist/utils/is.js");
|
||||
|
||||
var _is2 = _interopRequireDefault(_is);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
||||
|
||||
var create = function create() {
|
||||
var userControls = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
|
||||
|
||||
var controls = [].concat(_toConsumableArray(userControls), _toConsumableArray(_builtin2.default));
|
||||
|
||||
var runtime = function runtime(input) {
|
||||
var success = arguments.length <= 1 || arguments[1] === undefined ? function () {} : arguments[1];
|
||||
var error = arguments.length <= 2 || arguments[2] === undefined ? function () {} : arguments[2];
|
||||
|
||||
var iterate = function iterate(gen) {
|
||||
var yieldValue = function yieldValue(isError) {
|
||||
return function (ret) {
|
||||
try {
|
||||
var _ref = isError ? gen.throw(ret) : gen.next(ret);
|
||||
|
||||
var value = _ref.value;
|
||||
var done = _ref.done;
|
||||
|
||||
if (done) return success(value);
|
||||
next(value);
|
||||
} catch (e) {
|
||||
return error(e);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
var next = function next(ret) {
|
||||
controls.some(function (control) {
|
||||
return control(ret, next, runtime, yieldValue(false), yieldValue(true));
|
||||
});
|
||||
};
|
||||
|
||||
yieldValue(false)();
|
||||
};
|
||||
|
||||
var iterator = _is2.default.iterator(input) ? input : regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
_context.next = 2;
|
||||
return input;
|
||||
|
||||
case 2:
|
||||
return _context.abrupt('return', _context.sent);
|
||||
|
||||
case 3:
|
||||
case 'end':
|
||||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, this);
|
||||
})();
|
||||
|
||||
iterate(iterator, success, error);
|
||||
};
|
||||
|
||||
return runtime;
|
||||
};
|
||||
|
||||
exports.default = create;
|
||||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _builtin = __webpack_require__(/*! ./controls/builtin */ \"./node_modules/rungen/dist/controls/builtin.js\");\n\nvar _builtin2 = _interopRequireDefault(_builtin);\n\nvar _is = __webpack_require__(/*! ./utils/is */ \"./node_modules/rungen/dist/utils/is.js\");\n\nvar _is2 = _interopRequireDefault(_is);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar create = function create() {\n var userControls = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];\n\n var controls = [].concat(_toConsumableArray(userControls), _toConsumableArray(_builtin2.default));\n\n var runtime = function runtime(input) {\n var success = arguments.length <= 1 || arguments[1] === undefined ? function () {} : arguments[1];\n var error = arguments.length <= 2 || arguments[2] === undefined ? function () {} : arguments[2];\n\n var iterate = function iterate(gen) {\n var yieldValue = function yieldValue(isError) {\n return function (ret) {\n try {\n var _ref = isError ? gen.throw(ret) : gen.next(ret);\n\n var value = _ref.value;\n var done = _ref.done;\n\n if (done) return success(value);\n next(value);\n } catch (e) {\n return error(e);\n }\n };\n };\n\n var next = function next(ret) {\n controls.some(function (control) {\n return control(ret, next, runtime, yieldValue(false), yieldValue(true));\n });\n };\n\n yieldValue(false)();\n };\n\n var iterator = _is2.default.iterator(input) ? input : regeneratorRuntime.mark(function _callee() {\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return input;\n\n case 2:\n return _context.abrupt('return', _context.sent);\n\n case 3:\n case 'end':\n return _context.stop();\n }\n }\n }, _callee, this);\n })();\n\n iterate(iterator, success, error);\n };\n\n return runtime;\n};\n\nexports.default = create;\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/rungen/dist/create.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -749,42 +226,7 @@ exports.default = create;
|
|||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.wrapControls = exports.asyncControls = exports.create = undefined;
|
||||
|
||||
var _helpers = __webpack_require__(/*! ./utils/helpers */ "./node_modules/rungen/dist/utils/helpers.js");
|
||||
|
||||
Object.keys(_helpers).forEach(function (key) {
|
||||
if (key === "default") return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _helpers[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var _create = __webpack_require__(/*! ./create */ "./node_modules/rungen/dist/create.js");
|
||||
|
||||
var _create2 = _interopRequireDefault(_create);
|
||||
|
||||
var _async = __webpack_require__(/*! ./controls/async */ "./node_modules/rungen/dist/controls/async.js");
|
||||
|
||||
var _async2 = _interopRequireDefault(_async);
|
||||
|
||||
var _wrap = __webpack_require__(/*! ./controls/wrap */ "./node_modules/rungen/dist/controls/wrap.js");
|
||||
|
||||
var _wrap2 = _interopRequireDefault(_wrap);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
exports.create = _create2.default;
|
||||
exports.asyncControls = _async2.default;
|
||||
exports.wrapControls = _wrap2.default;
|
||||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.wrapControls = exports.asyncControls = exports.create = undefined;\n\nvar _helpers = __webpack_require__(/*! ./utils/helpers */ \"./node_modules/rungen/dist/utils/helpers.js\");\n\nObject.keys(_helpers).forEach(function (key) {\n if (key === \"default\") return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function get() {\n return _helpers[key];\n }\n });\n});\n\nvar _create = __webpack_require__(/*! ./create */ \"./node_modules/rungen/dist/create.js\");\n\nvar _create2 = _interopRequireDefault(_create);\n\nvar _async = __webpack_require__(/*! ./controls/async */ \"./node_modules/rungen/dist/controls/async.js\");\n\nvar _async2 = _interopRequireDefault(_async);\n\nvar _wrap = __webpack_require__(/*! ./controls/wrap */ \"./node_modules/rungen/dist/controls/wrap.js\");\n\nvar _wrap2 = _interopRequireDefault(_wrap);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.create = _create2.default;\nexports.asyncControls = _async2.default;\nexports.wrapControls = _wrap2.default;\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/rungen/dist/index.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -796,32 +238,7 @@ exports.wrapControls = _wrap2.default;
|
|||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var createDispatcher = function createDispatcher() {
|
||||
var listeners = [];
|
||||
|
||||
return {
|
||||
subscribe: function subscribe(listener) {
|
||||
listeners.push(listener);
|
||||
return function () {
|
||||
listeners = listeners.filter(function (l) {
|
||||
return l !== listener;
|
||||
});
|
||||
};
|
||||
},
|
||||
dispatch: function dispatch(action) {
|
||||
listeners.slice().forEach(function (listener) {
|
||||
return listener(action);
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
exports.default = createDispatcher;
|
||||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar createDispatcher = function createDispatcher() {\n var listeners = [];\n\n return {\n subscribe: function subscribe(listener) {\n listeners.push(listener);\n return function () {\n listeners = listeners.filter(function (l) {\n return l !== listener;\n });\n };\n },\n dispatch: function dispatch(action) {\n listeners.slice().forEach(function (listener) {\n return listener(action);\n });\n }\n };\n};\n\nexports.default = createDispatcher;\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/rungen/dist/utils/dispatcher.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -833,140 +250,7 @@ exports.default = createDispatcher;
|
|||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.createChannel = exports.subscribe = exports.cps = exports.apply = exports.call = exports.invoke = exports.delay = exports.race = exports.join = exports.fork = exports.error = exports.all = undefined;
|
||||
|
||||
var _keys = __webpack_require__(/*! ./keys */ "./node_modules/rungen/dist/utils/keys.js");
|
||||
|
||||
var _keys2 = _interopRequireDefault(_keys);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var all = exports.all = function all(value) {
|
||||
return {
|
||||
type: _keys2.default.all,
|
||||
value: value
|
||||
};
|
||||
};
|
||||
|
||||
var error = exports.error = function error(err) {
|
||||
return {
|
||||
type: _keys2.default.error,
|
||||
error: err
|
||||
};
|
||||
};
|
||||
|
||||
var fork = exports.fork = function fork(iterator) {
|
||||
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
args[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
return {
|
||||
type: _keys2.default.fork,
|
||||
iterator: iterator,
|
||||
args: args
|
||||
};
|
||||
};
|
||||
|
||||
var join = exports.join = function join(task) {
|
||||
return {
|
||||
type: _keys2.default.join,
|
||||
task: task
|
||||
};
|
||||
};
|
||||
|
||||
var race = exports.race = function race(competitors) {
|
||||
return {
|
||||
type: _keys2.default.race,
|
||||
competitors: competitors
|
||||
};
|
||||
};
|
||||
|
||||
var delay = exports.delay = function delay(timeout) {
|
||||
return new Promise(function (resolve) {
|
||||
setTimeout(function () {
|
||||
return resolve(true);
|
||||
}, timeout);
|
||||
});
|
||||
};
|
||||
|
||||
var invoke = exports.invoke = function invoke(func) {
|
||||
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
||||
args[_key2 - 1] = arguments[_key2];
|
||||
}
|
||||
|
||||
return {
|
||||
type: _keys2.default.call,
|
||||
func: func,
|
||||
context: null,
|
||||
args: args
|
||||
};
|
||||
};
|
||||
|
||||
var call = exports.call = function call(func, context) {
|
||||
for (var _len3 = arguments.length, args = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
|
||||
args[_key3 - 2] = arguments[_key3];
|
||||
}
|
||||
|
||||
return {
|
||||
type: _keys2.default.call,
|
||||
func: func,
|
||||
context: context,
|
||||
args: args
|
||||
};
|
||||
};
|
||||
|
||||
var apply = exports.apply = function apply(func, context, args) {
|
||||
return {
|
||||
type: _keys2.default.call,
|
||||
func: func,
|
||||
context: context,
|
||||
args: args
|
||||
};
|
||||
};
|
||||
|
||||
var cps = exports.cps = function cps(func) {
|
||||
for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
||||
args[_key4 - 1] = arguments[_key4];
|
||||
}
|
||||
|
||||
return {
|
||||
type: _keys2.default.cps,
|
||||
func: func,
|
||||
args: args
|
||||
};
|
||||
};
|
||||
|
||||
var subscribe = exports.subscribe = function subscribe(channel) {
|
||||
return {
|
||||
type: _keys2.default.subscribe,
|
||||
channel: channel
|
||||
};
|
||||
};
|
||||
|
||||
var createChannel = exports.createChannel = function createChannel(callback) {
|
||||
var listeners = [];
|
||||
var subscribe = function subscribe(l) {
|
||||
listeners.push(l);
|
||||
return function () {
|
||||
return listeners.splice(listeners.indexOf(l), 1);
|
||||
};
|
||||
};
|
||||
var next = function next(val) {
|
||||
return listeners.forEach(function (l) {
|
||||
return l(val);
|
||||
});
|
||||
};
|
||||
callback(next);
|
||||
|
||||
return {
|
||||
subscribe: subscribe
|
||||
};
|
||||
};
|
||||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createChannel = exports.subscribe = exports.cps = exports.apply = exports.call = exports.invoke = exports.delay = exports.race = exports.join = exports.fork = exports.error = exports.all = undefined;\n\nvar _keys = __webpack_require__(/*! ./keys */ \"./node_modules/rungen/dist/utils/keys.js\");\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar all = exports.all = function all(value) {\n return {\n type: _keys2.default.all,\n value: value\n };\n};\n\nvar error = exports.error = function error(err) {\n return {\n type: _keys2.default.error,\n error: err\n };\n};\n\nvar fork = exports.fork = function fork(iterator) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return {\n type: _keys2.default.fork,\n iterator: iterator,\n args: args\n };\n};\n\nvar join = exports.join = function join(task) {\n return {\n type: _keys2.default.join,\n task: task\n };\n};\n\nvar race = exports.race = function race(competitors) {\n return {\n type: _keys2.default.race,\n competitors: competitors\n };\n};\n\nvar delay = exports.delay = function delay(timeout) {\n return new Promise(function (resolve) {\n setTimeout(function () {\n return resolve(true);\n }, timeout);\n });\n};\n\nvar invoke = exports.invoke = function invoke(func) {\n for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return {\n type: _keys2.default.call,\n func: func,\n context: null,\n args: args\n };\n};\n\nvar call = exports.call = function call(func, context) {\n for (var _len3 = arguments.length, args = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {\n args[_key3 - 2] = arguments[_key3];\n }\n\n return {\n type: _keys2.default.call,\n func: func,\n context: context,\n args: args\n };\n};\n\nvar apply = exports.apply = function apply(func, context, args) {\n return {\n type: _keys2.default.call,\n func: func,\n context: context,\n args: args\n };\n};\n\nvar cps = exports.cps = function cps(func) {\n for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n\n return {\n type: _keys2.default.cps,\n func: func,\n args: args\n };\n};\n\nvar subscribe = exports.subscribe = function subscribe(channel) {\n return {\n type: _keys2.default.subscribe,\n channel: channel\n };\n};\n\nvar createChannel = exports.createChannel = function createChannel(callback) {\n var listeners = [];\n var subscribe = function subscribe(l) {\n listeners.push(l);\n return function () {\n return listeners.splice(listeners.indexOf(l), 1);\n };\n };\n var next = function next(val) {\n return listeners.forEach(function (l) {\n return l(val);\n });\n };\n callback(next);\n\n return {\n subscribe: subscribe\n };\n};\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/rungen/dist/utils/helpers.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -978,64 +262,7 @@ var createChannel = exports.createChannel = function createChannel(callback) {
|
|||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
|
||||
|
||||
var _keys = __webpack_require__(/*! ./keys */ "./node_modules/rungen/dist/utils/keys.js");
|
||||
|
||||
var _keys2 = _interopRequireDefault(_keys);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var is = {
|
||||
obj: function obj(value) {
|
||||
return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !!value;
|
||||
},
|
||||
all: function all(value) {
|
||||
return is.obj(value) && value.type === _keys2.default.all;
|
||||
},
|
||||
error: function error(value) {
|
||||
return is.obj(value) && value.type === _keys2.default.error;
|
||||
},
|
||||
array: Array.isArray,
|
||||
func: function func(value) {
|
||||
return typeof value === 'function';
|
||||
},
|
||||
promise: function promise(value) {
|
||||
return value && is.func(value.then);
|
||||
},
|
||||
iterator: function iterator(value) {
|
||||
return value && is.func(value.next) && is.func(value.throw);
|
||||
},
|
||||
fork: function fork(value) {
|
||||
return is.obj(value) && value.type === _keys2.default.fork;
|
||||
},
|
||||
join: function join(value) {
|
||||
return is.obj(value) && value.type === _keys2.default.join;
|
||||
},
|
||||
race: function race(value) {
|
||||
return is.obj(value) && value.type === _keys2.default.race;
|
||||
},
|
||||
call: function call(value) {
|
||||
return is.obj(value) && value.type === _keys2.default.call;
|
||||
},
|
||||
cps: function cps(value) {
|
||||
return is.obj(value) && value.type === _keys2.default.cps;
|
||||
},
|
||||
subscribe: function subscribe(value) {
|
||||
return is.obj(value) && value.type === _keys2.default.subscribe;
|
||||
},
|
||||
channel: function channel(value) {
|
||||
return is.obj(value) && is.func(value.subscribe);
|
||||
}
|
||||
};
|
||||
|
||||
exports.default = is;
|
||||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nvar _keys = __webpack_require__(/*! ./keys */ \"./node_modules/rungen/dist/utils/keys.js\");\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar is = {\n obj: function obj(value) {\n return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !!value;\n },\n all: function all(value) {\n return is.obj(value) && value.type === _keys2.default.all;\n },\n error: function error(value) {\n return is.obj(value) && value.type === _keys2.default.error;\n },\n array: Array.isArray,\n func: function func(value) {\n return typeof value === 'function';\n },\n promise: function promise(value) {\n return value && is.func(value.then);\n },\n iterator: function iterator(value) {\n return value && is.func(value.next) && is.func(value.throw);\n },\n fork: function fork(value) {\n return is.obj(value) && value.type === _keys2.default.fork;\n },\n join: function join(value) {\n return is.obj(value) && value.type === _keys2.default.join;\n },\n race: function race(value) {\n return is.obj(value) && value.type === _keys2.default.race;\n },\n call: function call(value) {\n return is.obj(value) && value.type === _keys2.default.call;\n },\n cps: function cps(value) {\n return is.obj(value) && value.type === _keys2.default.cps;\n },\n subscribe: function subscribe(value) {\n return is.obj(value) && value.type === _keys2.default.subscribe;\n },\n channel: function channel(value) {\n return is.obj(value) && is.func(value.subscribe);\n }\n};\n\nexports.default = is;\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/rungen/dist/utils/is.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -1047,23 +274,7 @@ exports.default = is;
|
|||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var keys = {
|
||||
all: Symbol('all'),
|
||||
error: Symbol('error'),
|
||||
fork: Symbol('fork'),
|
||||
join: Symbol('join'),
|
||||
race: Symbol('race'),
|
||||
call: Symbol('call'),
|
||||
cps: Symbol('cps'),
|
||||
subscribe: Symbol('subscribe')
|
||||
};
|
||||
|
||||
exports.default = keys;
|
||||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar keys = {\n all: Symbol('all'),\n error: Symbol('error'),\n fork: Symbol('fork'),\n join: Symbol('join'),\n race: Symbol('race'),\n call: Symbol('call'),\n cps: Symbol('cps'),\n subscribe: Symbol('subscribe')\n};\n\nexports.default = keys;\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/rungen/dist/utils/keys.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -1074,9 +285,8 @@ exports.default = keys;
|
|||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
(function() { module.exports = this["lodash"]; }());
|
||||
eval("(function() { module.exports = this[\"lodash\"]; }());\n\n//# sourceURL=webpack://wp.%5Bname%5D/external_%22lodash%22?");
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ })["default"];
|
||||
//# sourceMappingURL=redux-routine.js.map
|
||||
/******/ })["default"];
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -95,17 +95,7 @@ this["wp"] = this["wp"] || {}; this["wp"]["viewport"] =
|
|||
/***/ (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;
|
||||
}
|
||||
}
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _arrayWithoutHoles; });\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -117,11 +107,7 @@ function _arrayWithoutHoles(arr) {
|
|||
/***/ (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);
|
||||
}
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _iterableToArray; });\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/iterableToArray.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -133,11 +119,7 @@ function _iterableToArray(iter) {
|
|||
/***/ (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");
|
||||
}
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _nonIterableSpread; });\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -149,17 +131,7 @@ function _nonIterableSpread() {
|
|||
/***/ (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"])();
|
||||
}
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _toConsumableArray; });\n/* harmony import */ var _arrayWithoutHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithoutHoles */ \"./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js\");\n/* harmony import */ var _iterableToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArray */ \"./node_modules/@babel/runtime/helpers/esm/iterableToArray.js\");\n/* harmony import */ var _nonIterableSpread__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nonIterableSpread */ \"./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js\");\n\n\n\nfunction _toConsumableArray(arr) {\n return Object(_arrayWithoutHoles__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr) || Object(_iterableToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arr) || Object(_nonIterableSpread__WEBPACK_IMPORTED_MODULE_2__[\"default\"])();\n}\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -171,40 +143,7 @@ function _toConsumableArray(arr) {
|
|||
/***/ (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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/compose */ \"@wordpress/compose\");\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__);\n/* 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\");\n/**\n * WordPress dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\n/**\n * Higher-order component creator, creating a new component which renders if\n * the viewport query is satisfied.\n *\n * @param {string} query Viewport query.\n *\n * @see withViewportMatches\n *\n * @return {Function} Higher-order component.\n */\n\nvar ifViewportMatches = function ifViewportMatches(query) {\n 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\"])({\n isViewportMatch: query\n }), Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__[\"ifCondition\"])(function (props) {\n return props.isViewportMatch;\n })]), 'ifViewportMatches');\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ifViewportMatches);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/viewport/build-module/if-viewport-matches.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -216,96 +155,7 @@ var ifViewportMatches = function ifViewportMatches(query) {
|
|||
/***/ (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();
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ \"@wordpress/data\");\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./store */ \"./node_modules/@wordpress/viewport/build-module/store/index.js\");\n/* 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\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ifViewportMatches\", function() { return _if_viewport_matches__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* 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\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"withViewportMatch\", function() { return _with_viewport_match__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/**\n * External dependencies\n */\n\n/**\n * WordPress dependencies\n */\n\n\n/**\n * Internal dependencies\n */\n\n\n\n\n/**\n * Hash of breakpoint names with pixel width at which it becomes effective.\n *\n * @see _breakpoints.scss\n *\n * @type {Object}\n */\n\nvar BREAKPOINTS = {\n huge: 1440,\n wide: 1280,\n large: 960,\n medium: 782,\n small: 600,\n mobile: 480\n};\n/**\n * Hash of query operators with corresponding condition for media query.\n *\n * @type {Object}\n */\n\nvar OPERATORS = {\n '<': 'max-width',\n '>=': 'min-width'\n};\n/**\n * Callback invoked when media query state should be updated. Is invoked a\n * maximum of one time per call stack.\n */\n\nvar setIsMatching = Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"debounce\"])(function () {\n var values = Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"mapValues\"])(queries, function (query) {\n return query.matches;\n });\n Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"dispatch\"])('core/viewport').setIsMatching(values);\n}, {\n leading: true\n});\n/**\n * Hash of breakpoint names with generated MediaQueryList for corresponding\n * media query.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList\n *\n * @type {Object<string,MediaQueryList>}\n */\n\nvar queries = Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"reduce\"])(BREAKPOINTS, function (result, width, name) {\n Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"forEach\"])(OPERATORS, function (condition, operator) {\n var list = window.matchMedia(\"(\".concat(condition, \": \").concat(width, \"px)\"));\n list.addListener(setIsMatching);\n var key = [operator, name].join(' ');\n result[key] = list;\n });\n return result;\n}, {});\nwindow.addEventListener('orientationchange', setIsMatching); // Set initial values\n\nsetIsMatching();\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/viewport/build-module/index.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -317,24 +167,7 @@ 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
|
||||
};
|
||||
}
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setIsMatching\", function() { return setIsMatching; });\n/**\n * Returns an action object used in signalling that viewport queries have been\n * updated. Values are specified as an object of breakpoint query keys where\n * value represents whether query matches.\n *\n * @param {Object} values Breakpoint query matches.\n *\n * @return {Object} Action object.\n */\nfunction setIsMatching(values) {\n return {\n type: 'SET_IS_MATCHING',\n values: values\n };\n}\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/viewport/build-module/store/actions.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -346,29 +179,7 @@ function setIsMatching(values) {
|
|||
/***/ (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__
|
||||
}));
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ \"@wordpress/data\");\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reducer */ \"./node_modules/@wordpress/viewport/build-module/store/reducer.js\");\n/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./actions */ \"./node_modules/@wordpress/viewport/build-module/store/actions.js\");\n/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./selectors */ \"./node_modules/@wordpress/viewport/build-module/store/selectors.js\");\n/**\n * WordPress dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__[\"registerStore\"])('core/viewport', {\n reducer: _reducer__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n actions: _actions__WEBPACK_IMPORTED_MODULE_2__,\n selectors: _selectors__WEBPACK_IMPORTED_MODULE_3__\n}));\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/viewport/build-module/store/index.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -380,30 +191,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
/***/ (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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Reducer returning the viewport state, as keys of breakpoint queries with\n * boolean value representing whether query is matched.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nfunction reducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var action = arguments.length > 1 ? arguments[1] : undefined;\n\n switch (action.type) {\n case 'SET_IS_MATCHING':\n return action.values;\n }\n\n return state;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (reducer);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/viewport/build-module/store/reducer.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -415,41 +203,7 @@ function reducer() {
|
|||
/***/ (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];
|
||||
}
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isViewportMatch\", function() { return isViewportMatch; });\n/* 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\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/**\n * External dependencies\n */\n\n/**\n * Returns true if the viewport matches the given query, or false otherwise.\n *\n * @param {Object} state Viewport state object.\n * @param {string} query Query string. Includes operator and breakpoint name,\n * space separated. Operator defaults to >=.\n *\n * @example\n *\n * ```js\n * isViewportMatch( state, '< huge' );\n * isViewPortMatch( state, 'medium' );\n * ```\n *\n * @return {boolean} Whether viewport matches query.\n */\n\nfunction isViewportMatch(state, query) {\n // Pad to _at least_ two elements to take from the right, effectively\n // defaulting the left-most value.\n 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(' ');\n return !!state[key];\n}\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/viewport/build-module/store/selectors.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -461,45 +215,7 @@ function isViewportMatch(state, query) {
|
|||
/***/ (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);
|
||||
|
||||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ \"@wordpress/compose\");\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ \"@wordpress/data\");\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);\n/**\n * External dependencies\n */\n\n/**\n * WordPress dependencies\n */\n\n\n\n/**\n * Higher-order component creator, creating a new component which renders with\n * the given prop names, where the value passed to the underlying component is\n * the result of the query assigned as the object's value.\n *\n * @param {Object} queries Object of prop name to viewport query.\n *\n * @see isViewportMatch\n *\n * @return {Function} Higher-order component.\n */\n\nvar withViewportMatch = function withViewportMatch(queries) {\n return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__[\"createHigherOrderComponent\"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__[\"withSelect\"])(function (select) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"mapValues\"])(queries, function (query) {\n return select('core/viewport').isViewportMatch(query);\n });\n }), 'withViewportMatch');\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (withViewportMatch);\n\n\n//# sourceURL=webpack://wp.%5Bname%5D/./node_modules/@wordpress/viewport/build-module/with-viewport-match.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -510,7 +226,7 @@ var withViewportMatch = function withViewportMatch(queries) {
|
|||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
(function() { module.exports = this["wp"]["compose"]; }());
|
||||
eval("(function() { module.exports = this[\"wp\"][\"compose\"]; }());\n\n//# sourceURL=webpack://wp.%5Bname%5D/external_%7B%22this%22:%5B%22wp%22,%22compose%22%5D%7D?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -521,7 +237,7 @@ var withViewportMatch = function withViewportMatch(queries) {
|
|||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
(function() { module.exports = this["wp"]["data"]; }());
|
||||
eval("(function() { module.exports = this[\"wp\"][\"data\"]; }());\n\n//# sourceURL=webpack://wp.%5Bname%5D/external_%7B%22this%22:%5B%22wp%22,%22data%22%5D%7D?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
@ -532,9 +248,8 @@ var withViewportMatch = function withViewportMatch(queries) {
|
|||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
(function() { module.exports = this["lodash"]; }());
|
||||
eval("(function() { module.exports = this[\"lodash\"]; }());\n\n//# sourceURL=webpack://wp.%5Bname%5D/external_%22lodash%22?");
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
//# sourceMappingURL=viewport.js.map
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.0-beta5-43930';
|
||||
$wp_version = '5.0-beta5-43931';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue