From e4c09002252c6a4adbbe58d12fec860ce8e02c88 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Wed, 15 May 2024 14:51:57 +0200 Subject: [PATCH] handling the date as real date --- blocks/date/build/block.json | 2 +- blocks/date/build/index.asset.php | 2 +- blocks/date/build/index.js | 98 ++++++++++++++++--- blocks/date/build/index.js.map | 2 +- blocks/date/src/block.json | 2 +- blocks/date/src/edit.js | 49 ++++++++-- blocks/date/src/save.js | 12 ++- blocks/infos-seminaires/build/index.asset.php | 2 +- blocks/infos-seminaires/build/index.css | 6 +- blocks/infos-seminaires/build/index.js | 58 +++++------ blocks/infos-seminaires/build/index.js.map | 2 +- blocks/infos-seminaires/build/style-index.css | 6 +- blocks/infos-seminaires/src/edit.js | 1 + 13 files changed, 173 insertions(+), 69 deletions(-) diff --git a/blocks/date/build/block.json b/blocks/date/build/block.json index 2615d5e..2954f11 100644 --- a/blocks/date/build/block.json +++ b/blocks/date/build/block.json @@ -16,7 +16,7 @@ "style": "file:./style-index.css", "attributes": { "date": { - "type": "string" + "type": "object" } } } \ No newline at end of file diff --git a/blocks/date/build/index.asset.php b/blocks/date/build/index.asset.php index 7d8c1e5..167b64c 100644 --- a/blocks/date/build/index.asset.php +++ b/blocks/date/build/index.asset.php @@ -1 +1 @@ - array('react', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => 'bb768b98b7557df9007c'); + array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '53c7398feb6b982ef96d'); diff --git a/blocks/date/build/index.js b/blocks/date/build/index.js index 7ffbf4e..4bd4458 100644 --- a/blocks/date/build/index.js +++ b/blocks/date/build/index.js @@ -17,8 +17,13 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss"); -/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); -/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _utils_getAdminLanguageFromCookies_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils/getAdminLanguageFromCookies.js */ "../../utils/getAdminLanguageFromCookies.js"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__); + + @@ -30,17 +35,38 @@ function Edit({ const { date } = attributes; - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.RichText, { - ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)({ + function handleDateChange(newDate) { + const options = { + weekday: "long", + year: "numeric", + month: "long", + day: "numeric" + }; + const currentLang = (0,_utils_getAdminLanguageFromCookies_js__WEBPACK_IMPORTED_MODULE_3__["default"])("wp-wpml_current_language"); + const currentLocale = currentLang === "nl" ? "nl-NL" : "fr-FR"; + const formattedTime = new Date(newDate).toLocaleDateString(currentLocale, options); + if (!formattedTime || !newDate) return; + const date = { + time: newDate, + formattedTime: formattedTime + }; + setAttributes({ + date + }); + } + const formattedDate = date && date.formattedTime ? date.formattedTime : ""; + const savedDate = date && date.time ? date.time : new Date().toString(); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.InspectorControls, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.PanelBody, { + title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Date", "multiblocks") + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.DatePicker, { + currentDate: savedDate, + onChange: handleDateChange + }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("time", { + ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.useBlockProps)({ className: `homegrade-blocks-date` }), - tagName: "time", - value: date, - onChange: date => setAttributes({ - date - }), - placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Insérer votre date ici", "multiblocks") - })); + datetime: savedDate + }, formattedDate)); } /***/ }), @@ -106,13 +132,43 @@ function save({ const { date } = attributes; - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, { + const formattedDate = date && date.formattedTime ? date.formattedTime : ""; + const savedDate = date && date.time ? date.time : new Date().toString(); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("time", { ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({ className: `homegrade-blocks-date` }), - tagName: "time", - value: date - }); + datetime: savedDate + }, formattedDate); +} + +/***/ }), + +/***/ "../../utils/getAdminLanguageFromCookies.js": +/*!**************************************************!*\ + !*** ../../utils/getAdminLanguageFromCookies.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getAdminLanguageFromCookies) +/* harmony export */ }); +function getAdminLanguageFromCookies(c_name) { + var c_value = document.cookie, + c_start = c_value.indexOf(" " + c_name + "="); + if (c_start == -1) c_start = c_value.indexOf(c_name + "="); + if (c_start == -1) { + c_value = null; + } else { + c_start = c_value.indexOf("=", c_start) + 1; + var c_end = c_value.indexOf(";", c_start); + if (c_end == -1) { + c_end = c_value.length; + } + c_value = unescape(c_value.substring(c_start, c_end)); + } + return c_value; } /***/ }), @@ -171,6 +227,16 @@ module.exports = window["wp"]["blocks"]; /***/ }), +/***/ "@wordpress/components": +/*!************************************!*\ + !*** external ["wp","components"] ***! + \************************************/ +/***/ ((module) => { + +module.exports = window["wp"]["components"]; + +/***/ }), + /***/ "@wordpress/i18n": /*!******************************!*\ !*** external ["wp","i18n"] ***! @@ -187,7 +253,7 @@ module.exports = window["wp"]["i18n"]; \************************/ /***/ ((module) => { -module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/date","version":"0.1.0","title":"Date (Texte)","category":"homegrade-blocks","icon":"smiley","description":"Pour afficher une date simple (format Texte)","supports":{"html":false},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"date":{"type":"string"}}}'); +module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/date","version":"0.1.0","title":"Date (Texte)","category":"homegrade-blocks","icon":"smiley","description":"Pour afficher une date simple (format Texte)","supports":{"html":false},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"date":{"type":"object"}}}'); /***/ }) diff --git a/blocks/date/build/index.js.map b/blocks/date/build/index.js.map index d8e1438..3a4be6d 100644 --- a/blocks/date/build/index.js.map +++ b/blocks/date/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;AAAqC;AACd;AAMU;AAElB,SAASI,IAAIA,CAAC;EAAEC,UAAU;EAAEC;AAAc,CAAC,EAAE;EAC3D,MAAM;IAAEC;EAAK,CAAC,GAAGF,UAAU;EAC3B,OACCG,oDAAA,CAAAC,2CAAA,QACCD,oDAAA,CAACN,6DAAQ;IAAA,GACJD,sEAAa,CAAC;MACjBS,SAAS,EAAG;IACb,CAAC,CAAC;IACFC,OAAO,EAAC,MAAM;IACdC,KAAK,EAAEL,IAAK;IACZM,QAAQ,EAAGN,IAAI,IAAKD,aAAa,CAAC;MAAEC;IAAK,CAAC,CAAE;IAC5CO,WAAW,EAAEd,mDAAE,CAAC,wBAAwB,EAAE,aAAa;EAAE,CACzD,CACA,CAAC;AAEL;;;;;;;;;;;;;;;;;;;;ACxBsD;AAChC;AAEI;AACA;AACU;AAEpCe,oEAAiB,CAACE,6CAAa,EAAE;EAChCE,IAAI,EAAE;IACLC,GAAG,EACFZ,oDAAA;MAAKa,KAAK,EAAC,MAAM;MAACC,MAAM,EAAC,IAAI;MAACC,OAAO,EAAC;IAAa,GAClDf,oDAAA,YACCA,oDAAA;MACCgB,KAAK,EAAC,OAAO;MACbC,CAAC,EAAC;IAAwjB,CAC1jB,CACC,CACC,CACL;IACDC,UAAU,EAAE;EACb,CAAC;EAEDC,IAAI,EAAEvB,6CAAI;EACVY,IAAIA,+CAAAA;AACL,CAAC,CAAC;;;;;;;;;;;;;;;;;;;ACxBgE;AACnD,SAASA,IAAIA,CAAC;EAAEX;AAAW,CAAC,EAAE;EAC5C,MAAM;IAAEE;EAAK,CAAC,GAAGF,UAAU;EAC3B,OACCG,oDAAA,CAACN,6DAAQ,CAAC0B,OAAO;IAAA,GACZ3B,kEAAa,CAACe,IAAI,CAAC;MACtBN,SAAS,EAAG;IACb,CAAC,CAAC;IACFC,OAAO,EAAC,MAAM;IACdC,KAAK,EAAEL;EAAK,CACZ,CAAC;AAEJ;;;;;;;;;;;ACZA;;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://multiblocks/./src/edit.js","webpack://multiblocks/./src/index.js","webpack://multiblocks/./src/save.js","webpack://multiblocks/./src/editor.scss","webpack://multiblocks/./src/style.scss","webpack://multiblocks/external window \"React\"","webpack://multiblocks/external window [\"wp\",\"blockEditor\"]","webpack://multiblocks/external window [\"wp\",\"blocks\"]","webpack://multiblocks/external window [\"wp\",\"i18n\"]","webpack://multiblocks/webpack/bootstrap","webpack://multiblocks/webpack/runtime/chunk loaded","webpack://multiblocks/webpack/runtime/compat get default export","webpack://multiblocks/webpack/runtime/define property getters","webpack://multiblocks/webpack/runtime/hasOwnProperty shorthand","webpack://multiblocks/webpack/runtime/make namespace object","webpack://multiblocks/webpack/runtime/jsonp chunk loading","webpack://multiblocks/webpack/before-startup","webpack://multiblocks/webpack/startup","webpack://multiblocks/webpack/after-startup"],"sourcesContent":["import { __ } from \"@wordpress/i18n\";\nimport \"./editor.scss\";\n\nimport {\n\tuseBlockProps,\n\tRichText,\n\tBlockControls,\n} from \"@wordpress/block-editor\";\n\nexport default function Edit({ attributes, setAttributes }) {\n\tconst { date } = attributes;\n\treturn (\n\t\t<>\n\t\t\t setAttributes({ date })}\n\t\t\t\tplaceholder={__(\"Insérer votre date ici\", \"multiblocks\")}\n\t\t\t/>\n\t\t\n\t);\n}\n","import { registerBlockType } from \"@wordpress/blocks\";\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport save from \"./save\";\nimport metadata from \"./block.json\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tsrc: (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t),\n\t\tforeground: \"#DF1E1E\",\n\t},\n\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps, RichText } from \"@wordpress/block-editor\";\nexport default function save({ attributes }) {\n\tconst { date } = attributes;\n\treturn (\n\t\t\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkmultiblocks\"] = globalThis[\"webpackChunkmultiblocks\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"./style-index\"], () => (__webpack_require__(\"./src/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["__","useBlockProps","RichText","BlockControls","Edit","attributes","setAttributes","date","createElement","Fragment","className","tagName","value","onChange","placeholder","registerBlockType","save","metadata","name","icon","src","width","height","viewBox","class","d","foreground","edit","Content"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AACd;AACiE;AAOvD;AAC6B;AAE/C,SAASQ,IAAIA,CAAC;EAAEC,UAAU;EAAEC;AAAc,CAAC,EAAE;EAC3D,MAAM;IAAEC;EAAK,CAAC,GAAGF,UAAU;EAE3B,SAASG,gBAAgBA,CAACC,OAAO,EAAE;IAClC,MAAMC,OAAO,GAAG;MACfC,OAAO,EAAE,MAAM;MACfC,IAAI,EAAE,SAAS;MACfC,KAAK,EAAE,MAAM;MACbC,GAAG,EAAE;IACN,CAAC;IAED,MAAMC,WAAW,GAAGlB,iFAA2B,CAAC,0BAA0B,CAAC;IAC3E,MAAMmB,aAAa,GAAGD,WAAW,KAAK,IAAI,GAAG,OAAO,GAAG,OAAO;IAE9D,MAAME,aAAa,GAAG,IAAIC,IAAI,CAACT,OAAO,CAAC,CAACU,kBAAkB,CACzDH,aAAa,EACbN,OACD,CAAC;IAED,IAAI,CA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;;;;;;;;ACfA;;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://multiblocks/./src/edit.js","webpack://multiblocks/./src/index.js","webpack://multiblocks/./src/save.js","webpack://multiblocks/../../utils/getAdminLanguageFromCookies.js","webpack://multiblocks/./src/editor.scss","webpack://multiblocks/./src/style.scss","webpack://multiblocks/external window \"React\"","webpack://multiblocks/external window [\"wp\",\"blockEditor\"]","webpack://multiblocks/external window [\"wp\",\"blocks\"]","webpack://multiblocks/external window [\"wp\",\"components\"]","webpack://multiblocks/external window [\"wp\",\"i18n\"]","webpack://multiblocks/webpack/bootstrap","webpack://multiblocks/webpack/runtime/chunk loaded","webpack://multiblocks/webpack/runtime/compat get default export","webpack://multiblocks/webpack/runtime/define property getters","webpack://multiblocks/webpack/runtime/hasOwnProperty shorthand","webpack://multiblocks/webpack/runtime/make namespace object","webpack://multiblocks/webpack/runtime/jsonp chunk loading","webpack://multiblocks/webpack/before-startup","webpack://multiblocks/webpack/startup","webpack://multiblocks/webpack/after-startup"],"sourcesContent":["import { __ } from \"@wordpress/i18n\";\nimport \"./editor.scss\";\nimport getAdminLanguageFromCookies from \"../../../utils/getAdminLanguageFromCookies.js\";\n\nimport {\n\tuseBlockProps,\n\tRichText,\n\tBlockControls,\n\tInspectorControls,\n} from \"@wordpress/block-editor\";\nimport { DatePicker, PanelBody } from \"@wordpress/components\";\n\nexport default function Edit({ attributes, setAttributes }) {\n\tconst { date } = attributes;\n\n\tfunction handleDateChange(newDate) {\n\t\tconst options = {\n\t\t\tweekday: \"long\",\n\t\t\tyear: \"numeric\",\n\t\t\tmonth: \"long\",\n\t\t\tday: \"numeric\",\n\t\t};\n\n\t\tconst currentLang = getAdminLanguageFromCookies(\"wp-wpml_current_language\");\n\t\tconst currentLocale = currentLang === \"nl\" ? \"nl-NL\" : \"fr-FR\";\n\n\t\tconst formattedTime = new Date(newDate).toLocaleDateString(\n\t\t\tcurrentLocale,\n\t\t\toptions,\n\t\t);\n\n\t\tif (!formattedTime || !newDate) return;\n\n\t\tconst date = {\n\t\t\ttime: newDate,\n\t\t\tformattedTime: formattedTime,\n\t\t};\n\n\t\tsetAttributes({ date });\n\t}\n\tconst formattedDate = date && date.formattedTime ? date.formattedTime : \"\";\n\tconst savedDate = date && date.time ? date.time : new Date().toString();\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t{formattedDate}\n\t\t\t\n\t\t\n\t);\n}\n","import { registerBlockType } from \"@wordpress/blocks\";\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport save from \"./save\";\nimport metadata from \"./block.json\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tsrc: (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t),\n\t\tforeground: \"#DF1E1E\",\n\t},\n\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps, RichText } from \"@wordpress/block-editor\";\nexport default function save({ attributes }) {\n\tconst { date } = attributes;\n\tconst formattedDate = date && date.formattedTime ? date.formattedTime : \"\";\n\tconst savedDate = date && date.time ? date.time : new Date().toString();\n\n\treturn (\n\t\t\n\t\t\t{formattedDate}\n\t\t\n\t);\n}\n","export default function getAdminLanguageFromCookies(c_name) {\r\n\tvar c_value = document.cookie,\r\n\t\tc_start = c_value.indexOf(\" \" + c_name + \"=\");\r\n\tif (c_start == -1) c_start = c_value.indexOf(c_name + \"=\");\r\n\tif (c_start == -1) {\r\n\t\tc_value = null;\r\n\t} else {\r\n\t\tc_start = c_value.indexOf(\"=\", c_start) + 1;\r\n\t\tvar c_end = c_value.indexOf(\";\", c_start);\r\n\t\tif (c_end == -1) {\r\n\t\t\tc_end = c_value.length;\r\n\t\t}\r\n\t\tc_value = unescape(c_value.substring(c_start, c_end));\r\n\t}\r\n\treturn c_value;\r\n}\r\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkmultiblocks\"] = globalThis[\"webpackChunkmultiblocks\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"./style-index\"], () => (__webpack_require__(\"./src/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["__","getAdminLanguageFromCookies","useBlockProps","RichText","BlockControls","InspectorControls","DatePicker","PanelBody","Edit","attributes","setAttributes","date","handleDateChange","newDate","options","weekday","year","month","day","currentLang","currentLocale","formattedTime","Date","toLocaleDateString","time","formattedDate","savedDate","toString","createElement","Fragment","title","currentDate","onChange","className","datetime","registerBlockType","save","metadata","name","icon","src","width","height","viewBox","class","d","foreground","edit","c_name","c_value","document","cookie","c_start","indexOf","c_end","length","unescape","substring"],"sourceRoot":""} \ No newline at end of file diff --git a/blocks/date/src/block.json b/blocks/date/src/block.json index 49c5c1f..92f32ab 100644 --- a/blocks/date/src/block.json +++ b/blocks/date/src/block.json @@ -16,7 +16,7 @@ "style": "file:./style-index.css", "attributes": { "date": { - "type": "string" + "type": "object" } } } \ No newline at end of file diff --git a/blocks/date/src/edit.js b/blocks/date/src/edit.js index 1865654..d9fb86e 100644 --- a/blocks/date/src/edit.js +++ b/blocks/date/src/edit.js @@ -1,25 +1,62 @@ import { __ } from "@wordpress/i18n"; import "./editor.scss"; +import getAdminLanguageFromCookies from "../../../utils/getAdminLanguageFromCookies.js"; import { useBlockProps, RichText, BlockControls, + InspectorControls, } from "@wordpress/block-editor"; +import { DatePicker, PanelBody } from "@wordpress/components"; export default function Edit({ attributes, setAttributes }) { const { date } = attributes; + + function handleDateChange(newDate) { + const options = { + weekday: "long", + year: "numeric", + month: "long", + day: "numeric", + }; + + const currentLang = getAdminLanguageFromCookies("wp-wpml_current_language"); + const currentLocale = currentLang === "nl" ? "nl-NL" : "fr-FR"; + + const formattedTime = new Date(newDate).toLocaleDateString( + currentLocale, + options, + ); + + if (!formattedTime || !newDate) return; + + const date = { + time: newDate, + formattedTime: formattedTime, + }; + + setAttributes({ date }); + } + const formattedDate = date && date.formattedTime ? date.formattedTime : ""; + const savedDate = date && date.time ? date.time : new Date().toString(); + return ( <> - + + + + + + ); } diff --git a/blocks/date/src/save.js b/blocks/date/src/save.js index 8b81b05..5c8b1a5 100644 --- a/blocks/date/src/save.js +++ b/blocks/date/src/save.js @@ -1,13 +1,17 @@ import { useBlockProps, RichText } from "@wordpress/block-editor"; export default function save({ attributes }) { const { date } = attributes; + const formattedDate = date && date.formattedTime ? date.formattedTime : ""; + const savedDate = date && date.time ? date.time : new Date().toString(); + return ( - + datetime={savedDate} + > + {formattedDate} + ); } diff --git a/blocks/infos-seminaires/build/index.asset.php b/blocks/infos-seminaires/build/index.asset.php index e1d0d2b..3a9f2a2 100644 --- a/blocks/infos-seminaires/build/index.asset.php +++ b/blocks/infos-seminaires/build/index.asset.php @@ -1 +1 @@ - array('wp-block-editor', 'wp-blocks', 'wp-element', 'wp-i18n'), 'version' => 'a0d57d495c6ea3146884'); + array('react', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '5c07e753cb76ec69277b'); diff --git a/blocks/infos-seminaires/build/index.css b/blocks/infos-seminaires/build/index.css index b632374..2a7ab80 100644 --- a/blocks/infos-seminaires/build/index.css +++ b/blocks/infos-seminaires/build/index.css @@ -1,6 +1,6 @@ -/*!****************************************************************************************************************************************************************************************************************************************!*\ - !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***! - \****************************************************************************************************************************************************************************************************************************************/ +/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/.pnpm/css-loader@6.10.0_webpack@5.90.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.4.35_webpack@5.90.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@12.6.0_sass@1.71.1_webpack@5.90.3/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***! + \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /** * The following styles get applied inside the editor only. * diff --git a/blocks/infos-seminaires/build/index.js b/blocks/infos-seminaires/build/index.js index 4c7043a..c478fac 100644 --- a/blocks/infos-seminaires/build/index.js +++ b/blocks/infos-seminaires/build/index.js @@ -12,8 +12,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ Edit) /* harmony export */ }); -/* 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 react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss"); @@ -24,12 +24,12 @@ __webpack_require__.r(__webpack_exports__); function Edit() { - return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)({ className: `homegrade-blocks-infos-seminaires` }) - }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InnerBlocks, { - allowedBlocks: ["core/paragraph", "core/heading", "core/buttons", "core/button", "core/image", "homegrade-content-blocks/content-heading", "homegrade-content-blocks/icon"], + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InnerBlocks, { + allowedBlocks: ["core/paragraph", "core/heading", "core/buttons", "core/button", "core/image", "homegrade-content-blocks/content-heading", "homegrade-content-blocks/icon", "homegrade-content-blocks/date"], template: [["homegrade-content-blocks/icon", { className: "homegrade-blocks-infos-seminaires__icon" }], ["homegrade-content-blocks/content-heading", { @@ -65,8 +65,8 @@ function Edit() { /***/ ((__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__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__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 _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss"); @@ -81,10 +81,10 @@ __webpack_require__.r(__webpack_exports__); (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_5__.name, { icon: { - src: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", { + src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 58.01 52.01" - }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { class: "cls-1", d: "M43,10.73v4.56l3.98-2.28-3.98-2.28ZM25.56,27.01h-5.12c-3,0-5.44,2.44-5.44,5.44v2.56c0,1.1.9,2,2,2h12c1.1,0,2-.9,2-2v-2.56c0-3-2.44-5.44-5.44-5.44ZM23,25.01h0c2.21,0,4-1.79,4-4s-1.79-4-4-4-4,1.79-4,4c0,2.21,1.79,4,4,4ZM56,44.01h-1v-22.71c.35-.42.67-.86.97-1.33,3.86-6.05,2.08-14.08-3.97-17.94-6.05-3.86-14.08-2.08-17.94,3.97H5.04c-1.11,0-2.02.89-2.04,2v36h-1c-1.1,0-2,.9-2,2v4c0,1.1.9,2,2,2h54c1.1,0,2-.9,2-2v-4c0-1.1-.9-2-2-2ZM41,9.01c0-.36.19-.69.5-.87.31-.18.69-.18,1,0l7,4c.15.09.28.21.36.36.28.48.12,1.1-.36,1.38l-7,4c-.31.18-.69.18-1,0-.31-.18-.5-.51-.5-.87v-8ZM50,25.01v16H8V11.01h24.17c-.11.66-.16,1.33-.17,2,0,1.72.34,3.42,1,5,2.76,6.63,10.37,9.76,17,7ZM5.04,8.01h27.96c-.13.33-.25.66-.36,1H7c-.55,0-1,.45-1,1v32c0,.55.45,1,1,1h44c.55,0,1-.45,1-1v-18.07c.35-.22.67-.46,1-.7v20.77H5l.04-36ZM36,46.01v1h-14v-1h14ZM56,50.01H2v-4h18v2c0,.55.45,1,1,1h16c.55,0,1-.45,1-1v-2h18v4Z" }))), @@ -106,8 +106,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ save) /* harmony export */ }); -/* 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 react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); @@ -116,11 +116,11 @@ __webpack_require__.r(__webpack_exports__); function save({ attributes }) { - return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({ className: `homegrade-blocks-infos-seminaires` }) - }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null)); + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null)); } /***/ }), @@ -147,6 +147,16 @@ __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin +/***/ }), + +/***/ "react": +/*!************************!*\ + !*** external "React" ***! + \************************/ +/***/ ((module) => { + +module.exports = window["React"]; + /***/ }), /***/ "@wordpress/block-editor": @@ -169,16 +179,6 @@ module.exports = window["wp"]["blocks"]; /***/ }), -/***/ "@wordpress/element": -/*!*********************************!*\ - !*** external ["wp","element"] ***! - \*********************************/ -/***/ ((module) => { - -module.exports = window["wp"]["element"]; - -/***/ }), - /***/ "@wordpress/i18n": /*!******************************!*\ !*** external ["wp","i18n"] ***! @@ -195,7 +195,7 @@ module.exports = window["wp"]["i18n"]; \************************/ /***/ ((module) => { -module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/infos-seminaires","version":"0.1.0","title":"Infos Séminaires","category":"homegrade-blocks","icon":"smiley","description":"Pour rajouter des informations sur un séminaire à venir dans une news conférence et atelier","keywords":["seminaire","webinaire","conférence"],"supports":{"html":false},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'); +module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/infos-seminaires","version":"0.1.0","title":"Infos Séminaires","category":"homegrade-blocks","icon":"smiley","description":"Pour rajouter des informations sur un séminaire à venir dans une news conférence et atelier","keywords":["seminaire","webinaire","conférence"],"supports":{"html":false},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'); /***/ }) @@ -241,9 +241,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json /******/ } /******/ var notFulfilled = Infinity; /******/ for (var i = 0; i < deferred.length; i++) { -/******/ var chunkIds = deferred[i][0]; -/******/ var fn = deferred[i][1]; -/******/ var priority = deferred[i][2]; +/******/ var [chunkIds, fn, priority] = deferred[i]; /******/ var fulfilled = true; /******/ for (var j = 0; j < chunkIds.length; j++) { /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { @@ -329,9 +327,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ var runtime = data[2]; +/******/ var [chunkIds, moreModules, runtime] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0; @@ -354,7 +350,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json /******/ return __webpack_require__.O(result); /******/ } /******/ -/******/ var chunkLoadingGlobal = self["webpackChunkmultiblocks"] = self["webpackChunkmultiblocks"] || []; +/******/ var chunkLoadingGlobal = globalThis["webpackChunkmultiblocks"] = globalThis["webpackChunkmultiblocks"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); /******/ })(); diff --git a/blocks/infos-seminaires/build/index.js.map b/blocks/infos-seminaires/build/index.js.map index 7f8f98d..bd5be06 100644 --- a/blocks/infos-seminaires/build/index.js.map +++ b/blocks/infos-seminaires/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;AAAqC;AACd;AAOU;AAElB,SAASK,IAAIA,CAAA,EAAG;EAC9B,OACCC,iEAAA;IAAA,GACKL,sEAAa,CAAC;MACjBM,SAAS,EAAG;IACb,CAAC;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A,CAAC;EAAEW;AAAW,CAAC,EAAE;EAC5C,OACCvB,iEAAA;IAAA,GACKL,kEAAa,CAACiB,IAAI,CAAC;MACtBX,SAAS,EAAG;IACb,CAAC;EAAC,GAEFD,iEAAA,CAACF,gEAAW,CAAC0B,OAAO,MAAE,CAClB,CAAC;AAER;;;;;;;;;;;ACZA;;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC7BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEnDA;UACA;UACA;UACA;UACA","sources":["webpack://multiblocks/./src/edit.js","webpack://multiblocks/./src/index.js","webpack://multiblocks/./src/save.js","webpack://multiblocks/./src/editor.scss?0339","webpack://multiblocks/./src/style.scss?75bd","webpack://multiblocks/external window [\"wp\",\"blockEditor\"]","webpack://multiblocks/external window [\"wp\",\"blocks\"]","webpack://multiblocks/external window [\"wp\",\"element\"]","webpack://multiblocks/external window [\"wp\",\"i18n\"]","webpack://multiblocks/webpack/bootstrap","webpack://multiblocks/webpack/runtime/chunk loaded","webpack://multiblocks/webpack/runtime/compat get default export","webpack://multiblocks/webpack/runtime/define property getters","webpack://multiblocks/webpack/runtime/hasOwnProperty shorthand","webpack://multiblocks/webpack/runtime/make namespace object","webpack://multiblocks/webpack/runtime/jsonp chunk loading","webpack://multiblocks/webpack/before-startup","webpack://multiblocks/webpack/startup","webpack://multiblocks/webpack/after-startup"],"sourcesContent":["import { __ } from \"@wordpress/i18n\";\nimport \"./editor.scss\";\n\nimport {\n\tuseBlockProps,\n\tRichText,\n\tBlockControls,\n\tInnerBlocks,\n} from \"@wordpress/block-editor\";\n\nexport default function Edit() {\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t);\n}\n","import { registerBlockType } from \"@wordpress/blocks\";\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport save from \"./save\";\nimport metadata from \"./block.json\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tsrc: (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t),\n\t\tforeground: \"#DF1E1E\",\n\t},\n\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps } from \"@wordpress/block-editor\";\nimport { InnerBlocks } from \"@wordpress/block-editor\";\nexport default function save({ attributes }) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmultiblocks\"] = self[\"webpackChunkmultiblocks\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"./style-index\"], () => (__webpack_require__(\"./src/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["__","useBlockProps","RichText","BlockControls","InnerBlocks","Edit","createElement","className","allowedBlocks","template","title","headingLevel","content","placeholder","style","fontWeight","text","registerBlockType","save","metadata","name","icon","src","xmlns","viewBox","class","d","foreground","edit","attributes","Content"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;AAAqC;AACd;AAOU;AAElB,SAASK,IAAIA,CAAA,EAAG;EAC9B,OACCC,oDAAA;IAAA,GACKL,sEAAa,CAAC;MACjBM,SAAS,EAAG;IACb,CAAC;EAAC,GAEFD,oDAAA,CAACF,gEAAW;IACXI,aAAa,EAAE,CACd,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,aAAa,EACb,YAAY,EACZ,0CAA0C,EAC1C,+BAA+B,EAC/B,+BAA+B,CAC9B;IACFC,QAAQ,EAAE,CACT,CACC,+BAA+B,EAC/B;MAAEF,SAAS,EAAE;IAA0C,CAAC,CACxD,EACD,CACC,0CAA0C,EAC1C;MACCG,KAAK,EAAE,mBAAmB;MAC1BC,YAAY,EAAE,IAAI;MAClBJ,SAAS,EAAE;IACZ,CAAC,CACD,EACD,CACC,0CAA0C,EAC1C;MACCG,KAAK,EAAE,oBAAoB;MAC3BC,YAAY,EAAE,IAAI;MAClBJ,SAAS,EAAE;IACZ,CAAC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A;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://multiblocks/./src/edit.js","webpack://multiblocks/./src/index.js","webpack://multiblocks/./src/save.js","webpack://multiblocks/./src/editor.scss?d446","webpack://multiblocks/./src/style.scss?d1e4","webpack://multiblocks/external window \"React\"","webpack://multiblocks/external window [\"wp\",\"blockEditor\"]","webpack://multiblocks/external window [\"wp\",\"blocks\"]","webpack://multiblocks/external window [\"wp\",\"i18n\"]","webpack://multiblocks/webpack/bootstrap","webpack://multiblocks/webpack/runtime/chunk loaded","webpack://multiblocks/webpack/runtime/compat get default export","webpack://multiblocks/webpack/runtime/define property getters","webpack://multiblocks/webpack/runtime/hasOwnProperty shorthand","webpack://multiblocks/webpack/runtime/make namespace object","webpack://multiblocks/webpack/runtime/jsonp chunk loading","webpack://multiblocks/webpack/before-startup","webpack://multiblocks/webpack/startup","webpack://multiblocks/webpack/after-startup"],"sourcesContent":["import { __ } from \"@wordpress/i18n\";\nimport \"./editor.scss\";\n\nimport {\n\tuseBlockProps,\n\tRichText,\n\tBlockControls,\n\tInnerBlocks,\n} from \"@wordpress/block-editor\";\n\nexport default function Edit() {\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t);\n}\n","import { registerBlockType } from \"@wordpress/blocks\";\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport save from \"./save\";\nimport metadata from \"./block.json\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tsrc: (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t),\n\t\tforeground: \"#DF1E1E\",\n\t},\n\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps } from \"@wordpress/block-editor\";\nimport { InnerBlocks } from \"@wordpress/block-editor\";\nexport default function save({ attributes }) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkmultiblocks\"] = globalThis[\"webpackChunkmultiblocks\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"./style-index\"], () => (__webpack_require__(\"./src/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["__","useBlockProps","RichText","BlockControls","InnerBlocks","Edit","createElement","className","allowedBlocks","template","title","headingLevel","content","placeholder","style","fontWeight","text","registerBlockType","save","metadata","name","icon","src","xmlns","viewBox","class","d","foreground","edit","attributes","Content"],"sourceRoot":""} \ No newline at end of file diff --git a/blocks/infos-seminaires/build/style-index.css b/blocks/infos-seminaires/build/style-index.css index 74830d6..f197543 100644 --- a/blocks/infos-seminaires/build/style-index.css +++ b/blocks/infos-seminaires/build/style-index.css @@ -1,6 +1,6 @@ -/*!***************************************************************************************************************************************************************************************************************************************!*\ - !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***! - \***************************************************************************************************************************************************************************************************************************************/ +/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/.pnpm/css-loader@6.10.0_webpack@5.90.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.4.35_webpack@5.90.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@12.6.0_sass@1.71.1_webpack@5.90.3/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***! + \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /** * The following styles get applied both on the front of your site * and in the editor. diff --git a/blocks/infos-seminaires/src/edit.js b/blocks/infos-seminaires/src/edit.js index 0086090..b1aeea3 100644 --- a/blocks/infos-seminaires/src/edit.js +++ b/blocks/infos-seminaires/src/edit.js @@ -24,6 +24,7 @@ export default function Edit() { "core/image", "homegrade-content-blocks/content-heading", "homegrade-content-blocks/icon", + "homegrade-content-blocks/date", ]} template={[ [