wip fix
This commit is contained in:
parent
7083db69d7
commit
14cb4c88a7
|
|
@ -125,7 +125,10 @@ export const EdFormPage: FC<{
|
|||
}}
|
||||
onChange={(e) => {
|
||||
if (local.fillUrl) {
|
||||
form.url = `/${e.replace(/\W/g, "/").replace(/\/\/+/g, "/")}`;
|
||||
form.url = `/${e
|
||||
.replace(/\W/g, "/")
|
||||
.replace(/\/\/+/g, "/")
|
||||
.replace(/\s/g, "_")}`;
|
||||
}
|
||||
form.render();
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -34,10 +34,13 @@ export const EdPopPage = () => {
|
|||
const parents: string[] = [];
|
||||
let cur = pagePicker.tree.find((e) => e.id === p.page.cur.id);
|
||||
|
||||
const processed_id = new Set<string>();
|
||||
if (pagePicker.rename_id) {
|
||||
let cur = pagePicker.tree.find((e) => e.id === pagePicker.rename_id);
|
||||
while (cur) {
|
||||
if (typeof cur.id === "string") {
|
||||
if (processed_id.has(cur.id)) break;
|
||||
else processed_id.add(cur.id);
|
||||
if (parents.includes(cur.id)) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -49,6 +52,8 @@ export const EdPopPage = () => {
|
|||
} else {
|
||||
while (cur) {
|
||||
if (typeof cur.id === "string") {
|
||||
if (processed_id.has(cur.id)) break;
|
||||
else processed_id.add(cur.id);
|
||||
if (parents.includes(cur.id)) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ import { ParsedScope } from "../../../../../../../srv/ws/sync/editor/parser/pars
|
|||
import { jscript } from "../../../../../utils/script/jscript";
|
||||
import { jsMount } from "../../../../../utils/script/mount";
|
||||
import { monacoTypings } from "../../../../../utils/script/typings";
|
||||
import { Loading } from "../../../../../utils/ui/loading";
|
||||
import { getActiveMeta } from "../../../logic/active/get-meta";
|
||||
import { EDGlobal, IMeta, active } from "../../../logic/ed-global";
|
||||
import { edMonacoDefaultVal } from "./default-val";
|
||||
import { declareScope } from "./scope/scope";
|
||||
import { Loading } from "../../../../../utils/ui/loading";
|
||||
// @ts-ignore
|
||||
import { constrainedEditor } from "constrained-editor-plugin/dist/esm/constrainedEditor";
|
||||
import { addScope } from "./scope/add-scope";
|
||||
|
|
@ -95,7 +95,6 @@ export const EdScriptMonaco: FC<{}> = () => {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (p.ui.popup.script.mode === "js") {
|
||||
const w = window as any;
|
||||
const types: any = {};
|
||||
|
|
|
|||
|
|
@ -16,43 +16,48 @@ export const monacoTypings = async (
|
|||
if (!map.has(prop.values)) {
|
||||
map.set(prop.values, true);
|
||||
} else {
|
||||
console.log("map has prop values");
|
||||
return;
|
||||
}
|
||||
|
||||
if (w.prasiApi[p.site.api_url] && w.prasiApi[p.site.api_url].prismaTypes) {
|
||||
const prisma = w.prasiApi[p.site.api_url].prismaTypes;
|
||||
|
||||
register(
|
||||
monaco,
|
||||
`\
|
||||
if (prisma) {
|
||||
register(
|
||||
monaco,
|
||||
`\
|
||||
declare module "ts:runtime/index" {
|
||||
${prisma["runtime/index.d.ts"]}
|
||||
}`,
|
||||
`ts:runtime/index.d.ts`
|
||||
);
|
||||
`ts:runtime/index.d.ts`
|
||||
);
|
||||
|
||||
register(
|
||||
monaco,
|
||||
`\
|
||||
register(
|
||||
monaco,
|
||||
`\
|
||||
declare module "ts:runtime/library" {
|
||||
${prisma["runtime/library.d.ts"]}
|
||||
}`,
|
||||
`ts:runtime/library.d.ts`
|
||||
);
|
||||
`ts:runtime/library.d.ts`
|
||||
);
|
||||
|
||||
register(
|
||||
monaco,
|
||||
`\
|
||||
register(
|
||||
monaco,
|
||||
`\
|
||||
declare module "ts:prisma" {
|
||||
${prisma["prisma.d.ts"].replace(
|
||||
`import * as runtime from './runtime/library';`,
|
||||
`import * as runtime from 'ts:runtime/library';`
|
||||
)}
|
||||
}`,
|
||||
`ts:prisma.d.ts`
|
||||
);
|
||||
|
||||
register(monaco, w.prasiApi[p.site.api_url].apiTypes, "ts:api.d.ts");
|
||||
`ts:prisma.d.ts`
|
||||
);
|
||||
}
|
||||
const apiTypes = w.prasiApi[p.site.api_url].apiTypes;
|
||||
if (apiTypes) {
|
||||
register(monaco, apiTypes, "ts:api.d.ts");
|
||||
}
|
||||
}
|
||||
|
||||
monaco.languages.typescript.typescriptDefaults.setExtraLibs([
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ export const _ = {
|
|||
headers: any;
|
||||
body: any;
|
||||
}) {
|
||||
if (!arg.url) return new Response(null, { status: 403 });
|
||||
|
||||
const res = await fetch(
|
||||
arg.url,
|
||||
arg.body
|
||||
|
|
|
|||
Loading…
Reference in New Issue