2
0

📦 Update cuid to cuid2

This commit is contained in:
Baptiste Arnaud
2023-02-10 15:06:02 +01:00
parent 2dbf0fb848
commit 51f76700b2
77 changed files with 254 additions and 250 deletions

View File

@ -48,7 +48,7 @@ import {
} from './providers'
import { roundCorners } from 'svg-round-corners'
import { AnchorsPositionProps } from './components/Edges/Edge'
import cuid from 'cuid'
import { createId } from '@paralleldrive/cuid2'
import {
isBubbleBlockType,
blockTypeHasOption,
@ -359,7 +359,7 @@ export const parseNewBlock = (
type: DraggableBlockType,
groupId: string
): DraggableBlock => {
const id = cuid()
const id = createId()
return {
id,
groupId,
@ -368,7 +368,7 @@ export const parseNewBlock = (
options: blockTypeHasOption(type)
? parseDefaultBlockOptions(type)
: undefined,
webhookId: blockTypeHasWebhook(type) ? cuid() : undefined,
webhookId: blockTypeHasWebhook(type) ? createId() : undefined,
items: blockTypeHasItems(type) ? parseDefaultItems(type, id) : undefined,
} as DraggableBlock
}
@ -379,11 +379,11 @@ const parseDefaultItems = (
): Item[] => {
switch (type) {
case InputBlockType.CHOICE:
return [{ id: cuid(), blockId, type: ItemType.BUTTON }]
return [{ id: createId(), blockId, type: ItemType.BUTTON }]
case LogicBlockType.CONDITION:
return [
{
id: cuid(),
id: createId(),
blockId,
type: ItemType.CONDITION,
content: defaultConditionContent,