amis-editor-core 5.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cebfe0bc5a1dbde02da1.svg +10 -0
- package/lib/compat.d.ts +30 -0
- package/lib/component/Breadcrumb.d.ts +33 -0
- package/lib/component/ClassNameControl.d.ts +31 -0
- package/lib/component/CommonConfigWrapper.d.ts +6 -0
- package/lib/component/ContainerWrapper.d.ts +12 -0
- package/lib/component/Editor.d.ts +99 -0
- package/lib/component/HighlightBox.d.ts +29 -0
- package/lib/component/IFrameBridge.d.ts +32 -0
- package/lib/component/IFramePreview.d.ts +38 -0
- package/lib/component/MiniEditor.d.ts +9 -0
- package/lib/component/NodeWrapper.d.ts +20 -0
- package/lib/component/Panel/AMisCodeEditor.d.ts +37 -0
- package/lib/component/Panel/AvailableRenderersPanel.d.ts +10 -0
- package/lib/component/Panel/CodeEditorPanel.d.ts +6 -0
- package/lib/component/Panel/ContextMenuPanel.d.ts +8 -0
- package/lib/component/Panel/DrawerPanel.d.ts +15 -0
- package/lib/component/Panel/DrawerRendererPanel.d.ts +15 -0
- package/lib/component/Panel/InsertSubRendererPanel.d.ts +11 -0
- package/lib/component/Panel/LeftPanels.d.ts +20 -0
- package/lib/component/Panel/Outline.d.ts +18 -0
- package/lib/component/Panel/RenderersPanel.d.ts +31 -0
- package/lib/component/Panel/RightPanels.d.ts +21 -0
- package/lib/component/Panel/TargetNamePanel.d.ts +7 -0
- package/lib/component/PopOverForm.d.ts +22 -0
- package/lib/component/Preview.d.ts +67 -0
- package/lib/component/RegionHLBox.d.ts +20 -0
- package/lib/component/RegionWrapper.d.ts +206 -0
- package/lib/component/RendererThumb.d.ts +22 -0
- package/lib/component/ScaffoldModal.d.ts +24 -0
- package/lib/component/SubEditor.d.ts +67 -0
- package/lib/component/VRenderer.d.ts +191 -0
- package/lib/component/base/BackTop.d.ts +26 -0
- package/lib/component/base/ErrorRenderer.d.ts +4 -0
- package/lib/component/base/SearchCustomRendererPanel.d.ts +15 -0
- package/lib/component/base/SearchPanel.d.ts +83 -0
- package/lib/component/base/SearchRendererPanel.d.ts +19 -0
- package/lib/component/base/WidthDraggableBtn.d.ts +16 -0
- package/lib/component/base/WidthDraggableContainer.d.ts +2 -0
- package/lib/component/factory.d.ts +19 -0
- package/lib/dnd/default.d.ts +47 -0
- package/lib/dnd/index.d.ts +119 -0
- package/lib/dnd/interface.d.ts +14 -0
- package/lib/dnd/position-h.d.ts +7 -0
- package/lib/env.d.ts +5 -0
- package/lib/icons/index.d.ts +2 -0
- package/lib/index.d.ts +36 -0
- package/lib/index.min.js +1 -0
- package/lib/manager.d.ts +509 -0
- package/lib/mocker.d.ts +1 -0
- package/lib/plugin/AvailableRenderers.d.ts +8 -0
- package/lib/plugin/BasicToolbar.d.ts +11 -0
- package/lib/plugin/Code.d.ts +9 -0
- package/lib/plugin/DataDebug.d.ts +19 -0
- package/lib/plugin/ErrorRenderer.d.ts +7 -0
- package/lib/plugin/Name.d.ts +8 -0
- package/lib/plugin/Outline.d.ts +8 -0
- package/lib/plugin/Unknown.d.ts +5 -0
- package/lib/plugin.d.ts +639 -0
- package/lib/store/editor.d.ts +1048 -0
- package/lib/store/node.d.ts +281 -0
- package/lib/style.css +1 -0
- package/lib/tpl.d.ts +5 -0
- package/lib/util.d.ts +80 -0
- package/package.json +102 -0
- package/scss/_backTop.scss +55 -0
- package/scss/_bcn.scss +157 -0
- package/scss/_classname-picker.scss +57 -0
- package/scss/_context-menu-setting.scss +109 -0
- package/scss/_data-chain.scss +39 -0
- package/scss/_leftPanel.scss +237 -0
- package/scss/_mixin.scss +95 -0
- package/scss/_outline.scss +206 -0
- package/scss/_renderers.scss +536 -0
- package/scss/_rightPanel.scss +424 -0
- package/scss/_searchRendererPanel.scss +244 -0
- package/scss/_selection.scss +6 -0
- package/scss/_tableview.scss +53 -0
- package/scss/_targetname.scss +30 -0
- package/scss/_tooltip.scss +111 -0
- package/scss/_variables.scss +41 -0
- package/scss/control/_api-control.scss +61 -0
- package/scss/control/_badge-control.scss +46 -0
- package/scss/control/_dateshortcut-control.scss +108 -0
- package/scss/control/_formItem-control.scss +121 -0
- package/scss/control/_formula-control.scss +108 -0
- package/scss/control/_option-control.scss +170 -0
- package/scss/control/_switch-more-control.scss +121 -0
- package/scss/control/_validation-control.scss +101 -0
- package/scss/editor.scss +1563 -0
- package/scss/style-control/_background.scss +204 -0
- package/scss/style-control/_border.scss +105 -0
- package/scss/style-control/_box-model.scss +100 -0
- package/scss/style-control/_box-shadow.scss +12 -0
- package/scss/style-control/_font.scss +28 -0
- package/scss/style-control/_size.scss +40 -0
- package/scss/style-control/_style-common.scss +22 -0
- package/static/Code-hover.png +0 -0
- package/static/Code.png +0 -0
- package/static/Outline-hover.png +0 -0
- package/static/Outline.png +0 -0
- package/static/Renderers-hover.png +0 -0
- package/static/Renderers.png +0 -0
- package/static/empty.png +0 -0
- package/static/side_hide_left.svg +10 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="6px" height="8px" viewBox="0 0 6 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<g id="折叠icon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
4
|
+
<g id="折叠icon svg" transform="translate(-305.000000, -566.000000)" fill="#A1A6B3" fill-rule="nonzero">
|
|
5
|
+
<g id="折叠icon svg g" transform="translate(60.000000, 60.000000)">
|
|
6
|
+
<path d="M245.77735,506.518233 L250.375962,509.583975 C250.605727,509.737151 250.667814,510.047586 250.514637,510.27735 C250.47802,510.332276 250.430888,510.379408 250.375962,510.416025 L245.77735,513.481767 C245.547586,513.634943 245.237151,513.572856 245.083975,513.343092 C245.029219,513.260958 245,513.164454 245,513.065741 L245,506.934259 C245,506.658116 245.223858,506.434259 245.5,506.434259 C245.598712,506.434259 245.695216,506.463478 245.77735,506.518233 Z" id="矩形" transform="translate(248.000000, 510.000000) scale(-1, 1) translate(-248.000000, -510.000000) "></path>
|
|
7
|
+
</g>
|
|
8
|
+
</g>
|
|
9
|
+
</g>
|
|
10
|
+
</svg>
|
package/lib/compat.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 兼容 1.x 里面的注册渲染器的方法。
|
|
3
|
+
*/
|
|
4
|
+
import { EditorManager } from './manager';
|
|
5
|
+
import { BasePlugin } from './plugin';
|
|
6
|
+
/**
|
|
7
|
+
* 旧版本注册渲染器编辑器的方法。
|
|
8
|
+
*
|
|
9
|
+
* @deprecated
|
|
10
|
+
* @param rendererName
|
|
11
|
+
* @param config
|
|
12
|
+
*/
|
|
13
|
+
export declare function RendererEditor(rendererName: string, config: {
|
|
14
|
+
name: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
type?: string;
|
|
17
|
+
previewSchema?: any;
|
|
18
|
+
scaffold?: any;
|
|
19
|
+
}): (Klass: new (manager: EditorManager) => BasicEditor) => void;
|
|
20
|
+
/**
|
|
21
|
+
* 为了兼容旧版的注册方法
|
|
22
|
+
* @deprecated
|
|
23
|
+
*/
|
|
24
|
+
export declare class BasicEditor extends BasePlugin {
|
|
25
|
+
tipName?: string;
|
|
26
|
+
settingsSchema?: {
|
|
27
|
+
title: string;
|
|
28
|
+
body: Array<any>;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditorStoreType } from '../store/editor';
|
|
3
|
+
import { EditorManager } from '../manager';
|
|
4
|
+
export interface BreadcrumbProps {
|
|
5
|
+
store: EditorStoreType;
|
|
6
|
+
manager: EditorManager;
|
|
7
|
+
}
|
|
8
|
+
interface BreadcrumbStates {
|
|
9
|
+
showLeftScrollBtn: boolean;
|
|
10
|
+
showRightScrollBtn: boolean;
|
|
11
|
+
}
|
|
12
|
+
export default class Breadcrumb extends React.Component<BreadcrumbProps, BreadcrumbStates> {
|
|
13
|
+
readonly breadcrumbRef: React.RefObject<HTMLDivElement>;
|
|
14
|
+
readonly bcnContentRef: React.RefObject<HTMLDivElement>;
|
|
15
|
+
currentBreadcrumb: HTMLElement;
|
|
16
|
+
unReaction: () => void;
|
|
17
|
+
unSensor?: () => void;
|
|
18
|
+
constructor(props: any);
|
|
19
|
+
componentDidMount(): void;
|
|
20
|
+
componentWillUnmount(): void;
|
|
21
|
+
refreshHandleScroll(resetScroll?: boolean): void;
|
|
22
|
+
getCurBreadcrumb(): HTMLDivElement | null;
|
|
23
|
+
getBreadcrumbContainer(): HTMLDivElement | null;
|
|
24
|
+
getScrollLeft(): string;
|
|
25
|
+
toNumber(pxStr: string): number;
|
|
26
|
+
HandleScroll(resetScroll?: boolean): void;
|
|
27
|
+
handleScrollToLeft(): void;
|
|
28
|
+
handleScrollToRight(): void;
|
|
29
|
+
handleClick(e: React.MouseEvent<HTMLAnchorElement>): void;
|
|
30
|
+
handleMouseEnter(e: React.MouseEvent<HTMLAnchorElement>): void;
|
|
31
|
+
render(): JSX.Element;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { RendererProps } from 'amis';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Schema } from 'amis/lib/types';
|
|
4
|
+
interface ClassNameControlProps extends RendererProps {
|
|
5
|
+
schema: Schema;
|
|
6
|
+
}
|
|
7
|
+
interface ClassNameControlState {
|
|
8
|
+
isFocused: boolean;
|
|
9
|
+
isOpened: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare class ClassNameControl extends React.Component<ClassNameControlProps, ClassNameControlState> {
|
|
12
|
+
state: {
|
|
13
|
+
isFocused: boolean;
|
|
14
|
+
isOpened: boolean;
|
|
15
|
+
};
|
|
16
|
+
values: Array<string>;
|
|
17
|
+
open(): void;
|
|
18
|
+
close(): void;
|
|
19
|
+
toggle(): void;
|
|
20
|
+
handleFocus(e: any): void;
|
|
21
|
+
handleBlur(e: any): void;
|
|
22
|
+
handleChange(e: React.ChangeEvent<HTMLInputElement>): void;
|
|
23
|
+
getParent(): Element | Text | null;
|
|
24
|
+
getTarget(): HTMLElement;
|
|
25
|
+
handlePopOverChange(option: any): void;
|
|
26
|
+
renderGroup(option: any, index: number): JSX.Element;
|
|
27
|
+
renderOptions(options: Array<any>, index: number): JSX.Element[];
|
|
28
|
+
renderPopover(): JSX.Element;
|
|
29
|
+
render(): JSX.Element;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NodeWrapperProps } from './NodeWrapper';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Schema } from 'amis/lib/types';
|
|
4
|
+
export interface ContainerWrapperProps extends NodeWrapperProps {
|
|
5
|
+
}
|
|
6
|
+
export declare class ContainerWrapper extends React.Component<ContainerWrapperProps> {
|
|
7
|
+
ref: any;
|
|
8
|
+
getWrappedInstance(): any;
|
|
9
|
+
refFn(ref: any): void;
|
|
10
|
+
renderChild(region: string, node: Schema, props: any): JSX.Element;
|
|
11
|
+
render(): JSX.Element;
|
|
12
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { EditorStoreType } from '../store/editor';
|
|
3
|
+
import { SchemaObject } from 'amis/lib/Schema';
|
|
4
|
+
import { EditorManager, PluginClass } from '../manager';
|
|
5
|
+
import { RenderOptions } from 'amis';
|
|
6
|
+
import { PluginEventListener } from '../plugin';
|
|
7
|
+
import type { ActionConfigItemsMap, ActionTypeNode } from 'amis-editor-comp/dist/renderers/event-action';
|
|
8
|
+
export interface EditorProps extends PluginEventListener {
|
|
9
|
+
value: SchemaObject;
|
|
10
|
+
onChange: (value: SchemaObject) => void;
|
|
11
|
+
preview?: boolean;
|
|
12
|
+
isMobile?: boolean;
|
|
13
|
+
isSubEditor?: boolean;
|
|
14
|
+
autoFocus?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
$schemaUrl?: string;
|
|
17
|
+
schemas?: Array<any>;
|
|
18
|
+
theme?: string;
|
|
19
|
+
showCustomRenderersPanel?: boolean;
|
|
20
|
+
amisDocHost?: string;
|
|
21
|
+
withSuperDataSchema?: boolean;
|
|
22
|
+
dataBindingChange?: (value: string, data: any, manager?: EditorManager) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Preview 预览前可以修改配置。
|
|
25
|
+
* 比如把api地址替换成 proxy 地址。
|
|
26
|
+
*/
|
|
27
|
+
schemaFilter?: (schema: any) => any;
|
|
28
|
+
amisEnv?: RenderOptions;
|
|
29
|
+
/**
|
|
30
|
+
* 上下文数据,设置后,面板和脚手架表单里面可以取到这些值。
|
|
31
|
+
*/
|
|
32
|
+
ctx?: any;
|
|
33
|
+
data?: any;
|
|
34
|
+
/**
|
|
35
|
+
* 是否禁用内置插件
|
|
36
|
+
*/
|
|
37
|
+
disableBultinPlugin?: boolean;
|
|
38
|
+
plugins?: Array<PluginClass>;
|
|
39
|
+
/**
|
|
40
|
+
* 传给预览器的其他属性
|
|
41
|
+
*/
|
|
42
|
+
previewProps?: any;
|
|
43
|
+
iframeUrl?: string;
|
|
44
|
+
isHiddenProps?: (key: string) => boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 事件动作面板相关配置
|
|
47
|
+
*/
|
|
48
|
+
actionOptions?: {
|
|
49
|
+
/**
|
|
50
|
+
* 通用动作集(事件动作面板左侧动作树)
|
|
51
|
+
*/
|
|
52
|
+
actionTreeGetter?: (actionTree: ActionTypeNode[]) => ActionTypeNode[];
|
|
53
|
+
/**
|
|
54
|
+
* 自定义动作配置
|
|
55
|
+
*/
|
|
56
|
+
customActionGetter?: (manager: EditorManager) => ActionConfigItemsMap;
|
|
57
|
+
};
|
|
58
|
+
onUndo?: () => void;
|
|
59
|
+
onRedo?: () => void;
|
|
60
|
+
onSave?: () => void;
|
|
61
|
+
onPreview?: (preview: boolean) => void;
|
|
62
|
+
}
|
|
63
|
+
export default class Editor extends Component<EditorProps> {
|
|
64
|
+
readonly store: EditorStoreType;
|
|
65
|
+
readonly manager: EditorManager;
|
|
66
|
+
readonly mainRef: React.RefObject<HTMLDivElement>;
|
|
67
|
+
unReaction: () => void;
|
|
68
|
+
lastResult: any;
|
|
69
|
+
curCopySchemaId: any;
|
|
70
|
+
static defaultProps: {
|
|
71
|
+
autoFocus: boolean;
|
|
72
|
+
};
|
|
73
|
+
isInternalChange: boolean;
|
|
74
|
+
constructor(props: EditorProps);
|
|
75
|
+
componentDidMount(): void;
|
|
76
|
+
componentDidUpdate(prevProps: EditorProps): void;
|
|
77
|
+
componentWillUnmount(): void;
|
|
78
|
+
handleKeyDown(e: KeyboardEvent): void;
|
|
79
|
+
handleContextMenu(e: React.MouseEvent<HTMLElement>): void;
|
|
80
|
+
canUndo(): boolean;
|
|
81
|
+
canRedo(): boolean;
|
|
82
|
+
undo(): void;
|
|
83
|
+
redo(): void;
|
|
84
|
+
save(): void;
|
|
85
|
+
preview(): void;
|
|
86
|
+
/**
|
|
87
|
+
* 复制的内容以变量的形式存放
|
|
88
|
+
* 备注1: 系统的复制&粘贴需要开启https服务才有效,所有这里改用内存形式实现
|
|
89
|
+
* 备注2: 此方法不鞥实现跨页面复制&粘贴能力
|
|
90
|
+
* 备注3: 后续需要支持下跨页面跨浏览器复制&粘贴能力
|
|
91
|
+
*/
|
|
92
|
+
copy(): void;
|
|
93
|
+
/**
|
|
94
|
+
* 粘贴上一次复制的内容
|
|
95
|
+
*/
|
|
96
|
+
paste(): void;
|
|
97
|
+
getToolbarContainer(): HTMLDivElement | null;
|
|
98
|
+
render(): JSX.Element;
|
|
99
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditorStoreType } from '../store/editor';
|
|
3
|
+
import { EditorNodeType } from '../store/node';
|
|
4
|
+
import { EditorManager } from '../manager';
|
|
5
|
+
export interface HighlightBoxProps {
|
|
6
|
+
store: EditorStoreType;
|
|
7
|
+
node: EditorNodeType;
|
|
8
|
+
id: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
title: string;
|
|
11
|
+
toolbarContainer?: () => any;
|
|
12
|
+
onSwitch?: (id: string) => void;
|
|
13
|
+
manager: EditorManager;
|
|
14
|
+
}
|
|
15
|
+
export default class HighlightBox extends React.Component<HighlightBoxProps> {
|
|
16
|
+
mainRef: React.RefObject<HTMLDivElement>;
|
|
17
|
+
handleWResizerMouseDown(e: MouseEvent): void;
|
|
18
|
+
handleHResizerMouseDown(e: MouseEvent): void;
|
|
19
|
+
handleResizerMouseDown(e: MouseEvent): void;
|
|
20
|
+
startResize(e: MouseEvent, direction?: 'horizontal' | 'vertical' | 'both'): void;
|
|
21
|
+
wResizerDom: HTMLElement;
|
|
22
|
+
wResizerRef(ref: any): void;
|
|
23
|
+
hResizerDom: HTMLElement;
|
|
24
|
+
hResizerRef(ref: any): void;
|
|
25
|
+
resizerDom: HTMLElement;
|
|
26
|
+
resizerRef(ref: any): void;
|
|
27
|
+
handleMouseEnter(): void;
|
|
28
|
+
render(): JSX.Element;
|
|
29
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditorManager } from '../manager';
|
|
3
|
+
import { EditorStoreType } from '../store/editor';
|
|
4
|
+
export interface IFrameBridgeProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
url: string;
|
|
7
|
+
editable?: boolean;
|
|
8
|
+
isMobile?: boolean;
|
|
9
|
+
store: EditorStoreType;
|
|
10
|
+
manager: EditorManager;
|
|
11
|
+
theme?: string;
|
|
12
|
+
data?: any;
|
|
13
|
+
env?: any;
|
|
14
|
+
autoFocus?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface BridgeApi {
|
|
17
|
+
update: (props: any) => void;
|
|
18
|
+
}
|
|
19
|
+
export default class IFrameBridge extends React.PureComponent<IFrameBridgeProps> {
|
|
20
|
+
bridgeFnName: string;
|
|
21
|
+
bridge?: BridgeApi;
|
|
22
|
+
schema: any;
|
|
23
|
+
constructor(props: IFrameBridgeProps);
|
|
24
|
+
componentDidUpdate(): void;
|
|
25
|
+
componentWillUnmount(): void;
|
|
26
|
+
iframeRef(iframe: any): void;
|
|
27
|
+
update(props?: Readonly<IFrameBridgeProps> & Readonly<{
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
}>): void;
|
|
30
|
+
render(): JSX.Element;
|
|
31
|
+
}
|
|
32
|
+
export declare function mountInIframe(dom: HTMLElement, reactDom: any, envCreator?: any): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditorManager } from '../manager';
|
|
3
|
+
import { EditorStoreType } from '../store/editor';
|
|
4
|
+
import { RenderOptions } from 'amis-core';
|
|
5
|
+
import { Schema } from 'amis/lib/types';
|
|
6
|
+
import { RendererConfig } from 'amis-core/lib/factory';
|
|
7
|
+
export interface IFramePreviewProps {
|
|
8
|
+
className: string;
|
|
9
|
+
editable?: boolean;
|
|
10
|
+
isMobile?: boolean;
|
|
11
|
+
schema: any;
|
|
12
|
+
theme?: string;
|
|
13
|
+
store: EditorStoreType;
|
|
14
|
+
manager: EditorManager;
|
|
15
|
+
autoFocus?: boolean;
|
|
16
|
+
data?: any;
|
|
17
|
+
envCreator?: (props: IFramePreviewProps) => any;
|
|
18
|
+
}
|
|
19
|
+
export default class IFramePreview extends React.Component<IFramePreviewProps> {
|
|
20
|
+
env: RenderOptions;
|
|
21
|
+
componentDidMount(): void;
|
|
22
|
+
componentWillUnmount(): void;
|
|
23
|
+
dom?: HTMLElement;
|
|
24
|
+
unSensor?: () => void;
|
|
25
|
+
contentsRef(ref: HTMLDivElement | null): void;
|
|
26
|
+
syncIframeHeight(): void;
|
|
27
|
+
handleClick(e: MouseEvent): void;
|
|
28
|
+
handleMouseMove(e: MouseEvent): void;
|
|
29
|
+
handleMouseLeave(): void;
|
|
30
|
+
handeMouseOver(e: MouseEvent): void;
|
|
31
|
+
handleDragEnter(e: React.DragEvent): void;
|
|
32
|
+
handleDragLeave(e: React.DragEvent): void;
|
|
33
|
+
handleDragOver(e: React.DragEvent): void;
|
|
34
|
+
handleDrop(e: React.DragEvent): void;
|
|
35
|
+
handleContextMenu(e: React.MouseEvent<HTMLElement>): void;
|
|
36
|
+
rendererResolver(path: string, schema: Schema, props: any): RendererConfig;
|
|
37
|
+
render(): JSX.Element;
|
|
38
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import Editor, { EditorProps } from './Editor';
|
|
3
|
+
import { BaseEventContext, PluginEvent } from '../plugin';
|
|
4
|
+
export default class MiniEditor extends Editor {
|
|
5
|
+
constructor(props: EditorProps);
|
|
6
|
+
componentWillUnmount(): void;
|
|
7
|
+
buildPanels(event: PluginEvent<BaseEventContext>): void;
|
|
8
|
+
render(): JSX.Element;
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RendererProps } from 'amis-core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { RendererInfo } from '../plugin';
|
|
4
|
+
import { EditorNodeType } from '../store/node';
|
|
5
|
+
export interface NodeWrapperProps extends RendererProps {
|
|
6
|
+
$$editor: RendererInfo;
|
|
7
|
+
$$node?: EditorNodeType;
|
|
8
|
+
}
|
|
9
|
+
export declare class NodeWrapper extends React.Component<NodeWrapperProps> {
|
|
10
|
+
componentDidMount(): void;
|
|
11
|
+
componentDidUpdate(prevProps: NodeWrapperProps): void;
|
|
12
|
+
ref: any;
|
|
13
|
+
getWrappedInstance(): any;
|
|
14
|
+
refFn(ref: any): void;
|
|
15
|
+
/**
|
|
16
|
+
* 弄点标记
|
|
17
|
+
*/
|
|
18
|
+
markDom(id: string): void;
|
|
19
|
+
render(): any;
|
|
20
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface AMisCodeEditorProps {
|
|
4
|
+
value: any;
|
|
5
|
+
onChange: (value: any, diff: any) => void;
|
|
6
|
+
onPaste?: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
$schemaUrl?: string;
|
|
9
|
+
$schema?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
theme?: string;
|
|
12
|
+
}
|
|
13
|
+
export default class AMisCodeEditor extends React.Component<AMisCodeEditorProps> {
|
|
14
|
+
state: {
|
|
15
|
+
wrongSchema: string;
|
|
16
|
+
value: any;
|
|
17
|
+
contents: any;
|
|
18
|
+
};
|
|
19
|
+
lastResult: any;
|
|
20
|
+
toDispose: Array<() => void>;
|
|
21
|
+
editor: any;
|
|
22
|
+
monaco: any;
|
|
23
|
+
model: any;
|
|
24
|
+
decorations: any;
|
|
25
|
+
uri: string;
|
|
26
|
+
componentDidUpdate(prevProps: AMisCodeEditorProps): void;
|
|
27
|
+
obj2str(value: any, props: AMisCodeEditorProps): any;
|
|
28
|
+
str2obj(str: string): any;
|
|
29
|
+
emitChange: import("lodash").DebouncedFunc<() => void>;
|
|
30
|
+
changeJsonOptions(props?: AMisCodeEditorProps): void;
|
|
31
|
+
editorFactory: (containerElement: HTMLElement, monaco: any, options: any) => any;
|
|
32
|
+
editorDidMount: (editor: any, monaco: any) => void;
|
|
33
|
+
editorWillUnmount: (editor: any, monaco: any) => void;
|
|
34
|
+
handleChange: (value: string) => void;
|
|
35
|
+
handleBlur: () => Promise<void>;
|
|
36
|
+
render(): JSX.Element;
|
|
37
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PanelProps } from '../../plugin';
|
|
3
|
+
declare type PanelStates = {
|
|
4
|
+
toggleCollapseFolderStatus: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare class AvailableRenderersPanel extends React.Component<PanelProps, PanelStates> {
|
|
7
|
+
handleSelect(key: string): void;
|
|
8
|
+
render(): JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditorStoreType } from '../../store/editor';
|
|
3
|
+
export interface ContextMenuPanelProps {
|
|
4
|
+
store: EditorStoreType;
|
|
5
|
+
}
|
|
6
|
+
export declare class ContextMenuPanel extends React.Component<ContextMenuPanelProps> {
|
|
7
|
+
render(): JSX.Element | null;
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditorManager } from '../../manager';
|
|
3
|
+
import { EditorStoreType } from '../../store/editor';
|
|
4
|
+
import { EditorNodeType } from '../../store/node';
|
|
5
|
+
export interface PanelsProps {
|
|
6
|
+
store: EditorStoreType;
|
|
7
|
+
manager: EditorManager;
|
|
8
|
+
node: EditorNodeType | undefined;
|
|
9
|
+
panelItem: any;
|
|
10
|
+
theme?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class DrawerPanel extends React.Component<PanelsProps> {
|
|
13
|
+
getPopOverContainer(): HTMLElement;
|
|
14
|
+
render(): JSX.Element;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditorManager } from '../../manager';
|
|
3
|
+
import { EditorStoreType } from '../../store/editor';
|
|
4
|
+
import { EditorNodeType } from '../../store/node';
|
|
5
|
+
export interface PanelsProps {
|
|
6
|
+
store: EditorStoreType;
|
|
7
|
+
manager: EditorManager;
|
|
8
|
+
node: EditorNodeType | undefined;
|
|
9
|
+
panelItem: any;
|
|
10
|
+
theme?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class DrawerRendererPanel extends React.Component<PanelsProps> {
|
|
13
|
+
getPopOverContainer(): HTMLElement;
|
|
14
|
+
render(): JSX.Element;
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PanelProps } from '../../plugin';
|
|
3
|
+
export declare class InsertSubRendererPanel extends React.Component<PanelProps> {
|
|
4
|
+
handleLeftClick(e: React.MouseEvent): void;
|
|
5
|
+
handleClick(e: React.MouseEvent): void;
|
|
6
|
+
hadnlDBClick(e: React.MouseEvent): void;
|
|
7
|
+
handleInsert(): void;
|
|
8
|
+
handleReplace(): void;
|
|
9
|
+
handleCancel(): void;
|
|
10
|
+
render(): JSX.Element;
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditorManager } from '../../manager';
|
|
3
|
+
import { EditorStoreType } from '../../store/editor';
|
|
4
|
+
interface LeftPanelsProps {
|
|
5
|
+
store: EditorStoreType;
|
|
6
|
+
manager: EditorManager;
|
|
7
|
+
theme?: string;
|
|
8
|
+
}
|
|
9
|
+
interface LeftPanelsStates {
|
|
10
|
+
isFixedStatus: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare class LeftPanels extends React.Component<LeftPanelsProps, LeftPanelsStates> {
|
|
13
|
+
constructor(props: any);
|
|
14
|
+
handleHidden(): void;
|
|
15
|
+
handleFixed(): void;
|
|
16
|
+
handleSelect(key: string): void;
|
|
17
|
+
getPopOverContainer(): HTMLElement;
|
|
18
|
+
render(): JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PanelProps } from '../../plugin';
|
|
3
|
+
import { EditorNodeType } from '../../store/node';
|
|
4
|
+
export declare class OutlinePanel extends React.Component<PanelProps> {
|
|
5
|
+
state: {
|
|
6
|
+
curSearchElemKey: string;
|
|
7
|
+
};
|
|
8
|
+
handleClick(e: React.MouseEvent<HTMLAnchorElement>): void;
|
|
9
|
+
handleEnter(e: React.MouseEvent): void;
|
|
10
|
+
handleDragStart(e: React.DragEvent): void;
|
|
11
|
+
handleDragOver(e: React.DragEvent): void;
|
|
12
|
+
handleDrop(e: React.DragEvent): void;
|
|
13
|
+
handleSearchElemKeyChange(searchVal: string): void;
|
|
14
|
+
clearSearchElemKey(): void;
|
|
15
|
+
renderTitleByKeyword(rendererTitle: string, curSearchTitle: string): string | JSX.Element;
|
|
16
|
+
renderItem(option: EditorNodeType, index: number): JSX.Element | null;
|
|
17
|
+
render(): JSX.Element;
|
|
18
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditorStoreType } from '../../store/editor';
|
|
3
|
+
import { EditorManager } from '../../manager';
|
|
4
|
+
import { SubRendererInfo } from '../../plugin';
|
|
5
|
+
declare type PanelProps = {
|
|
6
|
+
store: EditorStoreType;
|
|
7
|
+
manager: EditorManager;
|
|
8
|
+
groupedRenderers: {
|
|
9
|
+
[propName: string]: Array<SubRendererInfo>;
|
|
10
|
+
};
|
|
11
|
+
searchRendererType: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
declare type PanelStates = {
|
|
15
|
+
toggleCollapseFolderStatus: boolean;
|
|
16
|
+
};
|
|
17
|
+
export default class RenderersPanel extends React.Component<PanelProps, PanelStates> {
|
|
18
|
+
state: {
|
|
19
|
+
toggleCollapseFolderStatus: boolean;
|
|
20
|
+
};
|
|
21
|
+
curCollapseFolded: {
|
|
22
|
+
[propName: string]: boolean;
|
|
23
|
+
};
|
|
24
|
+
handleRegionFilterClick(e: React.MouseEvent): void;
|
|
25
|
+
handleDragStart(e: React.DragEvent): void;
|
|
26
|
+
handleClick(e: React.MouseEvent): void;
|
|
27
|
+
changeCollapseFoldStatus(tagKey: string, event: any): void;
|
|
28
|
+
renderThumb(schema: any): JSX.Element;
|
|
29
|
+
render(): JSX.Element;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditorManager } from '../../manager';
|
|
3
|
+
import { EditorStoreType } from '../../store/editor';
|
|
4
|
+
interface RightPanelsProps {
|
|
5
|
+
store: EditorStoreType;
|
|
6
|
+
manager: EditorManager;
|
|
7
|
+
theme?: string;
|
|
8
|
+
}
|
|
9
|
+
interface RightPanelsStates {
|
|
10
|
+
isOpenStatus: boolean;
|
|
11
|
+
isFixedStatus: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare class RightPanels extends React.Component<RightPanelsProps, RightPanelsStates> {
|
|
14
|
+
constructor(props: any);
|
|
15
|
+
handleFixed(): void;
|
|
16
|
+
handleSelect(key: string): void;
|
|
17
|
+
handleHidden(): void;
|
|
18
|
+
getPopOverContainer(): HTMLElement;
|
|
19
|
+
render(): JSX.Element | null;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PanelProps } from '../../plugin';
|
|
3
|
+
export declare class TargetNamePanel extends React.Component<PanelProps> {
|
|
4
|
+
handleClick(e: React.MouseEvent<HTMLElement>): void;
|
|
5
|
+
handleEnter(e: React.MouseEvent<HTMLElement>): void;
|
|
6
|
+
render(): JSX.Element;
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditorManager } from '../manager';
|
|
3
|
+
import { EditorStoreType } from '../store/editor';
|
|
4
|
+
export interface PopOverFormProps {
|
|
5
|
+
store: EditorStoreType;
|
|
6
|
+
manager: EditorManager;
|
|
7
|
+
theme?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class PopOverForm extends React.Component<PopOverFormProps> {
|
|
10
|
+
overlay: React.RefObject<any>;
|
|
11
|
+
buildSchema(): {
|
|
12
|
+
type: string;
|
|
13
|
+
wrapWithPanel: boolean;
|
|
14
|
+
mode: string;
|
|
15
|
+
wrapperComponent: string;
|
|
16
|
+
body: any[];
|
|
17
|
+
submitOnChange: boolean;
|
|
18
|
+
autoFocus: boolean;
|
|
19
|
+
onFinished: (newValue: any) => void;
|
|
20
|
+
};
|
|
21
|
+
render(): JSX.Element;
|
|
22
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { RenderOptions } from 'amis-core';
|
|
3
|
+
import { Schema } from 'amis/lib/types';
|
|
4
|
+
import { EditorStoreType } from '../store/editor';
|
|
5
|
+
import { EditorManager } from '../manager';
|
|
6
|
+
import { RendererConfig } from 'amis-core/lib/factory';
|
|
7
|
+
export interface PreviewProps {
|
|
8
|
+
theme?: string;
|
|
9
|
+
amisEnv?: any;
|
|
10
|
+
className?: string;
|
|
11
|
+
editable?: boolean;
|
|
12
|
+
isMobile?: boolean;
|
|
13
|
+
store: EditorStoreType;
|
|
14
|
+
manager: EditorManager;
|
|
15
|
+
data?: any;
|
|
16
|
+
iframeUrl?: string;
|
|
17
|
+
autoFocus?: boolean;
|
|
18
|
+
toolbarContainer?: () => any;
|
|
19
|
+
}
|
|
20
|
+
export interface PreviewState {
|
|
21
|
+
ready?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export default class Preview extends Component<PreviewProps> {
|
|
24
|
+
currentDom: HTMLElement;
|
|
25
|
+
env: RenderOptions;
|
|
26
|
+
doingSelection: boolean;
|
|
27
|
+
componentDidMount(): void;
|
|
28
|
+
componentWillUnmount(): void;
|
|
29
|
+
unSensor?: () => void;
|
|
30
|
+
layer?: HTMLDivElement;
|
|
31
|
+
contentsRef(ref: HTMLDivElement | null): void;
|
|
32
|
+
readonly unReaction: () => void;
|
|
33
|
+
handlePanelChange(): void;
|
|
34
|
+
getHighlightNodes(): string[];
|
|
35
|
+
calculateHighlightBox(ids: Array<string>): void;
|
|
36
|
+
handeMouseDown(e: MouseEvent): void;
|
|
37
|
+
/** 拖拽多选 */
|
|
38
|
+
doSelection(rect: {
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
w: number;
|
|
42
|
+
h: number;
|
|
43
|
+
}): void;
|
|
44
|
+
handleClick(e: MouseEvent): void;
|
|
45
|
+
handleNavSwitch(id: string): void;
|
|
46
|
+
handleMouseMove(e: MouseEvent): void;
|
|
47
|
+
handleMouseLeave(): void;
|
|
48
|
+
handeMouseOver(e: MouseEvent): void;
|
|
49
|
+
handleDragEnter(e: React.DragEvent): void;
|
|
50
|
+
handleDragLeave(e: React.DragEvent): void;
|
|
51
|
+
handleDragOver(e: React.DragEvent): void;
|
|
52
|
+
handleDrop(e: React.DragEvent): void;
|
|
53
|
+
getCurrentTarget(): HTMLDivElement;
|
|
54
|
+
rendererResolver(path: string, schema: Schema, props: any): RendererConfig;
|
|
55
|
+
render(): JSX.Element;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 这个用了 observer,所以能最小程度的刷新,数据不变按理是不会刷新的。
|
|
59
|
+
*/
|
|
60
|
+
export interface SmartPreviewProps {
|
|
61
|
+
editable?: boolean;
|
|
62
|
+
autoFocus?: boolean;
|
|
63
|
+
store: EditorStoreType;
|
|
64
|
+
env: any;
|
|
65
|
+
data?: any;
|
|
66
|
+
manager: EditorManager;
|
|
67
|
+
}
|