import { DSLNodeType, ValidatorType } from '@lingxiteam/dsl'; import type { DSLQuery } from '@lingxiteam/dsl/lib/core/DSLQuery'; import type React from 'react'; import { PluginManager } from '../shell'; import type { LeftTypes } from '../interface'; import type { CompCreatorType, ComponentGroup, EditCompTypeKey, LcdpPlatformKey, PageContanerTypeKey, pageZoomTabs, pageZoomCompOperator, CompOperatorType } from '../interfaces/types'; import type { withRegisterProps } from '../utils/withRegister'; import type { openEventPanelType } from './hooks/useEvent'; import { EditPropsContextType, EditPropsJSONType } from '../preprocess/editPropsprocess/EditPropsParseBefore'; import { CanvasDragConfig } from "../utils/localDragUtils/CanvasDragMode"; import { I18nItemType } from '@lingxiteam/editor-types'; import { EditorPluginClass } from '../utils/plugin/EditorPlugin'; export declare type DslLimit = { platformLimit?: number; appLayoutLimit?: number; singleEventActionLimit?: { [actionKey: string]: number; }; actionOptionRequired?: { [actionKey: string]: { [optionKey: string]: 'required' | undefined; }; }; actionLimit?: number; }; export interface EditorConfigProps { isErmStatus?: boolean; showSpinWhenSave?: boolean; platformType: LcdpPlatformKey; editType: EditCompTypeKey; isMobile: boolean; pageContainerType?: PageContanerTypeKey; compList?: ComponentGroup[]; compCreatorList?: ComponentGroup[]; objectService?: any[]; goBack?: () => void; showGoBack?: boolean; tips?: string[]; currentEditStatus?: boolean; autoCorSkipObj?: any; busiData?: any; compCreators: () => CompCreatorType; userInfo?: Record; dslDidParse?: () => void; onSave?: SaveFunctionType; prefix?: string; pcfactory: string; $$reqPrefix?: string; isUsedOldFlow?: boolean; dataSource?: string[]; event?: string[]; style?: boolean; undoredo?: boolean; header?: React.ReactNode; headerLeft?: React.ReactNode; historySets: string[]; pages?: any[]; onPriview?: SaveFunctionType; onPreview?: (url: string) => false | string | PromiseLike | void; showPreview?: boolean; dslParseNodeBefore?: (node: any) => void; showBlockTemplate: boolean; onSavePreviewHandle?: (isDebug?: boolean) => void; onFocusSaveBt?: () => void; editPropsParseBefore?: (todoProps: any, key: string, context: EditPropsContextType) => EditPropsJSONType; editPageZoneCanRemoveCompBefore?: (node: DSLNodeType) => boolean; mulitWindowHooks: { useActivate: (cb: () => void) => void; useUnactivate: (cb: () => void) => void; }; /** * 左侧Tabs配置 */ leftTabsConfig?: { /** * 左侧权限 */ tabs?: LeftTypes[]; /** * 左侧或者上侧 */ position?: 'left' | 'top'; /** * 是否开启点击自动添加组件,默认关闭 */ clickInject?: boolean; }; /** * 打开时间面板 */ openEventPanel: openEventPanelType; /** * 右侧面板wrapper样式 */ rightTabsWidth?: number; /** * 右侧Tabs配置 */ rightTabsConfig?: { props?: { hiddenIdentifier?: boolean; }; }; /** * 开启pc、app组件融合模式 */ fusionMode?: false | { defaultTerminal: 'pc' | 'app'; onSwitchTerminal: (terminal: 'pc' | 'app', DSLCore: DSLQuery | undefined) => void; }; /** * 中间画布配置 */ pageZoomConfig?: { tabs?: pageZoomTabs[]; compOperator?: pageZoomCompOperator[]; }; wrapRef?: any; currentPageVersionId?: string; currentInstId?: string; cacheValuePropName: (valuePropName: string, type: 'props' | 'style' | 'data') => void; renderExtTitle?: any; plugins: PluginManager; showEditorPanel?: boolean; openCreateDataSourcePanel?: (flag: boolean) => void; setSpinLoading: (v: boolean) => void; canvasDragConfig: CanvasDragConfig[]; openWindow?: (nodeData: any) => void; /** * 应用Id */ appId?: string; /** * 业务组件列表 */ businessCompList: any[]; /** * 国际化 */ i18n?: EditorViewProps['i18n']; editStatus?: EditorViewProps['editStatus']; /** * 门户应用约束配置 */ dslLimit?: EditorViewProps['dslLimit']; /** * 配置态控件能力 */ edEngineApis: Record; /** * 资产相关配置 */ assetsConfig?: { compListPanel?: { /** * 是否展示安装 */ canInstall: boolean; /** * 跳转的url地址 */ url: string; /** * 标题默认安装 */ title: string; }; }; /** * 选择控件操作配置 */ compOperatorOptions?: { /** * 隐藏操作按钮 */ hiddenOperators?: CompOperatorType[]; }; /** * 外部注册的插件数据方法 */ editorPluginInst: EditorPluginClass; } export interface InitialEditorConfigFnReturn extends Partial { platformType: LcdpPlatformKey; compList: ComponentGroup[]; editType: EditCompTypeKey; isMobile: boolean; /** * 校验器, * true: 使用编辑器内置校验器。 * false: 关闭校验器。 * ValidatorType 自定义校验器 * @default true */ validator?: boolean | ValidatorType; /** * 资产相关配置 */ assetsConfig?: { compListPanel?: { /** * 是否展示安装 */ canInstall: boolean; /** * 跳转的url地址 */ url: string; /** * 标题默认安装 */ title: string; }; }; } export interface EditorViewProps extends withRegisterProps { pageData: Record; initEditorConfig: (defaultFunc: Record) => InitialEditorConfigFnReturn; goBack: () => void; showGoBack?: boolean; tips?: string[]; onSave: SaveFunctionType; onPriview?: SaveFunctionType; onPreview?: (url: string) => false | string | PromiseLike | void; showPreview?: boolean; editorWillLoad?: (DSLCore: DSLQuery) => void; editorDidLoad?: (DSLCore: DSLQuery) => void; editorUnmount?: () => void; dslParseNodeBefore?: (node: any) => void; editPropsParseBefore?: (todoProps: any, key: string, context: EditPropsContextType) => EditPropsJSONType; editPageZoneCanRemoveCompBefore?: (node: DSLNodeType) => boolean; /** * 组件添加前的预处理方法 * @param compName 组件名称 * @param isMobile 是否移动端 * @param opts 当前组件生成的时候存在dsl的节点信息,如果需要处理,直接修改opts里面的值 * @returns void */ parseAddComProcess?: (compName: string, opts: Record, DSLCore: DSLQuery) => void | undefined; plugins: PluginManager; showSpinWhenSave?: boolean; renderLoading?: any; /** * 国际化配置 false不支持 */ i18n: false | I18nItemType; editStatus?: 'edit' | 'detail' | 'lock'; /** * 门户应用约束配置 */ dslLimit?: DslLimit; /** * 插件实例 */ editorPluginInst?: EditorPluginClass; } export interface HeaderTabProps { children: React.ReactElement; key: string; compName: string; icon: React.ReactElement; name: string | React.ReactElement; } export interface HeaderToolProps { compName: string; children: React.ReactElement; placement: string; } export interface LeftTabsProps { children: React.ReactElement; key: string; compName: string; icon: React.ReactElement; name: string | React.ReactElement; } export declare type SaveFunctionType = (e: { data: any; DSLCore?: DSLQuery; setLoading: React.Dispatch>; setValidateNum?: any; busiData?: any; isApp?: boolean; operationDesc?: any; }) => Promise;