fix code
This commit is contained in:
parent
2f459afaa0
commit
51e3a205b7
|
|
@ -85,11 +85,19 @@ export const declareScope = (p: PG, meta: IMeta, monaco: Monaco) => {
|
||||||
|
|
||||||
if (comp && comp.typings) {
|
if (comp && comp.typings) {
|
||||||
try {
|
try {
|
||||||
const fn = new Function(`\
|
const arg = {
|
||||||
|
...exports,
|
||||||
|
params,
|
||||||
|
};
|
||||||
|
|
||||||
|
const fn = new Function(
|
||||||
|
...Object.keys(arg),
|
||||||
|
`\
|
||||||
${comp.typings};
|
${comp.typings};
|
||||||
return typings;
|
return typings;
|
||||||
`);
|
`
|
||||||
const result = fn();
|
);
|
||||||
|
const result = fn(...Object.values(arg));
|
||||||
if (typeof result === "object" && typeof result._raw === "object") {
|
if (typeof result === "object" && typeof result._raw === "object") {
|
||||||
for (const [k, v] of Object.entries(result._raw) as any) {
|
for (const [k, v] of Object.entries(result._raw) as any) {
|
||||||
comp_types[k] = v;
|
comp_types[k] = v;
|
||||||
|
|
|
||||||
|
|
@ -322,7 +322,6 @@ const treeClasses = {
|
||||||
placeholder: "placeholder",
|
placeholder: "placeholder",
|
||||||
draggingSource: css`
|
draggingSource: css`
|
||||||
background: #e4f0ff;
|
background: #e4f0ff;
|
||||||
|
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
`,
|
`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue