checkpoint

This commit is contained in:
Rizky 2024-07-27 14:59:56 +07:00
parent 2e1618721f
commit 29f91a7b5b
124 changed files with 145 additions and 151 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-cyrillic-ext-400-normal.woff2") format("woff2"),url("./source-sans-3-cyrillic-ext-400-normal.woff") format("woff");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-cyrillic-400-normal.woff2") format("woff2"),url("./source-sans-3-cyrillic-400-normal.woff") format("woff");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-greek-ext-400-normal.woff2") format("woff2"),url("./source-sans-3-greek-ext-400-normal.woff") format("woff");unicode-range:U+1F00-1FFF}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-greek-400-normal.woff2") format("woff2"),url("./source-sans-3-greek-400-normal.woff") format("woff");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-vietnamese-400-normal.woff2") format("woff2"),url("./source-sans-3-vietnamese-400-normal.woff") format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-latin-ext-400-normal.woff2") format("woff2"),url("./source-sans-3-latin-ext-400-normal.woff") format("woff");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-latin-400-normal.woff2") format("woff2"),url("./source-sans-3-latin-400-normal.woff") format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
/*# sourceMappingURL=font-LBWDSK65.css.map */

View File

@ -0,0 +1,2 @@
import{d as o,e as f,g as s}from"./chunk-MAXH2HJU.js";o();s();f();
//# sourceMappingURL=font-WINJX3PY.js.map

View File

@ -1 +1,2 @@
@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-cyrillic-ext-400-normal.woff2") format("woff2"),url("./source-sans-3-cyrillic-ext-400-normal.woff") format("woff");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-cyrillic-400-normal.woff2") format("woff2"),url("./source-sans-3-cyrillic-400-normal.woff") format("woff");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-greek-ext-400-normal.woff2") format("woff2"),url("./source-sans-3-greek-ext-400-normal.woff") format("woff");unicode-range:U+1F00-1FFF}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-greek-400-normal.woff2") format("woff2"),url("./source-sans-3-greek-400-normal.woff") format("woff");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-vietnamese-400-normal.woff2") format("woff2"),url("./source-sans-3-vietnamese-400-normal.woff") format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-latin-ext-400-normal.woff2") format("woff2"),url("./source-sans-3-latin-ext-400-normal.woff") format("woff");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-latin-400-normal.woff2") format("woff2"),url("./source-sans-3-latin-400-normal.woff") format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} @font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-cyrillic-ext-400-normal.woff2") format("woff2"),url("./source-sans-3-cyrillic-ext-400-normal.woff") format("woff");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-cyrillic-400-normal.woff2") format("woff2"),url("./source-sans-3-cyrillic-400-normal.woff") format("woff");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-greek-ext-400-normal.woff2") format("woff2"),url("./source-sans-3-greek-ext-400-normal.woff") format("woff");unicode-range:U+1F00-1FFF}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-greek-400-normal.woff2") format("woff2"),url("./source-sans-3-greek-400-normal.woff") format("woff");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-vietnamese-400-normal.woff2") format("woff2"),url("./source-sans-3-vietnamese-400-normal.woff") format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-latin-ext-400-normal.woff2") format("woff2"),url("./source-sans-3-latin-ext-400-normal.woff") format("woff");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url("./source-sans-3-latin-400-normal.woff2") format("woff2"),url("./source-sans-3-latin-400-normal.woff") format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
/*# sourceMappingURL=main.css.map */

File diff suppressed because one or more lines are too long

View File

@ -39,62 +39,68 @@ export const syncHandler: WebSocketHandler<WSData> = {
} }
}, },
async message(ws, raw) { async message(ws, raw) {
const conn_id = wconns.get(ws); try {
if (conn_id) { const conn_id = wconns.get(ws);
const conn = conns.get(conn_id); if (conn_id) {
if (conn) { const conn = conns.get(conn_id);
const msg = packr.unpack(Buffer.from(raw)); if (conn) {
if (msg.type === "preview") { const msg = packr.unpack(Buffer.from(raw));
previewLiveReload(ws, msg); if (msg.type === "preview") {
} previewLiveReload(ws, msg);
if (msg.type === SyncType.UserID) {
const { user_id, page_id, site_id } = msg;
conn.user_id = user_id;
conn.user = await _db.user.findFirst({ where: { id: user_id } });
let conf = await user.conf.getOrCreate(user_id);
if (site_id) {
const newconf = await loadSitePage(user_id, site_id, page_id);
if (newconf) conf = newconf;
} else if (!conf.site_id) {
await loadDefaultSite(user_id);
} }
conn.conf = new Proxy(conf, { if (msg.type === SyncType.UserID) {
get(_, p) { const { user_id, page_id, site_id } = msg;
const conf = user.conf.get(user_id); conn.user_id = user_id;
if (p === "toJSON") return () => conf;
if (conf) return conf[p as keyof typeof conf]; conn.user = await _db.user.findFirst({ where: { id: user_id } });
}, let conf = await user.conf.getOrCreate(user_id);
set(_, p, newValue) { if (site_id) {
user.conf.set(user_id, p as keyof UserConf, newValue); const newconf = await loadSitePage(user_id, site_id, page_id);
return true; if (newconf) conf = newconf;
}, } else if (!conf.site_id) {
}) as UserConf & { toJSON: () => UserConf }; await loadDefaultSite(user_id);
sendWS(ws, {
type: SyncType.Event,
event: "editor_start" as ClientEvent,
data: conn.conf.toJSON(),
});
}
if (msg.type === SyncType.Action) {
const code = msg.code as keyof typeof SyncActionPaths;
const actionName = SyncActionPaths[code].replace(/\./gi, "_");
if (actionName) {
const baseAction = (actions as any)[actionName];
if (!baseAction) {
console.log(`app/srv/ws/sync/actions/${actionName}.ts not found`);
} }
if (baseAction) { conn.conf = new Proxy(conf, {
const action = baseAction.bind(conn); get(_, p) {
sendWS(ws, { const conf = user.conf.get(user_id);
type: SyncType.ActionResult, if (p === "toJSON") return () => conf;
argid: msg.argid, if (conf) return conf[p as keyof typeof conf];
val: await action(...msg.args), },
}); set(_, p, newValue) {
user.conf.set(user_id, p as keyof UserConf, newValue);
return true;
},
}) as UserConf & { toJSON: () => UserConf };
sendWS(ws, {
type: SyncType.Event,
event: "editor_start" as ClientEvent,
data: conn.conf.toJSON(),
});
}
if (msg.type === SyncType.Action) {
const code = msg.code as keyof typeof SyncActionPaths;
const actionName = SyncActionPaths[code].replace(/\./gi, "_");
if (actionName) {
const baseAction = (actions as any)[actionName];
if (!baseAction) {
console.log(
`app/srv/ws/sync/actions/${actionName}.ts not found`
);
}
if (baseAction) {
const action = baseAction.bind(conn);
sendWS(ws, {
type: SyncType.ActionResult,
argid: msg.argid,
val: await action(...msg.args),
});
}
} }
} }
} }
} }
} catch (e) {
console.error(e);
} }
}, },
}; };

View File

@ -1,7 +1,7 @@
{ {
"name": "web", "name": "web",
"@parcel/bundler-default": { "@parcel/bundler-default": {
"minBundles": 1e7, "minBundles": 10000000,
"minBundleSize": 3000, "minBundleSize": 3000,
"maxParallelRequests": 20 "maxParallelRequests": 20
}, },

View File

@ -0,0 +1,2 @@
n ŚÔbÍît-˙~^ŠłśŮłb˛Ł2aąóbŃńá/G~@vďĆśíI? 4°8<EFBFBD>a<EFBFBD>7č.đšx'Ř_?nÖŘţsDôŢ~ҤΚˇ´8Ý=Čç\cŘgR´Đ˙ĺ®nÔk<EFBFBD>ŚT¨UK˘ęb«ŃnE<EFBFBD>ühvÚJbŘnDşŰŮ+ů%#·f×çO{b@ĐĹőĄÄŻâP
k 2«Ŕ95řS"šRyĄ#čîĂ»ˇ¬ůŘ<EFBFBD>7qśgŽPÁSWz˘Čś0Ä-Äóň}( D|/ř3Ú8G:z <EFBFBD>'Ë!SÖfaŮXŽ;đîkë ˘­UžČVŁžy¨ž[´ĺa®*ËĂř<EFBFBD> U<EFBFBD>pŹĆ÷(aoX:I ŽCUÖ<EFBFBD>LŮŔg+U>eAhXasÓáéc8¸®4±qŽ|2<EFBFBD>aV˘Ö yňękz,G6ž«HĽ¦8^?k!Śął °˙ş<EFBFBD>+»¨­öř÷*ŁH6v<EFBFBD>áŰöčůáj$ Ďâ(ÇŇ<EFBFBD>âÄ9

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More