From 3148507053ca8d19de605dbbde331da00c27168d Mon Sep 17 00:00:00 2001 From: Antoine M Date: Thu, 20 Nov 2025 11:37:23 +0100 Subject: [PATCH] FEATURE introducing new format type uppercase --- .../carhop-format-types/build/index-rtl.css | 7 ++ .../carhop-format-types/build/index.asset.php | 2 +- plugins/carhop-format-types/build/index.css | 7 ++ .../carhop-format-types/build/index.css.map | 2 +- plugins/carhop-format-types/build/index.js | 75 +++++++++++++++++++ .../carhop-format-types/build/index.js.map | 2 +- plugins/carhop-format-types/src/index.js | 1 + .../src/uppercase/uppercase.css | 3 + .../src/uppercase/uppercase.js | 44 +++++++++++ 9 files changed, 140 insertions(+), 3 deletions(-) create mode 100644 plugins/carhop-format-types/src/uppercase/uppercase.css create mode 100644 plugins/carhop-format-types/src/uppercase/uppercase.js diff --git a/plugins/carhop-format-types/build/index-rtl.css b/plugins/carhop-format-types/build/index-rtl.css index 9486b68..f79b328 100644 --- a/plugins/carhop-format-types/build/index-rtl.css +++ b/plugins/carhop-format-types/build/index-rtl.css @@ -67,3 +67,10 @@ body { text-transform: uppercase; } +/*!*********************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./src/uppercase/uppercase.css ***! + \*********************************************************************************************************************************************************************************/ +.uppercase { + text-transform: uppercase; +} + diff --git a/plugins/carhop-format-types/build/index.asset.php b/plugins/carhop-format-types/build/index.asset.php index 9fed8a9..a2a5f44 100644 --- a/plugins/carhop-format-types/build/index.asset.php +++ b/plugins/carhop-format-types/build/index.asset.php @@ -1 +1 @@ - array('react-jsx-runtime', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-rich-text'), 'version' => '2e5a48f579e7d22e1117'); + array('react-jsx-runtime', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-rich-text'), 'version' => 'f02e9424e6fc43485fc9'); diff --git a/plugins/carhop-format-types/build/index.css b/plugins/carhop-format-types/build/index.css index cd56af4..3bf739c 100644 --- a/plugins/carhop-format-types/build/index.css +++ b/plugins/carhop-format-types/build/index.css @@ -67,5 +67,12 @@ body { text-transform: uppercase; } +/*!*********************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./src/uppercase/uppercase.css ***! + \*********************************************************************************************************************************************************************************/ +.uppercase { + text-transform: uppercase; +} + /*# sourceMappingURL=index.css.map*/ \ No newline at end of file diff --git a/plugins/carhop-format-types/build/index.css.map b/plugins/carhop-format-types/build/index.css.map index e2b1aed..33e333c 100644 --- a/plugins/carhop-format-types/build/index.css.map +++ b/plugins/carhop-format-types/build/index.css.map @@ -1 +1 @@ -{"version":3,"file":"index.css","mappings":";;;AAAA;CACC,6BAA6B;AAC9B;AACA;CACC,iCAAiC;CACjC,kBAAkB;CAClB,YAAY;;CAEZ;EACC,mDAAmD;EACnD,WAAW;EACX,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,gCAAgC;EAChC,oBAAoB;EACpB,uBAAuB;EACvB,mBAAmB;EACnB,0BAA0B;EAC1B,gBAAgB;EAChB,gBAAgB;EAChB,iBAAiB;CAClB;AACD;;AAEA;;CAEC;EACC,0BAA0B;EAC1B,6BAA6B;EAC7B,wDAAwD;EACxD,8BAA8B;EAC9B,0BAA0B;CAC3B;AACD;;AAEA;CACC;EACC,wBAAwB;EACxB,gBAAgB;CACjB;CACA;EACC,aAAa;EACb,yBAAyB;EACzB,SAAS;EACT,gBAAgB;;EAEhB;GACC,oCAAoC;GACpC,sBAAsB;EACvB;;EAEA;GACC,8DAA8D;GAC9D,sBAAsB;EACvB;CACD;AACD;;;;;ACzDA;CACC,yBAAyB;AAC1B","sources":["webpack:///./src/footnotes/footnote.css","webpack:///./src/uppercased-small-title/uppercased-small-title.css"],"sourcesContent":["body {\r\n\tcounter-reset: footnote-index;\r\n}\r\n.footnote-reference {\r\n\tcounter-increment: footnote-index;\r\n\tposition: relative;\r\n\tcolor: unset;\r\n\r\n\t&::after {\r\n\t\tbackground-color: var(--wp--preset--color--primary);\r\n\t\tcolor: #fff;\r\n\t\twidth: 22px;\r\n\t\theight: 22px;\r\n\t\tborder-radius: 50%;\r\n\t\tcontent: counter(footnote-index);\r\n\t\tdisplay: inline-flex;\r\n\t\tjustify-content: center;\r\n\t\talign-items: center;\r\n\t\tfont-size: 11px !important;\r\n\t\tfont-weight: 600;\r\n\t\tmargin-left: 0px;\r\n\t\tmargin-right: 3px;\r\n\t}\r\n}\r\n\r\n// Editor\r\n.footnote-reference {\r\n\t.wp-block-post-content & {\r\n\t\ttext-decoration: underline;\r\n\t\ttext-decoration-style: dotted;\r\n\t\ttext-decoration-color: var(--wp--preset--color--primary);\r\n\t\ttext-decoration-thickness: 2px;\r\n\t\ttext-underline-offset: 2px;\r\n\t}\r\n}\r\n\r\n.popover_footnote_field {\r\n\t.components-popover__content {\r\n\t\tpadding: 10px !important;\r\n\t\tmin-width: 500px;\r\n\t}\r\n\t.popover_footnote_field_buttons {\r\n\t\tdisplay: flex;\r\n\t\tjustify-content: flex-end;\r\n\t\tgap: 10px;\r\n\t\tmargin-top: 10px;\r\n\r\n\t\tbutton.is-destructive {\r\n\t\t\tbackground-color: #cc1818 !important;\r\n\t\t\tcolor: #fff !important;\r\n\t\t}\r\n\r\n\t\tbutton.is-primary {\r\n\t\t\tbackground-color: var(--wp--preset--color--primary) !important;\r\n\t\t\tcolor: #fff !important;\r\n\t\t}\r\n\t}\r\n}\r\n",".uppercased-small-title {\r\n\ttext-transform: uppercase;\r\n}\r\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.css","mappings":";;;AAAA;CACC,6BAA6B;AAC9B;AACA;CACC,iCAAiC;CACjC,kBAAkB;CAClB,YAAY;;CAEZ;EACC,mDAAmD;EACnD,WAAW;EACX,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,gCAAgC;EAChC,oBAAoB;EACpB,uBAAuB;EACvB,mBAAmB;EACnB,0BAA0B;EAC1B,gBAAgB;EAChB,gBAAgB;EAChB,iBAAiB;CAClB;AACD;;AAEA;;CAEC;EACC,0BAA0B;EAC1B,6BAA6B;EAC7B,wDAAwD;EACxD,8BAA8B;EAC9B,0BAA0B;CAC3B;AACD;;AAEA;CACC;EACC,wBAAwB;EACxB,gBAAgB;CACjB;CACA;EACC,aAAa;EACb,yBAAyB;EACzB,SAAS;EACT,gBAAgB;;EAEhB;GACC,oCAAoC;GACpC,sBAAsB;EACvB;;EAEA;GACC,8DAA8D;GAC9D,sBAAsB;EACvB;CACD;AACD;;;;;ACzDA;CACC,yBAAyB;AAC1B;;;;;ACFA;CACC,yBAAyB;AAC1B","sources":["webpack:///./src/footnotes/footnote.css","webpack:///./src/uppercased-small-title/uppercased-small-title.css","webpack:///./src/uppercase/uppercase.css"],"sourcesContent":["body {\r\n\tcounter-reset: footnote-index;\r\n}\r\n.footnote-reference {\r\n\tcounter-increment: footnote-index;\r\n\tposition: relative;\r\n\tcolor: unset;\r\n\r\n\t&::after {\r\n\t\tbackground-color: var(--wp--preset--color--primary);\r\n\t\tcolor: #fff;\r\n\t\twidth: 22px;\r\n\t\theight: 22px;\r\n\t\tborder-radius: 50%;\r\n\t\tcontent: counter(footnote-index);\r\n\t\tdisplay: inline-flex;\r\n\t\tjustify-content: center;\r\n\t\talign-items: center;\r\n\t\tfont-size: 11px !important;\r\n\t\tfont-weight: 600;\r\n\t\tmargin-left: 0px;\r\n\t\tmargin-right: 3px;\r\n\t}\r\n}\r\n\r\n// Editor\r\n.footnote-reference {\r\n\t.wp-block-post-content & {\r\n\t\ttext-decoration: underline;\r\n\t\ttext-decoration-style: dotted;\r\n\t\ttext-decoration-color: var(--wp--preset--color--primary);\r\n\t\ttext-decoration-thickness: 2px;\r\n\t\ttext-underline-offset: 2px;\r\n\t}\r\n}\r\n\r\n.popover_footnote_field {\r\n\t.components-popover__content {\r\n\t\tpadding: 10px !important;\r\n\t\tmin-width: 500px;\r\n\t}\r\n\t.popover_footnote_field_buttons {\r\n\t\tdisplay: flex;\r\n\t\tjustify-content: flex-end;\r\n\t\tgap: 10px;\r\n\t\tmargin-top: 10px;\r\n\r\n\t\tbutton.is-destructive {\r\n\t\t\tbackground-color: #cc1818 !important;\r\n\t\t\tcolor: #fff !important;\r\n\t\t}\r\n\r\n\t\tbutton.is-primary {\r\n\t\t\tbackground-color: var(--wp--preset--color--primary) !important;\r\n\t\t\tcolor: #fff !important;\r\n\t\t}\r\n\t}\r\n}\r\n",".uppercased-small-title {\r\n\ttext-transform: uppercase;\r\n}\r\n",".uppercase {\r\n\ttext-transform: uppercase;\r\n}\r\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/carhop-format-types/build/index.js b/plugins/carhop-format-types/build/index.js index 2144bcb..ccc0e2e 100644 --- a/plugins/carhop-format-types/build/index.js +++ b/plugins/carhop-format-types/build/index.js @@ -244,6 +244,79 @@ const FootnoteFormatButton = props => { /***/ }), +/***/ "./src/uppercase/uppercase.css": +/*!*************************************!*\ + !*** ./src/uppercase/uppercase.css ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }), + +/***/ "./src/uppercase/uppercase.js": +/*!************************************!*\ + !*** ./src/uppercase/uppercase.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); +/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/text-color.js"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _uppercase_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./uppercase.css */ "./src/uppercase/uppercase.css"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__); + + + + + + + + +const formatName = "carhop-format/uppercase"; +const UppercaseFormatButton = props => { + const { + isActive, + value, + onChange + } = props; + function toggleUppercasedSmallTitle() { + onChange((0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_1__.toggleFormat)(value, { + type: formatName + })); + } + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.BlockControls, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToolbarGroup, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToolbarButton, { + isActive: isActive, + icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__["default"], + title: !isActive ? "Majuscules" : "Retirer Majuscules", + onClick: toggleUppercasedSmallTitle + }) + }) + }); +}; +(0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_1__.registerFormatType)(formatName, { + title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Petit titre en majuscules", "carhop-format-types"), + tagName: "span", + className: "uppercase", + edit: UppercaseFormatButton +}); + +/***/ }), + /***/ "./src/uppercased-small-title/uppercased-small-title.css": /*!***************************************************************!*\ !*** ./src/uppercased-small-title/uppercased-small-title.css ***! @@ -485,6 +558,7 @@ var __webpack_exports__ = {}; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _footnotes_footnote_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./footnotes/footnote.js */ "./src/footnotes/footnote.js"); /* harmony import */ var _uppercased_small_title_uppercased_small_title_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uppercased-small-title/uppercased-small-title.js */ "./src/uppercased-small-title/uppercased-small-title.js"); +/* harmony import */ var _uppercase_uppercase_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./uppercase/uppercase.js */ "./src/uppercase/uppercase.js"); /** * Carhop Format Types * @@ -494,6 +568,7 @@ __webpack_require__.r(__webpack_exports__); // Import all format types + })(); /******/ })() diff --git a/plugins/carhop-format-types/build/index.js.map b/plugins/carhop-format-types/build/index.js.map index bed682b..2781d77 100644 --- a/plugins/carhop-format-types/build/index.js.map +++ b/plugins/carhop-format-types/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACkD;AACF;AAChD,oCAAoC,sDAAI,CAAC,sDAAG;AAC5C;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA,GAAG;AACH,CAAC;AACD,iEAAe,cAAc,EAAC;AAC9B;;;;;;;;;;;;;;;;;;ACbA;AACA;AACA;AACkD;AACF;AAChD,+BAA+B,sDAAI,CAAC,sDAAG;AACvC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA,GAAG;AACH,CAAC;AACD,iEAAe,SAAS,EAAC;AACzB;;;;;;;;;;;ACbA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAqC;AACkF;AAErB;AACiB;AAE1D;AACX;AACF;AAEpB;AAAA;AAExB,MAAM0B,UAAU,GAAG,wBAAwB;AAE3C,MAAMC,oBAAoB,GAAIC,KAAK,IAAK;EACvC,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGH,KAAK;EAC3C,MAAM,CAACI,aAAa,EAAEC,gBAAgB,CAAC,GAAGf,4DAAQ,CAAC,KAAK,CAAC;EACzD,MAAMgB,YAAY,GAAGJ,KAAK,CAACK,KAAK,KAAKL,KAAK,CAACM,GAAG;;EAE9C;EACA,MAAMC,QAAQ,GAAGlB,0DAAS,CAAEmB,MAAM,IAAK;IACtC,OAAOA,MAAM,CAAC,aAAa,CAAC,EAAEC,kBAAkB,CAAC,CAAC;EACnD,CAAC,EA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AA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;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;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;;AAEA;AACiC","sources":["webpack:///./node_modules/@wordpress/icons/build-module/library/custom-post-type.js","webpack:///./node_modules/@wordpress/icons/build-module/library/text-color.js","webpack:///./src/footnotes/footnote.css?0320","webpack:///./src/footnotes/footnote.js","webpack:///./src/uppercased-small-title/uppercased-small-title.css?3e2e","webpack:///./src/uppercased-small-title/uppercased-small-title.js","webpack:///external window [\"wp\",\"blockEditor\"]","webpack:///external window [\"wp\",\"components\"]","webpack:///external window [\"wp\",\"data\"]","webpack:///external window [\"wp\",\"element\"]","webpack:///external window [\"wp\",\"i18n\"]","webpack:///external window [\"wp\",\"primitives\"]","webpack:///external window [\"wp\",\"richText\"]","webpack:///external window \"ReactJSXRuntime\"","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst customPostType = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z\"\n })\n});\nexport default customPostType;\n//# sourceMappingURL=custom-post-type.js.map","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst textColor = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z\"\n })\n});\nexport default textColor;\n//# sourceMappingURL=text-color.js.map","// extracted by mini-css-extract-plugin\nexport {};","import { __ } from \"@wordpress/i18n\";\r\nimport { registerFormatType, toggleFormat, applyFormat, getActiveFormats, insert, remove } from \"@wordpress/rich-text\";\r\n\r\nimport { BlockControls, __experimentalLinkControl as LinkControl } from \"@wordpress/block-editor\";\r\nimport { Popover, ToolbarGroup, ToolbarButton, TextControl, TextareaControl, Button } from \"@wordpress/components\";\r\n\r\nimport { trash, customPostType } from \"@wordpress/icons\";\r\nimport { useState } from \"@wordpress/element\";\r\nimport { useSelect } from \"@wordpress/data\";\r\n\r\nimport \"./footnote.css\";\r\n\r\nconst formatName = \"carhop-format/footnote\";\r\n\r\nconst FootnoteFormatButton = (props) => {\r\n\tconst { isActive, value, onChange } = props;\r\n\tconst [isPopoverOpen, setIsPopoverOpen] = useState(false);\r\n\tconst hasSelection = value.start !== value.end;\r\n\r\n\t// Vérifier si on est dans un article (post type 'post')\r\n\tconst postType = useSelect((select) => {\r\n\t\treturn select(\"core/editor\")?.getCurrentPostType();\r\n\t}, []);\r\n\r\n\t// Ne pas afficher le bouton si ce n'est pas un article\r\n\tif (postType !== \"articles\" || (!isActive && hasSelection)) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst activeFormat = getActiveFormats(value).filter((format) => format.type === formatName)[0];\r\n\r\n\tfunction handleFootnoteContentChange(value) {\r\n\t\tsetFormat(value);\r\n\t}\r\n\r\n\tfunction removeFormat() {\r\n\t\tsetIsPopoverOpen(false);\r\n\t\tconst { text, formats, start, end } = value;\r\n\t\tconst textLength = text ? text.length : 0;\r\n\r\n\t\tconst isFootnoteAtIndex = (index) => {\r\n\t\t\tif (!formats || index < 0 || index >= (formats?.length || 0)) return false;\r\n\t\t\tconst charFormats = formats[index];\r\n\t\t\tif (!charFormats) return false;\r\n\t\t\treturn charFormats.some((f) => f && f.type === formatName);\r\n\t\t};\r\n\r\n\t\tif (textLength > 0) {\r\n\t\t\tlet pos = Math.min(start, textLength - 1);\r\n\t\t\t// If caret is just after the formatted run, step back one char\r\n\t\t\tif (!isFootnoteAtIndex(pos) && pos > 0 && isFootnoteAtIndex(pos - 1)) {\r\n\t\t\t\tpos = pos - 1;\r\n\t\t\t}\r\n\r\n\t\t\tif (isFootnoteAtIndex(pos)) {\r\n\t\t\t\tlet left = pos;\r\n\t\t\t\tlet right = pos;\r\n\t\t\t\twhile (left >= 0 && isFootnoteAtIndex(left)) left--;\r\n\t\t\t\twhile (right < textLength && isFootnoteAtIndex(right)) right++;\r\n\r\n\t\t\t\tconst spanStart = left + 1;\r\n\t\t\t\tconst spanEnd = right; // exclusive\r\n\r\n\t\t\t\t// Supprimer toujours le texte complet de la footnote\r\n\t\t\t\tonChange(remove(value, spanStart, spanEnd));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Fallback: si aucune footnote n'est trouvée à la position du curseur,\r\n\t\t// enlever juste le formatage\r\n\t\tonChange(\r\n\t\t\ttoggleFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\tfunction setFormat(footnoteContent) {\r\n\t\tonChange(\r\n\t\t\tapplyFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t\tattributes: {\r\n\t\t\t\t\tdataFootnoteContent: footnoteContent,\r\n\t\t\t\t},\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\tfunction insertFormat(footnoteContent) {\r\n\t\tconst text = \"[NOTE]\";\r\n\t\tconst start = value.start; // position du curseur avant insertion\r\n\t\tconst nextValue = insert(value, text);\r\n\r\n\t\tonChange(\r\n\t\t\tapplyFormat(\r\n\t\t\t\tnextValue,\r\n\t\t\t\t{\r\n\t\t\t\t\ttype: formatName,\r\n\t\t\t\t\tattributes: { dataFootnoteContent: footnoteContent },\r\n\t\t\t\t},\r\n\t\t\t\tstart,\r\n\t\t\t\tstart + text.length\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t{isPopoverOpen && (\r\n\t\t\t\t\t setIsPopoverOpen(false)}\r\n\t\t\t\t\t\tclassName='popover_footnote_field'>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t setIsPopoverOpen(false)}>\r\n\t\t\t\t\t\t\t\tOk\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t\tif (!isActive) {\r\n\t\t\t\t\t\t\t\tinsertFormat();\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tsetIsPopoverOpen(true);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\r\n\t);\r\n};\r\n\r\nregisterFormatType(formatName, {\r\n\ttitle: __(\"Notes de bas de page\", \"carhop-format-types\"),\r\n\ttagName: \"a\",\r\n\tattributes: {\r\n\t\tdataFootnoteContent: \"data-footnote-content\",\r\n\t},\r\n\tclassName: \"footnote-reference\",\r\n\tedit: FootnoteFormatButton,\r\n});\r\n","// extracted by mini-css-extract-plugin\nexport {};","import { __ } from \"@wordpress/i18n\";\r\nimport { registerFormatType, toggleFormat } from \"@wordpress/rich-text\";\r\n\r\nimport { RichTextToolbarButton, BlockControls } from \"@wordpress/block-editor\";\r\nimport { ToolbarGroup, ToolbarButton } from \"@wordpress/components\";\r\n\r\nimport { textColor } from \"@wordpress/icons\";\r\nimport { useSelect } from \"@wordpress/data\";\r\n\r\nimport \"./uppercased-small-title.css\";\r\n\r\nconst formatName = \"carhop-format/uppercased-small-title\";\r\n\r\nconst UppercasedSmallTitleFormatButton = (props) => {\r\n\tconst { isActive, value, onChange } = props;\r\n\r\n\tfunction toggleUppercasedSmallTitle() {\r\n\t\tonChange(\r\n\t\t\ttoggleFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\r\n\t// // Vérifier si on est dans un article (post type 'post')\r\n\t// const postType = useSelect((select) => {\r\n\t// \treturn select(\"core/editor\")?.getCurrentPostType();\r\n\t// }, []);\r\n\r\n\t// // Ne pas afficher le bouton si ce n'est pas un article\r\n\t// if (postType !== \"page\") {\r\n\t// \treturn null;\r\n\t// }\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n};\r\n\r\nregisterFormatType(formatName, {\r\n\ttitle: __(\"Petit titre en majuscules\", \"carhop-format-types\"),\r\n\ttagName: \"span\",\r\n\tclassName: \"uppercased-small-title\",\r\n\tedit: UppercasedSmallTitleFormatButton,\r\n});\r\n","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"wp\"][\"richText\"];","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","// 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};","/**\r\n * Carhop Format Types\r\n *\r\n * Point d'entrée principal qui importe tous les format types personnalisés\r\n */\r\n\r\n// Import all format types\r\nimport \"./footnotes/footnote.js\";\r\nimport \"./uppercased-small-title/uppercased-small-title.js\";\r\n"],"names":["__","registerFormatType","toggleFormat","applyFormat","getActiveFormats","insert","remove","BlockControls","__experimentalLinkControl","LinkControl","Popover","ToolbarGroup","ToolbarButton","TextControl","TextareaControl","Button","trash","customPostType","useState","useSelect","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","formatName","FootnoteFormatButton","props","isActive","value","onChange","isPopoverOpen","setIsPopoverOpen","hasSelection","start","end","postType","select","getCurrentPostType","activeFormat","filter","format","type","handleFootnoteContentChange","setFormat","removeFormat","text","formats","textLength","length","isFootnoteAtIndex","index","charFormats","some","f","pos","Math","min","left","right","spanStart","spanEnd","footnoteContent","attributes","dataFootnoteContent","insertFormat","nextValue","children","onClose","className","__nextHasNoMarginBottom","__next40pxDefaultSize","label","variant","onClick","isDestructive","icon","isPressed","title","tagName","edit","RichTextToolbarButton","textColor","UppercasedSmallTitleFormatButton","toggleUppercasedSmallTitle"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACkD;AACF;AAChD,oCAAoC,sDAAI,CAAC,sDAAG;AAC5C;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA,GAAG;AACH,CAAC;AACD,iEAAe,cAAc,EAAC;AAC9B;;;;;;;;;;;;;;;;;;ACbA;AACA;AACA;AACkD;AACF;AAChD,+BAA+B,sDAAI,CAAC,sDAAG;AACvC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA,GAAG;AACH,CAAC;AACD,iEAAe,SAAS,EAAC;AACzB;;;;;;;;;;;ACbA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAqC;AACkF;AAErB;AACiB;AAE1D;AACX;AACF;AAEpB;AAAA;AAExB,MAAM0B,UAAU,GAAG,wBAAwB;AAE3C,MAAMC,oBAAoB,GAAIC,KAAK,IAAK;EACvC,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGH,KAAK;EAC3C,MAAM,CAACI,aAAa,EAAEC,gBAAgB,CAAC,GAAGf,4DAAQ,CAAC,KAAK,CAAC;EACzD,MAAMgB,YAAY,GAAGJ,KAAK,CAACK,KAAK,KAAKL,KAAK,CAACM,GAAG;;EAE9C;EACA,MAAMC,QAAQ,GA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W;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;;AAEA;AACiC;AAC2B","sources":["webpack:///./node_modules/@wordpress/icons/build-module/library/custom-post-type.js","webpack:///./node_modules/@wordpress/icons/build-module/library/text-color.js","webpack:///./src/footnotes/footnote.css?0320","webpack:///./src/footnotes/footnote.js","webpack:///./src/uppercase/uppercase.css?b44b","webpack:///./src/uppercase/uppercase.js","webpack:///./src/uppercased-small-title/uppercased-small-title.css?3e2e","webpack:///./src/uppercased-small-title/uppercased-small-title.js","webpack:///external window [\"wp\",\"blockEditor\"]","webpack:///external window [\"wp\",\"components\"]","webpack:///external window [\"wp\",\"data\"]","webpack:///external window [\"wp\",\"element\"]","webpack:///external window [\"wp\",\"i18n\"]","webpack:///external window [\"wp\",\"primitives\"]","webpack:///external window [\"wp\",\"richText\"]","webpack:///external window \"ReactJSXRuntime\"","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst customPostType = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z\"\n })\n});\nexport default customPostType;\n//# sourceMappingURL=custom-post-type.js.map","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst textColor = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z\"\n })\n});\nexport default textColor;\n//# sourceMappingURL=text-color.js.map","// extracted by mini-css-extract-plugin\nexport {};","import { __ } from \"@wordpress/i18n\";\r\nimport { registerFormatType, toggleFormat, applyFormat, getActiveFormats, insert, remove } from \"@wordpress/rich-text\";\r\n\r\nimport { BlockControls, __experimentalLinkControl as LinkControl } from \"@wordpress/block-editor\";\r\nimport { Popover, ToolbarGroup, ToolbarButton, TextControl, TextareaControl, Button } from \"@wordpress/components\";\r\n\r\nimport { trash, customPostType } from \"@wordpress/icons\";\r\nimport { useState } from \"@wordpress/element\";\r\nimport { useSelect } from \"@wordpress/data\";\r\n\r\nimport \"./footnote.css\";\r\n\r\nconst formatName = \"carhop-format/footnote\";\r\n\r\nconst FootnoteFormatButton = (props) => {\r\n\tconst { isActive, value, onChange } = props;\r\n\tconst [isPopoverOpen, setIsPopoverOpen] = useState(false);\r\n\tconst hasSelection = value.start !== value.end;\r\n\r\n\t// Vérifier si on est dans un article (post type 'post')\r\n\tconst postType = useSelect((select) => {\r\n\t\treturn select(\"core/editor\")?.getCurrentPostType();\r\n\t}, []);\r\n\r\n\t// Ne pas afficher le bouton si ce n'est pas un article\r\n\tif (postType !== \"articles\" || (!isActive && hasSelection)) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst activeFormat = getActiveFormats(value).filter((format) => format.type === formatName)[0];\r\n\r\n\tfunction handleFootnoteContentChange(value) {\r\n\t\tsetFormat(value);\r\n\t}\r\n\r\n\tfunction removeFormat() {\r\n\t\tsetIsPopoverOpen(false);\r\n\t\tconst { text, formats, start, end } = value;\r\n\t\tconst textLength = text ? text.length : 0;\r\n\r\n\t\tconst isFootnoteAtIndex = (index) => {\r\n\t\t\tif (!formats || index < 0 || index >= (formats?.length || 0)) return false;\r\n\t\t\tconst charFormats = formats[index];\r\n\t\t\tif (!charFormats) return false;\r\n\t\t\treturn charFormats.some((f) => f && f.type === formatName);\r\n\t\t};\r\n\r\n\t\tif (textLength > 0) {\r\n\t\t\tlet pos = Math.min(start, textLength - 1);\r\n\t\t\t// If caret is just after the formatted run, step back one char\r\n\t\t\tif (!isFootnoteAtIndex(pos) && pos > 0 && isFootnoteAtIndex(pos - 1)) {\r\n\t\t\t\tpos = pos - 1;\r\n\t\t\t}\r\n\r\n\t\t\tif (isFootnoteAtIndex(pos)) {\r\n\t\t\t\tlet left = pos;\r\n\t\t\t\tlet right = pos;\r\n\t\t\t\twhile (left >= 0 && isFootnoteAtIndex(left)) left--;\r\n\t\t\t\twhile (right < textLength && isFootnoteAtIndex(right)) right++;\r\n\r\n\t\t\t\tconst spanStart = left + 1;\r\n\t\t\t\tconst spanEnd = right; // exclusive\r\n\r\n\t\t\t\t// Supprimer toujours le texte complet de la footnote\r\n\t\t\t\tonChange(remove(value, spanStart, spanEnd));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Fallback: si aucune footnote n'est trouvée à la position du curseur,\r\n\t\t// enlever juste le formatage\r\n\t\tonChange(\r\n\t\t\ttoggleFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\tfunction setFormat(footnoteContent) {\r\n\t\tonChange(\r\n\t\t\tapplyFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t\tattributes: {\r\n\t\t\t\t\tdataFootnoteContent: footnoteContent,\r\n\t\t\t\t},\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\tfunction insertFormat(footnoteContent) {\r\n\t\tconst text = \"[NOTE]\";\r\n\t\tconst start = value.start; // position du curseur avant insertion\r\n\t\tconst nextValue = insert(value, text);\r\n\r\n\t\tonChange(\r\n\t\t\tapplyFormat(\r\n\t\t\t\tnextValue,\r\n\t\t\t\t{\r\n\t\t\t\t\ttype: formatName,\r\n\t\t\t\t\tattributes: { dataFootnoteContent: footnoteContent },\r\n\t\t\t\t},\r\n\t\t\t\tstart,\r\n\t\t\t\tstart + text.length\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t{isPopoverOpen && (\r\n\t\t\t\t\t setIsPopoverOpen(false)}\r\n\t\t\t\t\t\tclassName='popover_footnote_field'>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t setIsPopoverOpen(false)}>\r\n\t\t\t\t\t\t\t\tOk\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t\tif (!isActive) {\r\n\t\t\t\t\t\t\t\tinsertFormat();\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tsetIsPopoverOpen(true);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\r\n\t);\r\n};\r\n\r\nregisterFormatType(formatName, {\r\n\ttitle: __(\"Notes de bas de page\", \"carhop-format-types\"),\r\n\ttagName: \"a\",\r\n\tattributes: {\r\n\t\tdataFootnoteContent: \"data-footnote-content\",\r\n\t},\r\n\tclassName: \"footnote-reference\",\r\n\tedit: FootnoteFormatButton,\r\n});\r\n","// extracted by mini-css-extract-plugin\nexport {};","import { __ } from \"@wordpress/i18n\";\r\nimport { registerFormatType, toggleFormat } from \"@wordpress/rich-text\";\r\n\r\nimport { RichTextToolbarButton, BlockControls } from \"@wordpress/block-editor\";\r\nimport { ToolbarGroup, ToolbarButton } from \"@wordpress/components\";\r\n\r\nimport { textColor } from \"@wordpress/icons\";\r\nimport { useSelect } from \"@wordpress/data\";\r\n\r\nimport \"./uppercase.css\";\r\n\r\nconst formatName = \"carhop-format/uppercase\";\r\n\r\nconst UppercaseFormatButton = (props) => {\r\n\tconst { isActive, value, onChange } = props;\r\n\r\n\tfunction toggleUppercasedSmallTitle() {\r\n\t\tonChange(\r\n\t\t\ttoggleFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n};\r\n\r\nregisterFormatType(formatName, {\r\n\ttitle: __(\"Petit titre en majuscules\", \"carhop-format-types\"),\r\n\ttagName: \"span\",\r\n\tclassName: \"uppercase\",\r\n\tedit: UppercaseFormatButton,\r\n});\r\n","// extracted by mini-css-extract-plugin\nexport {};","import { __ } from \"@wordpress/i18n\";\r\nimport { registerFormatType, toggleFormat } from \"@wordpress/rich-text\";\r\n\r\nimport { RichTextToolbarButton, BlockControls } from \"@wordpress/block-editor\";\r\nimport { ToolbarGroup, ToolbarButton } from \"@wordpress/components\";\r\n\r\nimport { textColor } from \"@wordpress/icons\";\r\nimport { useSelect } from \"@wordpress/data\";\r\n\r\nimport \"./uppercased-small-title.css\";\r\n\r\nconst formatName = \"carhop-format/uppercased-small-title\";\r\n\r\nconst UppercasedSmallTitleFormatButton = (props) => {\r\n\tconst { isActive, value, onChange } = props;\r\n\r\n\tfunction toggleUppercasedSmallTitle() {\r\n\t\tonChange(\r\n\t\t\ttoggleFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\r\n\t// // Vérifier si on est dans un article (post type 'post')\r\n\t// const postType = useSelect((select) => {\r\n\t// \treturn select(\"core/editor\")?.getCurrentPostType();\r\n\t// }, []);\r\n\r\n\t// // Ne pas afficher le bouton si ce n'est pas un article\r\n\t// if (postType !== \"page\") {\r\n\t// \treturn null;\r\n\t// }\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n};\r\n\r\nregisterFormatType(formatName, {\r\n\ttitle: __(\"Petit titre en majuscules\", \"carhop-format-types\"),\r\n\ttagName: \"span\",\r\n\tclassName: \"uppercased-small-title\",\r\n\tedit: UppercasedSmallTitleFormatButton,\r\n});\r\n","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"wp\"][\"richText\"];","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","// 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};","/**\r\n * Carhop Format Types\r\n *\r\n * Point d'entrée principal qui importe tous les format types personnalisés\r\n */\r\n\r\n// Import all format types\r\nimport \"./footnotes/footnote.js\";\r\nimport \"./uppercased-small-title/uppercased-small-title.js\";\r\nimport \"./uppercase/uppercase.js\";\r\n"],"names":["__","registerFormatType","toggleFormat","applyFormat","getActiveFormats","insert","remove","BlockControls","__experimentalLinkControl","LinkControl","Popover","ToolbarGroup","ToolbarButton","TextControl","TextareaControl","Button","trash","customPostType","useState","useSelect","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","formatName","FootnoteFormatButton","props","isActive","value","onChange","isPopoverOpen","setIsPopoverOpen","hasSelection","start","end","postType","select","getCurrentPostType","activeFormat","filter","format","type","handleFootnoteContentChange","setFormat","removeFormat","text","formats","textLength","length","isFootnoteAtIndex","index","charFormats","some","f","pos","Math","min","left","right","spanStart","spanEnd","footnoteContent","attributes","dataFootnoteContent","insertFormat","nextValue","children","onClose","className","__nextHasNoMarginBottom","__next40pxDefaultSize","label","variant","onClick","isDestructive","icon","isPressed","title","tagName","edit","RichTextToolbarButton","textColor","UppercaseFormatButton","toggleUppercasedSmallTitle","UppercasedSmallTitleFormatButton"],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/carhop-format-types/src/index.js b/plugins/carhop-format-types/src/index.js index 32834f5..25a0755 100644 --- a/plugins/carhop-format-types/src/index.js +++ b/plugins/carhop-format-types/src/index.js @@ -7,3 +7,4 @@ // Import all format types import "./footnotes/footnote.js"; import "./uppercased-small-title/uppercased-small-title.js"; +import "./uppercase/uppercase.js"; diff --git a/plugins/carhop-format-types/src/uppercase/uppercase.css b/plugins/carhop-format-types/src/uppercase/uppercase.css new file mode 100644 index 0000000..6796c83 --- /dev/null +++ b/plugins/carhop-format-types/src/uppercase/uppercase.css @@ -0,0 +1,3 @@ +.uppercase { + text-transform: uppercase; +} diff --git a/plugins/carhop-format-types/src/uppercase/uppercase.js b/plugins/carhop-format-types/src/uppercase/uppercase.js new file mode 100644 index 0000000..aff9dd7 --- /dev/null +++ b/plugins/carhop-format-types/src/uppercase/uppercase.js @@ -0,0 +1,44 @@ +import { __ } from "@wordpress/i18n"; +import { registerFormatType, toggleFormat } from "@wordpress/rich-text"; + +import { RichTextToolbarButton, BlockControls } from "@wordpress/block-editor"; +import { ToolbarGroup, ToolbarButton } from "@wordpress/components"; + +import { textColor } from "@wordpress/icons"; +import { useSelect } from "@wordpress/data"; + +import "./uppercase.css"; + +const formatName = "carhop-format/uppercase"; + +const UppercaseFormatButton = (props) => { + const { isActive, value, onChange } = props; + + function toggleUppercasedSmallTitle() { + onChange( + toggleFormat(value, { + type: formatName, + }) + ); + } + + return ( + + + + + + ); +}; + +registerFormatType(formatName, { + title: __("Petit titre en majuscules", "carhop-format-types"), + tagName: "span", + className: "uppercase", + edit: UppercaseFormatButton, +});