fix
This commit is contained in:
parent
5984086a34
commit
4287466145
File diff suppressed because one or more lines are too long
|
|
@ -80,7 +80,15 @@ export const EdBase = () => {
|
|||
const Editor = jscript.editor;
|
||||
|
||||
return (
|
||||
<div className={cx("flex flex-col flex-1", style)}>
|
||||
<div
|
||||
className={cx("flex flex-col flex-1", style)}
|
||||
onPointerLeave={() => {
|
||||
w.pointer_active = false;
|
||||
}}
|
||||
onPointerEnter={() => {
|
||||
w.pointer_active = true;
|
||||
}}
|
||||
>
|
||||
<div className="flex justify-between"></div>
|
||||
<div className="flex flex-1 items-stretch">
|
||||
{p.status === "ready" && (
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ export const edInitSync = (p: PG) => {
|
|||
p.render();
|
||||
},
|
||||
async code_changes({ ts, mode, status }) {
|
||||
if (mode === "frontend") {
|
||||
if (mode === "frontend" && !w.pointer_active) {
|
||||
if (status === "ok") {
|
||||
console.clear();
|
||||
console.log(
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ export const initDevLiveReload = () => {
|
|||
},
|
||||
});
|
||||
} else if (msg.type === SyncType.Event) {
|
||||
if (w.pointer_active) return;
|
||||
if (msg.event === "page_changed") {
|
||||
const id = msg.data.map.id;
|
||||
const page = base.page.cache[id];
|
||||
|
|
@ -89,7 +90,7 @@ export const initDevLiveReload = () => {
|
|||
rebuildMeta(p.meta, p.root);
|
||||
|
||||
console.log(
|
||||
`${format(Date.now(), "HH:mm:ss")} 🚧 Component [${id}] updated `
|
||||
`${format(Date.now(), "HH:mm:ss")} 🚧 Component [${msg.data.map.root.name}] updated `
|
||||
);
|
||||
w.prasiContext.render();
|
||||
} else if (msg.event === "code_changes") {
|
||||
|
|
|
|||
|
|
@ -177,7 +177,15 @@ export const Root = () => {
|
|||
|
||||
return (
|
||||
<Provider value={w.prasiContext}>
|
||||
<div className={cx("relative flex flex-1 items-center justify-center")}>
|
||||
<div
|
||||
className={cx("relative flex flex-1 items-center justify-center")}
|
||||
onPointerLeave={() => {
|
||||
w.pointerActive = false;
|
||||
}}
|
||||
onPointerEnter={() => {
|
||||
w.pointerActive = true;
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className={cx(
|
||||
"absolute flex flex-col items-stretch flex-1 bg-white main-content-preview",
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ export const w = window as unknown as {
|
|||
};
|
||||
params: any;
|
||||
navigateOverride: (href: string) => void;
|
||||
pointerActive: boolean
|
||||
_prasi: {
|
||||
basepath: string;
|
||||
page_id?: string;
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ export const w = window as unknown as {
|
|||
on: any;
|
||||
off: any;
|
||||
};
|
||||
pointer_active: boolean
|
||||
};
|
||||
|
||||
export type Page = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue