kollapsminoriteten/wp-includes/js/dist/data-controls.js

123 lines
4.4 KiB
JavaScript
Raw Permalink Normal View History

2024-04-17 11:32:24 +02:00
/******/ (() => { // webpackBootstrap
2022-06-16 14:03:35 +02:00
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
2024-04-17 11:32:24 +02:00
/******/ (() => {
2022-06-16 14:03:35 +02:00
/******/ // getDefaultExport function for compatibility with non-harmony modules
2024-04-17 11:32:24 +02:00
/******/ __webpack_require__.n = (module) => {
2022-06-16 14:03:35 +02:00
/******/ var getter = module && module.__esModule ?
2024-04-17 11:32:24 +02:00
/******/ () => (module['default']) :
/******/ () => (module);
2022-06-16 14:03:35 +02:00
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
2024-04-17 11:32:24 +02:00
/******/ })();
2022-06-16 14:03:35 +02:00
/******/
/******/ /* webpack/runtime/define property getters */
2024-04-17 11:32:24 +02:00
/******/ (() => {
2022-06-16 14:03:35 +02:00
/******/ // define getter functions for harmony exports
2024-04-17 11:32:24 +02:00
/******/ __webpack_require__.d = (exports, definition) => {
2022-06-16 14:03:35 +02:00
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
2024-04-17 11:32:24 +02:00
/******/ })();
2022-06-16 14:03:35 +02:00
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
2024-04-17 11:32:24 +02:00
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
2022-06-16 14:03:35 +02:00
/******/
/******/ /* webpack/runtime/make namespace object */
2024-04-17 11:32:24 +02:00
/******/ (() => {
2022-06-16 14:03:35 +02:00
/******/ // define __esModule on exports
2024-04-17 11:32:24 +02:00
/******/ __webpack_require__.r = (exports) => {
2022-06-16 14:03:35 +02:00
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
2019-11-15 22:59:44 +01:00
/******/ };
2024-04-17 11:32:24 +02:00
/******/ })();
2022-06-16 14:03:35 +02:00
/******/
2019-11-15 22:59:44 +01:00
/************************************************************************/
2022-06-16 14:03:35 +02:00
var __webpack_exports__ = {};
// ESM COMPAT FLAG
2019-11-15 22:59:44 +01:00
__webpack_require__.r(__webpack_exports__);
2022-06-16 14:03:35 +02:00
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
2024-04-17 11:32:24 +02:00
__unstableAwaitPromise: () => (/* binding */ __unstableAwaitPromise),
apiFetch: () => (/* binding */ apiFetch),
controls: () => (/* binding */ controls),
dispatch: () => (/* binding */ dispatch),
select: () => (/* binding */ build_module_select),
syncSelect: () => (/* binding */ syncSelect)
2022-06-16 14:03:35 +02:00
});
2025-04-25 12:30:07 +02:00
;// external ["wp","apiFetch"]
2024-04-17 11:32:24 +02:00
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
2022-06-16 14:03:35 +02:00
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
2025-04-25 12:30:07 +02:00
;// external ["wp","data"]
2024-04-17 11:32:24 +02:00
const external_wp_data_namespaceObject = window["wp"]["data"];
2025-04-25 12:30:07 +02:00
;// external ["wp","deprecated"]
2024-04-17 11:32:24 +02:00
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
2022-06-16 14:03:35 +02:00
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
2025-04-25 12:30:07 +02:00
;// ./node_modules/@wordpress/data-controls/build-module/index.js
2019-11-15 22:59:44 +01:00
2021-04-27 08:32:47 +02:00
2019-11-15 22:59:44 +01:00
2020-12-10 14:06:04 +01:00
function apiFetch(request) {
2019-11-15 22:59:44 +01:00
return {
2025-12-12 13:15:55 +01:00
type: "API_FETCH",
2021-07-23 11:58:50 +02:00
request
2019-11-15 22:59:44 +01:00
};
2020-12-10 14:06:04 +01:00
}
2023-09-26 10:33:34 +02:00
function build_module_select(storeNameOrDescriptor, selectorName, ...args) {
2025-12-12 13:15:55 +01:00
external_wp_deprecated_default()("`select` control in `@wordpress/data-controls`", {
since: "5.7",
alternative: "built-in `resolveSelect` control in `@wordpress/data`"
2021-04-27 08:32:47 +02:00
});
2025-12-12 13:15:55 +01:00
return external_wp_data_namespaceObject.controls.resolveSelect(
storeNameOrDescriptor,
selectorName,
...args
);
2019-11-15 22:59:44 +01:00
}
2023-09-26 10:33:34 +02:00
function syncSelect(storeNameOrDescriptor, selectorName, ...args) {
2025-12-12 13:15:55 +01:00
external_wp_deprecated_default()("`syncSelect` control in `@wordpress/data-controls`", {
since: "5.7",
alternative: "built-in `select` control in `@wordpress/data`"
2021-04-27 08:32:47 +02:00
});
2023-09-26 10:33:34 +02:00
return external_wp_data_namespaceObject.controls.select(storeNameOrDescriptor, selectorName, ...args);
2020-09-15 14:29:22 +02:00
}
2023-09-26 10:33:34 +02:00
function dispatch(storeNameOrDescriptor, actionName, ...args) {
2025-12-12 13:15:55 +01:00
external_wp_deprecated_default()("`dispatch` control in `@wordpress/data-controls`", {
since: "5.7",
alternative: "built-in `dispatch` control in `@wordpress/data`"
2021-04-27 08:32:47 +02:00
});
2023-09-26 10:33:34 +02:00
return external_wp_data_namespaceObject.controls.dispatch(storeNameOrDescriptor, actionName, ...args);
2019-11-15 22:59:44 +01:00
}
2025-12-12 13:15:55 +01:00
const __unstableAwaitPromise = function(promise) {
2021-04-27 08:32:47 +02:00
return {
2025-12-12 13:15:55 +01:00
type: "AWAIT_PROMISE",
2021-07-23 11:58:50 +02:00
promise
2021-04-27 08:32:47 +02:00
};
};
2021-07-23 11:58:50 +02:00
const controls = {
2025-12-12 13:15:55 +01:00
AWAIT_PROMISE({ promise }) {
2025-04-25 12:30:07 +02:00
return promise;
},
2025-12-12 13:15:55 +01:00
API_FETCH({ request }) {
2022-06-16 14:03:35 +02:00
return external_wp_apiFetch_default()(request);
2020-12-10 14:06:04 +01:00
}
2019-11-15 22:59:44 +01:00
};
2025-12-12 13:15:55 +01:00
2022-06-16 14:03:35 +02:00
(window.wp = window.wp || {}).dataControls = __webpack_exports__;
/******/ })()
;