Merge remote-tracking branch 'myori/main' into feat/collaboration2

This commit is contained in:
hjlarry
2026-01-17 10:22:41 +08:00
6266 changed files with 544217 additions and 224655 deletions

View File

@ -1,8 +1,4 @@
import type { MouseEvent } from 'react'
import {
memo,
} from 'react'
import { useTranslation } from 'react-i18next'
import {
RiAspectRatioFill,
RiAspectRatioLine,
@ -11,23 +7,27 @@ import {
RiHand,
RiStickyNoteAddLine,
} from '@remixicon/react'
import {
memo,
} from 'react'
import { useTranslation } from 'react-i18next'
import { Comment } from '@/app/components/base/icons/src/public/other'
import { cn } from '@/utils/classnames'
import Divider from '../../base/divider'
import {
useNodesReadOnly,
useWorkflowCanvasMaximize,
useWorkflowMoveMode,
useWorkflowOrganize,
} from '../hooks'
import { useStore } from '../store'
import {
ControlMode,
} from '../types'
import { useStore } from '../store'
import Divider from '../../base/divider'
import AddBlock from './add-block'
import TipPopup from './tip-popup'
import MoreActions from './more-actions'
import { useOperator } from './hooks'
import cn from '@/utils/classnames'
import MoreActions from './more-actions'
import TipPopup from './tip-popup'
const Control = () => {
const { t } = useTranslation()
@ -56,9 +56,9 @@ const Control = () => {
}
return (
<div className='pointer-events-auto flex flex-col items-center rounded-lg border-[0.5px] border-components-actionbar-border bg-components-actionbar-bg p-0.5 text-text-tertiary shadow-lg'>
<div className="pointer-events-auto flex flex-col items-center rounded-lg border-[0.5px] border-components-actionbar-border bg-components-actionbar-bg p-0.5 text-text-tertiary shadow-lg">
<AddBlock />
<TipPopup title={t('workflow.nodes.note.addNote')}>
<TipPopup title={t('nodes.note.addNote', { ns: 'workflow' })}>
<div
className={cn(
'ml-[1px] flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg hover:bg-state-base-hover hover:text-text-secondary',
@ -66,11 +66,11 @@ const Control = () => {
)}
onClick={addNote}
>
<RiStickyNoteAddLine className='h-4 w-4' />
<RiStickyNoteAddLine className="h-4 w-4" />
</div>
</TipPopup>
<Divider className='my-1 w-3.5' />
<TipPopup title={t('workflow.common.pointerMode')} shortcuts={['v']}>
<Divider className="my-1 w-3.5" />
<TipPopup title={t('common.pointerMode', { ns: 'workflow' })} shortcuts={['v']}>
<div
className={cn(
'mr-[1px] flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg',
@ -79,10 +79,10 @@ const Control = () => {
)}
onClick={handleModePointer}
>
<RiCursorLine className='h-4 w-4' />
<RiCursorLine className="h-4 w-4" />
</div>
</TipPopup>
<TipPopup title={t('workflow.common.handMode')} shortcuts={['h']}>
<TipPopup title={t('common.handMode', { ns: 'workflow' })} shortcuts={['h']}>
<div
className={cn(
'flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg',
@ -91,11 +91,11 @@ const Control = () => {
)}
onClick={handleModeHand}
>
<RiHand className='h-4 w-4' />
<RiHand className="h-4 w-4" />
</div>
</TipPopup>
{isCommentModeAvailable && (
<TipPopup title={t('workflow.common.commentMode')} shortcuts={['c']}>
<TipPopup title={t('common.commentMode', { ns: 'workflow' })} shortcuts={['c']}>
<div
className={cn(
'ml-[1px] flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg',
@ -104,12 +104,12 @@ const Control = () => {
)}
onClick={handleModeComment}
>
<Comment className='h-4 w-4' />
<Comment className="h-4 w-4" />
</div>
</TipPopup>
)}
<Divider className='my-1 w-3.5' />
<TipPopup title={t('workflow.panel.organizeBlocks')} shortcuts={['ctrl', 'o']}>
<Divider className="my-1 w-3.5" />
<TipPopup title={t('panel.organizeBlocks', { ns: 'workflow' })} shortcuts={['ctrl', 'o']}>
<div
className={cn(
'flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg hover:bg-state-base-hover hover:text-text-secondary',
@ -117,10 +117,10 @@ const Control = () => {
)}
onClick={handleLayout}
>
<RiFunctionAddLine className='h-4 w-4' />
<RiFunctionAddLine className="h-4 w-4" />
</div>
</TipPopup>
<TipPopup title={maximizeCanvas ? t('workflow.panel.minimize') : t('workflow.panel.maximize')} shortcuts={['f']}>
<TipPopup title={maximizeCanvas ? t('panel.minimize', { ns: 'workflow' }) : t('panel.maximize', { ns: 'workflow' })} shortcuts={['f']}>
<div
className={cn(
'flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg hover:bg-state-base-hover hover:text-text-secondary',
@ -129,8 +129,8 @@ const Control = () => {
)}
onClick={handleToggleMaximizeCanvas}
>
{maximizeCanvas && <RiAspectRatioFill className='h-4 w-4' />}
{!maximizeCanvas && <RiAspectRatioLine className='h-4 w-4' />}
{maximizeCanvas && <RiAspectRatioFill className="h-4 w-4" />}
{!maximizeCanvas && <RiAspectRatioLine className="h-4 w-4" />}
</div>
</TipPopup>
<MoreActions />