lowcoder-comps 0.0.31 → 0.0.33
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/00bb478a.js +1102 -0
- package/02bef5a4.js +505 -0
- package/057d2a44.js +1127 -0
- package/0964fcc6.js +34 -0
- package/14220e98.js +1276 -0
- package/1c074fe4.js +25 -0
- package/250a6954.js +804 -0
- package/256b619e.js +92 -0
- package/2cd27cf0.js +2501 -0
- package/2f064957.js +64 -0
- package/2ff2c7a6.js +6 -0
- package/2ff7471d.js +9 -0
- package/30c4916b.js +8 -0
- package/36ec7270.js +915 -0
- package/38c14832.js +960 -0
- package/3ae34bed.js +819 -0
- package/3e2939fa.js +237 -0
- package/3f5f874f.js +86 -0
- package/3fb86fb9.js +447 -0
- package/415177f9.js +1579 -0
- package/47848c42.js +11636 -0
- package/4c6a0ece.js +162535 -0
- package/4db8e48b.js +2284 -0
- package/531065f1.js +1089 -0
- package/5a398ea8.js +881 -0
- package/5ab1614c.js +268 -0
- package/65bbb6ae.js +1536 -0
- package/777cd15c.js +48428 -0
- package/7dacfa82.js +220 -0
- package/800cf0d0.js +796 -0
- package/92e85b65.js +65 -0
- package/93e9bd3a.js +391 -0
- package/98622dfa.js +16582 -0
- package/a2e74e62.js +2967 -0
- package/a61c3bd3.js +5 -0
- package/b8f48ff4.js +769 -0
- package/bd0f5f65.js +319 -0
- package/bf4428f5.js +1269 -0
- package/cb1972f7.js +455 -0
- package/dfc10c94.js +818 -0
- package/ed2c9753.js +208 -0
- package/ef2833e6.js +927 -0
- package/f9637058.js +16 -0
- package/f9e72519.js +1284 -0
- package/fe063d15.js +19339 -0
- package/index.js +5 -0
- package/package.json +30 -3
- package/README.md +0 -120
- package/index.html +0 -26
- package/index.tsx +0 -21
- package/jest.config.js +0 -6
- package/src/__test__/allComp.test.tsx +0 -61
- package/src/app-env.d.ts +0 -3
- package/src/comps/calendarComp/calendarComp.tsx +0 -633
- package/src/comps/calendarComp/calendarConstants.tsx +0 -1048
- package/src/comps/calendarComp/errorBoundary.tsx +0 -30
- package/src/comps/chartComp/chartComp.tsx +0 -442
- package/src/comps/chartComp/chartConfigs/barChartConfig.tsx +0 -51
- package/src/comps/chartComp/chartConfigs/cartesianAxisConfig.tsx +0 -307
- package/src/comps/chartComp/chartConfigs/chartUrls.tsx +0 -9
- package/src/comps/chartComp/chartConfigs/legendConfig.tsx +0 -55
- package/src/comps/chartComp/chartConfigs/lineChartConfig.tsx +0 -96
- package/src/comps/chartComp/chartConfigs/pieChartConfig.tsx +0 -83
- package/src/comps/chartComp/chartConfigs/scatterChartConfig.tsx +0 -62
- package/src/comps/chartComp/chartConstants.tsx +0 -299
- package/src/comps/chartComp/chartPropertyView.tsx +0 -235
- package/src/comps/chartComp/chartUtils.ts +0 -291
- package/src/comps/chartComp/reactEcharts/core.tsx +0 -194
- package/src/comps/chartComp/reactEcharts/index.ts +0 -21
- package/src/comps/chartComp/reactEcharts/types.ts +0 -76
- package/src/comps/chartComp/seriesComp.tsx +0 -119
- package/src/comps/imageEditorComp/imageEditorClass.tsx +0 -52
- package/src/comps/imageEditorComp/imageEditorConstants.tsx +0 -109
- package/src/comps/imageEditorComp/index.tsx +0 -184
- package/src/comps/mermaidComp/index.tsx +0 -44
- package/src/comps/mermaidComp/mermaid.tsx +0 -29
- package/src/global.ts +0 -1
- package/src/i18n/comps/index.tsx +0 -29
- package/src/i18n/comps/locales/en.ts +0 -163
- package/src/i18n/comps/locales/enObj.tsx +0 -198
- package/src/i18n/comps/locales/index.ts +0 -7
- package/src/i18n/comps/locales/types.tsx +0 -10
- package/src/i18n/comps/locales/zh.ts +0 -156
- package/src/i18n/comps/locales/zhObj.tsx +0 -4
- package/src/index.ts +0 -11
- package/tsconfig.json +0 -22
- package/vite.config.js +0 -10
package/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.id="lowcoder-comps-0.0.33",e.appendChild(document.createTextNode("")),document.head.appendChild(e)}}catch(c){console.error("vite-plugin-css-injected-by-js",c)}})();
|
|
2
|
+
import { b9 as f } from "./4c6a0ece.js";
|
|
3
|
+
export {
|
|
4
|
+
f as default
|
|
5
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lowcoder-comps",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"dependencies": {
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
"@fullcalendar/timeline": "^6.1.6",
|
|
20
20
|
"@types/react": "^18.2.45",
|
|
21
21
|
"@types/react-dom": "^18.2.18",
|
|
22
|
+
"agora-rtc-sdk-ng": "^4.20.2",
|
|
23
|
+
"agora-rtm-sdk": "^1.5.1",
|
|
22
24
|
"big.js": "^6.2.1",
|
|
23
25
|
"echarts-extension-gmap": "^1.6.0",
|
|
24
26
|
"echarts-wordcloud": "^2.1.0",
|
|
@@ -32,6 +34,30 @@
|
|
|
32
34
|
"lowcoder": {
|
|
33
35
|
"description": "",
|
|
34
36
|
"comps": {
|
|
37
|
+
"meetingController": {
|
|
38
|
+
"name": "Agora Meeting Controller",
|
|
39
|
+
"icon": "./icons/icon-comp-calendar.svg",
|
|
40
|
+
"layoutInfo": {
|
|
41
|
+
"w": 15,
|
|
42
|
+
"h": 60
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"meetingSharing": {
|
|
46
|
+
"name": "Agora Meeting Sharing",
|
|
47
|
+
"icon": "./icons/icon-comp-calendar.svg",
|
|
48
|
+
"layoutInfo": {
|
|
49
|
+
"w": 15,
|
|
50
|
+
"h": 60
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"meetingStream": {
|
|
54
|
+
"name": "Video Stream",
|
|
55
|
+
"icon": "./icons/icon-comp-calendar.svg",
|
|
56
|
+
"layoutInfo": {
|
|
57
|
+
"w": 15,
|
|
58
|
+
"h": 60
|
|
59
|
+
}
|
|
60
|
+
},
|
|
35
61
|
"calendar": {
|
|
36
62
|
"name": "Calendar",
|
|
37
63
|
"icon": "./icons/icon-comp-calendar.svg",
|
|
@@ -64,7 +90,8 @@
|
|
|
64
90
|
"h": 40
|
|
65
91
|
}
|
|
66
92
|
}
|
|
67
|
-
}
|
|
93
|
+
},
|
|
94
|
+
"entry": "index.js"
|
|
68
95
|
},
|
|
69
96
|
"scripts": {
|
|
70
97
|
"start": "NODE_OPTIONS=--max_old_space_size=6144 vite",
|
|
@@ -78,4 +105,4 @@
|
|
|
78
105
|
"vite": "^5.0.12",
|
|
79
106
|
"vite-tsconfig-paths": "^3.6.0"
|
|
80
107
|
}
|
|
81
|
-
}
|
|
108
|
+
}
|
package/README.md
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
# Lowcoder Extra Components
|
|
2
|
-
|
|
3
|
-
This is the workspace for Lowcoder Extra Components like Calendar, Image Editor, Mermaid Charts and eCharts.
|
|
4
|
-
|
|
5
|
-
## Local Development preparation
|
|
6
|
-
|
|
7
|
-
Navigate your terminal or bash to your /root folder (lowcoder repository) to install Lowcoder Extra Components dependencies and the Lowcoder SDK
|
|
8
|
-
|
|
9
|
-
To develop with the Lowcoder Extra Components after you clone the Lowcoder Repository, first make sure the Lowcoder SDK is local built.
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
cd client/packages/lowcoder-sdk
|
|
13
|
-
yarn build
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Start
|
|
17
|
-
|
|
18
|
-
Now you can start the local dev server for Lowcoder Extra Components to develop and add your Component Plugin
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
cd client/packages/lowcoder-comps
|
|
22
|
-
yarn start
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
The local dev server will build for roughly a minute and open then a Browser Window on http://localhost:9000/ with the Lowcoder Component Builder.
|
|
26
|
-
|
|
27
|
-
## Local development
|
|
28
|
-
|
|
29
|
-
After the local dev server is started, the Lowcoder Component Builder is prepared. A new browser window should open at http://localhost:9000 This is the Components Preview, which allows you to see your new component in action, as it would work in the Lowcoder Editor.
|
|
30
|
-
|
|
31
|
-
Data, methods and properties are visible and interactive, so you can test your Component during development. The view will get automatically refreshed.
|
|
32
|
-
|
|
33
|
-
The Lowcoder Component Builder makes the development & publishing of multiple individual components as bundle possible. Find the /src/comps folder in /lowcoder-comps. Here are existing components to find. It is suggested for new components to create a new folder. In the left navigation of the Components Preview you can switch between your components.
|
|
34
|
-
|
|
35
|
-
to see your component and include it in the processing on the development server, you have to do the folloiwing steps:
|
|
36
|
-
|
|
37
|
-
### modify /lowcoder-comps/package.json
|
|
38
|
-
|
|
39
|
-
```JSON
|
|
40
|
-
"yournewcomponent": {
|
|
41
|
-
"name": "Your new Component name",
|
|
42
|
-
"icon": "./icons/your-icon.svg",
|
|
43
|
-
"description": "A Component Plugin to ...",
|
|
44
|
-
"category": "itemHandling",
|
|
45
|
-
"layoutInfo": {
|
|
46
|
-
"w": 6,
|
|
47
|
-
"h": 30
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Please choose one category out of:
|
|
54
|
-
|
|
55
|
-
- dashboards
|
|
56
|
-
- layout
|
|
57
|
-
- forms
|
|
58
|
-
- collaboration
|
|
59
|
-
- projectmanagement
|
|
60
|
-
- scheduling
|
|
61
|
-
- documents
|
|
62
|
-
- itemHandling
|
|
63
|
-
- multimedia
|
|
64
|
-
- integration
|
|
65
|
-
|
|
66
|
-
layoutInfo helps you to define the size (in grid-cells) of your Component in the grid for the very first moment, when a user drags your Component out of the components display on the right side in the Lowcoder Editor.
|
|
67
|
-
|
|
68
|
-
### modify /lowcoder-comps/src/index.ts
|
|
69
|
-
|
|
70
|
-
```JavaScript
|
|
71
|
-
Add your Component for the exported members of Lowcoder Extra Components
|
|
72
|
-
|
|
73
|
-
import { ChartCompWithDefault } from "./comps/chartComp/chartComp";
|
|
74
|
-
import { ImageEditorComp } from "./comps/imageEditorComp/index";
|
|
75
|
-
import { CalendarComp } from "./comps/calendarComp/calendarComp";
|
|
76
|
-
import { MermaidComp } from "comps/mermaidComp";
|
|
77
|
-
|
|
78
|
-
import { YourComponent } from "comps/yourComponentFolder/yourComponent";
|
|
79
|
-
|
|
80
|
-
export default {
|
|
81
|
-
chart: ChartCompWithDefault,
|
|
82
|
-
imageEditor: ImageEditorComp,
|
|
83
|
-
calendar: CalendarComp,
|
|
84
|
-
mermaid: MermaidComp,
|
|
85
|
-
|
|
86
|
-
yourcomponent: YourComponent,
|
|
87
|
-
};
|
|
88
|
-
```
|
|
89
|
-
Now your Plugin should be visibe and displayed in the Lowcoder Component Builder at http://localhost:9000/
|
|
90
|
-
|
|
91
|
-
## Build
|
|
92
|
-
|
|
93
|
-
When you finish development and all tests, you can build the Components to use it in runtime.
|
|
94
|
-
|
|
95
|
-
This will build the current Component Plugins into a .tgz file that you can upload.
|
|
96
|
-
|
|
97
|
-
**Before build you should change the version in package.json file.**
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
yarn build
|
|
101
|
-
|
|
102
|
-
# or
|
|
103
|
-
|
|
104
|
-
npm run build
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## How to publish a Component Plugin
|
|
108
|
-
|
|
109
|
-
With the following command you can publish the script to the NPM repository:
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
yarn build --publish
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
This command will publis the whole Lowcoder Extra Components bundle to [NPMjs](https://www.npmjs.com/)
|
|
116
|
-
Make sure, you updated the Version of Lowcoder Comps before in /lowcoder-comps/package.json
|
|
117
|
-
|
|
118
|
-
## Contribute your Plugin
|
|
119
|
-
|
|
120
|
-
If you wish to contribute your plugin and persist it as general Lowcoder Extra Component, please raise a PR to our /dev branch in the Lowcoder Community-Edition Repository https://github.com/lowcoder-org/lowcoder
|
package/index.html
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>Lowcoder Comp Playground</title>
|
|
8
|
-
<style>
|
|
9
|
-
#root {
|
|
10
|
-
height: 100vh;
|
|
11
|
-
}
|
|
12
|
-
#root-loader {
|
|
13
|
-
height: 100vh;
|
|
14
|
-
display: flex;
|
|
15
|
-
justify-content: center;
|
|
16
|
-
align-items: center;
|
|
17
|
-
}
|
|
18
|
-
</style>
|
|
19
|
-
</head>
|
|
20
|
-
<body>
|
|
21
|
-
<div id="root">
|
|
22
|
-
<div id="root-loader">Loading...</div>
|
|
23
|
-
</div>
|
|
24
|
-
<script src="index.tsx" type="module"></script>
|
|
25
|
-
</body>
|
|
26
|
-
</html>
|
package/index.tsx
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { createRoot } from "react-dom/client";
|
|
2
|
-
import { CompIDE } from "lowcoder-sdk";
|
|
3
|
-
import { name, version, lowcoder } from "./package.json";
|
|
4
|
-
import compMap from "./src/index";
|
|
5
|
-
|
|
6
|
-
import "lowcoder-sdk/dist/style.css";
|
|
7
|
-
|
|
8
|
-
function CompDevApp() {
|
|
9
|
-
return (
|
|
10
|
-
<CompIDE
|
|
11
|
-
compMap={compMap}
|
|
12
|
-
packageName={name}
|
|
13
|
-
packageVersion={version}
|
|
14
|
-
compMeta={lowcoder.comps}
|
|
15
|
-
/>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const container = document.querySelector("#root");
|
|
20
|
-
const root = createRoot(container!);
|
|
21
|
-
root.render(<CompDevApp />);
|
package/jest.config.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import _ from "lodash";
|
|
2
|
-
import { CompConstructor, CustomAction } from "lowcoder-core";
|
|
3
|
-
import { evalAndReduce, isExposingMethodComp } from "lowcoder-sdk";
|
|
4
|
-
import { ChartCompWithDefault } from "comps/chartComp/chartComp";
|
|
5
|
-
import log from "loglevel";
|
|
6
|
-
|
|
7
|
-
const COMPS_MAP = {
|
|
8
|
-
chart: ChartCompWithDefault,
|
|
9
|
-
} as Record<string, CompConstructor>;
|
|
10
|
-
|
|
11
|
-
const compContextActionMap = {} as Record<string, CustomAction>;
|
|
12
|
-
|
|
13
|
-
test("test comp don't change if no value change", () => {
|
|
14
|
-
Object.keys(COMPS_MAP).forEach((name) => {
|
|
15
|
-
const Comp = COMPS_MAP[name];
|
|
16
|
-
let comp = new Comp({});
|
|
17
|
-
if (compContextActionMap[name]) {
|
|
18
|
-
// set context
|
|
19
|
-
comp = comp.reduce(compContextActionMap[name]);
|
|
20
|
-
}
|
|
21
|
-
comp.getView(); // getView() is allowed when unevaluated
|
|
22
|
-
comp = evalAndReduce(comp);
|
|
23
|
-
expect(comp.node() === comp.node()).toBe(true);
|
|
24
|
-
expect(comp.node()?.evaluate() === comp.node()?.evaluate()).toBe(true);
|
|
25
|
-
const comp2 = evalAndReduce(comp);
|
|
26
|
-
if (comp2 !== comp) {
|
|
27
|
-
const comp3 = evalAndReduce(comp2);
|
|
28
|
-
if (comp3 === comp2) {
|
|
29
|
-
// log.debug(`${name} need eval twice to converge`);
|
|
30
|
-
} else {
|
|
31
|
-
const newComp = evalAndReduce(comp);
|
|
32
|
-
Object.keys((comp as any).children).forEach((key) => {
|
|
33
|
-
log.log(
|
|
34
|
-
`${key}, isEqual ${(comp as any).children[key] === (newComp as any).children[key]}`
|
|
35
|
-
);
|
|
36
|
-
});
|
|
37
|
-
throw new Error("bad " + name);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
test("comp exposing method duplicate name", () => {
|
|
44
|
-
// one comp can't expose two methods with the same name
|
|
45
|
-
Object.values(COMPS_MAP).forEach((Comp) => {
|
|
46
|
-
const comp = new Comp({});
|
|
47
|
-
const methods = [];
|
|
48
|
-
if (isExposingMethodComp(comp)) {
|
|
49
|
-
methods.push(comp.getMethodConfig());
|
|
50
|
-
}
|
|
51
|
-
const childrenMap = (comp as any).children;
|
|
52
|
-
childrenMap &&
|
|
53
|
-
Object.values(childrenMap).forEach((child) => {
|
|
54
|
-
if (isExposingMethodComp(child as any)) {
|
|
55
|
-
methods.push((child as any).getMethodConfig());
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
const allMethodName = methods.flatMap((m) => m.map((methodConfig) => methodConfig.name));
|
|
59
|
-
expect(allMethodName.length).toEqual(_.uniq(allMethodName).length);
|
|
60
|
-
});
|
|
61
|
-
});
|
package/src/app-env.d.ts
DELETED