feat: generate uuid with human-id #918 (#1111)

### What problem does this PR solve?

feat: generate uuid with human-id #918

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-06-11 11:58:49 +08:00
committed by GitHub
parent cf2f6592dd
commit 0b92f02672
4 changed files with 13 additions and 3 deletions

View File

@ -15,9 +15,9 @@ import React, {
useState,
} from 'react';
import { Node, Position, ReactFlowInstance } from 'reactflow';
import { v4 as uuidv4 } from 'uuid';
// import { shallow } from 'zustand/shallow';
import { useDebounceEffect } from 'ahooks';
import { humanId } from 'human-id';
import { useParams } from 'umi';
import useGraphStore, { RFState } from './store';
import { buildDslComponentsByGraph } from './utils';
@ -79,7 +79,7 @@ export const useHandleDrop = () => {
y: event.clientY,
});
const newNode = {
id: uuidv4(),
id: `${type}:${humanId()}`,
type: 'textUpdater',
position: position || {
x: 0,