wip fix
This commit is contained in:
parent
c1098a3125
commit
640e5f767e
|
|
@ -14,6 +14,7 @@ import { EdPagePop } from "./panel/popup/page/page-popup";
|
||||||
import { EdPopScript } from "./panel/popup/script/pop-script";
|
import { EdPopScript } from "./panel/popup/script/pop-script";
|
||||||
import { EdPopSite } from "./panel/popup/site/site-popup";
|
import { EdPopSite } from "./panel/popup/site/site-popup";
|
||||||
import { EdScriptInit } from "./panel/script/monaco/init";
|
import { EdScriptInit } from "./panel/script/monaco/init";
|
||||||
|
import { EdPopApi } from "./panel/popup/api/api-server";
|
||||||
|
|
||||||
export const EdBase = () => {
|
export const EdBase = () => {
|
||||||
const p = useGlobal(EDGlobal, "EDITOR");
|
const p = useGlobal(EDGlobal, "EDITOR");
|
||||||
|
|
@ -51,6 +52,7 @@ export const EdBase = () => {
|
||||||
<EdPopCode />
|
<EdPopCode />
|
||||||
<EdPopScript />
|
<EdPopScript />
|
||||||
<EdPopSite />
|
<EdPopSite />
|
||||||
|
<EdPopApi />
|
||||||
<EdPagePop />
|
<EdPagePop />
|
||||||
<EdPopCompGroup />
|
<EdPopCompGroup />
|
||||||
<EdScriptInit />
|
<EdScriptInit />
|
||||||
|
|
|
||||||
|
|
@ -244,6 +244,7 @@ export const EDGlobal = {
|
||||||
on_pick?: (group_id: string) => void | Promise<void>;
|
on_pick?: (group_id: string) => void | Promise<void>;
|
||||||
on_close?: () => void | Promise<void>;
|
on_close?: () => void | Promise<void>;
|
||||||
},
|
},
|
||||||
|
api: { open: false },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,18 @@
|
||||||
import { EdApiServer } from "../../popup/api/api-server";
|
import { useGlobal } from "web-utils";
|
||||||
import { TopBtn } from "../top-btn";
|
import { TopBtn } from "../top-btn";
|
||||||
|
import { EDGlobal } from "../../../logic/ed-global";
|
||||||
|
|
||||||
export const EdApi = () => {
|
export const EdApi = () => {
|
||||||
|
const p = useGlobal(EDGlobal, "EDITOR");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TopBtn
|
<TopBtn
|
||||||
style="slim"
|
style="slim"
|
||||||
innerClassName="flex-1 flex items-center justify-center"
|
innerClassName="flex-1 flex items-center justify-center"
|
||||||
popover={(popover) => <EdApiServer popover={popover} />}
|
onClick={() => {
|
||||||
|
p.ui.popup.api.open = true;
|
||||||
|
p.render();
|
||||||
|
}}
|
||||||
placement="right"
|
placement="right"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,30 @@ import { EdApiDB } from "./api-db";
|
||||||
import { EdApiDeploy } from "./api-deploy";
|
import { EdApiDeploy } from "./api-deploy";
|
||||||
import { EdApiDomain } from "./api-domain";
|
import { EdApiDomain } from "./api-domain";
|
||||||
import { apiRef, apiUrl, checkAPI, dev, server } from "./api-utils";
|
import { apiRef, apiUrl, checkAPI, dev, server } from "./api-utils";
|
||||||
|
import { Modal } from "../../../../../utils/ui/modal";
|
||||||
|
|
||||||
|
export const EdPopApi = () => {
|
||||||
|
const p = useGlobal(EDGlobal, "EDITOR");
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
open={p.ui.popup.api.open}
|
||||||
|
onOpenChange={(open) => {
|
||||||
|
p.ui.popup.api.open = open;
|
||||||
|
p.render();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<EdApiServer
|
||||||
|
popover={{
|
||||||
|
onClose() {
|
||||||
|
p.ui.popup.api.open = false;
|
||||||
|
p.render();
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export const EdApiServer = forwardRef<
|
export const EdApiServer = forwardRef<
|
||||||
HTMLDivElement,
|
HTMLDivElement,
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import { NodeModel, RenderParams } from "@minoru/react-dnd-treeview";
|
||||||
import { EDGlobal, EdMeta } from "../../../../logic/ed-global";
|
import { EDGlobal, EdMeta } from "../../../../logic/ed-global";
|
||||||
import { useGlobal, useLocal } from "web-utils";
|
import { useGlobal, useLocal } from "web-utils";
|
||||||
import { FC, useEffect } from "react";
|
import { FC, useEffect } from "react";
|
||||||
|
import { Tooltip } from "../../../../../../utils/ui/tooltip";
|
||||||
|
|
||||||
export const EdTreeName = ({
|
export const EdTreeName = ({
|
||||||
node,
|
node,
|
||||||
|
|
@ -74,7 +75,7 @@ export const EdTreeName = ({
|
||||||
) : (
|
) : (
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
<Name name={node.text} is_jsx_prop={is_jsx_prop} />
|
<Name name={node.text} is_jsx_prop={is_jsx_prop} />
|
||||||
<div className={"text-[11px] text-gray-500 -mt-1"}>{item.id}</div>
|
{/* <div className={"text-[11px] text-gray-500 -mt-1"}>{item.id}</div> */}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -88,8 +89,8 @@ const Name: FC<{ name: string; is_jsx_prop: boolean }> = ({
|
||||||
if (is_jsx_prop) {
|
if (is_jsx_prop) {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center space-x-1">
|
<div className="flex items-center space-x-1">
|
||||||
<div className="flex text-purple-500 border border-purple-400 items-center justify-center font-mono text-[8px] px-[2px]">
|
<div className="flex text-purple-500 border border-purple-400 items-center justify-center font-mono text-[6px] px-[2px]">
|
||||||
PROP
|
P
|
||||||
</div>
|
</div>
|
||||||
<div>{name}</div>
|
<div>{name}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue