This commit is contained in:
2025-03-29 19:36:56 +05:30
32 changed files with 797 additions and 328 deletions

View File

@@ -29,7 +29,10 @@ export const useSocketStore = create<any>((set: any, get: any) => ({
},
}));
export const useLoadingProgress = create<{ loadingProgress: number; setLoadingProgress: (x: number) => void }>((set) => ({
export const useLoadingProgress = create<{
loadingProgress: number;
setLoadingProgress: (x: number) => void;
}>((set) => ({
loadingProgress: 1,
setLoadingProgress: (x: number) => set({ loadingProgress: x }),
}));
@@ -326,7 +329,9 @@ export const useSelectedPath = create<any>((set: any) => ({
interface SimulationPathsStore {
simulationPaths: (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[];
setSimulationPaths: (paths: (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[]) => void;
setSimulationPaths: (
paths: (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[]
) => void;
}
export const useSimulationPaths = create<SimulationPathsStore>((set) => ({
@@ -366,3 +371,7 @@ export const useAsset3dWidget = create<any>((set: any) => ({
widgetSelect: "",
setWidgetSelect: (x: any) => set({ widgetSelect: x }),
}));
export const useWidgetSubOption = create<any>((set: any) => ({
widgetSubOption: "2D",
setWidgetSubOption: (x: any) => set({ widgetSubOption: x }),
}));

View File

@@ -2,10 +2,17 @@ import { create } from "zustand";
type DroppedObject = {
className: string;
position: [number, number];
id: string;
position: {
top: number | "auto";
left: number | "auto";
right: number | "auto";
bottom: number | "auto";
};
value?: number;
per?: string;
header?: string;
Data: {};
};
type Zone = {
@@ -21,7 +28,12 @@ type DroppedObjectsState = {
updateObjectPosition: (
zoneName: string,
index: number,
newPosition: [number, number]
newPosition: {
top: number | "auto";
left: number | "auto";
right: number | "auto";
bottom: number | "auto";
}
) => void;
};
@@ -64,15 +76,17 @@ export const useDroppedObjectsStore = create<DroppedObjectsState>((set) => ({
}));
export interface DroppedObjects {
header: string;
value: string | number; // ✅ Allows both numbers and formatted strings
per: string;
className: string;
position: [number, number]; // ✅ Ensures position is a tuple
}
export interface Zones {
zoneName: string;
zoneId: string;
objects: DroppedObject[];
}
header: string;
id: string;
Data: {};
value: string | number; // ✅ Allows both numbers and formatted strings
per: string;
className: string;
position: { top: number; left: number; right: number; bottom: number }; // ✅ Ensures position is a tuple
}
export interface Zones {
zoneName: string;
zoneId: string;
objects: DroppedObject[];
}