@easyv/react-component-builder 0.19.3 → 0.19.5-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/package.json CHANGED
@@ -1,76 +1,76 @@
1
- {
2
- "name": "@easyv/react-component-builder",
3
- "version": "0.19.3",
4
- "files": [
5
- "launcher",
6
- "templates",
7
- "config",
8
- "loaders",
9
- "public",
10
- "utils"
11
- ],
12
- "scripts": {
13
- "start": "node scripts/start.js",
14
- "build": "node scripts/build.js",
15
- "generate": "node scripts/generate.js",
16
- "push": "npm publish",
17
- "postpublish": "sync-to-mirror"
18
- },
19
- "dependencies": {
20
- "@babel/core": "7.9.0",
21
- "@babel/register": "^7.10.4",
22
- "@easyv/react-gui": "1.6.6",
23
- "@easyv/simulator": "0.5.1",
24
- "@svgr/webpack": "4.3.3",
25
- "acorn": "^7.3.1",
26
- "acorn-jsx": "^5.2.0",
27
- "antd": "^4.0.3",
28
- "babel-loader": "8.1.0",
29
- "babel-plugin-named-asset-import": "^0.3.6",
30
- "babel-preset-react-app": "^9.1.2",
31
- "classnames": "^2.2.6",
32
- "css-loader": "3.4.2",
33
- "d3": "^5.16.0",
34
- "expose-loader": "^1.0.0",
35
- "file-loader": "4.3.0",
36
- "filesize": "^6.1.0",
37
- "fs-extra": "^9.0.1",
38
- "glob": "^7.1.6",
39
- "html-webpack-plugin": "4.0.0-beta.11",
40
- "inquirer": "^7.3.0",
41
- "less-loader": "^6.2.0",
42
- "lodash": "^4.17.19",
43
- "multer": "^1.4.2",
44
- "optimize-css-assets-webpack-plugin": "5.0.3",
45
- "react": "^16.13.1",
46
- "react-dev-utils": "10.2.1",
47
- "react-dom": "^16.13.1",
48
- "style-loader": "0.23.1",
49
- "three": "^0.100.0",
50
- "url-loader": "2.3.0",
51
- "webpack": "4.42.0",
52
- "webpack-dev-server": "3.10.3",
53
- "webpack-manifest-plugin": "2.2.0"
54
- },
55
- "devDependencies": {
56
- "@easyv/sync-to-mirror": "^0.0.2",
57
- "@types/lodash": "^4.14.157",
58
- "@types/node": "^12.0.0",
59
- "@types/react": "^16.9.0",
60
- "@types/react-dom": "^16.9.0",
61
- "terser-webpack-plugin": "^4.2.3"
62
- },
63
- "easyv": {
64
- "src": "examples",
65
- "components": "examples/components",
66
- "builder": "~/Documents/project/easyv-cli/packages/react-builder",
67
- "host": {
68
- "online": "https://easyv.dtstack.com",
69
- "test": "http://172.16.10.70:1337"
70
- },
71
- "assets": "https://easyv-develop.oss-cn-hangzhou.aliyuncs.com/"
72
- },
73
- "publishConfig": {
74
- "registry": "https://registry.npmjs.org/"
75
- }
76
- }
1
+ {
2
+ "name": "@easyv/react-component-builder",
3
+ "version": "0.19.5-beta.0",
4
+ "files": [
5
+ "launcher",
6
+ "templates",
7
+ "config",
8
+ "loaders",
9
+ "public",
10
+ "utils"
11
+ ],
12
+ "scripts": {
13
+ "start": "node scripts/start.js",
14
+ "build": "node scripts/build.js",
15
+ "generate": "node scripts/generate.js",
16
+ "push": "npm publish",
17
+ "postpublish": "sync-to-mirror"
18
+ },
19
+ "dependencies": {
20
+ "@babel/core": "7.9.0",
21
+ "@babel/register": "^7.10.4",
22
+ "@easyv/react-gui": "1.6.6",
23
+ "@easyv/simulator": "0.5.2",
24
+ "@svgr/webpack": "4.3.3",
25
+ "acorn": "^7.3.1",
26
+ "acorn-jsx": "^5.2.0",
27
+ "antd": "^4.0.3",
28
+ "babel-loader": "8.1.0",
29
+ "babel-plugin-named-asset-import": "^0.3.6",
30
+ "babel-preset-react-app": "^9.1.2",
31
+ "classnames": "^2.2.6",
32
+ "css-loader": "3.4.2",
33
+ "d3": "^5.16.0",
34
+ "expose-loader": "^1.0.0",
35
+ "file-loader": "4.3.0",
36
+ "filesize": "^6.1.0",
37
+ "fs-extra": "^9.0.1",
38
+ "glob": "^7.1.6",
39
+ "html-webpack-plugin": "4.0.0-beta.11",
40
+ "inquirer": "^7.3.0",
41
+ "less-loader": "^6.2.0",
42
+ "lodash": "^4.17.19",
43
+ "multer": "^1.4.2",
44
+ "optimize-css-assets-webpack-plugin": "5.0.3",
45
+ "react": "^16.13.1",
46
+ "react-dev-utils": "10.2.1",
47
+ "react-dom": "^16.13.1",
48
+ "style-loader": "0.23.1",
49
+ "three": "^0.100.0",
50
+ "url-loader": "2.3.0",
51
+ "webpack": "4.42.0",
52
+ "webpack-dev-server": "3.10.3",
53
+ "webpack-manifest-plugin": "2.2.0"
54
+ },
55
+ "devDependencies": {
56
+ "@easyv/sync-to-mirror": "^0.0.2",
57
+ "@types/lodash": "^4.14.157",
58
+ "@types/node": "^12.0.0",
59
+ "@types/react": "^16.9.0",
60
+ "@types/react-dom": "^16.9.0",
61
+ "terser-webpack-plugin": "^4.2.3"
62
+ },
63
+ "easyv": {
64
+ "src": "examples",
65
+ "components": "examples/components",
66
+ "builder": "~/Documents/project/easyv-cli/packages/react-builder",
67
+ "host": {
68
+ "online": "https://easyv.dtstack.com",
69
+ "test": "http://172.16.10.70:1337"
70
+ },
71
+ "assets": "https://easyv-develop.oss-cn-hangzhou.aliyuncs.com/"
72
+ },
73
+ "publishConfig": {
74
+ "registry": "https://registry.npmjs.org/"
75
+ }
76
+ }
@@ -1,51 +1,51 @@
1
- <!DOCTYPE html>
2
- <html lang="zh">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <meta http-equiv="X-UA-Compatible" content="ie=edge" />
7
- <title><%= module_name %></title>
8
- </head>
9
- <body>
10
- <div id="root"></div>
11
-
12
- <script src="static/react/umd/react.development.js"></script>
13
- <script src="static/react-dom/umd/react-dom.development.js"></script>
14
- <script src="static/@easyv/react-gui/lib/index.js"></script>
15
- <script>
16
- window.react = React;
17
- window["@easyv/react-gui"] = window["react-gui"];
18
- </script>
19
- <script src="static/@easyv/simulator/lib/index.js"></script>
20
- <script>
21
- window.appConfig = {
22
- ASSETS_URL: "<%= assets %>",
23
- };
24
- window.addEventListener("load", () => {
25
- const child = window["__MAIN__"].default;
26
- const subConfigs = child.getDefaultChildrenConfig
27
- ? child.getDefaultChildrenConfig()
28
- : [];
29
- const subDatas = child.getDefaultChildrenData
30
- ? child.getDefaultChildrenData()
31
- : [];
32
-
33
- const DevGUI = window["easyv-simulator"].default;
34
-
35
- ReactDOM.render(
36
- React.createElement(
37
- DevGUI,
38
- {
39
- config: child.getDefaultConfig(),
40
- data: child.getDefaultData(),
41
- subConfigs,
42
- subDatas,
43
- },
44
- React.createElement(child)
45
- ),
46
- document.getElementById("root")
47
- );
48
- });
49
- </script>
50
- </body>
51
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="zh">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <meta http-equiv="X-UA-Compatible" content="ie=edge" />
7
+ <title><%= module_name %></title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+
12
+ <script src="static/react/umd/react.development.js"></script>
13
+ <script src="static/react-dom/umd/react-dom.development.js"></script>
14
+ <script src="static/@easyv/react-gui/lib/index.js"></script>
15
+ <script>
16
+ window.react = React;
17
+ window["@easyv/react-gui"] = window["react-gui"];
18
+ </script>
19
+ <script src="static/@easyv/simulator/lib/index.js"></script>
20
+ <script>
21
+ window.appConfig = {
22
+ ASSETS_URL: "<%= assets %>",
23
+ };
24
+ window.addEventListener("load", () => {
25
+ const child = window["__MAIN__"].default;
26
+ const subConfigs = child.getDefaultChildrenConfig
27
+ ? child.getDefaultChildrenConfig()
28
+ : [];
29
+ const subDatas = child.getDefaultChildrenData
30
+ ? child.getDefaultChildrenData()
31
+ : [];
32
+
33
+ const DevGUI = window["easyv-simulator"].default;
34
+
35
+ ReactDOM.render(
36
+ React.createElement(
37
+ DevGUI,
38
+ {
39
+ config: child.getDefaultConfig(),
40
+ data: child.getDefaultData(),
41
+ subConfigs,
42
+ subDatas,
43
+ },
44
+ React.createElement(child)
45
+ ),
46
+ document.getElementById("root")
47
+ );
48
+ });
49
+ </script>
50
+ </body>
51
+ </html>
package/public/home.ejs CHANGED
@@ -1,21 +1,21 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>List of Component</title>
7
- </head>
8
- <body>
9
- <h1>List of Component</h1>
10
- <ul id="list"></ul>
11
- <script>
12
- const modules = `<%= modules %>`;
13
- const list = document.getElementById("list");
14
- modules.split(",").map((name) => {
15
- const li = document.createElement("li");
16
- li.innerHTML = `<a href="${name}.html">${name}</a>`;
17
- list.appendChild(li);
18
- });
19
- </script>
20
- </body>
21
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>List of Component</title>
7
+ </head>
8
+ <body>
9
+ <h1>List of Component</h1>
10
+ <ul id="list"></ul>
11
+ <script>
12
+ const modules = `<%= modules %>`;
13
+ const list = document.getElementById("list");
14
+ modules.split(",").map((name) => {
15
+ const li = document.createElement("li");
16
+ li.innerHTML = `<a href="${name}.html">${name}</a>`;
17
+ list.appendChild(li);
18
+ });
19
+ </script>
20
+ </body>
21
+ </html>
File without changes
@@ -1,14 +1,14 @@
1
- {
2
- "data": [
3
- {
4
- "text": "React16 演示模版"
5
- }
6
- ],
7
- "fields": [
8
- {
9
- "name": "text",
10
- "value": "text",
11
- "desc": "文本"
12
- }
13
- ]
14
- }
1
+ {
2
+ "data": [
3
+ {
4
+ "text": "React16 演示模版"
5
+ }
6
+ ],
7
+ "fields": [
8
+ {
9
+ "name": "text",
10
+ "value": "text",
11
+ "desc": "文本"
12
+ }
13
+ ]
14
+ }
@@ -1,6 +1,6 @@
1
- {
2
- "base": {},
3
- "width": 200,
4
- "height": 70,
5
- "configuration": []
6
- }
1
+ {
2
+ "base": {},
3
+ "width": 200,
4
+ "height": 70,
5
+ "configuration": []
6
+ }
@@ -1,26 +1,26 @@
1
- import React from "react";
2
- import css from "./styles/index.module.css";
3
-
4
- export default function (props) {
5
- const { left, top, width, height, id, data } = props;
6
-
7
- // 自定义逻辑
8
- const styles = {
9
- position: "absolute",
10
- left,
11
- top,
12
- width,
13
- height,
14
- textAlign: "center",
15
- };
16
-
17
- /**
18
- * 固定格式: 返回的div必须有className/id属性
19
- */
20
- return (
21
- <div className="__easyv-component" style={styles} id={id}>
22
- <img src={require("./assets/logo.png")} />
23
- <div className={css.title}>{data[0].text}</div>
24
- </div>
25
- );
26
- }
1
+ import React from "react";
2
+ import css from "./styles/index.module.css";
3
+
4
+ export default function (props) {
5
+ const { left, top, width, height, id, data } = props;
6
+
7
+ // 自定义逻辑
8
+ const styles = {
9
+ position: "absolute",
10
+ left,
11
+ top,
12
+ width,
13
+ height,
14
+ textAlign: "center",
15
+ };
16
+
17
+ /**
18
+ * 固定格式: 返回的div必须有className/id属性
19
+ */
20
+ return (
21
+ <div className="__easyv-component" style={styles} id={id}>
22
+ <img src={require("./assets/logo.png")} />
23
+ <div className={css.title}>{data[0].text}</div>
24
+ </div>
25
+ );
26
+ }
@@ -1,3 +1,3 @@
1
- .title {
2
- color: skyblue;
3
- }
1
+ .title {
2
+ color: skyblue;
3
+ }
@@ -1,11 +1,11 @@
1
- export function bindChildren(configs,data){
2
- const bindedChildren = configs.map((config) =>{
3
- let childData = data.find((d)=>(d.id === config.id))
4
- return{
5
- id:config.id,
6
- config,
7
- data:childData
8
- }
9
- });
10
- return bindedChildren;
1
+ export function bindChildren(configs,data){
2
+ const bindedChildren = configs.map((config) =>{
3
+ let childData = data.find((d)=>(d.id === config.id))
4
+ return{
5
+ id:config.id,
6
+ config,
7
+ data:childData
8
+ }
9
+ });
10
+ return bindedChildren;
11
11
  }
@@ -1,21 +1,21 @@
1
- let notAtomConfigTypes = ['array', 'object', 'group', 'colors', 'menu', 'modal', 'rangeColor'];
2
- export function reduceConfig(config) {
3
- if (!Array.isArray(config)) {
4
- return config;
5
- }
6
- return config.reduce((result, item) => {
7
- result[item.name] = item.type && !notAtomConfigTypes.includes(item.type) ? item.value : reduceConfig(item.value);
8
- return result;
9
- }, {});
10
- }
11
-
12
- // 用于解析3.15之前的老版本带下划线的配置
13
- export function reduceConfigWithUndeline(config) {
14
- if (!Array.isArray(config)) {
15
- return config;
16
- }
17
- return config.reduce((result, item) => {
18
- result[item._name] = item._type && !notAtomConfigTypes.includes(item._type) ? item._value : reduceConfigWithUndeline(item._value);
19
- return result;
20
- }, {});
1
+ let notAtomConfigTypes = ['array', 'object', 'group', 'colors', 'menu', 'modal', 'rangeColor'];
2
+ export function reduceConfig(config) {
3
+ if (!Array.isArray(config)) {
4
+ return config;
5
+ }
6
+ return config.reduce((result, item) => {
7
+ result[item.name] = item.type && !notAtomConfigTypes.includes(item.type) ? item.value : reduceConfig(item.value);
8
+ return result;
9
+ }, {});
10
+ }
11
+
12
+ // 用于解析3.15之前的老版本带下划线的配置
13
+ export function reduceConfigWithUndeline(config) {
14
+ if (!Array.isArray(config)) {
15
+ return config;
16
+ }
17
+ return config.reduce((result, item) => {
18
+ result[item._name] = item._type && !notAtomConfigTypes.includes(item._type) ? item._value : reduceConfigWithUndeline(item._value);
19
+ return result;
20
+ }, {});
21
21
  }
@@ -1,14 +1,14 @@
1
- {
2
- "data": [
3
- {
4
- "text": "我是文字组件"
5
- }
6
- ],
7
- "fields": [
8
- {
9
- "name": "text",
10
- "value": "text",
11
- "desc": "文本"
12
- }
13
- ]
14
- }
1
+ {
2
+ "data": [
3
+ {
4
+ "text": "我是文字组件"
5
+ }
6
+ ],
7
+ "fields": [
8
+ {
9
+ "name": "text",
10
+ "value": "text",
11
+ "desc": "文本"
12
+ }
13
+ ]
14
+ }
@@ -1,76 +1,76 @@
1
- {
2
- "base": {},
3
- "width": 600,
4
- "height": 600,
5
- "configuration": [
6
- {
7
- "name": "chart",
8
- "displayName": "组件",
9
- "value": [
10
- {
11
- "name": "visionConfig",
12
- "displayName": "视效配置",
13
- "value": [
14
- {
15
- "name": "cameraConfig",
16
- "displayName": "相机",
17
- "value": [
18
- {
19
- "name": "fov",
20
- "displayName": "视角",
21
- "value": 45,
22
- "config": {
23
- "min": 15,
24
- "max": 165
25
- }
26
- },
27
- {
28
- "name": "position",
29
- "displayName": "位置",
30
- "value": [
31
- {
32
- "name": "x",
33
- "displayName": "x",
34
- "value": 100
35
- },
36
- {
37
- "name": "y",
38
- "displayName": "y",
39
- "value": 100
40
- },
41
- {
42
- "name": "z",
43
- "displayName": "z",
44
- "value": 100
45
- }
46
- ]
47
- },
48
- {
49
- "name": "target",
50
- "displayName": "聚焦点",
51
- "value": [
52
- {
53
- "name": "x",
54
- "displayName": "x",
55
- "value": 0
56
- },
57
- {
58
- "name": "y",
59
- "displayName": "y",
60
- "value": 0
61
- },
62
- {
63
- "name": "z",
64
- "displayName": "z",
65
- "value": 0
66
- }
67
- ]
68
- }
69
- ]
70
- }
71
- ]
72
- }
73
- ]
74
- }
75
- ]
76
- }
1
+ {
2
+ "base": {},
3
+ "width": 600,
4
+ "height": 600,
5
+ "configuration": [
6
+ {
7
+ "name": "chart",
8
+ "displayName": "组件",
9
+ "value": [
10
+ {
11
+ "name": "visionConfig",
12
+ "displayName": "视效配置",
13
+ "value": [
14
+ {
15
+ "name": "cameraConfig",
16
+ "displayName": "相机",
17
+ "value": [
18
+ {
19
+ "name": "fov",
20
+ "displayName": "视角",
21
+ "value": 45,
22
+ "config": {
23
+ "min": 15,
24
+ "max": 165
25
+ }
26
+ },
27
+ {
28
+ "name": "position",
29
+ "displayName": "位置",
30
+ "value": [
31
+ {
32
+ "name": "x",
33
+ "displayName": "x",
34
+ "value": 100
35
+ },
36
+ {
37
+ "name": "y",
38
+ "displayName": "y",
39
+ "value": 100
40
+ },
41
+ {
42
+ "name": "z",
43
+ "displayName": "z",
44
+ "value": 100
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ "name": "target",
50
+ "displayName": "聚焦点",
51
+ "value": [
52
+ {
53
+ "name": "x",
54
+ "displayName": "x",
55
+ "value": 0
56
+ },
57
+ {
58
+ "name": "y",
59
+ "displayName": "y",
60
+ "value": 0
61
+ },
62
+ {
63
+ "name": "z",
64
+ "displayName": "z",
65
+ "value": 0
66
+ }
67
+ ]
68
+ }
69
+ ]
70
+ }
71
+ ]
72
+ }
73
+ ]
74
+ }
75
+ ]
76
+ }