feat: schema builder's create flow
This commit is contained in:
1 parent
f514146fed
commit
083cc9e23e
71 files changed
+7223
-61
No files matched your search
@@ -14,16 +14,6 @@ export function metaSummary(authors: Byline[], siteName: string | null) {
|
||||
return siteName ? t('{0} · {1}', [siteName, summary]) : summary
|
||||
}
|
||||
|
||||
export function moveItem<T>(items: T[], from: number, to: number) {
|
||||
if (from === to || from < 0 || to < 0 || from >= items.length || to >= items.length) {
|
||||
return items
|
||||
}
|
||||
const next = [...items]
|
||||
const [moved] = next.splice(from, 1)
|
||||
next.splice(to, 0, moved!)
|
||||
return next
|
||||
}
|
||||
|
||||
export function insertionTarget(from: number, gap: number) {
|
||||
return gap > from ? gap - 1 : gap
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user