@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 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -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,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TabBar 验证器
|
|
3
|
-
* 负责验证 TabBar 配置是否有效
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/** TabBar 项的最小数量 */
|
|
7
|
-
var MIN_TAB_BAR_ITEMS = 2;
|
|
8
|
-
|
|
9
|
-
/** TabBar 项的最大数量 */
|
|
10
|
-
var MAX_TAB_BAR_ITEMS = 5;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* 验证 TabBar 配置
|
|
14
|
-
* @param tabBar TabBar 项数组(来自 toJson.tabbar)
|
|
15
|
-
* @returns 验证结果
|
|
16
|
-
*/
|
|
17
|
-
export function validateTabBar(tabBar) {
|
|
18
|
-
// 如果 tabBar 不存在或不是数组,返回不启用
|
|
19
|
-
if (!Array.isArray(tabBar)) {
|
|
20
|
-
return {
|
|
21
|
-
useTabBar: false,
|
|
22
|
-
validItems: [],
|
|
23
|
-
error: 'TabBar 配置不存在或格式错误'
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// 过滤出有效的 TabBar 项(必须有 scene.id)
|
|
28
|
-
var validItems = tabBar.filter(function (item) {
|
|
29
|
-
var _item$scene;
|
|
30
|
-
return !!(item !== null && item !== void 0 && (_item$scene = item.scene) !== null && _item$scene !== void 0 && _item$scene.id);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
// 检查数量是否在有效范围内
|
|
34
|
-
var itemCount = validItems.length;
|
|
35
|
-
if (itemCount < MIN_TAB_BAR_ITEMS) {
|
|
36
|
-
return {
|
|
37
|
-
useTabBar: false,
|
|
38
|
-
validItems: [],
|
|
39
|
-
error: "TabBar \u9879\u6570\u91CF\u4E0D\u8DB3\uFF0C\u9700\u8981\u81F3\u5C11 ".concat(MIN_TAB_BAR_ITEMS, " \u4E2A\uFF0C\u5F53\u524D ").concat(itemCount, " \u4E2A")
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
if (itemCount > MAX_TAB_BAR_ITEMS) {
|
|
43
|
-
return {
|
|
44
|
-
useTabBar: false,
|
|
45
|
-
validItems: [],
|
|
46
|
-
error: "TabBar \u9879\u6570\u91CF\u8FC7\u591A\uFF0C\u6700\u591A ".concat(MAX_TAB_BAR_ITEMS, " \u4E2A\uFF0C\u5F53\u524D ").concat(itemCount, " \u4E2A")
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// 验证通过
|
|
51
|
-
return {
|
|
52
|
-
useTabBar: true,
|
|
53
|
-
validItems: validItems
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* 判断是否启用 TabBar
|
|
59
|
-
* @param tabBar TabBar 项数组
|
|
60
|
-
* @returns 是否启用
|
|
61
|
-
*/
|
|
62
|
-
export function shouldUseTabBar(tabBar) {
|
|
63
|
-
return validateTabBar(tabBar).useTabBar;
|
|
64
|
-
}
|
|
@@ -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,89 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
|
-
import { generatePageConfigContent, generateTabBarConfigContent, formatTabBarConfigForAppConfig, generateCustomTabBarFileContent } from "./content";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* 处理页面配置的类
|
|
9
|
-
* 负责提取 systemPage 组件数据,生成页面配置和 TabBar 配置
|
|
10
|
-
*/
|
|
11
|
-
export var HandlePageConfig = /*#__PURE__*/function () {
|
|
12
|
-
function HandlePageConfig() {
|
|
13
|
-
_classCallCheck(this, HandlePageConfig);
|
|
14
|
-
_defineProperty(this, "globalTabBarConfig", null);
|
|
15
|
-
_defineProperty(this, "tabBarImageFiles", []);
|
|
16
|
-
_defineProperty(this, "customTabbarFileContent", null);
|
|
17
|
-
}
|
|
18
|
-
_createClass(HandlePageConfig, [{
|
|
19
|
-
key: "handle",
|
|
20
|
-
value:
|
|
21
|
-
/**
|
|
22
|
-
* 处理页面配置(提取 systemPage 组件数据)
|
|
23
|
-
* @param scene 场景数据
|
|
24
|
-
* @param isPopup 是否为弹窗场景
|
|
25
|
-
* @returns 页面配置内容
|
|
26
|
-
*/
|
|
27
|
-
function handle(scene) {
|
|
28
|
-
var _systemPageCom$model;
|
|
29
|
-
var isPopup = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
30
|
-
// 提取 systemPage 组件数据,生成 pageConfigContent
|
|
31
|
-
var pageConfigContent;
|
|
32
|
-
var systemPageCom = Object.values(scene.coms || {}).find(function (com) {
|
|
33
|
-
var _com$def;
|
|
34
|
-
return ((_com$def = com.def) === null || _com$def === void 0 ? void 0 : _com$def.namespace) === 'mybricks.taro.systemPage';
|
|
35
|
-
});
|
|
36
|
-
if (systemPageCom !== null && systemPageCom !== void 0 && (_systemPageCom$model = systemPageCom.model) !== null && _systemPageCom$model !== void 0 && _systemPageCom$model.data) {
|
|
37
|
-
var systemPageData = _objectSpread({}, systemPageCom.model.data);
|
|
38
|
-
|
|
39
|
-
// 生成页面配置
|
|
40
|
-
pageConfigContent = generatePageConfigContent(systemPageData);
|
|
41
|
-
|
|
42
|
-
// 提取 TabBar 配置(只提取一次,从第一个找到的 systemPage 组件)
|
|
43
|
-
if (!this.globalTabBarConfig && systemPageData.tabBar && Array.isArray(systemPageData.tabBar)) {
|
|
44
|
-
// 使用 tabBar[x].scene.id 作为路径的 id
|
|
45
|
-
var pageIdToPath = function pageIdToPath(pageId) {
|
|
46
|
-
return "pages/".concat(pageId, "/index");
|
|
47
|
-
};
|
|
48
|
-
var globalTabBarConfigJson = generateTabBarConfigContent(systemPageData.tabBar, pageIdToPath, this.tabBarImageFiles);
|
|
49
|
-
if (globalTabBarConfigJson) {
|
|
50
|
-
this.globalTabBarConfig = formatTabBarConfigForAppConfig(globalTabBarConfigJson);
|
|
51
|
-
if (this.globalTabBarConfig) {
|
|
52
|
-
this.customTabbarFileContent = generateCustomTabBarFileContent(systemPageData.tabBar, globalTabBarConfigJson);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return pageConfigContent;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* 获取全局 TabBar 配置
|
|
62
|
-
*/
|
|
63
|
-
}, {
|
|
64
|
-
key: "getTabBarConfig",
|
|
65
|
-
value: function getTabBarConfig() {
|
|
66
|
-
return this.globalTabBarConfig;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* 获取 TabBar 图片文件数组
|
|
71
|
-
*/
|
|
72
|
-
}, {
|
|
73
|
-
key: "getTabBarImageFiles",
|
|
74
|
-
value: function getTabBarImageFiles() {
|
|
75
|
-
return this.tabBarImageFiles;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* 获取自定义 TabBar 配置文件数据
|
|
80
|
-
* 用于生成文件/src/custom-tab-bar/mybricks/tabbar-config.ts
|
|
81
|
-
*/
|
|
82
|
-
}, {
|
|
83
|
-
key: "getCustomTabBarFileContent",
|
|
84
|
-
value: function getCustomTabBarFileContent() {
|
|
85
|
-
return this.customTabbarFileContent;
|
|
86
|
-
}
|
|
87
|
-
}]);
|
|
88
|
-
return HandlePageConfig;
|
|
89
|
-
}();
|
|
@@ -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,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 构建上下文数据
|
|
3
|
-
* 包括 sceneMap, eventsMap 等查询映射
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 构建场景映射表
|
|
8
|
-
*/
|
|
9
|
-
export var buildSceneMap = function buildSceneMap(scenes) {
|
|
10
|
-
return scenes.reduce(function (pre, cur) {
|
|
11
|
-
pre[cur.id] = cur;
|
|
12
|
-
return pre;
|
|
13
|
-
}, {});
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* 构建扩展事件映射表
|
|
18
|
-
*/
|
|
19
|
-
export var buildEventsMap = function buildEventsMap(frames) {
|
|
20
|
-
return frames.reduce(function (pre, cur) {
|
|
21
|
-
if (cur.type === "extension-event") {
|
|
22
|
-
pre[cur.id] = cur;
|
|
23
|
-
}
|
|
24
|
-
return pre;
|
|
25
|
-
}, {});
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* 构建连接器映射表
|
|
30
|
-
*/
|
|
31
|
-
export var buildConnectorMap = function buildConnectorMap(plugins) {
|
|
32
|
-
var servicePlugin = plugins === null || plugins === void 0 ? void 0 : plugins["@mybricks/plugins/service"];
|
|
33
|
-
if (!servicePlugin) return null;
|
|
34
|
-
return {
|
|
35
|
-
connectors: servicePlugin.connectors || [],
|
|
36
|
-
config: servicePlugin.config || {}
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* 创建场景查询函数
|
|
42
|
-
*/
|
|
43
|
-
export var createGetSceneById = function createGetSceneById(sceneMap) {
|
|
44
|
-
return function (id) {
|
|
45
|
-
return sceneMap[id];
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* 创建扩展事件查询函数
|
|
51
|
-
*/
|
|
52
|
-
export var createGetExtensionEventById = function createGetExtensionEventById(eventsMap) {
|
|
53
|
-
return function (id) {
|
|
54
|
-
return eventsMap[id];
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* 创建 frame 查询函数
|
|
60
|
-
*/
|
|
61
|
-
export var createGetFrameById = function createGetFrameById(frameMap) {
|
|
62
|
-
return function (id) {
|
|
63
|
-
return frameMap[id];
|
|
64
|
-
};
|
|
65
|
-
};
|
|
@@ -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,131 +0,0 @@
|
|
|
1
|
-
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
/**
|
|
4
|
-
* 构建 frames 映射表
|
|
5
|
-
* 参考鸿蒙实现 handleFrame.ts
|
|
6
|
-
* 用于快速查找 frame 和对应的组件信息
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* 递归构建 frameMap
|
|
11
|
-
* @param frames - 要处理的 frames 数组
|
|
12
|
-
* @param frameMap - 目标 frameMap 对象
|
|
13
|
-
* @param tojson - 完整的 tojson 数据,用于查找组件信息
|
|
14
|
-
*/
|
|
15
|
-
var buildFrameMapRecursive = function buildFrameMapRecursive(frames, frameMap, tojson, config) {
|
|
16
|
-
frames.forEach(function (frame) {
|
|
17
|
-
var _config$getComInfo;
|
|
18
|
-
frameMap[frame.id] = {
|
|
19
|
-
frame: frame,
|
|
20
|
-
meta: (config === null || config === void 0 || (_config$getComInfo = config.getComInfo) === null || _config$getComInfo === void 0 ? void 0 : _config$getComInfo.call(config, "")) || undefined
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// 递归处理子 frames(frame.frames)
|
|
24
|
-
if (frame.frames && frame.frames.length > 0) {
|
|
25
|
-
buildFrameMapRecursive(frame.frames, frameMap, tojson, config);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// 递归处理组件内的 frames(frame.coms)
|
|
29
|
-
if (frame.coms) {
|
|
30
|
-
Object.entries(frame.coms).forEach(function (_ref) {
|
|
31
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
32
|
-
comId = _ref2[0],
|
|
33
|
-
comFrame = _ref2[1];
|
|
34
|
-
if (comFrame.frames && comFrame.frames.length > 0) {
|
|
35
|
-
buildFrameMapRecursive(comFrame.frames, frameMap, tojson, {
|
|
36
|
-
getComInfo: function getComInfo(id) {
|
|
37
|
-
// 查找对应的组件信息
|
|
38
|
-
var _iterator = _createForOfIteratorHelper(tojson.scenes),
|
|
39
|
-
_step;
|
|
40
|
-
try {
|
|
41
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
42
|
-
var _scene$coms;
|
|
43
|
-
var scene = _step.value;
|
|
44
|
-
var comInfo = (_scene$coms = scene.coms) === null || _scene$coms === void 0 ? void 0 : _scene$coms[comId || id];
|
|
45
|
-
if (comInfo) {
|
|
46
|
-
return comInfo;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
} catch (err) {
|
|
50
|
-
_iterator.e(err);
|
|
51
|
-
} finally {
|
|
52
|
-
_iterator.f();
|
|
53
|
-
}
|
|
54
|
-
return undefined;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* 构建完整的 frameMap
|
|
65
|
-
* @param tojson - 完整的 tojson 数据
|
|
66
|
-
* @returns frameMap 对象
|
|
67
|
-
*/
|
|
68
|
-
export var buildFrameMap = function buildFrameMap(tojson) {
|
|
69
|
-
var frameMap = {};
|
|
70
|
-
|
|
71
|
-
// 处理所有场景的 frames
|
|
72
|
-
tojson.frames.forEach(function (frame) {
|
|
73
|
-
// 处理场景级别的 frame
|
|
74
|
-
if (frame.id && !frameMap[frame.id]) {
|
|
75
|
-
frameMap[frame.id] = {
|
|
76
|
-
frame: frame,
|
|
77
|
-
meta: undefined
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// 递归处理 frame 的子 frames
|
|
82
|
-
if (frame.frames && frame.frames.length > 0) {
|
|
83
|
-
buildFrameMapRecursive(frame.frames, frameMap, tojson);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// 递归处理 frame 内组件的 frames
|
|
87
|
-
if (frame.coms) {
|
|
88
|
-
Object.entries(frame.coms).forEach(function (_ref3) {
|
|
89
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
90
|
-
comId = _ref4[0],
|
|
91
|
-
comFrame = _ref4[1];
|
|
92
|
-
if (comFrame.frames && comFrame.frames.length > 0) {
|
|
93
|
-
buildFrameMapRecursive(comFrame.frames, frameMap, tojson, {
|
|
94
|
-
getComInfo: function getComInfo(id) {
|
|
95
|
-
var _iterator2 = _createForOfIteratorHelper(tojson.scenes),
|
|
96
|
-
_step2;
|
|
97
|
-
try {
|
|
98
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
99
|
-
var _scene$coms2;
|
|
100
|
-
var scene = _step2.value;
|
|
101
|
-
var comInfo = (_scene$coms2 = scene.coms) === null || _scene$coms2 === void 0 ? void 0 : _scene$coms2[comId || id];
|
|
102
|
-
if (comInfo) {
|
|
103
|
-
return comInfo;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
} catch (err) {
|
|
107
|
-
_iterator2.e(err);
|
|
108
|
-
} finally {
|
|
109
|
-
_iterator2.f();
|
|
110
|
-
}
|
|
111
|
-
return undefined;
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
// 处理全局 FX frames
|
|
120
|
-
if (tojson.global.fxFrames && tojson.global.fxFrames.length > 0) {
|
|
121
|
-
tojson.global.fxFrames.forEach(function (fxFrame) {
|
|
122
|
-
if (!frameMap[fxFrame.id]) {
|
|
123
|
-
frameMap[fxFrame.id] = {
|
|
124
|
-
frame: fxFrame,
|
|
125
|
-
meta: undefined
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
return frameMap;
|
|
131
|
-
};
|
|
@@ -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,44 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
/**
|
|
3
|
-
* 构建全局数据
|
|
4
|
-
* 包括全局变量类型定义、FX Map 等
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* 构建全局变量类型定义
|
|
9
|
-
*/
|
|
10
|
-
export var buildGlobalVarTypeDef = function buildGlobalVarTypeDef(comsReg) {
|
|
11
|
-
var globalVarTypeDef = {};
|
|
12
|
-
Object.entries(comsReg).forEach(function (_ref) {
|
|
13
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
14
|
-
com = _ref2[1];
|
|
15
|
-
if (com.def.namespace !== "mybricks.core-comlib.var") {
|
|
16
|
-
// 非变量,不需要初始化
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
globalVarTypeDef[com.title] = com;
|
|
20
|
-
});
|
|
21
|
-
return globalVarTypeDef;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* 构建默认 FX Map
|
|
26
|
-
*/
|
|
27
|
-
export var buildDefaultFxsMap = function buildDefaultFxsMap(fxFrames) {
|
|
28
|
-
var defaultFxsMap = {};
|
|
29
|
-
(fxFrames || []).filter(function (fxFrame) {
|
|
30
|
-
return fxFrame.type === "fx";
|
|
31
|
-
}).forEach(function (fxFrame) {
|
|
32
|
-
defaultFxsMap[fxFrame.id] = {
|
|
33
|
-
name: "global",
|
|
34
|
-
class: "global",
|
|
35
|
-
controllers: new Set(),
|
|
36
|
-
useParams: false,
|
|
37
|
-
useEvents: false,
|
|
38
|
-
coms: new Set(),
|
|
39
|
-
useController: false,
|
|
40
|
-
useData: false
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
return defaultFxsMap;
|
|
44
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 收集 JS 计算组件模块
|
|
3
|
-
*/
|
|
4
|
-
export interface JSModule {
|
|
5
|
-
id: string;
|
|
6
|
-
title: string;
|
|
7
|
-
transformCode: string;
|
|
8
|
-
inputs: string[];
|
|
9
|
-
outputs: string[];
|
|
10
|
-
data: any;
|
|
11
|
-
}
|
|
12
|
-
export type JSModulesMap = Map<string, JSModule>;
|
|
13
|
-
/**
|
|
14
|
-
* 从组件信息中提取 JS 模块数据
|
|
15
|
-
*/
|
|
16
|
-
export declare const extractJSModuleFromCom: (comId: string, comInfo: any) => JSModule | null;
|
|
17
|
-
/**
|
|
18
|
-
* 从场景中收集 JS 模块
|
|
19
|
-
*/
|
|
20
|
-
export declare const collectJSModulesFromScene: (scene: any, jsModulesMap: JSModulesMap) => void;
|
|
21
|
-
/**
|
|
22
|
-
* 创建 JS 模块收集器
|
|
23
|
-
*/
|
|
24
|
-
export declare const createJSModulesCollector: () => {
|
|
25
|
-
/**
|
|
26
|
-
* 从场景中收集 JS 模块
|
|
27
|
-
*/
|
|
28
|
-
collectFromScene: (scene: any) => void;
|
|
29
|
-
/**
|
|
30
|
-
* 添加 JS 模块
|
|
31
|
-
*/
|
|
32
|
-
add: (module: JSModule) => void;
|
|
33
|
-
/**
|
|
34
|
-
* 获取所有 JS 模块
|
|
35
|
-
*/
|
|
36
|
-
getAll: () => JSModule[];
|
|
37
|
-
/**
|
|
38
|
-
* 获取 JS 模块映射表
|
|
39
|
-
*/
|
|
40
|
-
getMap: () => JSModulesMap;
|
|
41
|
-
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
/**
|
|
3
|
-
* 收集 JS 计算组件模块
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 判断是否是 JS 计算组件
|
|
8
|
-
*/
|
|
9
|
-
var isJsCalculationComponent = function isJsCalculationComponent(namespace) {
|
|
10
|
-
return namespace === "mybricks.taro._muilt-inputJs" || namespace === "mybricks.core-comlib.js-ai";
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* 从组件信息中提取 JS 模块数据
|
|
15
|
-
*/
|
|
16
|
-
export var extractJSModuleFromCom = function extractJSModuleFromCom(comId, comInfo) {
|
|
17
|
-
var _model$data, _model$data2, _model$data3;
|
|
18
|
-
var def = comInfo.def,
|
|
19
|
-
model = comInfo.model;
|
|
20
|
-
if (!isJsCalculationComponent(def === null || def === void 0 ? void 0 : def.namespace)) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// 优先使用原始代码(code),而不是转译后的代码(transformCode),避免包含 Babel 辅助函数
|
|
25
|
-
var transformCode = (model === null || model === void 0 || (_model$data = model.data) === null || _model$data === void 0 || (_model$data = _model$data.fns) === null || _model$data === void 0 ? void 0 : _model$data.code) || (model === null || model === void 0 || (_model$data2 = model.data) === null || _model$data2 === void 0 || (_model$data2 = _model$data2.fns) === null || _model$data2 === void 0 ? void 0 : _model$data2.transformCode) || (model === null || model === void 0 || (_model$data3 = model.data) === null || _model$data3 === void 0 ? void 0 : _model$data3.fns);
|
|
26
|
-
if (!transformCode) {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
id: comId,
|
|
31
|
-
title: comInfo.title || "JS计算",
|
|
32
|
-
transformCode: typeof transformCode === "string" ? transformCode : "",
|
|
33
|
-
inputs: (model === null || model === void 0 ? void 0 : model.inputs) || [],
|
|
34
|
-
outputs: (model === null || model === void 0 ? void 0 : model.outputs) || [],
|
|
35
|
-
data: (model === null || model === void 0 ? void 0 : model.data) || {}
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* 从场景中收集 JS 模块
|
|
41
|
-
*/
|
|
42
|
-
export var collectJSModulesFromScene = function collectJSModulesFromScene(scene, jsModulesMap) {
|
|
43
|
-
Object.entries(scene.coms || {}).forEach(function (_ref) {
|
|
44
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
45
|
-
comId = _ref2[0],
|
|
46
|
-
comInfo = _ref2[1];
|
|
47
|
-
var jsModule = extractJSModuleFromCom(comId, comInfo);
|
|
48
|
-
if (jsModule && !jsModulesMap.has(comId)) {
|
|
49
|
-
jsModulesMap.set(comId, jsModule);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* 创建 JS 模块收集器
|
|
56
|
-
*/
|
|
57
|
-
export var createJSModulesCollector = function createJSModulesCollector() {
|
|
58
|
-
var jsModulesMap = new Map();
|
|
59
|
-
return {
|
|
60
|
-
/**
|
|
61
|
-
* 从场景中收集 JS 模块
|
|
62
|
-
*/
|
|
63
|
-
collectFromScene: function collectFromScene(scene) {
|
|
64
|
-
collectJSModulesFromScene(scene, jsModulesMap);
|
|
65
|
-
},
|
|
66
|
-
/**
|
|
67
|
-
* 添加 JS 模块
|
|
68
|
-
*/
|
|
69
|
-
add: function add(module) {
|
|
70
|
-
if (!jsModulesMap.has(module.id)) {
|
|
71
|
-
jsModulesMap.set(module.id, module);
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
/**
|
|
75
|
-
* 获取所有 JS 模块
|
|
76
|
-
*/
|
|
77
|
-
getAll: function getAll() {
|
|
78
|
-
return Array.from(jsModulesMap.values());
|
|
79
|
-
},
|
|
80
|
-
/**
|
|
81
|
-
* 获取 JS 模块映射表
|
|
82
|
-
*/
|
|
83
|
-
getMap: function getMap() {
|
|
84
|
-
return jsModulesMap;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 创建事件查询函数
|
|
3
|
-
* 用于从事件列表中查询特定类型的事件
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* 创建变量事件查询函数
|
|
7
|
-
*/
|
|
8
|
-
export declare const createGetVarEvents: (events: any[]) => (params?: {
|
|
9
|
-
comId?: string;
|
|
10
|
-
slotId?: string;
|
|
11
|
-
}) => any[];
|
|
12
|
-
/**
|
|
13
|
-
* 创建 FX 事件查询函数
|
|
14
|
-
*/
|
|
15
|
-
export declare const createGetFxEvents: (events: any[]) => (params?: {
|
|
16
|
-
comId?: string;
|
|
17
|
-
slotId?: string;
|
|
18
|
-
}) => any[];
|
|
19
|
-
/**
|
|
20
|
-
* 创建生命周期事件查询函数
|
|
21
|
-
*/
|
|
22
|
-
export declare const createGetEffectEvent: (events: any[]) => (params?: {
|
|
23
|
-
comId: string;
|
|
24
|
-
slotId: string;
|
|
25
|
-
}) => any;
|
|
26
|
-
/**
|
|
27
|
-
* 创建事件查询函数集合
|
|
28
|
-
*/
|
|
29
|
-
export declare const createEventQueries: (events: any[]) => {
|
|
30
|
-
getVarEvents: (params?: {
|
|
31
|
-
comId?: string;
|
|
32
|
-
slotId?: string;
|
|
33
|
-
}) => any[];
|
|
34
|
-
getFxEvents: (params?: {
|
|
35
|
-
comId?: string;
|
|
36
|
-
slotId?: string;
|
|
37
|
-
}) => any[];
|
|
38
|
-
getEffectEvent: (params?: {
|
|
39
|
-
comId: string;
|
|
40
|
-
slotId: string;
|
|
41
|
-
}) => any;
|
|
42
|
-
getEventByDiagramId: (diagramId: string) => any;
|
|
43
|
-
/** 获取场景/区块的输入项事件 */
|
|
44
|
-
getFrameInputEvent: (pinId: string, frameId?: string) => any;
|
|
45
|
-
};
|