+
setIsAddEntityMenuOpen(false)} />
diff --git a/packages/ui/src/components/editor/panels/Properties/container/index.tsx b/packages/ui/src/components/editor/panels/Properties/container/index.tsx
index e6184a67e3..124a8a207c 100644
--- a/packages/ui/src/components/editor/panels/Properties/container/index.tsx
+++ b/packages/ui/src/components/editor/panels/Properties/container/index.tsx
@@ -30,13 +30,13 @@ import { UUIDComponent } from '@etherealengine/ecs'
import { Component, ComponentJSONIDMap, useOptionalComponent } from '@etherealengine/ecs/src/ComponentFunctions'
import { NO_PROXY, getMutableState, getState, useHookstate } from '@etherealengine/hyperflux'
+import { calculateAndApplyYOffset } from '@etherealengine/common/src/utils/offsets'
import { EntityUUID } from '@etherealengine/ecs'
import { ComponentEditorsState } from '@etherealengine/editor/src/services/ComponentEditors'
import { EditorState } from '@etherealengine/editor/src/services/EditorServices'
import { SelectionState } from '@etherealengine/editor/src/services/SelectionServices'
import { GLTFNodeState } from '@etherealengine/engine/src/gltf/GLTFDocumentState'
import { MaterialSelectionState } from '@etherealengine/engine/src/scene/materials/MaterialLibraryState'
-import { Bounds, getBounds, getViewportBounds } from '@etherealengine/xrui/core/dom-utils'
import { HiOutlinePlusCircle } from 'react-icons/hi'
import Button from '../../../../../primitives/tailwind/Button'
import { Popup } from '../../../../tailwind/Popup'
@@ -55,29 +55,6 @@ const EntityComponentEditor = (props: { entity; component; multiEdit }) => {
return
}
-const calculateAndApplyOffset = (popupRef: React.RefObject
) => {
- if (popupRef.current) {
- const popupBounds = getBounds(popupRef.current)
- const viewportBounds = getViewportBounds(new Bounds())
-
- const overflowTop = viewportBounds.top - (popupBounds?.top ?? 0)
- const overflowBottom =
- (popupBounds?.top ?? 0) + (popupBounds?.height ?? 0) - (viewportBounds.top + viewportBounds.height)
-
- let offsetY = 0
-
- if (overflowTop > 0) {
- // popup is overflowing at the top, move it down
- offsetY = overflowTop
- } else if (overflowBottom > 0) {
- // popup is overflowing at the bottom, move it up
- offsetY = -overflowBottom
- }
-
- popupRef.current.style.transform = `translateY(${offsetY}px)`
- }
-}
-
const EntityEditor = (props: { entityUUID: EntityUUID; multiEdit: boolean }) => {
const { t } = useTranslation()
const { entityUUID, multiEdit } = props
@@ -96,15 +73,14 @@ const EntityEditor = (props: { entityUUID: EntityUUID; multiEdit: boolean }) =>
useEffect(() => {
const handleResize = () => {
- calculateAndApplyOffset(popupRef)
+ calculateAndApplyYOffset(popupRef.current)
}
window.addEventListener('resize', handleResize)
-
return () => {
window.removeEventListener('resize', handleResize)
}
- }, [popupRef])
+ }, [])
const [isAddComponentMenuOpen, setIsAddComponentMenuOpen] = useState(false)
@@ -128,7 +104,7 @@ const EntityEditor = (props: { entityUUID: EntityUUID; multiEdit: boolean }) =>
{t('editor:properties.lbl-addComponent')}
}
- onOpen={() => calculateAndApplyOffset(popupRef)}
+ onOpen={() => calculateAndApplyYOffset(popupRef.current)}
>
setIsAddComponentMenuOpen(false)} />
diff --git a/packages/ui/src/components/editor/panels/Properties/elementList/index.tsx b/packages/ui/src/components/editor/panels/Properties/elementList/index.tsx
index c8adf74ff7..b8260493b6 100644
--- a/packages/ui/src/components/editor/panels/Properties/elementList/index.tsx
+++ b/packages/ui/src/components/editor/panels/Properties/elementList/index.tsx
@@ -130,13 +130,15 @@ const SceneElementListItem = ({
return (
)
}
diff --git a/packages/ui/src/components/editor/panels/Properties/index.tsx b/packages/ui/src/components/editor/panels/Properties/index.tsx
index f669c9af61..b55725a5bb 100644
--- a/packages/ui/src/components/editor/panels/Properties/index.tsx
+++ b/packages/ui/src/components/editor/panels/Properties/index.tsx
@@ -26,9 +26,8 @@ Ethereal Engine. All Rights Reserved.
import { TabData } from 'rc-dock'
import React from 'react'
import { useTranslation } from 'react-i18next'
+import Tooltip from '../../../../primitives/tailwind/Tooltip'
import { PanelDragContainer, PanelTitle } from '../../layout/Panel'
-import { InfoTooltip } from '../../layout/Tooltip'
-//import styles from '../styles.module.scss'
import PropertiesPanelContainer from './container'
export const PropertiesPanelTitle = () => {
@@ -38,9 +37,7 @@ export const PropertiesPanelTitle = () => {
-
- {t('editor:properties.title')}
-
+ {t('editor:properties.title')}
diff --git a/packages/ui/src/components/editor/panels/Properties/material/index.tsx b/packages/ui/src/components/editor/panels/Properties/material/index.tsx
index 366aad61de..d9900fab51 100644
--- a/packages/ui/src/components/editor/panels/Properties/material/index.tsx
+++ b/packages/ui/src/components/editor/panels/Properties/material/index.tsx
@@ -56,11 +56,11 @@ import {
} from '@etherealengine/spatial/src/renderer/materials/MaterialComponent'
import { formatMaterialArgs, getMaterial } from '@etherealengine/spatial/src/renderer/materials/materialFunctions'
import Button from '../../../../../primitives/tailwind/Button'
+import Tooltip from '../../../../../primitives/tailwind/Tooltip'
import InputGroup from '../../../input/Group'
import SelectInput from '../../../input/Select'
import StringInput from '../../../input/String'
import { PanelDragContainer, PanelTitle } from '../../../layout/Panel'
-import { InfoTooltip } from '../../../layout/Tooltip'
import ParameterInput from '../../../properties/parameter'
type ThumbnailData = {
@@ -312,9 +312,9 @@ export const MaterialPropertyTitle = () => {
-
- {t('editor:properties.mesh.materialProperties.title')}
-
+
+ {t('editor:properties.mesh.materialProperties.title')}
+
diff --git a/packages/ui/src/components/editor/panels/Viewport/tools/GizmoTool.tsx b/packages/ui/src/components/editor/panels/Viewport/tools/GizmoTool.tsx
index cd96f35ed9..1b555cc0d8 100644
--- a/packages/ui/src/components/editor/panels/Viewport/tools/GizmoTool.tsx
+++ b/packages/ui/src/components/editor/panels/Viewport/tools/GizmoTool.tsx
@@ -109,7 +109,7 @@ export default function GizmoTool({
-
+
-
+
-
+
-
+