amis-editor 4.1.0-beta.28 → 4.2.0-beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. package/dist/component/ClassNameControl.d.ts +1 -1
  2. package/dist/component/Control/APIControl.d.ts +2 -2
  3. package/dist/component/Control/OptionControl.d.ts +3 -3
  4. package/dist/component/Control/PopoverEdit.d.ts +4 -4
  5. package/dist/component/Control/ValidationControl.d.ts +1 -1
  6. package/dist/component/Editor.d.ts +1 -1
  7. package/dist/component/IFramePreview.d.ts +2 -1
  8. package/dist/component/NodeWrapper.d.ts +1 -1
  9. package/dist/component/Preview.d.ts +2 -1
  10. package/dist/component/base/InputComponentName.d.ts +1 -1
  11. package/dist/component/base/ShortcutKey.d.ts +23 -0
  12. package/dist/env.d.ts +1 -1
  13. package/dist/exports.min.js +1 -1
  14. package/dist/index.d.ts +2 -1
  15. package/dist/index.min.js +1 -1
  16. package/dist/manager.d.ts +3 -2
  17. package/dist/plugin/Alert.d.ts +1 -1
  18. package/dist/plugin/Button.d.ts +1 -1
  19. package/dist/plugin/Dialog.d.ts +1 -1
  20. package/dist/plugin/Drawer.d.ts +1 -1
  21. package/dist/plugin/Form/Formula.d.ts +3 -3
  22. package/dist/plugin/IFrame.d.ts +3 -3
  23. package/dist/plugin/Page.d.ts +1 -1
  24. package/dist/plugin/Table.d.ts +1 -1
  25. package/dist/plugin.d.ts +3 -3
  26. package/dist/store/editor.d.ts +27 -9
  27. package/dist/style.css +1 -1
  28. package/dist/util.d.ts +1 -1
  29. package/package.json +5 -3
  30. package/src/plugin/Alert.tsx +1 -1
  31. package/src/plugin/AnchorNav.tsx +1 -1
  32. package/src/plugin/Audio.tsx +1 -8
  33. package/src/plugin/Button.tsx +2 -4
  34. package/src/plugin/ButtonGroup.tsx +3 -6
  35. package/src/plugin/ButtonToolbar.tsx +4 -6
  36. package/src/plugin/CRUD.tsx +4 -4
  37. package/src/plugin/Card.tsx +1 -1
  38. package/src/plugin/Cards.tsx +1 -1
  39. package/src/plugin/Carousel.tsx +3 -12
  40. package/src/plugin/Chart.tsx +1 -1
  41. package/src/plugin/Collapse.tsx +1 -8
  42. package/src/plugin/Container.tsx +2 -6
  43. package/src/plugin/Date.tsx +1 -8
  44. package/src/plugin/Datetime.tsx +1 -8
  45. package/src/plugin/Dialog.tsx +2 -4
  46. package/src/plugin/Drawer.tsx +3 -6
  47. package/src/plugin/DropDownButton.tsx +2 -4
  48. package/src/plugin/Each.tsx +2 -7
  49. package/src/plugin/Flex.tsx +4 -9
  50. package/src/plugin/Form/ButtonGroupSelect.tsx +2 -13
  51. package/src/plugin/Form/ButtonToolbar.tsx +2 -13
  52. package/src/plugin/Form/CodeEditor.tsx +2 -12
  53. package/src/plugin/Form/Combo.tsx +1 -1
  54. package/src/plugin/Form/ConditionBuilder.tsx +4 -13
  55. package/src/plugin/Form/DiffEditor.tsx +1 -7
  56. package/src/plugin/Form/FieldSet.tsx +3 -15
  57. package/src/plugin/Form/Form.tsx +1 -6
  58. package/src/plugin/Form/Formula.tsx +2 -14
  59. package/src/plugin/Form/Group.tsx +2 -7
  60. package/src/plugin/Form/Hidden.tsx +1 -13
  61. package/src/plugin/Form/InputFile.tsx +1 -8
  62. package/src/plugin/Form/InputGroup.tsx +4 -13
  63. package/src/plugin/Form/InputImage.tsx +2 -13
  64. package/src/plugin/Form/InputNumber.tsx +2 -10
  65. package/src/plugin/Form/InputRepeat.tsx +5 -17
  66. package/src/plugin/Form/InputRichText.tsx +2 -13
  67. package/src/plugin/Form/InputSubForm.tsx +2 -11
  68. package/src/plugin/Form/InputTable.tsx +1 -1
  69. package/src/plugin/Form/InputTag.tsx +2 -13
  70. package/src/plugin/Form/InputTime.tsx +2 -12
  71. package/src/plugin/Form/InputTree.tsx +2 -13
  72. package/src/plugin/Form/ListSelect.tsx +2 -13
  73. package/src/plugin/Form/LocationPicker.tsx +1 -14
  74. package/src/plugin/Form/MatrixCheckboxes.tsx +2 -13
  75. package/src/plugin/Form/NestedSelect.tsx +2 -13
  76. package/src/plugin/Form/Picker.tsx +2 -10
  77. package/src/plugin/Form/Radios.tsx +2 -13
  78. package/src/plugin/Form/Static.tsx +2 -15
  79. package/src/plugin/Form/Switch.tsx +2 -13
  80. package/src/plugin/Form/TabsTransfer.tsx +2 -13
  81. package/src/plugin/Form/Textarea.tsx +2 -13
  82. package/src/plugin/Form/Transfer.tsx +2 -13
  83. package/src/plugin/Grid.tsx +1 -2
  84. package/src/plugin/IFrame.tsx +1 -3
  85. package/src/plugin/Image.tsx +0 -4
  86. package/src/plugin/Images.tsx +1 -8
  87. package/src/plugin/Json.tsx +1 -8
  88. package/src/plugin/Link.tsx +2 -4
  89. package/src/plugin/List.tsx +1 -4
  90. package/src/plugin/ListItem.tsx +0 -4
  91. package/src/plugin/Mapping.tsx +1 -8
  92. package/src/plugin/Nav.tsx +2 -4
  93. package/src/plugin/Operation.tsx +2 -4
  94. package/src/plugin/Others/Action.tsx +2 -4
  95. package/src/plugin/Others/BasicToolbar.tsx +2 -8
  96. package/src/plugin/Others/TableCell.tsx +1 -1
  97. package/src/plugin/Page.tsx +1 -3
  98. package/src/plugin/Panel.tsx +1 -1
  99. package/src/plugin/Plain.tsx +1 -8
  100. package/src/plugin/Progress.tsx +1 -8
  101. package/src/plugin/QRCode.tsx +1 -3
  102. package/src/plugin/Service.tsx +3 -8
  103. package/src/plugin/Status.tsx +1 -3
  104. package/src/plugin/Steps.tsx +2 -14
  105. package/src/plugin/Table.tsx +4 -16
  106. package/src/plugin/TableView.tsx +2 -4
  107. package/src/plugin/Tabs.tsx +0 -2
  108. package/src/plugin/Tasks.tsx +1 -3
  109. package/src/plugin/Time.tsx +1 -8
  110. package/src/plugin/Tpl.tsx +1 -5
  111. package/src/plugin/Video.tsx +2 -4
  112. package/src/plugin/WebComponent.tsx +1 -4
  113. package/src/plugin/Wizard.tsx +1 -4
  114. package/src/plugin/Wrapper.tsx +1 -1
  115. package/src/plugin.ts +5 -4
@@ -1,12 +1,5 @@
1
- import {Button, SchemaObject} from 'amis';
2
- import React from 'react';
3
1
  import {registerEditorPlugin} from '../manager';
4
- import {
5
- BaseEventContext,
6
- BasePlugin,
7
- RegionConfig,
8
- RendererInfo
9
- } from '../plugin';
2
+ import {BaseEventContext, BasePlugin} from '../plugin';
10
3
  import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
11
4
 
12
5
  export class ProgressPlugin extends BasePlugin {
@@ -1,7 +1,5 @@
1
- import {Button, SchemaObject} from 'amis';
2
- import React from 'react';
3
1
  import {registerEditorPlugin} from '../manager';
4
- import {BasePlugin, RegionConfig, RendererInfo} from '../plugin';
2
+ import {BasePlugin} from '../plugin';
5
3
  import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
6
4
 
7
5
  export class QRCodePlugin extends BasePlugin {
@@ -1,13 +1,8 @@
1
- import {Button, SchemaObject} from 'amis';
1
+ import {Button} from 'amis';
2
2
  import React from 'react';
3
3
  import {registerEditorPlugin} from '../manager';
4
- import {
5
- BaseEventContext,
6
- BasePlugin,
7
- RegionConfig,
8
- RendererInfo
9
- } from '../plugin';
10
- import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
4
+ import {BaseEventContext, BasePlugin, RegionConfig} from '../plugin';
5
+ import {getSchemaTpl} from '../component/schemaTpl';
11
6
 
12
7
  export class ServicePlugin extends BasePlugin {
13
8
  // 关联渲染器名字
@@ -1,7 +1,5 @@
1
- import {Button, SchemaObject} from 'amis';
2
- import React from 'react';
3
1
  import {registerEditorPlugin} from '../manager';
4
- import {BasePlugin, BaseEventContext, RendererInfo} from '../plugin';
2
+ import {BasePlugin, BaseEventContext} from '../plugin';
5
3
  import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
6
4
 
7
5
  export class StatusPlugin extends BasePlugin {
@@ -1,21 +1,9 @@
1
1
  /**
2
2
  * @file Steps 步骤条
3
3
  */
4
- import {Button, SchemaObject} from 'amis';
5
- import React from 'react';
6
4
  import {registerEditorPlugin} from '../manager';
7
- import {
8
- BaseEventContext,
9
- BasePlugin,
10
- BasicPanelItem,
11
- PluginEvent,
12
- RegionConfig,
13
- RendererInfo,
14
- RendererJSONSchemaResolveEventContext,
15
- VRendererConfig
16
- } from '../plugin';
17
- import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
18
- import {EditorNodeType} from '../store/node';
5
+ import {BasePlugin} from '../plugin';
6
+ import {getSchemaTpl} from '../component/schemaTpl';
19
7
 
20
8
  export class StepsPlugin extends BasePlugin {
21
9
  // 关联渲染器名字
@@ -1,22 +1,10 @@
1
- import {
2
- Button,
3
- resolveVariable,
4
- resolveVariableAndFilter,
5
- SchemaObject
6
- } from 'amis';
7
- import {RendererConfig} from 'amis/lib/factory';
8
- import flatten from 'lodash/flatten';
9
- import React from 'react';
10
- import {ContainerWrapper} from '../component/ContainerWrapper';
1
+ import {resolveVariable} from 'amis';
11
2
  import {registerEditorPlugin} from '../manager';
12
3
  import {
13
4
  BasePlugin,
14
- ChangeEventContext,
15
5
  BaseEventContext,
16
- BasicPanelItem,
17
6
  PluginEvent,
18
7
  RegionConfig,
19
- RendererJSONSchemaResolveEventContext,
20
8
  RendererInfoResolveEventContext,
21
9
  BasicRendererInfo,
22
10
  PluginInterface,
@@ -24,10 +12,10 @@ import {
24
12
  ScaffoldForm
25
13
  } from '../plugin';
26
14
  import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
27
- import {isObject, JSONPipeIn, repeatArray} from '../util';
28
- import {IColumn} from 'amis/lib/store/table';
29
- import {setVariable} from 'amis/lib/utils/helper';
15
+ import {repeatArray} from '../util';
16
+ import {setVariable} from 'amis-core';
30
17
  import {mockValue} from '../mocker';
18
+ import {SchemaObject} from 'amis/lib/Schema';
31
19
 
32
20
  export class TablePlugin extends BasePlugin {
33
21
  // 关联渲染器名字
@@ -2,7 +2,6 @@
2
2
  * @file table view 组件的可视化编辑
3
3
  */
4
4
 
5
- import {Button} from 'amis';
6
5
  import React from 'react';
7
6
  import {registerEditorPlugin} from '../manager';
8
7
  import {
@@ -18,9 +17,8 @@ import {
18
17
  import {getSchemaTpl} from '../component/schemaTpl';
19
18
  import {VRenderer} from '../component/VRenderer';
20
19
  import {TableViewEditor} from '../component/TableViewEditor';
21
- import {TableViewSchema, TdObject} from 'amis/lib/renderers/TableView';
22
- import {JSONGetById, JSONPipeOut} from '../util';
23
- import {RegionWrapper as Region} from '../component/RegionWrapper';
20
+ import {TableViewSchema} from 'amis/lib/renderers/TableView';
21
+ import {JSONGetById} from '../util';
24
22
 
25
23
  /**
26
24
  * 尚未实现的功能:
@@ -1,4 +1,3 @@
1
- import {Button, SchemaObject} from 'amis';
2
1
  import React from 'react';
3
2
  import {registerEditorPlugin} from '../manager';
4
3
  import {
@@ -7,7 +6,6 @@ import {
7
6
  BasicToolbarItem,
8
7
  PluginEvent,
9
8
  PreventClickEventContext,
10
- RegionConfig,
11
9
  RendererInfo,
12
10
  VRendererConfig
13
11
  } from '../plugin';
@@ -1,7 +1,5 @@
1
- import {Button, SchemaObject} from 'amis';
2
- import React from 'react';
3
1
  import {registerEditorPlugin} from '../manager';
4
- import {BasePlugin, RegionConfig, RendererInfo} from '../plugin';
2
+ import {BasePlugin} from '../plugin';
5
3
  import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
6
4
 
7
5
  export class TasksPlugin extends BasePlugin {
@@ -1,12 +1,5 @@
1
- import {Button, SchemaObject} from 'amis';
2
- import React from 'react';
3
1
  import {registerEditorPlugin} from '../manager';
4
- import {
5
- BaseEventContext,
6
- BasePlugin,
7
- RegionConfig,
8
- RendererInfo
9
- } from '../plugin';
2
+ import {BaseEventContext} from '../plugin';
10
3
  import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
11
4
  import {DatePlugin} from './Date';
12
5
 
@@ -1,11 +1,7 @@
1
- import {SchemaObject} from 'amis';
2
1
  import {registerEditorPlugin} from '../manager';
3
2
  import {
4
3
  BaseEventContext,
5
- BasePlugin,
6
- RegionConfig,
7
- RendererInfo
8
- } from '../plugin';
4
+ BasePlugin} from '../plugin';
9
5
  import {defaultValue, getSchemaTpl, setSchemaTpl} from '../component/schemaTpl';
10
6
 
11
7
  setSchemaTpl('tpl:content', {
@@ -1,8 +1,6 @@
1
- import {Button, SchemaObject} from 'amis';
2
- import React from 'react';
3
1
  import {registerEditorPlugin} from '../manager';
4
- import {BasePlugin, RegionConfig, RendererInfo} from '../plugin';
5
- import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
2
+ import {BasePlugin} from '../plugin';
3
+ import {getSchemaTpl} from '../component/schemaTpl';
6
4
  import {JSONPipeOut} from '../util';
7
5
  import {mockValue} from '../mocker';
8
6
 
@@ -1,8 +1,5 @@
1
- import {Button, SchemaObject, utils} from 'amis';
2
- import React from 'react';
3
1
  import {registerEditorPlugin} from '../manager';
4
- import {BasePlugin, RegionConfig, RendererInfo} from '../plugin';
5
- import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
2
+ import {BasePlugin} from '../plugin';
6
3
  import '@webcomponents/webcomponentsjs/custom-elements-es5-adapter';
7
4
 
8
5
  // 需要一个示例,不然默认的没有高度都无法选中
@@ -1,11 +1,8 @@
1
- import {SchemaObject} from 'amis';
2
- import {RendererConfig} from 'amis/lib/factory';
3
1
  import {registerEditorPlugin} from '../manager';
4
2
  import {
5
3
  BaseEventContext,
6
4
  BasePlugin,
7
5
  BasicToolbarItem,
8
- RegionConfig,
9
6
  RendererInfo,
10
7
  VRendererConfig
11
8
  } from '../plugin';
@@ -37,7 +34,7 @@ export class WizardPlugin extends BasePlugin {
37
34
  {
38
35
  type: 'input-text',
39
36
  label: '文本',
40
- name: 'var1',
37
+ name: 'var1'
41
38
  }
42
39
  ]
43
40
  },
@@ -1,4 +1,4 @@
1
- import {Button, SchemaObject} from 'amis';
1
+ import {Button} from 'amis';
2
2
  import React from 'react';
3
3
  import {registerEditorPlugin} from '../manager';
4
4
  import {BasePlugin, RegionConfig, RendererInfo} from '../plugin';
package/src/plugin.ts CHANGED
@@ -1,9 +1,7 @@
1
1
  /**
2
2
  * @file 定义插件的 interface,以及提供一个 BasePlugin 基类,把一些通用的方法放在这。
3
3
  */
4
- import {BaseSchema, SchemaObject} from 'amis';
5
- import {MenuDivider, MenuItem} from 'amis/lib/components/ContextMenu';
6
- import {RendererConfig} from 'amis/lib/factory';
4
+
7
5
  import {RegionWrapperProps} from './component/RegionWrapper';
8
6
  import {EditorManager} from './manager';
9
7
  import {EditorStoreType} from './store/editor';
@@ -13,6 +11,9 @@ import {EditorDNDManager} from './dnd';
13
11
  import React from 'react';
14
12
  import {DiffChange} from './util';
15
13
  import find from 'lodash/find';
14
+ import type {RendererConfig} from 'amis-core/lib/factory';
15
+ import type {MenuDivider, MenuItem} from 'amis-ui/lib/components/ContextMenu';
16
+ import type {BaseSchema} from 'amis/lib/Schema';
16
17
 
17
18
  /**
18
19
  * 区域的定义,容器渲染器都需要定义区域信息。
@@ -412,7 +413,7 @@ export interface PanelItem {
412
413
  component?: React.ComponentType<PanelProps | any>;
413
414
  order: number;
414
415
  position?: 'left' | 'right';
415
- render?:(props: PanelProps) => JSX.Element;
416
+ render?: (props: PanelProps) => JSX.Element;
416
417
  menus?: Array<any>;
417
418
  }
418
419