@builder6/pages 0.7.9 → 0.7.11
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/pages/pages.controller.js +1 -1
- package/package.json +3 -3
- package/views/amis.liquid +55 -0
- package/views/layout/theme.liquid +13 -0
- package/views/react.liquid +22 -0
- package/views/page.liquid +0 -3
|
@@ -24,7 +24,7 @@ let PagesController = class PagesController {
|
|
|
24
24
|
return 'Welcome to Builder6 Pages!';
|
|
25
25
|
}
|
|
26
26
|
async getDemo(appId, pageId, query, res) {
|
|
27
|
-
const template =
|
|
27
|
+
const template = pageId;
|
|
28
28
|
const config = (0, core_1.getConfigs)();
|
|
29
29
|
try {
|
|
30
30
|
const rendered = await this.pagesService.render(template, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder6/pages",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.11",
|
|
4
4
|
"main": "dist/plugin.module.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"build:watch": "rm -rf dist && tsc --watch"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@builder6/core": "^0.7.
|
|
15
|
+
"@builder6/core": "^0.7.11",
|
|
16
16
|
"dataloader": "^2.2.3",
|
|
17
17
|
"liquidjs": "^10.19.0"
|
|
18
18
|
},
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "3dabc85d340b91687f80ac13ea0469a3bee78f8a"
|
|
23
23
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{% layout 'layout/theme.liquid' %}
|
|
2
|
+
|
|
3
|
+
{% block content %}
|
|
4
|
+
<head>
|
|
5
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
6
|
+
|
|
7
|
+
<script src="{{config.unpkg.url}}/@builder6/sdk@2.2.5/dist/index.umd.js"></script>
|
|
8
|
+
|
|
9
|
+
<script src="{{config.unpkg.url}}/@steedos-widgets/amis@6.3.0-patch.3/sdk/sdk.js"></script>
|
|
10
|
+
<link rel="stylesheet" href="{{config.unpkg.url}}/@steedos-widgets/amis@6.3.0-patch.3/lib/themes/antd.css" />
|
|
11
|
+
<link rel="stylesheet" href="{{config.unpkg.url}}/@steedos-widgets/amis@6.3.0-patch.3/lib/helper.css" />
|
|
12
|
+
<link rel="stylesheet" href="{{config.unpkg.url}}/@steedos-widgets/amis@6.3.0-patch.3/sdk/iconfont.css" />
|
|
13
|
+
<script async>
|
|
14
|
+
window['React'] = amisRequire('react');
|
|
15
|
+
window['ReactDOM'] = amisRequire('react-dom');
|
|
16
|
+
window['moment'] = amisRequire('moment');
|
|
17
|
+
</script>
|
|
18
|
+
</head>
|
|
19
|
+
|
|
20
|
+
<div id="root" class="w-full h-full"></div>
|
|
21
|
+
|
|
22
|
+
<script type="text/javascript">
|
|
23
|
+
(function () {
|
|
24
|
+
let amis = amisRequire('amis/embed');
|
|
25
|
+
// 通过替换下面这个配置来生成不同页面
|
|
26
|
+
let amisJSON = {
|
|
27
|
+
type: 'page',
|
|
28
|
+
title: '表单页面',
|
|
29
|
+
body: {
|
|
30
|
+
type: 'form',
|
|
31
|
+
mode: 'horizontal',
|
|
32
|
+
api: '/saveForm',
|
|
33
|
+
body: [
|
|
34
|
+
{
|
|
35
|
+
label: 'Name',
|
|
36
|
+
type: 'input-text',
|
|
37
|
+
name: 'name'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: 'Email',
|
|
41
|
+
type: 'input-email',
|
|
42
|
+
name: 'email'
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const props = {};
|
|
48
|
+
const env = {
|
|
49
|
+
theme: 'antd'
|
|
50
|
+
};
|
|
51
|
+
let amisScoped = amis.embed('#root', amisJSON, props, env);
|
|
52
|
+
})();
|
|
53
|
+
</script>
|
|
54
|
+
Hello
|
|
55
|
+
{% endblock %}
|
|
@@ -0,0 +1,13 @@
|
|
|
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>Builder6</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<main>
|
|
10
|
+
{% block content %}{% endblock %}
|
|
11
|
+
</main>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{% layout 'layout/theme.liquid' %}
|
|
2
|
+
|
|
3
|
+
{% block content %}
|
|
4
|
+
|
|
5
|
+
<!-- 引入 React 和 ReactDOM -->
|
|
6
|
+
<script src="{{config.unpkg.url}}/react@18/umd/react.development.js" crossorigin></script>
|
|
7
|
+
<script src="{{config.unpkg.url}}/react-dom@18/umd/react-dom.development.js" crossorigin></script>
|
|
8
|
+
<!-- Babel 编译器 -->
|
|
9
|
+
<script src="{{config.unpkg.url}}/@babel/standalone/babel.min.js"></script>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
<div id="root" class="w-full h-full"></div>
|
|
13
|
+
<script type="text/babel">
|
|
14
|
+
const App = () => {
|
|
15
|
+
return <h1>Hello, React in Browser!</h1>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// 挂载到 DOM 上
|
|
19
|
+
const root = ReactDOM.createRoot(document.getElementById('root'));
|
|
20
|
+
root.render(<App />);
|
|
21
|
+
</script>
|
|
22
|
+
{% endblock %}
|
package/views/page.liquid
DELETED