@cloudbase/lowcode-builder 1.3.15-private.1 → 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.
@@ -146,9 +146,7 @@ async function installMaterials(ctx, projDir, usedComps, weapps) {
146
146
  comp.materialName = lib.name;
147
147
  });
148
148
  });
149
- // Collection infomation from components to lib meta
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
- cmp.meta.platforms = {
163
- mp: {
164
- path: `${cmp.name}/index`,
165
- },
166
- };
167
- lib.dependencies = { ...lib.dependencies, ...cmp.npmDependencies };
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}`);
@@ -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.1",
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,7 +38,7 @@
38
38
  "url": "https://github.com/TencentCloudBase/cloudbase-framework/issues"
39
39
  },
40
40
  "dependencies": {
41
- "@cloudbase/cals": "^0.5.11",
41
+ "@cloudbase/cals": "^0.5.12",
42
42
  "@cloudbase/lowcode-generator": "1.3.7-private.1",
43
43
  "axios": "^0.21.0",
44
44
  "browserfs": "^1.4.3",
@@ -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.dd7f29a986538b6b1dce.bundle.js"
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>
@@ -5,7 +5,7 @@ page {
5
5
  box-sizing: border-box;
6
6
  }
7
7
 
8
- page view, page element, page text, page image {
8
+ page, page view, page element, page text, page image {
9
9
  box-sizing: border-box;
10
10
  }
11
11
 
@@ -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` : '';
@@ -729,6 +729,10 @@ class UserWidget {
729
729
  // return target._widget[prop];
730
730
  return undefined;
731
731
  },
732
+ /**
733
+ * userwidget 不可写
734
+ */
735
+ set() {},
732
736
  });
733
737
  }
734
738
 
@@ -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 (