Moved the simulationDashBoard from src to components
This commit is contained in:
@@ -4,7 +4,7 @@ import ControlPanel from "./ControlPanel";
|
|||||||
import SwapModal from "./SwapModal";
|
import SwapModal from "./SwapModal";
|
||||||
import DataModelPanel from "./components/models/DataModelPanel";
|
import DataModelPanel from "./components/models/DataModelPanel";
|
||||||
|
|
||||||
import { useSceneContext } from "../modules/scene/sceneContext";
|
import { useSceneContext } from "../../modules/scene/sceneContext";
|
||||||
import { calculateMinBlockSize } from "./functions/block/calculateMinBlockSize";
|
import { calculateMinBlockSize } from "./functions/block/calculateMinBlockSize";
|
||||||
import { handleElementDragStart, handleElementResizeStart, handleBlockResizeStart, handleSwapStart, handleSwapTarget, handleBlockClick, handleElementClick } from "./functions/eventHandlers";
|
import { handleElementDragStart, handleElementResizeStart, handleBlockResizeStart, handleSwapStart, handleSwapTarget, handleBlockClick, handleElementClick } from "./functions/eventHandlers";
|
||||||
import BlockGrid from "./components/block/BlockGrid";
|
import BlockGrid from "./components/block/BlockGrid";
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { RefObject } from "react";
|
import type { RefObject } from "react";
|
||||||
import { Block } from "../../../types/exportedTypes";
|
import { Block } from "../../../../types/exportedTypes";
|
||||||
import ElementComponent from "../element/ElementComponent";
|
import ElementComponent from "../element/ElementComponent";
|
||||||
|
|
||||||
interface BlockComponentProps {
|
interface BlockComponentProps {
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { RefObject } from "react";
|
import type { RefObject } from "react";
|
||||||
import { Block } from "../../../types/exportedTypes";
|
import { Block } from "../../../../types/exportedTypes";
|
||||||
import { getAlphaFromRgba, rgbaToHex } from "../../functions/helpers/colorHandlers";
|
import { getAlphaFromRgba, rgbaToHex } from "../../functions/helpers/colorHandlers";
|
||||||
import { getCurrentBlockStyleValue } from "../../functions/helpers/getCurrentBlockStyleValue";
|
import { getCurrentBlockStyleValue } from "../../functions/helpers/getCurrentBlockStyleValue";
|
||||||
import { handleBackgroundColorChange } from "../../functions/helpers/handleBackgroundColorChange";
|
import { handleBackgroundColorChange } from "../../functions/helpers/handleBackgroundColorChange";
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { type RefObject, useRef } from "react";
|
import React, { type RefObject, useRef } from "react";
|
||||||
import type { Block } from "../../../types/exportedTypes";
|
import type { Block } from "../../../../types/exportedTypes";
|
||||||
import BlockComponent from "./BlockComponent";
|
import BlockComponent from "./BlockComponent";
|
||||||
|
|
||||||
// components/BlockGrid.tsx - Updated props
|
// components/BlockGrid.tsx - Updated props
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import type { UIElement } from "../../../types/exportedTypes";
|
import type { UIElement } from "../../../../types/exportedTypes";
|
||||||
import { resolveElementValue } from "../../functions/helpers/resolveElementValue";
|
import { resolveElementValue } from "../../functions/helpers/resolveElementValue";
|
||||||
import ElementContent from "./ElementContent";
|
import ElementContent from "./ElementContent";
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ import {
|
|||||||
ResponsiveContainer,
|
ResponsiveContainer,
|
||||||
Cell,
|
Cell,
|
||||||
} from "recharts";
|
} from "recharts";
|
||||||
import { UIElement } from "../../../types/exportedTypes";
|
import { UIElement } from "../../../../types/exportedTypes";
|
||||||
|
|
||||||
interface ElementContentProps {
|
interface ElementContentProps {
|
||||||
element: UIElement;
|
element: UIElement;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { RefObject } from "react";
|
import type { RefObject } from "react";
|
||||||
import { ExtendedCSSProperties, UIElement, Block } from "../../../types/exportedTypes";
|
import { ExtendedCSSProperties, UIElement, Block } from "../../../../types/exportedTypes";
|
||||||
import { getCurrentElementStyleValue } from "../../functions/helpers/getCurrentElementStyleValue";
|
import { getCurrentElementStyleValue } from "../../functions/helpers/getCurrentElementStyleValue";
|
||||||
import type { DataModelManager } from "../../data/dataModel";
|
import type { DataModelManager } from "../../data/dataModel";
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { Block } from "../../../types/exportedTypes";
|
import type { Block } from "../../../../types/exportedTypes";
|
||||||
|
|
||||||
export const calculateMinBlockSize = (block: Block): Size => {
|
export const calculateMinBlockSize = (block: Block): Size => {
|
||||||
let minWidth = 300;
|
let minWidth = 300;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { UIElement, Block } from "../../../types/exportedTypes";
|
import type { UIElement } from "../../../../types/exportedTypes";
|
||||||
|
|
||||||
export const handleElementDragStart = (
|
export const handleElementDragStart = (
|
||||||
elementId: string,
|
elementId: string,
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { Block } from "../../../types/exportedTypes";
|
import type { Block } from "../../../../types/exportedTypes";
|
||||||
|
|
||||||
export const getCurrentBlockStyleValue = (
|
export const getCurrentBlockStyleValue = (
|
||||||
currentBlock: Block,
|
currentBlock: Block,
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { UIElement } from "../../../types/exportedTypes";
|
import type { UIElement } from "../../../../types/exportedTypes";
|
||||||
|
|
||||||
export const getCurrentElementStyleValue = (
|
export const getCurrentElementStyleValue = (
|
||||||
currentElement: UIElement,
|
currentElement: UIElement,
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { Block } from "../../../types/exportedTypes";
|
import type { Block } from "../../../../types/exportedTypes";
|
||||||
import { hexToRgba, rgbaToHex } from "./colorHandlers";
|
import { hexToRgba, rgbaToHex } from "./colorHandlers";
|
||||||
import { getCurrentBlockStyleValue } from "./getCurrentBlockStyleValue";
|
import { getCurrentBlockStyleValue } from "./getCurrentBlockStyleValue";
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { Block } from "../../../types/exportedTypes";
|
import type { Block } from "../../../../types/exportedTypes";
|
||||||
import { getAlphaFromRgba, hexToRgba } from "./colorHandlers";
|
import { getAlphaFromRgba, hexToRgba } from "./colorHandlers";
|
||||||
import { getCurrentBlockStyleValue } from "./getCurrentBlockStyleValue";
|
import { getCurrentBlockStyleValue } from "./getCurrentBlockStyleValue";
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { dataModelManager } from "../../data/dataModel";
|
import { dataModelManager } from "../../data/dataModel";
|
||||||
import type { UIElement } from "../../../types/exportedTypes";
|
import type { UIElement } from "../../../../types/exportedTypes";
|
||||||
|
|
||||||
export const resolveElementValue = (element: UIElement) => {
|
export const resolveElementValue = (element: UIElement) => {
|
||||||
// Implementation from original code
|
// Implementation from original code
|
||||||
@@ -33,7 +33,7 @@ import { recentlyViewedApi } from "../../../services/dashboard/recentlyViewedApi
|
|||||||
import { setAssetsApi } from "../../../services/builder/asset/floorAsset/setAssetsApi";
|
import { setAssetsApi } from "../../../services/builder/asset/floorAsset/setAssetsApi";
|
||||||
import { getVersionHistoryApi } from "../../../services/builder/versionControl/getVersionHistoryApi";
|
import { getVersionHistoryApi } from "../../../services/builder/versionControl/getVersionHistoryApi";
|
||||||
import { getUserData } from "../../../functions/getUserData";
|
import { getUserData } from "../../../functions/getUserData";
|
||||||
import DashboardEditor from "../../../SimulationDashboard/DashboardEditor";
|
import DashboardEditor from "../../SimulationDashboard/DashboardEditor";
|
||||||
|
|
||||||
function MainScene() {
|
function MainScene() {
|
||||||
const { setMainState, clearComparisonState } = useSimulationState();
|
const { setMainState, clearComparisonState } = useSimulationState();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { MathUtils } from "three";
|
import { MathUtils } from "three";
|
||||||
import { create } from "zustand";
|
import { create } from "zustand";
|
||||||
import { immer } from "zustand/middleware/immer";
|
import { immer } from "zustand/middleware/immer";
|
||||||
import { defaultGraphData } from "../../SimulationDashboard/data/defaultGraphData";
|
import { defaultGraphData } from "../../components/SimulationDashboard/data/defaultGraphData";
|
||||||
import { Block, UIElement, ExtendedCSSProperties } from "../../types/exportedTypes";
|
import { Block, UIElement, ExtendedCSSProperties } from "../../types/exportedTypes";
|
||||||
|
|
||||||
interface SimulationDashboardStore {
|
interface SimulationDashboardStore {
|
||||||
|
|||||||
Reference in New Issue
Block a user