From f47489118c7f35d3d16816d5fd4e93dfc328913f Mon Sep 17 00:00:00 2001 From: antpb Date: Wed, 9 Aug 2023 22:22:06 -0500 Subject: [PATCH] fixes site editor and adds changelog (#61) --- .../environment/components/ThreeObjectEdit.js | 17 ++++++++++++++++- readme.txt | 9 ++++++--- three-object-viewer.php | 2 +- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/blocks/environment/components/ThreeObjectEdit.js b/blocks/environment/components/ThreeObjectEdit.js index e4d6c41..ccc8a88 100644 --- a/blocks/environment/components/ThreeObjectEdit.js +++ b/blocks/environment/components/ThreeObjectEdit.js @@ -1235,7 +1235,22 @@ function ThreeObject(props) { let htmlobject; let htmlobjectId; - const currentBlocks = wp.data.select("core/block-editor").getBlocks(); + const { select } = wp.data; + + function getNestedBlocks(clientId) { + const blockEditor = select("core/block-editor"); + const blocks = blockEditor.getBlocks(clientId); + let allBlocks = [...blocks]; + + blocks.forEach(block => { + const innerBlocks = getNestedBlocks(block.clientId); + allBlocks = [...allBlocks, ...innerBlocks]; + }); + + return allBlocks; + } + + const currentBlocks = getNestedBlocks(props.clientId); if (currentBlocks) { currentBlocks.forEach((block) => { if (block.name === "three-object-viewer/environment") { diff --git a/readme.txt b/readme.txt index dcabdf6..759dbf9 100644 --- a/readme.txt +++ b/readme.txt @@ -1,8 +1,8 @@ === Three Object Viewer === -Requires at least: 5.7 -Tested up to: 6.2.2 +Requires at least: 6.0 +Tested up to: 6.3 Requires PHP: 7.2 -Stable tag: 1.5.1 +Stable tag: 1.5.2 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Author: antpb @@ -42,6 +42,9 @@ It can also be installed manually using a zip file. == Changelog == += 1.5.2 = +Fixed: Full compatibility with the Site Editor. + = 1.5.1 = Added: Video Block - Now sets audio to positionally play where the video's plane or mesh is located in the scene. Fixed: Player Controller animations fixed to not play incorrect direction when multiple directions are held. diff --git a/three-object-viewer.php b/three-object-viewer.php index 0bf3c92..a7b7dc1 100644 --- a/three-object-viewer.php +++ b/three-object-viewer.php @@ -3,7 +3,7 @@ * Plugin Name: Three Object Viewer * Plugin URI: https://3ov.xyz/ * Description: A plugin for viewing 3D files with support for WebXR and Open Metaverse Interoperability GLTF Extensions. -* Version: 1.5.1 +* Version: 1.5.2 * Requires at least: 5.7 * Requires PHP: 7.1.0 * Author: antpb