@steedos/service-pages 2.2.17 → 2.2.18
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.
|
@@ -64,7 +64,10 @@ function injectScript(src) {
|
|
|
64
64
|
|
|
65
65
|
injectScript('/unpkg.com/@steedos-builder/react/dist/builder-react.unpkg.js')
|
|
66
66
|
.then(() => {
|
|
67
|
-
console.log('Builder loaded!');
|
|
67
|
+
console.log('Builder React loaded!');
|
|
68
|
+
window.define.amd = undefined;
|
|
69
|
+
window.ReactDOM = ReactDom;
|
|
70
|
+
|
|
68
71
|
const BuilderSDK = BuilderReact;
|
|
69
72
|
|
|
70
73
|
window.BuilderReact = BuilderReact;
|
|
@@ -74,44 +77,19 @@ injectScript('/unpkg.com/@steedos-builder/react/dist/builder-react.unpkg.js')
|
|
|
74
77
|
window.BuilderComponent = BuilderReact.BuilderComponent;
|
|
75
78
|
window.builder = BuilderReact.builder;
|
|
76
79
|
|
|
77
|
-
Builder.set({
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
// window['lodash'] = require('lodash');
|
|
81
|
-
|
|
82
|
-
Builder.registerImportMap({
|
|
83
|
-
"lodash": '/js/requirejs/lodash',
|
|
84
|
-
"react": '/js/requirejs/react',
|
|
85
|
-
"react-dom": '/js/requirejs/react-dom',
|
|
86
|
-
"@steedos-builder/sdk": '/js/requirejs/builder-sdk',
|
|
87
|
-
"@steedos-builder/react": '/js/requirejs/builder-react',
|
|
80
|
+
Builder.set({
|
|
81
|
+
rootUrl: __meteor_runtime_config__.ROOT_URL,
|
|
82
|
+
unpkgUrl: Meteor.settings.public.unpkgUrl || 'https://unpkg.com'
|
|
88
83
|
})
|
|
89
|
-
Builder.require(['lodash',"react", "react-dom"])
|
|
90
|
-
|
|
91
|
-
Builder.requirejs.config(
|
|
92
|
-
{
|
|
93
|
-
waitSeconds: 60,
|
|
94
|
-
baseUrl: '',
|
|
95
|
-
paths: {
|
|
96
|
-
'vs': '/unpkg.com/monaco-editor/min/vs',
|
|
97
|
-
"vs/language/css/cssMode":"/unpkg.com/monaco-editor/min/vs/language/css/cssMode",
|
|
98
|
-
"vs/language/html/htmlMode":"/unpkg.com/monaco-editor/min/vs/language/html/htmlMode",
|
|
99
|
-
"vs/language/typescript/tsMode":"/unpkg.com/monaco-editor/min/vs/language/typescript/tsMode",
|
|
100
|
-
"vs/language/json/jsonMode":"/unpkg.com/monaco-editor/min/vs/language/json/jsonMode"
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
Builder.requirejs(['vs/editor/editor.main'], () => {
|
|
105
|
-
return monaco = window['monaco'];
|
|
106
|
-
});
|
|
107
84
|
|
|
108
85
|
if(Meteor.settings.public.page && Meteor.settings.public.page.assetUrls){
|
|
109
86
|
const defaultAssetsUrls = Meteor.settings.public.page.assetUrls.split(',')
|
|
110
87
|
Builder.registerRemoteAssets(defaultAssetsUrls)
|
|
111
88
|
}
|
|
112
|
-
|
|
89
|
+
|
|
113
90
|
window.postMessage({ type: "Builder.loaded" })
|
|
114
91
|
|
|
115
92
|
}).catch(error => {
|
|
116
93
|
console.error(error);
|
|
117
|
-
});
|
|
94
|
+
});
|
|
95
|
+
|
|
@@ -1,13 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: baozhoutao@steedos.com
|
|
3
|
+
* @Date: 2022-04-04 16:34:28
|
|
4
|
+
* @Description:
|
|
5
|
+
*/
|
|
1
6
|
const express = require("express");
|
|
2
7
|
const router = express.Router();
|
|
3
8
|
const core = require('@steedos/core');
|
|
4
9
|
const fs = require('fs');
|
|
5
|
-
|
|
10
|
+
const _ = require('lodash');
|
|
6
11
|
router.get('/api/pageDesign', core.requireAuthentication, async function (req, res) {
|
|
7
12
|
try {
|
|
8
13
|
res.set('Content-Type', 'text/html');
|
|
9
14
|
const userSession = req.user;
|
|
10
|
-
|
|
15
|
+
let assetUrl = "";
|
|
16
|
+
if(process.env.STEEDOS_PUBLIC_PAGE_ASSETURLS && _.isString(process.env.STEEDOS_PUBLIC_PAGE_ASSETURLS)){
|
|
17
|
+
const assetUrls = process.env.STEEDOS_PUBLIC_PAGE_ASSETURLS.split(',');
|
|
18
|
+
assetUrl = `assetUrl=${assetUrls.join("&assetUrl=")}&`;
|
|
19
|
+
}
|
|
20
|
+
const steedosBuilderHost = `https://builder.steedos.com/amis?${assetUrl}rootUrl=${__meteor_runtime_config__.ROOT_URL}&authToken=${userSession.authToken}&userId=${userSession.userId}&tenantId=${userSession.spaceId}&__q=`;
|
|
11
21
|
|
|
12
22
|
let data = fs.readFileSync(__dirname+'/design.html', 'utf8');
|
|
13
23
|
res.send(data.replace('SteedosBuilderHost',steedosBuilderHost));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-pages",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.18",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"scripts": {},
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@builder.io/react": "^1.1.50"
|
|
13
13
|
},
|
|
14
|
-
"gitHead": "
|
|
14
|
+
"gitHead": "4b9d49b8610ad4b0e18f71d0db33cf4f2f1b58e9"
|
|
15
15
|
}
|