From 96069807c63c1bc2b3d9c213cbc2360f504e7ad3 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Fri, 24 Nov 2023 14:17:16 +0100 Subject: [PATCH] working v1 --- blocks/labelled-picture/build/block.json | 2 +- blocks/labelled-picture/build/index.asset.php | 2 +- blocks/labelled-picture/build/index.css | 9 -- blocks/labelled-picture/build/index.js | 87 +++++++++++++++---- blocks/labelled-picture/build/index.js.map | 2 +- blocks/labelled-picture/build/style-index.css | 12 --- blocks/labelled-picture/src/block.json | 2 +- blocks/labelled-picture/src/edit.js | 41 +++++---- blocks/labelled-picture/src/editor.scss | 9 -- blocks/labelled-picture/src/save.js | 21 +++-- blocks/labelled-picture/src/style.scss | 12 --- 11 files changed, 109 insertions(+), 90 deletions(-) diff --git a/blocks/labelled-picture/build/block.json b/blocks/labelled-picture/build/block.json index 7024ad5..d38d9d9 100644 --- a/blocks/labelled-picture/build/block.json +++ b/blocks/labelled-picture/build/block.json @@ -3,7 +3,7 @@ "apiVersion": 2, "name": "homegrade-content-blocks/labelled-picture", "version": "0.1.0", - "title": "Image Sticker-Légende", + "title": "Image + Légende Autocollante", "category": "homegrade-blocks", "icon": "smiley", "description": "Bloc image contenant une légende autocollante", diff --git a/blocks/labelled-picture/build/index.asset.php b/blocks/labelled-picture/build/index.asset.php index a9f7d3c..f350f6d 100644 --- a/blocks/labelled-picture/build/index.asset.php +++ b/blocks/labelled-picture/build/index.asset.php @@ -1 +1 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'c78e69ebe27d4272f3d4'); + array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '49e83b88e7e47ccb671c'); diff --git a/blocks/labelled-picture/build/index.css b/blocks/labelled-picture/build/index.css index efb8ea8..d6689e0 100644 --- a/blocks/labelled-picture/build/index.css +++ b/blocks/labelled-picture/build/index.css @@ -1,13 +1,4 @@ /*!****************************************************************************************************************************************************************************************************************************************!*\ !*** 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 ***! \****************************************************************************************************************************************************************************************************************************************/ -/** - * The following styles get applied inside the editor only. - * - * Replace them with your own styles or remove the file completely. - */ -.wp-block-create-block-multiblocks { - border: 1px dotted #f00; -} -/*# sourceMappingURL=index.css.map*/ \ No newline at end of file diff --git a/blocks/labelled-picture/build/index.js b/blocks/labelled-picture/build/index.js index 4f801d5..e0c32bf 100644 --- a/blocks/labelled-picture/build/index.js +++ b/blocks/labelled-picture/build/index.js @@ -21,6 +21,8 @@ __webpack_require__.r(__webpack_exports__); /* 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 _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/@wordpress/icons/build-module/library/trash.js"); + @@ -63,34 +65,31 @@ function Edit({ noticeOperations.createErrorNotice(message); } return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelBody, { - title: "Source de l'image" - }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + title: "Source de l'image", + className: "homegrade-blocks-components-image__panel-body " + }, pictureUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", { + src: pictureUrl, + alt: pictureAlt + }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { className: "media-replace-container" }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.MediaReplaceFlow, { - mediaId: pictureUrlId, + mediaId: pictureId, mediaUrl: pictureUrl, allowedTypes: ["image"], accept: "image/*", onSelect: updatePictureImg, name: !pictureUrl ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Ajouter", "homegrade-blocks__texte-backoffice") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Remplacer", "homegrade-blocks__texte-backoffice") - }), pictureUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Button, { + }), pictureUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Button, { className: "custom-flow-button", variant: "primary", - icon: trash, + icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"], label: "Supprimer", - onClick: removeLateralCoverAttributes - }))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.FocalPointPicker, { - label: "position", - url: pictureUrl, - dimensions: { - width: 400, - height: 100 - } - }))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", { + onClick: removePictureImg + }))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Tip, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, "Le texte de votre L\xE9gende est automatiquement attribu\xE9 depuis le champ \"L\xE9gende\" de votre image dans la gallerie des m\xE9dias")))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, pictureUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("figure", { ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)({ className: `homegrade-blocks-labelled-picture` }) - }, pictureUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("figure", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", { + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", { src: pictureUrl, alt: pictureAlt }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("figcaption", null, pictureCaption)), !pictureUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.MediaPlaceholder, { @@ -171,11 +170,20 @@ __webpack_require__.r(__webpack_exports__); function save({ attributes }) { - return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", { + const { + pictureUrl, + pictureAlt, + pictureId, + pictureCaption + } = attributes; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, pictureUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("figure", { ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({ - className: `homegrade-blocks-starter` + className: `homegrade-blocks-labelled-picture` }) - }, "Multiblocks – salut from the saved content!"); + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", { + src: pictureUrl, + alt: pictureAlt + }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("figcaption", null, pictureCaption))); } /***/ }), @@ -202,6 +210,37 @@ __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin +/***/ }), + +/***/ "../../node_modules/@wordpress/icons/build-module/library/trash.js": +/*!*************************************************************************!*\ + !*** ../../node_modules/@wordpress/icons/build-module/library/trash.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* 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 _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives"); +/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); + + +/** + * WordPress dependencies + */ + +const trash = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.Path, { + d: "M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z" +})); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (trash); +//# sourceMappingURL=trash.js.map + /***/ }), /***/ "@wordpress/block-editor": @@ -254,13 +293,23 @@ module.exports = window["wp"]["i18n"]; /***/ }), +/***/ "@wordpress/primitives": +/*!************************************!*\ + !*** external ["wp","primitives"] ***! + \************************************/ +/***/ ((module) => { + +module.exports = window["wp"]["primitives"]; + +/***/ }), + /***/ "./src/block.json": /*!************************!*\ !*** ./src/block.json ***! \************************/ /***/ ((module) => { -module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/labelled-picture","version":"0.1.0","title":"Image Sticker-Légende","category":"homegrade-blocks","icon":"smiley","description":"Bloc image contenant une légende autocollante","supports":{"html":false},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"pictureUrl":{"type":"string"},"pictureAlt":{"type":"string"},"pictureId":{"type":"number"},"pictureCaption":{"type":"string"}}}'); +module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/labelled-picture","version":"0.1.0","title":"Image + Légende Autocollante","category":"homegrade-blocks","icon":"smiley","description":"Bloc image contenant une légende autocollante","supports":{"html":false},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"pictureUrl":{"type":"string"},"pictureAlt":{"type":"string"},"pictureId":{"type":"number"},"pictureCaption":{"type":"string"}}}'); /***/ }) diff --git a/blocks/labelled-picture/build/index.js.map b/blocks/labelled-picture/build/index.js.map index 76644d8..d16186f 100644 --- a/blocks/labelled-picture/build/index.js.map +++ b/blocks/labelled-picture/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA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EA;;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","webpack://multiblocks/./src/style.scss","webpack://multiblocks/external window [\"wp\",\"blockEditor\"]","webpack://multiblocks/external window [\"wp\",\"blocks\"]","webpack://multiblocks/external window [\"wp\",\"components\"]","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\";\nimport {\n\tuseBlockProps,\n\tMediaPlaceholder,\n\tBlockControls,\n\tInspectorControls,\n\tMediaReplaceFlow,\n} from \"@wordpress/block-editor\";\n\nimport {\n\tToolbarGroup,\n\tToolbarButton,\n\tSpinner,\n\twithNotices,\n\tFocalPointPicker,\n\tPanelBody,\n\tToggleControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from \"@wordpress/components\";\n\nexport default function Edit({\n\tattributes,\n\tsetAttributes,\n\tnoticeOperations,\n\tnoticeList,\n\tnoticeUI,\n}) {\n\tconst { pictureUrl, pictureAlt, pictureId, pictureCaption } = attributes;\n\n\tfunction removePictureImg() {\n\t\tsetAttributes({\n\t\t\tpictureUrl: undefined,\n\t\t\tpictureId: undefined,\n\t\t\tpictureCaption: undefined,\n\t\t\tpictureAlt: \"\",\n\t\t});\n\t}\n\n\tfunction updatePictureImg(image) {\n\t\tif (!image || !image.url) {\n\t\t\tremovePictureImg();\n\t\t}\n\t\tsetAttributes({\n\t\t\tpictureUrl: image.url,\n\t\t\tpictureId: image.id,\n\t\t\tpictureAlt: image.alt,\n\t\t\tpictureCaption: image.caption,\n\t\t});\n\t}\n\tfunction onUploadError(message) {\n\t\tnoticeOperations.removeAllNotices();\n\t\tnoticeOperations.createErrorNotice(message);\n\t}\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\t\t\n\t\t\t\t\t\t{pictureUrl && (\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t)}\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t\t\t{pictureUrl && (\n\t\t\t\t\t
\n\t\t\t\t\t\t{pictureAlt}\n\t\t\t\t\t\t
{pictureCaption}
\n\t\t\t\t\t
\n\t\t\t\t)}\n\n\t\t\t\t{!pictureUrl && (\n\t\t\t\t\t\n\t\t\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\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps } from \"@wordpress/block-editor\";\n\nexport default function save({ attributes }) {\n\treturn (\n\t\t\n\t\t\t{\"Multiblocks – salut from the saved content!\"}\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\"][\"components\"];","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","MediaPlaceholder","BlockControls","InspectorControls","MediaReplaceFlow","ToolbarGroup","ToolbarButton","Spinner","withNotices","FocalPointPicker","PanelBody","ToggleControl","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","Edit","attributes","setAttributes","noticeOperations","noticeList","noticeUI","pictureUrl","pictureAlt","pictureId","pictureCaption","removePictureImg","undefined","updatePictureImg","image","url","id","alt","caption","onUploadError","message","removeAllNotices","createErrorNotice","createElement","Fragment","title","className","mediaId","pictureUrlId","mediaUrl","allowedTypes","accept","onSelect","name","Button","variant","icon","trash","label","onClick","removeLateralCoverAttributes","dimensions","width","height","src","disableMediaButtons","notices","onError","registerBlockType","save","metadata","xmlns","viewBox","class","d","foreground","edit"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;A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;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","webpack://multiblocks/./src/style.scss","webpack://multiblocks/../../node_modules/@wordpress/icons/build-module/library/trash.js","webpack://multiblocks/external window [\"wp\",\"blockEditor\"]","webpack://multiblocks/external window [\"wp\",\"blocks\"]","webpack://multiblocks/external window [\"wp\",\"components\"]","webpack://multiblocks/external window [\"wp\",\"element\"]","webpack://multiblocks/external window [\"wp\",\"i18n\"]","webpack://multiblocks/external window [\"wp\",\"primitives\"]","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 {\n\tuseBlockProps,\n\tMediaPlaceholder,\n\tBlockControls,\n\tInspectorControls,\n\tMediaReplaceFlow,\n} from \"@wordpress/block-editor\";\n\nimport {\n\tButton,\n\tToolbarGroup,\n\tToolbarButton,\n\tSpinner,\n\twithNotices,\n\tFocalPointPicker,\n\tPanelBody,\n\tTip,\n\tToggleControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from \"@wordpress/components\";\nimport { trash } from \"@wordpress/icons\";\n\nexport default function Edit({\n\tattributes,\n\tsetAttributes,\n\tnoticeOperations,\n\tnoticeList,\n\tnoticeUI,\n}) {\n\tconst { pictureUrl, pictureAlt, pictureId, pictureCaption } = attributes;\n\n\tfunction removePictureImg() {\n\t\tsetAttributes({\n\t\t\tpictureUrl: undefined,\n\t\t\tpictureId: undefined,\n\t\t\tpictureCaption: undefined,\n\t\t\tpictureAlt: \"\",\n\t\t});\n\t}\n\n\tfunction updatePictureImg(image) {\n\t\tif (!image || !image.url) {\n\t\t\tremovePictureImg();\n\t\t}\n\t\tsetAttributes({\n\t\t\tpictureUrl: image.url,\n\t\t\tpictureId: image.id,\n\t\t\tpictureAlt: image.alt,\n\t\t\tpictureCaption: image.caption,\n\t\t});\n\t}\n\tfunction onUploadError(message) {\n\t\tnoticeOperations.removeAllNotices();\n\t\tnoticeOperations.createErrorNotice(message);\n\t}\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{pictureUrl && {pictureAlt}}\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t{pictureUrl && (\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t)}\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\tLe texte de votre Légende est automatiquement attribué depuis le\n\t\t\t\t\t\t\tchamp \"Légende\" de votre image dans la gallerie des médias\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t\t{pictureUrl && (\n\t\t\t\t\t\n\t\t\t\t\t\t{pictureAlt}\n\t\t\t\t\t\t
{pictureCaption}
\n\t\t\t\t\t\n\t\t\t\t)}\n\n\t\t\t\t{!pictureUrl && (\n\t\t\t\t\t\n\t\t\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\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps } from \"@wordpress/block-editor\";\n\nexport default function save({ attributes }) {\n\tconst { pictureUrl, pictureAlt, pictureId, pictureCaption } = attributes;\n\n\treturn (\n\t\t<>\n\t\t\t{pictureUrl && (\n\t\t\t\t\n\t\t\t\t\t{pictureAlt}\n\t\t\t\t\t
{pictureCaption}
\n\t\t\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 {};","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst trash = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z\"\n}));\nexport default trash;\n//# sourceMappingURL=trash.js.map","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","// 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","MediaPlaceholder","BlockControls","InspectorControls","MediaReplaceFlow","Button","ToolbarGroup","ToolbarButton","Spinner","withNotices","FocalPointPicker","PanelBody","Tip","ToggleControl","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","trash","Edit","attributes","setAttributes","noticeOperations","noticeList","noticeUI","pictureUrl","pictureAlt","pictureId","pictureCaption","removePictureImg","undefined","updatePictureImg","image","url","id","alt","caption","onUploadError","message","removeAllNotices","createErrorNotice","createElement","Fragment","title","className","src","mediaId","mediaUrl","allowedTypes","accept","onSelect","name","variant","icon","label","onClick","disableMediaButtons","notices","onError","registerBlockType","save","metadata","xmlns","viewBox","class","d","foreground","edit"],"sourceRoot":""} \ No newline at end of file diff --git a/blocks/labelled-picture/build/style-index.css b/blocks/labelled-picture/build/style-index.css index d3562f8..2488c9e 100644 --- a/blocks/labelled-picture/build/style-index.css +++ b/blocks/labelled-picture/build/style-index.css @@ -1,16 +1,4 @@ /*!***************************************************************************************************************************************************************************************************************************************!*\ !*** 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 ***! \***************************************************************************************************************************************************************************************************************************************/ -/** - * The following styles get applied both on the front of your site - * and in the editor. - * - * Replace them with your own styles or remove the file completely. - */ -.wp-block-create-block-multiblocks { - background-color: #21759b; - color: #fff; - padding: 2px; -} -/*# sourceMappingURL=style-index.css.map*/ \ No newline at end of file diff --git a/blocks/labelled-picture/src/block.json b/blocks/labelled-picture/src/block.json index 4a5575c..71f896d 100644 --- a/blocks/labelled-picture/src/block.json +++ b/blocks/labelled-picture/src/block.json @@ -3,7 +3,7 @@ "apiVersion": 2, "name": "homegrade-content-blocks/labelled-picture", "version": "0.1.0", - "title": "Image Sticker-Légende", + "title": "Image + Légende Autocollante", "category": "homegrade-blocks", "icon": "smiley", "description": "Bloc image contenant une légende autocollante", diff --git a/blocks/labelled-picture/src/edit.js b/blocks/labelled-picture/src/edit.js index 8fa1cbf..c28f58a 100644 --- a/blocks/labelled-picture/src/edit.js +++ b/blocks/labelled-picture/src/edit.js @@ -9,16 +9,19 @@ import { } from "@wordpress/block-editor"; import { + Button, ToolbarGroup, ToolbarButton, Spinner, withNotices, FocalPointPicker, PanelBody, + Tip, ToggleControl, __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, } from "@wordpress/components"; +import { trash } from "@wordpress/icons"; export default function Edit({ attributes, @@ -56,10 +59,14 @@ export default function Edit({ return ( <> - + + {pictureUrl && {pictureAlt}}
)} - + +

+ Le texte de votre Légende est automatiquement attribué depuis le + champ "Légende" de votre image dans la gallerie des médias +

+
-
+
{pictureUrl && ( -
+
{pictureAlt}
{pictureCaption}
@@ -115,7 +120,7 @@ export default function Edit({ onError={onUploadError} /> )} -
+ ); } diff --git a/blocks/labelled-picture/src/editor.scss b/blocks/labelled-picture/src/editor.scss index 0ba9f21..e69de29 100644 --- a/blocks/labelled-picture/src/editor.scss +++ b/blocks/labelled-picture/src/editor.scss @@ -1,9 +0,0 @@ -/** - * The following styles get applied inside the editor only. - * - * Replace them with your own styles or remove the file completely. - */ - -.wp-block-create-block-multiblocks { - border: 1px dotted #f00; -} diff --git a/blocks/labelled-picture/src/save.js b/blocks/labelled-picture/src/save.js index ea630d1..a1f5ac1 100644 --- a/blocks/labelled-picture/src/save.js +++ b/blocks/labelled-picture/src/save.js @@ -1,13 +1,20 @@ import { useBlockProps } from "@wordpress/block-editor"; export default function save({ attributes }) { + const { pictureUrl, pictureAlt, pictureId, pictureCaption } = attributes; + return ( -

- {"Multiblocks – salut from the saved content!"} -

+ <> + {pictureUrl && ( +
+ {pictureAlt} +
{pictureCaption}
+
+ )} + ); } diff --git a/blocks/labelled-picture/src/style.scss b/blocks/labelled-picture/src/style.scss index 7971c73..e69de29 100644 --- a/blocks/labelled-picture/src/style.scss +++ b/blocks/labelled-picture/src/style.scss @@ -1,12 +0,0 @@ -/** - * The following styles get applied both on the front of your site - * and in the editor. - * - * Replace them with your own styles or remove the file completely. - */ - -.wp-block-create-block-multiblocks { - background-color: #21759b; - color: #fff; - padding: 2px; -}