diff --git a/app/web/src/nova/ed/panel/popup/script/monaco.tsx b/app/web/src/nova/ed/panel/popup/script/monaco.tsx index 97304985..c485d922 100644 --- a/app/web/src/nova/ed/panel/popup/script/monaco.tsx +++ b/app/web/src/nova/ed/panel/popup/script/monaco.tsx @@ -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, diff --git a/app/web/src/nova/ed/panel/side/prop-instance/prop-option.tsx b/app/web/src/nova/ed/panel/side/prop-instance/prop-option.tsx index b7e586ba..0ba7aed6 100644 --- a/app/web/src/nova/ed/panel/side/prop-instance/prop-option.tsx +++ b/app/web/src/nova/ed/panel/side/prop-instance/prop-option.tsx @@ -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 (