feat: enhance dashboard and canvas components with improved state management and resizing logic
- Added client mount state to the dashboard to prevent premature interactions before the component is fully loaded. - Updated button disabling logic to ensure it reflects the component's readiness and user session state. - Introduced zIndex handling in canvas placement context for better node layering. - Enhanced asset and image nodes with improved resizing logic to maintain aspect ratios during adjustments. - Refactored node components to streamline rendering and improve performance during dynamic updates.
This commit is contained in:
@@ -23,6 +23,7 @@ type CreateNodeWithIntersectionInput = {
|
||||
height?: number;
|
||||
data?: Record<string, unknown>;
|
||||
clientPosition?: FlowPoint;
|
||||
zIndex?: number;
|
||||
};
|
||||
|
||||
type CanvasPlacementContextValue = {
|
||||
@@ -107,6 +108,7 @@ export function CanvasPlacementProvider({
|
||||
height,
|
||||
data,
|
||||
clientPosition,
|
||||
zIndex,
|
||||
}: CreateNodeWithIntersectionInput) => {
|
||||
const defaults = NODE_DEFAULTS[type] ?? {
|
||||
width: 200,
|
||||
@@ -140,6 +142,7 @@ export function CanvasPlacementProvider({
|
||||
...(data ?? {}),
|
||||
canvasId,
|
||||
},
|
||||
...(zIndex !== undefined ? { zIndex } : {}),
|
||||
});
|
||||
|
||||
if (!hitEdge) {
|
||||
|
||||
Reference in New Issue
Block a user