index.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. /******/ (() => { // webpackBootstrap
  2. /******/ "use strict";
  3. /******/ var __webpack_modules__ = ({
  4. /***/ "./src/edit.js":
  5. /*!*********************!*\
  6. !*** ./src/edit.js ***!
  7. \*********************/
  8. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  9. __webpack_require__.r(__webpack_exports__);
  10. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  11. /* harmony export */ "default": () => (/* binding */ Edit)
  12. /* harmony export */ });
  13. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
  14. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  15. /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
  16. /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
  17. /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
  18. /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
  19. /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss");
  20. /**
  21. * Retrieves the translation of text.
  22. *
  23. * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/
  24. */
  25. /**
  26. * React hook that is used to mark the block wrapper element.
  27. * It provides all the necessary props like the class name.
  28. *
  29. * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops
  30. */
  31. /**
  32. * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.
  33. * Those files can contain any CSS code that gets applied to the editor.
  34. *
  35. * @see https://www.npmjs.com/package/@wordpress/scripts#using-css
  36. */
  37. /**
  38. * The edit function describes the structure of your block in the context of the
  39. * editor. This represents what the editor will render when the block is used.
  40. *
  41. * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit
  42. *
  43. * @return {Element} Element to render.
  44. */
  45. function Edit({
  46. attributes,
  47. setAttributes
  48. }) {
  49. const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)();
  50. const onChangeContent = newContent => {
  51. setAttributes({
  52. content: newContent
  53. });
  54. };
  55. return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, "Podaj slug:", (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.RichText, {
  56. ...blockProps,
  57. // tagName="p"
  58. onChange: onChangeContent,
  59. allowedFormats: ['core/bold', 'core/italic'],
  60. value: attributes.content,
  61. placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Write your text...')
  62. }));
  63. }
  64. /***/ }),
  65. /***/ "./src/index.js":
  66. /*!**********************!*\
  67. !*** ./src/index.js ***!
  68. \**********************/
  69. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  70. __webpack_require__.r(__webpack_exports__);
  71. /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
  72. /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
  73. /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss");
  74. /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/edit.js");
  75. /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/save.js");
  76. /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/block.json");
  77. /**
  78. * Registers a new block provided a unique name and an object defining its behavior.
  79. *
  80. * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/
  81. */
  82. /**
  83. * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.
  84. * All files containing `style` keyword are bundled together. The code used
  85. * gets applied both to the front of your site and to the editor.
  86. *
  87. * @see https://www.npmjs.com/package/@wordpress/scripts#using-css
  88. */
  89. /**
  90. * Internal dependencies
  91. */
  92. /**
  93. * Every block starts by registering a new block type definition.
  94. *
  95. * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/
  96. */
  97. (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, {
  98. /**
  99. * @see ./edit.js
  100. */
  101. edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"],
  102. /**
  103. * @see ./save.js
  104. */
  105. save: _save__WEBPACK_IMPORTED_MODULE_3__["default"]
  106. });
  107. /***/ }),
  108. /***/ "./src/save.js":
  109. /*!*********************!*\
  110. !*** ./src/save.js ***!
  111. \*********************/
  112. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  113. __webpack_require__.r(__webpack_exports__);
  114. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  115. /* harmony export */ "default": () => (/* binding */ save)
  116. /* harmony export */ });
  117. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
  118. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  119. /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
  120. /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
  121. /**
  122. * React hook that is used to mark the block wrapper element.
  123. * It provides all the necessary props like the class name.
  124. *
  125. * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops
  126. */
  127. /**
  128. * The save function defines the way in which the different attributes should
  129. * be combined into the final markup, which is then serialized by the block
  130. * editor into `post_content`.
  131. *
  132. * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save
  133. *
  134. * @return {Element} Element to render.
  135. */
  136. function save({
  137. attributes
  138. }) {
  139. const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save();
  140. return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, {
  141. ...blockProps,
  142. // tagName = "div"
  143. value: attributes.content
  144. });
  145. }
  146. /***/ }),
  147. /***/ "./src/editor.scss":
  148. /*!*************************!*\
  149. !*** ./src/editor.scss ***!
  150. \*************************/
  151. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  152. __webpack_require__.r(__webpack_exports__);
  153. // extracted by mini-css-extract-plugin
  154. /***/ }),
  155. /***/ "./src/style.scss":
  156. /*!************************!*\
  157. !*** ./src/style.scss ***!
  158. \************************/
  159. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  160. __webpack_require__.r(__webpack_exports__);
  161. // extracted by mini-css-extract-plugin
  162. /***/ }),
  163. /***/ "react":
  164. /*!************************!*\
  165. !*** external "React" ***!
  166. \************************/
  167. /***/ ((module) => {
  168. module.exports = window["React"];
  169. /***/ }),
  170. /***/ "@wordpress/block-editor":
  171. /*!*************************************!*\
  172. !*** external ["wp","blockEditor"] ***!
  173. \*************************************/
  174. /***/ ((module) => {
  175. module.exports = window["wp"]["blockEditor"];
  176. /***/ }),
  177. /***/ "@wordpress/blocks":
  178. /*!********************************!*\
  179. !*** external ["wp","blocks"] ***!
  180. \********************************/
  181. /***/ ((module) => {
  182. module.exports = window["wp"]["blocks"];
  183. /***/ }),
  184. /***/ "@wordpress/i18n":
  185. /*!******************************!*\
  186. !*** external ["wp","i18n"] ***!
  187. \******************************/
  188. /***/ ((module) => {
  189. module.exports = window["wp"]["i18n"];
  190. /***/ }),
  191. /***/ "./src/block.json":
  192. /*!************************!*\
  193. !*** ./src/block.json ***!
  194. \************************/
  195. /***/ ((module) => {
  196. module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"create-block/tsu-financial-progress-block","version":"0.1.0","title":"Tsu Financial Progress Block","category":"widgets","icon":"smiley","description":"Example block scaffolded with Create Block tool.","example":{},"supports":{"html":false},"textdomain":"tsu-financial-progress-block","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","viewScript":"file:./view.js","attributes":{"content":{"type":"string","source":"html","selector":"p"}}}');
  197. /***/ })
  198. /******/ });
  199. /************************************************************************/
  200. /******/ // The module cache
  201. /******/ var __webpack_module_cache__ = {};
  202. /******/
  203. /******/ // The require function
  204. /******/ function __webpack_require__(moduleId) {
  205. /******/ // Check if module is in cache
  206. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  207. /******/ if (cachedModule !== undefined) {
  208. /******/ return cachedModule.exports;
  209. /******/ }
  210. /******/ // Create a new module (and put it into the cache)
  211. /******/ var module = __webpack_module_cache__[moduleId] = {
  212. /******/ // no module.id needed
  213. /******/ // no module.loaded needed
  214. /******/ exports: {}
  215. /******/ };
  216. /******/
  217. /******/ // Execute the module function
  218. /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  219. /******/
  220. /******/ // Return the exports of the module
  221. /******/ return module.exports;
  222. /******/ }
  223. /******/
  224. /******/ // expose the modules object (__webpack_modules__)
  225. /******/ __webpack_require__.m = __webpack_modules__;
  226. /******/
  227. /************************************************************************/
  228. /******/ /* webpack/runtime/chunk loaded */
  229. /******/ (() => {
  230. /******/ var deferred = [];
  231. /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
  232. /******/ if(chunkIds) {
  233. /******/ priority = priority || 0;
  234. /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
  235. /******/ deferred[i] = [chunkIds, fn, priority];
  236. /******/ return;
  237. /******/ }
  238. /******/ var notFulfilled = Infinity;
  239. /******/ for (var i = 0; i < deferred.length; i++) {
  240. /******/ var [chunkIds, fn, priority] = deferred[i];
  241. /******/ var fulfilled = true;
  242. /******/ for (var j = 0; j < chunkIds.length; j++) {
  243. /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
  244. /******/ chunkIds.splice(j--, 1);
  245. /******/ } else {
  246. /******/ fulfilled = false;
  247. /******/ if(priority < notFulfilled) notFulfilled = priority;
  248. /******/ }
  249. /******/ }
  250. /******/ if(fulfilled) {
  251. /******/ deferred.splice(i--, 1)
  252. /******/ var r = fn();
  253. /******/ if (r !== undefined) result = r;
  254. /******/ }
  255. /******/ }
  256. /******/ return result;
  257. /******/ };
  258. /******/ })();
  259. /******/
  260. /******/ /* webpack/runtime/compat get default export */
  261. /******/ (() => {
  262. /******/ // getDefaultExport function for compatibility with non-harmony modules
  263. /******/ __webpack_require__.n = (module) => {
  264. /******/ var getter = module && module.__esModule ?
  265. /******/ () => (module['default']) :
  266. /******/ () => (module);
  267. /******/ __webpack_require__.d(getter, { a: getter });
  268. /******/ return getter;
  269. /******/ };
  270. /******/ })();
  271. /******/
  272. /******/ /* webpack/runtime/define property getters */
  273. /******/ (() => {
  274. /******/ // define getter functions for harmony exports
  275. /******/ __webpack_require__.d = (exports, definition) => {
  276. /******/ for(var key in definition) {
  277. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  278. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  279. /******/ }
  280. /******/ }
  281. /******/ };
  282. /******/ })();
  283. /******/
  284. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  285. /******/ (() => {
  286. /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  287. /******/ })();
  288. /******/
  289. /******/ /* webpack/runtime/make namespace object */
  290. /******/ (() => {
  291. /******/ // define __esModule on exports
  292. /******/ __webpack_require__.r = (exports) => {
  293. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  294. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  295. /******/ }
  296. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  297. /******/ };
  298. /******/ })();
  299. /******/
  300. /******/ /* webpack/runtime/jsonp chunk loading */
  301. /******/ (() => {
  302. /******/ // no baseURI
  303. /******/
  304. /******/ // object to store loaded and loading chunks
  305. /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
  306. /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
  307. /******/ var installedChunks = {
  308. /******/ "index": 0,
  309. /******/ "./style-index": 0
  310. /******/ };
  311. /******/
  312. /******/ // no chunk on demand loading
  313. /******/
  314. /******/ // no prefetching
  315. /******/
  316. /******/ // no preloaded
  317. /******/
  318. /******/ // no HMR
  319. /******/
  320. /******/ // no HMR manifest
  321. /******/
  322. /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
  323. /******/
  324. /******/ // install a JSONP callback for chunk loading
  325. /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
  326. /******/ var [chunkIds, moreModules, runtime] = data;
  327. /******/ // add "moreModules" to the modules object,
  328. /******/ // then flag all "chunkIds" as loaded and fire callback
  329. /******/ var moduleId, chunkId, i = 0;
  330. /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
  331. /******/ for(moduleId in moreModules) {
  332. /******/ if(__webpack_require__.o(moreModules, moduleId)) {
  333. /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
  334. /******/ }
  335. /******/ }
  336. /******/ if(runtime) var result = runtime(__webpack_require__);
  337. /******/ }
  338. /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
  339. /******/ for(;i < chunkIds.length; i++) {
  340. /******/ chunkId = chunkIds[i];
  341. /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
  342. /******/ installedChunks[chunkId][0]();
  343. /******/ }
  344. /******/ installedChunks[chunkId] = 0;
  345. /******/ }
  346. /******/ return __webpack_require__.O(result);
  347. /******/ }
  348. /******/
  349. /******/ var chunkLoadingGlobal = globalThis["webpackChunktsu_financial_progress_block"] = globalThis["webpackChunktsu_financial_progress_block"] || [];
  350. /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
  351. /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
  352. /******/ })();
  353. /******/
  354. /************************************************************************/
  355. /******/
  356. /******/ // startup
  357. /******/ // Load entry module and return exports
  358. /******/ // This entry module depends on other loaded chunks and execution need to be delayed
  359. /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-index"], () => (__webpack_require__("./src/index.js")))
  360. /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
  361. /******/
  362. /******/ })()
  363. ;
  364. //# sourceMappingURL=index.js.map