wip fix
This commit is contained in:
parent
004ccd5ce7
commit
4868fa7a39
|
|
@ -81,12 +81,10 @@ export const edInitSync = (p: PG) => {
|
||||||
}
|
}
|
||||||
p.ui.popup.code.loading = false;
|
p.ui.popup.code.loading = false;
|
||||||
|
|
||||||
console.log("mooko ");
|
|
||||||
if (arg.src) {
|
if (arg.src) {
|
||||||
const w = window as any;
|
const w = window as any;
|
||||||
const module = evalCJS(decoder.decode(decompress(arg.src)));
|
const module = evalCJS(decoder.decode(decompress(arg.src)));
|
||||||
p.global_prop = Object.keys(module);
|
p.global_prop = Object.keys(module);
|
||||||
console.log(module);
|
|
||||||
if (typeof module === "object") {
|
if (typeof module === "object") {
|
||||||
for (const [k, v] of Object.entries(module)) {
|
for (const [k, v] of Object.entries(module)) {
|
||||||
w[k] = v;
|
w[k] = v;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,39 @@ export const ViPreview = (arg: { pathname: string }) => {
|
||||||
return <Loading note={p.status + "-page"} />;
|
return <Loading note={p.status + "-page"} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const mode = p.mode;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<div className={cx("relative flex flex-1 items-center justify-center")}>
|
||||||
|
<div
|
||||||
|
className={cx(
|
||||||
|
"absolute flex flex-col items-stretch flex-1 bg-white ",
|
||||||
|
mode === "mobile"
|
||||||
|
? css`
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
border-left: 1px solid #ccc;
|
||||||
|
border-right: 1px solid #ccc;
|
||||||
|
width: 375px;
|
||||||
|
top: 0px;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
bottom: 0px;
|
||||||
|
}
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
left: 0px;
|
||||||
|
right: 0px;
|
||||||
|
top: 0px;
|
||||||
|
bottom: 0px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
: "inset-0 overflow-auto",
|
||||||
|
|
||||||
|
css`
|
||||||
|
contain: content;
|
||||||
|
`
|
||||||
|
)}
|
||||||
|
>
|
||||||
<Vi
|
<Vi
|
||||||
meta={p.page.meta}
|
meta={p.page.meta}
|
||||||
api_url={p.site.config.api_url}
|
api_url={p.site.config.api_url}
|
||||||
|
|
@ -27,6 +59,8 @@ export const ViPreview = (arg: { pathname: string }) => {
|
||||||
render_stat="disabled"
|
render_stat="disabled"
|
||||||
script={{ init_local_effect: p.script.init_local_effect }}
|
script={{ init_local_effect: p.script.init_local_effect }}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -37,7 +71,7 @@ const viRoute = async (p: PG) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!p.site.domain && !p.site.name) {
|
if (!p.site.domain && !p.site.name) {
|
||||||
p.status = "loading";
|
p.status = "load-site";
|
||||||
const site = await p.sync.site.load(p.site.id);
|
const site = await p.sync.site.load(p.site.id);
|
||||||
if (!site) {
|
if (!site) {
|
||||||
p.status = "site-not-found";
|
p.status = "site-not-found";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue