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 ***!
|
||||
\****************************************************************************************************************************************************************************************************************************************************/
|
||||
/**
|
||||
* The following styles get applied inside the editor only.
|
||||
*
|
||||
* Replace them with your own styles or remove the file completely.
|
||||
*/
|
||||
.wp-block-create-block-test {
|
||||
border: 1px dotted #f00;
|
||||
.homegrade-blocks-parcours-step.is-selected {
|
||||
outline: 2px solid var(--wp--preset--color--secondary, --wp-admin-theme-color, #007cba) !important;
|
||||
}
|
||||
.homegrade-blocks-parcours-step.is-selected:focus:after {
|
||||
position: static !important;
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
/*# 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 {
|
||||
relatedPostId
|
||||
} = 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 => {
|
||||
var _media$source_url;
|
||||
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;
|
||||
}, [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"], {
|
||||
|
|
@ -147,7 +147,7 @@ function Edit({
|
|||
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", {
|
||||
class: "parcours-step-card__icon",
|
||||
className: "parcours-step-card__icon",
|
||||
src: stepIconUrl,
|
||||
alt: ""
|
||||
}), (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 { useBlockProps } from "@wordpress/block-editor";
|
||||
import OptionsSelectControl from "./OptionsSelectControl";
|
||||
import { useSelect } from "@wordpress/data";
|
||||
import "./editor.scss";
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { useBlockProps } from '@wordpress/block-editor';
|
||||
import OptionsSelectControl from './OptionsSelectControl';
|
||||
import { useSelect } from '@wordpress/data';
|
||||
import './editor.scss';
|
||||
|
||||
export default function Edit({ attributes, setAttributes }) {
|
||||
const { relatedPostId } = attributes;
|
||||
const post = useSelect((select) =>
|
||||
select("core").getEntityRecord("postType", "parcours", relatedPostId)
|
||||
select('core').getEntityRecord('postType', 'parcours', relatedPostId)
|
||||
);
|
||||
const stepIconUrl = useSelect(
|
||||
(select) => {
|
||||
let setpIconID = post?.acf?.step_icon;
|
||||
const media = select("core").getMedia(setpIconID);
|
||||
const media = select('core').getMedia(setpIconID);
|
||||
return media?.source_url ?? null;
|
||||
},
|
||||
[post]
|
||||
|
|
@ -20,10 +20,7 @@ export default function Edit({ attributes, setAttributes }) {
|
|||
|
||||
return (
|
||||
<>
|
||||
<OptionsSelectControl
|
||||
relatedPostId={relatedPostId}
|
||||
setAttributes={setAttributes}
|
||||
/>
|
||||
<OptionsSelectControl relatedPostId={relatedPostId} setAttributes={setAttributes} />
|
||||
|
||||
<div
|
||||
{...useBlockProps({
|
||||
|
|
@ -32,7 +29,7 @@ export default function Edit({ attributes, setAttributes }) {
|
|||
>
|
||||
{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>
|
||||
</>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
/**
|
||||
* The following styles get applied inside the editor only.
|
||||
*
|
||||
* Replace them with your own styles or remove the file completely.
|
||||
*/
|
||||
|
||||
.wp-block-create-block-test {
|
||||
border: 1px dotted #f00;
|
||||
.homegrade-blocks-parcours-step.is-selected {
|
||||
outline: 2px solid var(--wp--preset--color--secondary, --wp-admin-theme-color, #007cba) !important;
|
||||
&:focus:after {
|
||||
position: static !important;
|
||||
outline: none !important;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user