You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

272 lines
11 KiB

2 years ago
  1. /******/ (function() { // webpackBootstrap
  2. /******/ "use strict";
  3. /******/ var __webpack_modules__ = ({
  4. /***/ "./src/icons.js":
  5. /*!**********************!*\
  6. !*** ./src/icons.js ***!
  7. \**********************/
  8. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  9. __webpack_require__.r(__webpack_exports__);
  10. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
  11. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  12. const icons = {};
  13. icons.planist = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
  14. version: "1.1",
  15. id: "prefix__Layer_1",
  16. xmlns: "http://www.w3.org/2000/svg",
  17. x: "0",
  18. y: "0",
  19. viewBox: "0 0 1120.2 281.9",
  20. "enable-background": "new 0 0 1120.2 281.9"
  21. }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
  22. d: "M226.2 19.3H287V281.8H226.2z"
  23. }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
  24. d: "M414.8 88.4a96.7 96.7 0 1 0 96.7 96.7 96.6 96.6 0 0 0-96.7-96.7zm0 132.7a36 36 0 1 1 35.9-35.9 36 36 0 0 1-35.9 35.9z"
  25. }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
  26. class: "prefix__st0",
  27. d: "M456.1 272.6v9.1h55.3v-90.6a96.6 96.6 0 0 1-55.3 81.5z"
  28. }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
  29. class: "prefix__st1",
  30. d: "M456.1 272.6a96.9 96.9 0 0 0 55.3-81.5V185h-55.3v87.6z"
  31. }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
  32. d: "M634.9 88.4a92.2 92.2 0 0 0-92.2 92.2v101.2H598v-98.1a37 37 0 0 1 74 0v98.1h55.3V180.7a92.4 92.4 0 0 0-92.4-92.3z"
  33. }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
  34. d: "M758.2 88.5H819V281.8H758.2z"
  35. }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("circle", {
  36. cx: "788.6",
  37. cy: "30.4",
  38. r: "30.4",
  39. fill: "#de2029"
  40. }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
  41. d: "M0 137.1H60.8V281.9H0z"
  42. }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
  43. d: "M105.9 19.3H0v60.8h105.9a28.5 28.5 0 0 1 0 56.9H0v60.8h105.9a89.2 89.2 0 0 0 0-178.5z"
  44. }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
  45. fill: "#ed2939",
  46. d: "M0 137.1H60.8V197.9H0z"
  47. }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
  48. class: "prefix__st0",
  49. d: "M0 19.3H60.8V80.1H0z"
  50. }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
  51. class: "prefix__st0",
  52. d: "M1041.9 96.1H1102.7V137.5H1041.9z"
  53. }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
  54. d: "M1094.6 229.4h-.3c-12.6-1.1-22-12-22-24.6V159l.2-.2h-.2V47h-60.8v173.3a61.5 61.5 0 0 0 108.7 39.5l-25.6-30.4z"
  55. }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
  56. class: "prefix__st1",
  57. d: "M1011.5 96.1H1072.3V137.5H1011.5z"
  58. }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
  59. d: "M899.6 209.4c25.4 3.4 30.1 15.7 30.7 21.6a7.8 7.8 0 0 1-4.5 7.8c-18.6 9.2-48.9-15.2-48.9-15.2l-26.8 39s67 39.1 109.2 5.9a54 54 0 0 0 19.5-55c-6.9-27.8-47.9-41.3-47.9-41.3-24.9-6.2-30.1-15.7-30.7-21.6a7.9 7.9 0 0 1 4.4-7.8c18.6-9.2 48.9 15.2 48.9 15.2l26.8-39s-67-39.1-109.2-5.9a53.8 53.8 0 0 0-19.5 55c.1 0 5.9 35.7 48 41.3z"
  60. }));
  61. /* harmony default export */ __webpack_exports__["default"] = (icons);
  62. /***/ }),
  63. /***/ "@wordpress/block-editor":
  64. /*!*************************************!*\
  65. !*** external ["wp","blockEditor"] ***!
  66. \*************************************/
  67. /***/ (function(module) {
  68. module.exports = window["wp"]["blockEditor"];
  69. /***/ }),
  70. /***/ "@wordpress/blocks":
  71. /*!********************************!*\
  72. !*** external ["wp","blocks"] ***!
  73. \********************************/
  74. /***/ (function(module) {
  75. module.exports = window["wp"]["blocks"];
  76. /***/ }),
  77. /***/ "@wordpress/components":
  78. /*!************************************!*\
  79. !*** external ["wp","components"] ***!
  80. \************************************/
  81. /***/ (function(module) {
  82. module.exports = window["wp"]["components"];
  83. /***/ }),
  84. /***/ "@wordpress/element":
  85. /*!*********************************!*\
  86. !*** external ["wp","element"] ***!
  87. \*********************************/
  88. /***/ (function(module) {
  89. module.exports = window["wp"]["element"];
  90. /***/ })
  91. /******/ });
  92. /************************************************************************/
  93. /******/ // The module cache
  94. /******/ var __webpack_module_cache__ = {};
  95. /******/
  96. /******/ // The require function
  97. /******/ function __webpack_require__(moduleId) {
  98. /******/ // Check if module is in cache
  99. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  100. /******/ if (cachedModule !== undefined) {
  101. /******/ return cachedModule.exports;
  102. /******/ }
  103. /******/ // Create a new module (and put it into the cache)
  104. /******/ var module = __webpack_module_cache__[moduleId] = {
  105. /******/ // no module.id needed
  106. /******/ // no module.loaded needed
  107. /******/ exports: {}
  108. /******/ };
  109. /******/
  110. /******/ // Execute the module function
  111. /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  112. /******/
  113. /******/ // Return the exports of the module
  114. /******/ return module.exports;
  115. /******/ }
  116. /******/
  117. /************************************************************************/
  118. /******/ /* webpack/runtime/compat get default export */
  119. /******/ !function() {
  120. /******/ // getDefaultExport function for compatibility with non-harmony modules
  121. /******/ __webpack_require__.n = function(module) {
  122. /******/ var getter = module && module.__esModule ?
  123. /******/ function() { return module['default']; } :
  124. /******/ function() { return module; };
  125. /******/ __webpack_require__.d(getter, { a: getter });
  126. /******/ return getter;
  127. /******/ };
  128. /******/ }();
  129. /******/
  130. /******/ /* webpack/runtime/define property getters */
  131. /******/ !function() {
  132. /******/ // define getter functions for harmony exports
  133. /******/ __webpack_require__.d = function(exports, definition) {
  134. /******/ for(var key in definition) {
  135. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  136. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  137. /******/ }
  138. /******/ }
  139. /******/ };
  140. /******/ }();
  141. /******/
  142. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  143. /******/ !function() {
  144. /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  145. /******/ }();
  146. /******/
  147. /******/ /* webpack/runtime/make namespace object */
  148. /******/ !function() {
  149. /******/ // define __esModule on exports
  150. /******/ __webpack_require__.r = function(exports) {
  151. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  152. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  153. /******/ }
  154. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  155. /******/ };
  156. /******/ }();
  157. /******/
  158. /************************************************************************/
  159. var __webpack_exports__ = {};
  160. // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
  161. !function() {
  162. /*!**********************!*\
  163. !*** ./src/index.js ***!
  164. \**********************/
  165. __webpack_require__.r(__webpack_exports__);
  166. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
  167. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  168. /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
  169. /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
  170. /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
  171. /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
  172. /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
  173. /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
  174. /* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./icons */ "./src/icons.js");
  175. (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)('planist-gutenberg/planist-block', {
  176. title: 'Planist',
  177. icon: _icons__WEBPACK_IMPORTED_MODULE_4__["default"].planist,
  178. category: 'widgets',
  179. keyword: ['planist', 'event', 'schedule', 'calender'],
  180. attributes: {
  181. username: {
  182. type: 'string',
  183. default: ''
  184. },
  185. duration: {
  186. type: 'string',
  187. default: '30m'
  188. }
  189. },
  190. example: {
  191. attributes: {
  192. username: 'mohsen',
  193. duration: '45m'
  194. }
  195. },
  196. edit: props => {
  197. const {
  198. className,
  199. attributes: {
  200. username,
  201. duration
  202. },
  203. setAttributes
  204. } = props;
  205. const onChangeUsername = value => {
  206. setAttributes({
  207. username: value
  208. });
  209. };
  210. const onChangeDuration = value => {
  211. setAttributes({
  212. duration: value
  213. });
  214. };
  215. return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)(), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InspectorControls, {
  216. key: "setting"
  217. }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  218. className: className,
  219. style: {
  220. padding: '10px'
  221. }
  222. }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.TextControl, {
  223. label: "Username",
  224. value: username,
  225. onChange: onChangeUsername
  226. }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.TextControl, {
  227. label: "Duration",
  228. value: duration,
  229. onChange: onChangeDuration
  230. }))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
  231. className: "planist-block"
  232. }, username ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, _icons__WEBPACK_IMPORTED_MODULE_4__["default"].planist, "/", username, duration ? '/' + duration : '') : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, _icons__WEBPACK_IMPORTED_MODULE_4__["default"].planist, " Set username and duration")));
  233. },
  234. save: props => {
  235. const {
  236. className,
  237. attributes: {
  238. username,
  239. duration
  240. }
  241. } = props;
  242. return `[planist username="${username}" duration="${duration}"]`;
  243. }
  244. });
  245. }();
  246. /******/ })()
  247. ;
  248. //# sourceMappingURL=index.js.map