build/scripts/data-controls
index.js
4.2 KB
7 months ago
index.js.map
6.0 KB
9 months ago
index.min.asset.php
125 B
7 months ago
index.min.js
1.8 KB
7 months ago
index.min.js.map
6.4 KB
7 months ago
index.js in Gutenberg 23.2.0, at build/scripts/data-controls/index.js
| 1 | "use strict"; |
| 2 | var wp; |
| 3 | (wp ||= {}).dataControls = (() => { |
| 4 | var __create = Object.create; |
| 5 | var __defProp = Object.defineProperty; |
| 6 | var __getOwnPropDesc = Object.getOwnPropertyDescriptor; |
| 7 | var __getOwnPropNames = Object.getOwnPropertyNames; |
| 8 | var __getProtoOf = Object.getPrototypeOf; |
| 9 | var __hasOwnProp = Object.prototype.hasOwnProperty; |
| 10 | var __commonJS = (cb, mod) => function __require() { |
| 11 | return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; |
| 12 | }; |
| 13 | var __export = (target, all) => { |
| 14 | for (var name in all) |
| 15 | __defProp(target, name, { get: all[name], enumerable: true }); |
| 16 | }; |
| 17 | var __copyProps = (to, from, except, desc) => { |
| 18 | if (from && typeof from === "object" || typeof from === "function") { |
| 19 | for (let key of __getOwnPropNames(from)) |
| 20 | if (!__hasOwnProp.call(to, key) && key !== except) |
| 21 | __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); |
| 22 | } |
| 23 | return to; |
| 24 | }; |
| 25 | var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( |
| 26 | // If the importer is in node compatibility mode or this is not an ESM |
| 27 | // file that has been converted to a CommonJS file using a Babel- |
| 28 | // compatible transform (i.e. "__esModule" has not been set), then set |
| 29 | // "default" to the CommonJS "module.exports" for node compatibility. |
| 30 | isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, |
| 31 | mod |
| 32 | )); |
| 33 | var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); |
| 34 | |
| 35 | // package-external:@wordpress/api-fetch |
| 36 | var require_api_fetch = __commonJS({ |
| 37 | "package-external:@wordpress/api-fetch"(exports, module) { |
| 38 | module.exports = window.wp.apiFetch; |
| 39 | } |
| 40 | }); |
| 41 | |
| 42 | // package-external:@wordpress/data |
| 43 | var require_data = __commonJS({ |
| 44 | "package-external:@wordpress/data"(exports, module) { |
| 45 | module.exports = window.wp.data; |
| 46 | } |
| 47 | }); |
| 48 | |
| 49 | // package-external:@wordpress/deprecated |
| 50 | var require_deprecated = __commonJS({ |
| 51 | "package-external:@wordpress/deprecated"(exports, module) { |
| 52 | module.exports = window.wp.deprecated; |
| 53 | } |
| 54 | }); |
| 55 | |
| 56 | // packages/data-controls/build-module/index.mjs |
| 57 | var index_exports = {}; |
| 58 | __export(index_exports, { |
| 59 | __unstableAwaitPromise: () => __unstableAwaitPromise, |
| 60 | apiFetch: () => apiFetch, |
| 61 | controls: () => controls, |
| 62 | dispatch: () => dispatch, |
| 63 | select: () => select, |
| 64 | syncSelect: () => syncSelect |
| 65 | }); |
| 66 | var import_api_fetch = __toESM(require_api_fetch(), 1); |
| 67 | var import_data = __toESM(require_data(), 1); |
| 68 | var import_deprecated = __toESM(require_deprecated(), 1); |
| 69 | function apiFetch(request) { |
| 70 | return { |
| 71 | type: "API_FETCH", |
| 72 | request |
| 73 | }; |
| 74 | } |
| 75 | function select(storeNameOrDescriptor, selectorName, ...args) { |
| 76 | (0, import_deprecated.default)("`select` control in `@wordpress/data-controls`", { |
| 77 | since: "5.7", |
| 78 | alternative: "built-in `resolveSelect` control in `@wordpress/data`" |
| 79 | }); |
| 80 | return import_data.controls.resolveSelect( |
| 81 | storeNameOrDescriptor, |
| 82 | selectorName, |
| 83 | ...args |
| 84 | ); |
| 85 | } |
| 86 | function syncSelect(storeNameOrDescriptor, selectorName, ...args) { |
| 87 | (0, import_deprecated.default)("`syncSelect` control in `@wordpress/data-controls`", { |
| 88 | since: "5.7", |
| 89 | alternative: "built-in `select` control in `@wordpress/data`" |
| 90 | }); |
| 91 | return import_data.controls.select(storeNameOrDescriptor, selectorName, ...args); |
| 92 | } |
| 93 | function dispatch(storeNameOrDescriptor, actionName, ...args) { |
| 94 | (0, import_deprecated.default)("`dispatch` control in `@wordpress/data-controls`", { |
| 95 | since: "5.7", |
| 96 | alternative: "built-in `dispatch` control in `@wordpress/data`" |
| 97 | }); |
| 98 | return import_data.controls.dispatch(storeNameOrDescriptor, actionName, ...args); |
| 99 | } |
| 100 | var __unstableAwaitPromise = function(promise) { |
| 101 | return { |
| 102 | type: "AWAIT_PROMISE", |
| 103 | promise |
| 104 | }; |
| 105 | }; |
| 106 | var controls = { |
| 107 | AWAIT_PROMISE({ promise }) { |
| 108 | return promise; |
| 109 | }, |
| 110 | API_FETCH({ request }) { |
| 111 | return (0, import_api_fetch.default)(request); |
| 112 | } |
| 113 | }; |
| 114 | return __toCommonJS(index_exports); |
| 115 | })(); |
| 116 | //# sourceMappingURL=index.js.map |
| 117 |