/** * This file is part of the NocoBase (R) project. * Copyright (c) 2020-2024 NocoBase Co., Ltd. * Authors: NocoBase Team. * * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License. * For more information, please refer to: https://www.nocobase.com/agreement. */ import React from 'react'; import { FlowModel } from '../../../../models'; import { ToolbarItemConfig } from '../../../../types'; type ToolbarPosition = 'inside' | 'above' | 'below'; interface BaseFloatContextMenuProps { children?: React.ReactNode; enabled?: boolean; showDeleteButton?: boolean; showCopyUidButton?: boolean; containerStyle?: React.CSSProperties; /** 自定义工具栏样式,`top/left/right/bottom` 会作为 portal overlay 的 inset 使用。 */ toolbarStyle?: React.CSSProperties; className?: string; /** * @default true */ showBorder?: boolean; /** * @default true */ showBackground?: boolean; /** * @default false */ showTitle?: boolean; /** * @default false */ showDragHandle?: boolean; /** * Settings menu levels: 1=current model only (default), 2=include sub-models */ settingsMenuLevel?: number; /** * Extra toolbar items to add to this context menu instance */ extraToolbarItems?: ToolbarItemConfig[]; /** * @default true */ showDynamicFlowsEditor?: boolean; /** * @default 'inside' */ toolbarPosition?: ToolbarPosition; } interface ModelProvidedProps extends BaseFloatContextMenuProps { model: FlowModel; } interface ModelByIdProps extends BaseFloatContextMenuProps { uid: string; modelClassName: string; } type FlowsFloatContextMenuProps = ModelProvidedProps | ModelByIdProps; /** * FlowsFloatContextMenu组件 - 悬浮配置工具栏组件 * * 功能特性: * - 鼠标悬浮显示右上角配置图标 * - 点击图标显示配置菜单 * - 支持删除功能 * - Wrapper 模式支持 * - 使用 portal overlay 避免被宿主或祖先裁剪 * - 设置菜单与工具栏共享同一个 popup 容器 * * 支持两种使用方式: * 1. 直接提供 model: `{children}` * 2. 通过 uid 和 modelClassName 获取 model: * `{children}` * * @param props.children 子组件,必须提供 * @param props.enabled 是否启用悬浮菜单,默认为 true * @param props.showDeleteButton 是否显示删除按钮,默认为 true * @param props.showCopyUidButton 是否显示复制 UID 按钮,默认为 true * @param props.containerStyle 容器自定义样式 * @param props.toolbarStyle 工具栏自定义样式;`top/left/right/bottom` 会作为 portal overlay 的 inset 使用 * @param props.className 容器自定义类名 * @param props.showTitle 是否在边框左上角显示模型 title,默认为 false * @param props.settingsMenuLevel 设置菜单层级:1=仅当前模型(默认),2=包含子模型 * @param props.extraToolbarItems 额外的工具栏项目,仅应用于此实例 */ declare const FlowsFloatContextMenu: React.FC; export { FlowsFloatContextMenu };