plugins.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758
  1. this["wp"] = this["wp"] || {}; this["wp"]["plugins"] =
  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 = 363);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ 0:
  90. /***/ (function(module, exports) {
  91. (function() { module.exports = this["wp"]["element"]; }());
  92. /***/ }),
  93. /***/ 10:
  94. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95. "use strict";
  96. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
  97. function _defineProperty(obj, key, value) {
  98. if (key in obj) {
  99. Object.defineProperty(obj, key, {
  100. value: value,
  101. enumerable: true,
  102. configurable: true,
  103. writable: true
  104. });
  105. } else {
  106. obj[key] = value;
  107. }
  108. return obj;
  109. }
  110. /***/ }),
  111. /***/ 11:
  112. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113. "use strict";
  114. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; });
  115. function _defineProperties(target, props) {
  116. for (var i = 0; i < props.length; i++) {
  117. var descriptor = props[i];
  118. descriptor.enumerable = descriptor.enumerable || false;
  119. descriptor.configurable = true;
  120. if ("value" in descriptor) descriptor.writable = true;
  121. Object.defineProperty(target, descriptor.key, descriptor);
  122. }
  123. }
  124. function _createClass(Constructor, protoProps, staticProps) {
  125. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  126. if (staticProps) _defineProperties(Constructor, staticProps);
  127. return Constructor;
  128. }
  129. /***/ }),
  130. /***/ 12:
  131. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  132. "use strict";
  133. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
  134. function _classCallCheck(instance, Constructor) {
  135. if (!(instance instanceof Constructor)) {
  136. throw new TypeError("Cannot call a class as a function");
  137. }
  138. }
  139. /***/ }),
  140. /***/ 13:
  141. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  142. "use strict";
  143. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; });
  144. /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31);
  145. /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
  146. function _possibleConstructorReturn(self, call) {
  147. if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) {
  148. return call;
  149. }
  150. return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self);
  151. }
  152. /***/ }),
  153. /***/ 14:
  154. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  155. "use strict";
  156. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; });
  157. function _getPrototypeOf(o) {
  158. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  159. return o.__proto__ || Object.getPrototypeOf(o);
  160. };
  161. return _getPrototypeOf(o);
  162. }
  163. /***/ }),
  164. /***/ 15:
  165. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  166. "use strict";
  167. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
  168. function _setPrototypeOf(o, p) {
  169. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  170. o.__proto__ = p;
  171. return o;
  172. };
  173. return _setPrototypeOf(o, p);
  174. }
  175. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
  176. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inherits; });
  177. function _inherits(subClass, superClass) {
  178. if (typeof superClass !== "function" && superClass !== null) {
  179. throw new TypeError("Super expression must either be null or a function");
  180. }
  181. subClass.prototype = Object.create(superClass && superClass.prototype, {
  182. constructor: {
  183. value: subClass,
  184. writable: true,
  185. configurable: true
  186. }
  187. });
  188. if (superClass) _setPrototypeOf(subClass, superClass);
  189. }
  190. /***/ }),
  191. /***/ 18:
  192. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  193. "use strict";
  194. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
  195. function _extends() {
  196. _extends = Object.assign || function (target) {
  197. for (var i = 1; i < arguments.length; i++) {
  198. var source = arguments[i];
  199. for (var key in source) {
  200. if (Object.prototype.hasOwnProperty.call(source, key)) {
  201. target[key] = source[key];
  202. }
  203. }
  204. }
  205. return target;
  206. };
  207. return _extends.apply(this, arguments);
  208. }
  209. /***/ }),
  210. /***/ 2:
  211. /***/ (function(module, exports) {
  212. (function() { module.exports = this["lodash"]; }());
  213. /***/ }),
  214. /***/ 27:
  215. /***/ (function(module, exports) {
  216. (function() { module.exports = this["wp"]["hooks"]; }());
  217. /***/ }),
  218. /***/ 31:
  219. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  220. "use strict";
  221. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
  222. function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
  223. function _typeof(obj) {
  224. if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
  225. _typeof = function _typeof(obj) {
  226. return _typeof2(obj);
  227. };
  228. } else {
  229. _typeof = function _typeof(obj) {
  230. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
  231. };
  232. }
  233. return _typeof(obj);
  234. }
  235. /***/ }),
  236. /***/ 363:
  237. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  238. "use strict";
  239. __webpack_require__.r(__webpack_exports__);
  240. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
  241. var classCallCheck = __webpack_require__(12);
  242. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
  243. var createClass = __webpack_require__(11);
  244. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
  245. var possibleConstructorReturn = __webpack_require__(13);
  246. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
  247. var getPrototypeOf = __webpack_require__(14);
  248. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
  249. var assertThisInitialized = __webpack_require__(5);
  250. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
  251. var inherits = __webpack_require__(15);
  252. // EXTERNAL MODULE: external {"this":["wp","element"]}
  253. var external_this_wp_element_ = __webpack_require__(0);
  254. // EXTERNAL MODULE: external "lodash"
  255. var external_lodash_ = __webpack_require__(2);
  256. // EXTERNAL MODULE: external {"this":["wp","hooks"]}
  257. var external_this_wp_hooks_ = __webpack_require__(27);
  258. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
  259. var esm_extends = __webpack_require__(18);
  260. // EXTERNAL MODULE: external {"this":["wp","compose"]}
  261. var external_this_wp_compose_ = __webpack_require__(8);
  262. // CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/plugin-context/index.js
  263. /**
  264. * WordPress dependencies
  265. */
  266. var _createContext = Object(external_this_wp_element_["createContext"])({
  267. name: null,
  268. icon: null
  269. }),
  270. Consumer = _createContext.Consumer,
  271. Provider = _createContext.Provider;
  272. /**
  273. * A Higher Order Component used to inject Plugin context to the
  274. * wrapped component.
  275. *
  276. * @param {Function} mapContextToProps Function called on every context change,
  277. * expected to return object of props to
  278. * merge with the component's own props.
  279. *
  280. * @return {Component} Enhanced component with injected context as props.
  281. */
  282. var plugin_context_withPluginContext = function withPluginContext(mapContextToProps) {
  283. return Object(external_this_wp_compose_["createHigherOrderComponent"])(function (OriginalComponent) {
  284. return function (props) {
  285. return Object(external_this_wp_element_["createElement"])(Consumer, null, function (context) {
  286. return Object(external_this_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({}, props, mapContextToProps(context, props)));
  287. });
  288. };
  289. }, 'withPluginContext');
  290. };
  291. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js
  292. var objectSpread = __webpack_require__(7);
  293. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
  294. var esm_typeof = __webpack_require__(31);
  295. // CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/api/index.js
  296. /* eslint no-console: [ 'error', { allow: [ 'error' ] } ] */
  297. /**
  298. * WordPress dependencies
  299. */
  300. /**
  301. * External dependencies
  302. */
  303. /**
  304. * Plugin definitions keyed by plugin name.
  305. *
  306. * @type {Object.<string,WPPlugin>}
  307. */
  308. var plugins = {};
  309. /**
  310. * Registers a plugin to the editor.
  311. *
  312. * @param {string} name A string identifying the plugin. Must be unique across all registered plugins.
  313. * @param {Object} settings The settings for this plugin.
  314. * @param {string|WPElement|Function} settings.icon An icon to be shown in the UI. It can be a slug of the Dashicon,
  315. * or an element (or function returning an element) if you choose to render your own SVG.
  316. * @param {Function} settings.render A component containing the UI elements to be rendered.
  317. *
  318. * @example <caption>ES5</caption>
  319. * ```js
  320. * // Using ES5 syntax
  321. * var el = wp.element.createElement;
  322. * var Fragment = wp.element.Fragment;
  323. * var PluginSidebar = wp.editPost.PluginSidebar;
  324. * var PluginSidebarMoreMenuItem = wp.editPost.PluginSidebarMoreMenuItem;
  325. * var registerPlugin = wp.plugins.registerPlugin;
  326. *
  327. * function Component() {
  328. * return el(
  329. * Fragment,
  330. * {},
  331. * el(
  332. * PluginSidebarMoreMenuItem,
  333. * {
  334. * target: 'sidebar-name',
  335. * },
  336. * 'My Sidebar'
  337. * ),
  338. * el(
  339. * PluginSidebar,
  340. * {
  341. * name: 'sidebar-name',
  342. * title: 'My Sidebar',
  343. * },
  344. * 'Content of the sidebar'
  345. * )
  346. * );
  347. * }
  348. * registerPlugin( 'plugin-name', {
  349. * icon: 'smiley',
  350. * render: Component,
  351. * } );
  352. * ```
  353. *
  354. * @example <caption>ESNext</caption>
  355. * ```js
  356. * // Using ESNext syntax
  357. * const { PluginSidebar, PluginSidebarMoreMenuItem } = wp.editPost;
  358. * const { registerPlugin } = wp.plugins;
  359. *
  360. * const Component = () => (
  361. * <>
  362. * <PluginSidebarMoreMenuItem
  363. * target="sidebar-name"
  364. * >
  365. * My Sidebar
  366. * </PluginSidebarMoreMenuItem>
  367. * <PluginSidebar
  368. * name="sidebar-name"
  369. * title="My Sidebar"
  370. * >
  371. * Content of the sidebar
  372. * </PluginSidebar>
  373. * </>
  374. * );
  375. *
  376. * registerPlugin( 'plugin-name', {
  377. * icon: 'smiley',
  378. * render: Component,
  379. * } );
  380. * ```
  381. *
  382. * @return {Object} The final plugin settings object.
  383. */
  384. function registerPlugin(name, settings) {
  385. if (Object(esm_typeof["a" /* default */])(settings) !== 'object') {
  386. console.error('No settings object provided!');
  387. return null;
  388. }
  389. if (typeof name !== 'string') {
  390. console.error('Plugin names must be strings.');
  391. return null;
  392. }
  393. if (!/^[a-z][a-z0-9-]*$/.test(name)) {
  394. console.error('Plugin names must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".');
  395. return null;
  396. }
  397. if (plugins[name]) {
  398. console.error("Plugin \"".concat(name, "\" is already registered."));
  399. }
  400. settings = Object(external_this_wp_hooks_["applyFilters"])('plugins.registerPlugin', settings, name);
  401. if (!Object(external_lodash_["isFunction"])(settings.render)) {
  402. console.error('The "render" property must be specified and must be a valid function.');
  403. return null;
  404. }
  405. plugins[name] = Object(objectSpread["a" /* default */])({
  406. name: name,
  407. icon: 'admin-plugins'
  408. }, settings);
  409. Object(external_this_wp_hooks_["doAction"])('plugins.pluginRegistered', settings, name);
  410. return settings;
  411. }
  412. /**
  413. * Unregisters a plugin by name.
  414. *
  415. * @param {string} name Plugin name.
  416. *
  417. * @example <caption>ES5</caption>
  418. * ```js
  419. * // Using ES5 syntax
  420. * var unregisterPlugin = wp.plugins.unregisterPlugin;
  421. *
  422. * unregisterPlugin( 'plugin-name' );
  423. * ```
  424. *
  425. * @example <caption>ESNext</caption>
  426. * ```js
  427. * // Using ESNext syntax
  428. * const { unregisterPlugin } = wp.plugins;
  429. *
  430. * unregisterPlugin( 'plugin-name' );
  431. * ```
  432. *
  433. * @return {?WPPlugin} The previous plugin settings object, if it has been
  434. * successfully unregistered; otherwise `undefined`.
  435. */
  436. function unregisterPlugin(name) {
  437. if (!plugins[name]) {
  438. console.error('Plugin "' + name + '" is not registered.');
  439. return;
  440. }
  441. var oldPlugin = plugins[name];
  442. delete plugins[name];
  443. Object(external_this_wp_hooks_["doAction"])('plugins.pluginUnregistered', oldPlugin, name);
  444. return oldPlugin;
  445. }
  446. /**
  447. * Returns a registered plugin settings.
  448. *
  449. * @param {string} name Plugin name.
  450. *
  451. * @return {?Object} Plugin setting.
  452. */
  453. function getPlugin(name) {
  454. return plugins[name];
  455. }
  456. /**
  457. * Returns all registered plugins.
  458. *
  459. * @return {Array} Plugin settings.
  460. */
  461. function getPlugins() {
  462. return Object.values(plugins);
  463. }
  464. // CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/plugin-area/index.js
  465. /**
  466. * External dependencies
  467. */
  468. /**
  469. * WordPress dependencies
  470. */
  471. /**
  472. * Internal dependencies
  473. */
  474. /**
  475. * A component that renders all plugin fills in a hidden div.
  476. *
  477. * @example <caption>ES5</caption>
  478. * ```js
  479. * // Using ES5 syntax
  480. * var el = wp.element.createElement;
  481. * var PluginArea = wp.plugins.PluginArea;
  482. *
  483. * function Layout() {
  484. * return el(
  485. * 'div',
  486. * {},
  487. * 'Content of the page',
  488. * PluginArea
  489. * );
  490. * }
  491. * ```
  492. *
  493. * @example <caption>ESNext</caption>
  494. * ```js
  495. * // Using ESNext syntax
  496. * const { PluginArea } = wp.plugins;
  497. *
  498. * const Layout = () => (
  499. * <div>
  500. * Content of the page
  501. * <PluginArea />
  502. * </div>
  503. * );
  504. * ```
  505. *
  506. * @return {WPElement} Plugin area.
  507. */
  508. var plugin_area_PluginArea =
  509. /*#__PURE__*/
  510. function (_Component) {
  511. Object(inherits["a" /* default */])(PluginArea, _Component);
  512. function PluginArea() {
  513. var _this;
  514. Object(classCallCheck["a" /* default */])(this, PluginArea);
  515. _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(PluginArea).apply(this, arguments));
  516. _this.setPlugins = _this.setPlugins.bind(Object(assertThisInitialized["a" /* default */])(_this));
  517. _this.state = _this.getCurrentPluginsState();
  518. return _this;
  519. }
  520. Object(createClass["a" /* default */])(PluginArea, [{
  521. key: "getCurrentPluginsState",
  522. value: function getCurrentPluginsState() {
  523. return {
  524. plugins: Object(external_lodash_["map"])(getPlugins(), function (_ref) {
  525. var icon = _ref.icon,
  526. name = _ref.name,
  527. render = _ref.render;
  528. return {
  529. Plugin: render,
  530. context: {
  531. name: name,
  532. icon: icon
  533. }
  534. };
  535. })
  536. };
  537. }
  538. }, {
  539. key: "componentDidMount",
  540. value: function componentDidMount() {
  541. Object(external_this_wp_hooks_["addAction"])('plugins.pluginRegistered', 'core/plugins/plugin-area/plugins-registered', this.setPlugins);
  542. Object(external_this_wp_hooks_["addAction"])('plugins.pluginUnregistered', 'core/plugins/plugin-area/plugins-unregistered', this.setPlugins);
  543. }
  544. }, {
  545. key: "componentWillUnmount",
  546. value: function componentWillUnmount() {
  547. Object(external_this_wp_hooks_["removeAction"])('plugins.pluginRegistered', 'core/plugins/plugin-area/plugins-registered');
  548. Object(external_this_wp_hooks_["removeAction"])('plugins.pluginUnregistered', 'core/plugins/plugin-area/plugins-unregistered');
  549. }
  550. }, {
  551. key: "setPlugins",
  552. value: function setPlugins() {
  553. this.setState(this.getCurrentPluginsState);
  554. }
  555. }, {
  556. key: "render",
  557. value: function render() {
  558. return Object(external_this_wp_element_["createElement"])("div", {
  559. style: {
  560. display: 'none'
  561. }
  562. }, Object(external_lodash_["map"])(this.state.plugins, function (_ref2) {
  563. var context = _ref2.context,
  564. Plugin = _ref2.Plugin;
  565. return Object(external_this_wp_element_["createElement"])(Provider, {
  566. key: context.name,
  567. value: context
  568. }, Object(external_this_wp_element_["createElement"])(Plugin, null));
  569. }));
  570. }
  571. }]);
  572. return PluginArea;
  573. }(external_this_wp_element_["Component"]);
  574. /* harmony default export */ var plugin_area = (plugin_area_PluginArea);
  575. // CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/index.js
  576. // CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/index.js
  577. /* concated harmony reexport PluginArea */__webpack_require__.d(__webpack_exports__, "PluginArea", function() { return plugin_area; });
  578. /* concated harmony reexport withPluginContext */__webpack_require__.d(__webpack_exports__, "withPluginContext", function() { return plugin_context_withPluginContext; });
  579. /* concated harmony reexport registerPlugin */__webpack_require__.d(__webpack_exports__, "registerPlugin", function() { return registerPlugin; });
  580. /* concated harmony reexport unregisterPlugin */__webpack_require__.d(__webpack_exports__, "unregisterPlugin", function() { return unregisterPlugin; });
  581. /* concated harmony reexport getPlugin */__webpack_require__.d(__webpack_exports__, "getPlugin", function() { return getPlugin; });
  582. /* concated harmony reexport getPlugins */__webpack_require__.d(__webpack_exports__, "getPlugins", function() { return getPlugins; });
  583. /***/ }),
  584. /***/ 5:
  585. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  586. "use strict";
  587. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; });
  588. function _assertThisInitialized(self) {
  589. if (self === void 0) {
  590. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  591. }
  592. return self;
  593. }
  594. /***/ }),
  595. /***/ 7:
  596. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  597. "use strict";
  598. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread; });
  599. /* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);
  600. function _objectSpread(target) {
  601. for (var i = 1; i < arguments.length; i++) {
  602. var source = arguments[i] != null ? arguments[i] : {};
  603. var ownKeys = Object.keys(source);
  604. if (typeof Object.getOwnPropertySymbols === 'function') {
  605. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
  606. return Object.getOwnPropertyDescriptor(source, sym).enumerable;
  607. }));
  608. }
  609. ownKeys.forEach(function (key) {
  610. Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]);
  611. });
  612. }
  613. return target;
  614. }
  615. /***/ }),
  616. /***/ 8:
  617. /***/ (function(module, exports) {
  618. (function() { module.exports = this["wp"]["compose"]; }());
  619. /***/ })
  620. /******/ });