diff --git a/app/package.json b/app/package.json index ffeff66..128e910 100644 --- a/app/package.json +++ b/app/package.json @@ -1,3 +1,4 @@ +<<<<<<< HEAD { "name": "aalai-beta", "version": "0.1.0", @@ -88,3 +89,92 @@ "ts-node": "^10.9.2" } } +======= +{ + "name": "aalai-beta", + "version": "0.1.0", + "private": true, + "dependencies": { + "@dnd-kit/core": "^6.3.1", + "@dnd-kit/sortable": "^10.0.0", + "@fingerprintjs/fingerprintjs": "^4.6.2", + "@fingerprintjs/fingerprintjs-pro-react": "^2.6.3", + "@react-three/csg": "^3.2.0", + "@react-three/drei": "^9.113.0", + "@react-three/fiber": "^8.17.7", + "@react-three/postprocessing": "^2.16.3", + "@recast-navigation/core": "^0.39.0", + "@recast-navigation/three": "^0.39.0", + "@testing-library/jest-dom": "^5.17.0", + "@testing-library/react": "^13.4.0", + "@testing-library/user-event": "^13.5.0", + "@turf/helpers": "^7.2.0", + "@turf/turf": "^7.2.0", + "@types/jest": "^27.5.2", + "@types/react": "^18.3.5", + "@types/react-dom": "^18.3.0", + "@use-gesture/react": "^10.3.1", + "chart.js": "^4.4.8", + "chartjs-plugin-annotation": "^3.1.0", + "dxf-parser": "^1.1.2", + "glob": "^11.0.0", + "gsap": "^3.12.5", + "html2canvas": "^1.4.1", + "immer": "^9.0.21", + "leva": "^0.10.0", + "mqtt": "^5.10.4", + "postprocessing": "^6.36.4", + "prompt-sync": "^4.2.0", + "react": "^18.3.1", + "react-chartjs-2": "^5.3.0", + "react-dom": "^18.3.1", + "react-router-dom": "^7.4.0", + "react-scripts": "5.0.1", + "react-toastify": "^10.0.5", + "sass": "^1.78.0", + "socket.io-client": "^4.8.1", + "three": "^0.168.0", + "three-viewport-gizmo": "^2.2.0", + "typescript": "^4.9.5", + "web-vitals": "^2.1.4", + "zustand": "^5.0.0-rc.2" + }, + "scripts": { + "prepare": "husky", + "prestart": "tsc scripts/git-prompt.ts && node scripts/git-prompt.js", + "start": "react-scripts start", + "build": "cross-env GENERATE_SOURCEMAP=false react-scripts build", + "test": "jest", + "cypress:open": "cypress open", + "cypress:run": "cypress run" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "@types/html2canvas": "^1.0.0", + "@types/node": "^22.9.1", + "@types/three": "^0.169.0", + "axios": "^1.8.4", + "cypress": "^13.14.2", + "dotenv": "^16.4.5", + "husky": "^9.1.6", + "ts-node": "^10.9.2" + } +} +>>>>>>> origin/main diff --git a/app/src/components/ui/list/OutlineList/AssetOutline.tsx b/app/src/components/ui/list/OutlineList/AssetOutline.tsx index 2f67787..d144c6e 100644 --- a/app/src/components/ui/list/OutlineList/AssetOutline.tsx +++ b/app/src/components/ui/list/OutlineList/AssetOutline.tsx @@ -1,6 +1,17 @@ import { useState, useRef, DragEvent, useCallback, useMemo } from "react"; import { useParams } from "react-router-dom"; -import { EyeIcon, LockIcon, FolderIcon, ChevronIcon, CubeIcon, AddIcon, KebebIcon, CollapseAllIcon, FocusIcon, DeleteIcon } from "../../../icons/ExportCommonIcons"; +import { + EyeIcon, + LockIcon, + FolderIcon, + ChevronIcon, + CubeIcon, + AddIcon, + KebebIcon, + CollapseAllIcon, + FocusIcon, + DeleteIcon, +} from "../../../icons/ExportCommonIcons"; import RenameInput from "../../inputs/RenameInput"; import clsx from "clsx"; import { useSceneContext } from "../../../../modules/scene/sceneContext"; @@ -10,7 +21,8 @@ import useZoomMesh from "../../../../modules/builder/hooks/useZoomMesh"; import { getUserData } from "../../../../functions/getUserData"; import { useOuterClick } from "../../../../utils/useOuterClick"; - +import { GCodeLoader } from "three/examples/jsm/Addons"; +import { PDBLoader } from "three/examples/jsm/Addons"; import { setAssetsApi } from "../../../../services/builder/asset/floorAsset/setAssetsApi"; interface DragState { @@ -57,7 +69,9 @@ const TreeNode = ({ const isLocked = item.isLocked; const isExpanded = isGroupNode ? item.isExpanded : false; - const isSelected = isGroupNode ? hasSelectedGroup(item.groupUuid) : hasSelectedAsset(item.modelUuid); + const isSelected = isGroupNode + ? hasSelectedGroup(item.groupUuid) + : hasSelectedAsset(item.modelUuid); const getMultiSelectionState = (item: AssetGroupChild) => { const totalSelectedItems = selectedGroups.length + selectedAssets.length; @@ -111,7 +125,12 @@ const TreeNode = ({ const shouldShowHighlight = isDropTarget(); return ( -
+
{isGroupNode && ( - )} -
{isGroupNode ? : }
+
+ {isGroupNode ? : } +
- - - {isGroupNode && ( - )} @@ -200,7 +239,16 @@ export const AssetOutline = () => { }); const [_, forceUpdate] = useState({}); const { scene, assetGroupStore, assetStore, versionStore, undoRedo3DStore } = useSceneContext(); - const { addSelectedAsset, clearSelectedAssets, getAssetById, peekToggleVisibility, peekToggleLock, toggleSelectedAsset, selectedAssets, setSelectedAssets } = assetStore(); + const { + addSelectedAsset, + clearSelectedAssets, + getAssetById, + peekToggleVisibility, + peekToggleLock, + toggleSelectedAsset, + selectedAssets, + setSelectedAssets, + } = assetStore(); const { groupHierarchy, isGroup, @@ -335,7 +383,11 @@ export const AssetOutline = () => { }) .then((data) => { if (!data.message || !data.data) { - echo.error(`Error ${asset.isVisible ? "hiding" : "unhiding"} asset: ${asset.modelName}`); + echo.error( + `Error ${asset.isVisible ? "hiding" : "unhiding"} asset: ${ + asset.modelName + }` + ); return; } if (data.message === "Model updated successfully" && data.data) { @@ -354,14 +406,22 @@ export const AssetOutline = () => { }; updateAssetInScene(model, () => { - echo.info(`${asset.isVisible ? "Hid" : "Unhid"} asset: ${model.modelName}`); + echo.info( + `${asset.isVisible ? "Hid" : "Unhid"} asset: ${model.modelName}` + ); }); } else { - echo.error(`Error ${asset.isVisible ? "hiding" : "unhiding"} asset: ${asset.modelName}`); + echo.error( + `Error ${asset.isVisible ? "hiding" : "unhiding"} asset: ${ + asset.modelName + }` + ); } }) .catch(() => { - echo.error(`Error ${asset.isVisible ? "hiding" : "unhiding"} asset: ${asset.modelName}`); + echo.error( + `Error ${asset.isVisible ? "hiding" : "unhiding"} asset: ${asset.modelName}` + ); }); } else { const data = { @@ -406,7 +466,11 @@ export const AssetOutline = () => { }) .then((data) => { if (!data.message || !data.data) { - echo.error(`Error ${asset.isVisible ? "locking" : "unlocking"} asset: ${asset.modelName}`); + echo.error( + `Error ${asset.isVisible ? "locking" : "unlocking"} asset: ${ + asset.modelName + }` + ); return; } if (data.message === "Model updated successfully" && data.data) { @@ -425,14 +489,26 @@ export const AssetOutline = () => { }; updateAssetInScene(model, () => { - echo.info(`${asset.isVisible ? "Locked" : "Unlocked"} asset: ${model.modelName}`); + echo.info( + `${asset.isVisible ? "Locked" : "Unlocked"} asset: ${ + model.modelName + }` + ); }); } else { - echo.error(`Error ${asset.isVisible ? "locking" : "unlocking"} asset: ${asset.modelName}`); + echo.error( + `Error ${asset.isVisible ? "locking" : "unlocking"} asset: ${ + asset.modelName + }` + ); } }) .catch(() => { - echo.error(`Error ${asset.isVisible ? "locking" : "unlocking"} asset: ${asset.modelName}`); + echo.error( + `Error ${asset.isVisible ? "locking" : "unlocking"} asset: ${ + asset.modelName + }` + ); }); } else { const data = { @@ -464,13 +540,16 @@ export const AssetOutline = () => { [setGroupExpanded] ); - const handleDragStart = useCallback((e: DragEvent, item: AssetGroupChild, parentGroupUuid: string | null) => { - dragStateRef.current.draggedItem = item; - dragStateRef.current.draggedItemParentGroupUuid = parentGroupUuid; + const handleDragStart = useCallback( + (e: DragEvent, item: AssetGroupChild, parentGroupUuid: string | null) => { + dragStateRef.current.draggedItem = item; + dragStateRef.current.draggedItemParentGroupUuid = parentGroupUuid; - e.dataTransfer.effectAllowed = "move"; - forceUpdate({}); - }, []); + e.dataTransfer.effectAllowed = "move"; + forceUpdate({}); + }, + [] + ); const handleDragOver = useCallback( (e: DragEvent, targetItem: AssetGroupChild) => { @@ -540,7 +619,10 @@ export const AssetOutline = () => { } // Update target group - if (dragStateRef.current.targetGroupUuid !== targetGroupUuid || dragStateRef.current.isRootTarget !== false) { + if ( + dragStateRef.current.targetGroupUuid !== targetGroupUuid || + dragStateRef.current.isRootTarget !== false + ) { dragStateRef.current.targetGroupUuid = targetGroupUuid; dragStateRef.current.isRootTarget = false; forceUpdate({}); @@ -895,7 +977,9 @@ export const AssetOutline = () => { if (asset) { const itemId = getItemId(item); const flattened = getFlattenedHierarchy(); - const clickedIndex = flattened.findIndex((flatItem) => getItemId(flatItem) === itemId); + const clickedIndex = flattened.findIndex( + (flatItem) => getItemId(flatItem) === itemId + ); addSelectedAsset(asset); lastSelectedRef.current = { item, index: clickedIndex }; zoomMeshes([itemId]); @@ -910,7 +994,11 @@ export const AssetOutline = () => { [selectedVersion, builderSocket, projectId, userId, organization] ); - const handleAddGroup = useCallback(() => {}, [assetGroupStore, clearSelectedGroups, addSelectedGroup]); + const handleAddGroup = useCallback(() => {}, [ + assetGroupStore, + clearSelectedGroups, + addSelectedGroup, + ]); const handleCollapseAll = useCallback(() => {}, [assetGroupStore, setGroupExpanded]); @@ -920,7 +1008,9 @@ export const AssetOutline = () => { const totalSelectedGroups = selectedGroups.length; if (totalSelectedGroups > 0 && totalSelectedAssets > 0) { - return `${totalSelectedGroups} group${totalSelectedGroups > 1 ? "s" : ""} and ${totalSelectedAssets} asset${totalSelectedAssets > 1 ? "s" : ""} selected`; + return `${totalSelectedGroups} group${ + totalSelectedGroups > 1 ? "s" : "" + } and ${totalSelectedAssets} asset${totalSelectedAssets > 1 ? "s" : ""} selected`; } else if (totalSelectedGroups > 0) { return `${totalSelectedGroups} group${totalSelectedGroups > 1 ? "s" : ""} selected`; } else if (totalSelectedAssets > 0) { @@ -943,10 +1033,18 @@ export const AssetOutline = () => {

Assets

- -
{isOpen && ( -
+
{groupHierarchy.map((item) => ( {
- 1 ? "multi-selection" : ""}`}>{selectionStats} + 1 ? "multi-selection" : "" + }`} + > + {selectionStats} +
); diff --git a/app/src/pages/UserAuth.tsx b/app/src/pages/UserAuth.tsx index e21c8bb..063a26b 100644 --- a/app/src/pages/UserAuth.tsx +++ b/app/src/pages/UserAuth.tsx @@ -51,8 +51,14 @@ const UserAuth: React.FC = () => { const projects = await recentlyViewedApi(); if (res.message.isShare) { if (Object.values(projects.RecentlyViewed).length > 0) { - const recent_opend_projectID = (Object.values(projects?.RecentlyViewed || {})[0] as any)?._id; - if (Object.values(projects?.RecentlyViewed).filter((val: any) => val._id == recent_opend_projectID)) { + const recent_opend_projectID = ( + Object.values(projects?.RecentlyViewed || {})[0] as any + )?._id; + if ( + Object.values(projects?.RecentlyViewed).filter( + (val: any) => val._id == recent_opend_projectID + ) + ) { setLoadingProgress(1); navigate(`/projects/${recent_opend_projectID}`); } else { @@ -115,14 +121,22 @@ const UserAuth: React.FC = () => { {isSignIn ? ( <> Don’t have an account?{" "} - setIsSignIn(false)} style={{ cursor: "pointer" }}> + setIsSignIn(false)} + style={{ cursor: "pointer" }} + > Register here! ) : ( <> Already have an account?{" "} - setIsSignIn(true)} style={{ cursor: "pointer" }}> + setIsSignIn(true)} + style={{ cursor: "pointer" }} + > Login here! @@ -136,8 +150,24 @@ const UserAuth: React.FC = () => { {error &&
🛈 {error}
}
- {!isSignIn && setName(e.target.value)} required />} - setEmail(e.target.value)} required /> + {!isSignIn && ( + setName(e.target.value)} + required + /> + )} + setEmail(e.target.value)} + required + />
{ onChange={(e) => setPassword(e.target.value)} required /> -
- + {isSignIn && ( Forgot password ?