Skip to content

Commit 69a4010

Browse files
committed
Allow moving between arrays and add explicit position to edits
1 parent 5abb6a5 commit 69a4010

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

src/index.d.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,15 @@ export interface EditOptions {
195195
slug: string;
196196
/** Optional style information */
197197
style?: string | null;
198-
/** The mouse event that triggered the edit */
199-
e?: MouseEvent;
198+
/** The coordinates of the edit, and the bounding rectangle of the element being edited */
199+
position?: {
200+
x: number;
201+
y: number;
202+
left: number;
203+
width: number;
204+
top: number;
205+
height: number;
206+
};
200207
}
201208

202209
/**
@@ -222,9 +229,13 @@ export interface AddArrayItemOptions extends ArrayOptions {
222229
/**
223230
* Options for moving an array item in the v2 API
224231
*/
225-
export interface MoveArrayItemOptions extends ArrayOptions {
232+
export interface MoveArrayItemOptions {
233+
/** the identifier of the array field to move from */
234+
fromSlug: string;
235+
/** the identifier of the array field to move to, defaults to fromSlug if not provided */
236+
toSlug?: string;
226237
/** The current index of the item */
227-
index: number;
238+
fromIndex: number;
228239
/** The target index for the item */
229240
toIndex: number;
230241
}

0 commit comments

Comments
 (0)