From 6dbe4a0928d447480f527e50981835ff07159af0 Mon Sep 17 00:00:00 2001 From: SicParv1sMagna <92353726+SicParv1sMagna@users.noreply.github.com> Date: Fri, 1 Nov 2024 19:17:04 +0300 Subject: [PATCH 1/8] Added feature to change interactive and editor mode via context --- .../components/DraggableComponent/index.tsx | 9 ++++--- .../DraggableComponent/styles.module.css | 2 +- packages/core/components/Puck/context.tsx | 6 +++-- packages/core/components/Puck/index.tsx | 27 ++++++++++--------- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/packages/core/components/DraggableComponent/index.tsx b/packages/core/components/DraggableComponent/index.tsx index af5dc6ff2..e68014bf4 100644 --- a/packages/core/components/DraggableComponent/index.tsx +++ b/packages/core/components/DraggableComponent/index.tsx @@ -81,8 +81,9 @@ export const DraggableComponent = ({ indicativeHover?: boolean; style?: CSSProperties; }) => { - const { zoomConfig, status, overrides, selectedItem, getPermissions } = + const { zoomConfig, status, overrides, selectedItem, getPermissions, isInteractive } = useAppContext(); + const isModifierHeld = useModifierHeld("Alt"); const El = status !== "LOADING" ? Draggable : DefaultDraggable; @@ -132,7 +133,7 @@ export const DraggableComponent = ({ style={{ ...style, ...provided.draggableProps.style, - cursor: isModifierHeld || isDragDisabled ? "pointer" : "grab", + cursor: isInteractive || isModifierHeld || isDragDisabled ? "pointer" : "grab", }} onMouseOver={onMouseOver} onMouseOut={onMouseOut} @@ -177,8 +178,8 @@ export const DraggableComponent = ({ )} -
-