@mybricks/to-code-taro 1.2.7 → 1.2.8
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/package.json +1 -1
- package/dist/cjs/abstractEventTypeDef.d.ts +0 -11
- package/dist/cjs/abstractEventTypeDef.js +0 -93
- package/dist/cjs/generate/compressImages.d.ts +0 -16
- package/dist/cjs/generate/compressImages.js +0 -76
- package/dist/cjs/generate/generateTaroProjectJson.d.ts +0 -13
- package/dist/cjs/generate/generateTaroProjectJson.js +0 -225
- package/dist/cjs/generate/generateTaroTempalteJson.d.ts +0 -15
- package/dist/cjs/generate/generateTaroTempalteJson.js +0 -103
- package/dist/cjs/generate/utils/appConfig.d.ts +0 -21
- package/dist/cjs/generate/utils/appConfig.js +0 -57
- package/dist/cjs/generate/utils/commonDir.d.ts +0 -21
- package/dist/cjs/generate/utils/commonDir.js +0 -63
- package/dist/cjs/generate/utils/customTabBar.d.ts +0 -11
- package/dist/cjs/generate/utils/customTabBar.js +0 -73
- package/dist/cjs/generate/utils/fileNode.d.ts +0 -21
- package/dist/cjs/generate/utils/fileNode.js +0 -67
- package/dist/cjs/generate/utils/index.d.ts +0 -7
- package/dist/cjs/generate/utils/index.js +0 -29
- package/dist/cjs/generate/utils/pageImages.d.ts +0 -14
- package/dist/cjs/generate/utils/pageImages.js +0 -36
- package/dist/cjs/generate/utils/tabBarImages.d.ts +0 -14
- package/dist/cjs/generate/utils/tabBarImages.js +0 -36
- package/dist/cjs/handleCom.d.ts +0 -8
- package/dist/cjs/handleCom.js +0 -280
- package/dist/cjs/handleDom.d.ts +0 -21
- package/dist/cjs/handleDom.js +0 -52
- package/dist/cjs/handleExtension.d.ts +0 -10
- package/dist/cjs/handleExtension.js +0 -300
- package/dist/cjs/handleGlobal.d.ts +0 -11
- package/dist/cjs/handleGlobal.js +0 -191
- package/dist/cjs/handleModule.d.ts +0 -15
- package/dist/cjs/handleModule.js +0 -104
- package/dist/cjs/handleSlot.d.ts +0 -29
- package/dist/cjs/handleSlot.js +0 -153
- package/dist/cjs/index.d.ts +0 -4
- package/dist/cjs/index.js +0 -48
- package/dist/cjs/processors/processComEvents.d.ts +0 -9
- package/dist/cjs/processors/processComEvents.js +0 -163
- package/dist/cjs/processors/processModule.d.ts +0 -31
- package/dist/cjs/processors/processModule.js +0 -159
- package/dist/cjs/processors/processScene.d.ts +0 -32
- package/dist/cjs/processors/processScene.js +0 -198
- package/dist/cjs/processors/processSceneLogic.d.ts +0 -7
- package/dist/cjs/processors/processSceneLogic.js +0 -230
- package/dist/cjs/shims-taro.d.ts +0 -20
- package/dist/cjs/taro-template.json +0 -154
- package/dist/cjs/toCodeTaro.d.ts +0 -168
- package/dist/cjs/toCodeTaro.js +0 -326
- package/dist/cjs/utils/builder/buildResult.d.ts +0 -24
- package/dist/cjs/utils/builder/buildResult.js +0 -163
- package/dist/cjs/utils/common/ImportManager.d.ts +0 -26
- package/dist/cjs/utils/common/ImportManager.js +0 -123
- package/dist/cjs/utils/common/helper.d.ts +0 -12
- package/dist/cjs/utils/common/helper.js +0 -52
- package/dist/cjs/utils/common/object.d.ts +0 -5
- package/dist/cjs/utils/common/object.js +0 -58
- package/dist/cjs/utils/common/string.d.ts +0 -18
- package/dist/cjs/utils/common/string.js +0 -59
- package/dist/cjs/utils/config/content/converter.d.ts +0 -17
- package/dist/cjs/utils/config/content/converter.js +0 -84
- package/dist/cjs/utils/config/content/index.d.ts +0 -10
- package/dist/cjs/utils/config/content/index.js +0 -33
- package/dist/cjs/utils/config/content/pageConfig.d.ts +0 -10
- package/dist/cjs/utils/config/content/pageConfig.js +0 -80
- package/dist/cjs/utils/config/content/saveBase64Image.d.ts +0 -24
- package/dist/cjs/utils/config/content/saveBase64Image.js +0 -113
- package/dist/cjs/utils/config/content/tabBarConfig.d.ts +0 -28
- package/dist/cjs/utils/config/content/tabBarConfig.js +0 -74
- package/dist/cjs/utils/config/content/types.d.ts +0 -73
- package/dist/cjs/utils/config/content/types.js +0 -17
- package/dist/cjs/utils/config/content/validator.d.ts +0 -13
- package/dist/cjs/utils/config/content/validator.js +0 -67
- package/dist/cjs/utils/config/handlePageConfig.d.ts +0 -31
- package/dist/cjs/utils/config/handlePageConfig.js +0 -88
- package/dist/cjs/utils/context/buildContext.d.ts +0 -31
- package/dist/cjs/utils/context/buildContext.js +0 -76
- package/dist/cjs/utils/context/buildFrameMap.d.ts +0 -16
- package/dist/cjs/utils/context/buildFrameMap.js +0 -106
- package/dist/cjs/utils/context/buildGlobalData.d.ts +0 -13
- package/dist/cjs/utils/context/buildGlobalData.js +0 -58
- package/dist/cjs/utils/context/collectJSModules.d.ts +0 -41
- package/dist/cjs/utils/context/collectJSModules.js +0 -93
- package/dist/cjs/utils/context/createEventQueries.d.ts +0 -45
- package/dist/cjs/utils/context/createEventQueries.js +0 -99
- package/dist/cjs/utils/context/createProvider.d.ts +0 -21
- package/dist/cjs/utils/context/createProvider.js +0 -49
- package/dist/cjs/utils/index.d.ts +0 -10
- package/dist/cjs/utils/index.js +0 -60
- package/dist/cjs/utils/logic/convertNamespace.d.ts +0 -11
- package/dist/cjs/utils/logic/convertNamespace.js +0 -43
- package/dist/cjs/utils/logic/genJSModules.d.ts +0 -16
- package/dist/cjs/utils/logic/genJSModules.js +0 -114
- package/dist/cjs/utils/logic/handleProcess.d.ts +0 -9
- package/dist/cjs/utils/logic/handleProcess.js +0 -462
- package/dist/cjs/utils/logic/processChildren.d.ts +0 -26
- package/dist/cjs/utils/logic/processChildren.js +0 -121
- package/dist/cjs/utils/style/color.d.ts +0 -4
- package/dist/cjs/utils/style/color.js +0 -45
- package/dist/cjs/utils/style/converter.d.ts +0 -7
- package/dist/cjs/utils/style/converter.js +0 -175
- package/dist/cjs/utils/style/getComponentClassName.d.ts +0 -16
- package/dist/cjs/utils/style/getComponentClassName.js +0 -47
- package/dist/cjs/utils/style/pxtransform.d.ts +0 -4
- package/dist/cjs/utils/style/pxtransform.js +0 -62
- package/dist/cjs/utils/style/types.d.ts +0 -23
- package/dist/cjs/utils/style/types.js +0 -17
- package/dist/cjs/utils/templates/component.d.ts +0 -19
- package/dist/cjs/utils/templates/component.js +0 -86
- package/dist/cjs/utils/templates/index.d.ts +0 -32
- package/dist/cjs/utils/templates/index.js +0 -116
- package/dist/cjs/utils/templates/renderManager.d.ts +0 -18
- package/dist/cjs/utils/templates/renderManager.js +0 -152
- package/dist/cjs/utils/templates/scene.d.ts +0 -23
- package/dist/cjs/utils/templates/scene.js +0 -113
- package/dist/esm/abstractEventTypeDef.d.ts +0 -11
- package/dist/esm/abstractEventTypeDef.js +0 -63
- package/dist/esm/generate/compressImages.d.ts +0 -16
- package/dist/esm/generate/compressImages.js +0 -108
- package/dist/esm/generate/generateTaroProjectJson.d.ts +0 -13
- package/dist/esm/generate/generateTaroProjectJson.js +0 -228
- package/dist/esm/generate/generateTaroTempalteJson.d.ts +0 -15
- package/dist/esm/generate/generateTaroTempalteJson.js +0 -94
- package/dist/esm/generate/utils/appConfig.d.ts +0 -21
- package/dist/esm/generate/utils/appConfig.js +0 -49
- package/dist/esm/generate/utils/commonDir.d.ts +0 -21
- package/dist/esm/generate/utils/commonDir.js +0 -53
- package/dist/esm/generate/utils/customTabBar.d.ts +0 -11
- package/dist/esm/generate/utils/customTabBar.js +0 -52
- package/dist/esm/generate/utils/fileNode.d.ts +0 -21
- package/dist/esm/generate/utils/fileNode.js +0 -62
- package/dist/esm/generate/utils/index.d.ts +0 -7
- package/dist/esm/generate/utils/index.js +0 -8
- package/dist/esm/generate/utils/pageImages.d.ts +0 -14
- package/dist/esm/generate/utils/pageImages.js +0 -15
- package/dist/esm/generate/utils/tabBarImages.d.ts +0 -14
- package/dist/esm/generate/utils/tabBarImages.js +0 -15
- package/dist/esm/handleCom.d.ts +0 -8
- package/dist/esm/handleCom.js +0 -350
- package/dist/esm/handleDom.d.ts +0 -21
- package/dist/esm/handleDom.js +0 -26
- package/dist/esm/handleExtension.d.ts +0 -10
- package/dist/esm/handleExtension.js +0 -243
- package/dist/esm/handleGlobal.d.ts +0 -11
- package/dist/esm/handleGlobal.js +0 -157
- package/dist/esm/handleModule.d.ts +0 -15
- package/dist/esm/handleModule.js +0 -73
- package/dist/esm/handleSlot.d.ts +0 -29
- package/dist/esm/handleSlot.js +0 -215
- package/dist/esm/index.d.ts +0 -4
- package/dist/esm/index.js +0 -4
- package/dist/esm/processors/processComEvents.d.ts +0 -9
- package/dist/esm/processors/processComEvents.js +0 -170
- package/dist/esm/processors/processModule.d.ts +0 -31
- package/dist/esm/processors/processModule.js +0 -177
- package/dist/esm/processors/processScene.d.ts +0 -32
- package/dist/esm/processors/processScene.js +0 -234
- package/dist/esm/processors/processSceneLogic.d.ts +0 -7
- package/dist/esm/processors/processSceneLogic.js +0 -247
- package/dist/esm/shims-taro.d.ts +0 -20
- package/dist/esm/taro-template.json +0 -154
- package/dist/esm/toCodeTaro.d.ts +0 -168
- package/dist/esm/toCodeTaro.js +0 -367
- package/dist/esm/utils/builder/buildResult.d.ts +0 -24
- package/dist/esm/utils/builder/buildResult.js +0 -119
- package/dist/esm/utils/common/ImportManager.d.ts +0 -26
- package/dist/esm/utils/common/ImportManager.js +0 -131
- package/dist/esm/utils/common/helper.d.ts +0 -12
- package/dist/esm/utils/common/helper.js +0 -33
- package/dist/esm/utils/common/object.d.ts +0 -5
- package/dist/esm/utils/common/object.js +0 -32
- package/dist/esm/utils/common/string.d.ts +0 -18
- package/dist/esm/utils/common/string.js +0 -37
- package/dist/esm/utils/config/content/converter.d.ts +0 -17
- package/dist/esm/utils/config/content/converter.js +0 -106
- package/dist/esm/utils/config/content/index.d.ts +0 -10
- package/dist/esm/utils/config/content/index.js +0 -11
- package/dist/esm/utils/config/content/pageConfig.d.ts +0 -10
- package/dist/esm/utils/config/content/pageConfig.js +0 -43
- package/dist/esm/utils/config/content/saveBase64Image.d.ts +0 -24
- package/dist/esm/utils/config/content/saveBase64Image.js +0 -127
- package/dist/esm/utils/config/content/tabBarConfig.d.ts +0 -28
- package/dist/esm/utils/config/content/tabBarConfig.js +0 -89
- package/dist/esm/utils/config/content/types.d.ts +0 -73
- package/dist/esm/utils/config/content/types.js +0 -1
- package/dist/esm/utils/config/content/validator.d.ts +0 -13
- package/dist/esm/utils/config/content/validator.js +0 -64
- package/dist/esm/utils/config/handlePageConfig.d.ts +0 -31
- package/dist/esm/utils/config/handlePageConfig.js +0 -89
- package/dist/esm/utils/context/buildContext.d.ts +0 -31
- package/dist/esm/utils/context/buildContext.js +0 -65
- package/dist/esm/utils/context/buildFrameMap.d.ts +0 -16
- package/dist/esm/utils/context/buildFrameMap.js +0 -131
- package/dist/esm/utils/context/buildGlobalData.d.ts +0 -13
- package/dist/esm/utils/context/buildGlobalData.js +0 -44
- package/dist/esm/utils/context/collectJSModules.d.ts +0 -41
- package/dist/esm/utils/context/collectJSModules.js +0 -87
- package/dist/esm/utils/context/createEventQueries.d.ts +0 -45
- package/dist/esm/utils/context/createEventQueries.js +0 -99
- package/dist/esm/utils/context/createProvider.d.ts +0 -21
- package/dist/esm/utils/context/createProvider.js +0 -33
- package/dist/esm/utils/index.d.ts +0 -10
- package/dist/esm/utils/index.js +0 -12
- package/dist/esm/utils/logic/convertNamespace.d.ts +0 -11
- package/dist/esm/utils/logic/convertNamespace.js +0 -27
- package/dist/esm/utils/logic/genJSModules.d.ts +0 -16
- package/dist/esm/utils/logic/genJSModules.js +0 -33
- package/dist/esm/utils/logic/handleProcess.d.ts +0 -9
- package/dist/esm/utils/logic/handleProcess.js +0 -520
- package/dist/esm/utils/logic/processChildren.d.ts +0 -26
- package/dist/esm/utils/logic/processChildren.js +0 -101
- package/dist/esm/utils/style/color.d.ts +0 -4
- package/dist/esm/utils/style/color.js +0 -17
- package/dist/esm/utils/style/converter.d.ts +0 -7
- package/dist/esm/utils/style/converter.js +0 -175
- package/dist/esm/utils/style/getComponentClassName.d.ts +0 -16
- package/dist/esm/utils/style/getComponentClassName.js +0 -37
- package/dist/esm/utils/style/pxtransform.d.ts +0 -4
- package/dist/esm/utils/style/pxtransform.js +0 -54
- package/dist/esm/utils/style/types.d.ts +0 -23
- package/dist/esm/utils/style/types.js +0 -1
- package/dist/esm/utils/templates/component.d.ts +0 -19
- package/dist/esm/utils/templates/component.js +0 -55
- package/dist/esm/utils/templates/index.d.ts +0 -32
- package/dist/esm/utils/templates/index.js +0 -97
- package/dist/esm/utils/templates/renderManager.d.ts +0 -18
- package/dist/esm/utils/templates/renderManager.js +0 -145
- package/dist/esm/utils/templates/scene.d.ts +0 -23
- package/dist/esm/utils/templates/scene.js +0 -66
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/utils/common/helper.ts
|
|
20
|
-
var helper_exports = {};
|
|
21
|
-
__export(helper_exports, {
|
|
22
|
-
getInitValueBySchema: () => getInitValueBySchema,
|
|
23
|
-
indentation: () => indentation
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(helper_exports);
|
|
26
|
-
var indentation = (level) => {
|
|
27
|
-
return " ".repeat(level);
|
|
28
|
-
};
|
|
29
|
-
var getInitValueBySchema = (schema, initValue) => {
|
|
30
|
-
if (initValue !== void 0)
|
|
31
|
-
return initValue;
|
|
32
|
-
const type = schema == null ? void 0 : schema.type;
|
|
33
|
-
switch (type) {
|
|
34
|
-
case "string":
|
|
35
|
-
return "";
|
|
36
|
-
case "number":
|
|
37
|
-
return 0;
|
|
38
|
-
case "boolean":
|
|
39
|
-
return false;
|
|
40
|
-
case "array":
|
|
41
|
-
return [];
|
|
42
|
-
case "object":
|
|
43
|
-
return {};
|
|
44
|
-
default:
|
|
45
|
-
return {};
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
-
0 && (module.exports = {
|
|
50
|
-
getInitValueBySchema,
|
|
51
|
-
indentation
|
|
52
|
-
});
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/utils/common/object.ts
|
|
20
|
-
var object_exports = {};
|
|
21
|
-
__export(object_exports, {
|
|
22
|
-
genObjectCode: () => genObjectCode
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(object_exports);
|
|
25
|
-
var import_helper = require("./helper");
|
|
26
|
-
var genObjectCode = (object, config) => {
|
|
27
|
-
const { initialIndent, indentSize } = config;
|
|
28
|
-
const keys = Object.keys(object);
|
|
29
|
-
if (keys.length === 0)
|
|
30
|
-
return "{}";
|
|
31
|
-
let result = "{\n";
|
|
32
|
-
keys.forEach((key, idx) => {
|
|
33
|
-
const value = object[key];
|
|
34
|
-
let formattedValue;
|
|
35
|
-
if (Array.isArray(value)) {
|
|
36
|
-
formattedValue = JSON.stringify(value);
|
|
37
|
-
} else if (value && typeof value === "object") {
|
|
38
|
-
formattedValue = genObjectCode(value, {
|
|
39
|
-
initialIndent: initialIndent + indentSize,
|
|
40
|
-
indentSize
|
|
41
|
-
});
|
|
42
|
-
} else if (typeof value === "string") {
|
|
43
|
-
formattedValue = JSON.stringify(value);
|
|
44
|
-
} else {
|
|
45
|
-
formattedValue = String(value);
|
|
46
|
-
}
|
|
47
|
-
result += (0, import_helper.indentation)(initialIndent + indentSize) + `${JSON.stringify(key)}: ${formattedValue}`;
|
|
48
|
-
if (idx < keys.length - 1)
|
|
49
|
-
result += ",";
|
|
50
|
-
result += "\n";
|
|
51
|
-
});
|
|
52
|
-
result += (0, import_helper.indentation)(initialIndent) + "}";
|
|
53
|
-
return result;
|
|
54
|
-
};
|
|
55
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
-
0 && (module.exports = {
|
|
57
|
-
genObjectCode
|
|
58
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** 将第一个字符转大写 */
|
|
2
|
-
export declare const firstCharToUpperCase: (str: string) => string;
|
|
3
|
-
/** 将第一个字符转小写 */
|
|
4
|
-
export declare const firstCharToLowerCase: (str: string) => string;
|
|
5
|
-
/** 驼峰转中划线 */
|
|
6
|
-
export declare const camelToKebab: (str: string) => string;
|
|
7
|
-
/** 中划线转驼峰 */
|
|
8
|
-
export declare const kebabToCamel: (str: string) => string;
|
|
9
|
-
/** 检查字符串是否包含中文 */
|
|
10
|
-
export declare const hasChinese: (str: string) => boolean;
|
|
11
|
-
/**
|
|
12
|
-
* 获取安全的变量名
|
|
13
|
-
* 优先使用 title,如果 title 包含中文则使用 id
|
|
14
|
-
*/
|
|
15
|
-
export declare const getSafeVarName: (com: {
|
|
16
|
-
title?: string;
|
|
17
|
-
id: string;
|
|
18
|
-
}) => string;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/utils/common/string.ts
|
|
20
|
-
var string_exports = {};
|
|
21
|
-
__export(string_exports, {
|
|
22
|
-
camelToKebab: () => camelToKebab,
|
|
23
|
-
firstCharToLowerCase: () => firstCharToLowerCase,
|
|
24
|
-
firstCharToUpperCase: () => firstCharToUpperCase,
|
|
25
|
-
getSafeVarName: () => getSafeVarName,
|
|
26
|
-
hasChinese: () => hasChinese,
|
|
27
|
-
kebabToCamel: () => kebabToCamel
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(string_exports);
|
|
30
|
-
var firstCharToUpperCase = (str) => {
|
|
31
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
32
|
-
};
|
|
33
|
-
var firstCharToLowerCase = (str) => {
|
|
34
|
-
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
35
|
-
};
|
|
36
|
-
var camelToKebab = (str) => {
|
|
37
|
-
return str.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
38
|
-
};
|
|
39
|
-
var kebabToCamel = (str) => {
|
|
40
|
-
return str.replace(/-([a-z])/g, (_, char) => char.toUpperCase());
|
|
41
|
-
};
|
|
42
|
-
var hasChinese = (str) => {
|
|
43
|
-
return /[\u4e00-\u9fa5]/.test(str);
|
|
44
|
-
};
|
|
45
|
-
var getSafeVarName = (com) => {
|
|
46
|
-
if (com.title && !hasChinese(com.title)) {
|
|
47
|
-
return com.title;
|
|
48
|
-
}
|
|
49
|
-
return com.id;
|
|
50
|
-
};
|
|
51
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
-
0 && (module.exports = {
|
|
53
|
-
camelToKebab,
|
|
54
|
-
firstCharToLowerCase,
|
|
55
|
-
firstCharToUpperCase,
|
|
56
|
-
getSafeVarName,
|
|
57
|
-
hasChinese,
|
|
58
|
-
kebabToCamel
|
|
59
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { TabBarItemSource, TaroTabBarConfig } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* 将 TabBar 数据转换为 Taro 配置格式
|
|
4
|
-
* @param tabBar TabBar 项数组(来自 toJson.tabbar)
|
|
5
|
-
* @param pageIdToPath 页面 ID 到路径的映射函数,默认格式为 `pages/${pageId}/index`
|
|
6
|
-
* @param processIcon 处理图标的函数(可选,用于处理 base64 图片)
|
|
7
|
-
* @returns Taro TabBar 配置,如果验证失败则返回 null
|
|
8
|
-
*/
|
|
9
|
-
export declare function convertToTaroTabBarConfig(tabBar: TabBarItemSource[] | undefined | null, pageIdToPath?: (pageId: string) => string, processIcon?: (iconPath: string | undefined, index: number, type: 'normal' | 'selected') => string | undefined): TaroTabBarConfig | null;
|
|
10
|
-
/**
|
|
11
|
-
* 获取入口页面 ID
|
|
12
|
-
* 如果启用 TabBar,返回第一个 TabBar 项的页面 ID;否则返回 null
|
|
13
|
-
* @param tabBar TabBar 项数组
|
|
14
|
-
* @param defaultEntryPageId 默认入口页面 ID(当 TabBar 未启用时使用)
|
|
15
|
-
* @returns 入口页面 ID
|
|
16
|
-
*/
|
|
17
|
-
export declare function getEntryPageId(tabBar: TabBarItemSource[] | undefined | null, defaultEntryPageId?: string): string | null;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/utils/config/content/converter.ts
|
|
20
|
-
var converter_exports = {};
|
|
21
|
-
__export(converter_exports, {
|
|
22
|
-
convertToTaroTabBarConfig: () => convertToTaroTabBarConfig,
|
|
23
|
-
getEntryPageId: () => getEntryPageId
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(converter_exports);
|
|
26
|
-
var import_validator = require("./validator");
|
|
27
|
-
function convertTabBarItem(item, pageIdToPath, index = 0, processIcon) {
|
|
28
|
-
const pagePath = pageIdToPath(item.scene.id);
|
|
29
|
-
const text = item.text || item.scene.title || "";
|
|
30
|
-
const taroItem = {
|
|
31
|
-
pagePath,
|
|
32
|
-
text
|
|
33
|
-
};
|
|
34
|
-
if (item.normalIconPath) {
|
|
35
|
-
taroItem.iconPath = processIcon ? processIcon(item.normalIconPath, index, "normal") : item.normalIconPath.replace(/^\/?@\//, "");
|
|
36
|
-
}
|
|
37
|
-
if (item.selectedIconPath) {
|
|
38
|
-
taroItem.selectedIconPath = processIcon ? processIcon(item.selectedIconPath, index, "selected") : item.selectedIconPath.replace(/^\/?@\//, "");
|
|
39
|
-
}
|
|
40
|
-
return taroItem;
|
|
41
|
-
}
|
|
42
|
-
function extractColorFromTextStyle(textStyle) {
|
|
43
|
-
if (!textStyle || typeof textStyle !== "object") {
|
|
44
|
-
return void 0;
|
|
45
|
-
}
|
|
46
|
-
return textStyle.color || textStyle.colorValue;
|
|
47
|
-
}
|
|
48
|
-
function convertToTaroTabBarConfig(tabBar, pageIdToPath = (pageId) => `pages/${pageId}/index`, processIcon) {
|
|
49
|
-
const validation = (0, import_validator.validateTabBar)(tabBar);
|
|
50
|
-
if (!validation.useTabBar) {
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
const list = validation.validItems.map(
|
|
54
|
-
(item, index) => convertTabBarItem(item, pageIdToPath, index, processIcon)
|
|
55
|
-
);
|
|
56
|
-
const config = {
|
|
57
|
-
custom: true,
|
|
58
|
-
list
|
|
59
|
-
};
|
|
60
|
-
const firstItem = validation.validItems[0];
|
|
61
|
-
if (firstItem) {
|
|
62
|
-
const normalColor = extractColorFromTextStyle(firstItem.normalTextStyle);
|
|
63
|
-
const selectedColor = extractColorFromTextStyle(firstItem.selectedTextStyle);
|
|
64
|
-
if (normalColor) {
|
|
65
|
-
config.color = normalColor;
|
|
66
|
-
}
|
|
67
|
-
if (selectedColor) {
|
|
68
|
-
config.selectedColor = selectedColor;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return config;
|
|
72
|
-
}
|
|
73
|
-
function getEntryPageId(tabBar, defaultEntryPageId) {
|
|
74
|
-
const validation = (0, import_validator.validateTabBar)(tabBar);
|
|
75
|
-
if (validation.useTabBar && validation.validItems.length > 0) {
|
|
76
|
-
return validation.validItems[0].scene.id;
|
|
77
|
-
}
|
|
78
|
-
return defaultEntryPageId || null;
|
|
79
|
-
}
|
|
80
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
-
0 && (module.exports = {
|
|
82
|
-
convertToTaroTabBarConfig,
|
|
83
|
-
getEntryPageId
|
|
84
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/utils/config/content/index.ts
|
|
17
|
-
var content_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(content_exports);
|
|
19
|
-
__reExport(content_exports, require("./types"), module.exports);
|
|
20
|
-
__reExport(content_exports, require("./validator"), module.exports);
|
|
21
|
-
__reExport(content_exports, require("./converter"), module.exports);
|
|
22
|
-
__reExport(content_exports, require("./pageConfig"), module.exports);
|
|
23
|
-
__reExport(content_exports, require("./tabBarConfig"), module.exports);
|
|
24
|
-
__reExport(content_exports, require("./saveBase64Image"), module.exports);
|
|
25
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
-
0 && (module.exports = {
|
|
27
|
-
...require("./types"),
|
|
28
|
-
...require("./validator"),
|
|
29
|
-
...require("./converter"),
|
|
30
|
-
...require("./pageConfig"),
|
|
31
|
-
...require("./tabBarConfig"),
|
|
32
|
-
...require("./saveBase64Image")
|
|
33
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 页面配置工具
|
|
3
|
-
* 负责从 systemPage 组件数据生成 definePageConfig 配置字符串
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* 从 systemPage 组件数据生成 definePageConfig 配置字符串
|
|
7
|
-
* @param systemPageData systemPage 组件的 model.data
|
|
8
|
-
* @returns definePageConfig 配置字符串
|
|
9
|
-
*/
|
|
10
|
-
export declare function generatePageConfigContent(systemPageData?: any): string;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/utils/config/content/pageConfig.ts
|
|
20
|
-
var pageConfig_exports = {};
|
|
21
|
-
__export(pageConfig_exports, {
|
|
22
|
-
generatePageConfigContent: () => generatePageConfigContent
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(pageConfig_exports);
|
|
25
|
-
var import__ = require("../../index");
|
|
26
|
-
var TARO_NAVIGATION_BAR_PROPERTIES = [
|
|
27
|
-
"navigationBarBackgroundColor",
|
|
28
|
-
"navigationBarTextStyle",
|
|
29
|
-
"navigationBarTitleText",
|
|
30
|
-
"navigationStyle"
|
|
31
|
-
];
|
|
32
|
-
var TARO_PAGE_CONFIG_TEMPLATE_PROPERTIES = [
|
|
33
|
-
"navigationBarBackgroundColor",
|
|
34
|
-
"navigationBarTextStyle",
|
|
35
|
-
"navigationBarTitleText",
|
|
36
|
-
"navigationStyle",
|
|
37
|
-
"transparentTitle",
|
|
38
|
-
"backgroundColor",
|
|
39
|
-
"backgroundTextStyle",
|
|
40
|
-
"backgroundColorTop",
|
|
41
|
-
"backgroundColorBottom",
|
|
42
|
-
"enablePullDownRefresh",
|
|
43
|
-
"onReachBottomDistance",
|
|
44
|
-
"pageOrientation",
|
|
45
|
-
"disableScroll",
|
|
46
|
-
"disableSwipeBack",
|
|
47
|
-
"enableShareAppMessage",
|
|
48
|
-
"enableShareTimeline",
|
|
49
|
-
"usingComponents",
|
|
50
|
-
"renderer"
|
|
51
|
-
];
|
|
52
|
-
function generatePageConfigContent(systemPageData) {
|
|
53
|
-
const pageConfig = {
|
|
54
|
-
enableShareAppMessage: true,
|
|
55
|
-
enableShareTimeline: true
|
|
56
|
-
};
|
|
57
|
-
if (systemPageData) {
|
|
58
|
-
if (systemPageData.useNavigationStyle === "none") {
|
|
59
|
-
pageConfig.navigationStyle = "custom";
|
|
60
|
-
}
|
|
61
|
-
const propertiesToUse = systemPageData.useNavigationStyle === "default" ? TARO_NAVIGATION_BAR_PROPERTIES : TARO_PAGE_CONFIG_TEMPLATE_PROPERTIES;
|
|
62
|
-
propertiesToUse.forEach((prop) => {
|
|
63
|
-
let value = systemPageData[prop];
|
|
64
|
-
if (value !== void 0 && value !== null) {
|
|
65
|
-
if (prop.includes("BackgroundColor") || prop === "backgroundColor" || prop === "backgroundColorTop" || prop === "backgroundColorBottom") {
|
|
66
|
-
value = (0, import__.colorToHex)(value);
|
|
67
|
-
}
|
|
68
|
-
pageConfig[prop] = value;
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
const configContent = JSON.stringify(pageConfig, null, 2).replace(/^\{/, "").replace(/\}$/, "").trim();
|
|
73
|
-
return `export default definePageConfig({
|
|
74
|
-
${configContent}
|
|
75
|
-
})`;
|
|
76
|
-
}
|
|
77
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
78
|
-
0 && (module.exports = {
|
|
79
|
-
generatePageConfigContent
|
|
80
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base64 图片处理工具
|
|
3
|
-
* 负责将 base64 图片保存为本地文件
|
|
4
|
-
*/
|
|
5
|
-
import type { ImageFileInfo } from './types';
|
|
6
|
-
/**
|
|
7
|
-
* 处理 TabBar 图标,如果是 base64 则准备保存为文件
|
|
8
|
-
* @param iconPath 图标路径(可能是 base64 或普通路径)
|
|
9
|
-
* @param tabBarIndex TabBar 项的索引
|
|
10
|
-
* @param type 图标类型('normal' 或 'selected')
|
|
11
|
-
* @param imageFiles 用于收集需要保存的图片文件的数组(可选)
|
|
12
|
-
* @returns 处理后的图标路径(用于 app.config.ts),如果不是 base64 则返回原路径
|
|
13
|
-
*/
|
|
14
|
-
export declare function processTabBarIcon(iconPath: string | undefined, tabBarIndex: number, type: "normal" | "selected", imageFiles?: ImageFileInfo[]): string | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* 处理页面/组件 data 中的 base64 图片
|
|
17
|
-
* - 图片文件保存到 src/assets/<pageId>/ 目录(与 tabbar 同级)
|
|
18
|
-
* - data 中替换为 "@/assets/<pageId>/<fileName>"
|
|
19
|
-
*/
|
|
20
|
-
export declare function processPageBase64Image(value: string, pageId: string, imageFiles: ImageFileInfo[], nameHint: string, index: number): string;
|
|
21
|
-
/**
|
|
22
|
-
* 替换字符串中的 base64 图片(支持 url(data:image/...) 形式)
|
|
23
|
-
*/
|
|
24
|
-
export declare function replaceBase64InText(value: string, pageId: string, imageFiles: ImageFileInfo[], nameHint: string, getIndex: () => number): string;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/utils/config/content/saveBase64Image.ts
|
|
20
|
-
var saveBase64Image_exports = {};
|
|
21
|
-
__export(saveBase64Image_exports, {
|
|
22
|
-
processPageBase64Image: () => processPageBase64Image,
|
|
23
|
-
processTabBarIcon: () => processTabBarIcon,
|
|
24
|
-
replaceBase64InText: () => replaceBase64InText
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(saveBase64Image_exports);
|
|
27
|
-
var MIME_TO_EXT = {
|
|
28
|
-
png: "png",
|
|
29
|
-
jpg: "jpg",
|
|
30
|
-
jpeg: "jpg",
|
|
31
|
-
gif: "gif",
|
|
32
|
-
webp: "webp",
|
|
33
|
-
svg: "svg"
|
|
34
|
-
};
|
|
35
|
-
function parseBase64Image(base64Str) {
|
|
36
|
-
if (typeof base64Str !== "string")
|
|
37
|
-
return null;
|
|
38
|
-
const match = base64Str.match(/^data:image\/([^;]+);base64,(.+)$/);
|
|
39
|
-
if (!match)
|
|
40
|
-
return null;
|
|
41
|
-
return {
|
|
42
|
-
mimeType: match[1],
|
|
43
|
-
base64Data: match[2]
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
var getFileExtension = (mimeType) => MIME_TO_EXT[mimeType.toLowerCase()] ?? "png";
|
|
47
|
-
var sanitizeName = (name) => name.replace(/[^a-zA-Z0-9_]/g, "_").slice(0, 64) || "img";
|
|
48
|
-
var generateFileName = (index, type, extension) => `tabbar_${index}_${type}.${extension}`;
|
|
49
|
-
function processTabBarIcon(iconPath, tabBarIndex, type, imageFiles) {
|
|
50
|
-
if (!iconPath)
|
|
51
|
-
return void 0;
|
|
52
|
-
const parsed = parseBase64Image(iconPath);
|
|
53
|
-
if (!parsed)
|
|
54
|
-
return iconPath.replace(/^\/?@\//, "");
|
|
55
|
-
const extension = getFileExtension(parsed.mimeType);
|
|
56
|
-
const fileName = generateFileName(tabBarIndex, type, extension);
|
|
57
|
-
const fileSystemPath = `src/assets/tabbar/${fileName}`;
|
|
58
|
-
const configPath = `assets/tabbar/${fileName}`;
|
|
59
|
-
if (imageFiles) {
|
|
60
|
-
try {
|
|
61
|
-
imageFiles.push({
|
|
62
|
-
filePath: fileSystemPath,
|
|
63
|
-
fileContent: Buffer.from(parsed.base64Data, "base64")
|
|
64
|
-
});
|
|
65
|
-
} catch (error) {
|
|
66
|
-
console.error(`处理 TabBar 图标失败: ${error}`);
|
|
67
|
-
return iconPath;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return configPath;
|
|
71
|
-
}
|
|
72
|
-
function processPageBase64Image(value, pageId, imageFiles, nameHint, index) {
|
|
73
|
-
const parsed = parseBase64Image(value);
|
|
74
|
-
if (!parsed)
|
|
75
|
-
return value;
|
|
76
|
-
const extension = getFileExtension(parsed.mimeType);
|
|
77
|
-
const safeName = sanitizeName(nameHint);
|
|
78
|
-
const finalName = index > 1 ? `${safeName}_${index}` : safeName;
|
|
79
|
-
const fileName = `${finalName}.${extension}`;
|
|
80
|
-
const fileSystemPath = `src/assets/${pageId}/${fileName}`;
|
|
81
|
-
const aliasPath = `@/assets/${pageId}/${fileName}`;
|
|
82
|
-
imageFiles.push({
|
|
83
|
-
filePath: fileSystemPath,
|
|
84
|
-
fileContent: Buffer.from(parsed.base64Data, "base64")
|
|
85
|
-
});
|
|
86
|
-
return aliasPath;
|
|
87
|
-
}
|
|
88
|
-
function replaceBase64InText(value, pageId, imageFiles, nameHint, getIndex) {
|
|
89
|
-
if (typeof value !== "string")
|
|
90
|
-
return value;
|
|
91
|
-
let result = value;
|
|
92
|
-
while (true) {
|
|
93
|
-
const match = result.match(/data:image\/[^;]+;base64,[a-zA-Z0-9+/=]+/);
|
|
94
|
-
if (!match)
|
|
95
|
-
break;
|
|
96
|
-
const currentIndex = getIndex();
|
|
97
|
-
const replaced = processPageBase64Image(
|
|
98
|
-
match[0],
|
|
99
|
-
pageId,
|
|
100
|
-
imageFiles,
|
|
101
|
-
nameHint,
|
|
102
|
-
currentIndex
|
|
103
|
-
);
|
|
104
|
-
result = result.replace(match[0], replaced);
|
|
105
|
-
}
|
|
106
|
-
return result;
|
|
107
|
-
}
|
|
108
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
109
|
-
0 && (module.exports = {
|
|
110
|
-
processPageBase64Image,
|
|
111
|
-
processTabBarIcon,
|
|
112
|
-
replaceBase64InText
|
|
113
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TabBar 配置工具
|
|
3
|
-
* 负责从 tabBar 数据生成 app.config.ts 中的 tabBar 配置字符串
|
|
4
|
-
*/
|
|
5
|
-
import type { TaroTabBarConfig, ImageFileInfo } from './types';
|
|
6
|
-
/**
|
|
7
|
-
* 从 tabBar 数据生成 TabBar 配置JSON(用于 app.config.ts)
|
|
8
|
-
* @param tabBar tabBar 数据数组(来自 scenes[x].coms[id].model.data.tabBar)
|
|
9
|
-
* @param pageIdToPath 页面 ID 到路径的映射函数(默认使用 pages/${pageId}/index)
|
|
10
|
-
* @param imageFiles 用于收集需要保存的图片文件的数组(可选)
|
|
11
|
-
* @returns TabBar 配置JSON,如果验证失败则返回 null
|
|
12
|
-
*/
|
|
13
|
-
export declare function generateTabBarConfigContent(tabBar: any[] | undefined, pageIdToPath?: (pageId: string) => string, imageFiles?: ImageFileInfo[]): TaroTabBarConfig | null;
|
|
14
|
-
/**
|
|
15
|
-
* 将 TabBar 配置转换为 app.config.ts 中的字符串格式
|
|
16
|
-
* @param config TabBar 配置
|
|
17
|
-
* @param indent 缩进字符串,默认为 2 个空格
|
|
18
|
-
* @returns 配置字符串
|
|
19
|
-
*/
|
|
20
|
-
export declare function formatTabBarConfigForAppConfig(config: TaroTabBarConfig, indent?: string): string;
|
|
21
|
-
/**
|
|
22
|
-
* 生成转换后的自定义Tabbar项配置文件内容
|
|
23
|
-
* 增加页面路径pagePath
|
|
24
|
-
* normalIconPath/selectedIconPath替换成本地图片路径
|
|
25
|
-
* @param tabBar tabBar 数据数组(来自 scenes[x].coms[id].model.data.tabBar)
|
|
26
|
-
* @param config TabBar 配置
|
|
27
|
-
*/
|
|
28
|
-
export declare function generateCustomTabBarFileContent(tabBar: any[] | undefined, config: TaroTabBarConfig): string;
|