index.js 17 KB

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