@cloudbase/lowcode-builder 1.8.72 → 1.8.73
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/index.js +14 -5
- package/lib/builder.web.js +13 -13
- package/package.json +2 -2
- package/template/html/index.html.ejs +1 -1
- package/template/mp/common/data-patch.js +1 -1
- package/template/mp/common/merge-renderer.js +1 -5
- package/template/mp/common/style.js +1 -1
- package/template/mp/common/weapp-page.js +30 -2
package/lib/builder/mp/index.js
CHANGED
|
@@ -119,12 +119,15 @@ async function generateWxMp({ buildContext, weapps, calses, plugins, deployOptio
|
|
|
119
119
|
endpointType,
|
|
120
120
|
}, miniprogramRoot);
|
|
121
121
|
const expirationStartTimesnap = buildContext.enableExpiredTag ? Date.now() : 0;
|
|
122
|
-
const
|
|
122
|
+
const cssVarMap = Object.entries((0, theme_1.mergeCssVarConfig)((_b = (_a = calses[0]) === null || _a === void 0 ? void 0 : _a.theme) === null || _b === void 0 ? void 0 : _b.cssVarConfig, 'MP'))
|
|
123
123
|
.map(([key, _value]) => {
|
|
124
124
|
const value = _value || '';
|
|
125
|
-
return
|
|
125
|
+
return [key, value.replace(/;$/, '')];
|
|
126
126
|
})
|
|
127
|
-
.
|
|
127
|
+
.reduce((map, [key, value]) => {
|
|
128
|
+
map[key] = value;
|
|
129
|
+
return map;
|
|
130
|
+
}, {}) || {};
|
|
128
131
|
appFileData = {
|
|
129
132
|
...appFileData,
|
|
130
133
|
'common/style.js': {},
|
|
@@ -138,7 +141,7 @@ async function generateWxMp({ buildContext, weapps, calses, plugins, deployOptio
|
|
|
138
141
|
'common/widget.js': {},
|
|
139
142
|
'common/weapp-page.js': {
|
|
140
143
|
expirationStartTimesnap,
|
|
141
|
-
pageStyle:
|
|
144
|
+
pageStyle: JSON.stringify(cssVarMap || {}, undefined, 2),
|
|
142
145
|
},
|
|
143
146
|
'common/weapp-component.js': {},
|
|
144
147
|
'common/merge-renderer.js': {
|
|
@@ -417,10 +420,16 @@ async function generatePkg(ctx, { cals, weapp }, appRoot, pageConfigs) {
|
|
|
417
420
|
const subLevelPath = rootPath ? `${path_1.default.posix.relative(`packages/${rootPath}`, '')}/` : '';
|
|
418
421
|
const pageDataBinds = {};
|
|
419
422
|
Object.entries(page.data || {}).forEach(([prop, val]) => {
|
|
420
|
-
if (
|
|
423
|
+
if (/^(appShareMessage)/.test(prop)) {
|
|
421
424
|
(0, util_2.setDataBind)(pageDataBinds, prop, val);
|
|
422
425
|
}
|
|
423
426
|
});
|
|
427
|
+
if (page.styleBindPath) {
|
|
428
|
+
(0, util_2.setDataBind)(pageDataBinds, 'style', {
|
|
429
|
+
type: cals_1.PropBindType.expression,
|
|
430
|
+
value: page.styleBindPath,
|
|
431
|
+
});
|
|
432
|
+
}
|
|
424
433
|
/**
|
|
425
434
|
* 使用最终的 usingComponents 生成一份 componentPlaceholder
|
|
426
435
|
*/
|