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.
 
 
 

273 lines
11 KiB

/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./src/icons.js":
/*!**********************!*\
!*** ./src/icons.js ***!
\**********************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
const icons = {};
icons.planist = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
version: "1.1",
id: "prefix__Layer_1",
xmlns: "http://www.w3.org/2000/svg",
x: "0",
y: "0",
viewBox: "0 0 1120.2 281.9",
"enable-background": "new 0 0 1120.2 281.9"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
d: "M226.2 19.3H287V281.8H226.2z"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
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"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
class: "prefix__st0",
d: "M456.1 272.6v9.1h55.3v-90.6a96.6 96.6 0 0 1-55.3 81.5z"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
class: "prefix__st1",
d: "M456.1 272.6a96.9 96.9 0 0 0 55.3-81.5V185h-55.3v87.6z"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
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"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
d: "M758.2 88.5H819V281.8H758.2z"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("circle", {
cx: "788.6",
cy: "30.4",
r: "30.4",
fill: "#de2029"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
d: "M0 137.1H60.8V281.9H0z"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
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"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
fill: "#ed2939",
d: "M0 137.1H60.8V197.9H0z"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
class: "prefix__st0",
d: "M0 19.3H60.8V80.1H0z"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
class: "prefix__st0",
d: "M1041.9 96.1H1102.7V137.5H1041.9z"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
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"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
class: "prefix__st1",
d: "M1011.5 96.1H1072.3V137.5H1011.5z"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
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"
}));
/* harmony default export */ __webpack_exports__["default"] = (icons);
/***/ }),
/***/ "@wordpress/block-editor":
/*!*************************************!*\
!*** external ["wp","blockEditor"] ***!
\*************************************/
/***/ (function(module) {
module.exports = window["wp"]["blockEditor"];
/***/ }),
/***/ "@wordpress/blocks":
/*!********************************!*\
!*** external ["wp","blocks"] ***!
\********************************/
/***/ (function(module) {
module.exports = window["wp"]["blocks"];
/***/ }),
/***/ "@wordpress/components":
/*!************************************!*\
!*** external ["wp","components"] ***!
\************************************/
/***/ (function(module) {
module.exports = window["wp"]["components"];
/***/ }),
/***/ "@wordpress/element":
/*!*********************************!*\
!*** external ["wp","element"] ***!
\*********************************/
/***/ (function(module) {
module.exports = window["wp"]["element"];
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ !function() {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function() { return module['default']; } :
/******/ function() { return module; };
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ !function() {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = function(exports, definition) {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ !function() {
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ }();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ !function() {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ }();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
!function() {
/*!**********************!*\
!*** ./src/index.js ***!
\**********************/
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./icons */ "./src/icons.js");
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)('planist-gutenberg/planist-block', {
title: 'Planist',
icon: _icons__WEBPACK_IMPORTED_MODULE_4__["default"].planist,
category: 'widgets',
keyword: ['planist', 'event', 'schedule', 'calender'],
attributes: {
username: {
type: 'string',
default: ''
},
duration: {
type: 'string',
default: '30m'
}
},
example: {
attributes: {
username: 'mohsen',
duration: '45m'
}
},
edit: props => {
const {
className,
attributes: {
username,
duration
},
setAttributes
} = props;
const onChangeUsername = value => {
setAttributes({
username: value
});
};
const onChangeDuration = value => {
setAttributes({
duration: value
});
};
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, {
key: "setting"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: className,
style: {
padding: '10px'
}
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.TextControl, {
label: "Username",
value: username,
onChange: onChangeUsername
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.TextControl, {
label: "Duration",
value: duration,
onChange: onChangeDuration
}))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "planist-block"
}, 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")));
},
save: props => {
const {
className,
attributes: {
username,
duration
}
} = props;
return `[planist username="${username}" duration="${duration}"]`;
}
});
}();
/******/ })()
;
//# sourceMappingURL=index.js.map