@maxelms/create-plugin-cli 1.1.0 → 1.1.1
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/package.json +1 -1
- package/templates/react-micro-button/configuration/Configuration.tsx +1 -1
- package/templates/react-micro-button/package.json.tpl +1 -1
- package/templates/react-micro-button/src/App.tsx +1 -2
- package/templates/react-micro-button/src/index.tsx +5 -5
- package/templates/react-micro-field/configuration/Configuration.tsx +1 -1
- package/templates/react-micro-field/package.json.tpl +1 -1
- package/templates/react-micro-field/src/App.tsx.tpl +1 -2
- package/templates/react-micro-field/src/index.tsx +5 -5
- package/templates/react-micro-field-umi/package.json.tpl +1 -1
- package/templates/react-micro-field-umi/src/app.tsx +3 -3
- package/templates/react-micro-field-umi/src/hooks/masterProps.ts +2 -3
- package/templates/react-micro-field-umi/src/pages/configuration/index.tsx +1 -1
- package/templates/react-micro-field-umi/src/pages/index.tsx.tpl +1 -2
- package/templates/react-micro-field-umi/src/public-path.js +1 -1
- package/templates/react-micro-plugin/configuration/Configuration.tsx +1 -1
- package/templates/react-micro-plugin/package.json.tpl +1 -1
- package/templates/react-micro-plugin/src/App.tsx.tpl +1 -2
- package/templates/react-micro-plugin/src/index.tsx +4 -4
- package/templates/react-micro-plugin-umi/package.json.tpl +1 -1
- package/templates/react-micro-plugin-umi/src/app.tsx +1 -1
- package/templates/react-micro-plugin-umi/src/pages/configuration/index.tsx +1 -1
- package/templates/react-micro-plugin-umi/src/public-path.js +1 -1
- package/templates/vue-micro-button/configuration/App.vue +1 -1
- package/templates/vue-micro-button/package.json.tpl +1 -1
- package/templates/vue-micro-button/src/main.js +1 -1
- package/templates/vue-micro-field/configuration/App.vue +1 -1
- package/templates/vue-micro-field/package.json.tpl +1 -1
- package/templates/vue-micro-field/src/main.js +1 -1
- package/templates/vue-micro-plugin/configuration/App.vue +1 -1
- package/templates/vue-micro-plugin/package.json.tpl +1 -1
- package/templates/vue-micro-plugin/src/main.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import { Form, Switch, Input, InputNumber, Select } from 'antd';
|
|
3
|
-
import { PluginChannel } from '@
|
|
3
|
+
import { PluginChannel } from '@maxelms/create-pulgin-api'
|
|
4
4
|
|
|
5
5
|
interface ConfigurationType {}
|
|
6
6
|
type PlainObject = Record<string, any>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Modal } from 'antd'
|
|
3
|
-
import { ButtonPluginProps } from '@max-kit/max-api'
|
|
4
3
|
import 'antd/lib/modal/style'
|
|
5
4
|
|
|
6
|
-
const App = (props:
|
|
5
|
+
const App = (props: any) => {
|
|
7
6
|
const { originalButtonProps, bizData, pluginEnv, userInfo } = props
|
|
8
7
|
const { name = <button>自定义按钮</button> } = originalButtonProps || {}
|
|
9
8
|
const [visible, setVisible] = React.useState(false)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
|
-
import { registerPlugin, poweredByMaxelms
|
|
3
|
+
import { registerPlugin, poweredByMaxelms } from '@maxelms/create-pulgin-api'
|
|
4
4
|
import App from './App';
|
|
5
5
|
import './index.less';
|
|
6
6
|
|
|
7
|
-
const render = (container: string, props?:
|
|
7
|
+
const render = (container: string, props?: any) => {
|
|
8
8
|
ReactDOM.render(<App {...props} />, document.querySelector(container));
|
|
9
9
|
};
|
|
10
10
|
|
|
@@ -14,13 +14,13 @@ if (poweredByMaxelms) {
|
|
|
14
14
|
registerPlugin({
|
|
15
15
|
bootstrap() {
|
|
16
16
|
},
|
|
17
|
-
mount(props:
|
|
17
|
+
mount(props: any) {
|
|
18
18
|
render(`#${props.containerId} ${container}`, props);
|
|
19
19
|
},
|
|
20
|
-
update(props:
|
|
20
|
+
update(props: any) {
|
|
21
21
|
render(`#${props.containerId} ${container}`, props);
|
|
22
22
|
},
|
|
23
|
-
unmount(props:
|
|
23
|
+
unmount(props: any) {
|
|
24
24
|
const element = document.querySelector(`#${props.containerId} ${container}`)
|
|
25
25
|
element && ReactDOM.unmountComponentAtNode(element);
|
|
26
26
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import { Form, Switch, Input, InputNumber, Select } from 'antd';
|
|
3
|
-
import { PluginChannel } from '@
|
|
3
|
+
import { PluginChannel } from '@maxelms/create-pulgin-api'
|
|
4
4
|
|
|
5
5
|
interface ConfigurationType {}
|
|
6
6
|
type PlainObject = Record<string, any>
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Input } from 'antd';
|
|
3
|
-
import { FieldPluginProps } from '@max-kit/max-api';
|
|
4
3
|
import './style.less';
|
|
5
4
|
|
|
6
5
|
const prefixCls = 'maxelms-customize-component-<%= timestamp %>'
|
|
7
6
|
|
|
8
|
-
const App = (props:
|
|
7
|
+
const App = (props: any) => {
|
|
9
8
|
/** 当组件运行在 APaaS 基座应用时才存在 props 属性 */
|
|
10
9
|
const { configurations, value, onChange, readOnly } = props
|
|
11
10
|
/** configurations 是组件的配置项信息 */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
|
-
import { registerPlugin, poweredByMaxelms
|
|
3
|
+
import { registerPlugin, poweredByMaxelms } from '@maxelms/create-pulgin-api'
|
|
4
4
|
import App from './App';
|
|
5
5
|
|
|
6
|
-
const render = (container: string, props?:
|
|
6
|
+
const render = (container: string, props?: any) => {
|
|
7
7
|
ReactDOM.render(<App {...props} />, document.querySelector(container));
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -13,13 +13,13 @@ if (poweredByMaxelms) {
|
|
|
13
13
|
registerPlugin({
|
|
14
14
|
bootstrap() {
|
|
15
15
|
},
|
|
16
|
-
mount(props:
|
|
16
|
+
mount(props: any) {
|
|
17
17
|
render(`#${props.containerId} ${container}`, props);
|
|
18
18
|
},
|
|
19
|
-
update(props:
|
|
19
|
+
update(props: any) {
|
|
20
20
|
render(`#${props.containerId} ${container}`, props);
|
|
21
21
|
},
|
|
22
|
-
unmount(props) {
|
|
22
|
+
unmount(props: any) {
|
|
23
23
|
const element = document.querySelector(`#${props.containerId} ${container}`)
|
|
24
24
|
element && ReactDOM.unmountComponentAtNode(element);
|
|
25
25
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ReactDom from 'react-dom';
|
|
2
2
|
// @ts-ignore
|
|
3
3
|
import { setCreateHistoryOptions } from 'umi';
|
|
4
|
-
import { registerPlugin, poweredByMaxelms
|
|
4
|
+
import { registerPlugin, poweredByMaxelms } from '@maxelms/create-pulgin-api'
|
|
5
5
|
import { setMasterProps } from './hooks/masterProps';
|
|
6
6
|
import './public-path';
|
|
7
7
|
|
|
@@ -17,7 +17,7 @@ export const render = (oldRender: any) => {
|
|
|
17
17
|
return
|
|
18
18
|
}
|
|
19
19
|
registerPlugin({
|
|
20
|
-
mount(props:
|
|
20
|
+
mount(props: any) {
|
|
21
21
|
setMasterProps(props.containerId, props)
|
|
22
22
|
setCreateHistoryOptions({
|
|
23
23
|
type: 'memory',
|
|
@@ -26,7 +26,7 @@ export const render = (oldRender: any) => {
|
|
|
26
26
|
rootElement = document.querySelector(`#${props.containerId} #${defaultRootElement}`);
|
|
27
27
|
oldRender()
|
|
28
28
|
},
|
|
29
|
-
update(props:
|
|
29
|
+
update(props: any) {
|
|
30
30
|
setMasterProps(props.containerId, props)
|
|
31
31
|
},
|
|
32
32
|
unmount(props) {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { FieldPluginProps } from '@max-kit/max-api'
|
|
3
2
|
|
|
4
|
-
const runtimeProps: Record<string,
|
|
3
|
+
const runtimeProps: Record<string, any> = {}
|
|
5
4
|
|
|
6
|
-
export const masterPropsContext = React.createContext<
|
|
5
|
+
export const masterPropsContext = React.createContext<any>({} as any)
|
|
7
6
|
|
|
8
7
|
export const useMasterProps = () => {
|
|
9
8
|
const masterProps = React.useContext(masterPropsContext)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import { Form, Switch, Input, InputNumber, Select } from 'antd';
|
|
3
|
-
import { PluginChannel } from '@
|
|
3
|
+
import { PluginChannel } from '@maxelms/create-pulgin-api'
|
|
4
4
|
|
|
5
5
|
interface ConfigurationType {}
|
|
6
6
|
type PlainObject = Record<string, any>
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
export default App;
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Input } from 'antd';
|
|
4
|
-
import { FieldPluginProps } from '@max-kit/max-api';
|
|
5
4
|
import { useMasterProps } from '../hooks/masterProps';
|
|
6
5
|
import './index.less';
|
|
7
6
|
|
|
8
7
|
const prefixCls = 'maxelms-customize-component-<%= timestamp %>'
|
|
9
8
|
|
|
10
|
-
const App = (props:
|
|
9
|
+
const App = (props: any) => {
|
|
11
10
|
const masterProps = useMasterProps();
|
|
12
11
|
/** 当组件运行在 APaaS 基座应用时才存在 props 属性 */
|
|
13
12
|
const { configurations, value, onChange, readOnly } = masterProps
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import { Form, Switch, Input, InputNumber, Select } from 'antd';
|
|
3
|
-
import { PluginChannel } from '@
|
|
3
|
+
import { PluginChannel } from '@maxelms/create-pulgin-api'
|
|
4
4
|
import 'antd/dist/antd.css';
|
|
5
5
|
|
|
6
6
|
interface ConfigurationType {}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Input } from 'antd'
|
|
3
|
-
import { PluginProps } from '@max-kit/max-api';
|
|
4
3
|
import './style.less';
|
|
5
4
|
|
|
6
5
|
const prefixCls = 'maxelms-customize-component-<%= timestamp %>'
|
|
7
6
|
|
|
8
|
-
const App = (props:
|
|
7
|
+
const App = (props: any) => {
|
|
9
8
|
/** 当组件运行在 APaaS 基座应用时才存在 props 属性 */
|
|
10
9
|
/** configurations 是组件的配置项信息 */
|
|
11
10
|
const { configurations } = props
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
|
-
import { registerPlugin, poweredByMaxelms
|
|
3
|
+
import { registerPlugin, poweredByMaxelms } from '@maxelms/create-pulgin-api'
|
|
4
4
|
import App from './App';
|
|
5
5
|
|
|
6
|
-
const render = (container: string, props?:
|
|
6
|
+
const render = (container: string, props?: any) => {
|
|
7
7
|
ReactDOM.render(<App {...props} />, document.querySelector(container));
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -13,10 +13,10 @@ if (poweredByMaxelms) {
|
|
|
13
13
|
registerPlugin({
|
|
14
14
|
bootstrap() {
|
|
15
15
|
},
|
|
16
|
-
mount(props:
|
|
16
|
+
mount(props: any) {
|
|
17
17
|
render(`#${props.containerId} ${container}`, props);
|
|
18
18
|
},
|
|
19
|
-
update(props:
|
|
19
|
+
update(props: any) {
|
|
20
20
|
render(`#${props.containerId} ${container}`, props);
|
|
21
21
|
},
|
|
22
22
|
unmount(props) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ReactDom from 'react-dom';
|
|
2
2
|
// @ts-ignore
|
|
3
3
|
import { setCreateHistoryOptions } from 'umi';
|
|
4
|
-
import { registerPlugin, poweredByMaxelms } from '@
|
|
4
|
+
import { registerPlugin, poweredByMaxelms } from '@maxelms/create-pulgin-api'
|
|
5
5
|
import { setMasterProps } from './hooks/masterProps';
|
|
6
6
|
import './public-path';
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import { Form, Switch, Input, InputNumber, Select } from 'antd';
|
|
3
|
-
import { PluginChannel } from '@
|
|
3
|
+
import { PluginChannel } from '@maxelms/create-pulgin-api'
|
|
4
4
|
|
|
5
5
|
interface ConfigurationType {}
|
|
6
6
|
type PlainObject = Record<string, any>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Vue from 'vue'
|
|
2
2
|
import ElementUI from 'element-ui';
|
|
3
|
-
import { registerPlugin, poweredByMaxelms } from '@
|
|
3
|
+
import { registerPlugin, poweredByMaxelms } from '@maxelms/create-pulgin-api'
|
|
4
4
|
import App from './App.vue'
|
|
5
5
|
import 'element-ui/lib/theme-chalk/index.css';
|
|
6
6
|
|