From 69a4010aca2f985e8c966a150ee3cb5306ca4a87 Mon Sep 17 00:00:00 2001 From: Tate Date: Thu, 23 Oct 2025 10:57:26 +1300 Subject: [PATCH 1/2] Allow moving between arrays and add explicit position to edits --- src/index.d.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index 1ee596b..7b18cbd 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -195,8 +195,15 @@ export interface EditOptions { slug: string; /** Optional style information */ style?: string | null; - /** The mouse event that triggered the edit */ - e?: MouseEvent; + /** The coordinates of the edit, and the bounding rectangle of the element being edited */ + position?: { + x: number; + y: number; + left: number; + width: number; + top: number; + height: number; + }; } /** @@ -222,9 +229,13 @@ export interface AddArrayItemOptions extends ArrayOptions { /** * Options for moving an array item in the v2 API */ -export interface MoveArrayItemOptions extends ArrayOptions { +export interface MoveArrayItemOptions { + /** the identifier of the array field to move from */ + fromSlug: string; + /** the identifier of the array field to move to, defaults to fromSlug if not provided */ + toSlug?: string; /** The current index of the item */ - index: number; + fromIndex: number; /** The target index for the item */ toIndex: number; } From d1e91ba1fb6e2d3b0a6162218aa371d1efac4721 Mon Sep 17 00:00:00 2001 From: Tate Date: Thu, 23 Oct 2025 11:21:21 +1300 Subject: [PATCH 2/2] Remove unused mouse event + add missing sourceIndex --- src/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index 7b18cbd..7dceab7 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -222,8 +222,8 @@ export interface AddArrayItemOptions extends ArrayOptions { index: number | null; /** The value to insert */ value: any; - /** The mouse event that triggered the addition */ - e?: MouseEvent; + /** The index to clone from if value isnt provided */ + sourceIndex?: number; } /**