Compare commits
19 Commits
9729258a45
...
ab1c3aee52
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab1c3aee52 | ||
|
|
d9e6ecff12 | ||
|
|
74604c0a19 | ||
|
|
0296b12d4c | ||
|
|
59fc9bc832 | ||
|
|
b61d332dd5 | ||
|
|
328660ba95 | ||
|
|
50e41b940f | ||
|
|
7e690373b2 | ||
|
|
74a2e7048e | ||
|
|
c738227bba | ||
|
|
24ddfae7a5 | ||
|
|
08d1970802 | ||
|
|
4828b045f9 | ||
|
|
f8ae108622 | ||
|
|
9d130e54b4 | ||
|
|
4c353ab77b | ||
|
|
9eda00022e | ||
|
|
ebc2a9fb40 |
|
|
@ -17,24 +17,7 @@ function carhop_create_posttype()
|
||||||
$current_site = get_current_blog_id();
|
$current_site = get_current_blog_id();
|
||||||
if ($current_site !== 1) return;
|
if ($current_site !== 1) return;
|
||||||
|
|
||||||
register_post_type(
|
|
||||||
'dbmob',
|
|
||||||
// CPT Options
|
|
||||||
array(
|
|
||||||
'labels' => array(
|
|
||||||
'name' => __('DBMOB'),
|
|
||||||
'singular_name' => __('DBMOB')
|
|
||||||
),
|
|
||||||
'public' => true,
|
|
||||||
'has_archive' => true,
|
|
||||||
'rewrite' => array('slug' => 'dictionnaire'),
|
|
||||||
'show_in_rest' => true,
|
|
||||||
'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode('<svg width="96" height="74" viewBox="0 0 96 74" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M86.4 2.2C81.6 0.7 76.3 0 71.3 0C62.9 0 53.8 1.7 47.5 6.5C41.2 1.7 32.2 0 23.8 0C15.4 0 6.3 1.7 0 6.5V69.8C0 70.9 1.1 72 2.2 72C3.3 72 2.8 71.8 3.3 71.8C9.1 69 17.6 67 23.8 67C30 67 41.3 68.7 47.6 73.5C53.4 69.8 64 67 71.4 67C78.8 67 85.9 68.3 91.9 71.5C92.3 71.7 92.5 71.7 93 71.7C94.1 71.7 95.2 70.6 95.2 69.5V6.5C92.6 4.6 89.8 3.3 86.6 2.2H86.4ZM86.4 60.5C81.6 59 76.5 58.3 71.3 58.3C64 58.3 53.4 61.1 47.5 64.8V15.1C53.3 11.4 63.9 8.6 71.3 8.6C78.7 8.6 81.7 9.2 86.4 10.8V60.5Z" fill="black"/></svg>'),
|
|
||||||
'menu_position' => 5,
|
|
||||||
'supports' => array('title', 'custom-fields'),
|
|
||||||
'taxonomies' => array('category'),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
register_post_type(
|
register_post_type(
|
||||||
'equipe',
|
'equipe',
|
||||||
// CPT Options
|
// CPT Options
|
||||||
|
|
@ -61,6 +44,44 @@ function carhop_create_posttype()
|
||||||
'supports' => array('title', 'custom-fields'),
|
'supports' => array('title', 'custom-fields'),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
register_post_type(
|
||||||
|
'dbmob',
|
||||||
|
// CPT Options
|
||||||
|
array(
|
||||||
|
'labels' => array(
|
||||||
|
'name' => __('DBMOB'),
|
||||||
|
'singular_name' => __('DBMOB'),
|
||||||
|
),
|
||||||
|
'public' => true,
|
||||||
|
'has_archive' => true,
|
||||||
|
'rewrite' => array('slug' => 'dictionnaire'),
|
||||||
|
'show_in_rest' => true,
|
||||||
|
'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode('<svg width="96" height="74" viewBox="0 0 96 74" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M86.4 2.2C81.6 0.7 76.3 0 71.3 0C62.9 0 53.8 1.7 47.5 6.5C41.2 1.7 32.2 0 23.8 0C15.4 0 6.3 1.7 0 6.5V69.8C0 70.9 1.1 72 2.2 72C3.3 72 2.8 71.8 3.3 71.8C9.1 69 17.6 67 23.8 67C30 67 41.3 68.7 47.6 73.5C53.4 69.8 64 67 71.4 67C78.8 67 85.9 68.3 91.9 71.5C92.3 71.7 92.5 71.7 93 71.7C94.1 71.7 95.2 70.6 95.2 69.5V6.5C92.6 4.6 89.8 3.3 86.6 2.2H86.4ZM86.4 60.5C81.6 59 76.5 58.3 71.3 58.3C64 58.3 53.4 61.1 47.5 64.8V15.1C53.3 11.4 63.9 8.6 71.3 8.6C78.7 8.6 81.7 9.2 86.4 10.8V60.5Z" fill="black"/></svg>'),
|
||||||
|
'menu_position' => 5,
|
||||||
|
'supports' => array('title', 'custom-fields'),
|
||||||
|
'taxonomies' => array('category'),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
register_post_type(
|
||||||
|
'analyses-etudes',
|
||||||
|
// CPT Options
|
||||||
|
array(
|
||||||
|
'labels' => array(
|
||||||
|
'name' => __('Analyses et études'),
|
||||||
|
'singular_name' => __('Analyse ou étude'),
|
||||||
|
'menu_name' => 'Analyses & Études',
|
||||||
|
),
|
||||||
|
'public' => true,
|
||||||
|
'has_archive' => true,
|
||||||
|
'rewrite' => array('slug' => 'analyses-etudes'),
|
||||||
|
'show_in_rest' => true,
|
||||||
|
'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode('<svg xmlns="http://www.w3.org/2000/svg" width="46.3" height="63" viewBox="0 0 46.3 63"><path d="M44.6,8.5c-.8,0-1.5.7-1.5,1.5v37.1c0,1.6-1.3,2.9-2.9,2.9h-17.4v-2.5c0-.8-.7-1.5-1.5-1.5h-8c-.4,0-.8.2-1.1.4s-.4.7-.4,1.1v2.5h-5.9c-1.4,0-2.6-.8-3-2.2,0-.6,0-1.3.5-1.8.9-.9,2.1-1.4,3.4-1.4h29.7c2.7,0,4.8-2.2,4.8-4.8V6.5c0-3.6-2.9-6.5-6.5-6.5H6.5C2.9,0,0,2.9,0,6.5v41c0,.3,0,.6,0,.9.7,2.7,3.1,4.7,6,4.6h5.9v8.5c0,.6.4,1.1.9,1.4.6.2,1.2,0,1.6-.3l3-2.8,3,2.8h0c.3.3.7.4,1,.4s.4,0,.6,0c.6-.2.9-.8.9-1.4v-8.5h17.4c3.3,0,5.9-2.6,5.9-5.9h0V10c0-.8-.7-1.5-1.5-1.5h-.2ZM21.9,33.1c0,.8-.7,1.5-1.5,1.5s-1.5-.7-1.5-1.5v-14.9c0-.8.7-1.5,1.5-1.5s1.5.7,1.5,1.5v14.9h0ZM20.4,10.1h0c.9,0,1.6.5,1.9,1.3.3.8,0,1.7-.5,2.3s-1.5.8-2.3.4c-.8-.3-1.3-1.1-1.3-2s1-2.1,2.1-2.1h0Z" fill="black"/></svg>'),
|
||||||
|
// 'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode('<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path d="M16.8,2.7c-.3,0-.5.2-.5.5v11.8c0,.5-.4.9-.9.9h-5.5v-.8c0-.3-.2-.5-.5-.5h-2.5c-.1,0-.3,0-.3.1s-.1.2-.1.3v.8h-1.9c-.4,0-.8-.3-1-.7,0-.2,0-.4.2-.6.3-.3.7-.4,1.1-.4h9.4c.9,0,1.5-.7,1.5-1.5V2.1C15.8.9,14.8,0,13.7,0H4.7C3.6,0,2.7.9,2.7,2.1v13c0,0,0,.2,0,.3.2.9,1,1.5,1.9,1.5h1.9v2.7c0,.2.1.3.3.4.2,0,.4,0,.5,0l1-.9,1,.9h0c0,0,.2.1.3.1s.1,0,.2,0c.2,0,.3-.3.3-.4v-2.7h5.5c1,0,1.9-.8,1.9-1.9h0V3.2c0-.3-.2-.5-.5-.5h0ZM9.6,10.5c0,.3-.2.5-.5.5s-.5-.2-.5-.5v-4.7c0-.3.2-.5.5-.5s.5.2.5.5v4.7h0ZM9.1,3.2h0c.3,0,.5.2.6.4,0,.3,0,.5-.2.7s-.5.3-.7.1c-.3,0-.4-.3-.4-.6s.3-.7.7-.7h0Z" fill="black"/></svg>'),
|
||||||
|
'menu_position' => 5,
|
||||||
|
'supports' => array('title', 'custom-fields'),
|
||||||
|
'taxonomies' => array('category'),
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
add_action('init', 'carhop_create_posttype');
|
add_action('init', 'carhop_create_posttype');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ wp_enqueue_script('carhop-gallery-view');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<section class="block-gallery gallery content-section">
|
<section class="block-gallery gallery content-section alignwide">
|
||||||
<div class="gallery__slider">
|
<div class="gallery__slider">
|
||||||
<?php if ($gallery && is_array($gallery)) : ?>
|
<?php if ($gallery && is_array($gallery)) : ?>
|
||||||
<div class="swiper gallery-swiper">
|
<div class="swiper gallery-swiper">
|
||||||
|
|
|
||||||
|
|
@ -327,7 +327,11 @@ return array(
|
||||||
),
|
),
|
||||||
'supports' => array(
|
'supports' => array(
|
||||||
'html' => false,
|
'html' => false,
|
||||||
'anchor' => true
|
'anchor' => true,
|
||||||
|
'align' => array(
|
||||||
|
'wide',
|
||||||
|
'full'
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'textdomain' => 'carhop-blocks',
|
'textdomain' => 'carhop-blocks',
|
||||||
'editorScript' => 'file:./index.js',
|
'editorScript' => 'file:./index.js',
|
||||||
|
|
@ -359,8 +363,9 @@ return array(
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => 'full',
|
'default' => 'full',
|
||||||
'enum' => array(
|
'enum' => array(
|
||||||
'full',
|
'contained',
|
||||||
'contained'
|
'wide',
|
||||||
|
'full'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -554,7 +559,17 @@ return array(
|
||||||
|
|
||||||
),
|
),
|
||||||
'supports' => array(
|
'supports' => array(
|
||||||
'html' => false
|
'html' => false,
|
||||||
|
'align' => array(
|
||||||
|
'wide',
|
||||||
|
'full'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'attributes' => array(
|
||||||
|
'align' => array(
|
||||||
|
'type' => 'string',
|
||||||
|
'default' => 'full'
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'textdomain' => 'front-header',
|
'textdomain' => 'front-header',
|
||||||
'editorScript' => 'file:./index.js',
|
'editorScript' => 'file:./index.js',
|
||||||
|
|
@ -846,7 +861,13 @@ return array(
|
||||||
'editorScript' => 'file:./index.js',
|
'editorScript' => 'file:./index.js',
|
||||||
'editorStyle' => 'file:./index.css',
|
'editorStyle' => 'file:./index.css',
|
||||||
'style' => 'file:./style-index.css',
|
'style' => 'file:./style-index.css',
|
||||||
'viewScript' => 'file:./view.js'
|
'viewScript' => 'file:./view.js',
|
||||||
|
'attributes' => array(
|
||||||
|
'hasIcon' => array(
|
||||||
|
'type' => 'boolean',
|
||||||
|
'default' => true
|
||||||
|
)
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'our-collection' => array(
|
'our-collection' => array(
|
||||||
'$schema' => 'https://schemas.wp.org/trunk/block.json',
|
'$schema' => 'https://schemas.wp.org/trunk/block.json',
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,11 @@
|
||||||
"example": {},
|
"example": {},
|
||||||
"supports": {
|
"supports": {
|
||||||
"html": false,
|
"html": false,
|
||||||
"anchor": true
|
"anchor": true,
|
||||||
|
"align": [
|
||||||
|
"wide",
|
||||||
|
"full"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"textdomain": "carhop-blocks",
|
"textdomain": "carhop-blocks",
|
||||||
"editorScript": "file:./index.js",
|
"editorScript": "file:./index.js",
|
||||||
|
|
@ -42,8 +46,9 @@
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "full",
|
"default": "full",
|
||||||
"enum": [
|
"enum": [
|
||||||
"full",
|
"contained",
|
||||||
"contained"
|
"wide",
|
||||||
|
"full"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => '2abc1cc8d49f9b6ba159');
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => 'f5906ee56e4f48b43c73');
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ function isColorLight(color) {
|
||||||
\************************************/
|
\************************************/
|
||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/content-box","version":"0.1.0","title":"Boite de contenu","category":"carhop-blocks","icon":"smiley","description":"Boite de contenu pour la mise en forme d\'éléments de contenu","example":{},"supports":{"html":false,"anchor":true},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","attributes":{"hasBackgroundColor":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"#f1fcf9"},"hasLightBackground":{"type":"boolean","default":true},"textColor":{"type":"string","default":"inherit"},"blockVariant":{"type":"string","default":"framed"},"blockWidth":{"type":"string","default":"full","enum":["full","contained"]}}}');
|
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/content-box","version":"0.1.0","title":"Boite de contenu","category":"carhop-blocks","icon":"smiley","description":"Boite de contenu pour la mise en forme d\'éléments de contenu","example":{},"supports":{"html":false,"anchor":true,"align":["wide","full"]},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","attributes":{"hasBackgroundColor":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"#f1fcf9"},"hasLightBackground":{"type":"boolean","default":true},"textColor":{"type":"string","default":"inherit"},"blockVariant":{"type":"string","default":"framed"},"blockWidth":{"type":"string","default":"full","enum":["contained","wide","full"]}}}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
@ -183,11 +183,14 @@ function Edit({
|
||||||
__nextHasNoMarginBottom: true,
|
__nextHasNoMarginBottom: true,
|
||||||
__next40pxDefaultSize: true,
|
__next40pxDefaultSize: true,
|
||||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
|
||||||
value: "full",
|
|
||||||
label: "Pleine largeur"
|
|
||||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
|
|
||||||
value: "contained",
|
value: "contained",
|
||||||
label: "Contenue"
|
label: "Contenue"
|
||||||
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
|
||||||
|
value: "wide",
|
||||||
|
label: "Large"
|
||||||
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
|
||||||
|
value: "full",
|
||||||
|
label: "Pleine largeur"
|
||||||
})]
|
})]
|
||||||
}), blockVariant === "backgrounded" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Card, {
|
}), blockVariant === "backgrounded" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Card, {
|
||||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.CardHeader, {
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.CardHeader, {
|
||||||
|
|
@ -220,7 +223,7 @@ function Edit({
|
||||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("section", {
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("section", {
|
||||||
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
||||||
className: `${postType !== "articles" && "alignfull"} content-box content-box--variant-${blockVariant} ${hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"}
|
className: `${postType !== "articles" && "alignfull"} content-box content-box--variant-${blockVariant} ${hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"}
|
||||||
${blockWidth === "contained" ? "alignwide" : "alignfull"}`,
|
${blockWidth === "contained" ? "aligncontained" : blockWidth === "wide" ? "alignwide" : "alignfull"}`,
|
||||||
style: {
|
style: {
|
||||||
"--content-box-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit",
|
"--content-box-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit",
|
||||||
"--content-box-background-color": blockVariant === "backgrounded" ? backgroundColor : "transparent"
|
"--content-box-background-color": blockVariant === "backgrounded" ? backgroundColor : "transparent"
|
||||||
|
|
@ -232,7 +235,7 @@ function Edit({
|
||||||
template: [["core/paragraph", {
|
template: [["core/paragraph", {
|
||||||
placeholder: "Ajouter ici le texte"
|
placeholder: "Ajouter ici le texte"
|
||||||
}]],
|
}]],
|
||||||
allowedBlocks: ["core/heading", "core/paragraph", "core/group", "core/list", "core/button", "core/image", "core/buttons", "core/columns", "core/post-title", "core/embed", "core/quote", "core/pullquote", "core/media-text", "core/table", "carhop-blocks/chapter-section", "carhop-blocks/heading", "carhop-blocks/decorative-shapes", "carhop-blocks/scroll-story-block", "carhop-blocks/cta", "carhop-blocks/cta-group", "carhop-blocks/audio-player", "carhop-blocks/localisation-map", "carhop-blocks/notice-panel", "carhop-blocks/story-timeline", "carhop-blocks/highlight-timeline", "acf/statistics-datas", "ninja-forms/form", "gravityforms/form", "dynamiques-blocks/sitemap", "mailpoet/subscription-form-block", "shortcode"]
|
allowedBlocks: ["core/heading", "core/paragraph", "core/group", "core/list", "core/button", "core/image", "core/buttons", "core/columns", "core/post-title", "core/embed", "core/quote", "core/pullquote", "core/media-text", "core/table", "carhop-blocks/chapter-section", "carhop-blocks/heading", "carhop-blocks/decorative-shapes", "carhop-blocks/scroll-story-block", "carhop-blocks/cta", "carhop-blocks/cta-group", "carhop-blocks/audio-player", "carhop-blocks/content-box", "carhop-blocks/localisation-map", "carhop-blocks/notice-panel", "carhop-blocks/story-timeline", "carhop-blocks/highlight-timeline", "acf/statistics-datas", "ninja-forms/form", "gravityforms/form", "dynamiques-blocks/sitemap", "mailpoet/subscription-form-block", "shortcode"]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})]
|
})]
|
||||||
|
|
@ -328,7 +331,7 @@ function save({
|
||||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("section", {
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("section", {
|
||||||
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({
|
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({
|
||||||
className: `content-box content-box--variant-${blockVariant} ${hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"}
|
className: `content-box content-box--variant-${blockVariant} ${hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"}
|
||||||
${blockWidth === "contained" ? "alignwide" : "alignfull"}`,
|
${blockWidth === "contained" ? "aligncontained" : blockWidth === "wide" ? "alignwide" : "alignfull"}`,
|
||||||
style: {
|
style: {
|
||||||
"--content-box-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit",
|
"--content-box-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit",
|
||||||
"--content-box-background-color": blockVariant === "backgrounded" ? backgroundColor : "transparent"
|
"--content-box-background-color": blockVariant === "backgrounded" ? backgroundColor : "transparent"
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -9,7 +9,17 @@
|
||||||
"description": "Example block scaffolded with Create Block tool.",
|
"description": "Example block scaffolded with Create Block tool.",
|
||||||
"example": {},
|
"example": {},
|
||||||
"supports": {
|
"supports": {
|
||||||
"html": false
|
"html": false,
|
||||||
|
"align": [
|
||||||
|
"wide",
|
||||||
|
"full"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"attributes": {
|
||||||
|
"align": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "full"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"textdomain": "front-header",
|
"textdomain": "front-header",
|
||||||
"editorScript": "file:./index.js",
|
"editorScript": "file:./index.js",
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '3fd36cf3f25d904fa07a');
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '7248346e1270cebc7ce0');
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
\*************************************/
|
\*************************************/
|
||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"front-header/front-header","version":"0.1.0","title":"Header","category":"carhop-blocks","icon":"smiley","description":"Example block scaffolded with Create Block tool.","example":{},"supports":{"html":false},"textdomain":"front-header","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":"front-header/front-header","version":"0.1.0","title":"Header","category":"carhop-blocks","icon":"smiley","description":"Example block scaffolded with Create Block tool.","example":{},"supports":{"html":false,"align":["wide","full"]},"attributes":{"align":{"type":"string","default":"full"}},"textdomain":"front-header","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -15,5 +15,11 @@
|
||||||
"editorScript": "file:./index.js",
|
"editorScript": "file:./index.js",
|
||||||
"editorStyle": "file:./index.css",
|
"editorStyle": "file:./index.css",
|
||||||
"style": "file:./style-index.css",
|
"style": "file:./style-index.css",
|
||||||
"viewScript": "file:./view.js"
|
"viewScript": "file:./view.js",
|
||||||
|
"attributes": {
|
||||||
|
"hasIcon": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '7aabfb46e53e3b3a191d');
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '452e1bbafca80420bbd8');
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
\*************************************/
|
\*************************************/
|
||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/notice-panel","version":"0.1.0","title":"Encart d\'information","category":"carhop-blocks","icon":"smiley","description":"Encart d\'information pour la mise en avant d\'éléments informatifs","example":{},"supports":{"html":false},"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/notice-panel","version":"0.1.0","title":"Encart d\'information","category":"carhop-blocks","icon":"smiley","description":"Encart d\'information pour la mise en avant d\'éléments informatifs","example":{},"supports":{"html":false},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","attributes":{"hasIcon":{"type":"boolean","default":true}}}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
@ -27,8 +27,11 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
||||||
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/notice-panel/editor.scss");
|
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/notice-panel/editor.scss");
|
||||||
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
|
||||||
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
|
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
||||||
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -37,25 +40,39 @@ function Edit({
|
||||||
attributes,
|
attributes,
|
||||||
setAttributes
|
setAttributes
|
||||||
}) {
|
}) {
|
||||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.Fragment, {
|
const {
|
||||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
|
hasIcon
|
||||||
|
} = attributes;
|
||||||
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
|
||||||
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, {
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
|
||||||
|
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Icone", "carhop-blocks"),
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.CheckboxControl, {
|
||||||
|
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Afficher une icône", "carhop-blocks"),
|
||||||
|
checked: hasIcon,
|
||||||
|
onChange: value => setAttributes({
|
||||||
|
hasIcon: value
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||||
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
||||||
className: "notice-panel"
|
className: "notice-panel"
|
||||||
}),
|
}),
|
||||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
||||||
className: "notice-panel__content",
|
className: `notice-panel__content has-icon-${hasIcon}`,
|
||||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
|
children: [hasIcon && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||||
className: "icon"
|
className: "icon"
|
||||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||||
className: "innerblocks",
|
className: "innerblocks",
|
||||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, {
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, {
|
||||||
template: [["core/paragraph", {
|
template: [["core/paragraph", {
|
||||||
placeholder: "Ajouter ici le texte"
|
placeholder: "Ajouter ici le texte"
|
||||||
}]]
|
}]]
|
||||||
})
|
})
|
||||||
})]
|
})]
|
||||||
})
|
})
|
||||||
})
|
})]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -132,13 +149,16 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
function save({
|
function save({
|
||||||
attributes
|
attributes
|
||||||
}) {
|
}) {
|
||||||
|
const {
|
||||||
|
hasIcon
|
||||||
|
} = attributes;
|
||||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
|
||||||
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({
|
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({
|
||||||
className: "notice-panel"
|
className: "notice-panel"
|
||||||
}),
|
}),
|
||||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("div", {
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("div", {
|
||||||
className: "notice-panel__content",
|
className: `notice-panel__content has-icon-${hasIcon}`,
|
||||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
|
children: [hasIcon && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
|
||||||
className: "icon"
|
className: "icon"
|
||||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
|
||||||
className: "innerblocks",
|
className: "innerblocks",
|
||||||
|
|
@ -182,6 +202,16 @@ module.exports = window["wp"]["blocks"];
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/components":
|
||||||
|
/*!************************************!*\
|
||||||
|
!*** external ["wp","components"] ***!
|
||||||
|
\************************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["components"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
/***/ "@wordpress/i18n":
|
/***/ "@wordpress/i18n":
|
||||||
/*!******************************!*\
|
/*!******************************!*\
|
||||||
!*** external ["wp","i18n"] ***!
|
!*** external ["wp","i18n"] ***!
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => 'e5eb90f207b7f216c33c');
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '69ebaf285e7a53f93d1e');
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ function Edit({
|
||||||
} = attributes;
|
} = attributes;
|
||||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("section", {
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("section", {
|
||||||
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
||||||
className: "subscribe-infolettre"
|
className: "subscribe-infolettre alignfull"
|
||||||
}),
|
}),
|
||||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
|
||||||
className: "subscribe-infolettre__inner",
|
className: "subscribe-infolettre__inner",
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -5,19 +5,20 @@
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.wp-block-list.is-iconed-list li.has-custom-icon {
|
.wp-block-list.is-iconed-list li.has-custom-icon {
|
||||||
padding-right: 0;
|
padding-right: 48px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 20px;
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
.wp-block-list.is-iconed-list li.has-custom-icon::before {
|
.wp-block-list.is-iconed-list li.has-custom-icon::before {
|
||||||
content: " ";
|
content: " ";
|
||||||
position: static;
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 20px;
|
padding: 6px;
|
||||||
width: 40px;
|
width: 36px;
|
||||||
height: 40px;
|
height: 36px;
|
||||||
background-color: var(--wp--preset--color--primary);
|
background-color: var(--wp--preset--color--primary);
|
||||||
background-size: 20px auto;
|
background-size: 20px auto;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
|
@ -69,3 +70,15 @@
|
||||||
.iconed-list-item-backend-icon-square--pendule {
|
.iconed-list-item-backend-icon-square--pendule {
|
||||||
background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMiAyMSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEwLjU3ODEgMjBDMTUuODY4IDIwIDIwLjE1NjIgMTUuNzQ2NyAyMC4xNTYyIDEwLjVDMjAuMTU2MiA1LjI1MzI5IDE1Ljg2OCAxIDEwLjU3ODEgMUM1LjI4ODI3IDEgMSA1LjI1MzI5IDEgMTAuNUMxIDE1Ljc0NjcgNS4yODgyNyAyMCAxMC41NzgxIDIwWiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIi8+CjxwYXRoIGQ9Ik0xMC40ODA1IDQuMzgwODZWMTEuMDc5N0gxNS4wMDYiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4K);
|
background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMiAyMSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEwLjU3ODEgMjBDMTUuODY4IDIwIDIwLjE1NjIgMTUuNzQ2NyAyMC4xNTYyIDEwLjVDMjAuMTU2MiA1LjI1MzI5IDE1Ljg2OCAxIDEwLjU3ODEgMUM1LjI4ODI3IDEgMSA1LjI1MzI5IDEgMTAuNUMxIDE1Ljc0NjcgNS4yODgyNyAyMCAxMC41NzgxIDIwWiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIi8+CjxwYXRoIGQ9Ik0xMC40ODA1IDQuMzgwODZWMTEuMDc5N0gxNS4wMDYiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4K);
|
||||||
}
|
}
|
||||||
|
.wp-block-column.is-style-sticky-column .sticky-column-wrapper {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
body.wp-admin .sticky-column-wrapper {
|
||||||
|
flex-basis: 0;
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
body.wp-admin .sticky-column-wrapper .block-editor-block-list__block {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'cb68829c713b83a15dea');
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '1f52d271b768de8e56d3');
|
||||||
|
|
|
||||||
|
|
@ -5,19 +5,20 @@
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.wp-block-list.is-iconed-list li.has-custom-icon {
|
.wp-block-list.is-iconed-list li.has-custom-icon {
|
||||||
padding-left: 0;
|
padding-left: 48px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 20px;
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
.wp-block-list.is-iconed-list li.has-custom-icon::before {
|
.wp-block-list.is-iconed-list li.has-custom-icon::before {
|
||||||
content: " ";
|
content: " ";
|
||||||
position: static;
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 20px;
|
padding: 6px;
|
||||||
width: 40px;
|
width: 36px;
|
||||||
height: 40px;
|
height: 36px;
|
||||||
background-color: var(--wp--preset--color--primary);
|
background-color: var(--wp--preset--color--primary);
|
||||||
background-size: 20px auto;
|
background-size: 20px auto;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
|
@ -69,5 +70,17 @@
|
||||||
.iconed-list-item-backend-icon-square--pendule {
|
.iconed-list-item-backend-icon-square--pendule {
|
||||||
background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMiAyMSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEwLjU3ODEgMjBDMTUuODY4IDIwIDIwLjE1NjIgMTUuNzQ2NyAyMC4xNTYyIDEwLjVDMjAuMTU2MiA1LjI1MzI5IDE1Ljg2OCAxIDEwLjU3ODEgMUM1LjI4ODI3IDEgMSA1LjI1MzI5IDEgMTAuNUMxIDE1Ljc0NjcgNS4yODgyNyAyMCAxMC41NzgxIDIwWiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIi8+CjxwYXRoIGQ9Ik0xMC40ODA1IDQuMzgwODZWMTEuMDc5N0gxNS4wMDYiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4K);
|
background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMiAyMSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEwLjU3ODEgMjBDMTUuODY4IDIwIDIwLjE1NjIgMTUuNzQ2NyAyMC4xNTYyIDEwLjVDMjAuMTU2MiA1LjI1MzI5IDE1Ljg2OCAxIDEwLjU3ODEgMUM1LjI4ODI3IDEgMSA1LjI1MzI5IDEgMTAuNUMxIDE1Ljc0NjcgNS4yODgyNyAyMCAxMC41NzgxIDIwWiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIi8+CjxwYXRoIGQ9Ik0xMC40ODA1IDQuMzgwODZWMTEuMDc5N0gxNS4wMDYiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4K);
|
||||||
}
|
}
|
||||||
|
.wp-block-column.is-style-sticky-column .sticky-column-wrapper {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
body.wp-admin .sticky-column-wrapper {
|
||||||
|
flex-basis: 0;
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
body.wp-admin .sticky-column-wrapper .block-editor-block-list__block {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*# sourceMappingURL=variations.css.map*/
|
/*# sourceMappingURL=variations.css.map*/
|
||||||
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"variations.css","mappings":";;;AAAA;EACC;AACD;AACC;EACC;EACA;EACA;EACA;EACA;AACF;AACE;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AACH;AACE;EACC;AACH;AACE;EACC;AACH;AACE;EACC;AACH;AACE;EACC;AACH;AACE;EACC;AACH;AACE;EACC;AACH;AAOA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAJD;AAKC;EACC;AAHF;AAKC;EACC;AAHF;AAKC;EACC;AAHF;AAKC;EACC;AAHF;AAKC;EACC;AAHF;AAKC;EACC;AAHF,C","sources":["webpack://carhop-blocks/./src/core-variants/variants.scss"],"sourcesContent":[".wp-block-list.is-iconed-list {\r\n\tdisplay: block;\r\n\r\n\tli.has-custom-icon {\r\n\t\tpadding-left: 0;\r\n\t\tmargin-bottom: 10px;\r\n\t\tdisplay: flex;\r\n\t\talign-items: center;\r\n\t\tgap: 20px;\r\n\r\n\t\t&::before {\r\n\t\t\tcontent: \" \";\r\n\t\t\tposition: static;\r\n\t\t\tdisplay: inline-block;\r\n\t\t\tpadding: 20px;\r\n\t\t\twidth: 40px;\r\n\t\t\theight: 40px;\r\n\t\t\tbackground-color: var(--wp--preset--color--primary);\r\n\t\t\tbackground-size: 20px auto;\r\n\t\t\tbackground-repeat: no-repeat;\r\n\t\t\tbackground-position: center;\r\n\t\t}\r\n\t\t&--sablier::before {\r\n\t\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-sablier.svg\");\r\n\t\t}\r\n\t\t&--loupe::before {\r\n\t\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-loupe.svg\");\r\n\t\t}\r\n\t\t&--cadenas::before {\r\n\t\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-cadenas.svg\");\r\n\t\t}\r\n\t\t&--check::before {\r\n\t\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-check.svg\");\r\n\t\t}\r\n\t\t&--loupe-alt::before {\r\n\t\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-loupe-alt.svg\");\r\n\t\t}\r\n\t\t&--pendule::before {\r\n\t\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-pendule.svg\");\r\n\t\t}\r\n\t}\r\n}\r\n\r\n.iconed-list-item-icon-dropdown {\r\n}\r\n\r\n.iconed-list-item-backend-icon-square {\r\n\tdisplay: inline-block;\r\n\twidth: 20px;\r\n\theight: 20px;\r\n\tbackground-size: contain;\r\n\tbackground-repeat: no-repeat;\r\n\tbackground-position: center;\r\n\tcolor: currentColor;\r\n\tfilter: invert(1);\r\n\t&--sablier {\r\n\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-sablier.svg\");\r\n\t}\r\n\t&--loupe {\r\n\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-loupe.svg\");\r\n\t}\r\n\t&--cadenas {\r\n\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-cadenas.svg\");\r\n\t}\r\n\t&--check {\r\n\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-check.svg\");\r\n\t}\r\n\t&--loupe-alt {\r\n\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-loupe-alt.svg\");\r\n\t}\r\n\t&--pendule {\r\n\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-pendule.svg\");\r\n\t}\r\n}\r\n"],"names":[],"ignoreList":[],"sourceRoot":""}
|
{"version":3,"file":"variations.css","mappings":";;;AAAA;EACC;AACD;AACC;EACC;EACA;EACA;EACA;AACF;AAIE;EACC;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAHH;AAKE;EACC;AAHH;AAKE;EACC;AAHH;AAKE;EACC;AAHH;AAKE;EACC;AAHH;AAKE;EACC;AAHH;AAKE;EACC;AAHH;AAQA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AALD;AAMC;EACC;AAJF;AAMC;EACC;AAJF;AAMC;EACC;AAJF;AAMC;EACC;AAJF;AAMC;EACC;AAJF;AAMC;EACC;AAJF;AASC;EACC;EACA;AANF;AAWC;EACC;EACA;AARF;AASE;EACC;EACA;AAPH,C","sources":["webpack://carhop-blocks/./src/core-variants/variants.scss"],"sourcesContent":[".wp-block-list.is-iconed-list {\r\n\tdisplay: block;\r\n\r\n\tli.has-custom-icon {\r\n\t\tpadding-left: 48px;\r\n\t\tmargin-bottom: 20px;\r\n\t\tgap: 20px;\r\n\t\tposition: relative;\r\n\r\n\t\t// display: flex;\r\n\t\t// align-items: center;\r\n\r\n\t\t&::before {\r\n\t\t\tcontent: \" \";\r\n\t\t\t// position: static;\r\n\t\t\tposition: absolute;\r\n\t\t\ttop: 0;\r\n\t\t\tleft: 0;\r\n\t\t\tdisplay: inline-block;\r\n\t\t\tpadding: 6px;\r\n\t\t\twidth: 36px;\r\n\t\t\theight: 36px;\r\n\t\t\tbackground-color: var(--wp--preset--color--primary);\r\n\t\t\tbackground-size: 20px auto;\r\n\t\t\tbackground-repeat: no-repeat;\r\n\t\t\tbackground-position: center;\r\n\t\t}\r\n\t\t&--sablier::before {\r\n\t\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-sablier.svg\");\r\n\t\t}\r\n\t\t&--loupe::before {\r\n\t\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-loupe.svg\");\r\n\t\t}\r\n\t\t&--cadenas::before {\r\n\t\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-cadenas.svg\");\r\n\t\t}\r\n\t\t&--check::before {\r\n\t\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-check.svg\");\r\n\t\t}\r\n\t\t&--loupe-alt::before {\r\n\t\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-loupe-alt.svg\");\r\n\t\t}\r\n\t\t&--pendule::before {\r\n\t\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-pendule.svg\");\r\n\t\t}\r\n\t}\r\n}\r\n\r\n.iconed-list-item-backend-icon-square {\r\n\tdisplay: inline-block;\r\n\twidth: 20px;\r\n\theight: 20px;\r\n\tbackground-size: contain;\r\n\tbackground-repeat: no-repeat;\r\n\tbackground-position: center;\r\n\tcolor: currentColor;\r\n\tfilter: invert(1);\r\n\t&--sablier {\r\n\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-sablier.svg\");\r\n\t}\r\n\t&--loupe {\r\n\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-loupe.svg\");\r\n\t}\r\n\t&--cadenas {\r\n\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-cadenas.svg\");\r\n\t}\r\n\t&--check {\r\n\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-check.svg\");\r\n\t}\r\n\t&--loupe-alt {\r\n\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-loupe-alt.svg\");\r\n\t}\r\n\t&--pendule {\r\n\t\tbackground-image: url(\"../core-variants/core-list-variant/icons/carhop-pendule.svg\");\r\n\t}\r\n}\r\n\r\n.wp-block-column.is-style-sticky-column {\r\n\t.sticky-column-wrapper {\r\n\t\tposition: sticky;\r\n\t\ttop: 0;\r\n\t}\r\n}\r\n\r\nbody.wp-admin {\r\n\t.sticky-column-wrapper {\r\n\t\tflex-basis: 0;\r\n\t\tflex-grow: 1;\r\n\t\t.block-editor-block-list__block {\r\n\t\t\tposition: sticky;\r\n\t\t\ttop: 0;\r\n\t\t}\r\n\t}\r\n}\r\n"],"names":[],"ignoreList":[],"sourceRoot":""}
|
||||||
|
|
@ -1,6 +1,103 @@
|
||||||
/******/ (() => { // webpackBootstrap
|
/******/ (() => { // webpackBootstrap
|
||||||
/******/ var __webpack_modules__ = ({
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ "./src/core-variants/core-buttons/editor.js":
|
||||||
|
/*!**************************************************!*\
|
||||||
|
!*** ./src/core-variants/core-buttons/editor.js ***!
|
||||||
|
\**************************************************/
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
wp.blocks.registerBlockStyle("core/buttons", {
|
||||||
|
name: "big-buttons",
|
||||||
|
label: "Grands boutons "
|
||||||
|
});
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/core-variants/core-columns/editor.js":
|
||||||
|
/*!**************************************************!*\
|
||||||
|
!*** ./src/core-variants/core-columns/editor.js ***!
|
||||||
|
\**************************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
|
||||||
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
|
||||||
|
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
|
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
|
||||||
|
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
||||||
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Enregistrement du style de bloc
|
||||||
|
|
||||||
|
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockStyle)("core/column", {
|
||||||
|
name: "sticky-column",
|
||||||
|
label: "Colonne sticky"
|
||||||
|
});
|
||||||
|
|
||||||
|
// Fonction pour vérifier si le style sticky-columns est appliqué
|
||||||
|
const hasStickyColumnStyle = attributes => {
|
||||||
|
const className = attributes?.className || "";
|
||||||
|
return className.includes("is-style-sticky-column");
|
||||||
|
};
|
||||||
|
|
||||||
|
// -----------------------------
|
||||||
|
// 1. Modifier le HTML sauvegardé pour envelopper les colonnes dans une div avec la classe "test"
|
||||||
|
// -----------------------------
|
||||||
|
(0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__.addFilter)("blocks.getSaveElement", "carhop/sticky-columns-wrapper", (element, blockType, attributes) => {
|
||||||
|
// Vérifier si c'est le bloc core/columns et si le style sticky-columns est appliqué
|
||||||
|
if (blockType.name !== "core/column" || !hasStickyColumnStyle(attributes)) {
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Si l'élément est null ou n'a pas d'enfants, retourner tel quel
|
||||||
|
if (!element || !element.props || !element.props.children) {
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Envelopper les enfants dans une div avec la classe "sticky-column-wrapper"
|
||||||
|
const wrappedChildren = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)("div", {
|
||||||
|
className: "sticky-column-wrapper"
|
||||||
|
}, element.props.children);
|
||||||
|
|
||||||
|
// Retourner l'élément avec les enfants enveloppés
|
||||||
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)(element.type, {
|
||||||
|
...element.props,
|
||||||
|
children: wrappedChildren
|
||||||
|
}, wrappedChildren);
|
||||||
|
});
|
||||||
|
|
||||||
|
// -----------------------------
|
||||||
|
// 2. Modifier l'affichage dans l'éditeur pour envelopper les colonnes dans une div avec la classe "test"
|
||||||
|
// -----------------------------
|
||||||
|
(0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__.addFilter)("editor.BlockEdit", "carhop/sticky-columns-editor-wrapper", (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__.createHigherOrderComponent)(BlockEdit => {
|
||||||
|
return props => {
|
||||||
|
// Vérifier si c'est le bloc core/column et si le style sticky-column est appliqué
|
||||||
|
if (props.name !== "core/column" || !hasStickyColumnStyle(props.attributes)) {
|
||||||
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(BlockEdit, {
|
||||||
|
...props
|
||||||
|
});
|
||||||
|
}
|
||||||
|
console.log(props);
|
||||||
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)("div", {
|
||||||
|
className: "sticky-column-wrapper"
|
||||||
|
}, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(BlockEdit, {
|
||||||
|
...props
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
}, "withStickyColumnWrapper"));
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
/***/ "./src/core-variants/core-embed-variant/editor.js":
|
/***/ "./src/core-variants/core-embed-variant/editor.js":
|
||||||
/*!********************************************************!*\
|
/*!********************************************************!*\
|
||||||
!*** ./src/core-variants/core-embed-variant/editor.js ***!
|
!*** ./src/core-variants/core-embed-variant/editor.js ***!
|
||||||
|
|
@ -407,7 +504,12 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony import */ var _core_embed_variant_editor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./core-embed-variant/editor.js */ "./src/core-variants/core-embed-variant/editor.js");
|
/* harmony import */ var _core_embed_variant_editor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./core-embed-variant/editor.js */ "./src/core-variants/core-embed-variant/editor.js");
|
||||||
/* harmony import */ var _core_embed_variant_editor_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_core_embed_variant_editor_js__WEBPACK_IMPORTED_MODULE_2__);
|
/* harmony import */ var _core_embed_variant_editor_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_core_embed_variant_editor_js__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
/* harmony import */ var _core_list_variant_editor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./core-list-variant/editor.js */ "./src/core-variants/core-list-variant/editor.js");
|
/* harmony import */ var _core_list_variant_editor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./core-list-variant/editor.js */ "./src/core-variants/core-list-variant/editor.js");
|
||||||
/* harmony import */ var _variants_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variants.scss */ "./src/core-variants/variants.scss");
|
/* harmony import */ var _core_buttons_editor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./core-buttons/editor.js */ "./src/core-variants/core-buttons/editor.js");
|
||||||
|
/* harmony import */ var _core_buttons_editor_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_core_buttons_editor_js__WEBPACK_IMPORTED_MODULE_4__);
|
||||||
|
/* harmony import */ var _core_columns_editor_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./core-columns/editor.js */ "./src/core-variants/core-columns/editor.js");
|
||||||
|
/* harmony import */ var _variants_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./variants.scss */ "./src/core-variants/variants.scss");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -10,7 +10,11 @@
|
||||||
"example": {},
|
"example": {},
|
||||||
"supports": {
|
"supports": {
|
||||||
"html": false,
|
"html": false,
|
||||||
"anchor": true
|
"anchor": true,
|
||||||
|
"align": [
|
||||||
|
"wide",
|
||||||
|
"full"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"textdomain": "carhop-blocks",
|
"textdomain": "carhop-blocks",
|
||||||
"editorScript": "file:./index.js",
|
"editorScript": "file:./index.js",
|
||||||
|
|
@ -42,8 +46,9 @@
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "full",
|
"default": "full",
|
||||||
"enum": [
|
"enum": [
|
||||||
"full",
|
"contained",
|
||||||
"contained"
|
"wide",
|
||||||
|
"full"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
const filteredTextColors = filterTextColors(
|
const filteredTextColors = filterTextColors(
|
||||||
colors,
|
colors,
|
||||||
postType,
|
postType,
|
||||||
backgroundColor
|
backgroundColor,
|
||||||
);
|
);
|
||||||
|
|
||||||
function onBackgroundColorChange(value) {
|
function onBackgroundColorChange(value) {
|
||||||
|
|
@ -111,8 +111,9 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
__nextHasNoMarginBottom
|
__nextHasNoMarginBottom
|
||||||
__next40pxDefaultSize
|
__next40pxDefaultSize
|
||||||
>
|
>
|
||||||
<ToggleGroupControlOption value="full" label="Pleine largeur" />
|
|
||||||
<ToggleGroupControlOption value="contained" label="Contenue" />
|
<ToggleGroupControlOption value="contained" label="Contenue" />
|
||||||
|
<ToggleGroupControlOption value="wide" label="Large" />
|
||||||
|
<ToggleGroupControlOption value="full" label="Pleine largeur" />
|
||||||
</ToggleGroupControl>
|
</ToggleGroupControl>
|
||||||
|
|
||||||
{blockVariant === "backgrounded" && (
|
{blockVariant === "backgrounded" && (
|
||||||
|
|
@ -157,7 +158,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
? "content-box--bg-light"
|
? "content-box--bg-light"
|
||||||
: "content-box--bg-dark"
|
: "content-box--bg-dark"
|
||||||
}
|
}
|
||||||
${blockWidth === "contained" ? "alignwide" : "alignfull"}`,
|
${blockWidth === "contained" ? "aligncontained" : blockWidth === "wide" ? "alignwide" : "alignfull"}`,
|
||||||
style: {
|
style: {
|
||||||
"--content-box-text-color": textColor ?? "inherit",
|
"--content-box-text-color": textColor ?? "inherit",
|
||||||
"--content-box-background-color":
|
"--content-box-background-color":
|
||||||
|
|
@ -192,6 +193,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
"carhop-blocks/cta",
|
"carhop-blocks/cta",
|
||||||
"carhop-blocks/cta-group",
|
"carhop-blocks/cta-group",
|
||||||
"carhop-blocks/audio-player",
|
"carhop-blocks/audio-player",
|
||||||
|
"carhop-blocks/content-box",
|
||||||
"carhop-blocks/localisation-map",
|
"carhop-blocks/localisation-map",
|
||||||
"carhop-blocks/notice-panel",
|
"carhop-blocks/notice-panel",
|
||||||
"carhop-blocks/story-timeline",
|
"carhop-blocks/story-timeline",
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ export default function save({ attributes }) {
|
||||||
className: `content-box content-box--variant-${blockVariant} ${
|
className: `content-box content-box--variant-${blockVariant} ${
|
||||||
hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"
|
hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"
|
||||||
}
|
}
|
||||||
${blockWidth === "contained" ? "alignwide" : "alignfull"}`,
|
${blockWidth === "contained" ? "aligncontained" : blockWidth === "wide" ? "alignwide" : "alignfull"}`,
|
||||||
style: {
|
style: {
|
||||||
"--content-box-text-color": textColor ?? "inherit",
|
"--content-box-text-color": textColor ?? "inherit",
|
||||||
"--content-box-background-color":
|
"--content-box-background-color":
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
wp.blocks.registerBlockStyle("core/buttons", {
|
||||||
|
name: "big-buttons",
|
||||||
|
label: "Grands boutons ",
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
import { registerBlockStyle } from "@wordpress/blocks";
|
||||||
|
import { addFilter } from "@wordpress/hooks";
|
||||||
|
import {
|
||||||
|
createElement,
|
||||||
|
Fragment,
|
||||||
|
cloneElement,
|
||||||
|
Children,
|
||||||
|
} from "@wordpress/element";
|
||||||
|
import { createHigherOrderComponent } from "@wordpress/compose";
|
||||||
|
|
||||||
|
// Enregistrement du style de bloc
|
||||||
|
registerBlockStyle("core/column", {
|
||||||
|
name: "sticky-column",
|
||||||
|
label: "Colonne sticky",
|
||||||
|
});
|
||||||
|
|
||||||
|
// Fonction pour vérifier si le style sticky-columns est appliqué
|
||||||
|
const hasStickyColumnStyle = (attributes) => {
|
||||||
|
const className = attributes?.className || "";
|
||||||
|
return className.includes("is-style-sticky-column");
|
||||||
|
};
|
||||||
|
|
||||||
|
// -----------------------------
|
||||||
|
// 1. Modifier le HTML sauvegardé pour envelopper les colonnes dans une div avec la classe "test"
|
||||||
|
// -----------------------------
|
||||||
|
addFilter(
|
||||||
|
"blocks.getSaveElement",
|
||||||
|
"carhop/sticky-columns-wrapper",
|
||||||
|
(element, blockType, attributes) => {
|
||||||
|
// Vérifier si c'est le bloc core/columns et si le style sticky-columns est appliqué
|
||||||
|
if (blockType.name !== "core/column" || !hasStickyColumnStyle(attributes)) {
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Si l'élément est null ou n'a pas d'enfants, retourner tel quel
|
||||||
|
if (!element || !element.props || !element.props.children) {
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Envelopper les enfants dans une div avec la classe "sticky-column-wrapper"
|
||||||
|
const wrappedChildren = createElement(
|
||||||
|
"div",
|
||||||
|
{ className: "sticky-column-wrapper" },
|
||||||
|
element.props.children,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Retourner l'élément avec les enfants enveloppés
|
||||||
|
return createElement(
|
||||||
|
element.type,
|
||||||
|
{
|
||||||
|
...element.props,
|
||||||
|
children: wrappedChildren,
|
||||||
|
},
|
||||||
|
wrappedChildren,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
// -----------------------------
|
||||||
|
// 2. Modifier l'affichage dans l'éditeur pour envelopper les colonnes dans une div avec la classe "test"
|
||||||
|
// -----------------------------
|
||||||
|
addFilter(
|
||||||
|
"editor.BlockEdit",
|
||||||
|
"carhop/sticky-columns-editor-wrapper",
|
||||||
|
createHigherOrderComponent((BlockEdit) => {
|
||||||
|
return (props) => {
|
||||||
|
// Vérifier si c'est le bloc core/column et si le style sticky-column est appliqué
|
||||||
|
if (
|
||||||
|
props.name !== "core/column" ||
|
||||||
|
!hasStickyColumnStyle(props.attributes)
|
||||||
|
) {
|
||||||
|
return <BlockEdit {...props} />;
|
||||||
|
}
|
||||||
|
console.log(props);
|
||||||
|
|
||||||
|
return createElement(
|
||||||
|
"div",
|
||||||
|
{ className: "sticky-column-wrapper" },
|
||||||
|
<BlockEdit {...props} />,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}, "withStickyColumnWrapper"),
|
||||||
|
);
|
||||||
|
|
@ -2,5 +2,7 @@ import "./core-heading-variant/editor.js";
|
||||||
import "./core-image-variant/editor.js";
|
import "./core-image-variant/editor.js";
|
||||||
import "./core-embed-variant/editor.js";
|
import "./core-embed-variant/editor.js";
|
||||||
import "./core-list-variant/editor.js";
|
import "./core-list-variant/editor.js";
|
||||||
|
import "./core-buttons/editor.js";
|
||||||
|
import "./core-columns/editor.js";
|
||||||
|
|
||||||
import "./variants.scss";
|
import "./variants.scss";
|
||||||
|
|
|
||||||
|
|
@ -2,19 +2,24 @@
|
||||||
display: block;
|
display: block;
|
||||||
|
|
||||||
li.has-custom-icon {
|
li.has-custom-icon {
|
||||||
padding-left: 0;
|
padding-left: 48px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 20px;
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
// display: flex;
|
||||||
|
// align-items: center;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
content: " ";
|
content: " ";
|
||||||
position: static;
|
// position: static;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 20px;
|
padding: 6px;
|
||||||
width: 40px;
|
width: 36px;
|
||||||
height: 40px;
|
height: 36px;
|
||||||
background-color: var(--wp--preset--color--primary);
|
background-color: var(--wp--preset--color--primary);
|
||||||
background-size: 20px auto;
|
background-size: 20px auto;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
|
@ -41,9 +46,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconed-list-item-icon-dropdown {
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconed-list-item-backend-icon-square {
|
.iconed-list-item-backend-icon-square {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
|
|
@ -72,3 +74,21 @@
|
||||||
background-image: url("../core-variants/core-list-variant/icons/carhop-pendule.svg");
|
background-image: url("../core-variants/core-list-variant/icons/carhop-pendule.svg");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wp-block-column.is-style-sticky-column {
|
||||||
|
.sticky-column-wrapper {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
body.wp-admin {
|
||||||
|
.sticky-column-wrapper {
|
||||||
|
flex-basis: 0;
|
||||||
|
flex-grow: 1;
|
||||||
|
.block-editor-block-list__block {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,17 @@
|
||||||
"description": "Example block scaffolded with Create Block tool.",
|
"description": "Example block scaffolded with Create Block tool.",
|
||||||
"example": {},
|
"example": {},
|
||||||
"supports": {
|
"supports": {
|
||||||
"html": false
|
"html": false,
|
||||||
|
"align": [
|
||||||
|
"wide",
|
||||||
|
"full"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"attributes": {
|
||||||
|
"align": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "full"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"textdomain": "front-header",
|
"textdomain": "front-header",
|
||||||
"editorScript": "file:./index.js",
|
"editorScript": "file:./index.js",
|
||||||
|
|
|
||||||
|
|
@ -15,5 +15,11 @@
|
||||||
"editorScript": "file:./index.js",
|
"editorScript": "file:./index.js",
|
||||||
"editorStyle": "file:./index.css",
|
"editorStyle": "file:./index.css",
|
||||||
"style": "file:./style-index.css",
|
"style": "file:./style-index.css",
|
||||||
"viewScript": "file:./view.js"
|
"viewScript": "file:./view.js",
|
||||||
|
"attributes": {
|
||||||
|
"hasIcon": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,17 +1,33 @@
|
||||||
import { __ } from "@wordpress/i18n";
|
import { __ } from "@wordpress/i18n";
|
||||||
import { useBlockProps, RichText, InnerBlocks } from "@wordpress/block-editor";
|
import {
|
||||||
|
useBlockProps,
|
||||||
|
RichText,
|
||||||
|
InnerBlocks,
|
||||||
|
InspectorControls,
|
||||||
|
} from "@wordpress/block-editor";
|
||||||
import "./editor.scss";
|
import "./editor.scss";
|
||||||
|
import { PanelBody, CheckboxControl } from "@wordpress/components";
|
||||||
|
|
||||||
export default function Edit({ attributes, setAttributes }) {
|
export default function Edit({ attributes, setAttributes }) {
|
||||||
|
const { hasIcon } = attributes;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<InspectorControls>
|
||||||
|
<PanelBody title={__("Icone", "carhop-blocks")}>
|
||||||
|
<CheckboxControl
|
||||||
|
label={__("Afficher une icône", "carhop-blocks")}
|
||||||
|
checked={hasIcon}
|
||||||
|
onChange={(value) => setAttributes({ hasIcon: value })}
|
||||||
|
/>
|
||||||
|
</PanelBody>
|
||||||
|
</InspectorControls>
|
||||||
<div
|
<div
|
||||||
{...useBlockProps({
|
{...useBlockProps({
|
||||||
className: "notice-panel",
|
className: "notice-panel",
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<div className="notice-panel__content">
|
<div className={`notice-panel__content has-icon-${hasIcon}`}>
|
||||||
<div className="icon"></div>
|
{hasIcon && <div className="icon"></div>}
|
||||||
<div className="innerblocks">
|
<div className="innerblocks">
|
||||||
<InnerBlocks
|
<InnerBlocks
|
||||||
template={[
|
template={[
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,15 @@ import { RichText } from "@wordpress/block-editor";
|
||||||
import { InnerBlocks } from "@wordpress/block-editor";
|
import { InnerBlocks } from "@wordpress/block-editor";
|
||||||
|
|
||||||
export default function save({ attributes }) {
|
export default function save({ attributes }) {
|
||||||
|
const { hasIcon } = attributes;
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
{...useBlockProps.save({
|
{...useBlockProps.save({
|
||||||
className: "notice-panel",
|
className: "notice-panel",
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<div className="notice-panel__content">
|
<div className={`notice-panel__content has-icon-${hasIcon}`}>
|
||||||
<div className="icon"></div>
|
{hasIcon && <div className="icon"></div>}
|
||||||
|
|
||||||
<div className="innerblocks">
|
<div className="innerblocks">
|
||||||
<InnerBlocks.Content />
|
<InnerBlocks.Content />
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ export default function Edit({ attributes, setAttributes }) {
|
||||||
return (
|
return (
|
||||||
<section
|
<section
|
||||||
{...useBlockProps({
|
{...useBlockProps({
|
||||||
className: "subscribe-infolettre",
|
className: "subscribe-infolettre alignfull",
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<div className="subscribe-infolettre__inner">
|
<div className="subscribe-infolettre__inner">
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ $authors = get_posts(array(
|
||||||
));
|
));
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<section class="team-authors content-section">
|
<section class="team-authors content-section alignwide">
|
||||||
<h2 class="title-small">Équipe dynamiques</h2>
|
<h2 class="title-small">Équipe dynamiques</h2>
|
||||||
<h3 class="subtitle-big">À la croisée des plumes et des luttes</h3>
|
<h3 class="subtitle-big">À la croisée des plumes et des luttes</h3>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ $issue_related_articles = get_field('articles', $last_issue->ID);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<section class="block-dernieres-dynamiques content-section block-dernieres-dynamiques--<?php echo $variantLocation; ?>">
|
<section class="block-dernieres-dynamiques content-section block-dernieres-dynamiques--<?php echo $variantLocation; ?> alignfull">
|
||||||
<div class="block-dernieres-dynamiques__inner">
|
<div class="block-dernieres-dynamiques__inner">
|
||||||
<div class="block-dernieres-dynamiques__header">
|
<div class="block-dernieres-dynamiques__header">
|
||||||
<h2 class="block-title">
|
<h2 class="block-title">
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -23,7 +23,7 @@ $issue_related_articles = get_field('articles', $last_issue->ID);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<section class="block-dernieres-dynamiques content-section block-dernieres-dynamiques--<?php echo $variantLocation; ?>">
|
<section class="block-dernieres-dynamiques content-section block-dernieres-dynamiques--<?php echo $variantLocation; ?> alignfull">
|
||||||
<div class="block-dernieres-dynamiques__inner">
|
<div class="block-dernieres-dynamiques__inner">
|
||||||
<div class="block-dernieres-dynamiques__header">
|
<div class="block-dernieres-dynamiques__header">
|
||||||
<h2 class="block-title">
|
<h2 class="block-title">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user