@cloudbase/framework-plugin-low-code 0.7.35 → 0.7.36
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/lib/config/private.d.ts +3 -0
- package/lib/config/private.d.ts.map +1 -0
- package/lib/config/private.js +14 -0
- package/lib/weapps-core/utils/file.d.ts +1 -1
- package/package.json +3 -3
- package/template/mp/common/util.js +0 -1
- package/template/src/handlers/FieldMiddleware/renderer.jsx +34 -39
- package/template/src/handlers/utils/common.js +1 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const PRIVATE_JS_NAME = "weda-private.js";
|
|
2
|
+
export declare const PRIVATE_JS_CODE = "\n /**\n * An empty js file. It will be overridden in private place.\n *\n * For example:\n * ```javascript\n * window._isPrivate = true\n * ```\n */\n ";
|
|
3
|
+
//# sourceMappingURL=private.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"private.d.ts","sourceRoot":"","sources":["../../src/config/private.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAKjD,eAAO,MAAM,eAAe,oKAS1B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PRIVATE_JS_CODE = exports.PRIVATE_JS_NAME = void 0;
|
|
4
|
+
exports.PRIVATE_JS_NAME = 'weda-private.js';
|
|
5
|
+
exports.PRIVATE_JS_CODE = `
|
|
6
|
+
/**
|
|
7
|
+
* An empty js file. It will be overridden in private place.
|
|
8
|
+
*
|
|
9
|
+
* For example:
|
|
10
|
+
* \`\`\`javascript
|
|
11
|
+
* window._isPrivate = true
|
|
12
|
+
* \`\`\`
|
|
13
|
+
*/
|
|
14
|
+
`;
|
|
@@ -6,7 +6,7 @@ export declare function originJsonToFileList(appData: IWeAppData): (import("../t
|
|
|
6
6
|
code: string;
|
|
7
7
|
pageId: string;
|
|
8
8
|
})[];
|
|
9
|
-
export declare function getExtByType(type: CodeType): ".
|
|
9
|
+
export declare function getExtByType(type: CodeType): ".js" | ".json" | ".less";
|
|
10
10
|
export declare function HACK_FIX_LOWCODE_IN(code?: string): string;
|
|
11
11
|
export declare function HACK_FIX_LOWCODE_OUT(code?: string): string;
|
|
12
12
|
//# sourceMappingURL=file.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/framework-plugin-low-code",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.36",
|
|
4
4
|
"description": "云开发 Tencent CloudBase Framework Low Code Plugin,将低码配置生成完整项目并一键部署云开发资源。",
|
|
5
5
|
"author": "yhsunshining@gmail.com",
|
|
6
6
|
"homepage": "https://github.com/TencentCloudBase/cloudbase-framework#readme",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"url": "https://github.com/TencentCloudBase/cloudbase-framework/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@cloudbase/cals": "0.3.
|
|
38
|
+
"@cloudbase/cals": "0.3.35",
|
|
39
39
|
"@cloudbase/framework-core": "^1.8.16",
|
|
40
40
|
"@cloudbase/framework-plugin-auth": "^1.8.16",
|
|
41
41
|
"@cloudbase/framework-plugin-mp": "v1.3.6-beta.8",
|
|
@@ -87,4 +87,4 @@
|
|
|
87
87
|
"jest": "^26.0.1",
|
|
88
88
|
"typescript": "^3.8.3"
|
|
89
89
|
}
|
|
90
|
-
}
|
|
90
|
+
}
|
|
@@ -159,16 +159,44 @@ function FieldWrapper({
|
|
|
159
159
|
context,
|
|
160
160
|
children,
|
|
161
161
|
updateContext,
|
|
162
|
+
renderSlot = false,
|
|
162
163
|
}) {
|
|
163
|
-
const { scopeContext, forContext, forIndexes, widgetsData, codeContext, dataContext } = context;
|
|
164
|
+
const { scopeContext, forContext, forIndexes, widgetsData, codeContext, dataContext, virtualFields } = context;
|
|
164
165
|
|
|
165
166
|
const injectContext = {};
|
|
166
167
|
const indexRef = React.useRef();
|
|
167
168
|
const typeRef = React.useRef();
|
|
168
169
|
const instanceRef = React.useRef();
|
|
170
|
+
|
|
169
171
|
const { 'x-props': xProps } = componentSchema;
|
|
170
172
|
let { staticResourceAttribute = [], listenerInstances = [] } = xProps;
|
|
171
173
|
|
|
174
|
+
// 多个组件的 slot 属性
|
|
175
|
+
const slotMap = React.useMemo(
|
|
176
|
+
() => {
|
|
177
|
+
return generateSlotMap(
|
|
178
|
+
generateSlotMetaMap(
|
|
179
|
+
componentSchema,
|
|
180
|
+
{
|
|
181
|
+
scopeContext,
|
|
182
|
+
forContext,
|
|
183
|
+
dataContext,
|
|
184
|
+
codeContext,
|
|
185
|
+
virtualFields,
|
|
186
|
+
updateContext,
|
|
187
|
+
injectContext,
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
renderSlot,
|
|
191
|
+
},
|
|
192
|
+
),
|
|
193
|
+
);
|
|
194
|
+
},
|
|
195
|
+
!!codeContext
|
|
196
|
+
? [componentSchema, virtualFields]
|
|
197
|
+
: [componentSchema, scopeContext, codeContext, forContext, dataContext, virtualFields],
|
|
198
|
+
);
|
|
199
|
+
|
|
172
200
|
// 组件最终用于执行的事件函数
|
|
173
201
|
const emit = React.useCallback(
|
|
174
202
|
(trigger, listeners, eventData, forItems, domEvent, scopeContext) => {
|
|
@@ -245,6 +273,7 @@ function FieldWrapper({
|
|
|
245
273
|
ref={instanceRef}
|
|
246
274
|
data={{
|
|
247
275
|
...data,
|
|
276
|
+
...slotMap,
|
|
248
277
|
_selectableBlockEvents: {
|
|
249
278
|
onCustomEvent: ({ order: index, blockKey }) => {
|
|
250
279
|
if (index !== undefined) {
|
|
@@ -363,21 +392,6 @@ export function getComponentRenderList(props) {
|
|
|
363
392
|
return null;
|
|
364
393
|
}
|
|
365
394
|
|
|
366
|
-
const slotMap = generateSlotMap(
|
|
367
|
-
generateSlotMetaMap(
|
|
368
|
-
componentSchema,
|
|
369
|
-
{
|
|
370
|
-
..._context,
|
|
371
|
-
forContext: forItems,
|
|
372
|
-
virtualFields,
|
|
373
|
-
updateContext,
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
renderSlot,
|
|
377
|
-
},
|
|
378
|
-
),
|
|
379
|
-
);
|
|
380
|
-
|
|
381
395
|
return (
|
|
382
396
|
<ForContext.Provider key={forItemData._key} value={forItems}>
|
|
383
397
|
<FieldWrapper
|
|
@@ -388,13 +402,11 @@ export function getComponentRenderList(props) {
|
|
|
388
402
|
widgetsData,
|
|
389
403
|
forContext: forItems,
|
|
390
404
|
forIndexes: forItemsIndexes,
|
|
405
|
+
virtualFields,
|
|
391
406
|
}}
|
|
392
407
|
id={compId}
|
|
393
408
|
updateContext={updateContext}
|
|
394
|
-
data={
|
|
395
|
-
...forItemData,
|
|
396
|
-
...slotMap,
|
|
397
|
-
}}
|
|
409
|
+
data={forItemData}
|
|
398
410
|
{...getSafeComponentProps({
|
|
399
411
|
style: forItemStyle,
|
|
400
412
|
classNameList: forItemClassNameList,
|
|
@@ -433,21 +445,6 @@ export function getComponentRenderList(props) {
|
|
|
433
445
|
return null;
|
|
434
446
|
}
|
|
435
447
|
|
|
436
|
-
// 单个组件的 slot 属性
|
|
437
|
-
const slotMap = generateSlotMap(
|
|
438
|
-
generateSlotMetaMap(
|
|
439
|
-
componentSchema,
|
|
440
|
-
{
|
|
441
|
-
..._context,
|
|
442
|
-
virtualFields,
|
|
443
|
-
updateContext,
|
|
444
|
-
},
|
|
445
|
-
{
|
|
446
|
-
renderSlot,
|
|
447
|
-
},
|
|
448
|
-
),
|
|
449
|
-
);
|
|
450
|
-
|
|
451
448
|
return (
|
|
452
449
|
<FieldWrapper
|
|
453
450
|
key={key}
|
|
@@ -457,13 +454,11 @@ export function getComponentRenderList(props) {
|
|
|
457
454
|
..._context,
|
|
458
455
|
forIndexes: forIndexes,
|
|
459
456
|
widgetsData,
|
|
457
|
+
virtualFields,
|
|
460
458
|
}}
|
|
461
459
|
id={compId}
|
|
462
460
|
updateContext={updateContext}
|
|
463
|
-
data={
|
|
464
|
-
...fieldData,
|
|
465
|
-
...slotMap,
|
|
466
|
-
}}
|
|
461
|
+
data={fieldData}
|
|
467
462
|
{...getSafeComponentProps({
|
|
468
463
|
style: finalStyle,
|
|
469
464
|
classNameList: finalClassNameList,
|
|
@@ -218,6 +218,7 @@ export async function checkAnonymous() {
|
|
|
218
218
|
* 检查页面权限
|
|
219
219
|
**/
|
|
220
220
|
export async function checkAuth(app, appId, $page) {
|
|
221
|
+
return true
|
|
221
222
|
<% if (isAdminPortal || isXPage) { %>return true;<% } %>
|
|
222
223
|
app.showNavigationBarLoading();
|
|
223
224
|
const { loginConfigVersion } = app.__internal__.getConfig();
|