This commit is contained in:
Rizky 2024-01-23 22:56:31 +07:00
parent 6a1a7cf126
commit 6412caff2e
2 changed files with 20 additions and 2 deletions

View File

@ -97,10 +97,19 @@ export const EdScriptMonaco: FC<{}> = () => {
}
if (p.ui.popup.script.mode === "js") {
const w = window as any;
const types: any = {};
for (const prop of p.global_prop) {
types[prop] = "any";
for (const prop_name of p.global_prop) {
if (prop_name === "_types") continue;
types[prop_name] = "any";
}
if (w._types) {
for (const [k, v] of Object.entries(w._types)) {
types[k] = v;
}
}
await monacoTypings(
{
site_dts: p.site_dts,

View File

@ -87,6 +87,15 @@ else metaOptions = resOpt;
let mode = prop.meta?.option_mode;
if (!mode) mode = "button";
if (metaOptions && metaOptions.length > 0) {
for (const [k, v] of Object.entries(metaOptions)) {
if (typeof v === "string") {
metaOptions[k as any] = { label: v, value: v };
}
}
}
return (
<div className="flex items-stretch min-h-[28px]">
<EdPropLabel name={name} labelClick={labelClick} />