From fe2d8176f15b087ee1e0fc49260dba2fa8d11155 Mon Sep 17 00:00:00 2001 From: Andrey Platov Date: Sat, 9 Oct 2021 13:17:00 +0200 Subject: [PATCH] add $move descriptor Signed-off-by: Andrey Platov --- packages/core/src/tx.ts | 16 ++++++++++++++++ .../src/components/KanbanView.svelte | 1 - 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/core/src/tx.ts b/packages/core/src/tx.ts index 9a1bf47c78..c4d376c3d8 100644 --- a/packages/core/src/tx.ts +++ b/packages/core/src/tx.ts @@ -85,6 +85,14 @@ export interface Position { $position: number } +/** + * @public + */ +export interface MoveDescriptor { + $value: X + $position: number +} + /** * @public */ @@ -92,6 +100,13 @@ export type ArrayAsElementPosition = { [P in keyof T]: T[P] extends Arr ? X | Position : never } +/** + * @public + */ +export type ArrayMoveDescriptor = { + [P in keyof T]: T[P] extends Arr ? MoveDescriptor : never +} + /** * @public */ @@ -110,6 +125,7 @@ export type OmitNever = Omit> export interface PushOptions { $push?: Partial>> $pull?: Partial>> + $move?: Partial>> } /** diff --git a/plugins/view-resources/src/components/KanbanView.svelte b/plugins/view-resources/src/components/KanbanView.svelte index 25d3af78b2..61d14d9fd8 100644 --- a/plugins/view-resources/src/components/KanbanView.svelte +++ b/plugins/view-resources/src/components/KanbanView.svelte @@ -181,7 +181,6 @@ {#each objects as object, j} {#if object.state === state._id} - {j}
{ dragover(ev, object)