This commit is contained in:
Rizky 2024-06-25 08:21:22 +07:00
parent 8435309769
commit e28f7e3ec1
3 changed files with 7 additions and 13 deletions

View File

@ -1,26 +1,18 @@
import { TransformResult, transform } from "esbuild";
import { g } from "utils/global";
import { validate } from "uuid";
import { Doc } from "yjs";
import { MContent } from "../../../../web/src/utils/types/general";
import { MItem } from "../../../../web/src/utils/types/item";
import { MRoot } from "../../../../web/src/utils/types/root";
import { SAction } from "../actions";
import { loadComponent } from "../editor/load-component";
import { parseJs } from "../editor/parser/parse-js";
import { docs } from "../entity/docs";
import { gunzipAsync } from "../entity/zlib";
import { SyncConnection } from "../type";
import { parseJs } from "../editor/parser/parse-js";
import { snapshot } from "../entity/snapshot";
import { validate } from "uuid";
import { gzipAsync } from "utils/diff/diff";
import { user } from "../entity/user";
import { loadComponent } from "../editor/load-component";
const decoder = new TextDecoder();
const timeout = {
page: {} as Record<string, any>,
comp: {} as Record<string, any>,
};
export const code_edit: SAction["code"]["edit"] = async function (
this: SyncConnection,
arg

View File

@ -7,7 +7,7 @@ import { treeCacheBuild, treeRebuild } from "./tree/build";
import { get, set } from "idb-keyval";
import { nav } from "../../vi/render/script/extract-nav";
const UPDATE_TIMEOUT = 200;
const UPDATE_TIMEOUT = 0;
export const edRoute = async (p: PG) => {
if (p.sync && (p.status === "ready" || p.status === "init")) {
if (!p.site.domain && !p.site.name) {
@ -71,6 +71,7 @@ export const reloadLayout = async (p: PG, layout_id: string, note: string) => {
clearTimeout(page.update_timeout);
page.update_timeout = setTimeout(async () => {
if (origin === "local" || !p.sync) return;
console.log("page on update snap")
const res = await p.sync.yjs.sv_local(
"page",
@ -184,6 +185,7 @@ export const reloadPage = async (
return;
}
console.log("page on update", origin)
const res = await p.sync.yjs.sv_local(
"page",
p.page.cur.id,

View File

@ -227,7 +227,7 @@ export const EdPropInstanceOptions: FC<{
}
});
},
[local.open]
[local.open, mprop, config?.opt]
);
let mode = cprop.meta?.option_mode;