Skip to content

Commit c117258

Browse files
author
sunlei
committed
feat: component explorer, dynamic table column .etc
- componet explorer - dynamic table column configs - ue of code editor optimization - module method params
1 parent 3147492 commit c117258

File tree

250 files changed

+4799
-1313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+4799
-1313
lines changed

client/packages/openblocks-cli/actions/build.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { writeFileSync, existsSync, readFileSync } from "fs";
55
import { resolve } from "path";
66
import paths from "../config/paths.js";
77
import "../util/log.js";
8+
import chalk from "chalk";
89

910
const { copySync } = fsExtra;
1011
const packageJSON = JSON.parse(readFileSync(paths.appPackageJson).toString());
@@ -28,14 +29,14 @@ function validPackageJSON() {
2829
Object.keys(openblocks.comps).forEach((name) => {
2930
const compManifest = packageJSON.openblocks.comps[name];
3031
if (!compManifest.icon) {
31-
compErrors.push(`- comp ${name} must specify an icon`);
32+
// compErrors.push(`- comp ${name} must specify an icon`);
3233
return;
3334
}
3435
if (
3536
!compManifest.icon.startsWith("data:") &&
3637
!existsSync(paths.resolveApp(compManifest.icon))
3738
) {
38-
compErrors.push(`- comp ${name}'s icon path ${compManifest} not exist`);
39+
compErrors.push(`- comp ${name}'s icon file ${chalk.cyan(compManifest.icon)} not found`);
3940
return;
4041
}
4142
});
@@ -88,7 +89,9 @@ export default async function buildAction(options) {
8889
// copy icon files
8990
compNames.forEach((name) => {
9091
const compManifest = packageJSON.openblocks.comps[name];
91-
copySync(paths.resolveApp(compManifest.icon), resolve(paths.appOutPath, compManifest.icon));
92+
if (compManifest.icon) {
93+
copySync(paths.resolveApp(compManifest.icon), resolve(paths.appOutPath, compManifest.icon));
94+
}
9295
});
9396

9497
if (options.publish) {

client/packages/openblocks-cli/client.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ declare module "*.md" {
1717
export default value;
1818
}
1919

20-
declare module "eslint4b-prebuilt";
20+
declare module "eslint4b-prebuilt-2";
2121
declare module "mq-polyfill";
2222
declare module "@rjsf/antd";
2323
declare module "really-relaxed-json";

client/packages/openblocks-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "openblocks-cli",
33
"description": "CLI tool used to start build publish openblocks components",
4-
"version": "0.0.20",
4+
"version": "0.0.21",
55
"bin": "./index.js",
66
"type": "module",
77
"exports": {

client/packages/openblocks-core/lib/index.d.ts

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,23 @@ declare class WrapNode<T> extends AbstractNode<T> {
297297
dependValues(): Record<string, unknown>;
298298
}
299299

300+
/**
301+
* build a new node by setting new dependent nodes in child node
302+
*/
303+
declare class WrapContextNodeV2<T> extends AbstractNode<T> {
304+
readonly child: Node<T>;
305+
readonly paramNodes: Record<string, Node<unknown>>;
306+
readonly type = "wrapContextV2";
307+
constructor(child: Node<T>, paramNodes: Record<string, Node<unknown>>);
308+
wrapContext(paramName: string): AbstractNode<ValueFn<T>>;
309+
filterNodes(exposingNodes: Record<string, Node<unknown>>): Map<Node<unknown>, string[]>;
310+
justEval(exposingNodes: Record<string, Node<unknown>>, methods?: EvalMethods): T;
311+
getChildren(): Node<unknown>[];
312+
dependValues(): Record<string, unknown>;
313+
fetchInfo(exposingNodes: Record<string, Node<unknown>>): FetchInfo;
314+
private wrap;
315+
}
316+
300317
declare function transformWrapper<T>(
301318
transformFn: (value: unknown) => T,
302319
defaultValue?: T
@@ -305,7 +322,7 @@ declare function transformWrapper<T>(
305322
declare function relaxedJSONToJSON(text: string, compact: boolean): string;
306323

307324
declare function isDynamicSegment(segment: string): boolean;
308-
declare function getDynamicStringSegments(dynamicString: string): string[];
325+
declare function getDynamicStringSegments(input: string): string[];
309326

310327
declare function clearMockWindow(): void;
311328
interface SandBoxOption {
@@ -318,12 +335,19 @@ declare function evalFunc(
318335
functionBody: string,
319336
context: any,
320337
methods?: EvalMethods,
321-
options?: SandBoxOption
338+
options?: SandBoxOption,
339+
isAsync?: boolean
322340
): any;
323341

324342
declare function evalStyle(id: string, css: string[]): void;
325343
declare function clearStyleEval(id?: string): void;
326344

345+
declare function evalFunctionResult(
346+
unevaledValue: string,
347+
context: Record<string, unknown>,
348+
methods?: EvalMethods
349+
): Promise<ValueAndMsg<unknown>>;
350+
327351
declare function nodeIsRecord(
328352
node: Node<unknown>
329353
): node is RecordNode<Record<string, Node<unknown>>>;
@@ -735,6 +759,7 @@ export {
735759
EvalMethods,
736760
ExecuteQueryAction,
737761
ExtraActionType,
762+
ExtraNodeType,
738763
FetchCheckNode,
739764
FetchInfo,
740765
FunctionNode,
@@ -764,6 +789,7 @@ export {
764789
UpdateNodesV2Action,
765790
ValueAndMsg,
766791
ValueFn,
792+
WrapContextNodeV2,
767793
WrapNode,
768794
addChildAction,
769795
changeChildAction,
@@ -776,6 +802,7 @@ export {
776802
deleteCompAction,
777803
dependingNodeMapEquals,
778804
evalFunc,
805+
evalFunctionResult,
779806
evalNodeOrMinor,
780807
evalStyle,
781808
executeQueryAction,

0 commit comments

Comments
 (0)