fix
This commit is contained in:
parent
6a76b2ef03
commit
d51366b53e
File diff suppressed because one or more lines are too long
|
|
@ -53,7 +53,7 @@ const serverMain = () => ({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(`Failed to init server ${site_id}`, e);
|
console.log(`Failed to init server ${site_id}\n`, e);
|
||||||
}
|
}
|
||||||
}, 10);
|
}, 10);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { createRouter } from "radix3";
|
import { createRouter } from "radix3";
|
||||||
import { FC, Suspense, lazy } from "react";
|
import { FC, Suspense, lazy } from "react";
|
||||||
import { Geiger } from "react-geiger";
|
|
||||||
import { GlobalContext, useLocal } from "web-utils";
|
import { GlobalContext, useLocal } from "web-utils";
|
||||||
import { w } from "../utils/types/general";
|
import { w } from "../utils/types/general";
|
||||||
import { Loading } from "../utils/ui/loading";
|
import { Loading } from "../utils/ui/loading";
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,6 @@ export const EdScriptMonaco: FC<{}> = () => {
|
||||||
case "item":
|
case "item":
|
||||||
{
|
{
|
||||||
types._raw = declareScope(p, meta, monaco);
|
types._raw = declareScope(p, meta, monaco);
|
||||||
|
|
||||||
const model = monaco.editor.createModel(
|
const model = monaco.editor.createModel(
|
||||||
trim(val),
|
trim(val),
|
||||||
"typescript",
|
"typescript",
|
||||||
|
|
|
||||||
|
|
@ -103,8 +103,11 @@ export const EdSidePropInstance: FC<{ meta: IMeta }> = ({ meta }) => {
|
||||||
);
|
);
|
||||||
evn(arg);
|
evn(arg);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.warn(
|
||||||
|
`Error prop ${k} in item [${meta.item.name}], source:`,
|
||||||
|
v.valueBuilt
|
||||||
|
);
|
||||||
console.error(e);
|
console.error(e);
|
||||||
console.warn(k, v.valueBuilt);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import { w } from "../types/general";
|
||||||
import { baseTypings } from "./types/base";
|
import { baseTypings } from "./types/base";
|
||||||
import { extractProp } from "./types/prop";
|
import { extractProp } from "./types/prop";
|
||||||
import { prismaExtendType } from "./prisma-extend";
|
import { prismaExtendType } from "./prisma-extend";
|
||||||
|
import { propPopover } from "../../nova/ed/panel/side/prop-master/prop-form";
|
||||||
export type MonacoEditor = Parameters<OnMount>[0];
|
export type MonacoEditor = Parameters<OnMount>[0];
|
||||||
type Monaco = Parameters<OnMount>[1];
|
type Monaco = Parameters<OnMount>[1];
|
||||||
|
|
||||||
|
|
@ -125,8 +126,6 @@ declare global {
|
||||||
|
|
||||||
${baseTypings}
|
${baseTypings}
|
||||||
|
|
||||||
${propText.join("\n")}
|
|
||||||
|
|
||||||
${iftext(
|
${iftext(
|
||||||
apiTypes,
|
apiTypes,
|
||||||
`
|
`
|
||||||
|
|
@ -140,6 +139,8 @@ declare global {
|
||||||
`,
|
`,
|
||||||
"ts:global.d.ts"
|
"ts:global.d.ts"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
register(monaco, propText.join("\n"), "ts:typings.d.ts");
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadText = async (url: string) => {
|
const loadText = async (url: string) => {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ export const useLocal = <T extends object>(
|
||||||
render: () => void;
|
render: () => void;
|
||||||
},
|
},
|
||||||
deps: (deps || []) as any[],
|
deps: (deps || []) as any[],
|
||||||
promisedKeys: new Set<string>(),
|
|
||||||
ready: false,
|
ready: false,
|
||||||
_loading: {} as any,
|
_loading: {} as any,
|
||||||
});
|
});
|
||||||
|
|
@ -29,22 +28,6 @@ export const useLocal = <T extends object>(
|
||||||
if (local.ready === false) {
|
if (local.ready === false) {
|
||||||
local._loading = {};
|
local._loading = {};
|
||||||
|
|
||||||
for (const [k, v] of Object.entries(data)) {
|
|
||||||
if (!local.promisedKeys.has(k)) {
|
|
||||||
let val = v;
|
|
||||||
if (typeof val === "object" && val instanceof Promise) {
|
|
||||||
local._loading[k] = true;
|
|
||||||
local.promisedKeys.add(k);
|
|
||||||
(local.data as any)[k] = null;
|
|
||||||
val.then((resolved) => {
|
|
||||||
(local.data as any)[k] = resolved;
|
|
||||||
local._loading[k] = false;
|
|
||||||
local.data.render();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
local.data.render = () => {
|
local.data.render = () => {
|
||||||
if (local.ready) _render({});
|
if (local.ready) _render({});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue