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