1 ? (
-
- WARNING:
- e !== p.user.client_id)}
- />
- also open this script. Editing may cause conflicts.
-
- ) : undefined
- }
- monaco={{
- value: p.site.js,
- onChange: async (v) => {
- if (jscript.build) {
- const src = v || "";
- const built = await jscript.build("site.tsx", src);
-
- p.site.js = src;
- p.site.js_compiled = built;
-
- clearTimeout(local.timeout);
- local.timeout = setTimeout(async () => {
- await p.sync.site.update(p.site.id, {
- js: Buffer.from(compress(src)),
- js_compiled: Buffer.from(compress(built)),
- });
- }, 1000);
- }
- },
- }}
- prop={{
- types: {
- exports: "any",
- types: "any",
- render: "()=>void",
- },
- }}
- onClose={() => {
- // p.ui.script.site = false;
- // p.sync.activity(
- // { page_id: p.page.cur.id, item_id: "site" },
- // "js",
- // Activity.Null
- // );
- // p.render();
- }}
- />
- );
-};
diff --git a/app/web/src/render/site/site.tsx b/app/web/src/render/site/site.tsx
index 81328845..476495e4 100644
--- a/app/web/src/render/site/site.tsx
+++ b/app/web/src/render/site/site.tsx
@@ -1,8 +1,13 @@
+import structuredClone from "@ungap/structured-clone";
import { FC, useState } from "react";
import { createRoot } from "react-dom/client";
import { GlobalContext, defineReact, defineWindow } from "web-utils";
import { siteLoader } from "./site-loader";
+if (!("structuredClone" in (window as any))) {
+ (window as any).structuredClone = structuredClone;
+}
+
const w = window as unknown as {
prasiContext: any;
rootRender: any;
diff --git a/bun.lockb b/bun.lockb
index 91ef701c..edc0dbec 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/package.json b/package.json
index c51020f3..8c9790fa 100644
--- a/package.json
+++ b/package.json
@@ -24,6 +24,8 @@
"typescript": "^5.0.0"
},
"dependencies": {
+ "@types/ungap__structured-clone": "^0.3.1",
+ "@ungap/structured-clone": "^1.2.0",
"brotli-wasm": "^2.0.1",
"fdir": "^6.1.0"
}