From f5bece4ae6a9cf2c314dcb1d1c26398b47b11aa0 Mon Sep 17 00:00:00 2001
From: aditya-mitra <55396651+aditya-mitra@users.noreply.github.com>
Date: Wed, 5 Jun 2024 10:57:13 +0530
Subject: [PATCH 1/9] replace h2 with text
---
.../panels/Properties/elementList/index.tsx | 69 +++++++------------
1 file changed, 24 insertions(+), 45 deletions(-)
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 5fcf4d1377..f6f09b3588 100644
--- a/packages/ui/src/components/editor/panels/Properties/elementList/index.tsx
+++ b/packages/ui/src/components/editor/panels/Properties/elementList/index.tsx
@@ -28,16 +28,16 @@ import React, { useEffect, useRef } from 'react'
import { useTranslation } from 'react-i18next'
import { Component } from '@etherealengine/ecs/src/ComponentFunctions'
-import { getMutableState, getState, useHookstate } from '@etherealengine/hyperflux'
-
-import PlaceHolderIcon from '@mui/icons-material/GroupAddOutlined'
+import { getMutableState, getState, useHookstate, useMutableState } from '@etherealengine/hyperflux'
import { ItemTypes } from '@etherealengine/editor/src/constants/AssetTypes'
import { EditorControlFunctions } from '@etherealengine/editor/src/functions/EditorControlFunctions'
import { ComponentEditorsState } from '@etherealengine/editor/src/services/ComponentEditors'
import { ComponentShelfCategoriesState } from '@etherealengine/editor/src/services/ComponentShelfCategoriesState'
import { SelectionState } from '@etherealengine/editor/src/services/SelectionServices'
+import { GrStatusPlaceholder } from 'react-icons/gr'
import { IoIosArrowDown, IoIosArrowUp } from 'react-icons/io'
+import Text from '../../../../../primitives/tailwind/Text'
import StringInput from '../../../input/String'
import { usePopoverContextClose } from '../../../util/PopoverContext'
@@ -50,10 +50,12 @@ export type SceneElementType = {
const ComponentListItem = ({ item }: { item: Component }) => {
const { t } = useTranslation()
- useHookstate(getMutableState(ComponentEditorsState).keys).value // ensure reactively updates new components
- const Icon = getState(ComponentEditorsState)[item.name]?.iconComponent ?? PlaceHolderIcon
+ useMutableState(ComponentEditorsState).keys // ensure reactively updates new components
+ const Icon = getState(ComponentEditorsState)[item.name]?.iconComponent ?? GrStatusPlaceholder
const handleClosePopover = usePopoverContextClose()
+ const jsonName = item.jsonID?.slice(3).replace('_', '-') || item.name
+
return (
)
@@ -95,7 +97,7 @@ const SceneElementListItem = ({
{categoryTitle}
{isCollapsed || open.value ? : }
-
+
{categoryItems.map((item) => (
@@ -145,16 +147,16 @@ export function ElementList() {
return (
<>
-
-
-
{t('editor:layout.assetGrid.components')}
- onSearch(val)}
- inputRef={inputReference}
- />
-
+
+
+ {t('editor:layout.assetGrid.components')}
+
+ onSearch(val)}
+ inputRef={inputReference}
+ />
{shelves.map(([category, items]) => (
)
- {
- /*
-
- {t('editor:layout.assetGrid.components')}
-
- onSearch(e.target.value)}
- inputRef={inputReference}
- />
-
- }
- >
- {shelves.map(([category, items]) => (
-
- ))}
- */
- }
}
export default ElementList
From 19f17d1d454771c68d41c74cccb7f17cd1dbf12f Mon Sep 17 00:00:00 2001
From: aditya-mitra <55396651+aditya-mitra@users.noreply.github.com>
Date: Wed, 5 Jun 2024 10:58:05 +0530
Subject: [PATCH 2/9] elementlist descriptions
---
.../editor/panels/Properties/container/index.tsx | 2 +-
.../components/editor/panels/Viewport/tools/GridTool.tsx | 2 +-
.../src/components/editor/properties/light/spot/index.tsx | 7 ++++++-
3 files changed, 8 insertions(+), 3 deletions(-)
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 e8726f08ee..f505954c49 100644
--- a/packages/ui/src/components/editor/panels/Properties/container/index.tsx
+++ b/packages/ui/src/components/editor/panels/Properties/container/index.tsx
@@ -110,7 +110,7 @@ const EntityEditor = (props: { entityUUID: EntityUUID; multiEdit: boolean }) =>
anchorPosition={anchorPosition}
className="h-[60%] w-full min-w-[300px] overflow-y-auto"
>
- {}
+
{components.map((c, i) => (
diff --git a/packages/ui/src/components/editor/panels/Viewport/tools/GridTool.tsx b/packages/ui/src/components/editor/panels/Viewport/tools/GridTool.tsx
index f47fd1f86b..3591b85fed 100644
--- a/packages/ui/src/components/editor/panels/Viewport/tools/GridTool.tsx
+++ b/packages/ui/src/components/editor/panels/Viewport/tools/GridTool.tsx
@@ -48,7 +48,7 @@ const GridTool = () => {
startIcon={}
onClick={onToggleGridVisible}
variant="transparent"
- title={t('editor:toolbar.transformPivot.info-toggleGridVisibility')}
+ title={t('editor:toolbar.grid.info-toggleGridVisibility')}
className="px-0"
/>
{
const lightComponent = useComponent(props.entity, SpotLightComponent).value
return (
- }>
+ }
+ >
From ca91a927461c75700afc442f4c2782637816a419 Mon Sep 17 00:00:00 2001
From: aditya-mitra <55396651+aditya-mitra@users.noreply.github.com>
Date: Wed, 5 Jun 2024 11:41:14 +0530
Subject: [PATCH 3/9] wrap euler input
---
packages/ui/src/components/editor/input/Euler/index.tsx | 2 +-
.../ui/src/components/editor/input/Vector3/index.tsx | 9 +++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/packages/ui/src/components/editor/input/Euler/index.tsx b/packages/ui/src/components/editor/input/Euler/index.tsx
index 4295d7e350..03a0baeae9 100644
--- a/packages/ui/src/components/editor/input/Euler/index.tsx
+++ b/packages/ui/src/components/editor/input/Euler/index.tsx
@@ -64,7 +64,7 @@ export const EulerInput = (props: EulerInputProps) => {
)
return (
-
+
+
{uniformScaling && (
-
:
} onClick={onToggleUniform} />
+
:
}
+ onClick={onToggleUniform}
+ />
)}
Date: Wed, 5 Jun 2024 11:41:48 +0530
Subject: [PATCH 4/9] added attachment point and grid snap toggling
---
packages/client-core/i18n/en/editor.json | 1 +
.../Viewport/tools/TransformSnapTool.tsx | 20 ++++++++++---------
.../editor/properties/transform/index.tsx | 2 --
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/packages/client-core/i18n/en/editor.json b/packages/client-core/i18n/en/editor.json
index d15db7418f..56f27d3441 100755
--- a/packages/client-core/i18n/en/editor.json
+++ b/packages/client-core/i18n/en/editor.json
@@ -821,6 +821,7 @@
"description": "Adds an interactable that opens links or navigates scene"
},
"spotLight": {
+ "name": "Spot Light",
"description": "A light which emits along a direction, illuminating objects within a cone.",
"lbl-color": "Color",
"lbl-intensity": "Intensity",
diff --git a/packages/ui/src/components/editor/panels/Viewport/tools/TransformSnapTool.tsx b/packages/ui/src/components/editor/panels/Viewport/tools/TransformSnapTool.tsx
index 3600575fa1..b8af4fe35d 100644
--- a/packages/ui/src/components/editor/panels/Viewport/tools/TransformSnapTool.tsx
+++ b/packages/ui/src/components/editor/panels/Viewport/tools/TransformSnapTool.tsx
@@ -28,9 +28,11 @@ import React from 'react'
import { SnapMode } from '@etherealengine/engine/src/scene/constants/transformConstants'
import { getMutableState, useHookstate } from '@etherealengine/hyperflux'
+import { toggleSnapMode } from '@etherealengine/editor/src/functions/transformFunctions'
import { EditorHelperState } from '@etherealengine/editor/src/services/EditorHelperState'
import { ObjectGridSnapState } from '@etherealengine/editor/src/systems/ObjectGridSnapSystem'
import { useTranslation } from 'react-i18next'
+import { LuUtilityPole } from 'react-icons/lu'
import { MdOutlineCenterFocusWeak } from 'react-icons/md'
import Button from '../../../../../primitives/tailwind/Button'
import Select from '../../../../../primitives/tailwind/Select'
@@ -78,19 +80,19 @@ const TransformSnapTool = () => {
objectSnapState.enabled.set(!objectSnapState.enabled.value)
}
- // const onChangeScaleSnap = (snapValue: number) => {
- // getMutableState(EditorHelperState).scaleSnap.set(snapValue)
- // if (editorHelperState.snapMode.value !== SnapMode.Grid) {
- // getMutableState(EditorHelperState).snapMode.set(SnapMode.Grid)
- // }
- // }
-
return (
- {props.isRenaming ? (
- <>>
- ) : (
- /**/
-
- {props.item.fullName}
-
- )}
+
+ {props.item.fullName}
+
)
}
@@ -220,7 +193,6 @@ type FileBrowserItemType = {
deleteContent: (contentPath: string, type: string) => void
onClick: (params: FileDataType) => void
dropItemsOnPanel: (data: any, dropOn?: FileDataType) => void
- moveContent: (oldName: string, newName: string, oldPath: string, newPath: string, isCopy?: boolean) => Promise
addFolder: () => void
isListView: boolean
staticResourceModifiedDates: Record
@@ -237,7 +209,6 @@ export function FileBrowserItem({
deleteContent,
onClick,
dropItemsOnPanel,
- moveContent,
isFilesLoading,
addFolder,
isListView,
@@ -247,7 +218,6 @@ export function FileBrowserItem({
const [anchorPosition, setAnchorPosition] = React.useState(undefined)
const [anchorEl, setAnchorEl] = React.useState(null)
const open = Boolean(anchorEl)
- const [renamingAsset, setRenamingAsset] = useState(false)
const fileService = useMutation(fileBrowserPath)
@@ -339,17 +309,6 @@ export function FileBrowserItem({
handleClose()
}
- const onNameChanged = async (fileName: string): Promise => {
- setRenamingAsset(false)
-
- await moveContent(item.fullName, item.isFolder ? fileName : `${fileName}.${item.type}`, item.path, item.path, false)
- }
-
- const rename = () => {
- setRenamingAsset(true)
- handleClose()
- }
-
const [_dragProps, drag, preview] = disableDnD
? [undefined, undefined, undefined]
: useDrag(() => ({
@@ -382,8 +341,6 @@ export function FileBrowserItem({
onContextMenu={handleContextMenu}
onClick={onClickItem}
onDoubleClick={onClickItem}
- isRenaming={renamingAsset}
- onNameChanged={onNameChanged}
modifiedDate={staticResourceModifiedDates[item.key]}
drop={drop}
isOver={isOver}
@@ -393,15 +350,7 @@ export function FileBrowserItem({
@@ -445,7 +394,12 @@ export function FileBrowserItem({
-