wip fix
This commit is contained in:
parent
e69ff0fb3d
commit
27085ccd12
|
|
@ -1,21 +1,21 @@
|
||||||
import { useGlobal, useLocal } from "web-utils";
|
import { useGlobal, useLocal } from "web-utils";
|
||||||
import { Vi } from "../../../vi/vi";
|
import { Vi } from "../../../vi/vi";
|
||||||
import { EDGlobal } from "../../logic/ed-global";
|
import { EDGlobal, active } from "../../logic/ed-global";
|
||||||
|
|
||||||
export const EdMain = () => {
|
export const EdMain = () => {
|
||||||
const local = useLocal({
|
|
||||||
hover_id: "",
|
|
||||||
});
|
|
||||||
// return <div className="flex flex-1 flex-col relative"></div>;
|
// return <div className="flex flex-1 flex-col relative"></div>;
|
||||||
const p = useGlobal(EDGlobal, "EDITOR");
|
const p = useGlobal(EDGlobal, "EDITOR");
|
||||||
|
const local = useLocal({});
|
||||||
|
active.hover.renderMain = local.render;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-1 relative overflow-auto">
|
<div className="flex flex-1 relative overflow-auto">
|
||||||
<div
|
<div
|
||||||
className={cx(
|
className={cx(
|
||||||
"absolute inset-0 flex",
|
"absolute inset-0 flex",
|
||||||
local.hover_id &&
|
active.hover.id &&
|
||||||
css`
|
css`
|
||||||
.s-${local.hover_id} {
|
.s-${active.hover.id} {
|
||||||
&::after {
|
&::after {
|
||||||
content: " ";
|
content: " ";
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|
@ -38,14 +38,39 @@ export const EdMain = () => {
|
||||||
api={p.script.api}
|
api={p.script.api}
|
||||||
db={p.script.db}
|
db={p.script.db}
|
||||||
visit={(meta, parts) => {
|
visit={(meta, parts) => {
|
||||||
|
parts.props.className = cx(
|
||||||
|
parts.props.className,
|
||||||
|
active.item_id === meta.item.id &&
|
||||||
|
css`
|
||||||
|
&::after {
|
||||||
|
content: " ";
|
||||||
|
pointer-events: none;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
border: 2px solid #1c88f3;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
);
|
||||||
parts.props.onPointerOver = (e) => {
|
parts.props.onPointerOver = (e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
local.hover_id = meta.item.id;
|
active.hover.id = meta.item.id;
|
||||||
local.render();
|
active.hover.renderMain();
|
||||||
|
active.hover.renderTree();
|
||||||
};
|
};
|
||||||
parts.props.onPointerLeave = (e) => {
|
parts.props.onPointerLeave = (e) => {
|
||||||
local.hover_id = "";
|
e.stopPropagation();
|
||||||
local.render();
|
active.hover.id = "";
|
||||||
|
active.hover.renderMain();
|
||||||
|
active.hover.renderTree();
|
||||||
|
};
|
||||||
|
parts.props.onPointerDown = (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
active.item_id = meta.item.id;
|
||||||
|
active.hover.id = "";
|
||||||
|
p.render();
|
||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue