From bef65c520bcd725370e0e3fca63e57f40aa5c610 Mon Sep 17 00:00:00 2001 From: Vikram Kumar Date: Thu, 23 Jul 2026 23:09:37 +0530 Subject: [PATCH 1/2] feat: add liveDrawArrow option to arrowOptions --- docs/D_OptionsApi.mdx | 20 ++++++++++++------- docs/stories/options/ArrowOptions.stories.tsx | 20 +++++++++++++++++++ src/Arrows.tsx | 3 +++ src/ChessboardProvider.tsx | 11 +++++++--- src/defaults.ts | 1 + 5 files changed, 45 insertions(+), 10 deletions(-) diff --git a/docs/D_OptionsApi.mdx b/docs/D_OptionsApi.mdx index 4911888..14d62cf 100644 --- a/docs/D_OptionsApi.mdx +++ b/docs/D_OptionsApi.mdx @@ -256,6 +256,10 @@ When drawing an arrow, you can hold down modifier keys to change the arrow color - `opacity`: Controls the opacity of arrows when not being drawn - `activeOpacity`: Controls the opacity of arrows when they are being drawn +#### Arrow behavior + +- `liveDrawArrow`: Controls whether the arrow is drawn live while dragging (`true`) or drawn after the final target is set (`false`) + **Default value:** ```tsx @@ -274,6 +278,7 @@ When drawing an arrow, you can hold down modifier keys to change the arrow color opacity: 0.65, activeOpacity: 0.5, arrowStartOffset: 0, + liveDrawArrow: true, } ``` @@ -288,13 +293,14 @@ When drawing an arrow, you can hold down modifier keys to change the arrow color alt?: string; meta?: string; }, - arrowLengthReducerDenominator: number, - sameTargetArrowLengthReducerDenominator: number, - arrowWidthDenominator: number, - activeArrowWidthMultiplier: number, - opacity: number, - activeOpacity: number - arrowStartOffset: number, + arrowLengthReducerDenominator?: number, + sameTargetArrowLengthReducerDenominator?: number, + arrowWidthDenominator?: number, + activeArrowWidthMultiplier?: number, + opacity?: number, + activeOpacity?: number, + arrowStartOffset?: number, + liveDrawArrow?: boolean, } ``` diff --git a/docs/stories/options/ArrowOptions.stories.tsx b/docs/stories/options/ArrowOptions.stories.tsx index 215df32..1813cb9 100644 --- a/docs/stories/options/ArrowOptions.stories.tsx +++ b/docs/stories/options/ArrowOptions.stories.tsx @@ -33,6 +33,7 @@ export const ArrowOptions: Story = { opacity: 0.65, activeOpacity: 0.5, arrowStartOffset: 0, + liveDrawArrow: true, }; // arrows @@ -264,6 +265,25 @@ export const ArrowOptions: Story = { } /> + + {/* Toggles */} +
+ +