@cloudbase/lowcode-builder 1.8.45-beta.2 → 1.8.45-ide.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 +13 -29
- package/lib/builder/config/index.d.ts +1 -1
- package/lib/builder/config/index.js +1 -1
- package/lib/builder/mp/index.js +3 -6
- package/lib/builder/mp/util.d.ts +0 -1
- package/lib/builder/mp/util.js +1 -34
- package/lib/builder.web.js +13 -29
- package/lib/utils/transform.d.ts +1 -1
- package/lib/utils/transform.js +69 -63
- package/package.json +5 -8
- package/template/mp/common/merge-renderer.js +1 -1
- package/template/mp/common/widget.js +6 -6
|
@@ -6,7 +6,7 @@ export declare const materialsDirName = "materials";
|
|
|
6
6
|
* src/template的代码,在IDE编辑器插件中构建builder
|
|
7
7
|
* 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488®ion=ap-shanghai&path=%252Flcap-builder%252F
|
|
8
8
|
*/
|
|
9
|
-
export declare const builderTemplateURL = "https://comp-public-1303824488.file.myqcloud.com/lcap-builder/template.1.8.
|
|
9
|
+
export declare const builderTemplateURL = "https://comp-public-1303824488.file.myqcloud.com/lcap-builder/template.1.8.45.zip";
|
|
10
10
|
/**
|
|
11
11
|
* miniprogram的代码,IDE插件后续会提供端功能
|
|
12
12
|
* 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488®ion=ap-shanghai&path=%252Flcap-builder%252F
|
|
@@ -45,7 +45,7 @@ exports.materialsDirName = 'materials'; // materials diretory of current project
|
|
|
45
45
|
* src/template的代码,在IDE编辑器插件中构建builder
|
|
46
46
|
* 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488®ion=ap-shanghai&path=%252Flcap-builder%252F
|
|
47
47
|
*/
|
|
48
|
-
exports.builderTemplateURL = 'https://comp-public-1303824488.file.myqcloud.com/lcap-builder/template.1.8.
|
|
48
|
+
exports.builderTemplateURL = 'https://comp-public-1303824488.file.myqcloud.com/lcap-builder/template.1.8.45.zip';
|
|
49
49
|
/**
|
|
50
50
|
* miniprogram的代码,IDE插件后续会提供端功能
|
|
51
51
|
* 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488®ion=ap-shanghai&path=%252Flcap-builder%252F
|
package/lib/builder/mp/index.js
CHANGED
|
@@ -387,12 +387,9 @@ async function generatePkg(ctx, weapp, appRoot, pageConfigs) {
|
|
|
387
387
|
subWxss: rootPath && !((_l = ctx.mainAppData) === null || _l === void 0 ? void 0 : _l.mpPkgUrl)
|
|
388
388
|
? `@import "${path_1.default.posix.relative(`/${rootPath}/pages/${page.id}`, '/lowcode')}/style.wxss";`
|
|
389
389
|
: '',
|
|
390
|
-
content:
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
}), 'page'),
|
|
394
|
-
(0, util_2.generateScopedStyleText)(componentInstances),
|
|
395
|
-
].join('\n'),
|
|
390
|
+
content: (0, weapps_core_1.toCssText)((0, cals_1.processCommonStyle2CSSProperties)(page.commonStyle, {
|
|
391
|
+
defaultUnit: processCssUnit,
|
|
392
|
+
}), 'page'),
|
|
396
393
|
pageWxss: importor.styles.length ? `@import "../../lowcode/${page.id}/style.wxss"` : '',
|
|
397
394
|
},
|
|
398
395
|
};
|
package/lib/builder/mp/util.d.ts
CHANGED
package/lib/builder/mp/util.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.findComponentInfo = exports.processRepeaterSchema = exports.createDataBinds = exports.createTemplateEventFlows = exports.createTemplateQuery = exports.generateDataContainerListeners = exports.generateSyncListeners = exports.createEventHandlers = exports.createWidgetProps = exports.generatedDynamicData = void 0;
|
|
4
4
|
const weapps_core_1 = require("@cloudbase/lowcode-generator/lib/weapps-core");
|
|
5
5
|
const lowcode_generator_1 = require("@cloudbase/lowcode-generator");
|
|
6
6
|
const weapp_1 = require("@cloudbase/lowcode-generator/lib/generator/util/weapp");
|
|
@@ -481,36 +481,3 @@ function findComponentInfo(xComponent, { materialLibs, miniprogramPlugins }) {
|
|
|
481
481
|
return compProto;
|
|
482
482
|
}
|
|
483
483
|
exports.findComponentInfo = findComponentInfo;
|
|
484
|
-
function generateScopedStyleText(widgets) {
|
|
485
|
-
const cssTextList = [];
|
|
486
|
-
function traverse(target) {
|
|
487
|
-
var _a;
|
|
488
|
-
for (const [id, widget] of Object.entries(target)) {
|
|
489
|
-
const scopedStyle = (_a = widget.xProps) === null || _a === void 0 ? void 0 : _a.scopedStyle;
|
|
490
|
-
if (scopedStyle) {
|
|
491
|
-
let cssText = scopedStyle
|
|
492
|
-
// 移除 `/* ... */` 注释
|
|
493
|
-
.replace(/\/\*(?:[\s\S]*?)\*\//g, '')
|
|
494
|
-
// 移除换行及其前后的空白符
|
|
495
|
-
.replace(/\s*\n\s*/g, '')
|
|
496
|
-
// 添加 `#wd-page-root` 前缀以增加样式权重
|
|
497
|
-
.replace(/(:root.*?{)/g, '\n#wd-page-root $1')
|
|
498
|
-
// 替换 `:root`
|
|
499
|
-
.replace(/:root/g, `.wd-comp-id-${id}`)
|
|
500
|
-
// `: ` => `:`
|
|
501
|
-
.replace(/\s*:\s*/g, ':')
|
|
502
|
-
// ` {` => `{`
|
|
503
|
-
.replace(/\s*{\s*/g, '{')
|
|
504
|
-
// `;}` => `}`
|
|
505
|
-
.replace(/;\s*}/g, '}');
|
|
506
|
-
cssTextList.push(cssText.trim());
|
|
507
|
-
}
|
|
508
|
-
if (widget.properties) {
|
|
509
|
-
traverse(widget.properties);
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
traverse(widgets);
|
|
514
|
-
return cssTextList.join('\n');
|
|
515
|
-
}
|
|
516
|
-
exports.generateScopedStyleText = generateScopedStyleText;
|