@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,74 +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/tabBarConfig.ts
|
|
20
|
-
var tabBarConfig_exports = {};
|
|
21
|
-
__export(tabBarConfig_exports, {
|
|
22
|
-
formatTabBarConfigForAppConfig: () => formatTabBarConfigForAppConfig,
|
|
23
|
-
generateCustomTabBarFileContent: () => generateCustomTabBarFileContent,
|
|
24
|
-
generateTabBarConfigContent: () => generateTabBarConfigContent
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(tabBarConfig_exports);
|
|
27
|
-
var import_converter = require("./converter");
|
|
28
|
-
var import_saveBase64Image = require("./saveBase64Image");
|
|
29
|
-
function generateTabBarConfigContent(tabBar, pageIdToPath = (pageId) => `pages/${pageId}/index`, imageFiles) {
|
|
30
|
-
if (!tabBar || !Array.isArray(tabBar)) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
const iconProcessor = imageFiles ? (iconPath, index, type) => (0, import_saveBase64Image.processTabBarIcon)(iconPath, index, type, imageFiles) : void 0;
|
|
34
|
-
const config = (0, import_converter.convertToTaroTabBarConfig)(tabBar, pageIdToPath, iconProcessor);
|
|
35
|
-
if (!config) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
return config;
|
|
39
|
-
}
|
|
40
|
-
function formatTabBarConfigForAppConfig(config, indent = " ") {
|
|
41
|
-
const tabBarJson = JSON.stringify(config, null, 2);
|
|
42
|
-
const formattedJson = tabBarJson.replace(/"([^"]+)":/g, "$1:").replace(/"/g, "'");
|
|
43
|
-
const lines = formattedJson.split("\n");
|
|
44
|
-
return lines.map((line, index) => {
|
|
45
|
-
if (index === 0)
|
|
46
|
-
return `${indent}tabBar: ${line}`;
|
|
47
|
-
return `${indent}${line}`;
|
|
48
|
-
}).join("\n");
|
|
49
|
-
}
|
|
50
|
-
function generateCustomTabBarFileContent(tabBar, config) {
|
|
51
|
-
const customTabbarConfig = tabBar.map((item, index) => {
|
|
52
|
-
const { iconPath, selectedIconPath } = config.list[index];
|
|
53
|
-
const cleanPath = (p) => {
|
|
54
|
-
if (!p)
|
|
55
|
-
return void 0;
|
|
56
|
-
const cleaned = p.replace(/^\/?@\//, "").replace(/^\//, "");
|
|
57
|
-
return `/${cleaned}`;
|
|
58
|
-
};
|
|
59
|
-
return {
|
|
60
|
-
...item,
|
|
61
|
-
pagePath: config.list[index].pagePath,
|
|
62
|
-
normalIconPath: cleanPath(iconPath),
|
|
63
|
-
selectedIconPath: cleanPath(selectedIconPath)
|
|
64
|
-
};
|
|
65
|
-
});
|
|
66
|
-
const tabBarJson = JSON.stringify(customTabbarConfig, null, 2);
|
|
67
|
-
return `export default ${tabBarJson} as any`;
|
|
68
|
-
}
|
|
69
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
-
0 && (module.exports = {
|
|
71
|
-
formatTabBarConfigForAppConfig,
|
|
72
|
-
generateCustomTabBarFileContent,
|
|
73
|
-
generateTabBarConfigContent
|
|
74
|
-
});
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TabBar 相关类型定义
|
|
3
|
-
*/
|
|
4
|
-
/// <reference types="node" />
|
|
5
|
-
/// <reference types="node" />
|
|
6
|
-
/**
|
|
7
|
-
* TabBar 项源数据(来自 toJson.tabbar)
|
|
8
|
-
*/
|
|
9
|
-
export interface TabBarItemSource {
|
|
10
|
-
scene: {
|
|
11
|
-
id: string;
|
|
12
|
-
title?: string;
|
|
13
|
-
};
|
|
14
|
-
text?: string;
|
|
15
|
-
type?: string;
|
|
16
|
-
normalIconUseImg?: boolean;
|
|
17
|
-
selectedIconUseImg?: boolean;
|
|
18
|
-
normalIcon?: string;
|
|
19
|
-
selectedIcon?: string;
|
|
20
|
-
normalFontIconStyle?: Record<string, any>;
|
|
21
|
-
selectedFontIconStyle?: Record<string, any>;
|
|
22
|
-
normalIconPath?: string;
|
|
23
|
-
selectedIconPath?: string;
|
|
24
|
-
normalTextStyle?: Record<string, any>;
|
|
25
|
-
selectedTextStyle?: Record<string, any>;
|
|
26
|
-
normalIconStyle?: Record<string, any>;
|
|
27
|
-
selectedIconStyle?: Record<string, any>;
|
|
28
|
-
normalBackgroundStyle?: Record<string, any>;
|
|
29
|
-
selectedBackgroundStyle?: Record<string, any>;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* 转换后的自定义Tabbar项配置
|
|
33
|
-
* 增加页面路径pagePath
|
|
34
|
-
* normalIconPath/selectedIconPath替换成本地图片路径
|
|
35
|
-
*/
|
|
36
|
-
export interface CustomTabbarConfig extends TabBarItemSource {
|
|
37
|
-
pagePath: string;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Taro TabBar 项配置
|
|
41
|
-
*/
|
|
42
|
-
export interface TaroTabBarItem {
|
|
43
|
-
pagePath: string;
|
|
44
|
-
text: string;
|
|
45
|
-
iconPath?: string;
|
|
46
|
-
selectedIconPath?: string;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Taro TabBar 配置
|
|
50
|
-
*/
|
|
51
|
-
export interface TaroTabBarConfig {
|
|
52
|
-
custom?: boolean;
|
|
53
|
-
color?: string;
|
|
54
|
-
selectedColor?: string;
|
|
55
|
-
backgroundColor?: string;
|
|
56
|
-
borderStyle?: string;
|
|
57
|
-
list: TaroTabBarItem[];
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* TabBar 验证结果
|
|
61
|
-
*/
|
|
62
|
-
export interface TabBarValidationResult {
|
|
63
|
-
useTabBar: boolean;
|
|
64
|
-
validItems: TabBarItemSource[];
|
|
65
|
-
error?: string;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* 图片文件信息
|
|
69
|
-
*/
|
|
70
|
-
export interface ImageFileInfo {
|
|
71
|
-
filePath: string;
|
|
72
|
-
fileContent: Buffer;
|
|
73
|
-
}
|
|
@@ -1,17 +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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
-
|
|
15
|
-
// src/utils/config/content/types.ts
|
|
16
|
-
var types_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(types_exports);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { TabBarItemSource, TabBarValidationResult } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* 验证 TabBar 配置
|
|
4
|
-
* @param tabBar TabBar 项数组(来自 toJson.tabbar)
|
|
5
|
-
* @returns 验证结果
|
|
6
|
-
*/
|
|
7
|
-
export declare function validateTabBar(tabBar: TabBarItemSource[] | undefined | null): TabBarValidationResult;
|
|
8
|
-
/**
|
|
9
|
-
* 判断是否启用 TabBar
|
|
10
|
-
* @param tabBar TabBar 项数组
|
|
11
|
-
* @returns 是否启用
|
|
12
|
-
*/
|
|
13
|
-
export declare function shouldUseTabBar(tabBar: TabBarItemSource[] | undefined | null): boolean;
|
|
@@ -1,67 +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/validator.ts
|
|
20
|
-
var validator_exports = {};
|
|
21
|
-
__export(validator_exports, {
|
|
22
|
-
shouldUseTabBar: () => shouldUseTabBar,
|
|
23
|
-
validateTabBar: () => validateTabBar
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(validator_exports);
|
|
26
|
-
var MIN_TAB_BAR_ITEMS = 2;
|
|
27
|
-
var MAX_TAB_BAR_ITEMS = 5;
|
|
28
|
-
function validateTabBar(tabBar) {
|
|
29
|
-
if (!Array.isArray(tabBar)) {
|
|
30
|
-
return {
|
|
31
|
-
useTabBar: false,
|
|
32
|
-
validItems: [],
|
|
33
|
-
error: "TabBar 配置不存在或格式错误"
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
const validItems = tabBar.filter((item) => {
|
|
37
|
-
var _a;
|
|
38
|
-
return !!((_a = item == null ? void 0 : item.scene) == null ? void 0 : _a.id);
|
|
39
|
-
});
|
|
40
|
-
const itemCount = validItems.length;
|
|
41
|
-
if (itemCount < MIN_TAB_BAR_ITEMS) {
|
|
42
|
-
return {
|
|
43
|
-
useTabBar: false,
|
|
44
|
-
validItems: [],
|
|
45
|
-
error: `TabBar 项数量不足,需要至少 ${MIN_TAB_BAR_ITEMS} 个,当前 ${itemCount} 个`
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
if (itemCount > MAX_TAB_BAR_ITEMS) {
|
|
49
|
-
return {
|
|
50
|
-
useTabBar: false,
|
|
51
|
-
validItems: [],
|
|
52
|
-
error: `TabBar 项数量过多,最多 ${MAX_TAB_BAR_ITEMS} 个,当前 ${itemCount} 个`
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
return {
|
|
56
|
-
useTabBar: true,
|
|
57
|
-
validItems
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
function shouldUseTabBar(tabBar) {
|
|
61
|
-
return validateTabBar(tabBar).useTabBar;
|
|
62
|
-
}
|
|
63
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
-
0 && (module.exports = {
|
|
65
|
-
shouldUseTabBar,
|
|
66
|
-
validateTabBar
|
|
67
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import toCode from "@mybricks/to-code-react/dist/cjs/toCode";
|
|
2
|
-
import { type ImageFileInfo } from "./content";
|
|
3
|
-
/**
|
|
4
|
-
* 处理页面配置的类
|
|
5
|
-
* 负责提取 systemPage 组件数据,生成页面配置和 TabBar 配置
|
|
6
|
-
*/
|
|
7
|
-
export declare class HandlePageConfig {
|
|
8
|
-
private globalTabBarConfig;
|
|
9
|
-
private tabBarImageFiles;
|
|
10
|
-
private customTabbarFileContent;
|
|
11
|
-
/**
|
|
12
|
-
* 处理页面配置(提取 systemPage 组件数据)
|
|
13
|
-
* @param scene 场景数据
|
|
14
|
-
* @param isPopup 是否为弹窗场景
|
|
15
|
-
* @returns 页面配置内容
|
|
16
|
-
*/
|
|
17
|
-
handle(scene: ReturnType<typeof toCode>["scenes"][0]["scene"], isPopup?: boolean): string | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* 获取全局 TabBar 配置
|
|
20
|
-
*/
|
|
21
|
-
getTabBarConfig(): string | null;
|
|
22
|
-
/**
|
|
23
|
-
* 获取 TabBar 图片文件数组
|
|
24
|
-
*/
|
|
25
|
-
getTabBarImageFiles(): ImageFileInfo[];
|
|
26
|
-
/**
|
|
27
|
-
* 获取自定义 TabBar 配置文件数据
|
|
28
|
-
* 用于生成文件/src/custom-tab-bar/mybricks/tabbar-config.ts
|
|
29
|
-
*/
|
|
30
|
-
getCustomTabBarFileContent(): string | null;
|
|
31
|
-
}
|
|
@@ -1,88 +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/handlePageConfig.ts
|
|
20
|
-
var handlePageConfig_exports = {};
|
|
21
|
-
__export(handlePageConfig_exports, {
|
|
22
|
-
HandlePageConfig: () => HandlePageConfig
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(handlePageConfig_exports);
|
|
25
|
-
var import_content = require("./content");
|
|
26
|
-
var HandlePageConfig = class {
|
|
27
|
-
constructor() {
|
|
28
|
-
this.globalTabBarConfig = null;
|
|
29
|
-
this.tabBarImageFiles = [];
|
|
30
|
-
this.customTabbarFileContent = null;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* 处理页面配置(提取 systemPage 组件数据)
|
|
34
|
-
* @param scene 场景数据
|
|
35
|
-
* @param isPopup 是否为弹窗场景
|
|
36
|
-
* @returns 页面配置内容
|
|
37
|
-
*/
|
|
38
|
-
handle(scene, isPopup = false) {
|
|
39
|
-
var _a;
|
|
40
|
-
let pageConfigContent;
|
|
41
|
-
const systemPageCom = Object.values(scene.coms || {}).find((com) => {
|
|
42
|
-
var _a2;
|
|
43
|
-
return ((_a2 = com.def) == null ? void 0 : _a2.namespace) === "mybricks.taro.systemPage";
|
|
44
|
-
});
|
|
45
|
-
if ((_a = systemPageCom == null ? void 0 : systemPageCom.model) == null ? void 0 : _a.data) {
|
|
46
|
-
const systemPageData = { ...systemPageCom.model.data };
|
|
47
|
-
pageConfigContent = (0, import_content.generatePageConfigContent)(systemPageData);
|
|
48
|
-
if (!this.globalTabBarConfig && systemPageData.tabBar && Array.isArray(systemPageData.tabBar)) {
|
|
49
|
-
const pageIdToPath = (pageId) => `pages/${pageId}/index`;
|
|
50
|
-
const globalTabBarConfigJson = (0, import_content.generateTabBarConfigContent)(
|
|
51
|
-
systemPageData.tabBar,
|
|
52
|
-
pageIdToPath,
|
|
53
|
-
this.tabBarImageFiles
|
|
54
|
-
);
|
|
55
|
-
if (globalTabBarConfigJson) {
|
|
56
|
-
this.globalTabBarConfig = (0, import_content.formatTabBarConfigForAppConfig)(globalTabBarConfigJson);
|
|
57
|
-
if (this.globalTabBarConfig) {
|
|
58
|
-
this.customTabbarFileContent = (0, import_content.generateCustomTabBarFileContent)(systemPageData.tabBar, globalTabBarConfigJson);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return pageConfigContent;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* 获取全局 TabBar 配置
|
|
67
|
-
*/
|
|
68
|
-
getTabBarConfig() {
|
|
69
|
-
return this.globalTabBarConfig;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* 获取 TabBar 图片文件数组
|
|
73
|
-
*/
|
|
74
|
-
getTabBarImageFiles() {
|
|
75
|
-
return this.tabBarImageFiles;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* 获取自定义 TabBar 配置文件数据
|
|
79
|
-
* 用于生成文件/src/custom-tab-bar/mybricks/tabbar-config.ts
|
|
80
|
-
*/
|
|
81
|
-
getCustomTabBarFileContent() {
|
|
82
|
-
return this.customTabbarFileContent;
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
86
|
-
0 && (module.exports = {
|
|
87
|
-
HandlePageConfig
|
|
88
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 构建上下文数据
|
|
3
|
-
* 包括 sceneMap, eventsMap 等查询映射
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* 构建场景映射表
|
|
7
|
-
*/
|
|
8
|
-
export declare const buildSceneMap: (scenes: any[]) => any;
|
|
9
|
-
/**
|
|
10
|
-
* 构建扩展事件映射表
|
|
11
|
-
*/
|
|
12
|
-
export declare const buildEventsMap: (frames: any[]) => any;
|
|
13
|
-
/**
|
|
14
|
-
* 构建连接器映射表
|
|
15
|
-
*/
|
|
16
|
-
export declare const buildConnectorMap: (plugins: any) => {
|
|
17
|
-
connectors: any;
|
|
18
|
-
config: any;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* 创建场景查询函数
|
|
22
|
-
*/
|
|
23
|
-
export declare const createGetSceneById: (sceneMap: Record<string, any>) => (id: string) => any;
|
|
24
|
-
/**
|
|
25
|
-
* 创建扩展事件查询函数
|
|
26
|
-
*/
|
|
27
|
-
export declare const createGetExtensionEventById: (eventsMap: Record<string, any>) => (id: string) => any;
|
|
28
|
-
/**
|
|
29
|
-
* 创建 frame 查询函数
|
|
30
|
-
*/
|
|
31
|
-
export declare const createGetFrameById: (frameMap: Record<string, any>) => (id: string) => any;
|
|
@@ -1,76 +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/context/buildContext.ts
|
|
20
|
-
var buildContext_exports = {};
|
|
21
|
-
__export(buildContext_exports, {
|
|
22
|
-
buildConnectorMap: () => buildConnectorMap,
|
|
23
|
-
buildEventsMap: () => buildEventsMap,
|
|
24
|
-
buildSceneMap: () => buildSceneMap,
|
|
25
|
-
createGetExtensionEventById: () => createGetExtensionEventById,
|
|
26
|
-
createGetFrameById: () => createGetFrameById,
|
|
27
|
-
createGetSceneById: () => createGetSceneById
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(buildContext_exports);
|
|
30
|
-
var buildSceneMap = (scenes) => {
|
|
31
|
-
return scenes.reduce((pre, cur) => {
|
|
32
|
-
pre[cur.id] = cur;
|
|
33
|
-
return pre;
|
|
34
|
-
}, {});
|
|
35
|
-
};
|
|
36
|
-
var buildEventsMap = (frames) => {
|
|
37
|
-
return frames.reduce((pre, cur) => {
|
|
38
|
-
if (cur.type === "extension-event") {
|
|
39
|
-
pre[cur.id] = cur;
|
|
40
|
-
}
|
|
41
|
-
return pre;
|
|
42
|
-
}, {});
|
|
43
|
-
};
|
|
44
|
-
var buildConnectorMap = (plugins) => {
|
|
45
|
-
const servicePlugin = plugins == null ? void 0 : plugins["@mybricks/plugins/service"];
|
|
46
|
-
if (!servicePlugin)
|
|
47
|
-
return null;
|
|
48
|
-
return {
|
|
49
|
-
connectors: servicePlugin.connectors || [],
|
|
50
|
-
config: servicePlugin.config || {}
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
var createGetSceneById = (sceneMap) => {
|
|
54
|
-
return (id) => {
|
|
55
|
-
return sceneMap[id];
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
var createGetExtensionEventById = (eventsMap) => {
|
|
59
|
-
return (id) => {
|
|
60
|
-
return eventsMap[id];
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
var createGetFrameById = (frameMap) => {
|
|
64
|
-
return (id) => {
|
|
65
|
-
return frameMap[id];
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
69
|
-
0 && (module.exports = {
|
|
70
|
-
buildConnectorMap,
|
|
71
|
-
buildEventsMap,
|
|
72
|
-
buildSceneMap,
|
|
73
|
-
createGetExtensionEventById,
|
|
74
|
-
createGetFrameById,
|
|
75
|
-
createGetSceneById
|
|
76
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 构建 frames 映射表
|
|
3
|
-
* 参考鸿蒙实现 handleFrame.ts
|
|
4
|
-
* 用于快速查找 frame 和对应的组件信息
|
|
5
|
-
*/
|
|
6
|
-
export interface FrameMapItem {
|
|
7
|
-
frame: any;
|
|
8
|
-
meta: any;
|
|
9
|
-
}
|
|
10
|
-
export type FrameMap = Record<string, FrameMapItem>;
|
|
11
|
-
/**
|
|
12
|
-
* 构建完整的 frameMap
|
|
13
|
-
* @param tojson - 完整的 tojson 数据
|
|
14
|
-
* @returns frameMap 对象
|
|
15
|
-
*/
|
|
16
|
-
export declare const buildFrameMap: (tojson: any) => FrameMap;
|
|
@@ -1,106 +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/context/buildFrameMap.ts
|
|
20
|
-
var buildFrameMap_exports = {};
|
|
21
|
-
__export(buildFrameMap_exports, {
|
|
22
|
-
buildFrameMap: () => buildFrameMap
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(buildFrameMap_exports);
|
|
25
|
-
var buildFrameMapRecursive = (frames, frameMap, tojson, config) => {
|
|
26
|
-
frames.forEach((frame) => {
|
|
27
|
-
var _a;
|
|
28
|
-
frameMap[frame.id] = {
|
|
29
|
-
frame,
|
|
30
|
-
meta: ((_a = config == null ? void 0 : config.getComInfo) == null ? void 0 : _a.call(config, "")) || void 0
|
|
31
|
-
};
|
|
32
|
-
if (frame.frames && frame.frames.length > 0) {
|
|
33
|
-
buildFrameMapRecursive(frame.frames, frameMap, tojson, config);
|
|
34
|
-
}
|
|
35
|
-
if (frame.coms) {
|
|
36
|
-
Object.entries(frame.coms).forEach(([comId, comFrame]) => {
|
|
37
|
-
if (comFrame.frames && comFrame.frames.length > 0) {
|
|
38
|
-
buildFrameMapRecursive(
|
|
39
|
-
comFrame.frames,
|
|
40
|
-
frameMap,
|
|
41
|
-
tojson,
|
|
42
|
-
{
|
|
43
|
-
getComInfo: (id) => {
|
|
44
|
-
var _a2;
|
|
45
|
-
for (const scene of tojson.scenes) {
|
|
46
|
-
const comInfo = (_a2 = scene.coms) == null ? void 0 : _a2[comId || id];
|
|
47
|
-
if (comInfo) {
|
|
48
|
-
return comInfo;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return void 0;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
var buildFrameMap = (tojson) => {
|
|
61
|
-
const frameMap = {};
|
|
62
|
-
tojson.frames.forEach((frame) => {
|
|
63
|
-
if (frame.id && !frameMap[frame.id]) {
|
|
64
|
-
frameMap[frame.id] = {
|
|
65
|
-
frame,
|
|
66
|
-
meta: void 0
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
if (frame.frames && frame.frames.length > 0) {
|
|
70
|
-
buildFrameMapRecursive(frame.frames, frameMap, tojson);
|
|
71
|
-
}
|
|
72
|
-
if (frame.coms) {
|
|
73
|
-
Object.entries(frame.coms).forEach(([comId, comFrame]) => {
|
|
74
|
-
if (comFrame.frames && comFrame.frames.length > 0) {
|
|
75
|
-
buildFrameMapRecursive(comFrame.frames, frameMap, tojson, {
|
|
76
|
-
getComInfo: (id) => {
|
|
77
|
-
var _a;
|
|
78
|
-
for (const scene of tojson.scenes) {
|
|
79
|
-
const comInfo = (_a = scene.coms) == null ? void 0 : _a[comId || id];
|
|
80
|
-
if (comInfo) {
|
|
81
|
-
return comInfo;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return void 0;
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
if (tojson.global.fxFrames && tojson.global.fxFrames.length > 0) {
|
|
92
|
-
tojson.global.fxFrames.forEach((fxFrame) => {
|
|
93
|
-
if (!frameMap[fxFrame.id]) {
|
|
94
|
-
frameMap[fxFrame.id] = {
|
|
95
|
-
frame: fxFrame,
|
|
96
|
-
meta: void 0
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
return frameMap;
|
|
102
|
-
};
|
|
103
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
104
|
-
0 && (module.exports = {
|
|
105
|
-
buildFrameMap
|
|
106
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 构建全局数据
|
|
3
|
-
* 包括全局变量类型定义、FX Map 等
|
|
4
|
-
*/
|
|
5
|
-
import type { Provider } from "./createProvider";
|
|
6
|
-
/**
|
|
7
|
-
* 构建全局变量类型定义
|
|
8
|
-
*/
|
|
9
|
-
export declare const buildGlobalVarTypeDef: (comsReg: Record<string, any>) => Record<string, any>;
|
|
10
|
-
/**
|
|
11
|
-
* 构建默认 FX Map
|
|
12
|
-
*/
|
|
13
|
-
export declare const buildDefaultFxsMap: (fxFrames: any[]) => Record<string, Provider>;
|
|
@@ -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/context/buildGlobalData.ts
|
|
20
|
-
var buildGlobalData_exports = {};
|
|
21
|
-
__export(buildGlobalData_exports, {
|
|
22
|
-
buildDefaultFxsMap: () => buildDefaultFxsMap,
|
|
23
|
-
buildGlobalVarTypeDef: () => buildGlobalVarTypeDef
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(buildGlobalData_exports);
|
|
26
|
-
var buildGlobalVarTypeDef = (comsReg) => {
|
|
27
|
-
const globalVarTypeDef = {};
|
|
28
|
-
Object.entries(comsReg).forEach(([, com]) => {
|
|
29
|
-
if (com.def.namespace !== "mybricks.core-comlib.var") {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
globalVarTypeDef[com.title] = com;
|
|
33
|
-
});
|
|
34
|
-
return globalVarTypeDef;
|
|
35
|
-
};
|
|
36
|
-
var buildDefaultFxsMap = (fxFrames) => {
|
|
37
|
-
const defaultFxsMap = {};
|
|
38
|
-
(fxFrames || []).filter((fxFrame) => {
|
|
39
|
-
return fxFrame.type === "fx";
|
|
40
|
-
}).forEach((fxFrame) => {
|
|
41
|
-
defaultFxsMap[fxFrame.id] = {
|
|
42
|
-
name: "global",
|
|
43
|
-
class: "global",
|
|
44
|
-
controllers: /* @__PURE__ */ new Set(),
|
|
45
|
-
useParams: false,
|
|
46
|
-
useEvents: false,
|
|
47
|
-
coms: /* @__PURE__ */ new Set(),
|
|
48
|
-
useController: false,
|
|
49
|
-
useData: false
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
return defaultFxsMap;
|
|
53
|
-
};
|
|
54
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
-
0 && (module.exports = {
|
|
56
|
-
buildDefaultFxsMap,
|
|
57
|
-
buildGlobalVarTypeDef
|
|
58
|
-
});
|