From e2b7c364349be50cbb35659d52d193eb8e74dad5 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Wed, 29 Oct 2025 18:01:35 +0100 Subject: [PATCH] FEATURE Add block type filtering for audio player based on user capabilities and update block metadata --- .../blocks/audio-player/audio-player.php | 43 +++++++++++++++++++ .../build/audio-player/block.json | 11 +++-- .../build/audio-player/index.asset.php | 2 +- .../audio-player/build/audio-player/index.js | 2 +- .../build/audio-player/index.js.map | 2 +- .../audio-player/build/blocks-manifest.php | 11 +++-- .../audio-player/src/audio-player/block.json | 11 +++-- 7 files changed, 67 insertions(+), 15 deletions(-) diff --git a/plugins/carhop-blocks/blocks/audio-player/audio-player.php b/plugins/carhop-blocks/blocks/audio-player/audio-player.php index 6a33ab1..7a30a85 100644 --- a/plugins/carhop-blocks/blocks/audio-player/audio-player.php +++ b/plugins/carhop-blocks/blocks/audio-player/audio-player.php @@ -107,3 +107,46 @@ function create_block_audio_player_block_init() } } add_action('init', 'create_block_audio_player_block_init'); + + + +/* ############## DISALLOW BLOCKS ############## */ + +/** + * Désactive le bloc audio natif pour les utilisateurs non administrateurs pour éviter toute confusio + * + */ +function carhop_blocks_disallow_block_types($allowed_block_types, $block_editor_context) +{ + + + + $disallowed_blocks = array( + 'core/audio', + ); + + // Get all registered blocks if $allowed_block_types is not already set. + if (! is_array($allowed_block_types) || empty($allowed_block_types)) { + $registered_blocks = WP_Block_Type_Registry::get_instance()->get_all_registered(); + $allowed_block_types = array_keys($registered_blocks); + } + + // Create a new array for the allowed blocks. + $filtered_blocks = array(); + + // Loop through each block in the allowed blocks list. + foreach ($allowed_block_types as $block) { + + // Check if the block is not in the disallowed blocks list. + if (! in_array($block, $disallowed_blocks, true)) { + + // If it's not disallowed, add it to the filtered list. + $filtered_blocks[] = $block; + } + } + + + // Return the filtered list of allowed blocks + return $filtered_blocks; +} +add_filter('allowed_block_types_all', 'carhop_blocks_disallow_block_types', 10, 2); diff --git a/plugins/carhop-blocks/blocks/audio-player/build/audio-player/block.json b/plugins/carhop-blocks/blocks/audio-player/build/audio-player/block.json index 3b728c8..76e3f2f 100644 --- a/plugins/carhop-blocks/blocks/audio-player/build/audio-player/block.json +++ b/plugins/carhop-blocks/blocks/audio-player/build/audio-player/block.json @@ -3,10 +3,13 @@ "apiVersion": 3, "name": "carhop-blocks/audio-player", "version": "0.1.0", - "title": "Player audio", + "title": "Lecteur audio", "category": "carhop-blocks", - "icon": "format-audio", - "description": "Lecteur audio pour la mise en forme d'éléments de contenu", + "icon": { + "src": "format-audio", + "foreground": "#136f63" + }, + "description": "Lecteur audio pour intégrer un fichier audio dans votre contenu", "example": {}, "attributes": { "audioUrl": { @@ -19,7 +22,7 @@ }, "title": { "type": "string", - "default": "Titre du bloc" + "default": "Titre du bloc audio" }, "description": { "type": "string", diff --git a/plugins/carhop-blocks/blocks/audio-player/build/audio-player/index.asset.php b/plugins/carhop-blocks/blocks/audio-player/build/audio-player/index.asset.php index df1f66d..5edb66c 100644 --- a/plugins/carhop-blocks/blocks/audio-player/build/audio-player/index.asset.php +++ b/plugins/carhop-blocks/blocks/audio-player/build/audio-player/index.asset.php @@ -1 +1 @@ - array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '6ac76ce8fc2124b02c68'); + array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '522d2588811a43dfc829'); diff --git a/plugins/carhop-blocks/blocks/audio-player/build/audio-player/index.js b/plugins/carhop-blocks/blocks/audio-player/build/audio-player/index.js index 7c052c8..db2b0a6 100644 --- a/plugins/carhop-blocks/blocks/audio-player/build/audio-player/index.js +++ b/plugins/carhop-blocks/blocks/audio-player/build/audio-player/index.js @@ -8,7 +8,7 @@ \*************************************/ /***/ ((module) => { -module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/audio-player","version":"0.1.0","title":"Player audio","category":"carhop-blocks","icon":"format-audio","description":"Lecteur audio pour la mise en forme d\'éléments de contenu","example":{},"attributes":{"audioUrl":{"type":"string","default":""},"audioId":{"type":"number","default":0},"title":{"type":"string","default":"Titre du bloc"},"description":{"type":"string","default":""},"caption":{"type":"string","default":""}},"supports":{"html":false},"keywords":["audio","player","lecteur audio"],"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}'); +module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/audio-player","version":"0.1.0","title":"Lecteur audio","category":"carhop-blocks","icon":{"src":"format-audio","foreground":"#136f63"},"description":"Lecteur audio pour intégrer un fichier audio dans votre contenu","example":{},"attributes":{"audioUrl":{"type":"string","default":""},"audioId":{"type":"number","default":0},"title":{"type":"string","default":"Titre du bloc audio"},"description":{"type":"string","default":""},"caption":{"type":"string","default":""}},"supports":{"html":false},"keywords":["audio","player","lecteur audio"],"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}'); /***/ }), diff --git a/plugins/carhop-blocks/blocks/audio-player/build/audio-player/index.js.map b/plugins/carhop-blocks/blocks/audio-player/build/audio-player/index.js.map index 0dfc407..20f6053 100644 --- a/plugins/carhop-blocks/blocks/audio-player/build/audio-player/index.js.map +++ b/plugins/carhop-blocks/blocks/audio-player/build/audio-player/index.js.map @@ -1 +1 @@ -{"version":3,"file":"audio-player/index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AAMJ;AACqB;AACC;AAChC;AAC4B;AAAA;AACpC,SAASe,IAAIA,CAAC;EAAEC,UAAU;EAAEC;AAAc,CAAC,EAAE;EAC3D,MAAM;IAAEC,QAAQ;IAAEC,OAAO;IAAEC,KAAK;IAAEC,WAAW;IAAEC;EAAQ,CAAC,GAAGN,UAAU;EACrE,MAAMO,Q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,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;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,4G;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://audio-player/./src/audio-player/edit.js","webpack://audio-player/./src/audio-player/editor.scss","webpack://audio-player/./src/audio-player/index.js","webpack://audio-player/./src/audio-player/save.js","webpack://audio-player/./src/audio-player/style.scss","webpack://audio-player/external window [\"wp\",\"blockEditor\"]","webpack://audio-player/external window [\"wp\",\"blocks\"]","webpack://audio-player/external window [\"wp\",\"components\"]","webpack://audio-player/external window [\"wp\",\"element\"]","webpack://audio-player/external window [\"wp\",\"i18n\"]","webpack://audio-player/external window \"ReactJSXRuntime\"","webpack://audio-player/webpack/bootstrap","webpack://audio-player/webpack/runtime/chunk loaded","webpack://audio-player/webpack/runtime/compat get default export","webpack://audio-player/webpack/runtime/define property getters","webpack://audio-player/webpack/runtime/hasOwnProperty shorthand","webpack://audio-player/webpack/runtime/make namespace object","webpack://audio-player/webpack/runtime/jsonp chunk loading","webpack://audio-player/webpack/before-startup","webpack://audio-player/webpack/startup","webpack://audio-player/webpack/after-startup"],"sourcesContent":["import { __ } from \"@wordpress/i18n\";\nimport {\n\tuseBlockProps,\n\tMediaPlaceholder,\n\tBlockControls,\n\tMediaReplaceFlow,\n} from \"@wordpress/block-editor\";\nimport { ToolbarButton } from \"@wordpress/components\";\nimport { useEffect, useRef } from \"@wordpress/element\";\nimport \"./editor.scss\";\nimport { RichText } from \"@wordpress/block-editor\";\nexport default function Edit({ attributes, setAttributes }) {\n\tconst { audioUrl, audioId, title, description, caption } = attributes;\n\tconst audioRef = useRef(null);\n\tconst plyrInstance = useRef(null);\n\n\tconst onSelectAudio = (media) => {\n\t\tsetAttributes({\n\t\t\taudioUrl: media.url,\n\t\t\taudioId: media.id,\n\t\t\t// Récupérer les métadonnées depuis la médiathèque\n\t\t\tdescription: media.description || \"\",\n\t\t\tcaption: media.caption || \"\",\n\t\t});\n\t};\n\n\tconst onSelectURL = (url) => {\n\t\tsetAttributes({\n\t\t\taudioUrl: url,\n\t\t\taudioId: 0,\n\t\t});\n\t};\n\n\tconst onRemoveAudio = () => {\n\t\tsetAttributes({\n\t\t\taudioUrl: \"\",\n\t\t\taudioId: 0,\n\t\t\tdescription: \"\",\n\t\t\tcaption: \"\",\n\t\t});\n\t};\n\n\t// Initialize Plyr in the editor\n\tuseEffect(() => {\n\t\t// Wait for Plyr to be loaded (via PHP)\n\t\tif (!audioUrl || !audioRef.current || typeof window.Plyr === \"undefined\") {\n\t\t\treturn;\n\t\t}\n\n\t\t// Destroy previous instance if it exists\n\t\tif (plyrInstance.current) {\n\t\t\tplyrInstance.current.destroy();\n\t\t}\n\n\t\t// Create new Plyr instance\n\t\tplyrInstance.current = new window.Plyr(audioRef.current, {\n\t\t\tcontrols: [\n\t\t\t\t\"play-large\",\n\t\t\t\t\"play\",\n\t\t\t\t\"progress\",\n\t\t\t\t\"current-time\",\n\t\t\t\t\"mute\",\n\t\t\t\t\"volume\",\n\t\t\t\t\"settings\",\n\t\t\t],\n\t\t\tsettings: [\"speed\"],\n\t\t\tspeed: { selected: 1, options: [0.5, 0.75, 1, 1.25, 1.5, 2] },\n\t\t});\n\n\t\t// Cleanup on unmount\n\t\treturn () => {\n\t\t\tif (plyrInstance.current) {\n\t\t\t\tplyrInstance.current.destroy();\n\t\t\t\tplyrInstance.current = null;\n\t\t\t}\n\t\t};\n\t}, [audioUrl]);\n\n\treturn (\n\t\t
\n\t\t\t setAttributes({ title: value })}\n\t\t\t\ttagName=\"h4\"\n\t\t\t/>\n\t\t\t{!audioUrl ? (\n\t\t\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\n\t\t\t\t\t\t\t{__(\"Retirer\", \"carhop-blocks\")}\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\t{__(\n\t\t\t\t\t\t\t\t\"Votre navigateur ne supporte pas l'élément audio.\",\n\t\t\t\t\t\t\t\t\"carhop-blocks\"\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\n\t\t\t)}\n\t\t\t{(description || caption) && (\n\t\t\t\t

\n\t\t\t\t\tAudio\n\t\t\t\t\t\n\t\t\t\t\t\t{description || caption}\n\t\t\t\t\t\n\t\t\t\t

\n\t\t\t)}\n\t\t
\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","import { registerBlockType } from \"@wordpress/blocks\";\n\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport save from \"./save\";\nimport metadata from \"./block.json\";\n\nregisterBlockType(metadata.name, {\n\t/**\n\t * @see ./edit.js\n\t */\n\tedit: Edit,\n\n\t/**\n\t * @see ./save.js\n\t */\n\tsave,\n});\n","import { useBlockProps } from \"@wordpress/block-editor\";\nimport { RichText } from \"@wordpress/block-editor\";\n\nexport default function save({ attributes }) {\n\tconst { audioUrl, title, description, caption } = attributes;\n\n\tif (!audioUrl) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\n\n\t\t\t{(description || caption) && (\n\t\t\t\t

\n\t\t\t\t\tAudio\n\t\t\t\t\t\n\t\t\t\t\t\t{description || caption}\n\t\t\t\t\t\n\t\t\t\t

\n\t\t\t)}\n\t\t
\n\t);\n}\n","// 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\"];","module.exports = window[\"ReactJSXRuntime\"];","// 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\"audio-player/index\": 0,\n\t\"audio-player/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[\"webpackChunkaudio_player\"] = globalThis[\"webpackChunkaudio_player\"] || [];\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, [\"audio-player/style-index\"], () => (__webpack_require__(\"./src/audio-player/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["__","useBlockProps","MediaPlaceholder","BlockControls","MediaReplaceFlow","ToolbarButton","useEffect","useRef","RichText","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","setAttributes","audioUrl","audioId","title","description","caption","audioRef","plyrInstance","onSelectAudio","media","url","id","onSelectURL","onRemoveAudio","current","window","Plyr","destroy","controls","settings","speed","selected","options","className","children","value","onChange","tagName","icon","onSelect","accept","allowedTypes","labels","instructions","mediaId","mediaURL","onClick","ref","src","preload","registerBlockType","save","metadata","name","edit","Content"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"audio-player/index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AAMJ;AACqB;AACC;AAChC;AAC4B;AAAA;AACpC,SAASe,IAAIA,CAAC;EAAEC,UAAU;EAAEC;AAAc,CAAC,EAAE;EAC3D,MAAM;IAAEC,QAAQ;IAAEC,OAAO;IAAEC,KAAK;IAAEC,WAAW;IAAEC;EAAQ,CAAC,GAAGN,UAAU;EACrE,MAAMO,QAAQ,GAAGhB,0DAAM,CAAC,IAAI,CAAC;EAC7B,MAAMiB,YAAY,GAAGjB,0DA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AAgD,aAAa;WAC7D,E;;;;;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,4G;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://audio-player/./src/audio-player/edit.js","webpack://audio-player/./src/audio-player/editor.scss?e190","webpack://audio-player/./src/audio-player/index.js","webpack://audio-player/./src/audio-player/save.js","webpack://audio-player/./src/audio-player/style.scss?9587","webpack://audio-player/external window [\"wp\",\"blockEditor\"]","webpack://audio-player/external window [\"wp\",\"blocks\"]","webpack://audio-player/external window [\"wp\",\"components\"]","webpack://audio-player/external window [\"wp\",\"element\"]","webpack://audio-player/external window [\"wp\",\"i18n\"]","webpack://audio-player/external window \"ReactJSXRuntime\"","webpack://audio-player/webpack/bootstrap","webpack://audio-player/webpack/runtime/chunk loaded","webpack://audio-player/webpack/runtime/compat get default export","webpack://audio-player/webpack/runtime/define property getters","webpack://audio-player/webpack/runtime/hasOwnProperty shorthand","webpack://audio-player/webpack/runtime/make namespace object","webpack://audio-player/webpack/runtime/jsonp chunk loading","webpack://audio-player/webpack/before-startup","webpack://audio-player/webpack/startup","webpack://audio-player/webpack/after-startup"],"sourcesContent":["import { __ } from \"@wordpress/i18n\";\nimport {\n\tuseBlockProps,\n\tMediaPlaceholder,\n\tBlockControls,\n\tMediaReplaceFlow,\n} from \"@wordpress/block-editor\";\nimport { ToolbarButton } from \"@wordpress/components\";\nimport { useEffect, useRef } from \"@wordpress/element\";\nimport \"./editor.scss\";\nimport { RichText } from \"@wordpress/block-editor\";\nexport default function Edit({ attributes, setAttributes }) {\n\tconst { audioUrl, audioId, title, description, caption } = attributes;\n\tconst audioRef = useRef(null);\n\tconst plyrInstance = useRef(null);\n\n\tconst onSelectAudio = (media) => {\n\t\tsetAttributes({\n\t\t\taudioUrl: media.url,\n\t\t\taudioId: media.id,\n\t\t\t// Récupérer les métadonnées depuis la médiathèque\n\t\t\tdescription: media.description || \"\",\n\t\t\tcaption: media.caption || \"\",\n\t\t});\n\t};\n\n\tconst onSelectURL = (url) => {\n\t\tsetAttributes({\n\t\t\taudioUrl: url,\n\t\t\taudioId: 0,\n\t\t});\n\t};\n\n\tconst onRemoveAudio = () => {\n\t\tsetAttributes({\n\t\t\taudioUrl: \"\",\n\t\t\taudioId: 0,\n\t\t\tdescription: \"\",\n\t\t\tcaption: \"\",\n\t\t});\n\t};\n\n\t// Initialize Plyr in the editor\n\tuseEffect(() => {\n\t\t// Wait for Plyr to be loaded (via PHP)\n\t\tif (!audioUrl || !audioRef.current || typeof window.Plyr === \"undefined\") {\n\t\t\treturn;\n\t\t}\n\n\t\t// Destroy previous instance if it exists\n\t\tif (plyrInstance.current) {\n\t\t\tplyrInstance.current.destroy();\n\t\t}\n\n\t\t// Create new Plyr instance\n\t\tplyrInstance.current = new window.Plyr(audioRef.current, {\n\t\t\tcontrols: [\n\t\t\t\t\"play-large\",\n\t\t\t\t\"play\",\n\t\t\t\t\"progress\",\n\t\t\t\t\"current-time\",\n\t\t\t\t\"mute\",\n\t\t\t\t\"volume\",\n\t\t\t\t\"settings\",\n\t\t\t],\n\t\t\tsettings: [\"speed\"],\n\t\t\tspeed: { selected: 1, options: [0.5, 0.75, 1, 1.25, 1.5, 2] },\n\t\t});\n\n\t\t// Cleanup on unmount\n\t\treturn () => {\n\t\t\tif (plyrInstance.current) {\n\t\t\t\tplyrInstance.current.destroy();\n\t\t\t\tplyrInstance.current = null;\n\t\t\t}\n\t\t};\n\t}, [audioUrl]);\n\n\treturn (\n\t\t
\n\t\t\t setAttributes({ title: value })}\n\t\t\t\ttagName=\"h4\"\n\t\t\t/>\n\t\t\t{!audioUrl ? (\n\t\t\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\n\t\t\t\t\t\t\t{__(\"Retirer\", \"carhop-blocks\")}\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\t{__(\n\t\t\t\t\t\t\t\t\"Votre navigateur ne supporte pas l'élément audio.\",\n\t\t\t\t\t\t\t\t\"carhop-blocks\"\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\n\t\t\t)}\n\t\t\t{(description || caption) && (\n\t\t\t\t

\n\t\t\t\t\tAudio\n\t\t\t\t\t\n\t\t\t\t\t\t{description || caption}\n\t\t\t\t\t\n\t\t\t\t

\n\t\t\t)}\n\t\t
\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","import { registerBlockType } from \"@wordpress/blocks\";\n\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport save from \"./save\";\nimport metadata from \"./block.json\";\n\nregisterBlockType(metadata.name, {\n\t/**\n\t * @see ./edit.js\n\t */\n\tedit: Edit,\n\n\t/**\n\t * @see ./save.js\n\t */\n\tsave,\n});\n","import { useBlockProps } from \"@wordpress/block-editor\";\nimport { RichText } from \"@wordpress/block-editor\";\n\nexport default function save({ attributes }) {\n\tconst { audioUrl, title, description, caption } = attributes;\n\n\tif (!audioUrl) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\n\n\t\t\t{(description || caption) && (\n\t\t\t\t

\n\t\t\t\t\tAudio\n\t\t\t\t\t\n\t\t\t\t\t\t{description || caption}\n\t\t\t\t\t\n\t\t\t\t

\n\t\t\t)}\n\t\t
\n\t);\n}\n","// 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\"];","module.exports = window[\"ReactJSXRuntime\"];","// 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\"audio-player/index\": 0,\n\t\"audio-player/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[\"webpackChunkaudio_player\"] = globalThis[\"webpackChunkaudio_player\"] || [];\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, [\"audio-player/style-index\"], () => (__webpack_require__(\"./src/audio-player/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["__","useBlockProps","MediaPlaceholder","BlockControls","MediaReplaceFlow","ToolbarButton","useEffect","useRef","RichText","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","setAttributes","audioUrl","audioId","title","description","caption","audioRef","plyrInstance","onSelectAudio","media","url","id","onSelectURL","onRemoveAudio","current","window","Plyr","destroy","controls","settings","speed","selected","options","className","children","value","onChange","tagName","icon","onSelect","accept","allowedTypes","labels","instructions","mediaId","mediaURL","onClick","ref","src","preload","registerBlockType","save","metadata","name","edit","Content"],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/carhop-blocks/blocks/audio-player/build/blocks-manifest.php b/plugins/carhop-blocks/blocks/audio-player/build/blocks-manifest.php index be8e469..1bd72c7 100644 --- a/plugins/carhop-blocks/blocks/audio-player/build/blocks-manifest.php +++ b/plugins/carhop-blocks/blocks/audio-player/build/blocks-manifest.php @@ -6,10 +6,13 @@ return array( 'apiVersion' => 3, 'name' => 'carhop-blocks/audio-player', 'version' => '0.1.0', - 'title' => 'Player audio', + 'title' => 'Lecteur audio', 'category' => 'carhop-blocks', - 'icon' => 'format-audio', - 'description' => 'Lecteur audio pour la mise en forme d\'éléments de contenu', + 'icon' => array( + 'src' => 'format-audio', + 'foreground' => '#136f63' + ), + 'description' => 'Lecteur audio pour intégrer un fichier audio dans votre contenu', 'example' => array( ), @@ -24,7 +27,7 @@ return array( ), 'title' => array( 'type' => 'string', - 'default' => 'Titre du bloc' + 'default' => 'Titre du bloc audio' ), 'description' => array( 'type' => 'string', diff --git a/plugins/carhop-blocks/blocks/audio-player/src/audio-player/block.json b/plugins/carhop-blocks/blocks/audio-player/src/audio-player/block.json index ace5bd6..fa3814e 100644 --- a/plugins/carhop-blocks/blocks/audio-player/src/audio-player/block.json +++ b/plugins/carhop-blocks/blocks/audio-player/src/audio-player/block.json @@ -3,10 +3,13 @@ "apiVersion": 3, "name": "carhop-blocks/audio-player", "version": "0.1.0", - "title": "Player audio", + "title": "Lecteur audio", "category": "carhop-blocks", - "icon": "format-audio", - "description": "Lecteur audio pour la mise en forme d'éléments de contenu", + "icon": { + "src": "format-audio", + "foreground": "#136f63" + }, + "description": "Lecteur audio pour intégrer un fichier audio dans votre contenu", "example": {}, "attributes": { "audioUrl": { @@ -19,7 +22,7 @@ }, "title": { "type": "string", - "default": "Titre du bloc" + "default": "Titre du bloc audio" }, "description": { "type": "string",