@mybricks/to-code-taro 1.0.6 → 1.0.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/dist/cjs/core/utils/ComContext.js +11 -2
- package/dist/cjs/core/utils/hooks.js +13 -4
- package/dist/cjs/core/utils/index.js +9 -2
- package/dist/cjs/core/utils/slots.js +124 -0
- package/dist/cjs/core/utils/useContext.js +10 -6
- package/dist/cjs/core/utils/with.js +32 -5
- package/dist/cjs/generate/generateTaroProjectJson.js +2 -2
- package/dist/cjs/handleCom.d.ts +7 -30
- package/dist/cjs/handleCom.js +171 -61
- package/dist/cjs/handleSlot.d.ts +3 -0
- package/dist/cjs/handleSlot.js +27 -10
- package/dist/cjs/processors/processScene.js +34 -1
- package/dist/cjs/processors/processSceneLogic.js +1 -1
- package/dist/cjs/taro-template.json +17 -13
- package/dist/cjs/toCodeTaro.d.ts +2 -0
- package/dist/cjs/utils/logic/handleProcess.js +8 -13
- package/dist/cjs/utils/logic/processChildren.d.ts +1 -0
- package/dist/cjs/utils/logic/processChildren.js +16 -1
- package/dist/cjs/utils/style/converter.js +43 -15
- package/dist/cjs/utils/style/pxtransform.d.ts +2 -26
- package/dist/cjs/utils/style/pxtransform.js +27 -67
- package/dist/cjs/utils/templates/component.js +4 -3
- package/dist/cjs/utils/templates/index.d.ts +10 -0
- package/dist/cjs/utils/templates/index.js +31 -7
- package/dist/cjs/utils/templates/renderManager.d.ts +3 -11
- package/dist/cjs/utils/templates/renderManager.js +86 -21
- package/dist/cjs/utils/templates/scene.d.ts +2 -1
- package/dist/cjs/utils/templates/scene.js +4 -1
- package/dist/esm/core/utils/ComContext.js +5 -0
- package/dist/esm/core/utils/hooks.js +14 -5
- package/dist/esm/core/utils/index.js +4 -2
- package/dist/esm/core/utils/slots.js +108 -0
- package/dist/esm/core/utils/useContext.js +21 -11
- package/dist/esm/core/utils/with.js +50 -7
- package/dist/esm/generate/generateTaroProjectJson.js +2 -2
- package/dist/esm/handleCom.d.ts +7 -30
- package/dist/esm/handleCom.js +224 -81
- package/dist/esm/handleSlot.d.ts +3 -0
- package/dist/esm/handleSlot.js +34 -11
- package/dist/esm/processors/processScene.js +36 -1
- package/dist/esm/processors/processSceneLogic.js +3 -1
- package/dist/esm/taro-template.json +17 -13
- package/dist/esm/toCodeTaro.d.ts +2 -0
- package/dist/esm/utils/logic/handleProcess.js +12 -16
- package/dist/esm/utils/logic/processChildren.d.ts +1 -0
- package/dist/esm/utils/logic/processChildren.js +17 -1
- package/dist/esm/utils/style/converter.js +66 -31
- package/dist/esm/utils/style/pxtransform.d.ts +2 -26
- package/dist/esm/utils/style/pxtransform.js +31 -98
- package/dist/esm/utils/templates/component.js +3 -2
- package/dist/esm/utils/templates/index.d.ts +10 -0
- package/dist/esm/utils/templates/index.js +33 -9
- package/dist/esm/utils/templates/renderManager.d.ts +3 -11
- package/dist/esm/utils/templates/renderManager.js +92 -23
- package/dist/esm/utils/templates/scene.d.ts +2 -1
- package/dist/esm/utils/templates/scene.js +4 -2
- package/package.json +1 -1
|
@@ -19,14 +19,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/core/utils/ComContext.tsx
|
|
20
20
|
var ComContext_exports = {};
|
|
21
21
|
__export(ComContext_exports, {
|
|
22
|
+
SlotProvider: () => SlotProvider,
|
|
22
23
|
default: () => ComContext_default,
|
|
23
24
|
pageRouter: () => import_pageRouter.pageRouter,
|
|
24
|
-
useAppContext: () => useAppContext
|
|
25
|
+
useAppContext: () => useAppContext,
|
|
26
|
+
useParentSlot: () => useParentSlot
|
|
25
27
|
});
|
|
26
28
|
module.exports = __toCommonJS(ComContext_exports);
|
|
27
29
|
var import_react = require("react");
|
|
28
30
|
var import_pageRouter = require("./pageRouter");
|
|
29
31
|
var ComContext = (0, import_react.createContext)(void 0);
|
|
32
|
+
var SlotContext = (0, import_react.createContext)(null);
|
|
30
33
|
function useAppContext() {
|
|
31
34
|
const context = (0, import_react.useContext)(ComContext);
|
|
32
35
|
if (!context) {
|
|
@@ -34,9 +37,15 @@ function useAppContext() {
|
|
|
34
37
|
}
|
|
35
38
|
return context;
|
|
36
39
|
}
|
|
40
|
+
function useParentSlot() {
|
|
41
|
+
return (0, import_react.useContext)(SlotContext);
|
|
42
|
+
}
|
|
43
|
+
var SlotProvider = SlotContext.Provider;
|
|
37
44
|
var ComContext_default = ComContext;
|
|
38
45
|
// Annotate the CommonJS export names for ESM import in node:
|
|
39
46
|
0 && (module.exports = {
|
|
47
|
+
SlotProvider,
|
|
40
48
|
pageRouter,
|
|
41
|
-
useAppContext
|
|
49
|
+
useAppContext,
|
|
50
|
+
useParentSlot
|
|
42
51
|
});
|
|
@@ -87,17 +87,26 @@ function useBindInputs(scope, id, initialHandlers) {
|
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
|
-
scope
|
|
90
|
+
if (scope && scope.current) {
|
|
91
|
+
scope.current[id] = proxy;
|
|
92
|
+
}
|
|
91
93
|
return proxy;
|
|
92
94
|
}, [scope, id]);
|
|
93
95
|
}
|
|
94
|
-
function useBindEvents(props) {
|
|
96
|
+
function useBindEvents(props, context) {
|
|
95
97
|
return (0, import_react.useMemo)(() => {
|
|
96
98
|
const _events = {};
|
|
97
99
|
Object.keys(props).forEach((key) => {
|
|
98
100
|
if (key.startsWith("on") && typeof props[key] === "function") {
|
|
99
101
|
const handler = props[key];
|
|
100
|
-
const wrapped = (
|
|
102
|
+
const wrapped = (originalValue) => {
|
|
103
|
+
const value = context ? {
|
|
104
|
+
id: context.id,
|
|
105
|
+
name: context.name,
|
|
106
|
+
value: originalValue
|
|
107
|
+
} : originalValue;
|
|
108
|
+
return handler(value);
|
|
109
|
+
};
|
|
101
110
|
wrapped.getConnections = () => [{ id: "default" }];
|
|
102
111
|
_events[key] = wrapped;
|
|
103
112
|
}
|
|
@@ -116,7 +125,7 @@ function useBindEvents(props) {
|
|
|
116
125
|
return target[key];
|
|
117
126
|
}
|
|
118
127
|
});
|
|
119
|
-
}, [props]);
|
|
128
|
+
}, [props, context]);
|
|
120
129
|
}
|
|
121
130
|
// Annotate the CommonJS export names for ESM import in node:
|
|
122
131
|
0 && (module.exports = {
|
|
@@ -23,6 +23,7 @@ __export(utils_exports, {
|
|
|
23
23
|
PopupRenderer: () => import_PopupRenderer.PopupRenderer,
|
|
24
24
|
SUBJECT_SUBSCRIBE: () => import_constant.SUBJECT_SUBSCRIBE,
|
|
25
25
|
SUBJECT_VALUE: () => import_constant.SUBJECT_VALUE,
|
|
26
|
+
SlotProvider: () => import_ComContext.SlotProvider,
|
|
26
27
|
WithCom: () => import_with.WithCom,
|
|
27
28
|
WithWrapper: () => import_with.WithWrapper,
|
|
28
29
|
closeActivePopupRouter: () => import_popupRouter.closeActivePopupRouter,
|
|
@@ -33,7 +34,8 @@ __export(utils_exports, {
|
|
|
33
34
|
popupRouter: () => import_popupRouter.popupRouter,
|
|
34
35
|
router: () => import_pageRouter.router,
|
|
35
36
|
subscribePopupRouter: () => import_popupRouter.subscribePopupRouter,
|
|
36
|
-
useAppContext: () => import_ComContext.useAppContext
|
|
37
|
+
useAppContext: () => import_ComContext.useAppContext,
|
|
38
|
+
useAppCreateContext: () => import_useContext.useAppCreateContext
|
|
37
39
|
});
|
|
38
40
|
module.exports = __toCommonJS(utils_exports);
|
|
39
41
|
__reExport(utils_exports, require("./hooks"), module.exports);
|
|
@@ -42,13 +44,16 @@ var import_PopupRenderer = require("./PopupRenderer");
|
|
|
42
44
|
var import_pageRouter = require("./pageRouter");
|
|
43
45
|
var import_popupRouter = require("./popupRouter");
|
|
44
46
|
var import_ComContext = require("./ComContext");
|
|
47
|
+
var import_useContext = require("./useContext");
|
|
45
48
|
var import_mybricks = require("../mybricks");
|
|
46
49
|
var import_constant = require("../mybricks/constant");
|
|
50
|
+
__reExport(utils_exports, require("./slots"), module.exports);
|
|
47
51
|
// Annotate the CommonJS export names for ESM import in node:
|
|
48
52
|
0 && (module.exports = {
|
|
49
53
|
PopupRenderer,
|
|
50
54
|
SUBJECT_SUBSCRIBE,
|
|
51
55
|
SUBJECT_VALUE,
|
|
56
|
+
SlotProvider,
|
|
52
57
|
WithCom,
|
|
53
58
|
WithWrapper,
|
|
54
59
|
closeActivePopupRouter,
|
|
@@ -60,5 +65,7 @@ var import_constant = require("../mybricks/constant");
|
|
|
60
65
|
router,
|
|
61
66
|
subscribePopupRouter,
|
|
62
67
|
useAppContext,
|
|
63
|
-
|
|
68
|
+
useAppCreateContext,
|
|
69
|
+
...require("./hooks"),
|
|
70
|
+
...require("./slots")
|
|
64
71
|
});
|
|
@@ -0,0 +1,124 @@
|
|
|
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/core/utils/slots.tsx
|
|
30
|
+
var slots_exports = {};
|
|
31
|
+
__export(slots_exports, {
|
|
32
|
+
ScopedComContextProvider: () => ScopedComContextProvider,
|
|
33
|
+
useEnhancedSlots: () => useEnhancedSlots,
|
|
34
|
+
useResolvedParentSlot: () => useResolvedParentSlot
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(slots_exports);
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_ComContext = __toESM(require("./ComContext"));
|
|
39
|
+
var import_createReactiveInputHandler = require("../mybricks/createReactiveInputHandler");
|
|
40
|
+
function createChannelProxy(title) {
|
|
41
|
+
const handlersMap = {};
|
|
42
|
+
return new Proxy(
|
|
43
|
+
{},
|
|
44
|
+
{
|
|
45
|
+
get: (_t, pin) => {
|
|
46
|
+
return (arg) => {
|
|
47
|
+
if (typeof arg === "function") {
|
|
48
|
+
handlersMap[pin] = arg;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const handler = handlersMap[pin];
|
|
52
|
+
if (typeof handler === "function") {
|
|
53
|
+
return (0, import_createReactiveInputHandler.createReactiveInputHandler)({
|
|
54
|
+
input: handler,
|
|
55
|
+
value: arg,
|
|
56
|
+
rels: {},
|
|
57
|
+
title
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
function useEnhancedSlots(rawSlots, id) {
|
|
66
|
+
const slotStoreRef = (0, import_react.useRef)({});
|
|
67
|
+
return (0, import_react.useMemo)(() => {
|
|
68
|
+
if (!rawSlots)
|
|
69
|
+
return {};
|
|
70
|
+
const nextSlots = {};
|
|
71
|
+
Object.entries(rawSlots).forEach(([slotKey, slotDef]) => {
|
|
72
|
+
const state = slotStoreRef.current[slotKey] || (slotStoreRef.current[slotKey] = {
|
|
73
|
+
inputs: createChannelProxy(`${id}.${slotKey}.inputs`),
|
|
74
|
+
outputs: createChannelProxy(`${id}.${slotKey}.outputs`),
|
|
75
|
+
_inputs: createChannelProxy(`${id}.${slotKey}._inputs`),
|
|
76
|
+
_scopedComRefs: {},
|
|
77
|
+
_render: void 0,
|
|
78
|
+
render: (params) => {
|
|
79
|
+
var _a, _b, _c, _d;
|
|
80
|
+
const r = state._render;
|
|
81
|
+
const rawScope = (params == null ? void 0 : params.key) ?? ((_a = params == null ? void 0 : params.inputValues) == null ? void 0 : _a.index) ?? ((_c = (_b = params == null ? void 0 : params.inputValues) == null ? void 0 : _b.itemData) == null ? void 0 : _c.id);
|
|
82
|
+
const SlotComp = r;
|
|
83
|
+
const content = r ? /* @__PURE__ */ import_react.default.createElement(SlotComp, { ...params || {} }) : null;
|
|
84
|
+
if (rawScope === void 0 || rawScope === null) {
|
|
85
|
+
return /* @__PURE__ */ import_react.default.createElement(import_ComContext.SlotProvider, { value: { ...state, params } }, content);
|
|
86
|
+
}
|
|
87
|
+
const scopeId = `${id}.${slotKey}::${String(rawScope)}`;
|
|
88
|
+
const scopedComRefs = (_d = state._scopedComRefs)[scopeId] || (_d[scopeId] = { current: { $inputs: {} } });
|
|
89
|
+
return /* @__PURE__ */ import_react.default.createElement(import_ComContext.SlotProvider, { value: { ...state, params } }, /* @__PURE__ */ import_react.default.createElement(ScopedComContextProvider, { comRefs: scopedComRefs, scopeId }, content));
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
state._render = slotDef == null ? void 0 : slotDef.render;
|
|
93
|
+
nextSlots[slotKey] = {
|
|
94
|
+
...slotDef || {},
|
|
95
|
+
render: state.render,
|
|
96
|
+
inputs: state.inputs,
|
|
97
|
+
outputs: state.outputs,
|
|
98
|
+
_inputs: state._inputs
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
return nextSlots;
|
|
102
|
+
}, [rawSlots, id]);
|
|
103
|
+
}
|
|
104
|
+
function ScopedComContextProvider(props) {
|
|
105
|
+
const parent = (0, import_ComContext.useAppContext)();
|
|
106
|
+
const value = (0, import_react.useMemo)(() => {
|
|
107
|
+
return {
|
|
108
|
+
...parent,
|
|
109
|
+
comRefs: props.comRefs || parent.comRefs,
|
|
110
|
+
$scopeId: props.scopeId
|
|
111
|
+
};
|
|
112
|
+
}, [parent, props.comRefs, props.scopeId]);
|
|
113
|
+
return /* @__PURE__ */ import_react.default.createElement(import_ComContext.default.Provider, { value }, props.children);
|
|
114
|
+
}
|
|
115
|
+
function useResolvedParentSlot(parentSlotProp) {
|
|
116
|
+
const parentSlotFromCtx = (0, import_ComContext.useParentSlot)();
|
|
117
|
+
return parentSlotProp ?? parentSlotFromCtx;
|
|
118
|
+
}
|
|
119
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
120
|
+
0 && (module.exports = {
|
|
121
|
+
ScopedComContextProvider,
|
|
122
|
+
useEnhancedSlots,
|
|
123
|
+
useResolvedParentSlot
|
|
124
|
+
});
|
|
@@ -25,14 +25,15 @@ module.exports = __toCommonJS(useContext_exports);
|
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
var import_hooks = require("./hooks");
|
|
27
27
|
function useAppCreateContext() {
|
|
28
|
-
const comRefs = (0, import_react.useRef)((0, import_hooks.deepProxy)({}));
|
|
28
|
+
const comRefs = (0, import_react.useRef)((0, import_hooks.deepProxy)({ $inputs: {} }));
|
|
29
|
+
const outputs = (0, import_react.useRef)((0, import_hooks.deepProxy)({}));
|
|
29
30
|
const [popupState, setPopupState] = (0, import_react.useState)({
|
|
30
31
|
visible: false,
|
|
31
32
|
name: "",
|
|
32
33
|
value: null,
|
|
33
34
|
controller: null
|
|
34
35
|
});
|
|
35
|
-
const appContext = {
|
|
36
|
+
const appContext = (0, import_react.useRef)({
|
|
36
37
|
canvas: {
|
|
37
38
|
id: "u_7VvVn"
|
|
38
39
|
// 使用 data 中的 id
|
|
@@ -47,14 +48,17 @@ function useAppCreateContext() {
|
|
|
47
48
|
isRelease: false,
|
|
48
49
|
isDebug: false,
|
|
49
50
|
isLocal: false,
|
|
50
|
-
isTest: false
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
isTest: false,
|
|
52
|
+
tabBar: [],
|
|
53
|
+
useTabBar: false
|
|
54
|
+
}).current;
|
|
55
|
+
return (0, import_react.useMemo)(() => ({
|
|
53
56
|
comRefs,
|
|
57
|
+
outputs,
|
|
54
58
|
appContext,
|
|
55
59
|
popupState,
|
|
56
60
|
setPopupState
|
|
57
|
-
};
|
|
61
|
+
}), [popupState]);
|
|
58
62
|
}
|
|
59
63
|
// Annotate the CommonJS export names for ESM import in node:
|
|
60
64
|
0 && (module.exports = {
|
|
@@ -38,9 +38,11 @@ var import_components = require("@tarojs/components");
|
|
|
38
38
|
var import_index = require("./index");
|
|
39
39
|
var import_useContext = require("./useContext");
|
|
40
40
|
var import_ComContext = __toESM(require("./ComContext"));
|
|
41
|
+
var import_slots = require("./slots");
|
|
41
42
|
var import_taro = require("@tarojs/taro");
|
|
42
43
|
var WithCom = (props) => {
|
|
43
|
-
|
|
44
|
+
var _a;
|
|
45
|
+
const { component: Component, id = "", data, className, style, inputValues, inputValuesMapping, ...rest } = props;
|
|
44
46
|
const { comRefs, appContext } = (0, import_ComContext.useAppContext)();
|
|
45
47
|
const env = appContext;
|
|
46
48
|
const isPopup = Component.isPopup;
|
|
@@ -70,20 +72,45 @@ var WithCom = (props) => {
|
|
|
70
72
|
});
|
|
71
73
|
}
|
|
72
74
|
const inputProxy = (0, import_index.useBindInputs)(comRefs, id, handlers);
|
|
73
|
-
const
|
|
75
|
+
const { slots: rawSlots, parentSlot: parentSlotProp, ...restProps } = rest;
|
|
76
|
+
const { outputs: globalOutputs } = (0, import_ComContext.useAppContext)();
|
|
77
|
+
const parentSlot = (0, import_slots.useResolvedParentSlot)(parentSlotProp);
|
|
78
|
+
const eventProxy = (0, import_index.useBindEvents)(restProps, {
|
|
79
|
+
id,
|
|
80
|
+
name: props.name || id,
|
|
81
|
+
parentSlot
|
|
82
|
+
});
|
|
83
|
+
if (globalOutputs && globalOutputs.current) {
|
|
84
|
+
globalOutputs.current[id] = eventProxy;
|
|
85
|
+
}
|
|
74
86
|
comRefs.current[id] = inputProxy;
|
|
75
|
-
|
|
87
|
+
const enhancedSlots = (0, import_slots.useEnhancedSlots)(rawSlots, id);
|
|
88
|
+
const jsx = /* @__PURE__ */ import_react.default.createElement(
|
|
76
89
|
Component,
|
|
77
90
|
{
|
|
78
|
-
...
|
|
91
|
+
...restProps,
|
|
79
92
|
inputs: inputProxy,
|
|
80
93
|
outputs: eventProxy,
|
|
94
|
+
slots: enhancedSlots,
|
|
95
|
+
parentSlot,
|
|
81
96
|
data: _data,
|
|
82
97
|
env,
|
|
83
98
|
id,
|
|
84
99
|
style
|
|
85
100
|
}
|
|
86
|
-
)
|
|
101
|
+
);
|
|
102
|
+
if ((_a = parentSlot == null ? void 0 : parentSlot.params) == null ? void 0 : _a.itemWrap) {
|
|
103
|
+
return parentSlot.params.itemWrap({
|
|
104
|
+
id,
|
|
105
|
+
name: props.name || id,
|
|
106
|
+
jsx,
|
|
107
|
+
def: Component.def,
|
|
108
|
+
inputs: inputProxy,
|
|
109
|
+
outputs: eventProxy,
|
|
110
|
+
style
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return show || isPopup ? /* @__PURE__ */ import_react.default.createElement(import_components.View, { className, style: { ...style, ...dynamicStyle } }, jsx) : null;
|
|
87
114
|
};
|
|
88
115
|
var WithWrapper = (Component) => {
|
|
89
116
|
return function WrappedComponent(props) {
|
|
@@ -76,7 +76,7 @@ ${fileContent}` : fileContent;
|
|
|
76
76
|
content: configContent
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
|
-
path: `src/pages/${pageName}/index.less`,
|
|
79
|
+
path: `src/pages/${pageName}/index.global.less`,
|
|
80
80
|
content: item.cssContent || ""
|
|
81
81
|
},
|
|
82
82
|
{
|
|
@@ -108,7 +108,7 @@ ${item.content || ""}`;
|
|
|
108
108
|
content: fullContent
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
|
-
path: `src/popupComponents/${popupId}/index.less`,
|
|
111
|
+
path: `src/popupComponents/${popupId}/index.global.less`,
|
|
112
112
|
content: item.cssContent || ""
|
|
113
113
|
}
|
|
114
114
|
]
|
package/dist/cjs/handleCom.d.ts
CHANGED
|
@@ -1,31 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
ui: string;
|
|
9
|
-
js: string;
|
|
10
|
-
slots: string[];
|
|
11
|
-
scopeSlots: string[];
|
|
12
|
-
cssContent: string;
|
|
13
|
-
renderCode?: string;
|
|
14
|
-
outputsConfig?: Record<string, any>;
|
|
15
|
-
};
|
|
16
|
-
export interface HandleComConfig extends BaseConfig {
|
|
17
|
-
addParentDependencyImport: (typeof ImportManager)["prototype"]["addImport"];
|
|
18
|
-
addConsumer: (provider: ReturnType<BaseConfig["getCurrentProvider"]>) => void;
|
|
19
|
-
addComId: (comId: string) => void;
|
|
20
|
-
renderManager?: RenderManager;
|
|
21
|
-
addJSModule?: (module: {
|
|
22
|
-
id: string;
|
|
23
|
-
title: string;
|
|
24
|
-
transformCode: string;
|
|
25
|
-
inputs: string[];
|
|
26
|
-
outputs: string[];
|
|
27
|
-
data: any;
|
|
28
|
-
}) => void;
|
|
29
|
-
}
|
|
30
|
-
declare const handleCom: (com: Com, config: HandleComConfig) => HandleComResult;
|
|
1
|
+
export type Com = any;
|
|
2
|
+
export type HandleComConfig = any;
|
|
3
|
+
export type HandleComResult = any;
|
|
4
|
+
/**
|
|
5
|
+
* 处理组件
|
|
6
|
+
*/
|
|
7
|
+
export declare const handleCom: (com: Com, config: HandleComConfig) => HandleComResult;
|
|
31
8
|
export default handleCom;
|