@chamn/engine 0.0.10 → 0.0.12
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/dist/component/CustomSchemaForm/components/Form/context.d.ts +2 -0
- package/dist/component/CustomSchemaForm/components/Form/index.d.ts +1 -0
- package/dist/component/CustomSchemaForm/components/SetterSwitcher/index.d.ts +2 -0
- package/dist/component/CustomSchemaForm/index.d.ts +3 -0
- package/dist/component/Workbench/index.d.ts +4 -0
- package/dist/core/pluginManager.d.ts +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +197 -0
- package/dist/index.js.map +1 -0
- package/dist/{index.es.js → index.mjs} +3849 -3814
- package/dist/index.mjs.map +1 -0
- package/dist/material/innerMaterial.d.ts +1 -1
- package/dist/plugins/RightPanel/view.d.ts +4 -0
- package/package.json +12 -9
- package/.eslintignore +0 -1
- package/.eslintrc.js +0 -36
- package/.prettierrc.json +0 -7
- package/.storybook/main.js +0 -24
- package/.storybook/preview.js +0 -9
- package/CHANGELOG.md +0 -54
- package/__tests__/demo.test.ts +0 -3
- package/build.config.js +0 -88
- package/dist/index.cjs.js +0 -197
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.es.js.map +0 -1
- package/index.html +0 -16
- package/jest.config.js +0 -196
- package/public/Engine.module.scss.d.ts +0 -5
- package/public/_dev_/render.d.ts +0 -2
- package/public/component/CSSEditor/style.module.scss.d.ts +0 -6
- package/public/component/CSSPropertiesEditor/style.module.scss.d.ts +0 -15
- package/public/component/CSSPropertiesVariableBindEditor/style.module.scss.d.ts +0 -15
- package/public/component/CustomSchemaForm/components/Form/Field/style.module.scss.d.ts +0 -8
- package/public/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss.d.ts +0 -7
- package/public/component/CustomSchemaForm/components/Setters/ArraySetter/style.module.scss.d.ts +0 -7
- package/public/component/CustomSchemaForm/components/Setters/CSSValueSetter/style.module.scss.d.ts +0 -6
- package/public/component/CustomSchemaForm/style.module.scss.d.ts +0 -11
- package/public/component/Workbench/style.module.scss.d.ts +0 -25
- package/public/plugins/AdvancePanel/style.module.scss.d.ts +0 -7
- package/public/plugins/ComponentLibrary/components/DragItem/style.module.scss.d.ts +0 -9
- package/public/plugins/ComponentLibrary/components/ListView/style.module.scss.d.ts +0 -12
- package/public/plugins/ComponentLibrary/style.module.scss.d.ts +0 -11
- package/public/plugins/Designer/components/DefaultSelectToolBar/style.module.scss.d.ts +0 -11
- package/public/plugins/Designer/style.module.scss.d.ts +0 -5
- package/public/plugins/GlobalStatePanel/style.module.scss.d.ts +0 -5
- package/public/plugins/OutlineTree/components/TreeView/style.module.scss.d.ts +0 -16
- package/public/plugins/PropertyPanel/style.module.scss.d.ts +0 -10
- package/public/plugins/RightPanel/style.module.scss.d.ts +0 -10
- package/public/plugins/VisualPanelPlus/style.module.scss.d.ts +0 -10
- package/public/render.umd.js +0 -42
- package/public/render.umd.js.map +0 -1
- package/src/Engine.module.scss +0 -10
- package/src/Engine.module.scss.d.ts +0 -5
- package/src/_dev_/index.css +0 -22
- package/src/_dev_/index.tsx +0 -5
- package/src/_dev_/page/Editor/index.tsx +0 -198
- package/src/_dev_/page/Editor/indexCustom.tsx +0 -274
- package/src/_dev_/page/Preview/index.tsx +0 -56
- package/src/_dev_/render.ts +0 -3
- package/src/_dev_/router.tsx +0 -14
- package/src/assets/react.svg +0 -4
- package/src/assets/styles/mixin.scss +0 -15
- package/src/component/CSSEditor/index.tsx +0 -247
- package/src/component/CSSEditor/style.module.scss +0 -22
- package/src/component/CSSEditor/style.module.scss.d.ts +0 -6
- package/src/component/CSSPropertiesEditor/cssProperties.ts +0 -1062
- package/src/component/CSSPropertiesEditor/index.tsx +0 -389
- package/src/component/CSSPropertiesEditor/style.module.scss +0 -46
- package/src/component/CSSPropertiesEditor/style.module.scss.d.ts +0 -15
- package/src/component/CSSPropertiesEditor/util.ts +0 -19
- package/src/component/CSSPropertiesVariableBindEditor/cssProperties.ts +0 -782
- package/src/component/CSSPropertiesVariableBindEditor/index.tsx +0 -366
- package/src/component/CSSPropertiesVariableBindEditor/style.module.scss +0 -48
- package/src/component/CSSPropertiesVariableBindEditor/style.module.scss.d.ts +0 -15
- package/src/component/CSSPropertiesVariableBindEditor/util.ts +0 -19
- package/src/component/ClassNameEditor/index.tsx +0 -91
- package/src/component/ClassNameEditor/style.module.scss +0 -0
- package/src/component/CustomSchemaForm/components/Form/Field/index.tsx +0 -81
- package/src/component/CustomSchemaForm/components/Form/Field/style.module.scss +0 -32
- package/src/component/CustomSchemaForm/components/Form/Field/style.module.scss.d.ts +0 -8
- package/src/component/CustomSchemaForm/components/Form/context.ts +0 -23
- package/src/component/CustomSchemaForm/components/Form/index.tsx +0 -71
- package/src/component/CustomSchemaForm/components/SetterSwitcher/index.tsx +0 -273
- package/src/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss +0 -16
- package/src/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss.d.ts +0 -7
- package/src/component/CustomSchemaForm/components/Setters/ArraySetter/ArrayItem.tsx +0 -55
- package/src/component/CustomSchemaForm/components/Setters/ArraySetter/SortItemOrderModal.tsx +0 -160
- package/src/component/CustomSchemaForm/components/Setters/ArraySetter/index.tsx +0 -129
- package/src/component/CustomSchemaForm/components/Setters/ArraySetter/style.module.scss +0 -22
- package/src/component/CustomSchemaForm/components/Setters/ArraySetter/style.module.scss.d.ts +0 -7
- package/src/component/CustomSchemaForm/components/Setters/BooleanSetter/index.tsx +0 -32
- package/src/component/CustomSchemaForm/components/Setters/CSSValueSetter/index.tsx +0 -78
- package/src/component/CustomSchemaForm/components/Setters/CSSValueSetter/style.module.scss +0 -7
- package/src/component/CustomSchemaForm/components/Setters/CSSValueSetter/style.module.scss.d.ts +0 -6
- package/src/component/CustomSchemaForm/components/Setters/ExpressionSetter/index.tsx +0 -47
- package/src/component/CustomSchemaForm/components/Setters/FunctionSetter/defaultDts.ts +0 -28
- package/src/component/CustomSchemaForm/components/Setters/FunctionSetter/index.tsx +0 -93
- package/src/component/CustomSchemaForm/components/Setters/JSONSetter/index.tsx +0 -80
- package/src/component/CustomSchemaForm/components/Setters/NumberSetter/index.tsx +0 -34
- package/src/component/CustomSchemaForm/components/Setters/SelectSetter/index.tsx +0 -35
- package/src/component/CustomSchemaForm/components/Setters/ShapeSetter/index.tsx +0 -65
- package/src/component/CustomSchemaForm/components/Setters/StringSetter/index.tsx +0 -30
- package/src/component/CustomSchemaForm/components/Setters/TextAreaSetter/index.tsx +0 -31
- package/src/component/CustomSchemaForm/components/Setters/index.ts +0 -26
- package/src/component/CustomSchemaForm/components/Setters/type.ts +0 -18
- package/src/component/CustomSchemaForm/context.ts +0 -20
- package/src/component/CustomSchemaForm/index.tsx +0 -93
- package/src/component/CustomSchemaForm/style.module.scss +0 -15
- package/src/component/CustomSchemaForm/style.module.scss.d.ts +0 -11
- package/src/component/CustomSchemaForm/utils.ts +0 -13
- package/src/component/MonacoEditor/index.tsx +0 -81
- package/src/component/Workbench/index.tsx +0 -329
- package/src/component/Workbench/style.module.scss +0 -159
- package/src/component/Workbench/style.module.scss.d.ts +0 -25
- package/src/core/pluginManager.ts +0 -151
- package/src/i18n/en_US/index.ts +0 -5
- package/src/i18n/index.ts +0 -39
- package/src/i18n/zh_CN/index.ts +0 -5
- package/src/index.tsx +0 -150
- package/src/material/innerMaterial.ts +0 -343
- package/src/plugins/AdvancePanel/index.tsx +0 -191
- package/src/plugins/AdvancePanel/style.module.scss +0 -8
- package/src/plugins/AdvancePanel/style.module.scss.d.ts +0 -7
- package/src/plugins/ComponentLibrary/components/DragItem/index.tsx +0 -65
- package/src/plugins/ComponentLibrary/components/DragItem/style.module.scss +0 -58
- package/src/plugins/ComponentLibrary/components/DragItem/style.module.scss.d.ts +0 -9
- package/src/plugins/ComponentLibrary/components/ListView/index.tsx +0 -50
- package/src/plugins/ComponentLibrary/components/ListView/style.module.scss +0 -27
- package/src/plugins/ComponentLibrary/components/ListView/style.module.scss.d.ts +0 -12
- package/src/plugins/ComponentLibrary/index.tsx +0 -184
- package/src/plugins/ComponentLibrary/localize/en_US/index.ts +0 -3
- package/src/plugins/ComponentLibrary/localize/index.ts +0 -3
- package/src/plugins/ComponentLibrary/localize/zh_CN/index.ts +0 -3
- package/src/plugins/ComponentLibrary/style.module.scss +0 -31
- package/src/plugins/ComponentLibrary/style.module.scss.d.ts +0 -11
- package/src/plugins/ComponentLibrary/util.ts +0 -14
- package/src/plugins/ComponentStatePanel/index.tsx +0 -59
- package/src/plugins/Designer/components/DefaultSelectToolBar/index.tsx +0 -94
- package/src/plugins/Designer/components/DefaultSelectToolBar/style.module.scss +0 -59
- package/src/plugins/Designer/components/DefaultSelectToolBar/style.module.scss.d.ts +0 -11
- package/src/plugins/Designer/components/GhostView/index.tsx +0 -18
- package/src/plugins/Designer/config.ts +0 -1
- package/src/plugins/Designer/index.tsx +0 -61
- package/src/plugins/Designer/localize/en_US/index.ts +0 -3
- package/src/plugins/Designer/localize/index.ts +0 -3
- package/src/plugins/Designer/localize/zh_CN/index.ts +0 -3
- package/src/plugins/Designer/style.module.scss +0 -10
- package/src/plugins/Designer/style.module.scss.d.ts +0 -5
- package/src/plugins/Designer/util.ts +0 -18
- package/src/plugins/Designer/view.tsx +0 -225
- package/src/plugins/DisplaySourceSchema/index.tsx +0 -76
- package/src/plugins/GlobalStatePanel/index.tsx +0 -96
- package/src/plugins/GlobalStatePanel/localize/en_US/index.ts +0 -3
- package/src/plugins/GlobalStatePanel/localize/index.ts +0 -3
- package/src/plugins/GlobalStatePanel/localize/zh_CN/index.ts +0 -3
- package/src/plugins/GlobalStatePanel/style.module.scss +0 -8
- package/src/plugins/GlobalStatePanel/style.module.scss.d.ts +0 -5
- package/src/plugins/History/index.tsx +0 -110
- package/src/plugins/OutlineTree/components/TreeView/context.ts +0 -43
- package/src/plugins/OutlineTree/components/TreeView/dataStruct.ts +0 -58
- package/src/plugins/OutlineTree/components/TreeView/index.tsx +0 -376
- package/src/plugins/OutlineTree/components/TreeView/style.module.scss +0 -93
- package/src/plugins/OutlineTree/components/TreeView/style.module.scss.d.ts +0 -16
- package/src/plugins/OutlineTree/components/TreeView/treeNode.tsx +0 -271
- package/src/plugins/OutlineTree/index.tsx +0 -39
- package/src/plugins/OutlineTree/localize/en_US/index.ts +0 -3
- package/src/plugins/OutlineTree/localize/index.ts +0 -3
- package/src/plugins/OutlineTree/localize/zh_CN/index.ts +0 -3
- package/src/plugins/OutlineTree/util.tsx +0 -302
- package/src/plugins/PropertyPanel/index.tsx +0 -63
- package/src/plugins/PropertyPanel/style.module.scss +0 -12
- package/src/plugins/PropertyPanel/style.module.scss.d.ts +0 -10
- package/src/plugins/PropertyPanel/utils.ts +0 -13
- package/src/plugins/RightPanel/index.tsx +0 -30
- package/src/plugins/RightPanel/style.module.scss +0 -16
- package/src/plugins/RightPanel/style.module.scss.d.ts +0 -10
- package/src/plugins/RightPanel/view.tsx +0 -177
- package/src/plugins/VisualPanel/index.tsx +0 -185
- package/src/plugins/VisualPanel/style.module.scss +0 -17
- package/src/plugins/VisualPanelPlus/index.tsx +0 -103
- package/src/plugins/VisualPanelPlus/style.module.scss +0 -20
- package/src/plugins/VisualPanelPlus/style.module.scss.d.ts +0 -10
- package/src/plugins/index.tsx +0 -26
- package/src/stories/Button.jsx +0 -50
- package/src/stories/Button.stories.jsx +0 -40
- package/src/stories/Introduction.stories.mdx +0 -194
- package/src/stories/assets/code-brackets.svg +0 -1
- package/src/stories/assets/colors.svg +0 -1
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/assets/flow.svg +0 -1
- package/src/stories/assets/plugin.svg +0 -1
- package/src/stories/assets/repo.svg +0 -1
- package/src/stories/assets/stackalt.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/plugins/CSSEditor.stories.tsx +0 -75
- package/src/stories/plugins/VisualPanelPlus.stories.tsx +0 -74
- package/src/style.d.ts +0 -2
- package/src/typing.d.ts +0 -9
- package/src/utils/css.ts +0 -88
- package/src/utils/defaultEngineConfig.tsx +0 -55
- package/src/utils/index.ts +0 -12
- package/src/utils/logger.ts +0 -4
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.json +0 -32
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import globalClassNames from '../../style.d';
|
|
2
|
-
declare const classNames: typeof globalClassNames & {
|
|
3
|
-
readonly CFromRenderBox: 'CFromRenderBox';
|
|
4
|
-
readonly 'ant-collapse': 'ant-collapse';
|
|
5
|
-
readonly 'ant-collapse-content': 'ant-collapse-content';
|
|
6
|
-
readonly 'ant-collapse-content-box': 'ant-collapse-content-box';
|
|
7
|
-
readonly 'ant-collapse-item': 'ant-collapse-item';
|
|
8
|
-
readonly 'ant-collapse-header': 'ant-collapse-header';
|
|
9
|
-
};
|
|
10
|
-
export = classNames;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SetterObjType, SetterType } from '@chamn/model';
|
|
2
|
-
|
|
3
|
-
export const getSetterList = (setters: SetterType[] = []): SetterObjType[] => {
|
|
4
|
-
return setters.map((setter) => {
|
|
5
|
-
if (typeof setter === 'string') {
|
|
6
|
-
return {
|
|
7
|
-
componentName: setter as any,
|
|
8
|
-
};
|
|
9
|
-
} else {
|
|
10
|
-
return setter;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CPlugin } from '../../core/pluginManager';
|
|
3
|
-
import { CRightPanelItem, RightPanel } from './view';
|
|
4
|
-
|
|
5
|
-
const PLUGIN_NAME = 'RightPanel';
|
|
6
|
-
export const RightPanelPlugin: CPlugin = (ctx) => {
|
|
7
|
-
const uiHandle = React.createRef<RightPanel>();
|
|
8
|
-
return {
|
|
9
|
-
name: PLUGIN_NAME,
|
|
10
|
-
async init(ctx) {
|
|
11
|
-
const workbench = ctx.getWorkbench();
|
|
12
|
-
workbench.replaceRightView(<RightPanel ref={uiHandle} pluginCtx={ctx} />);
|
|
13
|
-
},
|
|
14
|
-
async destroy(ctx) {
|
|
15
|
-
console.log('destroy', ctx);
|
|
16
|
-
},
|
|
17
|
-
exports: (ctx) => {
|
|
18
|
-
return {
|
|
19
|
-
addPanel: (panel: CRightPanelItem) => {
|
|
20
|
-
uiHandle?.current?.addPanel(panel);
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
meta: {
|
|
25
|
-
engine: {
|
|
26
|
-
version: '1.0.0',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
.rightPanelContainer {
|
|
2
|
-
height: 100%;
|
|
3
|
-
width: 100%;
|
|
4
|
-
:global {
|
|
5
|
-
.ant-tabs .ant-tabs-tab + .ant-tabs-tab {
|
|
6
|
-
margin-left: 0;
|
|
7
|
-
}
|
|
8
|
-
.ant-tabs-content.ant-tabs-content-top {
|
|
9
|
-
height: 100%;
|
|
10
|
-
overflow: auto;
|
|
11
|
-
}
|
|
12
|
-
.ant-tabs .ant-tabs-tabpane {
|
|
13
|
-
height: 100%;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import globalClassNames from '../../style.d';
|
|
2
|
-
declare const classNames: typeof globalClassNames & {
|
|
3
|
-
readonly rightPanelContainer: 'rightPanelContainer';
|
|
4
|
-
readonly 'ant-tabs': 'ant-tabs';
|
|
5
|
-
readonly 'ant-tabs-tab': 'ant-tabs-tab';
|
|
6
|
-
readonly 'ant-tabs-content': 'ant-tabs-content';
|
|
7
|
-
readonly 'ant-tabs-content-top': 'ant-tabs-content-top';
|
|
8
|
-
readonly 'ant-tabs-tabpane': 'ant-tabs-tabpane';
|
|
9
|
-
};
|
|
10
|
-
export = classNames;
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { CNode, CRootNode } from '@chamn/model';
|
|
2
|
-
import { Empty, Tabs } from 'antd';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { CPluginCtx } from '../../core/pluginManager';
|
|
5
|
-
import { PropertyPanelConfig } from '../PropertyPanel';
|
|
6
|
-
import { ComponentStatePanelConfig } from '../ComponentStatePanel';
|
|
7
|
-
import { AdvancePanelConfig } from '../AdvancePanel';
|
|
8
|
-
import styles from './style.module.scss';
|
|
9
|
-
import { VisualPanelPlusConfig } from '../VisualPanelPlus';
|
|
10
|
-
|
|
11
|
-
export type RightPanelOptions = { node: CNode | CRootNode; pluginCtx: CPluginCtx };
|
|
12
|
-
|
|
13
|
-
export type CRightPanelItem = {
|
|
14
|
-
key: string;
|
|
15
|
-
name: string | ((props: RightPanelOptions) => React.ReactNode);
|
|
16
|
-
view: (props: RightPanelOptions) => React.ReactNode;
|
|
17
|
-
show?: (options: RightPanelOptions) => boolean;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
interface RightPanelProps {
|
|
21
|
-
pluginCtx: CPluginCtx;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface RightPanelState {
|
|
25
|
-
node: CNode | CRootNode | null;
|
|
26
|
-
activeKey: string;
|
|
27
|
-
panels: CRightPanelItem[];
|
|
28
|
-
displayPanels: CRightPanelItem[];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export class RightPanel extends React.Component<RightPanelProps, RightPanelState> {
|
|
32
|
-
constructor(props: RightPanelProps) {
|
|
33
|
-
super(props);
|
|
34
|
-
this.state = {
|
|
35
|
-
node: props.pluginCtx.engine.getActiveNode(),
|
|
36
|
-
activeKey: 'Visual',
|
|
37
|
-
panels: [
|
|
38
|
-
// AdvancePanelConfig,
|
|
39
|
-
PropertyPanelConfig,
|
|
40
|
-
// VisualPanelConfig,
|
|
41
|
-
VisualPanelPlusConfig,
|
|
42
|
-
ComponentStatePanelConfig,
|
|
43
|
-
// {
|
|
44
|
-
// key: 'Actions',
|
|
45
|
-
// name: 'Actions',
|
|
46
|
-
// view: () => <>Actions</>,
|
|
47
|
-
// },
|
|
48
|
-
AdvancePanelConfig,
|
|
49
|
-
],
|
|
50
|
-
displayPanels: [],
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
addPanel = (panel: CRightPanelItem) => {
|
|
55
|
-
const newPanels = [...this.state.panels, panel];
|
|
56
|
-
this.setState({
|
|
57
|
-
panels: newPanels,
|
|
58
|
-
});
|
|
59
|
-
this.updatePanels();
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
updatePanels = () => {
|
|
63
|
-
const { pluginCtx } = this.props;
|
|
64
|
-
const { node, panels } = this.state;
|
|
65
|
-
const newPanels = panels;
|
|
66
|
-
let val: {
|
|
67
|
-
panels: CRightPanelItem[];
|
|
68
|
-
displayPanels: CRightPanelItem[];
|
|
69
|
-
} = { panels: [], displayPanels: [] };
|
|
70
|
-
if (node) {
|
|
71
|
-
const panelParams = { node: node, pluginCtx };
|
|
72
|
-
const displayPanels = newPanels.filter((panel) => {
|
|
73
|
-
if (panel.show === undefined) {
|
|
74
|
-
return true;
|
|
75
|
-
} else {
|
|
76
|
-
return panel.show(panelParams);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
val = {
|
|
80
|
-
panels: newPanels,
|
|
81
|
-
displayPanels,
|
|
82
|
-
};
|
|
83
|
-
} else {
|
|
84
|
-
val = {
|
|
85
|
-
panels: newPanels,
|
|
86
|
-
displayPanels: [],
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
this.setState(val);
|
|
90
|
-
return val;
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
onNodeChange = ({ node }: any) => {
|
|
94
|
-
const { pluginCtx } = this.props;
|
|
95
|
-
const { panels, activeKey } = this.state;
|
|
96
|
-
const panelParams = { node: node, pluginCtx };
|
|
97
|
-
const displayPanels = panels.filter((panel) => {
|
|
98
|
-
if (panel.show === undefined) {
|
|
99
|
-
return true;
|
|
100
|
-
} else {
|
|
101
|
-
return panel.show(panelParams);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
const firstPanelKey = displayPanels.find((_, index) => index === 0)?.key || '';
|
|
105
|
-
const isExitsCurrent = displayPanels.find((el) => el.key === activeKey);
|
|
106
|
-
if (!isExitsCurrent) {
|
|
107
|
-
this.setState({
|
|
108
|
-
activeKey: firstPanelKey,
|
|
109
|
-
node,
|
|
110
|
-
displayPanels,
|
|
111
|
-
});
|
|
112
|
-
} else {
|
|
113
|
-
this.setState({
|
|
114
|
-
node,
|
|
115
|
-
displayPanels,
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
componentDidMount(): void {
|
|
121
|
-
const { pluginCtx } = this.props;
|
|
122
|
-
pluginCtx.globalEmitter.on('onSelectNodeChange', this.onNodeChange);
|
|
123
|
-
pluginCtx.pageModel.emitter.on('*', () => {
|
|
124
|
-
const currentSelectNode = pluginCtx.engine.getActiveNode();
|
|
125
|
-
this.onNodeChange({ node: currentSelectNode });
|
|
126
|
-
});
|
|
127
|
-
const { displayPanels } = this.updatePanels();
|
|
128
|
-
const firstPanelKey = displayPanels.find((_, index) => index === 0)?.key || '';
|
|
129
|
-
const isExitsCurrent = displayPanels.find((el) => el.key === this.state.activeKey);
|
|
130
|
-
|
|
131
|
-
if (!isExitsCurrent) {
|
|
132
|
-
this.setState({
|
|
133
|
-
activeKey: firstPanelKey,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
render() {
|
|
139
|
-
const { displayPanels, node, activeKey } = this.state;
|
|
140
|
-
const { pluginCtx } = this.props;
|
|
141
|
-
if (!node) {
|
|
142
|
-
return (
|
|
143
|
-
<div style={{ overflow: 'hidden' }}>
|
|
144
|
-
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={'Please select a node from left view'} />
|
|
145
|
-
</div>
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
const panelParams = { node: node, pluginCtx };
|
|
149
|
-
|
|
150
|
-
return (
|
|
151
|
-
<div className={styles.rightPanelContainer}>
|
|
152
|
-
<Tabs
|
|
153
|
-
activeKey={activeKey}
|
|
154
|
-
tabPosition="top"
|
|
155
|
-
style={{
|
|
156
|
-
flex: 1,
|
|
157
|
-
height: '100%',
|
|
158
|
-
}}
|
|
159
|
-
onChange={(activeKey) => {
|
|
160
|
-
this.setState({
|
|
161
|
-
activeKey,
|
|
162
|
-
});
|
|
163
|
-
}}
|
|
164
|
-
items={displayPanels.map((p) => {
|
|
165
|
-
return {
|
|
166
|
-
label: (
|
|
167
|
-
<div style={{ padding: '0 10px' }}>{typeof p.name === 'string' ? p.name : p.name?.(panelParams)}</div>
|
|
168
|
-
),
|
|
169
|
-
key: p.key,
|
|
170
|
-
children: p.view(panelParams),
|
|
171
|
-
};
|
|
172
|
-
})}
|
|
173
|
-
/>
|
|
174
|
-
</div>
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
-
import { CMaterialPropsType, CNode, CNodePropsTypeEnum, CProp, isExpression } from '@chamn/model';
|
|
3
|
-
import { CPluginCtx } from '../../core/pluginManager';
|
|
4
|
-
import { CRightPanelItem } from '../RightPanel/view';
|
|
5
|
-
|
|
6
|
-
import styles from './style.module.scss';
|
|
7
|
-
import { CSSPropertiesEditor, CSSPropertiesEditorRef } from '../../component/CSSPropertiesEditor';
|
|
8
|
-
import { Collapse } from 'antd';
|
|
9
|
-
import { CustomSchemaForm, CustomSchemaFormInstance } from '../../component/CustomSchemaForm';
|
|
10
|
-
|
|
11
|
-
type styleArr = {
|
|
12
|
-
key: string;
|
|
13
|
-
value: any;
|
|
14
|
-
}[];
|
|
15
|
-
|
|
16
|
-
const CSSBindPropsSchema: CMaterialPropsType<'CSSValueSetter'> = [
|
|
17
|
-
{
|
|
18
|
-
name: 'css',
|
|
19
|
-
title: 'CSS Variable Bind',
|
|
20
|
-
valueType: 'array',
|
|
21
|
-
setters: [
|
|
22
|
-
{
|
|
23
|
-
componentName: 'ArraySetter',
|
|
24
|
-
props: {
|
|
25
|
-
item: {
|
|
26
|
-
setters: [
|
|
27
|
-
{
|
|
28
|
-
componentName: 'ShapeSetter',
|
|
29
|
-
props: {
|
|
30
|
-
elements: [
|
|
31
|
-
{
|
|
32
|
-
name: 'key',
|
|
33
|
-
title: '属性',
|
|
34
|
-
valueType: 'string',
|
|
35
|
-
setters: ['StringSetter'],
|
|
36
|
-
description: '',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: 'value',
|
|
40
|
-
title: '置',
|
|
41
|
-
valueType: 'string',
|
|
42
|
-
setters: ['ExpressionSetter'],
|
|
43
|
-
description: '',
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
collapse: false,
|
|
47
|
-
},
|
|
48
|
-
initialValue: {
|
|
49
|
-
key: '',
|
|
50
|
-
value: {
|
|
51
|
-
type: CNodePropsTypeEnum.EXPRESSION,
|
|
52
|
-
value: '',
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
initialValue: {
|
|
58
|
-
key: '',
|
|
59
|
-
value: {
|
|
60
|
-
type: CNodePropsTypeEnum.EXPRESSION,
|
|
61
|
-
value: '',
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
initialValue: [],
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
},
|
|
70
|
-
];
|
|
71
|
-
|
|
72
|
-
const formatProperty = (cssVal: Record<string, any>) => {
|
|
73
|
-
const normalProperty: { key: string; value: string }[] = [];
|
|
74
|
-
const expressionProperty: { key: string; value: any }[] = [];
|
|
75
|
-
Object.keys(cssVal).forEach((key) => {
|
|
76
|
-
const val = cssVal[key];
|
|
77
|
-
if (isExpression(val)) {
|
|
78
|
-
expressionProperty.push({
|
|
79
|
-
key,
|
|
80
|
-
value: val,
|
|
81
|
-
});
|
|
82
|
-
} else {
|
|
83
|
-
normalProperty.push({
|
|
84
|
-
key,
|
|
85
|
-
value: val,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
const res = {
|
|
90
|
-
normalProperty,
|
|
91
|
-
expressionProperty,
|
|
92
|
-
};
|
|
93
|
-
return res;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
const styleArr2Obj = (val: styleArr) => {
|
|
97
|
-
const res: Record<string, any> = {};
|
|
98
|
-
val.forEach((item) => {
|
|
99
|
-
res[item.key] = item.value;
|
|
100
|
-
});
|
|
101
|
-
return res;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
export const VisualPanel = (props: { node: CNode; pluginCtx: CPluginCtx }) => {
|
|
105
|
-
const formRef = useRef<CustomSchemaFormInstance>(null);
|
|
106
|
-
const { node } = props;
|
|
107
|
-
const cssEditorRef = useRef<CSSPropertiesEditorRef>(null);
|
|
108
|
-
const [style, setStyle] = useState<Record<string, string>>({});
|
|
109
|
-
const formatStyle = useMemo(() => {
|
|
110
|
-
return formatProperty(style);
|
|
111
|
-
}, [style]);
|
|
112
|
-
useEffect(() => {
|
|
113
|
-
const handel = () => {
|
|
114
|
-
const newStyle = node.getPlainProps?.()['style'] || {};
|
|
115
|
-
setStyle(newStyle);
|
|
116
|
-
const { normalProperty, expressionProperty } = formatProperty(newStyle);
|
|
117
|
-
cssEditorRef.current?.setValue(normalProperty);
|
|
118
|
-
formRef.current?.setFields({
|
|
119
|
-
css: expressionProperty,
|
|
120
|
-
});
|
|
121
|
-
};
|
|
122
|
-
handel();
|
|
123
|
-
node.emitter.on('onNodeChange', handel);
|
|
124
|
-
() => {
|
|
125
|
-
node.emitter.off('onNodeChange', handel);
|
|
126
|
-
};
|
|
127
|
-
}, [node]);
|
|
128
|
-
|
|
129
|
-
const onUpdateStyle = (styleArr: styleArr) => {
|
|
130
|
-
// merge style
|
|
131
|
-
const newStyle = styleArr2Obj([...styleArr]);
|
|
132
|
-
setStyle(newStyle);
|
|
133
|
-
if (node.value.props.style) {
|
|
134
|
-
node.value.props.style.updateValue(newStyle);
|
|
135
|
-
} else {
|
|
136
|
-
node.value.props.style = new CProp('style', newStyle, {
|
|
137
|
-
parent: node,
|
|
138
|
-
materials: node.materialsModel,
|
|
139
|
-
});
|
|
140
|
-
node.updateValue();
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
return (
|
|
145
|
-
<div className={styles.visualPanelBox}>
|
|
146
|
-
<Collapse
|
|
147
|
-
defaultActiveKey={['origin-css-edit']}
|
|
148
|
-
bordered={false}
|
|
149
|
-
style={{
|
|
150
|
-
marginBottom: '10px',
|
|
151
|
-
}}
|
|
152
|
-
>
|
|
153
|
-
<Collapse.Panel header={<span className={styles.header}>CSS Source</span>} key="origin-css-edit">
|
|
154
|
-
<CSSPropertiesEditor
|
|
155
|
-
key={node.id}
|
|
156
|
-
ref={cssEditorRef}
|
|
157
|
-
onValueChange={(val) => {
|
|
158
|
-
onUpdateStyle([...val, ...formatStyle.expressionProperty]);
|
|
159
|
-
}}
|
|
160
|
-
initialValue={formatStyle.normalProperty}
|
|
161
|
-
/>
|
|
162
|
-
</Collapse.Panel>
|
|
163
|
-
</Collapse>
|
|
164
|
-
<CustomSchemaForm
|
|
165
|
-
pluginCtx={props.pluginCtx}
|
|
166
|
-
key={node.id}
|
|
167
|
-
defaultSetterConfig={node.value.configure.propsSetter || {}}
|
|
168
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
169
|
-
onSetterChange={() => {}}
|
|
170
|
-
properties={CSSBindPropsSchema}
|
|
171
|
-
initialValue={formatStyle.expressionProperty}
|
|
172
|
-
ref={formRef}
|
|
173
|
-
onValueChange={(val) => {
|
|
174
|
-
onUpdateStyle([...formatStyle.normalProperty, ...val.css]);
|
|
175
|
-
}}
|
|
176
|
-
/>
|
|
177
|
-
</div>
|
|
178
|
-
);
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
export const VisualPanelConfig: CRightPanelItem = {
|
|
182
|
-
key: 'Visual',
|
|
183
|
-
name: 'Visual',
|
|
184
|
-
view: ({ node, pluginCtx }) => <VisualPanel node={node} pluginCtx={pluginCtx} />,
|
|
185
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
.visualPanelBox {
|
|
2
|
-
padding: 0 15px;
|
|
3
|
-
:global {
|
|
4
|
-
.ant-collapse > .ant-collapse-item:last-child > .ant-collapse-header {
|
|
5
|
-
padding: 5px 5px 5px 10px;
|
|
6
|
-
align-items: center;
|
|
7
|
-
.ant-collapse-expand-icon {
|
|
8
|
-
padding-inline-end: 4px;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
.header {
|
|
13
|
-
color: $fontColor;
|
|
14
|
-
display: flex;
|
|
15
|
-
font-size: 12px;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
-
import { CNode, CRootNode } from '@chamn/model';
|
|
3
|
-
import { CPluginCtx } from '../../core/pluginManager';
|
|
4
|
-
import { CRightPanelItem } from '../RightPanel/view';
|
|
5
|
-
|
|
6
|
-
import styles from './style.module.scss';
|
|
7
|
-
import { CSSPropertiesEditor, CSSPropertiesEditorRef } from '../../component/CSSPropertiesEditor';
|
|
8
|
-
import {
|
|
9
|
-
CSSPropertiesVariableBindEditor,
|
|
10
|
-
CSSPropertiesVariableBindEditorRef,
|
|
11
|
-
} from '../../component/CSSPropertiesVariableBindEditor';
|
|
12
|
-
import { Collapse } from 'antd';
|
|
13
|
-
import { ClassNameEditor } from '@/component/ClassNameEditor';
|
|
14
|
-
import { CSSEditor, CSSEditorRef, CSSVal } from '@/component/CSSEditor';
|
|
15
|
-
import { formatCSSProperty, formatCssToNodeVal, formatNodeValToEditor, StyleArr, styleArr2Obj } from '@/utils/css';
|
|
16
|
-
|
|
17
|
-
export const VisualPanelPlus = (props: { node: CNode | CRootNode; pluginCtx: CPluginCtx }) => {
|
|
18
|
-
const formRef = useRef<CSSPropertiesVariableBindEditorRef>(null);
|
|
19
|
-
const node = props.pluginCtx.pageModel.getNode(props.node.id)!;
|
|
20
|
-
const cssPropertyEditorRef = useRef<CSSPropertiesEditorRef>(null);
|
|
21
|
-
const cssEditorRef = useRef<CSSEditorRef>(null);
|
|
22
|
-
const [style, setStyle] = useState<Record<string, any>>({});
|
|
23
|
-
const formatStyle = useMemo(() => {
|
|
24
|
-
return formatCSSProperty(style);
|
|
25
|
-
}, [style]);
|
|
26
|
-
|
|
27
|
-
const lastNode = useRef<CNode | CRootNode>();
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
const handel = () => {
|
|
30
|
-
lastNode.current = node;
|
|
31
|
-
const newStyle = node.value.style || {};
|
|
32
|
-
setStyle(newStyle);
|
|
33
|
-
const { normalProperty, expressionProperty } = formatCSSProperty(newStyle);
|
|
34
|
-
cssPropertyEditorRef.current?.setValue(normalProperty);
|
|
35
|
-
formRef.current?.setValue(expressionProperty);
|
|
36
|
-
const fCss = formatNodeValToEditor(node.value.css);
|
|
37
|
-
cssEditorRef.current?.setValue(fCss);
|
|
38
|
-
};
|
|
39
|
-
handel();
|
|
40
|
-
node.emitter.on('onNodeChange', handel);
|
|
41
|
-
node.emitter.on('onReloadPage', handel);
|
|
42
|
-
() => {
|
|
43
|
-
node.emitter.off('onNodeChange', handel);
|
|
44
|
-
node.emitter.off('onReloadPage', handel);
|
|
45
|
-
};
|
|
46
|
-
}, [node]);
|
|
47
|
-
|
|
48
|
-
const onUpdateStyle = (styleArr: StyleArr) => {
|
|
49
|
-
// merge style
|
|
50
|
-
const newStyle = styleArr2Obj([...styleArr]);
|
|
51
|
-
setStyle(newStyle);
|
|
52
|
-
node.value.style = newStyle;
|
|
53
|
-
node.updateValue();
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const onUpdateCss = (val: CSSVal) => {
|
|
57
|
-
// class name 不能以数字开头,这里使用c_前缀
|
|
58
|
-
node.value.css = formatCssToNodeVal(`c_${node.id}`, val);
|
|
59
|
-
console.log(' node.value.css', node.value.css);
|
|
60
|
-
node.updateValue();
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<div className={styles.visualPanelBox}>
|
|
65
|
-
<div
|
|
66
|
-
style={{
|
|
67
|
-
marginBottom: '10px',
|
|
68
|
-
}}
|
|
69
|
-
>
|
|
70
|
-
<ClassNameEditor
|
|
71
|
-
onValueChange={(newVal) => {
|
|
72
|
-
node.value.classNames = newVal;
|
|
73
|
-
node.updateValue();
|
|
74
|
-
}}
|
|
75
|
-
/>
|
|
76
|
-
</div>
|
|
77
|
-
<Collapse
|
|
78
|
-
defaultActiveKey={['origin-css-edit']}
|
|
79
|
-
bordered={false}
|
|
80
|
-
style={{
|
|
81
|
-
marginBottom: '10px',
|
|
82
|
-
}}
|
|
83
|
-
>
|
|
84
|
-
<Collapse.Panel header={<span className={styles.header}>Style Variable Bind</span>} key="origin-css-edit">
|
|
85
|
-
<CSSPropertiesVariableBindEditor
|
|
86
|
-
ref={formRef}
|
|
87
|
-
initialValue={formatStyle.expressionProperty}
|
|
88
|
-
onValueChange={(val) => {
|
|
89
|
-
onUpdateStyle([...formatStyle.normalProperty, ...val]);
|
|
90
|
-
}}
|
|
91
|
-
/>
|
|
92
|
-
</Collapse.Panel>
|
|
93
|
-
</Collapse>
|
|
94
|
-
<CSSEditor handler={cssEditorRef} onValueChange={onUpdateCss} />
|
|
95
|
-
</div>
|
|
96
|
-
);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export const VisualPanelPlusConfig: CRightPanelItem = {
|
|
100
|
-
key: 'VisualPanelPlus',
|
|
101
|
-
name: 'VisualPanel',
|
|
102
|
-
view: ({ node, pluginCtx }) => <VisualPanelPlus node={node} pluginCtx={pluginCtx} />,
|
|
103
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
.visualPanelBox {
|
|
2
|
-
padding: 0 15px 300px;
|
|
3
|
-
|
|
4
|
-
.header {
|
|
5
|
-
color: $fontColor;
|
|
6
|
-
display: flex;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
:global {
|
|
11
|
-
.ant-collapse .ant-collapse-item .ant-collapse-header {
|
|
12
|
-
padding: 5px 5px 5px 10px;
|
|
13
|
-
align-items: center;
|
|
14
|
-
color: $fontColor;
|
|
15
|
-
font-size: 12px;
|
|
16
|
-
.ant-collapse-expand-icon {
|
|
17
|
-
padding-inline-end: 4px;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import globalClassNames from '../../style.d';
|
|
2
|
-
declare const classNames: typeof globalClassNames & {
|
|
3
|
-
readonly visualPanelBox: 'visualPanelBox';
|
|
4
|
-
readonly header: 'header';
|
|
5
|
-
readonly 'ant-collapse': 'ant-collapse';
|
|
6
|
-
readonly 'ant-collapse-item': 'ant-collapse-item';
|
|
7
|
-
readonly 'ant-collapse-header': 'ant-collapse-header';
|
|
8
|
-
readonly 'ant-collapse-expand-icon': 'ant-collapse-expand-icon';
|
|
9
|
-
};
|
|
10
|
-
export = classNames;
|
package/src/plugins/index.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { CPlugin } from '../core/pluginManager';
|
|
2
|
-
import { ComponentLibPlugin } from './ComponentLibrary';
|
|
3
|
-
import { DesignerPlugin } from './Designer';
|
|
4
|
-
import { OutlineTreePlugin } from './OutlineTree';
|
|
5
|
-
import { RightPanelPlugin } from './RightPanel';
|
|
6
|
-
import { GlobalStatePanelPlugin } from './GlobalStatePanel';
|
|
7
|
-
import { DisplaySourceSchema } from './DisplaySourceSchema';
|
|
8
|
-
import { HistoryPlugin } from './History';
|
|
9
|
-
|
|
10
|
-
export const DEFAULT_PLUGIN_LIST: CPlugin[] = [
|
|
11
|
-
DesignerPlugin,
|
|
12
|
-
OutlineTreePlugin,
|
|
13
|
-
ComponentLibPlugin,
|
|
14
|
-
GlobalStatePanelPlugin,
|
|
15
|
-
RightPanelPlugin,
|
|
16
|
-
HistoryPlugin,
|
|
17
|
-
];
|
|
18
|
-
|
|
19
|
-
export {
|
|
20
|
-
DesignerPlugin,
|
|
21
|
-
ComponentLibPlugin,
|
|
22
|
-
RightPanelPlugin,
|
|
23
|
-
GlobalStatePanelPlugin,
|
|
24
|
-
HistoryPlugin,
|
|
25
|
-
DisplaySourceSchema,
|
|
26
|
-
};
|
package/src/stories/Button.jsx
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import './button.css';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Primary UI component for user interaction
|
|
7
|
-
*/
|
|
8
|
-
export const Button = ({ primary, backgroundColor, size, label, ...props }) => {
|
|
9
|
-
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
10
|
-
return (
|
|
11
|
-
<button
|
|
12
|
-
type="button"
|
|
13
|
-
className={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
|
|
14
|
-
style={backgroundColor && { backgroundColor }}
|
|
15
|
-
{...props}
|
|
16
|
-
>
|
|
17
|
-
{label}
|
|
18
|
-
</button>
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
Button.propTypes = {
|
|
23
|
-
/**
|
|
24
|
-
* Is this the principal call to action on the page?
|
|
25
|
-
*/
|
|
26
|
-
primary: PropTypes.bool,
|
|
27
|
-
/**
|
|
28
|
-
* What background color to use
|
|
29
|
-
*/
|
|
30
|
-
backgroundColor: PropTypes.string,
|
|
31
|
-
/**
|
|
32
|
-
* How large should the button be?
|
|
33
|
-
*/
|
|
34
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
35
|
-
/**
|
|
36
|
-
* Button contents
|
|
37
|
-
*/
|
|
38
|
-
label: PropTypes.string.isRequired,
|
|
39
|
-
/**
|
|
40
|
-
* Optional click handler
|
|
41
|
-
*/
|
|
42
|
-
onClick: PropTypes.func,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
Button.defaultProps = {
|
|
46
|
-
backgroundColor: null,
|
|
47
|
-
primary: false,
|
|
48
|
-
size: 'medium',
|
|
49
|
-
onClick: undefined,
|
|
50
|
-
};
|