229 lines
8.5 KiB
JavaScript
229 lines
8.5 KiB
JavaScript
/******/ (() => { // webpackBootstrap
|
|
/******/ "use strict";
|
|
/******/ var __webpack_modules__ = ({
|
|
|
|
/***/ "./blocks/utilities.js":
|
|
/*!*****************************!*\
|
|
!*** ./blocks/utilities.js ***!
|
|
\*****************************/
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ getThematiqueFamilySlug: () => (/* binding */ getThematiqueFamilySlug)
|
|
/* harmony export */ });
|
|
function getThematiqueFamilySlug(thematique_slug) {
|
|
switch (thematique_slug) {
|
|
case "energie":
|
|
case "urbanisme":
|
|
return "energies-urbanisme";
|
|
case "acoustique":
|
|
case "petites-coproprietes":
|
|
return "acoustique-coproprietes";
|
|
case "isolation":
|
|
case "au-quotidien":
|
|
return "isolation-quotidien";
|
|
case "energies":
|
|
case "urbanisme":
|
|
return "energies-urbanisme";
|
|
case "patrimoine":
|
|
case "renovation":
|
|
return "patrimoine-renovation";
|
|
case "location":
|
|
return "location";
|
|
}
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./src/format-types/highlight.js":
|
|
/*!***************************************!*\
|
|
!*** ./src/format-types/highlight.js ***!
|
|
\***************************************/
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var _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_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
|
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__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__);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const HighlightFormatButton = ({
|
|
...props
|
|
}) => {
|
|
// console.log(isActive);
|
|
// console.log(value);
|
|
// console.log(props);
|
|
console.log(props);
|
|
// console.log(props.contentRef.current.innerHTML);
|
|
|
|
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_2__.RichTextToolbarButton, {
|
|
icon: "edit",
|
|
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Highlight", "blocks-course"),
|
|
onClick: () => {
|
|
onChange((0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_1__.toggleFormat)(value, {
|
|
type: "block-course/highlight",
|
|
attributes: {
|
|
style: "background-color: #f0ff00"
|
|
}
|
|
}));
|
|
},
|
|
isActive: props.isActive
|
|
}));
|
|
};
|
|
(0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_1__.registerFormatType)("block-course/highlight", {
|
|
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Highlight", "blocks-course"),
|
|
tagName: "span",
|
|
className: "myclass",
|
|
edit: HighlightFormatButton
|
|
});
|
|
|
|
/***/ }),
|
|
|
|
/***/ "@wordpress/block-editor":
|
|
/*!*************************************!*\
|
|
!*** external ["wp","blockEditor"] ***!
|
|
\*************************************/
|
|
/***/ ((module) => {
|
|
|
|
module.exports = window["wp"]["blockEditor"];
|
|
|
|
/***/ }),
|
|
|
|
/***/ "@wordpress/components":
|
|
/*!************************************!*\
|
|
!*** external ["wp","components"] ***!
|
|
\************************************/
|
|
/***/ ((module) => {
|
|
|
|
module.exports = window["wp"]["components"];
|
|
|
|
/***/ }),
|
|
|
|
/***/ "@wordpress/element":
|
|
/*!*********************************!*\
|
|
!*** external ["wp","element"] ***!
|
|
\*********************************/
|
|
/***/ ((module) => {
|
|
|
|
module.exports = window["wp"]["element"];
|
|
|
|
/***/ }),
|
|
|
|
/***/ "@wordpress/i18n":
|
|
/*!******************************!*\
|
|
!*** external ["wp","i18n"] ***!
|
|
\******************************/
|
|
/***/ ((module) => {
|
|
|
|
module.exports = window["wp"]["i18n"];
|
|
|
|
/***/ }),
|
|
|
|
/***/ "@wordpress/rich-text":
|
|
/*!**********************************!*\
|
|
!*** external ["wp","richText"] ***!
|
|
\**********************************/
|
|
/***/ ((module) => {
|
|
|
|
module.exports = window["wp"]["richText"];
|
|
|
|
/***/ })
|
|
|
|
/******/ });
|
|
/************************************************************************/
|
|
/******/ // The module cache
|
|
/******/ var __webpack_module_cache__ = {};
|
|
/******/
|
|
/******/ // The require function
|
|
/******/ function __webpack_require__(moduleId) {
|
|
/******/ // Check if module is in cache
|
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
/******/ if (cachedModule !== undefined) {
|
|
/******/ return cachedModule.exports;
|
|
/******/ }
|
|
/******/ // Create a new module (and put it into the cache)
|
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
/******/ // no module.id needed
|
|
/******/ // no module.loaded needed
|
|
/******/ exports: {}
|
|
/******/ };
|
|
/******/
|
|
/******/ // Execute the module function
|
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
/******/
|
|
/******/ // Return the exports of the module
|
|
/******/ return module.exports;
|
|
/******/ }
|
|
/******/
|
|
/************************************************************************/
|
|
/******/ /* webpack/runtime/compat get default export */
|
|
/******/ (() => {
|
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
/******/ __webpack_require__.n = (module) => {
|
|
/******/ var getter = module && module.__esModule ?
|
|
/******/ () => (module['default']) :
|
|
/******/ () => (module);
|
|
/******/ __webpack_require__.d(getter, { a: getter });
|
|
/******/ return getter;
|
|
/******/ };
|
|
/******/ })();
|
|
/******/
|
|
/******/ /* webpack/runtime/define property getters */
|
|
/******/ (() => {
|
|
/******/ // define getter functions for harmony exports
|
|
/******/ __webpack_require__.d = (exports, definition) => {
|
|
/******/ for(var key in definition) {
|
|
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
/******/ }
|
|
/******/ }
|
|
/******/ };
|
|
/******/ })();
|
|
/******/
|
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
/******/ (() => {
|
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
/******/ })();
|
|
/******/
|
|
/******/ /* webpack/runtime/make namespace object */
|
|
/******/ (() => {
|
|
/******/ // define __esModule on exports
|
|
/******/ __webpack_require__.r = (exports) => {
|
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
/******/ }
|
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
/******/ };
|
|
/******/ })();
|
|
/******/
|
|
/************************************************************************/
|
|
var __webpack_exports__ = {};
|
|
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
(() => {
|
|
/*!**********************!*\
|
|
!*** ./src/index.js ***!
|
|
\**********************/
|
|
__webpack_require__.r(__webpack_exports__);
|
|
/* harmony import */ var _format_types_highlight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./format-types/highlight.js */ "./src/format-types/highlight.js");
|
|
/* harmony import */ var _blocks_utilities_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../blocks/utilities.js */ "./blocks/utilities.js");
|
|
|
|
|
|
})();
|
|
|
|
/******/ })()
|
|
;
|
|
//# sourceMappingURL=index.js.map
|