@mybricks/to-code-taro 1.2.6 → 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,175 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/utils/style/converter.ts
|
|
30
|
-
var converter_exports = {};
|
|
31
|
-
__export(converter_exports, {
|
|
32
|
-
convertComponentStyle: () => convertComponentStyle,
|
|
33
|
-
convertRootStyle: () => convertRootStyle,
|
|
34
|
-
convertStyleAryToCss: () => convertStyleAryToCss
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(converter_exports);
|
|
37
|
-
var import_pxtransform = __toESM(require("./pxtransform"));
|
|
38
|
-
var import_string = require("../common/string");
|
|
39
|
-
var DIMENSION_PROPS = /^(width|height|padding|margin|top|right|bottom|left|fontSize|borderRadius|borderWidth|gap|rowGap|columnGap)/i;
|
|
40
|
-
var MIXED_PROPS = /^(lineHeight)/i;
|
|
41
|
-
var MIN_MAX_PROPS = /^(min|max)/i;
|
|
42
|
-
function isDimensionProp(key) {
|
|
43
|
-
if (DIMENSION_PROPS.test(key))
|
|
44
|
-
return true;
|
|
45
|
-
if (MIN_MAX_PROPS.test(key)) {
|
|
46
|
-
const subKey = key.replace(/^(min|max)/i, "");
|
|
47
|
-
const normalizedSubKey = subKey.charAt(0).toLowerCase() + subKey.slice(1);
|
|
48
|
-
return DIMENSION_PROPS.test(normalizedSubKey);
|
|
49
|
-
}
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
function transformStyleValue(key, value) {
|
|
53
|
-
if (typeof value !== "string" && typeof value !== "number")
|
|
54
|
-
return value;
|
|
55
|
-
if (isDimensionProp(key)) {
|
|
56
|
-
return (0, import_pxtransform.default)(value);
|
|
57
|
-
}
|
|
58
|
-
if (MIXED_PROPS.test(key)) {
|
|
59
|
-
return typeof value === "string" ? (0, import_pxtransform.default)(value) : value;
|
|
60
|
-
}
|
|
61
|
-
return value;
|
|
62
|
-
}
|
|
63
|
-
function handleLayoutProp(value, target) {
|
|
64
|
-
if (typeof value === "object" && value !== null) {
|
|
65
|
-
const layoutObj = value;
|
|
66
|
-
Object.entries(layoutObj).forEach(([lKey, lValue]) => {
|
|
67
|
-
if (lKey === "position") {
|
|
68
|
-
if (lValue === "smart") {
|
|
69
|
-
if (target["position"] === void 0) {
|
|
70
|
-
target["position"] = "relative";
|
|
71
|
-
}
|
|
72
|
-
} else if (lValue !== "inherit") {
|
|
73
|
-
target["position"] = lValue;
|
|
74
|
-
}
|
|
75
|
-
} else {
|
|
76
|
-
const camelLKey = (0, import_string.kebabToCamel)(lKey);
|
|
77
|
-
target[camelLKey] = transformStyleValue(camelLKey, lValue);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
} else if (value === "flex-row") {
|
|
81
|
-
target["display"] = "flex";
|
|
82
|
-
target["flexDirection"] = "row";
|
|
83
|
-
} else if (value === "flex-column") {
|
|
84
|
-
target["display"] = "flex";
|
|
85
|
-
target["flexDirection"] = "column";
|
|
86
|
-
} else if (value === "smart") {
|
|
87
|
-
if (target["position"] === void 0) {
|
|
88
|
-
target["position"] = "relative";
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
var convertRootStyle = (style) => {
|
|
93
|
-
const rootStyle = {};
|
|
94
|
-
Object.entries(style || {}).forEach(([key, value]) => {
|
|
95
|
-
if (key === "_new" || key === "themesId" || key === "visibility" || key === "styleAry") {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
if (key === "layout") {
|
|
99
|
-
handleLayoutProp(value, rootStyle);
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
if (key === "widthAuto" && value === true) {
|
|
103
|
-
rootStyle["width"] = "auto";
|
|
104
|
-
} else if (key === "heightAuto" && value === true) {
|
|
105
|
-
rootStyle["height"] = "auto";
|
|
106
|
-
} else if (key === "widthFull" && value === true) {
|
|
107
|
-
rootStyle["width"] = "100%";
|
|
108
|
-
} else if (key === "heightFull" && value === true) {
|
|
109
|
-
rootStyle["height"] = "100%";
|
|
110
|
-
}
|
|
111
|
-
const camelKey = key.includes("-") ? (0, import_string.kebabToCamel)(key) : key;
|
|
112
|
-
rootStyle[camelKey] = transformStyleValue(camelKey, value);
|
|
113
|
-
});
|
|
114
|
-
return rootStyle;
|
|
115
|
-
};
|
|
116
|
-
var convertComponentStyle = (style) => {
|
|
117
|
-
const resultStyle = {};
|
|
118
|
-
const rootStyle = convertRootStyle(style);
|
|
119
|
-
if (style.styleAry) {
|
|
120
|
-
style.styleAry.forEach(
|
|
121
|
-
({
|
|
122
|
-
css,
|
|
123
|
-
selector
|
|
124
|
-
}) => {
|
|
125
|
-
const transformedCss = {};
|
|
126
|
-
Object.entries(css).forEach(([cssKey, cssValue]) => {
|
|
127
|
-
if (cssKey === "layout") {
|
|
128
|
-
handleLayoutProp(cssValue, transformedCss);
|
|
129
|
-
} else {
|
|
130
|
-
const camelKey = cssKey.includes("-") ? (0, import_string.kebabToCamel)(cssKey) : cssKey;
|
|
131
|
-
transformedCss[camelKey] = transformStyleValue(camelKey, cssValue);
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
resultStyle[selector] = transformedCss;
|
|
135
|
-
}
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
resultStyle["root"] = rootStyle;
|
|
139
|
-
return resultStyle;
|
|
140
|
-
};
|
|
141
|
-
var convertStyleAryToCss = (styleAry, parentSelector) => {
|
|
142
|
-
if (!Array.isArray(styleAry))
|
|
143
|
-
return "";
|
|
144
|
-
return styleAry.map(({ selector, css }) => {
|
|
145
|
-
if (!selector || !css)
|
|
146
|
-
return "";
|
|
147
|
-
let finalSelector = selector.trim();
|
|
148
|
-
if (parentSelector) {
|
|
149
|
-
const prefix = `.${parentSelector}`;
|
|
150
|
-
finalSelector = `${prefix} ${finalSelector}`;
|
|
151
|
-
}
|
|
152
|
-
const transformedCss = {};
|
|
153
|
-
Object.entries(css).forEach(([key, value]) => {
|
|
154
|
-
if (key === "layout") {
|
|
155
|
-
handleLayoutProp(value, transformedCss);
|
|
156
|
-
} else {
|
|
157
|
-
const camelKey = (0, import_string.kebabToCamel)(key);
|
|
158
|
-
transformedCss[camelKey] = transformStyleValue(camelKey, value);
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
const cssString = Object.entries(transformedCss).map(([key, value]) => {
|
|
162
|
-
const kebabKey = (0, import_string.camelToKebab)(key);
|
|
163
|
-
return ` ${kebabKey}: ${value};`;
|
|
164
|
-
}).join("\n");
|
|
165
|
-
return `${finalSelector} {
|
|
166
|
-
${cssString}
|
|
167
|
-
}`;
|
|
168
|
-
}).join("\n\n");
|
|
169
|
-
};
|
|
170
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
171
|
-
0 && (module.exports = {
|
|
172
|
-
convertComponentStyle,
|
|
173
|
-
convertRootStyle,
|
|
174
|
-
convertStyleAryToCss
|
|
175
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 从组件的 namespace 转换为 className
|
|
3
|
-
* 例如:mybricks.taro.systemPage -> mybricks_taro_systemPage
|
|
4
|
-
* 例如:mybricks.taro.image -> mybricks_taro_image
|
|
5
|
-
* @param namespace 组件的 namespace
|
|
6
|
-
* @returns className(用下划线替换点)
|
|
7
|
-
*/
|
|
8
|
-
export declare function getComponentClassName(namespace: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* 从场景中获取根组件的 className
|
|
11
|
-
* 获取场景中第一个组件的命名空间并转换为 className(仅用于根组件)
|
|
12
|
-
* @param scene 场景对象
|
|
13
|
-
* @param isRoot 是否为根组件
|
|
14
|
-
* @returns className 字符串,如果不是根组件或未找到则返回空字符串
|
|
15
|
-
*/
|
|
16
|
-
export declare function getRootComponentClassName(scene: any, isRoot?: boolean): string;
|
|
@@ -1,47 +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/style/getComponentClassName.ts
|
|
20
|
-
var getComponentClassName_exports = {};
|
|
21
|
-
__export(getComponentClassName_exports, {
|
|
22
|
-
getComponentClassName: () => getComponentClassName,
|
|
23
|
-
getRootComponentClassName: () => getRootComponentClassName
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(getComponentClassName_exports);
|
|
26
|
-
function getComponentClassName(namespace) {
|
|
27
|
-
if (!namespace) {
|
|
28
|
-
return "";
|
|
29
|
-
}
|
|
30
|
-
return namespace.replace(/\./g, "_");
|
|
31
|
-
}
|
|
32
|
-
function getRootComponentClassName(scene, isRoot = false) {
|
|
33
|
-
var _a;
|
|
34
|
-
if (!isRoot || !scene || !scene.coms) {
|
|
35
|
-
return "";
|
|
36
|
-
}
|
|
37
|
-
const firstCom = Object.values(scene.coms)[0];
|
|
38
|
-
if ((_a = firstCom == null ? void 0 : firstCom.def) == null ? void 0 : _a.namespace) {
|
|
39
|
-
return getComponentClassName(firstCom.def.namespace);
|
|
40
|
-
}
|
|
41
|
-
return "";
|
|
42
|
-
}
|
|
43
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
getComponentClassName,
|
|
46
|
-
getRootComponentClassName
|
|
47
|
-
});
|
|
@@ -1,62 +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/style/pxtransform.ts
|
|
20
|
-
var pxtransform_exports = {};
|
|
21
|
-
__export(pxtransform_exports, {
|
|
22
|
-
default: () => pxtransform
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(pxtransform_exports);
|
|
25
|
-
function pxToRpx(value) {
|
|
26
|
-
if (typeof value === "number") {
|
|
27
|
-
return `${value * 2}rpx`;
|
|
28
|
-
}
|
|
29
|
-
if (typeof value !== "string")
|
|
30
|
-
return String(value);
|
|
31
|
-
return value.replace(/(\d*\.?\d+)px/g, (_, num) => {
|
|
32
|
-
return `${parseFloat(num) * 2}rpx`;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function pxToRem(value) {
|
|
36
|
-
if (typeof value === "number") {
|
|
37
|
-
return `${value / 16}rem`;
|
|
38
|
-
}
|
|
39
|
-
if (typeof value !== "string")
|
|
40
|
-
return String(value);
|
|
41
|
-
return value.replace(/(\d*\.?\d+)px/g, (_, num) => {
|
|
42
|
-
return `${parseFloat(num) / 16}rem`;
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
function isPxValue(value) {
|
|
46
|
-
if (typeof value === "number") {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
if (typeof value === "string") {
|
|
50
|
-
return /\d*\.?\d+px/.test(value);
|
|
51
|
-
}
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
function pxtransform(value, target = "rpx") {
|
|
55
|
-
if (!isPxValue(value)) {
|
|
56
|
-
return value;
|
|
57
|
-
}
|
|
58
|
-
if (target === "rem") {
|
|
59
|
-
return pxToRem(value);
|
|
60
|
-
}
|
|
61
|
-
return pxToRpx(value);
|
|
62
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface Style {
|
|
2
|
-
layout?: "smart" | "flex-column" | "flex-row" | {
|
|
3
|
-
display?: string;
|
|
4
|
-
position?: string;
|
|
5
|
-
flexDirection?: string;
|
|
6
|
-
alignItems?: string;
|
|
7
|
-
justifyContent?: string;
|
|
8
|
-
flexWrap?: string;
|
|
9
|
-
rowGap?: number;
|
|
10
|
-
columnGap?: number;
|
|
11
|
-
};
|
|
12
|
-
width?: string | number;
|
|
13
|
-
height?: string | number;
|
|
14
|
-
styleAry?: Array<{
|
|
15
|
-
selector: string;
|
|
16
|
-
css: Record<string, any>;
|
|
17
|
-
}>;
|
|
18
|
-
slots?: Record<string, {
|
|
19
|
-
layout?: string | object;
|
|
20
|
-
[key: string]: any;
|
|
21
|
-
}>;
|
|
22
|
-
[key: string]: any;
|
|
23
|
-
}
|
|
@@ -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/style/types.ts
|
|
16
|
-
var types_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(types_exports);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** 生成组件 Inputs 映射代码 */
|
|
2
|
-
export declare const genComponentInputsCode: (indent: string, providerName: string, comId: string) => string;
|
|
3
|
-
/** 生成组件 Outputs 映射代码 */
|
|
4
|
-
export declare const genComponentOutputsCode: (indent: string, comId: string, comEventCode: string) => string;
|
|
5
|
-
/** 包装单个事件处理函数,注入 getConnections */
|
|
6
|
-
export declare const wrapEventProcess: (indent: string, eventId: string, defaultValue: string, process: string) => string;
|
|
7
|
-
/** 生成插槽渲染函数引用(使用 renderManager) */
|
|
8
|
-
export declare const genSlotRenderRef: ({ slotId, renderId, indent, isLast }: {
|
|
9
|
-
slotId: string;
|
|
10
|
-
renderId: string;
|
|
11
|
-
indent: string;
|
|
12
|
-
isLast: boolean;
|
|
13
|
-
}) => string;
|
|
14
|
-
/** 格式化插槽内容为 render 函数体代码 */
|
|
15
|
-
export declare const formatSlotContent: ({ uiContent, baseIndentSize, renderBodyIndent }: {
|
|
16
|
-
uiContent: string;
|
|
17
|
-
baseIndentSize: number;
|
|
18
|
-
renderBodyIndent: string;
|
|
19
|
-
}) => string;
|
|
@@ -1,86 +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/templates/component.ts
|
|
20
|
-
var component_exports = {};
|
|
21
|
-
__export(component_exports, {
|
|
22
|
-
formatSlotContent: () => formatSlotContent,
|
|
23
|
-
genComponentInputsCode: () => genComponentInputsCode,
|
|
24
|
-
genComponentOutputsCode: () => genComponentOutputsCode,
|
|
25
|
-
genSlotRenderRef: () => genSlotRenderRef,
|
|
26
|
-
wrapEventProcess: () => wrapEventProcess
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(component_exports);
|
|
29
|
-
var import_index = require("./index");
|
|
30
|
-
var genComponentInputsCode = (indent, providerName, comId) => {
|
|
31
|
-
return `${indent}inputs['${comId}'] = useBindInputs(controllers.current.${providerName}, '${comId}');
|
|
32
|
-
`;
|
|
33
|
-
};
|
|
34
|
-
var genComponentOutputsCode = (indent, comId, comEventCode) => {
|
|
35
|
-
if (!comEventCode)
|
|
36
|
-
return "";
|
|
37
|
-
return `${indent}outputs['${comId}'] = {
|
|
38
|
-
${comEventCode}${indent}};
|
|
39
|
-
`;
|
|
40
|
-
};
|
|
41
|
-
var wrapEventProcess = (indent, eventId, defaultValue, process) => {
|
|
42
|
-
return `${indent}${eventId}: Object.assign((${defaultValue}: any) => {
|
|
43
|
-
${process}
|
|
44
|
-
${indent}}, { getConnections: () => [1] }),
|
|
45
|
-
`;
|
|
46
|
-
};
|
|
47
|
-
var genSlotRenderRef = ({
|
|
48
|
-
slotId,
|
|
49
|
-
renderId,
|
|
50
|
-
indent,
|
|
51
|
-
isLast
|
|
52
|
-
}) => {
|
|
53
|
-
const renderFunctionName = (0, import_index.toSlotFunctionName)(renderId);
|
|
54
|
-
return `${indent}${slotId}: {
|
|
55
|
-
${indent} render: ${renderFunctionName},
|
|
56
|
-
${indent}}${isLast ? "" : ","}
|
|
57
|
-
`;
|
|
58
|
-
};
|
|
59
|
-
var formatSlotContent = ({
|
|
60
|
-
uiContent,
|
|
61
|
-
baseIndentSize,
|
|
62
|
-
renderBodyIndent
|
|
63
|
-
}) => {
|
|
64
|
-
const lines = uiContent.split("\n");
|
|
65
|
-
const formattedLines = [];
|
|
66
|
-
lines.forEach((line) => {
|
|
67
|
-
const trimmedLine = line.trim();
|
|
68
|
-
if (!trimmedLine) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
const originalIndentMatch = line.match(/^(\s*)/);
|
|
72
|
-
const originalIndent = originalIndentMatch ? originalIndentMatch[1].length : 0;
|
|
73
|
-
const relativeIndentLevel = Math.floor(originalIndent / baseIndentSize);
|
|
74
|
-
const newIndent = renderBodyIndent + (0, import_index.indentation)(baseIndentSize * relativeIndentLevel);
|
|
75
|
-
formattedLines.push(newIndent + trimmedLine);
|
|
76
|
-
});
|
|
77
|
-
return formattedLines.join("\n");
|
|
78
|
-
};
|
|
79
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
-
0 && (module.exports = {
|
|
81
|
-
formatSlotContent,
|
|
82
|
-
genComponentInputsCode,
|
|
83
|
-
genComponentOutputsCode,
|
|
84
|
-
genSlotRenderRef,
|
|
85
|
-
wrapEventProcess
|
|
86
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { indentation } from "../index";
|
|
2
|
-
export { indentation };
|
|
3
|
-
/** 将第一个字符转大写 */
|
|
4
|
-
export declare const firstCharToUpperCase: (str: string) => string;
|
|
5
|
-
/** 格式化插槽内容缩进 */
|
|
6
|
-
export declare const formatSlotContent: (uiContent: string, baseIndentSize: number, renderBodyIndent: string) => string;
|
|
7
|
-
/** 将字符串转为大驼峰 */
|
|
8
|
-
export declare const toPascalCase: (str: string) => string;
|
|
9
|
-
/** 生成插槽渲染函数名:S${ID} (SCREAMING_SNAKE_CASE) */
|
|
10
|
-
export declare const toSlotFunctionName: (renderId: string) => string;
|
|
11
|
-
/** Taro/React UI 组件代码生成 */
|
|
12
|
-
export declare const getUiComponentCode: (params: {
|
|
13
|
-
componentName: string;
|
|
14
|
-
meta: any;
|
|
15
|
-
props: any;
|
|
16
|
-
resultStyle: Record<string, Record<string, string | number>>;
|
|
17
|
-
/** 可选:自定义 data 的表达式代码(用于插槽动态入参等场景) */
|
|
18
|
-
dataCode?: string;
|
|
19
|
-
componentInputs?: string[];
|
|
20
|
-
componentOutputs?: string[];
|
|
21
|
-
comEventCode?: string;
|
|
22
|
-
slotsCode?: string;
|
|
23
|
-
childrenUi?: string;
|
|
24
|
-
eventHandlers?: Record<string, string>;
|
|
25
|
-
}, config: {
|
|
26
|
-
codeStyle: {
|
|
27
|
-
indent: number;
|
|
28
|
-
};
|
|
29
|
-
depth: number;
|
|
30
|
-
verbose?: boolean;
|
|
31
|
-
checkIsRoot: () => boolean;
|
|
32
|
-
}) => string;
|
|
@@ -1,116 +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/templates/index.ts
|
|
20
|
-
var templates_exports = {};
|
|
21
|
-
__export(templates_exports, {
|
|
22
|
-
firstCharToUpperCase: () => firstCharToUpperCase,
|
|
23
|
-
formatSlotContent: () => formatSlotContent,
|
|
24
|
-
getUiComponentCode: () => getUiComponentCode,
|
|
25
|
-
indentation: () => import__.indentation,
|
|
26
|
-
toPascalCase: () => toPascalCase,
|
|
27
|
-
toSlotFunctionName: () => toSlotFunctionName
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(templates_exports);
|
|
30
|
-
var import__ = require("../index");
|
|
31
|
-
var firstCharToUpperCase = (str) => {
|
|
32
|
-
if (!str)
|
|
33
|
-
return str;
|
|
34
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
35
|
-
};
|
|
36
|
-
var formatSlotContent = (uiContent, baseIndentSize, renderBodyIndent) => {
|
|
37
|
-
return uiContent.split("\n").map((line) => `${renderBodyIndent}${line}`).join("\n");
|
|
38
|
-
};
|
|
39
|
-
var toPascalCase = (str) => {
|
|
40
|
-
return str.split(/[_-]/).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
|
|
41
|
-
};
|
|
42
|
-
var toSlotFunctionName = (renderId) => {
|
|
43
|
-
return `S${renderId.replace(/[^a-zA-Z0-9]/g, "_").toUpperCase()}`;
|
|
44
|
-
};
|
|
45
|
-
var formatData = (data, isRoot) => {
|
|
46
|
-
if (!data)
|
|
47
|
-
return {};
|
|
48
|
-
if (!isRoot)
|
|
49
|
-
return data;
|
|
50
|
-
const delKeys = ["tabBar", "navigationStyle", "navigationBarBackgroundColor", "navigationBarTextStyle", "navigationBarTitleText", "backgroundColorTop", "backgroundColorBottom"];
|
|
51
|
-
return Object.fromEntries(Object.entries(data).filter(([key]) => !delKeys.includes(key)));
|
|
52
|
-
};
|
|
53
|
-
var getUiComponentCode = (params, config) => {
|
|
54
|
-
const {
|
|
55
|
-
componentName,
|
|
56
|
-
meta,
|
|
57
|
-
props,
|
|
58
|
-
resultStyle,
|
|
59
|
-
dataCode,
|
|
60
|
-
slotsCode,
|
|
61
|
-
childrenUi,
|
|
62
|
-
eventHandlers = {}
|
|
63
|
-
} = params;
|
|
64
|
-
const isRoot = config.checkIsRoot();
|
|
65
|
-
const indent = (0, import__.indentation)(config.codeStyle.indent * config.depth);
|
|
66
|
-
const indent2 = (0, import__.indentation)(config.codeStyle.indent * (config.depth + 1));
|
|
67
|
-
let ui = `${indent}<WithCom`;
|
|
68
|
-
ui += `
|
|
69
|
-
${indent2}component={${componentName}}`;
|
|
70
|
-
ui += `
|
|
71
|
-
${indent2}id='${meta.id}'`;
|
|
72
|
-
ui += `
|
|
73
|
-
${indent2}className='mybricks_com ${meta.id}'`;
|
|
74
|
-
if (meta.name) {
|
|
75
|
-
ui += `
|
|
76
|
-
${indent2}name='${meta.name}'`;
|
|
77
|
-
}
|
|
78
|
-
if (resultStyle.root && Object.keys(resultStyle.root).length > 0) {
|
|
79
|
-
const styleCode = JSON.stringify(resultStyle.root);
|
|
80
|
-
ui += `
|
|
81
|
-
${indent2}style={${styleCode}}`;
|
|
82
|
-
}
|
|
83
|
-
const initialDataCode = dataCode ?? JSON.stringify(formatData(props.data, isRoot));
|
|
84
|
-
ui += `
|
|
85
|
-
${indent2}data={${initialDataCode}}`;
|
|
86
|
-
Object.entries(eventHandlers).forEach(([eventName, handlerCode]) => {
|
|
87
|
-
ui += `
|
|
88
|
-
${indent2}${eventName}={${handlerCode}}`;
|
|
89
|
-
});
|
|
90
|
-
if (slotsCode) {
|
|
91
|
-
ui += `
|
|
92
|
-
${indent2}slots={{
|
|
93
|
-
${slotsCode}${indent2}}}`;
|
|
94
|
-
}
|
|
95
|
-
if (childrenUi) {
|
|
96
|
-
ui += `
|
|
97
|
-
${indent}>`;
|
|
98
|
-
ui += `
|
|
99
|
-
${childrenUi}`;
|
|
100
|
-
ui += `
|
|
101
|
-
${indent}</WithCom>`;
|
|
102
|
-
} else {
|
|
103
|
-
ui += `
|
|
104
|
-
${indent}/>`;
|
|
105
|
-
}
|
|
106
|
-
return ui;
|
|
107
|
-
};
|
|
108
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
109
|
-
0 && (module.exports = {
|
|
110
|
-
firstCharToUpperCase,
|
|
111
|
-
formatSlotContent,
|
|
112
|
-
getUiComponentCode,
|
|
113
|
-
indentation,
|
|
114
|
-
toPascalCase,
|
|
115
|
-
toSlotFunctionName
|
|
116
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** Render 函数管理器 */
|
|
2
|
-
export declare class RenderManager {
|
|
3
|
-
/** 存储格式:renderId -> { renderCode, children?, logicCode?, slotType?, useWrap?, description? } */
|
|
4
|
-
private _renders;
|
|
5
|
-
/**
|
|
6
|
-
* 注册一个 render 函数
|
|
7
|
-
*/
|
|
8
|
-
register(renderId: string, renderCode: string, children?: any[], logicCode?: string, slotType?: string, useWrap?: boolean, description?: string): void;
|
|
9
|
-
/**
|
|
10
|
-
* 生成所有 render 函数的 definition 代码
|
|
11
|
-
*/
|
|
12
|
-
toCode(indent: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* 转义字符串并创建能够匹配任意空白符的正则
|
|
15
|
-
*/
|
|
16
|
-
private createFlexibleRegex;
|
|
17
|
-
genRenderRef(slotId: string, renderId: string, indent: string): string;
|
|
18
|
-
}
|