File: /www/wwwroot/www.waciwang.com/wp-content/plugins/gutenberg/build/scripts/data-controls/index.js.map
{
"version": 3,
"sources": ["package-external:@wordpress/api-fetch", "package-external:@wordpress/data", "package-external:@wordpress/deprecated", "../../../packages/data-controls/src/index.ts"],
"sourcesContent": ["module.exports = window.wp.apiFetch;", "module.exports = window.wp.data;", "module.exports = window.wp.deprecated;", "/**\n * WordPress dependencies\n */\nimport triggerFetch from '@wordpress/api-fetch';\nimport { controls as dataControls } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport type { StoreDescriptor } from '@wordpress/data';\nimport type { APIFetchOptions } from '@wordpress/api-fetch';\n\n/**\n * Dispatches a control action for triggering an api fetch call.\n *\n * @param {Object} request Arguments for the fetch request.\n *\n * @example\n * ```js\n * import { apiFetch } from '@wordpress/data-controls';\n *\n * // Action generator using apiFetch\n * export function* myAction() {\n * \tconst path = '/v2/my-api/items';\n * \tconst items = yield apiFetch( { path } );\n * \t// do something with the items.\n * }\n * ```\n *\n * @return {Object} The control descriptor.\n */\nexport function apiFetch( request: APIFetchOptions ) {\n\treturn {\n\t\ttype: 'API_FETCH',\n\t\trequest,\n\t};\n}\n\n/**\n * Control for resolving a selector in a registered data store.\n * Alias for the `resolveSelect` built-in control in the `@wordpress/data` package.\n *\n * @param storeNameOrDescriptor The store object or identifier.\n * @param selectorName The selector name.\n * @param args Arguments passed without change to the `@wordpress/data` control.\n */\nexport function select(\n\tstoreNameOrDescriptor: string | StoreDescriptor,\n\tselectorName: string,\n\t...args: any[]\n) {\n\tdeprecated( '`select` control in `@wordpress/data-controls`', {\n\t\tsince: '5.7',\n\t\talternative: 'built-in `resolveSelect` control in `@wordpress/data`',\n\t} );\n\n\treturn dataControls.resolveSelect(\n\t\tstoreNameOrDescriptor,\n\t\tselectorName,\n\t\t...args\n\t);\n}\n\n/**\n * Control for calling a selector in a registered data store.\n * Alias for the `select` built-in control in the `@wordpress/data` package.\n *\n * @param storeNameOrDescriptor The store object or identifier.\n * @param selectorName The selector name.\n * @param args Arguments passed without change to the `@wordpress/data` control.\n */\nexport function syncSelect(\n\tstoreNameOrDescriptor: string | StoreDescriptor,\n\tselectorName: string,\n\t...args: any[]\n) {\n\tdeprecated( '`syncSelect` control in `@wordpress/data-controls`', {\n\t\tsince: '5.7',\n\t\talternative: 'built-in `select` control in `@wordpress/data`',\n\t} );\n\n\treturn dataControls.select( storeNameOrDescriptor, selectorName, ...args );\n}\n\n/**\n * Control for dispatching an action in a registered data store.\n * Alias for the `dispatch` control in the `@wordpress/data` package.\n *\n * @param storeNameOrDescriptor The store object or identifier.\n * @param actionName The action name.\n * @param args Arguments passed without change to the `@wordpress/data` control.\n */\nexport function dispatch(\n\tstoreNameOrDescriptor: string | StoreDescriptor,\n\tactionName: string,\n\t...args: any[]\n) {\n\tdeprecated( '`dispatch` control in `@wordpress/data-controls`', {\n\t\tsince: '5.7',\n\t\talternative: 'built-in `dispatch` control in `@wordpress/data`',\n\t} );\n\n\treturn dataControls.dispatch( storeNameOrDescriptor, actionName, ...args );\n}\n\n/**\n * Dispatches a control action for awaiting on a promise to be resolved.\n *\n * @param {Object} promise Promise to wait for.\n *\n * @example\n * ```js\n * import { __unstableAwaitPromise } from '@wordpress/data-controls';\n *\n * // Action generator using apiFetch\n * export function* myAction() {\n * \tconst promise = getItemsAsync();\n * \tconst items = yield __unstableAwaitPromise( promise );\n * \t// do something with the items.\n * }\n * ```\n *\n * @return {Object} The control descriptor.\n */\nexport const __unstableAwaitPromise = function < T >( promise: Promise< T > ) {\n\treturn {\n\t\ttype: 'AWAIT_PROMISE',\n\t\tpromise,\n\t};\n};\n\n/**\n * The default export is what you use to register the controls with your custom\n * store.\n *\n * @example\n * ```js\n * // WordPress dependencies\n * import { controls } from '@wordpress/data-controls';\n * import { registerStore } from '@wordpress/data';\n *\n * // Internal dependencies\n * import reducer from './reducer';\n * import * as selectors from './selectors';\n * import * as actions from './actions';\n * import * as resolvers from './resolvers';\n *\n * registerStore( 'my-custom-store', {\n * reducer,\n * controls,\n * actions,\n * selectors,\n * resolvers,\n * } );\n * ```\n * @return {Object} An object for registering the default controls with the\n * store.\n */\nexport const controls = {\n\tAWAIT_PROMISE< T >( { promise }: { promise: Promise< T > } ) {\n\t\treturn promise;\n\t},\n\tAPI_FETCH( { request }: { request: APIFetchOptions } ) {\n\t\treturn triggerFetch( request );\n\t},\n};\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,aAAO,UAAU,OAAO,GAAG;AAAA;AAAA;;;ACA3B;AAAA;AAAA,aAAO,UAAU,OAAO,GAAG;AAAA;AAAA;;;ACA3B;AAAA;AAAA,aAAO,UAAU,OAAO,GAAG;AAAA;AAAA;;;;;;;;;;;;ACG3B,yBAAyB;AACzB,oBAAyC;AACzC,0BAAuB;AAuBhB,WAAS,SAAU,SAA2B;AACpD,WAAO;MACN,MAAM;MACN;IACD;EACD;AAUO,WAAS,OACf,uBACA,iBACG,MACF;AACD,0BAAAA,SAAY,kDAAkD;MAC7D,OAAO;MACP,aAAa;IACd,CAAE;AAEF,WAAO,YAAAC,SAAa;MACnB;MACA;MACA,GAAG;IACJ;EACD;AAUO,WAAS,WACf,uBACA,iBACG,MACF;AACD,0BAAAD,SAAY,sDAAsD;MACjE,OAAO;MACP,aAAa;IACd,CAAE;AAEF,WAAO,YAAAC,SAAa,OAAQ,uBAAuB,cAAc,GAAG,IAAK;EAC1E;AAUO,WAAS,SACf,uBACA,eACG,MACF;AACD,0BAAAD,SAAY,oDAAoD;MAC/D,OAAO;MACP,aAAa;IACd,CAAE;AAEF,WAAO,YAAAC,SAAa,SAAU,uBAAuB,YAAY,GAAG,IAAK;EAC1E;AAqBO,MAAM,yBAAyB,SAAgB,SAAwB;AAC7E,WAAO;MACN,MAAM;MACN;IACD;EACD;AA6BO,MAAM,WAAW;IACvB,cAAoB,EAAE,QAAQ,GAA+B;AAC5D,aAAO;IACR;IACA,UAAW,EAAE,QAAQ,GAAkC;AACtD,iBAAO,iBAAAC,SAAc,OAAQ;IAC9B;EACD;",
"names": ["deprecated", "dataControls", "triggerFetch"]
}