making some test for focal point picker precision

This commit is contained in:
Antoine M 2024-03-20 11:55:27 +01:00
parent 880a037228
commit 0919151813
7 changed files with 37 additions and 9 deletions

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'cf77ee822bf6010cfa16'); <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '20350dab69404054c069');

View File

@ -79,6 +79,7 @@ function Edit({
focusIndex focusIndex
} = attributes; } = attributes;
function handleChangeobjectPosition(objectPosition) { function handleChangeobjectPosition(objectPosition) {
console.log('position', objectPosition);
setAttributes({ setAttributes({
objectPosition objectPosition
}); });
@ -118,7 +119,14 @@ function Edit({
objectScale objectScale
}); });
} }
console.log(behaviourType, clientId); function resolvepoint(point) {
console.log('point', point);
return {
x: point.x,
y: point.y
};
}
console.log(objectPosition);
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_3__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelBody, { 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_3__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelBody, {
className: "focus-point-modification-pannel", className: "focus-point-modification-pannel",
title: "Object de comportement clickable" title: "Object de comportement clickable"
@ -157,7 +165,8 @@ function Edit({
value: objectPosition, value: objectPosition,
onChange: focalPoint => { onChange: focalPoint => {
handleChangeobjectPosition(focalPoint); handleChangeobjectPosition(focalPoint);
} },
resolvePoint: resolvepoint
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.RangeControl, { }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.RangeControl, {
label: "Scale", label: "Scale",
value: objectScale, value: objectScale,

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '827526b833aac8a953d1'); <?php return array('dependencies' => array('react', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '5ef52644f751f125af68');

View File

@ -296,6 +296,7 @@ function Edit({
focusIndex focusIndex
} = attributes; } = attributes;
function handleChangeobjectPosition(objectPosition) { function handleChangeobjectPosition(objectPosition) {
console.log('position', objectPosition);
setAttributes({ setAttributes({
objectPosition objectPosition
}); });
@ -335,7 +336,14 @@ function Edit({
objectScale objectScale
}); });
} }
console.log(behaviourType, clientId); function resolvepoint(point) {
console.log('point', point);
return {
x: point.x,
y: point.y
};
}
console.log(objectPosition);
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_3__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelBody, { 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_3__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelBody, {
className: "focus-point-modification-pannel", className: "focus-point-modification-pannel",
title: "Object de comportement clickable" title: "Object de comportement clickable"
@ -374,7 +382,8 @@ function Edit({
value: objectPosition, value: objectPosition,
onChange: focalPoint => { onChange: focalPoint => {
handleChangeobjectPosition(focalPoint); handleChangeobjectPosition(focalPoint);
} },
resolvePoint: resolvepoint
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.RangeControl, { }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.RangeControl, {
label: "Scale", label: "Scale",
value: objectScale, value: objectScale,

File diff suppressed because one or more lines are too long

View File

@ -37,6 +37,8 @@ export default function Edit({
} = attributes; } = attributes;
function handleChangeobjectPosition(objectPosition) { function handleChangeobjectPosition(objectPosition) {
console.log('position', objectPosition);
setAttributes({ objectPosition }); setAttributes({ objectPosition });
} }
function handleChangeTitle(focusTitle) { function handleChangeTitle(focusTitle) {
@ -69,8 +71,15 @@ export default function Edit({
function setScale(objectScale) { function setScale(objectScale) {
setAttributes({ objectScale }); setAttributes({ objectScale });
} }
function resolvepoint(point) {
console.log('point', point);
return {
x: point.x,
y: point.y,
};
}
console.log(behaviourType, clientId); console.log(objectPosition);
return ( return (
<> <>
<InspectorControls> <InspectorControls>
@ -143,6 +152,7 @@ export default function Edit({
onChange={(focalPoint) => { onChange={(focalPoint) => {
handleChangeobjectPosition(focalPoint); handleChangeobjectPosition(focalPoint);
}} }}
resolvePoint={resolvepoint}
/> />
<RangeControl <RangeControl
label="Scale" label="Scale"