Sin descripción

block-directory.js 61KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992
  1. this["wp"] = this["wp"] || {}; this["wp"]["blockDirectory"] =
  2. /******/ (function(modules) { // webpackBootstrap
  3. /******/ // The module cache
  4. /******/ var installedModules = {};
  5. /******/
  6. /******/ // The require function
  7. /******/ function __webpack_require__(moduleId) {
  8. /******/
  9. /******/ // Check if module is in cache
  10. /******/ if(installedModules[moduleId]) {
  11. /******/ return installedModules[moduleId].exports;
  12. /******/ }
  13. /******/ // Create a new module (and put it into the cache)
  14. /******/ var module = installedModules[moduleId] = {
  15. /******/ i: moduleId,
  16. /******/ l: false,
  17. /******/ exports: {}
  18. /******/ };
  19. /******/
  20. /******/ // Execute the module function
  21. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22. /******/
  23. /******/ // Flag the module as loaded
  24. /******/ module.l = true;
  25. /******/
  26. /******/ // Return the exports of the module
  27. /******/ return module.exports;
  28. /******/ }
  29. /******/
  30. /******/
  31. /******/ // expose the modules object (__webpack_modules__)
  32. /******/ __webpack_require__.m = modules;
  33. /******/
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/
  37. /******/ // define getter function for harmony exports
  38. /******/ __webpack_require__.d = function(exports, name, getter) {
  39. /******/ if(!__webpack_require__.o(exports, name)) {
  40. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41. /******/ }
  42. /******/ };
  43. /******/
  44. /******/ // define __esModule on exports
  45. /******/ __webpack_require__.r = function(exports) {
  46. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48. /******/ }
  49. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  50. /******/ };
  51. /******/
  52. /******/ // create a fake namespace object
  53. /******/ // mode & 1: value is a module id, require it
  54. /******/ // mode & 2: merge all properties of value into the ns
  55. /******/ // mode & 4: return value when already ns object
  56. /******/ // mode & 8|1: behave like require
  57. /******/ __webpack_require__.t = function(value, mode) {
  58. /******/ if(mode & 1) value = __webpack_require__(value);
  59. /******/ if(mode & 8) return value;
  60. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61. /******/ var ns = Object.create(null);
  62. /******/ __webpack_require__.r(ns);
  63. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65. /******/ return ns;
  66. /******/ };
  67. /******/
  68. /******/ // getDefaultExport function for compatibility with non-harmony modules
  69. /******/ __webpack_require__.n = function(module) {
  70. /******/ var getter = module && module.__esModule ?
  71. /******/ function getDefault() { return module['default']; } :
  72. /******/ function getModuleExports() { return module; };
  73. /******/ __webpack_require__.d(getter, 'a', getter);
  74. /******/ return getter;
  75. /******/ };
  76. /******/
  77. /******/ // Object.prototype.hasOwnProperty.call
  78. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79. /******/
  80. /******/ // __webpack_public_path__
  81. /******/ __webpack_require__.p = "";
  82. /******/
  83. /******/
  84. /******/ // Load entry module and return exports
  85. /******/ return __webpack_require__(__webpack_require__.s = "7f3f");
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ "//Lo":
  90. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91. "use strict";
  92. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  93. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  94. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  95. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  96. /**
  97. * WordPress dependencies
  98. */
  99. const blockDefault = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  100. xmlns: "http://www.w3.org/2000/svg",
  101. viewBox: "0 0 24 24"
  102. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  103. d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"
  104. }));
  105. /* harmony default export */ __webpack_exports__["a"] = (blockDefault);
  106. /***/ }),
  107. /***/ "1ZqX":
  108. /***/ (function(module, exports) {
  109. (function() { module.exports = window["wp"]["data"]; }());
  110. /***/ }),
  111. /***/ "51Zz":
  112. /***/ (function(module, exports) {
  113. (function() { module.exports = window["wp"]["dataControls"]; }());
  114. /***/ }),
  115. /***/ "7f3f":
  116. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117. "use strict";
  118. // ESM COMPAT FLAG
  119. __webpack_require__.r(__webpack_exports__);
  120. // EXPORTS
  121. __webpack_require__.d(__webpack_exports__, "store", function() { return /* reexport */ store; });
  122. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js
  123. var selectors_namespaceObject = {};
  124. __webpack_require__.r(selectors_namespaceObject);
  125. __webpack_require__.d(selectors_namespaceObject, "isRequestingDownloadableBlocks", function() { return selectors_isRequestingDownloadableBlocks; });
  126. __webpack_require__.d(selectors_namespaceObject, "getDownloadableBlocks", function() { return selectors_getDownloadableBlocks; });
  127. __webpack_require__.d(selectors_namespaceObject, "getInstalledBlockTypes", function() { return getInstalledBlockTypes; });
  128. __webpack_require__.d(selectors_namespaceObject, "getNewBlockTypes", function() { return getNewBlockTypes; });
  129. __webpack_require__.d(selectors_namespaceObject, "getUnusedBlockTypes", function() { return getUnusedBlockTypes; });
  130. __webpack_require__.d(selectors_namespaceObject, "isInstalling", function() { return selectors_isInstalling; });
  131. __webpack_require__.d(selectors_namespaceObject, "getErrorNotices", function() { return getErrorNotices; });
  132. __webpack_require__.d(selectors_namespaceObject, "getErrorNoticeForBlock", function() { return selectors_getErrorNoticeForBlock; });
  133. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/actions.js
  134. var actions_namespaceObject = {};
  135. __webpack_require__.r(actions_namespaceObject);
  136. __webpack_require__.d(actions_namespaceObject, "fetchDownloadableBlocks", function() { return fetchDownloadableBlocks; });
  137. __webpack_require__.d(actions_namespaceObject, "receiveDownloadableBlocks", function() { return receiveDownloadableBlocks; });
  138. __webpack_require__.d(actions_namespaceObject, "installBlockType", function() { return actions_installBlockType; });
  139. __webpack_require__.d(actions_namespaceObject, "uninstallBlockType", function() { return actions_uninstallBlockType; });
  140. __webpack_require__.d(actions_namespaceObject, "addInstalledBlockType", function() { return addInstalledBlockType; });
  141. __webpack_require__.d(actions_namespaceObject, "removeInstalledBlockType", function() { return removeInstalledBlockType; });
  142. __webpack_require__.d(actions_namespaceObject, "setIsInstalling", function() { return setIsInstalling; });
  143. __webpack_require__.d(actions_namespaceObject, "setErrorNotice", function() { return setErrorNotice; });
  144. __webpack_require__.d(actions_namespaceObject, "clearErrorNotice", function() { return clearErrorNotice; });
  145. // EXTERNAL MODULE: external ["wp","element"]
  146. var external_wp_element_ = __webpack_require__("GRId");
  147. // EXTERNAL MODULE: external ["wp","plugins"]
  148. var external_wp_plugins_ = __webpack_require__("TvNi");
  149. // EXTERNAL MODULE: external ["wp","hooks"]
  150. var external_wp_hooks_ = __webpack_require__("g56x");
  151. // EXTERNAL MODULE: external ["wp","blocks"]
  152. var external_wp_blocks_ = __webpack_require__("HSyU");
  153. // EXTERNAL MODULE: external ["wp","data"]
  154. var external_wp_data_ = __webpack_require__("1ZqX");
  155. // EXTERNAL MODULE: external ["wp","editor"]
  156. var external_wp_editor_ = __webpack_require__("jSdM");
  157. // EXTERNAL MODULE: external ["wp","dataControls"]
  158. var external_wp_dataControls_ = __webpack_require__("51Zz");
  159. // EXTERNAL MODULE: external "lodash"
  160. var external_lodash_ = __webpack_require__("YLtl");
  161. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/reducer.js
  162. /**
  163. * External dependencies
  164. */
  165. /**
  166. * WordPress dependencies
  167. */
  168. /**
  169. * Reducer returning an array of downloadable blocks.
  170. *
  171. * @param {Object} state Current state.
  172. * @param {Object} action Dispatched action.
  173. *
  174. * @return {Object} Updated state.
  175. */
  176. const downloadableBlocks = (state = {}, action) => {
  177. switch (action.type) {
  178. case 'FETCH_DOWNLOADABLE_BLOCKS':
  179. return { ...state,
  180. [action.filterValue]: {
  181. isRequesting: true
  182. }
  183. };
  184. case 'RECEIVE_DOWNLOADABLE_BLOCKS':
  185. return { ...state,
  186. [action.filterValue]: {
  187. results: action.downloadableBlocks,
  188. isRequesting: false
  189. }
  190. };
  191. }
  192. return state;
  193. };
  194. /**
  195. * Reducer managing the installation and deletion of blocks.
  196. *
  197. * @param {Object} state Current state.
  198. * @param {Object} action Dispatched action.
  199. *
  200. * @return {Object} Updated state.
  201. */
  202. const blockManagement = (state = {
  203. installedBlockTypes: [],
  204. isInstalling: {}
  205. }, action) => {
  206. switch (action.type) {
  207. case 'ADD_INSTALLED_BLOCK_TYPE':
  208. return { ...state,
  209. installedBlockTypes: [...state.installedBlockTypes, action.item]
  210. };
  211. case 'REMOVE_INSTALLED_BLOCK_TYPE':
  212. return { ...state,
  213. installedBlockTypes: state.installedBlockTypes.filter(blockType => blockType.name !== action.item.name)
  214. };
  215. case 'SET_INSTALLING_BLOCK':
  216. return { ...state,
  217. isInstalling: { ...state.isInstalling,
  218. [action.blockId]: action.isInstalling
  219. }
  220. };
  221. }
  222. return state;
  223. };
  224. /**
  225. * Reducer returning an object of error notices.
  226. *
  227. * @param {Object} state Current state.
  228. * @param {Object} action Dispatched action.
  229. *
  230. * @return {Object} Updated state.
  231. */
  232. const errorNotices = (state = {}, action) => {
  233. switch (action.type) {
  234. case 'SET_ERROR_NOTICE':
  235. return { ...state,
  236. [action.blockId]: {
  237. message: action.message,
  238. isFatal: action.isFatal
  239. }
  240. };
  241. case 'CLEAR_ERROR_NOTICE':
  242. return Object(external_lodash_["omit"])(state, action.blockId);
  243. }
  244. return state;
  245. };
  246. /* harmony default export */ var reducer = (Object(external_wp_data_["combineReducers"])({
  247. downloadableBlocks,
  248. blockManagement,
  249. errorNotices
  250. }));
  251. // EXTERNAL MODULE: external ["wp","blockEditor"]
  252. var external_wp_blockEditor_ = __webpack_require__("axFQ");
  253. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/has-block-type.js
  254. /**
  255. * Check if a block list contains a specific block type. Recursively searches
  256. * through `innerBlocks` if they exist.
  257. *
  258. * @param {Object} blockType A block object to search for.
  259. * @param {Object[]} blocks The list of blocks to look through.
  260. *
  261. * @return {boolean} Whether the blockType is found.
  262. */
  263. function hasBlockType(blockType, blocks = []) {
  264. if (!blocks.length) {
  265. return false;
  266. }
  267. if (blocks.some(({
  268. name
  269. }) => name === blockType.name)) {
  270. return true;
  271. }
  272. for (let i = 0; i < blocks.length; i++) {
  273. if (hasBlockType(blockType, blocks[i].innerBlocks)) {
  274. return true;
  275. }
  276. }
  277. return false;
  278. }
  279. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js
  280. /**
  281. * WordPress dependencies
  282. */
  283. /**
  284. * Internal dependencies
  285. */
  286. /**
  287. * Returns true if application is requesting for downloadable blocks.
  288. *
  289. * @param {Object} state Global application state.
  290. * @param {string} filterValue Search string.
  291. *
  292. * @return {boolean} Whether a request is in progress for the blocks list.
  293. */
  294. function selectors_isRequestingDownloadableBlocks(state, filterValue) {
  295. if (!state.downloadableBlocks[filterValue] || !state.downloadableBlocks[filterValue].isRequesting) {
  296. return false;
  297. }
  298. return state.downloadableBlocks[filterValue].isRequesting;
  299. }
  300. /**
  301. * Returns the available uninstalled blocks.
  302. *
  303. * @param {Object} state Global application state.
  304. * @param {string} filterValue Search string.
  305. *
  306. * @return {Array} Downloadable blocks.
  307. */
  308. function selectors_getDownloadableBlocks(state, filterValue) {
  309. if (!state.downloadableBlocks[filterValue] || !state.downloadableBlocks[filterValue].results) {
  310. return [];
  311. }
  312. return state.downloadableBlocks[filterValue].results;
  313. }
  314. /**
  315. * Returns the block types that have been installed on the server in this
  316. * session.
  317. *
  318. * @param {Object} state Global application state.
  319. *
  320. * @return {Array} Block type items
  321. */
  322. function getInstalledBlockTypes(state) {
  323. return state.blockManagement.installedBlockTypes;
  324. }
  325. /**
  326. * Returns block types that have been installed on the server and used in the
  327. * current post.
  328. *
  329. * @param {Object} state Global application state.
  330. *
  331. * @return {Array} Block type items.
  332. */
  333. const getNewBlockTypes = Object(external_wp_data_["createRegistrySelector"])(select => state => {
  334. const usedBlockTree = select(external_wp_blockEditor_["store"]).getBlocks();
  335. const installedBlockTypes = getInstalledBlockTypes(state);
  336. return installedBlockTypes.filter(blockType => hasBlockType(blockType, usedBlockTree));
  337. });
  338. /**
  339. * Returns the block types that have been installed on the server but are not
  340. * used in the current post.
  341. *
  342. * @param {Object} state Global application state.
  343. *
  344. * @return {Array} Block type items.
  345. */
  346. const getUnusedBlockTypes = Object(external_wp_data_["createRegistrySelector"])(select => state => {
  347. const usedBlockTree = select(external_wp_blockEditor_["store"]).getBlocks();
  348. const installedBlockTypes = getInstalledBlockTypes(state);
  349. return installedBlockTypes.filter(blockType => !hasBlockType(blockType, usedBlockTree));
  350. });
  351. /**
  352. * Returns true if a block plugin install is in progress.
  353. *
  354. * @param {Object} state Global application state.
  355. * @param {string} blockId Id of the block.
  356. *
  357. * @return {boolean} Whether this block is currently being installed.
  358. */
  359. function selectors_isInstalling(state, blockId) {
  360. return state.blockManagement.isInstalling[blockId] || false;
  361. }
  362. /**
  363. * Returns all block error notices.
  364. *
  365. * @param {Object} state Global application state.
  366. *
  367. * @return {Object} Object with error notices.
  368. */
  369. function getErrorNotices(state) {
  370. return state.errorNotices;
  371. }
  372. /**
  373. * Returns the error notice for a given block.
  374. *
  375. * @param {Object} state Global application state.
  376. * @param {string} blockId The ID of the block plugin. eg: my-block
  377. *
  378. * @return {string|boolean} The error text, or false if no error.
  379. */
  380. function selectors_getErrorNoticeForBlock(state, blockId) {
  381. return state.errorNotices[blockId];
  382. }
  383. // EXTERNAL MODULE: external ["wp","i18n"]
  384. var external_wp_i18n_ = __webpack_require__("l3Sj");
  385. // EXTERNAL MODULE: external ["wp","notices"]
  386. var external_wp_notices_ = __webpack_require__("onLe");
  387. // EXTERNAL MODULE: external ["wp","apiFetch"]
  388. var external_wp_apiFetch_ = __webpack_require__("ywyh");
  389. var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_);
  390. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/controls.js
  391. /**
  392. * WordPress dependencies
  393. */
  394. /**
  395. * Load an asset for a block.
  396. *
  397. * This function returns a Promise that will resolve once the asset is loaded,
  398. * or in the case of Stylesheets and Inline JavaScript, will resolve immediately.
  399. *
  400. * @param {HTMLElement} el A HTML Element asset to inject.
  401. *
  402. * @return {Promise} Promise which will resolve when the asset is loaded.
  403. */
  404. const loadAsset = el => {
  405. return new Promise((resolve, reject) => {
  406. /*
  407. * Reconstruct the passed element, this is required as inserting the Node directly
  408. * won't always fire the required onload events, even if the asset wasn't already loaded.
  409. */
  410. const newNode = document.createElement(el.nodeName);
  411. ['id', 'rel', 'src', 'href', 'type'].forEach(attr => {
  412. if (el[attr]) {
  413. newNode[attr] = el[attr];
  414. }
  415. }); // Append inline <script> contents.
  416. if (el.innerHTML) {
  417. newNode.appendChild(document.createTextNode(el.innerHTML));
  418. }
  419. newNode.onload = () => resolve(true);
  420. newNode.onerror = () => reject(new Error('Error loading asset.'));
  421. document.body.appendChild(newNode); // Resolve Stylesheets and Inline JavaScript immediately.
  422. if ('link' === newNode.nodeName.toLowerCase() || 'script' === newNode.nodeName.toLowerCase() && !newNode.src) {
  423. resolve();
  424. }
  425. });
  426. };
  427. /**
  428. * Load the asset files for a block
  429. *
  430. * @param {Array} assets A collection of URLs for the assets.
  431. *
  432. * @return {Object} Control descriptor.
  433. */
  434. function loadAssets(assets) {
  435. return {
  436. type: 'LOAD_ASSETS',
  437. assets
  438. };
  439. }
  440. const controls = {
  441. async LOAD_ASSETS() {
  442. /*
  443. * Fetch the current URL (post-new.php, or post.php?post=1&action=edit) and compare the
  444. * JavaScript and CSS assets loaded between the pages. This imports the required assets
  445. * for the block into the current page while not requiring that we know them up-front.
  446. * In the future this can be improved by reliance upon block.json and/or a script-loader
  447. * dependency API.
  448. */
  449. const response = await external_wp_apiFetch_default()({
  450. url: document.location.href,
  451. parse: false
  452. });
  453. const data = await response.text();
  454. const doc = new window.DOMParser().parseFromString(data, 'text/html');
  455. const newAssets = Array.from(doc.querySelectorAll('link[rel="stylesheet"],script')).filter(asset => asset.id && !document.getElementById(asset.id));
  456. /*
  457. * Load each asset in order, as they may depend upon an earlier loaded script.
  458. * Stylesheets and Inline Scripts will resolve immediately upon insertion.
  459. */
  460. for (const newAsset of newAssets) {
  461. await loadAsset(newAsset);
  462. }
  463. }
  464. };
  465. /* harmony default export */ var store_controls = (controls);
  466. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/get-plugin-url.js
  467. /**
  468. * Get the plugin's direct API link out of a block-directory response.
  469. *
  470. * @param {Object} block The block object
  471. *
  472. * @return {string} The plugin URL, if exists.
  473. */
  474. function getPluginUrl(block) {
  475. if (!block) {
  476. return false;
  477. }
  478. const link = block.links['wp:plugin'] || block.links.self;
  479. if (link && link.length) {
  480. return link[0].href;
  481. }
  482. return false;
  483. }
  484. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/actions.js
  485. /**
  486. * WordPress dependencies
  487. */
  488. /**
  489. * Internal dependencies
  490. */
  491. /**
  492. * Returns an action object used in signalling that the downloadable blocks
  493. * have been requested and are loading.
  494. *
  495. * @param {string} filterValue Search string.
  496. *
  497. * @return {Object} Action object.
  498. */
  499. function fetchDownloadableBlocks(filterValue) {
  500. return {
  501. type: 'FETCH_DOWNLOADABLE_BLOCKS',
  502. filterValue
  503. };
  504. }
  505. /**
  506. * Returns an action object used in signalling that the downloadable blocks
  507. * have been updated.
  508. *
  509. * @param {Array} downloadableBlocks Downloadable blocks.
  510. * @param {string} filterValue Search string.
  511. *
  512. * @return {Object} Action object.
  513. */
  514. function receiveDownloadableBlocks(downloadableBlocks, filterValue) {
  515. return {
  516. type: 'RECEIVE_DOWNLOADABLE_BLOCKS',
  517. downloadableBlocks,
  518. filterValue
  519. };
  520. }
  521. /**
  522. * Action triggered to install a block plugin.
  523. *
  524. * @param {Object} block The block item returned by search.
  525. *
  526. * @return {boolean} Whether the block was successfully installed & loaded.
  527. */
  528. function* actions_installBlockType(block) {
  529. const {
  530. id,
  531. assets
  532. } = block;
  533. let success = false;
  534. yield clearErrorNotice(id);
  535. try {
  536. yield setIsInstalling(block.id, true); // If we have a wp:plugin link, the plugin is installed but inactive.
  537. const url = getPluginUrl(block);
  538. let links = {};
  539. if (url) {
  540. yield Object(external_wp_dataControls_["apiFetch"])({
  541. url,
  542. data: {
  543. status: 'active'
  544. },
  545. method: 'PUT'
  546. });
  547. } else {
  548. const response = yield Object(external_wp_dataControls_["apiFetch"])({
  549. path: 'wp/v2/plugins',
  550. data: {
  551. slug: block.id,
  552. status: 'active'
  553. },
  554. method: 'POST'
  555. }); // Add the `self` link for newly-installed blocks.
  556. links = response._links;
  557. }
  558. yield addInstalledBlockType({ ...block,
  559. links: { ...block.links,
  560. ...links
  561. }
  562. });
  563. yield loadAssets(assets);
  564. const registeredBlocks = yield external_wp_data_["controls"].select(external_wp_blocks_["store"].name, 'getBlockTypes');
  565. if (!registeredBlocks.some(i => i.name === block.name)) {
  566. throw new Error(Object(external_wp_i18n_["__"])('Error registering block. Try reloading the page.'));
  567. }
  568. yield external_wp_data_["controls"].dispatch(external_wp_notices_["store"], 'createInfoNotice', Object(external_wp_i18n_["sprintf"])( // translators: %s is the block title.
  569. Object(external_wp_i18n_["__"])('Block %s installed and added.'), block.title), {
  570. speak: true,
  571. type: 'snackbar'
  572. });
  573. success = true;
  574. } catch (error) {
  575. let message = error.message || Object(external_wp_i18n_["__"])('An error occurred.'); // Errors we throw are fatal
  576. let isFatal = error instanceof Error; // Specific API errors that are fatal
  577. const fatalAPIErrors = {
  578. folder_exists: Object(external_wp_i18n_["__"])('This block is already installed. Try reloading the page.'),
  579. unable_to_connect_to_filesystem: Object(external_wp_i18n_["__"])('Error installing block. You can reload the page and try again.')
  580. };
  581. if (fatalAPIErrors[error.code]) {
  582. isFatal = true;
  583. message = fatalAPIErrors[error.code];
  584. }
  585. yield setErrorNotice(id, message, isFatal);
  586. yield external_wp_data_["controls"].dispatch(external_wp_notices_["store"], 'createErrorNotice', message, {
  587. speak: true,
  588. isDismissible: true
  589. });
  590. }
  591. yield setIsInstalling(block.id, false);
  592. return success;
  593. }
  594. /**
  595. * Action triggered to uninstall a block plugin.
  596. *
  597. * @param {Object} block The blockType object.
  598. */
  599. function* actions_uninstallBlockType(block) {
  600. try {
  601. yield Object(external_wp_dataControls_["apiFetch"])({
  602. url: getPluginUrl(block),
  603. data: {
  604. status: 'inactive'
  605. },
  606. method: 'PUT'
  607. });
  608. yield Object(external_wp_dataControls_["apiFetch"])({
  609. url: getPluginUrl(block),
  610. method: 'DELETE'
  611. });
  612. yield removeInstalledBlockType(block);
  613. } catch (error) {
  614. yield external_wp_data_["controls"].dispatch(external_wp_notices_["store"], 'createErrorNotice', error.message || Object(external_wp_i18n_["__"])('An error occurred.'));
  615. }
  616. }
  617. /**
  618. * Returns an action object used to add a block type to the "newly installed"
  619. * tracking list.
  620. *
  621. * @param {Object} item The block item with the block id and name.
  622. *
  623. * @return {Object} Action object.
  624. */
  625. function addInstalledBlockType(item) {
  626. return {
  627. type: 'ADD_INSTALLED_BLOCK_TYPE',
  628. item
  629. };
  630. }
  631. /**
  632. * Returns an action object used to remove a block type from the "newly installed"
  633. * tracking list.
  634. *
  635. * @param {string} item The block item with the block id and name.
  636. *
  637. * @return {Object} Action object.
  638. */
  639. function removeInstalledBlockType(item) {
  640. return {
  641. type: 'REMOVE_INSTALLED_BLOCK_TYPE',
  642. item
  643. };
  644. }
  645. /**
  646. * Returns an action object used to indicate install in progress.
  647. *
  648. * @param {string} blockId
  649. * @param {boolean} isInstalling
  650. *
  651. * @return {Object} Action object.
  652. */
  653. function setIsInstalling(blockId, isInstalling) {
  654. return {
  655. type: 'SET_INSTALLING_BLOCK',
  656. blockId,
  657. isInstalling
  658. };
  659. }
  660. /**
  661. * Sets an error notice to be displayed to the user for a given block.
  662. *
  663. * @param {string} blockId The ID of the block plugin. eg: my-block
  664. * @param {string} message The message shown in the notice.
  665. * @param {boolean} isFatal Whether the user can recover from the error.
  666. *
  667. * @return {Object} Action object.
  668. */
  669. function setErrorNotice(blockId, message, isFatal = false) {
  670. return {
  671. type: 'SET_ERROR_NOTICE',
  672. blockId,
  673. message,
  674. isFatal
  675. };
  676. }
  677. /**
  678. * Sets the error notice to empty for specific block.
  679. *
  680. * @param {string} blockId The ID of the block plugin. eg: my-block
  681. *
  682. * @return {Object} Action object.
  683. */
  684. function clearErrorNotice(blockId) {
  685. return {
  686. type: 'CLEAR_ERROR_NOTICE',
  687. blockId
  688. };
  689. }
  690. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/resolvers.js
  691. /**
  692. * External dependencies
  693. */
  694. /**
  695. * WordPress dependencies
  696. */
  697. /**
  698. * Internal dependencies
  699. */
  700. /* harmony default export */ var resolvers = ({
  701. *getDownloadableBlocks(filterValue) {
  702. if (!filterValue) {
  703. return;
  704. }
  705. try {
  706. yield fetchDownloadableBlocks(filterValue);
  707. const results = yield Object(external_wp_dataControls_["apiFetch"])({
  708. path: `wp/v2/block-directory/search?term=${filterValue}`
  709. });
  710. const blocks = results.map(result => Object(external_lodash_["mapKeys"])(result, (value, key) => {
  711. return Object(external_lodash_["camelCase"])(key);
  712. }));
  713. yield receiveDownloadableBlocks(blocks, filterValue);
  714. } catch (error) {}
  715. }
  716. });
  717. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/index.js
  718. /**
  719. * WordPress dependencies
  720. */
  721. /**
  722. * Internal dependencies
  723. */
  724. /**
  725. * Module Constants
  726. */
  727. const STORE_NAME = 'core/block-directory';
  728. /**
  729. * Block editor data store configuration.
  730. *
  731. * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore
  732. *
  733. * @type {Object}
  734. */
  735. const storeConfig = {
  736. reducer: reducer,
  737. selectors: selectors_namespaceObject,
  738. actions: actions_namespaceObject,
  739. controls: { ...external_wp_dataControls_["controls"],
  740. ...store_controls
  741. },
  742. resolvers: resolvers
  743. };
  744. /**
  745. * Store definition for the block directory namespace.
  746. *
  747. * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
  748. *
  749. * @type {Object}
  750. */
  751. const store = Object(external_wp_data_["createReduxStore"])(STORE_NAME, storeConfig);
  752. Object(external_wp_data_["register"])(store);
  753. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/auto-block-uninstaller/index.js
  754. /**
  755. * WordPress dependencies
  756. */
  757. /**
  758. * Internal dependencies
  759. */
  760. function AutoBlockUninstaller() {
  761. const {
  762. uninstallBlockType
  763. } = Object(external_wp_data_["useDispatch"])(store);
  764. const shouldRemoveBlockTypes = Object(external_wp_data_["useSelect"])(select => {
  765. const {
  766. isAutosavingPost,
  767. isSavingPost
  768. } = select(external_wp_editor_["store"]);
  769. return isSavingPost() && !isAutosavingPost();
  770. }, []);
  771. const unusedBlockTypes = Object(external_wp_data_["useSelect"])(select => select(store).getUnusedBlockTypes(), []);
  772. Object(external_wp_element_["useEffect"])(() => {
  773. if (shouldRemoveBlockTypes && unusedBlockTypes.length) {
  774. unusedBlockTypes.forEach(blockType => {
  775. uninstallBlockType(blockType);
  776. Object(external_wp_blocks_["unregisterBlockType"])(blockType.name);
  777. });
  778. }
  779. }, [shouldRemoveBlockTypes]);
  780. return null;
  781. }
  782. // EXTERNAL MODULE: external ["wp","components"]
  783. var external_wp_components_ = __webpack_require__("tI+e");
  784. // EXTERNAL MODULE: external ["wp","compose"]
  785. var external_wp_compose_ = __webpack_require__("K9lf");
  786. // EXTERNAL MODULE: external ["wp","coreData"]
  787. var external_wp_coreData_ = __webpack_require__("jZUy");
  788. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
  789. var esm_extends = __webpack_require__("wx14");
  790. // EXTERNAL MODULE: external ["wp","htmlEntities"]
  791. var external_wp_htmlEntities_ = __webpack_require__("rmEH");
  792. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
  793. var build_module_icon = __webpack_require__("iClF");
  794. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js
  795. var star_filled = __webpack_require__("URob");
  796. // EXTERNAL MODULE: external ["wp","primitives"]
  797. var external_wp_primitives_ = __webpack_require__("Tqx9");
  798. // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-half.js
  799. /**
  800. * WordPress dependencies
  801. */
  802. const starHalf = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
  803. xmlns: "http://www.w3.org/2000/svg",
  804. viewBox: "0 0 24 24"
  805. }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
  806. d: "M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z"
  807. }));
  808. /* harmony default export */ var star_half = (starHalf);
  809. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js
  810. var star_empty = __webpack_require__("Xxwi");
  811. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/block-ratings/stars.js
  812. /**
  813. * External dependencies
  814. */
  815. /**
  816. * WordPress dependencies
  817. */
  818. function Stars({
  819. rating
  820. }) {
  821. const stars = Math.round(rating / 0.5) * 0.5;
  822. const fullStarCount = Math.floor(rating);
  823. const halfStarCount = Math.ceil(rating - fullStarCount);
  824. const emptyStarCount = 5 - (fullStarCount + halfStarCount);
  825. return Object(external_wp_element_["createElement"])("span", {
  826. "aria-label": Object(external_wp_i18n_["sprintf"])(
  827. /* translators: %s: number of stars. */
  828. Object(external_wp_i18n_["__"])('%s out of 5 stars'), stars)
  829. }, Object(external_lodash_["times"])(fullStarCount, i => Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
  830. key: `full_stars_${i}`,
  831. className: "block-directory-block-ratings__star-full",
  832. icon: star_filled["a" /* default */],
  833. size: 16
  834. })), Object(external_lodash_["times"])(halfStarCount, i => Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
  835. key: `half_stars_${i}`,
  836. className: "block-directory-block-ratings__star-half-full",
  837. icon: star_half,
  838. size: 16
  839. })), Object(external_lodash_["times"])(emptyStarCount, i => Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
  840. key: `empty_stars_${i}`,
  841. className: "block-directory-block-ratings__star-empty",
  842. icon: star_empty["a" /* default */],
  843. size: 16
  844. })));
  845. }
  846. /* harmony default export */ var block_ratings_stars = (Stars);
  847. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/block-ratings/index.js
  848. /**
  849. * Internal dependencies
  850. */
  851. const BlockRatings = ({
  852. rating
  853. }) => Object(external_wp_element_["createElement"])("span", {
  854. className: "block-directory-block-ratings"
  855. }, Object(external_wp_element_["createElement"])(block_ratings_stars, {
  856. rating: rating
  857. }));
  858. /* harmony default export */ var block_ratings = (BlockRatings);
  859. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-icon/index.js
  860. /**
  861. * WordPress dependencies
  862. */
  863. function DownloadableBlockIcon({
  864. icon
  865. }) {
  866. const className = 'block-directory-downloadable-block-icon';
  867. return icon.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/) !== null ? Object(external_wp_element_["createElement"])("img", {
  868. className: className,
  869. src: icon,
  870. alt: ""
  871. }) : Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockIcon"], {
  872. className: className,
  873. icon: icon,
  874. showColors: true
  875. });
  876. }
  877. /* harmony default export */ var downloadable_block_icon = (DownloadableBlockIcon);
  878. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-notice/index.js
  879. /**
  880. * WordPress dependencies
  881. */
  882. /**
  883. * Internal dependencies
  884. */
  885. const DownloadableBlockNotice = ({
  886. block
  887. }) => {
  888. const errorNotice = Object(external_wp_data_["useSelect"])(select => select(store).getErrorNoticeForBlock(block.id), [block]);
  889. if (!errorNotice) {
  890. return null;
  891. }
  892. return Object(external_wp_element_["createElement"])("div", {
  893. className: "block-directory-downloadable-block-notice"
  894. }, Object(external_wp_element_["createElement"])("div", {
  895. className: "block-directory-downloadable-block-notice__content"
  896. }, errorNotice.message, errorNotice.isFatal ? ' ' + Object(external_wp_i18n_["__"])('Try reloading the page.') : null));
  897. };
  898. /* harmony default export */ var downloadable_block_notice = (DownloadableBlockNotice);
  899. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-list-item/index.js
  900. /**
  901. * WordPress dependencies
  902. */
  903. /**
  904. * Internal dependencies
  905. */
  906. // Return the appropriate block item label, given the block data and status.
  907. function getDownloadableBlockLabel({
  908. title,
  909. rating,
  910. ratingCount
  911. }, {
  912. hasNotice,
  913. isInstalled,
  914. isInstalling
  915. }) {
  916. const stars = Math.round(rating / 0.5) * 0.5;
  917. if (!isInstalled && hasNotice) {
  918. /* translators: %1$s: block title */
  919. return Object(external_wp_i18n_["sprintf"])('Retry installing %s.', Object(external_wp_htmlEntities_["decodeEntities"])(title));
  920. }
  921. if (isInstalled) {
  922. /* translators: %1$s: block title */
  923. return Object(external_wp_i18n_["sprintf"])('Add %s.', Object(external_wp_htmlEntities_["decodeEntities"])(title));
  924. }
  925. if (isInstalling) {
  926. /* translators: %1$s: block title */
  927. return Object(external_wp_i18n_["sprintf"])('Installing %s.', Object(external_wp_htmlEntities_["decodeEntities"])(title));
  928. } // No ratings yet, just use the title.
  929. if (ratingCount < 1) {
  930. /* translators: %1$s: block title */
  931. return Object(external_wp_i18n_["sprintf"])('Install %s.', Object(external_wp_htmlEntities_["decodeEntities"])(title));
  932. }
  933. return Object(external_wp_i18n_["sprintf"])(
  934. /* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */
  935. Object(external_wp_i18n_["_n"])('Install %1$s. %2$s stars with %3$s review.', 'Install %1$s. %2$s stars with %3$s reviews.', ratingCount), Object(external_wp_htmlEntities_["decodeEntities"])(title), stars, ratingCount);
  936. }
  937. function DownloadableBlockListItem({
  938. composite,
  939. item,
  940. onClick
  941. }) {
  942. const {
  943. author,
  944. description,
  945. icon,
  946. rating,
  947. title
  948. } = item; // getBlockType returns a block object if this block exists, or null if not.
  949. const isInstalled = !!Object(external_wp_blocks_["getBlockType"])(item.name);
  950. const {
  951. hasNotice,
  952. isInstalling,
  953. isInstallable
  954. } = Object(external_wp_data_["useSelect"])(select => {
  955. const {
  956. getErrorNoticeForBlock,
  957. isInstalling: isBlockInstalling
  958. } = select(store);
  959. const notice = getErrorNoticeForBlock(item.id);
  960. const hasFatal = notice && notice.isFatal;
  961. return {
  962. hasNotice: !!notice,
  963. isInstalling: isBlockInstalling(item.id),
  964. isInstallable: !hasFatal
  965. };
  966. }, [item]);
  967. let statusText = '';
  968. if (isInstalled) {
  969. statusText = Object(external_wp_i18n_["__"])('Installed!');
  970. } else if (isInstalling) {
  971. statusText = Object(external_wp_i18n_["__"])('Installing…');
  972. }
  973. return Object(external_wp_element_["createElement"])(external_wp_components_["__unstableCompositeItem"], Object(esm_extends["a" /* default */])({
  974. role: "option",
  975. as: external_wp_components_["Button"]
  976. }, composite, {
  977. className: "block-directory-downloadable-block-list-item",
  978. onClick: event => {
  979. event.preventDefault();
  980. onClick();
  981. },
  982. isBusy: isInstalling,
  983. disabled: isInstalling || !isInstallable,
  984. label: getDownloadableBlockLabel(item, {
  985. hasNotice,
  986. isInstalled,
  987. isInstalling
  988. }),
  989. showTooltip: true,
  990. tooltipPosition: "top center"
  991. }), Object(external_wp_element_["createElement"])("div", {
  992. className: "block-directory-downloadable-block-list-item__icon"
  993. }, Object(external_wp_element_["createElement"])(downloadable_block_icon, {
  994. icon: icon,
  995. title: title
  996. }), isInstalling ? Object(external_wp_element_["createElement"])("span", {
  997. className: "block-directory-downloadable-block-list-item__spinner"
  998. }, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null)) : Object(external_wp_element_["createElement"])(block_ratings, {
  999. rating: rating
  1000. })), Object(external_wp_element_["createElement"])("span", {
  1001. className: "block-directory-downloadable-block-list-item__details"
  1002. }, Object(external_wp_element_["createElement"])("span", {
  1003. className: "block-directory-downloadable-block-list-item__title"
  1004. }, Object(external_wp_element_["createInterpolateElement"])(Object(external_wp_i18n_["sprintf"])(
  1005. /* translators: %1$s: block title, %2$s: author name. */
  1006. Object(external_wp_i18n_["__"])('%1$s <span>by %2$s</span>'), Object(external_wp_htmlEntities_["decodeEntities"])(title), author), {
  1007. span: Object(external_wp_element_["createElement"])("span", {
  1008. className: "block-directory-downloadable-block-list-item__author"
  1009. })
  1010. })), hasNotice ? Object(external_wp_element_["createElement"])(downloadable_block_notice, {
  1011. block: item
  1012. }) : Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("span", {
  1013. className: "block-directory-downloadable-block-list-item__desc"
  1014. }, !!statusText ? statusText : Object(external_wp_htmlEntities_["decodeEntities"])(description)), isInstallable && !(isInstalled || isInstalling) && Object(external_wp_element_["createElement"])(external_wp_components_["VisuallyHidden"], null, Object(external_wp_i18n_["__"])('Install block')))));
  1015. }
  1016. /* harmony default export */ var downloadable_block_list_item = (DownloadableBlockListItem);
  1017. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-list/index.js
  1018. /**
  1019. * External dependencies
  1020. */
  1021. /**
  1022. * WordPress dependencies
  1023. */
  1024. /**
  1025. * Internal dependencies
  1026. */
  1027. function DownloadableBlocksList({
  1028. items,
  1029. onHover = external_lodash_["noop"],
  1030. onSelect
  1031. }) {
  1032. const composite = Object(external_wp_components_["__unstableUseCompositeState"])();
  1033. const {
  1034. installBlockType
  1035. } = Object(external_wp_data_["useDispatch"])(store);
  1036. if (!items.length) {
  1037. return null;
  1038. }
  1039. return Object(external_wp_element_["createElement"])(external_wp_components_["__unstableComposite"], Object(esm_extends["a" /* default */])({}, composite, {
  1040. role: "listbox",
  1041. className: "block-directory-downloadable-blocks-list",
  1042. "aria-label": Object(external_wp_i18n_["__"])('Blocks available for install')
  1043. }), items.map(item => {
  1044. return Object(external_wp_element_["createElement"])(downloadable_block_list_item, {
  1045. key: item.id,
  1046. composite: composite,
  1047. onClick: () => {
  1048. // Check if the block is registered (`getBlockType`
  1049. // will return an object). If so, insert the block.
  1050. // This prevents installing existing plugins.
  1051. if (Object(external_wp_blocks_["getBlockType"])(item.name)) {
  1052. onSelect(item);
  1053. } else {
  1054. installBlockType(item).then(success => {
  1055. if (success) {
  1056. onSelect(item);
  1057. }
  1058. });
  1059. }
  1060. onHover(null);
  1061. },
  1062. onHover: onHover,
  1063. item: item
  1064. });
  1065. }));
  1066. }
  1067. /* harmony default export */ var downloadable_blocks_list = (DownloadableBlocksList);
  1068. // EXTERNAL MODULE: external ["wp","a11y"]
  1069. var external_wp_a11y_ = __webpack_require__("gdqT");
  1070. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/inserter-panel.js
  1071. /**
  1072. * WordPress dependencies
  1073. */
  1074. function DownloadableBlocksInserterPanel({
  1075. children,
  1076. downloadableItems,
  1077. hasLocalBlocks
  1078. }) {
  1079. const count = downloadableItems.length;
  1080. Object(external_wp_element_["useEffect"])(() => {
  1081. Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["sprintf"])(
  1082. /* translators: %d: number of available blocks. */
  1083. Object(external_wp_i18n_["_n"])('%d additional block is available to install.', '%d additional blocks are available to install.', count), count));
  1084. }, [count]);
  1085. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, !hasLocalBlocks && Object(external_wp_element_["createElement"])("p", {
  1086. className: "block-directory-downloadable-blocks-panel__no-local"
  1087. }, Object(external_wp_i18n_["__"])('No results available from your installed blocks.')), Object(external_wp_element_["createElement"])("div", {
  1088. className: "block-editor-inserter__quick-inserter-separator"
  1089. }), Object(external_wp_element_["createElement"])("div", {
  1090. className: "block-directory-downloadable-blocks-panel"
  1091. }, Object(external_wp_element_["createElement"])("div", {
  1092. className: "block-directory-downloadable-blocks-panel__header"
  1093. }, Object(external_wp_element_["createElement"])("h2", {
  1094. className: "block-directory-downloadable-blocks-panel__title"
  1095. }, Object(external_wp_i18n_["__"])('Available to install')), Object(external_wp_element_["createElement"])("p", {
  1096. className: "block-directory-downloadable-blocks-panel__description"
  1097. }, Object(external_wp_i18n_["__"])('Select a block to install and add it to your post.'))), children));
  1098. }
  1099. /* harmony default export */ var inserter_panel = (DownloadableBlocksInserterPanel);
  1100. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js
  1101. var block_default = __webpack_require__("//Lo");
  1102. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/no-results.js
  1103. /**
  1104. * WordPress dependencies
  1105. */
  1106. function DownloadableBlocksNoResults() {
  1107. return Object(external_wp_element_["createElement"])("div", {
  1108. className: "block-editor-inserter__no-results"
  1109. }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
  1110. className: "block-editor-inserter__no-results-icon",
  1111. icon: block_default["a" /* default */]
  1112. }), Object(external_wp_element_["createElement"])("p", null, Object(external_wp_i18n_["__"])('No results found.')));
  1113. }
  1114. /* harmony default export */ var no_results = (DownloadableBlocksNoResults);
  1115. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/index.js
  1116. /**
  1117. * WordPress dependencies
  1118. */
  1119. /**
  1120. * Internal dependencies
  1121. */
  1122. function DownloadableBlocksPanel({
  1123. downloadableItems,
  1124. onSelect,
  1125. onHover,
  1126. hasLocalBlocks,
  1127. hasPermission,
  1128. isLoading,
  1129. isTyping
  1130. }) {
  1131. if (typeof hasPermission === 'undefined' || isLoading || isTyping) {
  1132. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, hasPermission && !hasLocalBlocks && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("p", {
  1133. className: "block-directory-downloadable-blocks-panel__no-local"
  1134. }, Object(external_wp_i18n_["__"])('No results available from your installed blocks.')), Object(external_wp_element_["createElement"])("div", {
  1135. className: "block-editor-inserter__quick-inserter-separator"
  1136. })), Object(external_wp_element_["createElement"])("div", {
  1137. className: "block-directory-downloadable-blocks-panel has-blocks-loading"
  1138. }, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null)));
  1139. }
  1140. if (false === hasPermission) {
  1141. if (!hasLocalBlocks) {
  1142. return Object(external_wp_element_["createElement"])(no_results, null);
  1143. }
  1144. return null;
  1145. }
  1146. return !!downloadableItems.length ? Object(external_wp_element_["createElement"])(inserter_panel, {
  1147. downloadableItems: downloadableItems,
  1148. hasLocalBlocks: hasLocalBlocks
  1149. }, Object(external_wp_element_["createElement"])(downloadable_blocks_list, {
  1150. items: downloadableItems,
  1151. onSelect: onSelect,
  1152. onHover: onHover
  1153. })) : !hasLocalBlocks && Object(external_wp_element_["createElement"])(no_results, null);
  1154. }
  1155. /* harmony default export */ var downloadable_blocks_panel = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])((select, {
  1156. filterValue,
  1157. rootClientId = null
  1158. }) => {
  1159. const {
  1160. getDownloadableBlocks,
  1161. isRequestingDownloadableBlocks
  1162. } = select(store);
  1163. const {
  1164. canInsertBlockType
  1165. } = select(external_wp_blockEditor_["store"]);
  1166. const hasPermission = select(external_wp_coreData_["store"]).canUser('read', 'block-directory/search');
  1167. function getInstallableBlocks(term) {
  1168. return getDownloadableBlocks(term).filter(block => canInsertBlockType(block, rootClientId, true));
  1169. }
  1170. const downloadableItems = hasPermission ? getInstallableBlocks(filterValue) : [];
  1171. const isLoading = isRequestingDownloadableBlocks(filterValue);
  1172. return {
  1173. downloadableItems,
  1174. hasPermission,
  1175. isLoading
  1176. };
  1177. })])(DownloadableBlocksPanel));
  1178. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.js
  1179. /**
  1180. * External dependencies
  1181. */
  1182. /**
  1183. * WordPress dependencies
  1184. */
  1185. /**
  1186. * Internal dependencies
  1187. */
  1188. function InserterMenuDownloadableBlocksPanel() {
  1189. const [debouncedFilterValue, setFilterValue] = Object(external_wp_element_["useState"])('');
  1190. const debouncedSetFilterValue = Object(external_lodash_["debounce"])(setFilterValue, 400);
  1191. return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableInserterMenuExtension"], null, ({
  1192. onSelect,
  1193. onHover,
  1194. filterValue,
  1195. hasItems,
  1196. rootClientId
  1197. }) => {
  1198. if (debouncedFilterValue !== filterValue) {
  1199. debouncedSetFilterValue(filterValue);
  1200. }
  1201. if (!debouncedFilterValue) {
  1202. return null;
  1203. }
  1204. return Object(external_wp_element_["createElement"])(downloadable_blocks_panel, {
  1205. onSelect: onSelect,
  1206. onHover: onHover,
  1207. rootClientId: rootClientId,
  1208. filterValue: debouncedFilterValue,
  1209. hasLocalBlocks: hasItems,
  1210. isTyping: filterValue !== debouncedFilterValue
  1211. });
  1212. });
  1213. }
  1214. /* harmony default export */ var inserter_menu_downloadable_blocks_panel = (InserterMenuDownloadableBlocksPanel);
  1215. // EXTERNAL MODULE: external ["wp","editPost"]
  1216. var external_wp_editPost_ = __webpack_require__("BLhE");
  1217. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/compact-list/index.js
  1218. /**
  1219. * WordPress dependencies
  1220. */
  1221. /**
  1222. * Internal dependencies
  1223. */
  1224. function CompactList({
  1225. items
  1226. }) {
  1227. if (!items.length) {
  1228. return null;
  1229. }
  1230. return Object(external_wp_element_["createElement"])("ul", {
  1231. className: "block-directory-compact-list"
  1232. }, items.map(({
  1233. icon,
  1234. id,
  1235. title,
  1236. author
  1237. }) => Object(external_wp_element_["createElement"])("li", {
  1238. key: id,
  1239. className: "block-directory-compact-list__item"
  1240. }, Object(external_wp_element_["createElement"])(downloadable_block_icon, {
  1241. icon: icon,
  1242. title: title
  1243. }), Object(external_wp_element_["createElement"])("div", {
  1244. className: "block-directory-compact-list__item-details"
  1245. }, Object(external_wp_element_["createElement"])("div", {
  1246. className: "block-directory-compact-list__item-title"
  1247. }, title), Object(external_wp_element_["createElement"])("div", {
  1248. className: "block-directory-compact-list__item-author"
  1249. }, Object(external_wp_i18n_["sprintf"])(
  1250. /* translators: %s: Name of the block author. */
  1251. Object(external_wp_i18n_["__"])('By %s'), author))))));
  1252. }
  1253. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/index.js
  1254. /**
  1255. * WordPress dependencies
  1256. */
  1257. /**
  1258. * Internal dependencies
  1259. */
  1260. function InstalledBlocksPrePublishPanel() {
  1261. const newBlockTypes = Object(external_wp_data_["useSelect"])(select => select(store).getNewBlockTypes(), []);
  1262. if (!newBlockTypes.length) {
  1263. return null;
  1264. }
  1265. return Object(external_wp_element_["createElement"])(external_wp_editPost_["PluginPrePublishPanel"], {
  1266. icon: block_default["a" /* default */],
  1267. title: Object(external_wp_i18n_["sprintf"])( // translators: %d: number of blocks (number).
  1268. Object(external_wp_i18n_["_n"])('Added: %d block', 'Added: %d blocks', newBlockTypes.length), newBlockTypes.length),
  1269. initialOpen: true
  1270. }, Object(external_wp_element_["createElement"])("p", {
  1271. className: "installed-blocks-pre-publish-panel__copy"
  1272. }, Object(external_wp_i18n_["_n"])('The following block has been added to your site.', 'The following blocks have been added to your site.', newBlockTypes.length)), Object(external_wp_element_["createElement"])(CompactList, {
  1273. items: newBlockTypes
  1274. }));
  1275. }
  1276. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/get-install-missing/install-button.js
  1277. /**
  1278. * WordPress dependencies
  1279. */
  1280. /**
  1281. * Internal dependencies
  1282. */
  1283. function InstallButton({
  1284. attributes,
  1285. block,
  1286. clientId
  1287. }) {
  1288. const isInstallingBlock = Object(external_wp_data_["useSelect"])(select => select(store).isInstalling(block.id));
  1289. const {
  1290. installBlockType
  1291. } = Object(external_wp_data_["useDispatch"])(store);
  1292. const {
  1293. replaceBlock
  1294. } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
  1295. return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  1296. onClick: () => installBlockType(block).then(success => {
  1297. if (success) {
  1298. const blockType = Object(external_wp_blocks_["getBlockType"])(block.name);
  1299. const [originalBlock] = Object(external_wp_blocks_["parse"])(attributes.originalContent);
  1300. if (originalBlock) {
  1301. replaceBlock(clientId, Object(external_wp_blocks_["createBlock"])(blockType.name, originalBlock.attributes, originalBlock.innerBlocks));
  1302. }
  1303. }
  1304. }),
  1305. disabled: isInstallingBlock,
  1306. isBusy: isInstallingBlock,
  1307. isPrimary: true
  1308. }, Object(external_wp_i18n_["sprintf"])(
  1309. /* translators: %s: block name */
  1310. Object(external_wp_i18n_["__"])('Install %s'), block.title));
  1311. }
  1312. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/get-install-missing/index.js
  1313. /**
  1314. * WordPress dependencies
  1315. */
  1316. /**
  1317. * Internal dependencies
  1318. */
  1319. const getInstallMissing = OriginalComponent => props => {
  1320. const {
  1321. originalName
  1322. } = props.attributes; // Disable reason: This is a valid component, but it's mistaken for a callback.
  1323. // eslint-disable-next-line react-hooks/rules-of-hooks
  1324. const {
  1325. block,
  1326. hasPermission
  1327. } = Object(external_wp_data_["useSelect"])(select => {
  1328. const {
  1329. getDownloadableBlocks
  1330. } = select(store);
  1331. const blocks = getDownloadableBlocks('block:' + originalName).filter(({
  1332. name
  1333. }) => originalName === name);
  1334. return {
  1335. hasPermission: select(external_wp_coreData_["store"]).canUser('read', 'block-directory/search'),
  1336. block: blocks.length && blocks[0]
  1337. };
  1338. }, [originalName]); // The user can't install blocks, or the block isn't available for download.
  1339. if (!hasPermission || !block) {
  1340. return Object(external_wp_element_["createElement"])(OriginalComponent, props);
  1341. }
  1342. return Object(external_wp_element_["createElement"])(ModifiedWarning, Object(esm_extends["a" /* default */])({}, props, {
  1343. originalBlock: block
  1344. }));
  1345. };
  1346. const ModifiedWarning = ({
  1347. originalBlock,
  1348. ...props
  1349. }) => {
  1350. const {
  1351. originalName,
  1352. originalUndelimitedContent
  1353. } = props.attributes;
  1354. const {
  1355. replaceBlock
  1356. } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
  1357. const convertToHTML = () => {
  1358. replaceBlock(props.clientId, Object(external_wp_blocks_["createBlock"])('core/html', {
  1359. content: originalUndelimitedContent
  1360. }));
  1361. };
  1362. const hasContent = !!originalUndelimitedContent;
  1363. const hasHTMLBlock = Object(external_wp_blocks_["getBlockType"])('core/html');
  1364. let messageHTML = Object(external_wp_i18n_["sprintf"])(
  1365. /* translators: %s: block name */
  1366. Object(external_wp_i18n_["__"])('Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'), originalBlock.title || originalName);
  1367. const actions = [Object(external_wp_element_["createElement"])(InstallButton, {
  1368. key: "install",
  1369. block: originalBlock,
  1370. attributes: props.attributes,
  1371. clientId: props.clientId
  1372. })];
  1373. if (hasContent && hasHTMLBlock) {
  1374. messageHTML = Object(external_wp_i18n_["sprintf"])(
  1375. /* translators: %s: block name */
  1376. Object(external_wp_i18n_["__"])('Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'), originalBlock.title || originalName);
  1377. actions.push(Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  1378. key: "convert",
  1379. onClick: convertToHTML,
  1380. isLink: true
  1381. }, Object(external_wp_i18n_["__"])('Keep as HTML')));
  1382. }
  1383. return Object(external_wp_element_["createElement"])("div", Object(external_wp_blockEditor_["useBlockProps"])(), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], {
  1384. actions: actions
  1385. }, messageHTML), Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, originalUndelimitedContent));
  1386. };
  1387. /* harmony default export */ var get_install_missing = (getInstallMissing);
  1388. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/index.js
  1389. /**
  1390. * WordPress dependencies
  1391. */
  1392. /**
  1393. * Internal dependencies
  1394. */
  1395. Object(external_wp_plugins_["registerPlugin"])('block-directory', {
  1396. render() {
  1397. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(AutoBlockUninstaller, null), Object(external_wp_element_["createElement"])(inserter_menu_downloadable_blocks_panel, null), Object(external_wp_element_["createElement"])(InstalledBlocksPrePublishPanel, null));
  1398. }
  1399. });
  1400. Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'block-directory/fallback', (settings, name) => {
  1401. if (name !== 'core/missing') {
  1402. return settings;
  1403. }
  1404. settings.edit = get_install_missing(settings.edit);
  1405. return settings;
  1406. });
  1407. // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/index.js
  1408. /**
  1409. * Internal dependencies
  1410. */
  1411. /***/ }),
  1412. /***/ "BLhE":
  1413. /***/ (function(module, exports) {
  1414. (function() { module.exports = window["wp"]["editPost"]; }());
  1415. /***/ }),
  1416. /***/ "GRId":
  1417. /***/ (function(module, exports) {
  1418. (function() { module.exports = window["wp"]["element"]; }());
  1419. /***/ }),
  1420. /***/ "HSyU":
  1421. /***/ (function(module, exports) {
  1422. (function() { module.exports = window["wp"]["blocks"]; }());
  1423. /***/ }),
  1424. /***/ "K9lf":
  1425. /***/ (function(module, exports) {
  1426. (function() { module.exports = window["wp"]["compose"]; }());
  1427. /***/ }),
  1428. /***/ "Tqx9":
  1429. /***/ (function(module, exports) {
  1430. (function() { module.exports = window["wp"]["primitives"]; }());
  1431. /***/ }),
  1432. /***/ "TvNi":
  1433. /***/ (function(module, exports) {
  1434. (function() { module.exports = window["wp"]["plugins"]; }());
  1435. /***/ }),
  1436. /***/ "URob":
  1437. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1438. "use strict";
  1439. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  1440. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  1441. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  1442. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  1443. /**
  1444. * WordPress dependencies
  1445. */
  1446. const starFilled = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  1447. xmlns: "http://www.w3.org/2000/svg",
  1448. viewBox: "0 0 24 24"
  1449. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  1450. d: "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"
  1451. }));
  1452. /* harmony default export */ __webpack_exports__["a"] = (starFilled);
  1453. /***/ }),
  1454. /***/ "Xxwi":
  1455. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1456. "use strict";
  1457. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  1458. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  1459. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  1460. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  1461. /**
  1462. * WordPress dependencies
  1463. */
  1464. const starEmpty = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  1465. xmlns: "http://www.w3.org/2000/svg",
  1466. viewBox: "0 0 24 24"
  1467. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  1468. fillRule: "evenodd",
  1469. d: "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",
  1470. clipRule: "evenodd"
  1471. }));
  1472. /* harmony default export */ __webpack_exports__["a"] = (starEmpty);
  1473. /***/ }),
  1474. /***/ "YLtl":
  1475. /***/ (function(module, exports) {
  1476. (function() { module.exports = window["lodash"]; }());
  1477. /***/ }),
  1478. /***/ "axFQ":
  1479. /***/ (function(module, exports) {
  1480. (function() { module.exports = window["wp"]["blockEditor"]; }());
  1481. /***/ }),
  1482. /***/ "g56x":
  1483. /***/ (function(module, exports) {
  1484. (function() { module.exports = window["wp"]["hooks"]; }());
  1485. /***/ }),
  1486. /***/ "gdqT":
  1487. /***/ (function(module, exports) {
  1488. (function() { module.exports = window["wp"]["a11y"]; }());
  1489. /***/ }),
  1490. /***/ "iClF":
  1491. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1492. "use strict";
  1493. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  1494. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  1495. /**
  1496. * WordPress dependencies
  1497. */
  1498. /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
  1499. /**
  1500. * Return an SVG icon.
  1501. *
  1502. * @param {IconProps} props icon is the SVG component to render
  1503. * size is a number specifiying the icon size in pixels
  1504. * Other props will be passed to wrapped SVG component
  1505. *
  1506. * @return {JSX.Element} Icon component
  1507. */
  1508. function Icon({
  1509. icon,
  1510. size = 24,
  1511. ...props
  1512. }) {
  1513. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["cloneElement"])(icon, {
  1514. width: size,
  1515. height: size,
  1516. ...props
  1517. });
  1518. }
  1519. /* harmony default export */ __webpack_exports__["a"] = (Icon);
  1520. /***/ }),
  1521. /***/ "jSdM":
  1522. /***/ (function(module, exports) {
  1523. (function() { module.exports = window["wp"]["editor"]; }());
  1524. /***/ }),
  1525. /***/ "jZUy":
  1526. /***/ (function(module, exports) {
  1527. (function() { module.exports = window["wp"]["coreData"]; }());
  1528. /***/ }),
  1529. /***/ "l3Sj":
  1530. /***/ (function(module, exports) {
  1531. (function() { module.exports = window["wp"]["i18n"]; }());
  1532. /***/ }),
  1533. /***/ "onLe":
  1534. /***/ (function(module, exports) {
  1535. (function() { module.exports = window["wp"]["notices"]; }());
  1536. /***/ }),
  1537. /***/ "rmEH":
  1538. /***/ (function(module, exports) {
  1539. (function() { module.exports = window["wp"]["htmlEntities"]; }());
  1540. /***/ }),
  1541. /***/ "tI+e":
  1542. /***/ (function(module, exports) {
  1543. (function() { module.exports = window["wp"]["components"]; }());
  1544. /***/ }),
  1545. /***/ "wx14":
  1546. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1547. "use strict";
  1548. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
  1549. function _extends() {
  1550. _extends = Object.assign || function (target) {
  1551. for (var i = 1; i < arguments.length; i++) {
  1552. var source = arguments[i];
  1553. for (var key in source) {
  1554. if (Object.prototype.hasOwnProperty.call(source, key)) {
  1555. target[key] = source[key];
  1556. }
  1557. }
  1558. }
  1559. return target;
  1560. };
  1561. return _extends.apply(this, arguments);
  1562. }
  1563. /***/ }),
  1564. /***/ "ywyh":
  1565. /***/ (function(module, exports) {
  1566. (function() { module.exports = window["wp"]["apiFetch"]; }());
  1567. /***/ })
  1568. /******/ });