From 9100947d45176bf6c172ca64633c4b52e26c366f Mon Sep 17 00:00:00 2001 From: Akalanka Perera Date: Sun, 24 Nov 2024 17:18:06 +0530 Subject: [PATCH 1/3] Perf: optimized cursor movement --- src/components/workspace/cursor.tsx | 33 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/components/workspace/cursor.tsx b/src/components/workspace/cursor.tsx index 304c7a9..f5ef958 100644 --- a/src/components/workspace/cursor.tsx +++ b/src/components/workspace/cursor.tsx @@ -13,27 +13,26 @@ export const Cursor = () => { const Cursor = useSelector((state: any) => state.editor.cursor); + const workspace = document.getElementById(ids.workspace)?.getBoundingClientRect(); + const zoomControls = document.getElementById(ids.zoomControls)?.getBoundingClientRect(); + const mainControls = document.getElementById(ids.controls)?.getBoundingClientRect(); + const move = (e) => { const ptr = pointer(e); const x = ptr[0]; const y = ptr[1]; - const workspace = document.getElementById(ids.workspace)?.getBoundingClientRect(); - const zoomControls = document.getElementById(ids.zoomControls)?.getBoundingClientRect(); - const mainControls = document.getElementById(ids.controls)?.getBoundingClientRect(); - if (workspace) { - const customCursor = document.getElementById(ids.cursor); - if ( - isWithinBounds(x, y, workspace) && - !isWithinBounds(x, y, zoomControls) && - !isWithinBounds(x, y, mainControls) && - !resizeCursors.includes(e.target?.style?.cursor) && - !e.target.id.includes("radix:") && - e.target.getAttribute("role") !== "dialog" - ) { - customCursor.style.display = "block"; - } else { - customCursor.style.display = "none"; - } + const customCursor = document.getElementById(ids.cursor); + if ( + isWithinBounds(x, y, workspace) && + !isWithinBounds(x, y, zoomControls) && + !isWithinBounds(x, y, mainControls) && + !resizeCursors.includes(e.target?.style?.cursor) && + !e.target.id.includes("radix:") && + e.target.getAttribute("role") !== "dialog" + ) { + customCursor.classList.remove("hidden"); + } else { + customCursor.classList.add("hidden"); } setCursorX(x); setCursorY(y); From 73fdfefdb36e0d80837b0bd739822836908d4e0a Mon Sep 17 00:00:00 2001 From: Akalanka Perera Date: Thu, 5 Dec 2024 12:45:50 +0530 Subject: [PATCH 2/3] Fix: issue in seat icon visibility and removed a few unwanted types --- src/components/workspace/elements/seat.tsx | 2 +- src/stories/designer/basic.stories.tsx | 13 ------------- src/stories/options.ts | 5 ----- src/styles/index.css | 2 +- src/types/index.ts | 1 - src/types/styles.ts | 9 --------- 6 files changed, 2 insertions(+), 30 deletions(-) diff --git a/src/components/workspace/elements/seat.tsx b/src/components/workspace/elements/seat.tsx index 2548b16..7a3e8bc 100644 --- a/src/components/workspace/elements/seat.tsx +++ b/src/components/workspace/elements/seat.tsx @@ -152,7 +152,7 @@ const Seat: React.FC = forwardRef( width={seatSize * 0.75} height={seatSize * 0.75} size={seatSize * 0.75} - className={consumer.styles?.elements?.seat?.icon?.className} + className={twMerge(consumer.styles?.elements?.seat?.icon?.className, "stk-seat-icon")} style={consumer.styles?.elements?.seat?.icon?.properties} /> )} diff --git a/src/stories/designer/basic.stories.tsx b/src/stories/designer/basic.stories.tsx index 6a2fce9..21d27c3 100644 --- a/src/stories/designer/basic.stories.tsx +++ b/src/stories/designer/basic.stories.tsx @@ -13,19 +13,6 @@ export const Story = { render: (props) => }; -export const WithoutFooter = { - render: (props) => ( - - ) -}; - export const WithReloadButton = { render: (props) => ( Date: Thu, 5 Dec 2024 07:16:24 +0000 Subject: [PATCH 3/3] CI: @mezh-hq/react-seat-toolkit - prepatch release skip-checks: true --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d649435..427aa31 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mezh-hq/react-seat-toolkit", - "version": "3.0.0", + "version": "3.0.1-blizzard.0", "description": "React UI library to design and render seat layouts", "main": "dist/index.cjs", "module": "dist/index.mjs",