@vite-hub/comments 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -31
- package/dist/anchor.d.ts +7 -4
- package/dist/anchor.js +10 -5
- package/dist/client-diagnostics-CcFpkbAk.js +40 -0
- package/dist/client.d.ts +78 -3
- package/dist/client.js +198 -13
- package/dist/{console-BIz9t2cO.d.ts → console-h4KlhIik.d.ts} +97 -8
- package/dist/context-BqIsmYP1.js +61 -0
- package/dist/database/postgres.d.ts +738 -347
- package/dist/database/postgres.js +28 -7
- package/dist/{database-Cb2xjC1V.d.ts → database-CA1aHKN7.d.ts} +675 -276
- package/dist/database.d.ts +6 -98
- package/dist/database.js +2 -3
- package/dist/define-43mMR39K.js +89 -0
- package/dist/define-B3TF9zzn.d.ts +204 -0
- package/dist/errors-4gelGVmK.js +57 -0
- package/dist/errors-C6qptPoG.js +135 -0
- package/dist/errors-CyQyKAvy.d.ts +185 -0
- package/dist/fold-name-B7Zb3-MF.js +7 -0
- package/dist/{identity-3qtVC4rF.js → identity-CBOzgxSf.js} +7 -2
- package/dist/index-DNhy69Wt.d.ts +83 -0
- package/dist/index.d.ts +7 -7
- package/dist/index.js +196 -5
- package/dist/install-BcMPgPk_.js +1154 -0
- package/dist/install-W9ghhGoh.d.ts +36 -0
- package/dist/installed-B-PfERBU.js +30 -0
- package/dist/invariant-D8_xBqmZ.js +22 -0
- package/dist/migrate-B0k_0swk.d.ts +54 -0
- package/dist/migrate-BDQ8xqUs.js +289 -0
- package/dist/object-Da1zyPCR.js +11 -0
- package/dist/{operations-0B0QTVWX.d.ts → operations-D4A1Fcgf.d.ts} +37 -15
- package/dist/operations-DMMIfYPW.js +1159 -0
- package/dist/operations-GLeOqgMt.d.ts +257 -0
- package/dist/operations.d.ts +3 -7
- package/dist/operations.js +3 -2
- package/dist/overlay/client-DmsSMOzi.js +4 -0
- package/dist/overlay/dist-BoHMOFax.js +14 -0
- package/dist/overlay/dist-yIZmvSaU.js +1 -0
- package/dist/overlay/overlay.js +183 -177
- package/dist/page/loader.js +138 -18
- package/dist/{page-BuroSMXO.js → page-B41ozN63.js} +8 -6
- package/dist/{page-BtXADR6d.d.ts → page-DtbMOEMd.d.ts} +6 -5
- package/dist/page-tools-shared-NHUjKI8E.js +117 -0
- package/dist/path--zk6PEMz.js +18 -0
- package/dist/plugin-PS8PMYus.js +74 -0
- package/dist/realtime.d.ts +6 -12
- package/dist/realtime.js +23 -24
- package/dist/rpc-HBcWtg0T.d.ts +17 -0
- package/dist/rpc-RKPAusHp.js +153 -0
- package/dist/rpc.d.ts +2 -29
- package/dist/rpc.js +2 -75
- package/dist/runtime/auth.d.ts +5 -3
- package/dist/runtime/auth.js +8 -5
- package/dist/runtime/console.d.ts +1 -1
- package/dist/runtime/console.js +26 -21
- package/dist/runtime/index.d.ts +108 -60
- package/dist/runtime/index.js +684 -236
- package/dist/{server-BomGg3Gb.js → server-D8k-0GXe.js} +16 -7
- package/dist/server.d.ts +14 -88
- package/dist/server.js +7 -326
- package/dist/service-CFVm23k7.d.ts +158 -0
- package/dist/service-GHhhyQj4.js +609 -0
- package/dist/session-DVx-1Tym.d.ts +14 -0
- package/dist/session-EkudzUmm.js +503 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +14 -2
- package/dist/tokens-DSbwkVSy.js +58 -0
- package/dist/types-BIS0hCEl.d.ts +124 -0
- package/dist/types-CZujrMFd.d.ts +322 -0
- package/dist/vite.d.ts +91 -87
- package/dist/vite.js +535 -796
- package/package.json +24 -27
- package/dist/database-BSnVrwHn.js +0 -60
- package/dist/database-C-ktS9Do.js +0 -95
- package/dist/define-BzW2Ychn.d.ts +0 -46
- package/dist/define-Cbhl6QVJ.js +0 -32
- package/dist/errors-BAQYcy3_.d.ts +0 -89
- package/dist/errors-DeD6wTCl.js +0 -77
- package/dist/h3-v1-request-DDGXJ9E7.js +0 -166
- package/dist/index-DklG2Etf.d.ts +0 -111
- package/dist/operations-NZG5dB8y.js +0 -732
- package/dist/page-tools-shared-D-amu6sx.js +0 -53
- package/dist/plugin-QElKQYkA.js +0 -725
- package/dist/request-DVc3M_AG.js +0 -14
- package/dist/src-CRTwnaEG.js +0 -1362
- package/dist/types-Cj8K7Vx7.d.ts +0 -176
- package/dist/types-Un2dcJWD.d.ts +0 -288
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
//#region ../internal/src/runtime/page-tools-shared.ts
|
|
2
|
-
/**
|
|
3
|
-
* The names and the session answer that the page tools server and the browser loader share. It has no DOM and no Node
|
|
4
|
-
* code, so both sides import it.
|
|
5
|
-
*/
|
|
6
|
-
/** The query that turns the page tools on for a page. `?vitehub=<tool id>` also opens that tool. */
|
|
7
|
-
const viteHubPageToolsQuery = "vitehub";
|
|
8
|
-
/** The cookie that keeps the page tools on, on the next pages. It is a hint, never a credential. */
|
|
9
|
-
const viteHubPageToolsCookie = "vitehub-tools";
|
|
10
|
-
/**
|
|
11
|
-
* The URL prefix of the built page tools scripts, such as the loader. It is not `/_vitehub/page`: Nitro answers 404 for
|
|
12
|
-
* any path under a public asset prefix that has no file, and gives the whole prefix the asset cache headers.
|
|
13
|
-
*/
|
|
14
|
-
const viteHubPageToolsAssets = "/_vitehub/page/assets";
|
|
15
|
-
/** The route of the visitor check. */
|
|
16
|
-
const viteHubPageSessionPath = "/_vitehub/page/session";
|
|
17
|
-
/**
|
|
18
|
-
* The URL of the loader script, below the app base. Its version query changes when the loader changes, so caches keep
|
|
19
|
-
* it 5 minutes.
|
|
20
|
-
*/
|
|
21
|
-
const viteHubPageToolsLoader = "/_vitehub/page/assets/loader.js?v=8";
|
|
22
|
-
/** The attribute of the script that loads the page tools. A page that has it does not get a second one. */
|
|
23
|
-
const viteHubPageToolsMarker = "data-vitehub-page-tools";
|
|
24
|
-
/** The generated SPA check's opening tag, so the server can recognize it when replacing the check. */
|
|
25
|
-
const viteHubPageToolsInlineStart = `<script type="module" ${viteHubPageToolsMarker}>`;
|
|
26
|
-
/** The exact generated SPA hint check, shared with the server's replacement check. */
|
|
27
|
-
function viteHubPageToolsInlineScript(base) {
|
|
28
|
-
const hint = `new URLSearchParams(location.search).has(${JSON.stringify(viteHubPageToolsQuery)})||document.cookie.split("; ").includes(${JSON.stringify(`${viteHubPageToolsCookie}=1`)})`;
|
|
29
|
-
return `${viteHubPageToolsInlineStart}if(${hint})import(${JSON.stringify(`${viteHubBasePath(base)}${viteHubPageToolsLoader}`)})<\/script>`;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* The path of an app base, without the trailing slash: `/portal/` and `https://cdn.example/portal/` give `/portal`.
|
|
33
|
-
* The root and relative bases (`""`, `"./"`) give `""`. The Console mounts its routes with the same rule.
|
|
34
|
-
*/
|
|
35
|
-
function viteHubBasePath(base) {
|
|
36
|
-
if (!base || base === "./") return "";
|
|
37
|
-
let pathname = base;
|
|
38
|
-
if (/^https?:\/\//.test(pathname)) try {
|
|
39
|
-
pathname = new URL(pathname).pathname;
|
|
40
|
-
} catch {
|
|
41
|
-
return "";
|
|
42
|
-
}
|
|
43
|
-
if (!pathname.startsWith("/") || pathname.startsWith("//")) return "";
|
|
44
|
-
return pathname.replace(/\/+$/, "");
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Adds the app base to a path, such as the `script` of a tool. Full URLs and protocol-relative URLs stay as they are.
|
|
48
|
-
*/
|
|
49
|
-
function withViteHubBase(base, path) {
|
|
50
|
-
return path.startsWith("/") && !path.startsWith("//") ? `${base}${path}` : path;
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
53
|
-
export { viteHubPageToolsInlineScript as a, viteHubPageToolsMarker as c, viteHubPageToolsCookie as i, viteHubPageToolsQuery as l, viteHubPageSessionPath as n, viteHubPageToolsInlineStart as o, viteHubPageToolsAssets as r, viteHubPageToolsLoader as s, viteHubBasePath as t, withViteHubBase as u };
|