Refactor: Remove deprecated API endpoints and implement new zone management features

- Deleted obsolete API files for wall items, layers, lines, and points.
- Introduced new zone management APIs including create, delete, and update functionalities.
- Enhanced zone state management in the store with new properties for height and color.
- Implemented 2D and 3D zone rendering components for better visualization.
- Added asset fetching functionalities for marketplace integration.
- Updated types to accommodate new zone properties and API responses.
This commit is contained in:
2025-06-27 17:51:57 +05:30
parent 812a4f6aef
commit fa6506c0be
46 changed files with 1301 additions and 1301 deletions

View File

@@ -7,11 +7,12 @@ interface ZoneStore {
addZone: (zone: Zone) => void;
updateZone: (uuid: string, updated: Partial<Zone>) => void;
setZoneName: (uuid: string, name: string) => void;
setZoneHeight: (uuid: string, height: number) => void;
setZoneColor: (uuid: string, color: string) => void;
removeZone: (uuid: string) => void;
removePointFromZones: (pointUuid: string) => void;
clearZones: () => void;
setViewPort: (uuid: string, position: [number, number, number], target: [number, number, number]) => void;
setColor: (uuid: string, color: string) => void;
getZoneById: (uuid: string) => Zone | undefined;
}
@@ -43,6 +44,20 @@ export const createZoneStore = () => {
}
}),
setZoneHeight: (uuid, height) => set(state => {
const zone = state.zones.find(z => z.zoneUuid === uuid);
if (zone) {
zone.zoneHeight = height;
}
}),
setZoneColor: (uuid, color) => set(state => {
const zone = state.zones.find(z => z.zoneUuid === uuid);
if (zone) {
zone.zoneColor = color;
}
}),
removeZone: (uuid) => set(state => {
state.zones = state.zones.filter(z => z.zoneUuid !== uuid);
}),
@@ -65,13 +80,6 @@ export const createZoneStore = () => {
}
}),
setColor: (uuid, color) => set(state => {
const zone = state.zones.find(z => z.zoneUuid === uuid);
if (zone) {
zone.zoneColor = color;
}
}),
getZoneById: (uuid) => {
return get().zones.find(z => z.zoneUuid === uuid);
},