@cloudbase/lowcode-builder 1.8.43 → 1.8.44-alpha.0
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/builder.web.js +3 -3
- package/lib/builder/mp/index.js +9 -7
- package/lib/builder.web.js +3 -3
- package/package.json +3 -3
- package/template/mp/common/util.js +16 -3
- package/template/mp/package.json +1 -1
- package/template/mp/page/api.js +3 -1
- package/template/.DS_Store +0 -0
- package/template/mp/.DS_Store +0 -0
- package/template/mp/common/.DS_Store +0 -0
package/lib/builder/mp/index.js
CHANGED
|
@@ -325,7 +325,7 @@ async function generatePkg(ctx, weapp, appRoot, pageConfigs) {
|
|
|
325
325
|
console.log(`Generating ${em('page')} files`);
|
|
326
326
|
(0, generateFiles_1.cleanDir)(path_1.default.join(appRoot, 'pages'), []);
|
|
327
327
|
await Promise.all(weapp.pageInstanceList.map(async (page, index) => {
|
|
328
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
328
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
329
329
|
// # Generating page
|
|
330
330
|
const rootPath = weapp.rootPath || '';
|
|
331
331
|
const usingComponents = {};
|
|
@@ -346,8 +346,10 @@ async function generatePkg(ctx, weapp, appRoot, pageConfigs) {
|
|
|
346
346
|
const pageFileData = {
|
|
347
347
|
[`api.js|api.js`]: {
|
|
348
348
|
subLevelPath: rootPath ? `${path_1.default.posix.relative(rootPath, '')}/` : '',
|
|
349
|
+
packageName: rootPath || '',
|
|
350
|
+
subAppId: rootPath ? ((_a = weapp.extra) === null || _a === void 0 ? void 0 : _a.id) || weapp.id || '' : '',
|
|
349
351
|
uuid: rootPath ? `${rootPath}/${page.id}` : page.id,
|
|
350
|
-
label: ((
|
|
352
|
+
label: ((_c = (_b = page === null || page === void 0 ? void 0 : page.data) === null || _b === void 0 ? void 0 : _b.navigationBarTitleText) === null || _c === void 0 ? void 0 : _c.value) || ((_e = (_d = page === null || page === void 0 ? void 0 : page.data) === null || _d === void 0 ? void 0 : _d.title) === null || _e === void 0 ? void 0 : _e.value),
|
|
351
353
|
},
|
|
352
354
|
[`data.js|data.js`]: {
|
|
353
355
|
widgetProps: (0, util_2.createWidgetProps)(ctx, componentInstances),
|
|
@@ -360,16 +362,16 @@ async function generatePkg(ctx, weapp, appRoot, pageConfigs) {
|
|
|
360
362
|
eventHandlers: (0, util_2.createEventHandlers)(ctx, componentInstances, 'this', page),
|
|
361
363
|
dataBinds: (0, util_2.createDataBinds)(ctx, componentInstances),
|
|
362
364
|
pageAttributes: {
|
|
363
|
-
...(((
|
|
365
|
+
...(((_f = page.data) === null || _f === void 0 ? void 0 : _f.appShareMessage) ? { appShareMessage: page.data.appShareMessage.value } : {}),
|
|
364
366
|
},
|
|
365
367
|
debug: ctx.debugMode,
|
|
366
368
|
stringifyObj: util_1.inspect,
|
|
367
369
|
subLevelPath: rootPath ? `${path_1.default.posix.relative(rootPath, '')}/` : '',
|
|
368
370
|
importor,
|
|
369
|
-
query: (0, util_2.createTemplateQuery)(ctx, (
|
|
371
|
+
query: (0, util_2.createTemplateQuery)(ctx, (_g = page.dataset) === null || _g === void 0 ? void 0 : _g.query),
|
|
370
372
|
eventFlows: (0, util_2.createTemplateEventFlows)(ctx, page.eventFlows),
|
|
371
|
-
resetShare: ((
|
|
372
|
-
((
|
|
373
|
+
resetShare: ((_k = (_j = (_h = page === null || page === void 0 ? void 0 : page.data) === null || _h === void 0 ? void 0 : _h.appShareMessage) === null || _j === void 0 ? void 0 : _j.value) === null || _k === void 0 ? void 0 : _k.enable) ||
|
|
374
|
+
((_l = allAppUsedComps === null || allAppUsedComps === void 0 ? void 0 : allAppUsedComps[cals_1.OFFICIAL_LIB_KEY]) === null || _l === void 0 ? void 0 : _l.has('Share')) ||
|
|
373
375
|
/* 从 enablePageRoot 的版本开始支持按需reset share
|
|
374
376
|
* 否则默认都开启
|
|
375
377
|
*/ !ctx.enablePageRoot,
|
|
@@ -383,7 +385,7 @@ async function generatePkg(ctx, weapp, appRoot, pageConfigs) {
|
|
|
383
385
|
content: wxml,
|
|
384
386
|
},
|
|
385
387
|
[`index.wxss|${pageFileName}.wxss`]: {
|
|
386
|
-
subWxss: rootPath && !((
|
|
388
|
+
subWxss: rootPath && !((_m = ctx.mainAppData) === null || _m === void 0 ? void 0 : _m.mpPkgUrl)
|
|
387
389
|
? `@import "${path_1.default.posix.relative(`/${rootPath}/pages/${page.id}`, '/lowcode')}/style.wxss";`
|
|
388
390
|
: '',
|
|
389
391
|
content: (0, weapps_core_1.toCssText)((0, cals_1.processCommonStyle2CSSProperties)(page.commonStyle, {
|