@cloudbase/lowcode-builder 1.3.15-private.0 → 1.3.15-private.2
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/lib/builder/mp/materials.js +11 -9
- package/lib/builder/mp/util.js +2 -1
- package/package.json +3 -3
- package/template/html/index.html.ejs +1 -1
- package/template/mp/app.wxss +1 -1
- package/template/mp/common/util.js +2 -3
- package/template/mp/common/widget.js +4 -0
- package/template/mp/component/index.js +1 -0
- package/template/mp/page/index.js +1 -0
|
@@ -146,9 +146,7 @@ async function installMaterials(ctx, projDir, usedComps, weapps) {
|
|
|
146
146
|
comp.materialName = lib.name;
|
|
147
147
|
});
|
|
148
148
|
});
|
|
149
|
-
|
|
150
|
-
const compositedLibs = materialLibs.filter((lib) => lib.isComposite && usedComps[lib.name]);
|
|
151
|
-
compositedLibs.map((lib) => {
|
|
149
|
+
materialLibs.map((lib) => {
|
|
152
150
|
lib.dependencies = lib.dependencies || {};
|
|
153
151
|
lib.components.map((cmp) => {
|
|
154
152
|
cmp.meta.syncProps = {};
|
|
@@ -159,14 +157,18 @@ async function installMaterials(ctx, projDir, usedComps, weapps) {
|
|
|
159
157
|
cmp.meta.syncProps[prop] = syncProp || inputProp;
|
|
160
158
|
}
|
|
161
159
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
160
|
+
if (lib.isComposite) {
|
|
161
|
+
cmp.meta.platforms = {
|
|
162
|
+
mp: {
|
|
163
|
+
path: `${cmp.name}/index`,
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
lib.dependencies = { ...lib.dependencies, ...cmp.npmDependencies };
|
|
167
|
+
}
|
|
168
168
|
});
|
|
169
169
|
});
|
|
170
|
+
// Collection infomation from components to lib meta
|
|
171
|
+
const compositedLibs = materialLibs.filter((lib) => lib.isComposite && usedComps[lib.name]);
|
|
170
172
|
// #2 Generate composited libs
|
|
171
173
|
await Promise.all(compositedLibs.map(async (lib) => {
|
|
172
174
|
console.log(`Generate composited library ${lib.name}`);
|
package/lib/builder/mp/util.js
CHANGED
|
@@ -220,7 +220,7 @@ function getListenersHandlers(listeners, id, componentApi) {
|
|
|
220
220
|
return {};
|
|
221
221
|
const eventHandlers = {};
|
|
222
222
|
listeners.forEach((l) => {
|
|
223
|
-
var _a, _b, _c;
|
|
223
|
+
var _a, _b, _c, _d, _e;
|
|
224
224
|
const handlerName = (0, wxml_1.getMpEventHanlderName)(id, l.trigger, l);
|
|
225
225
|
eventHandlers[handlerName] = eventHandlers[handlerName] || [];
|
|
226
226
|
const params = generatedDynamicData(l.data);
|
|
@@ -243,6 +243,7 @@ function getListenersHandlers(listeners, id, componentApi) {
|
|
|
243
243
|
key: l.key || '',
|
|
244
244
|
handler,
|
|
245
245
|
handlerModule: (_c = l.handler) === null || _c === void 0 ? void 0 : _c.moduleName,
|
|
246
|
+
sourceKey: `${((_d = l.handler) === null || _d === void 0 ? void 0 : _d.moduleName) || ''}:${((_e = l.handler) === null || _e === void 0 ? void 0 : _e.name) || ''}`,
|
|
246
247
|
data: params.staticProps,
|
|
247
248
|
boundData: params.boundProps,
|
|
248
249
|
type: l.type,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/lowcode-builder",
|
|
3
|
-
"version": "1.3.15-private.
|
|
3
|
+
"version": "1.3.15-private.2",
|
|
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",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"url": "https://github.com/TencentCloudBase/cloudbase-framework/issues"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@cloudbase/cals": "^0.5.
|
|
42
|
-
"@cloudbase/lowcode-generator": "1.3.7-private.
|
|
41
|
+
"@cloudbase/cals": "^0.5.12",
|
|
42
|
+
"@cloudbase/lowcode-generator": "1.3.7-private.1",
|
|
43
43
|
"axios": "^0.21.0",
|
|
44
44
|
"browserfs": "^1.4.3",
|
|
45
45
|
"browserify-zlib": "^0.2.0",
|
|
@@ -475,7 +475,7 @@
|
|
|
475
475
|
crossorigin
|
|
476
476
|
src="<%=
|
|
477
477
|
cdnEndpoints.cdngo
|
|
478
|
-
%>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.
|
|
478
|
+
%>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.90a1845eb61a012b3d66.bundle.js"
|
|
479
479
|
></script>
|
|
480
480
|
</body>
|
|
481
481
|
</html>
|
package/template/mp/app.wxss
CHANGED
|
@@ -70,7 +70,6 @@ export function createEventHandlers(
|
|
|
70
70
|
const { lists = [], forItems = {} } = forContext;
|
|
71
71
|
const dataContext = untracked(() => generateDataContext(currentTarget));
|
|
72
72
|
const $w = untracked(() => generateWidgetAPIContext(owner?.__internal__?.$w, currentTarget, forContext));
|
|
73
|
-
|
|
74
73
|
listeners.forEach(async (l) => {
|
|
75
74
|
let { data = {}, boundData = {} } = l;
|
|
76
75
|
data = { ...data };
|
|
@@ -79,11 +78,11 @@ export function createEventHandlers(
|
|
|
79
78
|
set(data, k, boundData[k].call(owner, owner, lists, forItems, event, dataContext, $w));
|
|
80
79
|
}
|
|
81
80
|
let res = await l.handler.call(owner, { event, data });
|
|
82
|
-
let eventName = prefix && l.key ? `${prefix}$${l.key}_success` : '';
|
|
81
|
+
let eventName = prefix && l.key ? `${prefix}$${l.key}${(l.sourceKey !== 'platform:utils.If') ? '_success' : (res ? '_success' : '_fail')}` : '';
|
|
83
82
|
self[eventName] &&
|
|
84
83
|
self[eventName]({
|
|
85
84
|
...event,
|
|
86
|
-
detail: res,
|
|
85
|
+
detail: l.sourceKey === 'platform:utils.If' ? event.detail : res,
|
|
87
86
|
});
|
|
88
87
|
} catch (e) {
|
|
89
88
|
let eventName = l.key ? `${prefix}$${l.key}_fail` : '';
|
|
@@ -18,6 +18,7 @@ const evtListeners = {<% Object.entries(eventHandlers).map(([handlerName, listen
|
|
|
18
18
|
<%= handlerName%>: [
|
|
19
19
|
<%listeners.map(l=> { %>{
|
|
20
20
|
key: '<%= l.key %>',
|
|
21
|
+
sourceKey: '<%= l.sourceKey %>',
|
|
21
22
|
handler: <% if (l.type == 'rematch') {%> _handler<%= l.handler %> <%} else {%> <%= l.handler %> <%} %>,
|
|
22
23
|
data: <%= stringifyObj(l.data, {depth: null}) %>,
|
|
23
24
|
boundData: {<% Object.entries(l.boundData).map(([prop, bindMeta])=>{%>'<%= prop %>':($comp, lists, forItems, event, $context, $w) => {<%= bindMeta.imports %> return (
|
|
@@ -14,6 +14,7 @@ const evtListeners = {<% Object.entries(eventHanlders).map(([handlerName, listen
|
|
|
14
14
|
<%= handlerName%>: [
|
|
15
15
|
<%listeners.map(l=> { %>{
|
|
16
16
|
key: '<%= l.key %>',
|
|
17
|
+
sourceKey: '<%= l.sourceKey %>',
|
|
17
18
|
handler: <% if (l.type === 'rematch') {%> handlers.<%= l.handler %> <%} else if (l.type == 'material') {%> function(...args) { return require('../../materials/<%= l.handlerModule %>/actions/<%= l.handler %>/index').default(...args) } <%} else {%> <%= l.handler %> <%} %>,
|
|
18
19
|
data: <%= stringifyObj(l.data, {depth: null}) %>,
|
|
19
20
|
boundData: {<% Object.entries(l.boundData).map(([prop, bindMeta])=>{%>'<%= prop %>':($page, lists, forItems, event, $context, $w) => {<%= bindMeta.imports %> return (
|