index.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/
  8. /******/ // Check if module is in cache
  9. /******/ if(installedModules[moduleId]) {
  10. /******/ return installedModules[moduleId].exports;
  11. /******/ }
  12. /******/ // Create a new module (and put it into the cache)
  13. /******/ var module = installedModules[moduleId] = {
  14. /******/ i: moduleId,
  15. /******/ l: false,
  16. /******/ exports: {}
  17. /******/ };
  18. /******/
  19. /******/ // Execute the module function
  20. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  21. /******/
  22. /******/ // Flag the module as loaded
  23. /******/ module.l = true;
  24. /******/
  25. /******/ // Return the exports of the module
  26. /******/ return module.exports;
  27. /******/ }
  28. /******/
  29. /******/
  30. /******/ // expose the modules object (__webpack_modules__)
  31. /******/ __webpack_require__.m = modules;
  32. /******/
  33. /******/ // expose the module cache
  34. /******/ __webpack_require__.c = installedModules;
  35. /******/
  36. /******/ // define getter function for harmony exports
  37. /******/ __webpack_require__.d = function(exports, name, getter) {
  38. /******/ if(!__webpack_require__.o(exports, name)) {
  39. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  40. /******/ }
  41. /******/ };
  42. /******/
  43. /******/ // define __esModule on exports
  44. /******/ __webpack_require__.r = function(exports) {
  45. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  46. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  47. /******/ }
  48. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  49. /******/ };
  50. /******/
  51. /******/ // create a fake namespace object
  52. /******/ // mode & 1: value is a module id, require it
  53. /******/ // mode & 2: merge all properties of value into the ns
  54. /******/ // mode & 4: return value when already ns object
  55. /******/ // mode & 8|1: behave like require
  56. /******/ __webpack_require__.t = function(value, mode) {
  57. /******/ if(mode & 1) value = __webpack_require__(value);
  58. /******/ if(mode & 8) return value;
  59. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  60. /******/ var ns = Object.create(null);
  61. /******/ __webpack_require__.r(ns);
  62. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  63. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  64. /******/ return ns;
  65. /******/ };
  66. /******/
  67. /******/ // getDefaultExport function for compatibility with non-harmony modules
  68. /******/ __webpack_require__.n = function(module) {
  69. /******/ var getter = module && module.__esModule ?
  70. /******/ function getDefault() { return module['default']; } :
  71. /******/ function getModuleExports() { return module; };
  72. /******/ __webpack_require__.d(getter, 'a', getter);
  73. /******/ return getter;
  74. /******/ };
  75. /******/
  76. /******/ // Object.prototype.hasOwnProperty.call
  77. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  78. /******/
  79. /******/ // __webpack_public_path__
  80. /******/ __webpack_require__.p = "";
  81. /******/
  82. /******/
  83. /******/ // Load entry module and return exports
  84. /******/ return __webpack_require__(__webpack_require__.s = "./src/index.js");
  85. /******/ })
  86. /************************************************************************/
  87. /******/ ({
  88. /***/ "./src/index.js":
  89. /*!**********************!*\
  90. !*** ./src/index.js ***!
  91. \**********************/
  92. /*! no exports provided */
  93. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94. "use strict";
  95. __webpack_require__.r(__webpack_exports__);
  96. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
  97. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  98. /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/plugins */ "@wordpress/plugins");
  99. /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__);
  100. /* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/edit-post */ "@wordpress/edit-post");
  101. /* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2__);
  102. /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
  103. /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
  104. /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
  105. /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__);
  106. /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
  107. /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__);
  108. var PluginMetaFields_media_url = function PluginMetaFields_media_url(props) {
  109. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["PanelBody"], {
  110. title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])("Media URL", "textdomain"),
  111. icon: "format-video",
  112. intialOpen: true
  113. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["TextControl"], {
  114. value: props.text_metafield,
  115. label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])("video for meta", "textdomain"),
  116. help: "( postmeta: dwp23_media_meta_url )",
  117. onChange: function onChange(value) {
  118. return props.onMetaFieldChange_media_url(value);
  119. }
  120. })));
  121. };
  122. var PluginMetaFields_poster_image_url = function PluginMetaFields_poster_image_url(props) {
  123. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["PanelBody"], {
  124. title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])("Poster Image URL", "textdomain"),
  125. icon: "format-image",
  126. intialOpen: true
  127. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["TextControl"], {
  128. value: props.text_metafield_poster_image_url,
  129. label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])("image for video poster", "textdomain"),
  130. help: "( postmeta: dwp23_image_meta_url )",
  131. onChange: function onChange(value) {
  132. return props.onMetaFieldChange_poster_image_url(value);
  133. }
  134. })));
  135. };
  136. PluginMetaFields_media_url = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select) {
  137. return {
  138. text_metafield: select('core/editor').getEditedPostAttribute('meta')['dwp23_media_url_meta']
  139. };
  140. })(PluginMetaFields_media_url);
  141. PluginMetaFields_media_url = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withDispatch"])(function (dispatch) {
  142. return {
  143. onMetaFieldChange_media_url: function onMetaFieldChange_media_url(value) {
  144. dispatch('core/editor').editPost({
  145. meta: {
  146. dwp23_media_url_meta: value
  147. }
  148. });
  149. }
  150. };
  151. })(PluginMetaFields_media_url);
  152. PluginMetaFields_poster_image_url = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (select) {
  153. return {
  154. text_metafield_featured_image_url: select('core/editor').getEditedPostAttribute('meta')['dwp23_poster_url_meta']
  155. };
  156. })(PluginMetaFields_poster_image_url);
  157. PluginMetaFields_poster_image_url = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withDispatch"])(function (dispatch) {
  158. return {
  159. onMetaFieldChange_poster_image_url: function onMetaFieldChange_poster_image_url(value) {
  160. dispatch('core/editor').editPost({
  161. meta: {
  162. dwp23_poster_url_meta: value
  163. }
  164. });
  165. }
  166. };
  167. })(PluginMetaFields_poster_image_url);
  168. Object(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__["registerPlugin"])('dwp-guten-sidebar', {
  169. icon: 'welcome-widgets-menus',
  170. render: function render() {
  171. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2__["PluginSidebarMoreMenuItem"], {
  172. target: "dwp-guten-sidebar"
  173. }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Meta Options', 'textdomain')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2__["PluginSidebar"], {
  174. name: "dwp-guten-sidebar",
  175. title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Post Meta', 'textdomain')
  176. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(PluginMetaFields_media_url, null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(PluginMetaFields_poster_image_url, null)));
  177. }
  178. });
  179. /***/ }),
  180. /***/ "@wordpress/components":
  181. /*!************************************!*\
  182. !*** external ["wp","components"] ***!
  183. \************************************/
  184. /*! no static exports found */
  185. /***/ (function(module, exports) {
  186. (function() { module.exports = window["wp"]["components"]; }());
  187. /***/ }),
  188. /***/ "@wordpress/data":
  189. /*!******************************!*\
  190. !*** external ["wp","data"] ***!
  191. \******************************/
  192. /*! no static exports found */
  193. /***/ (function(module, exports) {
  194. (function() { module.exports = window["wp"]["data"]; }());
  195. /***/ }),
  196. /***/ "@wordpress/edit-post":
  197. /*!**********************************!*\
  198. !*** external ["wp","editPost"] ***!
  199. \**********************************/
  200. /*! no static exports found */
  201. /***/ (function(module, exports) {
  202. (function() { module.exports = window["wp"]["editPost"]; }());
  203. /***/ }),
  204. /***/ "@wordpress/element":
  205. /*!*********************************!*\
  206. !*** external ["wp","element"] ***!
  207. \*********************************/
  208. /*! no static exports found */
  209. /***/ (function(module, exports) {
  210. (function() { module.exports = window["wp"]["element"]; }());
  211. /***/ }),
  212. /***/ "@wordpress/i18n":
  213. /*!******************************!*\
  214. !*** external ["wp","i18n"] ***!
  215. \******************************/
  216. /*! no static exports found */
  217. /***/ (function(module, exports) {
  218. (function() { module.exports = window["wp"]["i18n"]; }());
  219. /***/ }),
  220. /***/ "@wordpress/plugins":
  221. /*!*********************************!*\
  222. !*** external ["wp","plugins"] ***!
  223. \*********************************/
  224. /*! no static exports found */
  225. /***/ (function(module, exports) {
  226. (function() { module.exports = window["wp"]["plugins"]; }());
  227. /***/ })
  228. /******/ });
  229. //# sourceMappingURL=index.js.map