📦 Update cuid to cuid2
This commit is contained in:
@ -12,7 +12,7 @@ import { useTypebot } from '@/features/editor'
|
||||
import { DraggableBlockType, PublicTypebot, Typebot } from 'models'
|
||||
import { useDebounce } from 'use-debounce'
|
||||
import GraphElements from './GraphElements'
|
||||
import cuid from 'cuid'
|
||||
import { createId } from '@paralleldrive/cuid2'
|
||||
import { useUser } from '@/features/account'
|
||||
import { ZoomButtons } from './ZoomButtons'
|
||||
import { AnswersCount } from '@/features/analytics'
|
||||
@ -96,7 +96,7 @@ export const Graph = ({
|
||||
{ x: e.clientX, y: e.clientY },
|
||||
graphPosition
|
||||
)
|
||||
const id = cuid()
|
||||
const id = createId()
|
||||
updateGroupCoordinates(id, coordinates)
|
||||
createGroup({
|
||||
id,
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user