@cloudbase/lowcode-builder 1.8.64 → 1.8.65
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/lowcode-builder",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.65",
|
|
4
4
|
"description": "云开发 Tencent CloudBase Framework Low Code Plugin,将低码配置生成完整项目并一键部署云开发资源。",
|
|
5
5
|
"author": "yhsunshining@gmail.com",
|
|
6
6
|
"homepage": "https://github.com/TencentCloudBase/cloudbase-framework#readme",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@babel/core": "7.21.4",
|
|
48
48
|
"@babel/preset-env": "7.21.4",
|
|
49
|
-
"@cloudbase/cals": "^1.0.
|
|
50
|
-
"@cloudbase/lowcode-generator": "^1.8.
|
|
49
|
+
"@cloudbase/cals": "^1.0.51",
|
|
50
|
+
"@cloudbase/lowcode-generator": "^1.8.19",
|
|
51
51
|
"axios": "^0.21.0",
|
|
52
52
|
"browserfs": "^1.4.3",
|
|
53
53
|
"browserify-zlib": "^0.2.0",
|
|
@@ -543,7 +543,7 @@
|
|
|
543
543
|
crossorigin
|
|
544
544
|
src="<%=
|
|
545
545
|
cdnEndpoints.cdngo
|
|
546
|
-
%>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.
|
|
546
|
+
%>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.3897a073a34a755db5d0.bundle.js"
|
|
547
547
|
></script>
|
|
548
548
|
</body>
|
|
549
549
|
</html>
|
|
@@ -3,6 +3,10 @@ import * as $$<%= mod %> from '../lowcode/common/<%= mod %>'<%}) %>
|
|
|
3
3
|
|
|
4
4
|
const _weapps_app_common = {}
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* 合并逻辑主要担心之前存在引用
|
|
8
|
+
* 实际上可以遵照web实现互斥,有 default 则使用 default 否则 module
|
|
9
|
+
*/
|
|
6
10
|
function getDefaultModule(targetModule) {
|
|
7
11
|
if (!targetModule) {
|
|
8
12
|
return
|
|
@@ -11,7 +15,29 @@ function getDefaultModule(targetModule) {
|
|
|
11
15
|
if (keys.length === 1 && keys[0] === 'default') {
|
|
12
16
|
return targetModule.default
|
|
13
17
|
}
|
|
14
|
-
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
if (keys.includes('default')) {
|
|
21
|
+
let module = targetModule.default || {};
|
|
22
|
+
for (const key in targetModule) {
|
|
23
|
+
try {
|
|
24
|
+
if (module[key] !== undefined) {
|
|
25
|
+
// reportEvent(`${tag}.mergeconflict`);
|
|
26
|
+
} else if (key !== 'default') {
|
|
27
|
+
/**
|
|
28
|
+
* 兼容之前写法进行数据合并
|
|
29
|
+
*/
|
|
30
|
+
module[key] = targetModule[key];
|
|
31
|
+
}
|
|
32
|
+
} catch (e) {
|
|
33
|
+
// reportEvent(`${tag}.unmergeable`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return module;
|
|
37
|
+
}
|
|
38
|
+
} catch (e) {}
|
|
39
|
+
|
|
40
|
+
return targetModule;
|
|
15
41
|
}
|
|
16
42
|
|
|
17
43
|
Object.defineProperties(_weapps_app_common, {
|
|
@@ -64,6 +64,27 @@ export function createEventHandlers(
|
|
|
64
64
|
) {
|
|
65
65
|
const { looseError = false, isComposite = false, syncCall = false } = options;
|
|
66
66
|
const evtHandlers = {};
|
|
67
|
+
function proxyWrapper(target, compareTarget, key) {
|
|
68
|
+
try {
|
|
69
|
+
return new Proxy(target, {
|
|
70
|
+
get(target, p) {
|
|
71
|
+
if (p !== 'id') {
|
|
72
|
+
if (
|
|
73
|
+
(key === 'currentTarget' || key === 'target') &&
|
|
74
|
+
p !== '_userWidget' &&
|
|
75
|
+
target[p] !== compareTarget?.[p]
|
|
76
|
+
) {
|
|
77
|
+
// console.log(`@deprecated event.${key}.${String(p)}`);
|
|
78
|
+
reportEvent(`event.${key}.${String(p)}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return target[p];
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
} catch (e) {
|
|
85
|
+
return target;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
67
88
|
for (const name in evtListeners) {
|
|
68
89
|
const listeners = evtListeners[name];
|
|
69
90
|
evtHandlers[name] = function (event = {}) {
|
|
@@ -71,8 +92,8 @@ export function createEventHandlers(
|
|
|
71
92
|
const owner = this._getInstance();
|
|
72
93
|
const target = !!event?.target?.id ? getWidget(owner.widgets, event.target.id) : undefined;
|
|
73
94
|
const currentTarget = !!event?.currentTarget?.id ? getWidget(owner.widgets, event.currentTarget.id) : undefined;
|
|
74
|
-
event.target = target;
|
|
75
|
-
event.currentTarget = currentTarget;
|
|
95
|
+
event.target = proxyWrapper(target, target?._userWidget, 'target');
|
|
96
|
+
event.currentTarget = proxyWrapper(currentTarget, currentTarget?._userWidget, 'currentTarget');
|
|
76
97
|
const [prefix = '', trigger] = name.split('$');
|
|
77
98
|
// The page event handler
|
|
78
99
|
const forContext = (!!currentTarget && generateForContextOfWidget(currentTarget)) || {};
|
|
@@ -825,3 +846,15 @@ export function patchWdigetPropsWithEvtListeners(widgetProps, evtListeners) {
|
|
|
825
846
|
}
|
|
826
847
|
return widgetProps;
|
|
827
848
|
}
|
|
849
|
+
|
|
850
|
+
|
|
851
|
+
export function reportEvent(tag) {
|
|
852
|
+
try {
|
|
853
|
+
const { envVersion } = app.__internal__?.getConfig?.() || {};
|
|
854
|
+
// console.log('>>>>>>reportevent:', tag);
|
|
855
|
+
getApp().globalData._aegis?.reportEvent?.({
|
|
856
|
+
name: tag,
|
|
857
|
+
ext2: envVersion,
|
|
858
|
+
});
|
|
859
|
+
} catch (e) {}
|
|
860
|
+
}
|
|
@@ -32,6 +32,11 @@ initTcb()
|
|
|
32
32
|
|
|
33
33
|
<% if(cdnEndpoints.aegis){ %>
|
|
34
34
|
require.async('../packages/$wd_system/index.js').then(({ Aegis }) => {
|
|
35
|
-
new Aegis(AEGIS_CONFIG)
|
|
35
|
+
let _aegis = new Aegis(AEGIS_CONFIG);
|
|
36
|
+
const app = getApp();
|
|
37
|
+
if(!app.globalData) {
|
|
38
|
+
app.globalData = {}
|
|
39
|
+
}
|
|
40
|
+
app.globalData._aegis = _aegis;
|
|
36
41
|
})
|
|
37
42
|
<% }%>
|