feat: 补充文档定义

This commit is contained in:
humphry.hy 2021-12-13 17:33:45 +08:00
parent 43a2a2ffbd
commit 1a2f82154b
3 changed files with 32 additions and 19 deletions

View File

@ -3,7 +3,7 @@ import { PropConfig } from './prop-config';
import { Snippet, ComponentMetadata } from './metadata';
/**
* 应该被编辑器默认加载,定义组件大包及external资源的信息
* 定义组件大包及external资源的信息,应该被编辑器默认加载
*/
export interface Package {
/**
@ -27,11 +27,11 @@ export interface Package {
*/
library: string;
/**
* 待补充文档
* todo 待补充文档
*/
async?: boolean;
/**
* 待补充文档
* 组件描述导出名字,可以通过 window[exportName] 获取到组件描述的 Object 内容;
*/
exportName?: string;
}
@ -71,9 +71,21 @@ export interface ComponentItem {
*/
icon?: string;
/**
* 待补充文档
* 可用片段
*/
snippets?: Snippet[];
/**
* 一级分组
*/
group?: string;
/**
* 二级分组
*/
category?: string;
/**
* 组件优先级排序
*/
priority?: number;
}
/**
@ -81,7 +93,7 @@ export interface ComponentItem {
*/
export interface ComponentDescription extends ComponentMetadata {
/**
* 待补充文档
* todo 待补充文档
*/
keywords: string[];
}
@ -91,11 +103,17 @@ export interface ComponentDescription extends ComponentMetadata {
*/
export interface RemoteComponentDescription {
/**
* 待补充文档
* 组件描述导出名字,可以通过 window[exportName] 获取到组件描述的 Object 内容;
*/
exportName: string;
exportName?: string;
/**
* 待补充文档
* 组件描述的资源链接;
*/
url: string;
url?: string;
/**
* 组件(库)的 npm 信息;
*/
package?: {
npm?: string;
};
}

View File

@ -52,10 +52,6 @@ export interface FieldExtraProps {
display?: 'accordion' | 'inline' | 'block' | 'plain' | 'popup' | 'entry';
// todo 这个 omit 是否合理?
liveTextEditing?: Omit<LiveTextEditingConfig, 'propTarget'>;
/**
* 待文档定义
*/
onChange?: (value: any, field: SettingTarget) => void;
}
export interface FieldConfig extends FieldExtraProps {
@ -82,11 +78,11 @@ export interface FieldConfig extends FieldExtraProps {
*/
extraProps?: FieldExtraProps;
/**
* 待文档定义
* todo 待补充文档
*/
description?: TitleContent;
/**
* 待文档定义
* todo 待补充文档
*/
isExtends?: boolean;
}

View File

@ -120,15 +120,16 @@ export interface Experimental {
*/
export interface LiveTextEditingConfig {
/**
* 待补充文档
* todo 待补充文档
*/
propTarget: string;
/**
* 待补充文档
* todo 待补充文档
*/
selector?: string;
/**
* 编辑模式 纯文本|段落编辑|文章编辑(默认纯文本,无跟随工具条)
* @default 'plaintext'
*/
mode?: 'plaintext' | 'paragraph' | 'article';
/**
@ -247,8 +248,6 @@ export interface Callbacks {
/**
* hooks
*/
onMouseDownHook?: (e: MouseEvent, currentNode: any) => any;
onDblClickHook?: (e: MouseEvent, currentNode: any) => any;
onClickHook?: (e: MouseEvent, currentNode: any) => any;