FIX block and passing brouillons page in linkable page list in OptionSelectrontrol
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
ef64310b51
commit
2167de1672
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => 'e574e62cbddff5258e34');
|
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => 'fcd901559e8b72a56c33');
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
/*!****************************************************************************************************************************************************************************************************************************************************!*\
|
/*!****************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
!*** css ../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
|
!*** css ../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
|
||||||
\****************************************************************************************************************************************************************************************************************************************************/
|
\****************************************************************************************************************************************************************************************************************************************************/
|
||||||
/**
|
.homegrade-blocks-parcours-step.is-selected {
|
||||||
* The following styles get applied inside the editor only.
|
outline: 2px solid var(--wp--preset--color--secondary, --wp-admin-theme-color, #007cba) !important;
|
||||||
*
|
}
|
||||||
* Replace them with your own styles or remove the file completely.
|
.homegrade-blocks-parcours-step.is-selected:focus:after {
|
||||||
*/
|
position: static !important;
|
||||||
.wp-block-create-block-test {
|
outline: none !important;
|
||||||
border: 1px dotted #f00;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*# sourceMappingURL=index.css.map*/
|
/*# sourceMappingURL=index.css.map*/
|
||||||
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.css","mappings":";;;AAAA;;;;EAAA;AAMA;EACC;AAAD,C","sources":["webpack://test/./src/editor.scss"],"sourcesContent":["/**\n * The following styles get applied inside the editor only.\n *\n * Replace them with your own styles or remove the file completely.\n */\n\n.wp-block-create-block-test {\n\tborder: 1px dotted #f00;\n}\n"],"names":[],"sourceRoot":""}
|
{"version":3,"file":"index.css","mappings":";;;AAAA;EACC;AACD;AAAC;EACC;EACA;AAEF,C","sources":["webpack://test/./src/editor.scss"],"sourcesContent":[".homegrade-blocks-parcours-step.is-selected {\n\toutline: 2px solid var(--wp--preset--color--secondary, --wp-admin-theme-color, #007cba) !important;\n\t&:focus:after {\n\t\tposition: static !important;\n\t\toutline: none !important;\n\t}\n}\n"],"names":[],"sourceRoot":""}
|
||||||
|
|
@ -132,11 +132,11 @@ function Edit({
|
||||||
const {
|
const {
|
||||||
relatedPostId
|
relatedPostId
|
||||||
} = attributes;
|
} = attributes;
|
||||||
const post = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select("core").getEntityRecord("postType", "parcours", relatedPostId));
|
const post = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select('core').getEntityRecord('postType', 'parcours', relatedPostId));
|
||||||
const stepIconUrl = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
|
const stepIconUrl = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
|
||||||
var _media$source_url;
|
var _media$source_url;
|
||||||
let setpIconID = post?.acf?.step_icon;
|
let setpIconID = post?.acf?.step_icon;
|
||||||
const media = select("core").getMedia(setpIconID);
|
const media = select('core').getMedia(setpIconID);
|
||||||
return (_media$source_url = media?.source_url) !== null && _media$source_url !== void 0 ? _media$source_url : null;
|
return (_media$source_url = media?.source_url) !== null && _media$source_url !== void 0 ? _media$source_url : null;
|
||||||
}, [post]);
|
}, [post]);
|
||||||
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)(_OptionsSelectControl__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
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)(_OptionsSelectControl__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
||||||
|
|
@ -147,7 +147,7 @@ function Edit({
|
||||||
className: `homegrade-blocks-parcours-step parcours-step parcours-step-card`
|
className: `homegrade-blocks-parcours-step parcours-step parcours-step-card`
|
||||||
})
|
})
|
||||||
}, post && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
}, post && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
||||||
class: "parcours-step-card__icon",
|
className: "parcours-step-card__icon",
|
||||||
src: stepIconUrl,
|
src: stepIconUrl,
|
||||||
alt: ""
|
alt: ""
|
||||||
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h3", {
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h3", {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,18 +1,18 @@
|
||||||
import { __ } from "@wordpress/i18n";
|
import { __ } from '@wordpress/i18n';
|
||||||
import { useBlockProps } from "@wordpress/block-editor";
|
import { useBlockProps } from '@wordpress/block-editor';
|
||||||
import OptionsSelectControl from "./OptionsSelectControl";
|
import OptionsSelectControl from './OptionsSelectControl';
|
||||||
import { useSelect } from "@wordpress/data";
|
import { useSelect } from '@wordpress/data';
|
||||||
import "./editor.scss";
|
import './editor.scss';
|
||||||
|
|
||||||
export default function Edit({ attributes, setAttributes }) {
|
export default function Edit({ attributes, setAttributes }) {
|
||||||
const { relatedPostId } = attributes;
|
const { relatedPostId } = attributes;
|
||||||
const post = useSelect((select) =>
|
const post = useSelect((select) =>
|
||||||
select("core").getEntityRecord("postType", "parcours", relatedPostId)
|
select('core').getEntityRecord('postType', 'parcours', relatedPostId)
|
||||||
);
|
);
|
||||||
const stepIconUrl = useSelect(
|
const stepIconUrl = useSelect(
|
||||||
(select) => {
|
(select) => {
|
||||||
let setpIconID = post?.acf?.step_icon;
|
let setpIconID = post?.acf?.step_icon;
|
||||||
const media = select("core").getMedia(setpIconID);
|
const media = select('core').getMedia(setpIconID);
|
||||||
return media?.source_url ?? null;
|
return media?.source_url ?? null;
|
||||||
},
|
},
|
||||||
[post]
|
[post]
|
||||||
|
|
@ -20,10 +20,7 @@ export default function Edit({ attributes, setAttributes }) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<OptionsSelectControl
|
<OptionsSelectControl relatedPostId={relatedPostId} setAttributes={setAttributes} />
|
||||||
relatedPostId={relatedPostId}
|
|
||||||
setAttributes={setAttributes}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
{...useBlockProps({
|
{...useBlockProps({
|
||||||
|
|
@ -32,7 +29,7 @@ export default function Edit({ attributes, setAttributes }) {
|
||||||
>
|
>
|
||||||
{post && (
|
{post && (
|
||||||
<>
|
<>
|
||||||
<img class="parcours-step-card__icon" src={stepIconUrl} alt="" />
|
<img className="parcours-step-card__icon" src={stepIconUrl} alt="" />
|
||||||
<h3 className="parcours-step-card__title">{post.title.rendered}</h3>
|
<h3 className="parcours-step-card__title">{post.title.rendered}</h3>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
/**
|
.homegrade-blocks-parcours-step.is-selected {
|
||||||
* The following styles get applied inside the editor only.
|
outline: 2px solid var(--wp--preset--color--secondary, --wp-admin-theme-color, #007cba) !important;
|
||||||
*
|
&:focus:after {
|
||||||
* Replace them with your own styles or remove the file completely.
|
position: static !important;
|
||||||
*/
|
outline: none !important;
|
||||||
|
}
|
||||||
.wp-block-create-block-test {
|
|
||||||
border: 1px dotted #f00;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user