@vitejs/devtools-vite 0.0.0-alpha.1 → 0.0.0-alpha.11
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/dist/{dirs-Z7VQHyIZ.js → dirs-K_XnRVOr.js} +1 -1
- package/dist/dirs.js +1 -1
- package/dist/index.d.ts +67 -28
- package/dist/index.js +137 -81
- package/dist/nitro.json +2 -2
- package/dist/public/200.html +1 -1
- package/dist/public/404.html +1 -1
- package/dist/public/_nuxt/17ealR8P.js +1 -0
- package/dist/public/_nuxt/2OALqkc2.js +1 -0
- package/dist/public/_nuxt/AuXMpmu_.js +1 -0
- package/dist/public/_nuxt/B-LCQpq9.js +2 -0
- package/dist/public/_nuxt/B-MkobAt.js +1 -0
- package/dist/public/_nuxt/BEtueeHN.js +1 -0
- package/dist/public/_nuxt/BFwdTbGt.js +1 -0
- package/dist/public/_nuxt/BQPGP7j8.js +1 -0
- package/dist/public/_nuxt/B_mZ82Ef.js +1 -0
- package/dist/public/_nuxt/Bs1eUuZt.js +1 -0
- package/dist/public/_nuxt/C2Zn9dj_.js +1 -0
- package/dist/public/_nuxt/CBa98m2O.js +33 -0
- package/dist/public/_nuxt/CIZ7KSXz.js +1 -0
- package/dist/public/_nuxt/CRsFizRX.js +1 -0
- package/dist/public/_nuxt/CbzAqNxs.js +1 -0
- package/dist/public/_nuxt/ChaI2u-J.js +1 -0
- package/dist/public/_nuxt/CmZYssbg.js +1 -0
- package/dist/public/_nuxt/Cnct9GAr.js +1 -0
- package/dist/public/_nuxt/Cq2KqeQT.js +1 -0
- package/dist/public/_nuxt/Cql2HFZJ.js +1 -0
- package/dist/public/_nuxt/D-ZnEyqr.js +1 -0
- package/dist/public/_nuxt/D2Zr4_9a.js +1 -0
- package/dist/public/_nuxt/{BQ-NBLhA.js → DL1ysgP5.js} +1 -1
- package/dist/public/_nuxt/DQtLZa7C.js +1 -0
- package/dist/public/_nuxt/DcamI1aQ.js +1 -0
- package/dist/public/_nuxt/DqBpHZ7Y.js +11 -0
- package/dist/public/_nuxt/HzvsUJ0F.js +1 -0
- package/dist/public/_nuxt/Jdu9jmuG.js +1 -0
- package/dist/public/_nuxt/{IrMnfQaU.js → LMGHh3hZ.js} +1 -1
- package/dist/public/_nuxt/{BdGMcGSQ.js → SO3ppn9m.js} +1 -1
- package/dist/public/_nuxt/X7aOo9pb.js +1 -0
- package/dist/public/_nuxt/_hSlj5r4.js +1 -0
- package/dist/public/_nuxt/builds/latest.json +1 -1
- package/dist/public/_nuxt/builds/meta/1a94e2d7-5f0c-42d1-b6c2-f70865b42be5.json +1 -0
- package/dist/public/_nuxt/diff.worker-DCsgdfuV.js +10 -0
- package/dist/public/_nuxt/entry.BkLl46Cr.css +1 -0
- package/dist/public/_nuxt/error-404.CCdr3eE4.css +1 -0
- package/dist/public/_nuxt/error-500.D-vBsHK_.css +1 -0
- package/dist/public/_nuxt/lxg2Cb0s.js +1 -0
- package/dist/public/_nuxt/mIZU4Om9.js +1 -0
- package/dist/public/_nuxt/qkzn-X0p.js +1 -0
- package/dist/public/_nuxt/vzoJapJG.js +1 -0
- package/dist/public/index.html +1 -1
- package/package.json +16 -16
- package/dist/public/_nuxt/B1Vd6rqS.js +0 -1
- package/dist/public/_nuxt/B2YLpys2.js +0 -1
- package/dist/public/_nuxt/B2fBtupD.js +0 -1
- package/dist/public/_nuxt/BBRXmiYk.js +0 -1
- package/dist/public/_nuxt/BL9XEsp7.js +0 -1
- package/dist/public/_nuxt/BO9hKuA-.js +0 -1
- package/dist/public/_nuxt/BcAccMwu.js +0 -1
- package/dist/public/_nuxt/BdSZoQls.js +0 -1
- package/dist/public/_nuxt/BjbaCuBE.js +0 -1
- package/dist/public/_nuxt/Bjr51Ks8.js +0 -1
- package/dist/public/_nuxt/BvuqupwD.js +0 -1
- package/dist/public/_nuxt/C2X_oPur.js +0 -1
- package/dist/public/_nuxt/C5J04JCq.js +0 -1
- package/dist/public/_nuxt/CQNn9qP2.js +0 -1
- package/dist/public/_nuxt/CS0-317H.js +0 -1
- package/dist/public/_nuxt/CciM0jEL.js +0 -1
- package/dist/public/_nuxt/CcwEApAr.js +0 -1
- package/dist/public/_nuxt/Ci9NHG69.js +0 -1
- package/dist/public/_nuxt/D1yk44lc.js +0 -1
- package/dist/public/_nuxt/DKn-LAPX.js +0 -11
- package/dist/public/_nuxt/DS2MKblJ.js +0 -1
- package/dist/public/_nuxt/DSjlpmm-.js +0 -1
- package/dist/public/_nuxt/DZeYNBxL.js +0 -1
- package/dist/public/_nuxt/D_Sk_I-u.js +0 -1
- package/dist/public/_nuxt/Dl8iHwQo.js +0 -2
- package/dist/public/_nuxt/Z5tyTJaP.js +0 -1
- package/dist/public/_nuxt/builds/meta/6f75d3aa-4cfc-4ed3-af3a-9078b8defb8f.json +0 -1
- package/dist/public/_nuxt/cRQbgMUp.js +0 -1
- package/dist/public/_nuxt/diff.worker-BXxwMoGc.js +0 -10
- package/dist/public/_nuxt/entry.Dufqy7qJ.css +0 -1
- package/dist/public/_nuxt/error-404.yUUAZDjV.css +0 -1
- package/dist/public/_nuxt/error-500.BHZzZRS-.css +0 -1
- package/dist/public/_nuxt/pXptjyzi.js +0 -1
- package/dist/public/_nuxt/rwBDQBzn.js +0 -1
- package/dist/public/_nuxt/tS5wJZMm.js +0 -1
- package/dist/public/_nuxt/yfNgynAH.js +0 -33
- package/dist/public/_nuxt/z9pSC1xM.js +0 -1
- /package/dist/public/_nuxt/{l47FwQA-.js → D03ETnho.js} +0 -0
package/dist/dirs.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,68 @@
|
|
|
1
1
|
import { Plugin, ResolvedConfig, ViteDevServer } from "vite";
|
|
2
2
|
|
|
3
|
-
//#region ../
|
|
3
|
+
//#region ../kit/src/types/rpc-augments.d.ts
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* To be extended
|
|
7
7
|
*/
|
|
8
8
|
interface DevToolsRpcServerFunctions {}
|
|
9
9
|
//#endregion
|
|
10
|
-
//#region ../
|
|
10
|
+
//#region ../kit/src/types/utils.d.ts
|
|
11
11
|
type Thenable<T> = T | Promise<T>;
|
|
12
12
|
//#endregion
|
|
13
|
-
//#region ../
|
|
13
|
+
//#region ../kit/src/types/views.d.ts
|
|
14
14
|
interface DevToolsDockHost {
|
|
15
|
+
views: Map<string, DevToolsDockEntry>;
|
|
15
16
|
register: (entry: DevToolsDockEntry) => void;
|
|
17
|
+
update: (entry: DevToolsDockEntry) => void;
|
|
16
18
|
values: () => DevToolsDockEntry[];
|
|
17
19
|
}
|
|
20
|
+
interface DevToolsViewHost {
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
buildStaticDirs: {
|
|
25
|
+
baseUrl: string;
|
|
26
|
+
distDir: string;
|
|
27
|
+
}[];
|
|
28
|
+
/**
|
|
29
|
+
* Helper to host static files
|
|
30
|
+
* - In `dev` mode, it will register middleware to `viteServer.middlewares` to host the static files
|
|
31
|
+
* - In `build` mode, it will copy the static files to the dist directory
|
|
32
|
+
*/
|
|
33
|
+
hostStatic: (baseUrl: string, distDir: string) => void;
|
|
34
|
+
}
|
|
35
|
+
type DevToolsDockEntryCategory = 'app' | 'framework' | 'web' | 'advanced' | 'default';
|
|
18
36
|
interface DevToolsDockEntryBase {
|
|
19
37
|
id: string;
|
|
20
38
|
title: string;
|
|
21
|
-
icon: string
|
|
39
|
+
icon: string | {
|
|
40
|
+
light: string;
|
|
41
|
+
dark: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The default order of the entry in the dock.
|
|
45
|
+
* The higher the number the earlier it appears.
|
|
46
|
+
* @default 0
|
|
47
|
+
*/
|
|
48
|
+
defaultOrder?: number;
|
|
49
|
+
/**
|
|
50
|
+
* The category of the entry
|
|
51
|
+
* @default 'default'
|
|
52
|
+
*/
|
|
53
|
+
category?: DevToolsDockEntryCategory;
|
|
54
|
+
}
|
|
55
|
+
interface ClientScriptEntry {
|
|
56
|
+
/**
|
|
57
|
+
* The filepath or module name to import from
|
|
58
|
+
*/
|
|
59
|
+
importFrom: string;
|
|
60
|
+
/**
|
|
61
|
+
* The name to import the module as
|
|
62
|
+
*
|
|
63
|
+
* @default 'default'
|
|
64
|
+
*/
|
|
65
|
+
importName?: string;
|
|
22
66
|
}
|
|
23
67
|
interface DevToolsViewIframe extends DevToolsDockEntryBase {
|
|
24
68
|
type: 'iframe';
|
|
@@ -29,23 +73,22 @@ interface DevToolsViewIframe extends DevToolsDockEntryBase {
|
|
|
29
73
|
* When not provided, it would be treated as a unique frame.
|
|
30
74
|
*/
|
|
31
75
|
frameId?: string;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
import: string;
|
|
76
|
+
/**
|
|
77
|
+
* Optional client script to import into the iframe
|
|
78
|
+
*/
|
|
79
|
+
clientScript?: ClientScriptEntry;
|
|
37
80
|
}
|
|
38
81
|
interface DevToolsViewAction extends DevToolsDockEntryBase {
|
|
39
82
|
type: 'action';
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @default 'default'
|
|
43
|
-
*/
|
|
44
|
-
importName?: string;
|
|
83
|
+
action: ClientScriptEntry;
|
|
45
84
|
}
|
|
46
|
-
|
|
85
|
+
interface DevToolsViewCustomRender extends DevToolsDockEntryBase {
|
|
86
|
+
type: 'custom-render';
|
|
87
|
+
renderer: ClientScriptEntry;
|
|
88
|
+
}
|
|
89
|
+
type DevToolsDockEntry = DevToolsViewIframe | DevToolsViewAction | DevToolsViewCustomRender;
|
|
47
90
|
//#endregion
|
|
48
|
-
//#region ../
|
|
91
|
+
//#region ../kit/src/types/vite-plugin.d.ts
|
|
49
92
|
interface DevToolsCapabilities {
|
|
50
93
|
rpc?: boolean;
|
|
51
94
|
views?: boolean;
|
|
@@ -64,19 +107,14 @@ interface DevToolsNodeContext {
|
|
|
64
107
|
readonly viteServer?: ViteDevServer;
|
|
65
108
|
rpc: RpcFunctionsHost;
|
|
66
109
|
docks: DevToolsDockHost;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
hostStatic: (baseUrl: string, distDir: string) => void;
|
|
73
|
-
staticDirs: {
|
|
74
|
-
baseUrl: string;
|
|
75
|
-
distDir: string;
|
|
76
|
-
}[];
|
|
110
|
+
views: DevToolsViewHost;
|
|
111
|
+
utils: DevToolsNodeUtils;
|
|
112
|
+
}
|
|
113
|
+
interface DevToolsNodeUtils {
|
|
114
|
+
clientEntryFromSimpleFunction: (fn: () => void) => ClientScriptEntry;
|
|
77
115
|
}
|
|
78
116
|
//#endregion
|
|
79
|
-
//#region ../
|
|
117
|
+
//#region ../kit/src/types/rpc.d.ts
|
|
80
118
|
/**
|
|
81
119
|
* Type of the RPC function,
|
|
82
120
|
* - static: A function that returns a static data (can be cached and dumped)
|
|
@@ -89,6 +127,7 @@ interface RpcFunctionsHost {
|
|
|
89
127
|
readonly functions: DevToolsRpcServerFunctions;
|
|
90
128
|
readonly definitions: Map<string, RpcFunctionDefinition<string, any, any, any>>;
|
|
91
129
|
register: (fn: RpcFunctionDefinition<string, any, any, any>) => void;
|
|
130
|
+
update: (fn: RpcFunctionDefinition<string, any, any, any>) => void;
|
|
92
131
|
}
|
|
93
132
|
interface RpcFunctionSetupResult<ARGS extends any[], RETURN = void> {
|
|
94
133
|
handler: (...args: ARGS) => RETURN;
|
|
@@ -102,7 +141,7 @@ interface RpcFunctionDefinition<NAME extends string, TYPE extends RpcFunctionTyp
|
|
|
102
141
|
__promise?: Thenable<RpcFunctionSetupResult<ARGS, RETURN>>;
|
|
103
142
|
}
|
|
104
143
|
//#endregion
|
|
105
|
-
//#region ../
|
|
144
|
+
//#region ../kit/src/types/vite-augment.d.ts
|
|
106
145
|
declare module 'vite' {
|
|
107
146
|
interface Plugin {
|
|
108
147
|
devtools?: DevToolsPluginOptions;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { clientPublicDir } from "./dirs-
|
|
1
|
+
import { t as clientPublicDir } from "./dirs-K_XnRVOr.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { defineRpcFunction } from "@vitejs/devtools-kit";
|
|
4
4
|
import fs, { existsSync } from "node:fs";
|
|
@@ -785,6 +785,29 @@ async function parseJsonStreamWithConcatArrays(stream, processor) {
|
|
|
785
785
|
return values$1;
|
|
786
786
|
}
|
|
787
787
|
|
|
788
|
+
//#endregion
|
|
789
|
+
//#region src/node/utils/chunk.ts
|
|
790
|
+
function getInitialChunkIds(chunks) {
|
|
791
|
+
const chunkMap = new Map(chunks.map((chunk) => [chunk.chunk_id, chunk]));
|
|
792
|
+
const entryChunkIds = chunks.filter((chunk) => !!chunk.is_user_defined_entry).map((chunk) => chunk.chunk_id);
|
|
793
|
+
const visited = /* @__PURE__ */ new Set();
|
|
794
|
+
const initialChunkIds = new Set(entryChunkIds);
|
|
795
|
+
const queue = [...entryChunkIds];
|
|
796
|
+
while (queue.length > 0) {
|
|
797
|
+
const chunkId = queue.shift();
|
|
798
|
+
if (visited.has(chunkId)) continue;
|
|
799
|
+
visited.add(chunkId);
|
|
800
|
+
const chunk = chunkMap.get(chunkId);
|
|
801
|
+
if (chunk?.imports) {
|
|
802
|
+
for (const _import of chunk.imports) if (!initialChunkIds.has(_import.chunk_id)) {
|
|
803
|
+
initialChunkIds.add(_import.chunk_id);
|
|
804
|
+
queue.push(_import.chunk_id);
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
return initialChunkIds;
|
|
809
|
+
}
|
|
810
|
+
|
|
788
811
|
//#endregion
|
|
789
812
|
//#region src/node/utils/format.ts
|
|
790
813
|
function getContentByteSize(content) {
|
|
@@ -913,7 +936,11 @@ var RolldownEventsManager = class {
|
|
|
913
936
|
return;
|
|
914
937
|
}
|
|
915
938
|
if (event.action === "ChunkGraphReady") {
|
|
916
|
-
|
|
939
|
+
const initialChunkIds = getInitialChunkIds(event.chunks);
|
|
940
|
+
for (const chunk of event.chunks) this.chunks.set(chunk.chunk_id, {
|
|
941
|
+
...chunk,
|
|
942
|
+
is_initial: initialChunkIds.has(chunk.chunk_id)
|
|
943
|
+
});
|
|
917
944
|
return;
|
|
918
945
|
}
|
|
919
946
|
this.interpretSourceRefs(event, "content");
|
|
@@ -974,8 +1001,7 @@ var RolldownEventsReader = class RolldownEventsReader {
|
|
|
974
1001
|
async read() {
|
|
975
1002
|
const { mtime, size } = await fs.promises.stat(this.filepath);
|
|
976
1003
|
if (mtime.getTime() <= this.lastTimestamp) return;
|
|
977
|
-
|
|
978
|
-
await parseJsonStreamWithConcatArrays(stream, (event) => {
|
|
1004
|
+
await parseJsonStreamWithConcatArrays(fs.createReadStream(this.filepath, { start: this.lastBytes }), (event) => {
|
|
979
1005
|
this.manager.handleEvent(event);
|
|
980
1006
|
return event;
|
|
981
1007
|
});
|
|
@@ -998,8 +1024,9 @@ var RolldownLogsManager = class {
|
|
|
998
1024
|
this.dir = dir;
|
|
999
1025
|
}
|
|
1000
1026
|
async list() {
|
|
1027
|
+
if (!existsSync(this.dir)) return [];
|
|
1001
1028
|
const sessions = await fs$1.readdir(this.dir, { withFileTypes: true });
|
|
1002
|
-
return await Promise.all(sessions.filter((d) => d.isDirectory()).map(async (d) => {
|
|
1029
|
+
return await Promise.all(sessions.filter((d) => d.isDirectory()).filter((d) => existsSync(join(this.dir, d.name, "meta.json"))).map(async (d) => {
|
|
1003
1030
|
const reader = RolldownEventsReader.get(join(this.dir, d.name, "meta.json"));
|
|
1004
1031
|
await reader.read();
|
|
1005
1032
|
const meta = reader.manager.events[reader.manager.events.length - 1];
|
|
@@ -1028,9 +1055,10 @@ const weakMap = /* @__PURE__ */ new WeakMap();
|
|
|
1028
1055
|
function getLogsManager(context) {
|
|
1029
1056
|
let manager = weakMap.get(context);
|
|
1030
1057
|
if (!manager) {
|
|
1031
|
-
const
|
|
1032
|
-
|
|
1033
|
-
|
|
1058
|
+
const dirs = [join(context.cwd, ".rolldown"), join(process.cwd(), ".rolldown")];
|
|
1059
|
+
const dir = dirs.find((dir$1) => existsSync(dir$1));
|
|
1060
|
+
if (!dir) console.warn("[Vite DevTools] Rolldown logs directory `.rolldown` not found, you might want to run build with `build.rolldownOptions.debug` enabled first.");
|
|
1061
|
+
manager = new RolldownLogsManager(dir ?? dirs[0]);
|
|
1034
1062
|
}
|
|
1035
1063
|
return manager;
|
|
1036
1064
|
}
|
|
@@ -1052,13 +1080,11 @@ const rolldownGetAssetDetails = defineRpcFunction({
|
|
|
1052
1080
|
if (asset.chunk_id === null) return { asset };
|
|
1053
1081
|
const assetChunkId = asset.chunk_id;
|
|
1054
1082
|
const chunk = chunks.get(assetChunkId);
|
|
1055
|
-
const importers = chunkList.filter((mod) => mod.imports.some((i) => i.chunk_id === assetChunkId)).map((c) => assetList.find((a) => a.chunk_id === c.chunk_id));
|
|
1056
|
-
const imports = chunk.imports.map((c) => assetList.find((a) => a.chunk_id === c.chunk_id));
|
|
1057
1083
|
return {
|
|
1058
1084
|
asset,
|
|
1059
1085
|
chunk,
|
|
1060
|
-
importers,
|
|
1061
|
-
imports
|
|
1086
|
+
importers: chunkList.filter((mod) => mod.imports.some((i) => i.chunk_id === assetChunkId)).map((c) => assetList.find((a) => a.chunk_id === c.chunk_id)),
|
|
1087
|
+
imports: chunk.imports.map((c) => assetList.find((a) => a.chunk_id === c.chunk_id))
|
|
1062
1088
|
};
|
|
1063
1089
|
} };
|
|
1064
1090
|
}
|
|
@@ -1078,6 +1104,21 @@ const rolldownGetAssetsList = defineRpcFunction({
|
|
|
1078
1104
|
}
|
|
1079
1105
|
});
|
|
1080
1106
|
|
|
1107
|
+
//#endregion
|
|
1108
|
+
//#region src/shared/utils/guess-chunk-name.ts
|
|
1109
|
+
function guessChunkName(chunk) {
|
|
1110
|
+
if (chunk.name) return chunk.name;
|
|
1111
|
+
if (chunk.modules.length === 1) return `[${simplifyModuleName(chunk.modules[0])}]`;
|
|
1112
|
+
if (chunk.modules.length > 1) return `[${simplifyModuleName(`${chunk.modules[0]}`)}_${chunk.modules.length}]`;
|
|
1113
|
+
return "[unnamed]";
|
|
1114
|
+
}
|
|
1115
|
+
function simplifyModuleName(module$1) {
|
|
1116
|
+
let parts = module$1.replace(/^.*(\.pnpm|node_modules|src|app|packages)\//gi, "").replace(/\b(index|main|dist|test|component|components)\b/gi, "").replace(/\/+/g, "/").replace(/\?.*$/, "").replace(/\.\w+$/, "").replace(/\W/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "").replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase().split("_").filter(Boolean);
|
|
1117
|
+
parts = Array.from(new Set(parts));
|
|
1118
|
+
if (parts.length > 5) parts = parts.slice(0, 5);
|
|
1119
|
+
return parts.join("_");
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1081
1122
|
//#endregion
|
|
1082
1123
|
//#region src/node/rpc/functions/rolldown-get-chunk-info.ts
|
|
1083
1124
|
const rolldownGetChunkInfo = defineRpcFunction({
|
|
@@ -1086,7 +1127,9 @@ const rolldownGetChunkInfo = defineRpcFunction({
|
|
|
1086
1127
|
setup: (context) => {
|
|
1087
1128
|
const manager = getLogsManager(context);
|
|
1088
1129
|
return { handler: async ({ session, id }) => {
|
|
1089
|
-
|
|
1130
|
+
const chunk = (await manager.loadSession(session)).manager.chunks.get(id);
|
|
1131
|
+
if (chunk && !chunk.name) chunk.name = guessChunkName(chunk);
|
|
1132
|
+
return chunk;
|
|
1090
1133
|
} };
|
|
1091
1134
|
}
|
|
1092
1135
|
});
|
|
@@ -1100,7 +1143,11 @@ const rolldownGetChunksGraph = defineRpcFunction({
|
|
|
1100
1143
|
const manager = getLogsManager(context);
|
|
1101
1144
|
return { handler: async ({ session }) => {
|
|
1102
1145
|
const reader = await manager.loadSession(session);
|
|
1103
|
-
|
|
1146
|
+
const chunks = Array.from(reader.manager.chunks.values());
|
|
1147
|
+
chunks.forEach((chunk) => {
|
|
1148
|
+
if (chunk && !chunk.name) chunk.name = guessChunkName(chunk);
|
|
1149
|
+
});
|
|
1150
|
+
return chunks;
|
|
1104
1151
|
} };
|
|
1105
1152
|
}
|
|
1106
1153
|
});
|
|
@@ -1209,13 +1256,65 @@ function getModuleNameFromPath(path) {
|
|
|
1209
1256
|
return match.split("/")[0];
|
|
1210
1257
|
}
|
|
1211
1258
|
function getPackageDirPath(path) {
|
|
1212
|
-
|
|
1213
|
-
const packageName = getModuleNameFromPath(path);
|
|
1214
|
-
return nodeModulesPrefix + packageName;
|
|
1259
|
+
return path.replace(/%2F/g, "/").replace(/\\/g, "/").match(/^(.+\/node_modules\/)/)?.[1] + getModuleNameFromPath(path);
|
|
1215
1260
|
}
|
|
1216
1261
|
|
|
1217
1262
|
//#endregion
|
|
1218
1263
|
//#region src/node/rpc/functions/rolldown-get-packages.ts
|
|
1264
|
+
async function getPackagesManifest(reader) {
|
|
1265
|
+
const modulesMap = reader.manager.modules;
|
|
1266
|
+
const chunks = Array.from(reader.manager.chunks.values());
|
|
1267
|
+
const packagesManifest = /* @__PURE__ */ new Map();
|
|
1268
|
+
const getImporters = (path, packageDir, visited = /* @__PURE__ */ new Set()) => {
|
|
1269
|
+
const importers = modulesMap.get(path)?.importers || [];
|
|
1270
|
+
const result = [];
|
|
1271
|
+
for (const importer of importers) {
|
|
1272
|
+
if (visited.has(importer)) continue;
|
|
1273
|
+
visited.add(importer);
|
|
1274
|
+
if ((modulesMap.get(importer)?.imports?.map((i) => i.module_id) || []).some((i) => getPackageDirPath(i) === packageDir)) result.push(importer);
|
|
1275
|
+
result.push(...getImporters(importer, packageDir, visited));
|
|
1276
|
+
}
|
|
1277
|
+
return result;
|
|
1278
|
+
};
|
|
1279
|
+
const packages = chunks.map((chunk) => chunk.modules.map((module$1) => module$1)).flat().filter(isNodeModulePath).map((p) => {
|
|
1280
|
+
const moduleBuildMetrics = modulesMap.get(p)?.build_metrics;
|
|
1281
|
+
return {
|
|
1282
|
+
path: p,
|
|
1283
|
+
dir: getPackageDirPath(p),
|
|
1284
|
+
transformedCodeSize: moduleBuildMetrics?.transforms[moduleBuildMetrics?.transforms.length - 1]?.transformed_code_size ?? 0
|
|
1285
|
+
};
|
|
1286
|
+
});
|
|
1287
|
+
await Promise.all(packages.map(async (p) => {
|
|
1288
|
+
const manifest = await readProjectManifestOnly(p.dir);
|
|
1289
|
+
const packageKey = `${manifest.name}@${manifest.version}`;
|
|
1290
|
+
const packageInfo = packagesManifest.get(packageKey);
|
|
1291
|
+
const importers = getImporters(p.path, p.dir).map((i) => ({
|
|
1292
|
+
path: i,
|
|
1293
|
+
version: ""
|
|
1294
|
+
}));
|
|
1295
|
+
if (packageInfo) packagesManifest.set(packageKey, {
|
|
1296
|
+
...packageInfo,
|
|
1297
|
+
files: [...packageInfo.files, {
|
|
1298
|
+
path: p.path,
|
|
1299
|
+
transformedCodeSize: p.transformedCodeSize,
|
|
1300
|
+
importers
|
|
1301
|
+
}],
|
|
1302
|
+
transformedCodeSize: packageInfo.transformedCodeSize + p.transformedCodeSize
|
|
1303
|
+
});
|
|
1304
|
+
else packagesManifest.set(packageKey, {
|
|
1305
|
+
name: manifest.name,
|
|
1306
|
+
version: manifest.version,
|
|
1307
|
+
dir: p.dir,
|
|
1308
|
+
files: [{
|
|
1309
|
+
path: p.path,
|
|
1310
|
+
transformedCodeSize: p.transformedCodeSize,
|
|
1311
|
+
importers
|
|
1312
|
+
}],
|
|
1313
|
+
transformedCodeSize: p.transformedCodeSize
|
|
1314
|
+
});
|
|
1315
|
+
}));
|
|
1316
|
+
return packagesManifest;
|
|
1317
|
+
}
|
|
1219
1318
|
const rolldownGetPackages = defineRpcFunction({
|
|
1220
1319
|
name: "vite:rolldown:get-packages",
|
|
1221
1320
|
type: "query",
|
|
@@ -1223,50 +1322,9 @@ const rolldownGetPackages = defineRpcFunction({
|
|
|
1223
1322
|
const manager = getLogsManager(context);
|
|
1224
1323
|
return { handler: async ({ session }) => {
|
|
1225
1324
|
const reader = await manager.loadSession(session);
|
|
1226
|
-
const chunks = Array.from(reader.manager.chunks.values());
|
|
1227
1325
|
const modulesMap = reader.manager.modules;
|
|
1228
1326
|
const duplicatePackagesMap = /* @__PURE__ */ new Map();
|
|
1229
|
-
const packagesManifest =
|
|
1230
|
-
const packages = chunks.map((chunk) => chunk.modules.map((module$1) => module$1)).flat().filter(isNodeModulePath).map((p) => {
|
|
1231
|
-
const moduleBuildMetrics = modulesMap.get(p)?.build_metrics;
|
|
1232
|
-
return {
|
|
1233
|
-
path: p,
|
|
1234
|
-
dir: getPackageDirPath(p),
|
|
1235
|
-
transformedCodeSize: moduleBuildMetrics?.transforms[moduleBuildMetrics?.transforms.length - 1]?.transformed_code_size ?? 0
|
|
1236
|
-
};
|
|
1237
|
-
});
|
|
1238
|
-
await Promise.all(packages.map(async (p) => {
|
|
1239
|
-
const manifest = await readProjectManifestOnly(p.dir);
|
|
1240
|
-
const packageKey = `${manifest.name}@${manifest.version}`;
|
|
1241
|
-
const packageInfo = packagesManifest.get(packageKey);
|
|
1242
|
-
const module$1 = modulesMap.get(p.path);
|
|
1243
|
-
if (packageInfo) packagesManifest.set(packageKey, {
|
|
1244
|
-
...packageInfo,
|
|
1245
|
-
files: [...packageInfo.files, {
|
|
1246
|
-
path: p.path,
|
|
1247
|
-
transformedCodeSize: p.transformedCodeSize,
|
|
1248
|
-
importers: module$1?.importers?.map((i) => ({
|
|
1249
|
-
path: i,
|
|
1250
|
-
version: ""
|
|
1251
|
-
})) ?? []
|
|
1252
|
-
}],
|
|
1253
|
-
transformedCodeSize: packageInfo.transformedCodeSize + p.transformedCodeSize
|
|
1254
|
-
});
|
|
1255
|
-
else packagesManifest.set(packageKey, {
|
|
1256
|
-
name: manifest.name,
|
|
1257
|
-
version: manifest.version,
|
|
1258
|
-
dir: p.dir,
|
|
1259
|
-
files: [{
|
|
1260
|
-
path: p.path,
|
|
1261
|
-
transformedCodeSize: p.transformedCodeSize,
|
|
1262
|
-
importers: module$1?.importers?.map((i) => ({
|
|
1263
|
-
path: i,
|
|
1264
|
-
version: ""
|
|
1265
|
-
})) ?? []
|
|
1266
|
-
}],
|
|
1267
|
-
transformedCodeSize: p.transformedCodeSize
|
|
1268
|
-
});
|
|
1269
|
-
}));
|
|
1327
|
+
const packagesManifest = await getPackagesManifest(reader);
|
|
1270
1328
|
return (await Promise.all(Array.from(packagesManifest.values()).map((p) => {
|
|
1271
1329
|
duplicatePackagesMap.set(p.name, (duplicatePackagesMap.get(p.name) ?? 0) + 1);
|
|
1272
1330
|
return {
|
|
@@ -1299,6 +1357,19 @@ const rolldownGetPackages = defineRpcFunction({
|
|
|
1299
1357
|
}
|
|
1300
1358
|
});
|
|
1301
1359
|
|
|
1360
|
+
//#endregion
|
|
1361
|
+
//#region src/node/rpc/functions/rolldown-get-package-details.ts
|
|
1362
|
+
const rolldownGetPackageDetails = defineRpcFunction({
|
|
1363
|
+
name: "vite:rolldown:get-package-details",
|
|
1364
|
+
type: "query",
|
|
1365
|
+
setup: (context) => {
|
|
1366
|
+
const manager = getLogsManager(context);
|
|
1367
|
+
return { handler: async ({ session, id }) => {
|
|
1368
|
+
return (await getPackagesManifest(await manager.loadSession(session))).get(id);
|
|
1369
|
+
} };
|
|
1370
|
+
}
|
|
1371
|
+
});
|
|
1372
|
+
|
|
1302
1373
|
//#endregion
|
|
1303
1374
|
//#region src/node/rpc/functions/rolldown-get-plugin-details.ts
|
|
1304
1375
|
const rolldownGetPluginDetails = defineRpcFunction({
|
|
@@ -1356,23 +1427,7 @@ const rolldownGetSessionCompareSummary = defineRpcFunction({
|
|
|
1356
1427
|
const _reader = reader[index];
|
|
1357
1428
|
const assets = Array.from(_reader.manager.assets.values());
|
|
1358
1429
|
const chunks = Array.from(_reader.manager.chunks.values());
|
|
1359
|
-
|
|
1360
|
-
const initialChunkIds$1 = [];
|
|
1361
|
-
for (const chunkId of chunkIds) {
|
|
1362
|
-
if (visited.has(chunkId)) continue;
|
|
1363
|
-
visited.add(chunkId);
|
|
1364
|
-
const chunk = chunks.find((c) => c.chunk_id === chunkId);
|
|
1365
|
-
if (chunk?.imports) {
|
|
1366
|
-
const importChunkIds = chunk.imports.map((imp) => imp.chunk_id);
|
|
1367
|
-
initialChunkIds$1.push(...importChunkIds);
|
|
1368
|
-
const nestedImports = getInitialChunkIds(importChunkIds, visited);
|
|
1369
|
-
initialChunkIds$1.push(...nestedImports);
|
|
1370
|
-
}
|
|
1371
|
-
}
|
|
1372
|
-
return initialChunkIds$1;
|
|
1373
|
-
}
|
|
1374
|
-
const entryChunkIds = chunks.filter((chunk) => !!chunk.is_user_defined_entry).map((chunk) => chunk.chunk_id);
|
|
1375
|
-
const initialChunkIds = [...new Set([...entryChunkIds, ...getInitialChunkIds(entryChunkIds)])];
|
|
1430
|
+
const initialChunkIds = chunks.filter((chunk) => chunk.is_initial).map((chunk) => chunk.chunk_id);
|
|
1376
1431
|
return {
|
|
1377
1432
|
id: s,
|
|
1378
1433
|
meta: _reader.meta,
|
|
@@ -1436,24 +1491,25 @@ const rpcFunctions = [
|
|
|
1436
1491
|
rolldownGetPluginDetails,
|
|
1437
1492
|
rolldownGetSessionCompareSummary,
|
|
1438
1493
|
rolldownGetChunkInfo,
|
|
1439
|
-
rolldownGetPackages
|
|
1494
|
+
rolldownGetPackages,
|
|
1495
|
+
rolldownGetPackageDetails
|
|
1440
1496
|
];
|
|
1441
1497
|
|
|
1442
1498
|
//#endregion
|
|
1443
1499
|
//#region src/node/plugin.ts
|
|
1444
1500
|
function DevToolsViteUI() {
|
|
1445
1501
|
return {
|
|
1446
|
-
name: "vite:devtools",
|
|
1502
|
+
name: "vite:devtools:vite-ui",
|
|
1447
1503
|
devtools: { setup(ctx) {
|
|
1448
1504
|
console.log("Vite DevTools Vite plugin setup");
|
|
1449
1505
|
for (const fn of rpcFunctions) ctx.rpc.register(fn);
|
|
1450
|
-
ctx.hostStatic("/
|
|
1506
|
+
ctx.views.hostStatic("/.devtools-vite/", clientPublicDir);
|
|
1451
1507
|
ctx.docks.register({
|
|
1452
1508
|
id: "vite",
|
|
1453
1509
|
title: "Vite",
|
|
1454
|
-
icon: "
|
|
1510
|
+
icon: "builtin:vite-plus-core",
|
|
1455
1511
|
type: "iframe",
|
|
1456
|
-
url: "/
|
|
1512
|
+
url: "/.devtools-vite/"
|
|
1457
1513
|
});
|
|
1458
1514
|
} }
|
|
1459
1515
|
};
|
package/dist/nitro.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"date": "2025-
|
|
2
|
+
"date": "2025-11-05T08:47:13.312Z",
|
|
3
3
|
"preset": "static",
|
|
4
4
|
"framework": {
|
|
5
5
|
"name": "nuxt",
|
|
6
6
|
"version": "4.1.2"
|
|
7
7
|
},
|
|
8
8
|
"versions": {
|
|
9
|
-
"nitro": "2.12.
|
|
9
|
+
"nitro": "2.12.8"
|
|
10
10
|
},
|
|
11
11
|
"commands": {
|
|
12
12
|
"preview": "npx serve public"
|
package/dist/public/200.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" class="bg-dots"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><script type="importmap">{"imports":{"#entry":"/
|
|
1
|
+
<!DOCTYPE html><html lang="en" class="bg-dots"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><script type="importmap">{"imports":{"#entry":"/.devtools-vite/_nuxt/DqBpHZ7Y.js"}}</script><title>Vite DevTools</title><link rel="stylesheet" href="/.devtools-vite/_nuxt/entry.BkLl46Cr.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/.devtools-vite/_nuxt/DqBpHZ7Y.js"><link rel="prefetch" as="style" crossorigin href="/.devtools-vite/_nuxt/error-404.CCdr3eE4.css"><link rel="prefetch" as="script" crossorigin href="/.devtools-vite/_nuxt/D-ZnEyqr.js"><link rel="prefetch" as="script" crossorigin href="/.devtools-vite/_nuxt/Jdu9jmuG.js"><link rel="prefetch" as="style" crossorigin href="/.devtools-vite/_nuxt/error-500.D-vBsHK_.css"><link rel="prefetch" as="script" crossorigin href="/.devtools-vite/_nuxt/AuXMpmu_.js"><meta name="description" content="DevTools for Vite"><meta property="og:title" content="Vite DevTools"><meta property="og:description" content="DevTools for Vite"><link rel="icon" type="image/svg+xml" href="/favicon.svg"><script type="module" src="/.devtools-vite/_nuxt/DqBpHZ7Y.js" crossorigin></script><script id="unhead:payload" type="application/json">{"title":"Vite DevTools"}</script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1762332433245,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/.devtools-vite/",buildId:"1a94e2d7-5f0c-42d1-b6c2-f70865b42be5",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/public/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" class="bg-dots"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><script type="importmap">{"imports":{"#entry":"/
|
|
1
|
+
<!DOCTYPE html><html lang="en" class="bg-dots"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><script type="importmap">{"imports":{"#entry":"/.devtools-vite/_nuxt/DqBpHZ7Y.js"}}</script><title>Vite DevTools</title><link rel="stylesheet" href="/.devtools-vite/_nuxt/entry.BkLl46Cr.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/.devtools-vite/_nuxt/DqBpHZ7Y.js"><link rel="prefetch" as="style" crossorigin href="/.devtools-vite/_nuxt/error-404.CCdr3eE4.css"><link rel="prefetch" as="script" crossorigin href="/.devtools-vite/_nuxt/D-ZnEyqr.js"><link rel="prefetch" as="script" crossorigin href="/.devtools-vite/_nuxt/Jdu9jmuG.js"><link rel="prefetch" as="style" crossorigin href="/.devtools-vite/_nuxt/error-500.D-vBsHK_.css"><link rel="prefetch" as="script" crossorigin href="/.devtools-vite/_nuxt/AuXMpmu_.js"><meta name="description" content="DevTools for Vite"><meta property="og:title" content="Vite DevTools"><meta property="og:description" content="DevTools for Vite"><link rel="icon" type="image/svg+xml" href="/favicon.svg"><script type="module" src="/.devtools-vite/_nuxt/DqBpHZ7Y.js" crossorigin></script><script id="unhead:payload" type="application/json">{"title":"Vite DevTools"}</script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1762332433246,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/.devtools-vite/",buildId:"1a94e2d7-5f0c-42d1-b6c2-f70865b42be5",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Tt as e,in as t,it as n,kt as r,mt as i,st as a,ut as o}from"#entry";var s={flex:`~ gap5`,"w-full":``,border:`b base`,pb3:``},c={"font-mono":``},l={"font-mono":``},u=[`datetime`],d=i({__name:`SessionMeta`,props:{sessions:{}},setup(i){return(d,f)=>(e(),o(`div`,s,[(e(!0),o(n,null,r(i.sessions,n=>(e(),o(`div`,{key:n.id,"flex-1":``,border:`~ base rounded`,p4:``,grid:`~ cols-[max-content_140px_2fr] max-lg:cols-[max-content_80px_2fr] gap-2 items-center`},[f[0]||=a(`div`,{class:`i-ph-hash-duotone`},null,-1),a(`div`,null,t(n.title),1),a(`div`,c,[a(`span`,null,t(n.id),1)]),f[1]||=a(`div`,{class:`i-ph-clock-duotone`},null,-1),f[2]||=a(`div`,null,` Created At `,-1),a(`div`,l,[a(`time`,{datetime:n.createdAt.toISOString()},t(n.createdAt.toLocaleString()),9,u)])]))),128))]))}}),f=Object.assign(d,{__name:`CompareSessionMeta`});export{f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Tt as e,_t as t,mt as n,ot as r,tn as i,ut as a}from"#entry";import{r as o,s}from"./B_mZ82Ef.js";var c=[`title`],l=n({__name:`FileIcon`,props:{filename:{}},setup(t){let n=t,o=r(()=>s(n.filename));return(t,n)=>(e(),a(`div`,{"flex-none":``,"icon-catppuccin":``,title:o.value.description||o.value.name,class:i([o.value.icon])},null,10,c))}}),u=Object.assign(l,{__name:`DisplayFileIcon`}),d=n({name:`HighlightedPath`,props:{path:{type:String,required:!0},minimal:{type:Boolean,default:!1}},setup(e){return()=>{let n=e.path.split(/([?/&:=])/g),r=`path`,i=n.map(()=>[]),a=n.map(()=>[]),s=n.map(e=>t(`span`,{class:``},e)),c=new Set;return n.forEach((t,l)=>{if(t===`?`&&(r=`query`),r===`path`){if(t.match(/^\.+$/)||t===`/`?i[l]?.push(`op50`):(t===`node_modules`||t===`dist`||t===`lib`||t.match(/^\.\w/))&&i[l]?.push(`op60`),t===`node_modules`&&e.minimal)for(let e=0;e<l+2;e++)c.add(e);if(t===`.pnpm`&&(s[l]&&(s[l].children=`~`,i[l]?.push(`op25!`),i[l-1]?.push(`op25!`)),c.add(l+1),c.add(l+2),i[l+3]?.push(`op25!`),s[l+4]?.children===`node_modules`&&(c.add(l+3),c.add(l+4),i[l+5]?.push(`op25!`))),t===`:`&&(s[l-1]&&a[l-1]?.push(`color: ${o(n[l-1])}`),i[l]?.push(`op50`)),n[l-2]===`node_modules`&&!t.startsWith(`.`)){let e=`color: ${o(n[l])}`;a[l]?.push(e),t.startsWith(`@`)&&(a[l+1]?.push(e),a[l+2]?.push(e))}}r===`query`&&(t===`?`?i[l]?.push(`text-red-500 dark:text-red-400`):t===`&`&&i[l]?.push(`text-orange-500 dark:text-orange-400`),t===`=`?i[l]?.push(`text-orange-900 dark:text-orange-200 op50`):n[l+1]===`=`?i[l]?.push(`text-amber-900 dark:text-amber-200`):i[l]?.push(`text-orange-900 dark:text-orange-200`))}),s.forEach((e,t)=>{e.props&&(e.props.class=i[t]?.join(` `)??``,e.props.style=a[t]?.join(`;`)??``)}),Array.from(c).sort((e,t)=>t-e).forEach(e=>{s.splice(e,1)}),s}}});export{u as n,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,Tt as t,V as n,in as r,st as i,ut as a}from"#entry";var o={class:`antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide`},s={class:`max-w-520px text-center`},c=[`textContent`],l=[`textContent`],u=[`textContent`],d=e({__name:`error-500`,props:{appName:{type:String,default:`Nuxt`},statusCode:{type:Number,default:500},statusMessage:{type:String,default:`Internal server error`},description:{type:String,default:`This page is temporarily unavailable.`},refresh:{type:String,default:`Refresh this page`}},setup(e){let d=e;return n({title:`${d.statusCode} - ${d.statusMessage} | ${d.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:`*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }`}]}),(n,d)=>(t(),a(`div`,o,[i(`div`,s,[i(`h1`,{class:`font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]`,textContent:r(e.statusCode)},null,8,c),i(`h2`,{class:`font-semibold mb-2 sm:text-3xl text-2xl`,textContent:r(e.statusMessage)},null,8,l),i(`p`,{class:`mb-4 px-2 text-[#64748B] text-md`,textContent:r(e.description)},null,8,u)])]))}},[[`__scopeId`,`data-v-4936aca7`]]);export{d as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{At as e,Et as t,Gt as n,Ht as r,Mt as i,Nt as a,Ot as o,Pt as s,Tt as c,Ut as l,Vt as u,Yt as d,_t as f,bt as p,ct as m,en as h,gt as g,h as _,in as v,it as y,jt as b,kt as x,lt as S,mt as C,nn as w,pt as T,rn as ee,st as E,tn as D,tt as te,ut as O,xt as k}from"#entry";var ne={flex:`col gap-2`,"max-w-90vw":``,"min-w-30vw":``,border:`~ base rounded-xl`,"bg-glass":``},re={key:0},ie=[`title`],ae=[`checked`,`onChange`],oe={"text-sm":``},A=[`title`],se={key:0,op75:``,"i-ph-selection-slash-duotone":``},ce={key:1,op75:``,"i-ph-selection-plus-duotone":``},le=C({__name:`SearchPanel`,props:{rules:{},modelValue:{default:()=>({search:``,selected:null})},selectedContainerClass:{default:``}},emits:[`update:modelValue`],setup(t,{emit:n}){let i=t,a=_(i,`modelValue`,n);function o(e){let{modelValue:t}=i;return t?.selected?t.selected.includes(e.name):!0}function s(e){let{rules:t}=i;a?.value?.selected||(a.value.selected=t.map(e=>e.name)),a.value.selected.includes(e.name)?a.value.selected=a.value.selected.filter(t=>t!==e.name):a.value.selected.push(e.name),a?.value?.selected.length===i.rules.length&&(a.value.selected=null)}function l(){a?.value?.selected?.length===i.rules.length?a.value.selected=null:a?.value?.selected==null?a.value.selected=[]:a.value.selected=i.rules.map(e=>e.name).filter(e=>!a.value.selected?.includes(e))}function u(){a?.value?.selected?.length===0?a.value.selected=null:a.value.selected=[]}return(n,i)=>(c(),O(`div`,ne,[t.modelValue.search===!1?S(``,!0):(c(),O(`div`,re,[r(E(`input`,{"onUpdate:modelValue":i[0]||=e=>h(a).search=e,p2:``,px4:``,"w-full":``,style:{outline:`none`},placeholder:`Search`},null,512),[[te,h(a).search]])])),t.rules.length?(c(),O(`div`,{key:1,class:D(t.selectedContainerClass),flex:`~ gap-2 wrap`,p2:``,border:`t base`},[(c(!0),O(y,null,x(t.rules,e=>(c(),O(`label`,{key:e.name,border:`~ base rounded-md`,px2:``,py1:``,flex:`~ items-center gap-1`,"select-none":``,title:e.description,class:D(o(e)?`bg-active`:`grayscale op50`)},[E(`input`,{type:`checkbox`,mr1:``,checked:o(e),onChange:t=>s(e)},null,40,ae),E(`div`,{class:D(e.icon),"icon-catppuccin":``},null,2),E(`div`,oe,v(e.description||e.name),1)],10,ie))),128)),E(`button`,{"rounded-md":``,p1:``,flex:`~ items-center gap-1`,"select-none":``,hover:`bg-active`,title:`Reverse Selection`,onClick:l},[...i[1]||=[E(`div`,{op75:``,"i-ph-selection-background-duotone":``},null,-1)]]),E(`button`,{"rounded-md":``,p1:``,flex:`~ items-center gap-1`,"select-none":``,hover:`bg-active`,title:h(a).selected?.length===0?`Select All`:`Unselect All`,onClick:u},[h(a).selected?.length===0?(c(),O(`div`,se)):(c(),O(`div`,ce))],8,A)],2)):S(``,!0),e(n.$slots,`default`)]))}}),ue=Object.assign(le,{__name:`DataSearchPanel`});function de(){var e=window.navigator.userAgent,t=e.indexOf(`MSIE `);if(t>0)return parseInt(e.substring(t+5,e.indexOf(`.`,t)),10);if(e.indexOf(`Trident/`)>0){var n=e.indexOf(`rv:`);return parseInt(e.substring(n+3,e.indexOf(`.`,n)),10)}var r=e.indexOf(`Edge/`);return r>0?parseInt(e.substring(r+5,e.indexOf(`.`,r)),10):-1}var j;function M(){M.init||(M.init=!0,j=de()!==-1)}var N={name:`ResizeObserver`,props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:[`notify`],mounted(){M(),k(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});let e=document.createElement(`object`);this._resizeObject=e,e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`tabindex`,-1),e.onload=this.addResizeHandlers,e.type=`text/html`,j&&this.$el.appendChild(e),e.data=`about:blank`,j||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit(`notify`,{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener(`resize`,this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!j&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener(`resize`,this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}},fe=l(`data-v-b329ee4c`);o(`data-v-b329ee4c`);var pe={class:`resize-observer`,tabindex:`-1`};t(),N.render=fe((e,t,n,r,i,a)=>(c(),m(`div`,pe))),N.__scopeId=`data-v-b329ee4c`,N.__file=`src/components/ResizeObserver.vue`;function P(e){"@babel/helpers - typeof";return P=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},P(e)}function me(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function F(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function he(e,t,n){return t&&F(e.prototype,t),n&&F(e,n),e}function I(e){return L(e)||R(e)||ge(e)||_e()}function L(e){if(Array.isArray(e))return z(e)}function R(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function ge(e,t){if(e){if(typeof e==`string`)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z(e,t)}}function z(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _e(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ve(e){return typeof e==`function`?{callback:e}:e}function ye(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r,i,a,o=function(o){if(a=[...arguments].slice(1),!(r&&o===i)){var s=n.leading;typeof s==`function`&&(s=s(o,i)),(!r||o!==i)&&s&&e.apply(void 0,[o].concat(I(a))),i=o,clearTimeout(r),r=setTimeout(function(){e.apply(void 0,[o].concat(I(a))),r=0},t)}};return o._clear=function(){clearTimeout(r),r=null},o}function B(e,t){if(e===t)return!0;if(P(e)===`object`){for(var n in e)if(!B(e[n],t[n]))return!1;return!0}return!1}var be=function(){function e(t,n,r){me(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(n,r)}return he(e,[{key:`createObserver`,value:function(e,t){var n=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=ve(e),this.callback=function(e,t){n.options.callback(e,t),e&&n.options.once&&(n.frozen=!0,n.destroyObserver())},this.callback&&this.options.throttle){var r=(this.options.throttleOptions||{}).leading;this.callback=ye(this.callback,this.options.throttle,{leading:function(e){return r===`both`||r===`visible`&&e||r===`hidden`&&!e}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(e){var t=e[0];if(e.length>1){var r=e.find(function(e){return e.isIntersecting});r&&(t=r)}if(n.callback){var i=t.isIntersecting&&t.intersectionRatio>=n.threshold;if(i===n.oldResult)return;n.oldResult=i,n.callback(i,t)}},this.options.intersection),k(function(){n.observer&&n.observer.observe(n.el)})}}},{key:`destroyObserver`,value:function(){this.observer&&=(this.observer.disconnect(),null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:`threshold`,get:function(){return this.options.intersection&&typeof this.options.intersection.threshold==`number`?this.options.intersection.threshold:0}}]),e}();function V(e,t,n){var r=t.value;r&&(typeof IntersectionObserver>`u`?console.warn(`[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill`):e._vue_visibilityState=new be(e,r,n))}function xe(e,t,n){var r=t.value,i=t.oldValue;if(!B(r,i)){var a=e._vue_visibilityState;if(!r){H(e);return}a?a.createObserver(r,n):V(e,{value:r},n)}}function H(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var Se={beforeMount:V,updated:xe,unmounted:H};function Ce(e){return{all:e||=new Map,on:function(t,n){var r=e.get(t);r&&r.push(n)||e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit:function(t,n){(e.get(t)||[]).slice().map(function(e){e(n)}),(e.get(`*`)||[]).slice().map(function(e){e(t,n)})}}}var we={itemsLimit:1e3},Te=/(auto|scroll)/;function U(e,t){return e.parentNode===null?t:U(e.parentNode,t.concat([e]))}var W=function(e,t){return getComputedStyle(e,null).getPropertyValue(t)},Ee=function(e){return W(e,`overflow`)+W(e,`overflow-y`)+W(e,`overflow-x`)},De=function(e){return Te.test(Ee(e))};function G(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var t=U(e.parentNode,[]),n=0;n<t.length;n+=1)if(De(t[n]))return t[n];return document.scrollingElement||document.documentElement}}function K(e){"@babel/helpers - typeof";return K=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},K(e)}var q={items:{type:Array,required:!0},keyField:{type:String,default:`id`},direction:{type:String,default:`vertical`,validator:function(e){return[`vertical`,`horizontal`].includes(e)}},listTag:{type:String,default:`div`},itemTag:{type:String,default:`div`}};function J(){return this.items.length&&K(this.items[0])!==`object`}var Y=!1;if(typeof window<`u`){Y=!1;try{var Oe=Object.defineProperty({},`passive`,{get:function(){Y=!0}});window.addEventListener(`test`,null,Oe)}catch{}}var ke=0,X={name:`RecycleScroller`,components:{ResizeObserver:N},directives:{ObserveVisibility:Se},props:{...q,itemSize:{type:Number,default:null},gridItems:{type:Number,default:void 0},itemSecondarySize:{type:Number,default:void 0},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:`size`},typeField:{type:String,default:`type`},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1},updateInterval:{type:Number,default:0},skipHover:{type:Boolean,default:!1},listTag:{type:String,default:`div`},itemTag:{type:String,default:`div`},listClass:{type:[String,Object,Array],default:``},itemClass:{type:[String,Object,Array],default:``}},emits:[`resize`,`visible`,`hidden`,`update`,`scroll-start`,`scroll-end`],data(){return{pool:[],totalSize:0,ready:!1,hoverKey:null}},computed:{sizes(){if(this.itemSize===null){let e={"-1":{accumulator:0}},t=this.items,n=this.sizeField,r=this.minItemSize,i=1e4,a=0,o;for(let s=0,c=t.length;s<c;s++)o=t[s][n]||r,o<i&&(i=o),a+=o,e[s]={accumulator:a,size:o};return this.$_computedMinItemSize=i,e}return[]},simpleArray:J,itemIndexByKey(){let{keyField:e,items:t}=this,n={};for(let r=0,i=t.length;r<i;r++)n[t[r][e]]=r;return n}},watch:{items(){this.updateVisibleItems(!0)},pageMode(){this.applyPageMode(),this.updateVisibleItems(!1)},sizes:{handler(){this.updateVisibleItems(!1)},deep:!0},gridItems(){this.updateVisibleItems(!0)},itemSecondarySize(){this.updateVisibleItems(!0)}},created(){this.$_startIndex=0,this.$_endIndex=0,this.$_views=new Map,this.$_unusedViews=new Map,this.$_scrollDirty=!1,this.$_lastUpdateScrollPosition=0,this.prerender&&(this.$_prerender=!0,this.updateVisibleItems(!1)),this.gridItems&&!this.itemSize&&console.error(`[vue-recycle-scroller] You must provide an itemSize when using gridItems`)},mounted(){this.applyPageMode(),this.$nextTick(()=>{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){let e=this.$_lastUpdateScrollPosition;typeof e==`number`&&this.$nextTick(()=>{this.scrollToPosition(e)})},beforeUnmount(){this.removeListeners()},methods:{addView(e,t,r,i,a){let o=d({item:r,position:0,nr:n({id:ke++,index:t,used:!0,key:i,type:a})});return e.push(o),o},unuseView(e,t=!1){let n=this.$_unusedViews,r=e.nr.type,i=n.get(r);i||(i=[],n.set(r,i)),i.push(e),t||(e.nr.used=!1,e.position=-9999)},handleResize(){this.$emit(`resize`),this.ready&&this.updateVisibleItems(!1)},handleScroll(e){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;let e=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;let{continuous:e}=this.updateVisibleItems(!1,!0);e||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});e(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&e()},this.updateInterval))}},handleVisibilityChange(e,t){this.ready&&(e||t.boundingClientRect.width!==0||t.boundingClientRect.height!==0?(this.$emit(`visible`),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit(`hidden`))},updateVisibleItems(e,t=!1){let n=this.itemSize,r=this.gridItems||1,i=this.itemSecondarySize||n,a=this.$_computedMinItemSize,o=this.typeField,s=this.simpleArray?null:this.keyField,c=this.items,l=c.length,u=this.sizes,d=this.$_views,f=this.$_unusedViews,p=this.pool,m=this.itemIndexByKey,h,g,_,v,y;if(!l)h=g=v=y=_=0;else if(this.$_prerender)h=v=0,g=y=Math.min(this.prerender,c.length),_=null;else{let e=this.getScroll();if(t){let t=e.start-this.$_lastUpdateScrollPosition;if(t<0&&(t=-t),n===null&&t<a||t<n)return{continuous:!0}}this.$_lastUpdateScrollPosition=e.start;let i=this.buffer;e.start-=i,e.end+=i;let o=0;if(this.$refs.before&&(o=this.$refs.before.scrollHeight,e.start-=o),this.$refs.after){let t=this.$refs.after.scrollHeight;e.end+=t}if(n===null){let t,n=0,r=l-1,i=~~(l/2),a;do a=i,t=u[i].accumulator,t<e.start?n=i:i<l-1&&u[i+1].accumulator>e.start&&(r=i),i=~~((n+r)/2);while(i!==a);for(i<0&&(i=0),h=i,_=u[l-1].accumulator,g=i;g<l&&u[g].accumulator<e.end;g++);for(g===-1?g=c.length-1:(g++,g>l&&(g=l)),v=h;v<l&&o+u[v].accumulator<e.start;v++);for(y=v;y<l&&o+u[y].accumulator<e.end;y++);}else{h=~~(e.start/n*r);let t=h%r;h-=t,g=Math.ceil(e.end/n*r),v=Math.max(0,Math.floor((e.start-o)/n*r)),y=Math.floor((e.end-o)/n*r),h<0&&(h=0),g>l&&(g=l),v<0&&(v=0),y>l&&(y=l),_=Math.ceil(l/r)*n}}g-h>we.itemsLimit&&this.itemsLimitError(),this.totalSize=_;let b,x=h<=this.$_endIndex&&g>=this.$_startIndex;if(x)for(let t=0,n=p.length;t<n;t++)b=p[t],b.nr.used&&(e&&(b.nr.index=m[b.item[s]]),(b.nr.index==null||b.nr.index<h||b.nr.index>=g)&&this.unuseView(b));let S=x?null:new Map,C,w,T;for(let e=h;e<g;e++){C=c[e];let t=s?C[s]:C;if(t==null)throw Error(`Key is ${t} on item (keyField is '${s}')`);if(b=d.get(t),!n&&!u[e].size){b&&this.unuseView(b);continue}w=C[o];let a=f.get(w),l=!1;if(!b)x?b=a&&a.length?a.pop():this.addView(p,e,C,t,w):(T=S.get(w)||0,(!a||T>=a.length)&&(b=this.addView(p,e,C,t,w),this.unuseView(b,!0),a=f.get(w)),b=a[T],S.set(w,T+1)),d.delete(b.nr.key),b.nr.used=!0,b.nr.index=e,b.nr.key=t,b.nr.type=w,d.set(t,b),l=!0;else if(!b.nr.used&&(b.nr.used=!0,l=!0,a)){let e=a.indexOf(b);e!==-1&&a.splice(e,1)}b.item=C,l&&(e===c.length-1&&this.$emit(`scroll-end`),e===0&&this.$emit(`scroll-start`)),n===null?(b.position=u[e-1].accumulator,b.offset=0):(b.position=Math.floor(e/r)*n,b.offset=e%r*i)}return this.$_startIndex=h,this.$_endIndex=g,this.emitUpdate&&this.$emit(`update`,h,g,v,y),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:x}},getListenerTarget(){let e=G(this.$el);return window.document&&(e===window.document.documentElement||e===window.document.body)&&(e=window),e},getScroll(){let{$el:e,direction:t}=this,n=t===`vertical`,r;if(this.pageMode){let t=e.getBoundingClientRect(),i=n?t.height:t.width,a=-(n?t.top:t.left),o=n?window.innerHeight:window.innerWidth;a<0&&(o+=a,a=0),a+o>i&&(o=i-a),r={start:a,end:a+o}}else r=n?{start:e.scrollTop,end:e.scrollTop+e.clientHeight}:{start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return r},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener(`scroll`,this.handleScroll,Y?{passive:!0}:!1),this.listenerTarget.addEventListener(`resize`,this.handleResize)},removeListeners(){this.listenerTarget&&=(this.listenerTarget.removeEventListener(`scroll`,this.handleScroll),this.listenerTarget.removeEventListener(`resize`,this.handleResize),null)},scrollToItem(e){let t,n=this.gridItems||1;t=this.itemSize===null?e>0?this.sizes[e-1].accumulator:0:Math.floor(e/n)*this.itemSize,this.scrollToPosition(t)},scrollToPosition(e){let t=this.direction===`vertical`?{scroll:`scrollTop`,start:`top`}:{scroll:`scrollLeft`,start:`left`},n,r,i;if(this.pageMode){let a=G(this.$el),o=a.tagName===`HTML`?0:a[t.scroll],s=a.getBoundingClientRect(),c=this.$el.getBoundingClientRect()[t.start]-s[t.start];n=a,r=t.scroll,i=e+o+c}else n=this.$el,r=t.scroll,i=e;n[r]=i},itemsLimitError(){throw setTimeout(()=>{console.log(`It seems the scroller element isn't scrolling, so it tries to render all the items at once.`,`Scroller:`,this.$el),console.log(`Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.`)}),Error(`Rendered items limit reached`)},sortViews(){this.pool.sort((e,t)=>e.nr.index-t.nr.index)}}},Z={key:0,ref:`before`,class:`vue-recycle-scroller__slot`},Ae={key:1,ref:`after`,class:`vue-recycle-scroller__slot`};function je(t,n,o,l,d,f){let h=b(`ResizeObserver`),g=i(`observe-visibility`);return r((c(),O(`div`,{class:D([`vue-recycle-scroller`,{ready:d.ready,"page-mode":o.pageMode,[`direction-${t.direction}`]:!0}]),onScrollPassive:n[0]||=(...e)=>f.handleScroll&&f.handleScroll(...e)},[t.$slots.before?(c(),O(`div`,Z,[e(t.$slots,`before`)],512)):S(`v-if`,!0),(c(),m(a(o.listTag),{ref:`wrapper`,style:ee({[t.direction===`vertical`?`minHeight`:`minWidth`]:d.totalSize+`px`}),class:D([`vue-recycle-scroller__item-wrapper`,o.listClass])},{default:u(()=>[(c(!0),O(y,null,x(d.pool,n=>(c(),m(a(o.itemTag),p({key:n.nr.id,style:d.ready?{transform:`translate${t.direction===`vertical`?`Y`:`X`}(${n.position}px) translate${t.direction===`vertical`?`X`:`Y`}(${n.offset}px)`,width:o.gridItems?`${t.direction===`vertical`&&o.itemSecondarySize||o.itemSize}px`:void 0,height:o.gridItems?`${t.direction===`horizontal`&&o.itemSecondarySize||o.itemSize}px`:void 0}:null,class:[`vue-recycle-scroller__item-view`,[o.itemClass,{hover:!o.skipHover&&d.hoverKey===n.nr.key}]]},s(o.skipHover?{}:{mouseenter:()=>{d.hoverKey=n.nr.key},mouseleave:()=>{d.hoverKey=null}})),{default:u(()=>[e(t.$slots,`default`,{item:n.item,index:n.nr.index,active:n.nr.used})]),_:2},1040,[`style`,`class`]))),128)),e(t.$slots,`empty`)]),_:3},8,[`style`,`class`])),t.$slots.after?(c(),O(`div`,Ae,[e(t.$slots,`after`)],512)):S(`v-if`,!0),T(h,{onNotify:f.handleResize},null,8,[`onNotify`])],34)),[[g,f.handleVisibilityChange]])}X.render=je,X.__file=`src/components/RecycleScroller.vue`;var Q={name:`DynamicScroller`,components:{RecycleScroller:X},provide(){return typeof ResizeObserver<`u`&&(this.$_resizeObserver=new ResizeObserver(e=>{requestAnimationFrame(()=>{if(Array.isArray(e)){for(let t of e)if(t.target&&t.target.$_vs_onResize){let e,n;if(t.borderBoxSize){let r=t.borderBoxSize[0];e=r.inlineSize,n=r.blockSize}else e=t.contentRect.width,n=t.contentRect.height;t.target.$_vs_onResize(t.target.$_vs_id,e,n)}}})})),{vscrollData:this.vscrollData,vscrollParent:this,vscrollResizeObserver:this.$_resizeObserver}},inheritAttrs:!1,props:{...q,minItemSize:{type:[Number,String],required:!0}},emits:[`resize`,`visible`],data(){return{vscrollData:{active:!0,sizes:{},keyField:this.keyField,simpleArray:!1}}},computed:{simpleArray:J,itemsWithSize(){let e=[],{items:t,keyField:n,simpleArray:r}=this,i=this.vscrollData.sizes,a=t.length;for(let o=0;o<a;o++){let a=t[o],s=r?o:a[n],c=i[s];c===void 0&&!this.$_undefinedMap[s]&&(c=0),e.push({item:a,id:s,size:c})}return e}},watch:{items(){this.forceUpdate()},simpleArray:{handler(e){this.vscrollData.simpleArray=e},immediate:!0},direction(e){this.forceUpdate(!0)},itemsWithSize(e,t){let n=this.$el.scrollTop,r=0,i=0,a=Math.min(e.length,t.length);for(let o=0;o<a&&!(r>=n);o++)r+=t[o].size||this.minItemSize,i+=e[o].size||this.minItemSize;let o=i-r;o!==0&&(this.$el.scrollTop+=o)}},beforeCreate(){this.$_updates=[],this.$_undefinedSizes=0,this.$_undefinedMap={},this.$_events=Ce()},activated(){this.vscrollData.active=!0},deactivated(){this.vscrollData.active=!1},unmounted(){this.$_events.all.clear()},methods:{onScrollerResize(){this.$refs.scroller&&this.forceUpdate(),this.$emit(`resize`)},onScrollerVisible(){this.$_events.emit(`vscroll:update`,{force:!1}),this.$emit(`visible`)},forceUpdate(e=!1){(e||this.simpleArray)&&(this.vscrollData.sizes={}),this.$_events.emit(`vscroll:update`,{force:!0})},scrollToItem(e){let t=this.$refs.scroller;t&&t.scrollToItem(e)},getItemSize(e,t=void 0){let n=this.simpleArray?t??this.items.indexOf(e):e[this.keyField];return this.vscrollData.sizes[n]||0},scrollToBottom(){if(this.$_scrollingToBottom)return;this.$_scrollingToBottom=!0;let e=this.$el;this.$nextTick(()=>{e.scrollTop=e.scrollHeight+5e3;let t=()=>{e.scrollTop=e.scrollHeight+5e3,requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight+5e3,this.$_undefinedSizes===0?this.$_scrollingToBottom=!1:requestAnimationFrame(t)})};requestAnimationFrame(t)})}}};function Me(t,n,r,i,a,o){let s=b(`RecycleScroller`);return c(),m(s,p({ref:`scroller`,items:o.itemsWithSize,"min-item-size":r.minItemSize,direction:t.direction,"key-field":`id`,"list-tag":t.listTag,"item-tag":t.itemTag},t.$attrs,{onResize:o.onScrollerResize,onVisible:o.onScrollerVisible}),{default:u(({item:n,index:r,active:i})=>[e(t.$slots,`default`,w(g({item:n.item,index:r,active:i,itemWithSize:n})))]),before:u(()=>[e(t.$slots,`before`)]),after:u(()=>[e(t.$slots,`after`)]),empty:u(()=>[e(t.$slots,`empty`)]),_:3},16,[`items`,`min-item-size`,`direction`,`list-tag`,`item-tag`,`onResize`,`onVisible`])}Q.render=Me,Q.__file=`src/components/DynamicScroller.vue`;var $={name:`DynamicScrollerItem`,inject:[`vscrollData`,`vscrollParent`,`vscrollResizeObserver`],props:{item:{required:!0},watchData:{type:Boolean,default:!1},active:{type:Boolean,required:!0},index:{type:Number,default:void 0},sizeDependencies:{type:[Array,Object],default:null},emitResize:{type:Boolean,default:!1},tag:{type:String,default:`div`}},emits:[`resize`],computed:{id(){if(this.vscrollData.simpleArray)return this.index;if(this.vscrollData.keyField in this.item)return this.item[this.vscrollData.keyField];throw Error(`keyField '${this.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`)},size(){return this.vscrollData.sizes[this.id]||0},finalActive(){return this.active&&this.vscrollData.active}},watch:{watchData:`updateWatchData`,id(e,t){if(this.$el.$_vs_id=this.id,this.size||this.onDataUpdate(),this.$_sizeObserved){let n=this.vscrollData.sizes[t],r=this.vscrollData.sizes[e];n!=null&&n!==r&&this.applySize(n)}},finalActive(e){this.size||(e?this.vscrollParent.$_undefinedMap[this.id]||(this.vscrollParent.$_undefinedSizes++,this.vscrollParent.$_undefinedMap[this.id]=!0):this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=!1)),this.vscrollResizeObserver?e?this.observeSize():this.unobserveSize():e&&this.$_pendingVScrollUpdate===this.id&&this.updateSize()}},created(){if(!this.$isServer&&(this.$_forceNextVScrollUpdate=null,this.updateWatchData(),!this.vscrollResizeObserver)){for(let e in this.sizeDependencies)this.$watch(()=>this.sizeDependencies[e],this.onDataUpdate);this.vscrollParent.$_events.on(`vscroll:update`,this.onVscrollUpdate)}},mounted(){this.finalActive&&(this.updateSize(),this.observeSize())},beforeUnmount(){this.vscrollParent.$_events.off(`vscroll:update`,this.onVscrollUpdate),this.unobserveSize()},methods:{updateSize(){this.finalActive?this.$_pendingSizeUpdate!==this.id&&(this.$_pendingSizeUpdate=this.id,this.$_forceNextVScrollUpdate=null,this.$_pendingVScrollUpdate=null,this.computeSize(this.id)):this.$_forceNextVScrollUpdate=this.id},updateWatchData(){this.watchData&&!this.vscrollResizeObserver?this.$_watchData=this.$watch(`item`,()=>{this.onDataUpdate()},{deep:!0}):this.$_watchData&&=(this.$_watchData(),null)},onVscrollUpdate({force:e}){!this.finalActive&&e&&(this.$_pendingVScrollUpdate=this.id),(this.$_forceNextVScrollUpdate===this.id||e||!this.size)&&this.updateSize()},onDataUpdate(){this.updateSize()},computeSize(e){this.$nextTick(()=>{if(this.id===e){let e=this.$el.offsetWidth,t=this.$el.offsetHeight;this.applyWidthHeight(e,t)}this.$_pendingSizeUpdate=null})},applyWidthHeight(e,t){let n=~~(this.vscrollParent.direction===`vertical`?t:e);n&&this.size!==n&&this.applySize(n)},applySize(e){this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=void 0),this.vscrollData.sizes[this.id]=e,this.emitResize&&this.$emit(`resize`,this.id)},observeSize(){this.vscrollResizeObserver&&(this.$_sizeObserved||=(this.vscrollResizeObserver.observe(this.$el),this.$el.$_vs_id=this.id,this.$el.$_vs_onResize=this.onResize,!0))},unobserveSize(){this.vscrollResizeObserver&&(this.$_sizeObserved&&=(this.vscrollResizeObserver.unobserve(this.$el),this.$el.$_vs_onResize=void 0,!1))},onResize(e,t,n){this.id===e&&this.applyWidthHeight(t,n)}},render(){return f(this.tag,this.$slots.default())}};$.__file=`src/components/DynamicScrollerItem.vue`;var Ne=C({__name:`VirtualList`,props:{items:{},keyProp:{}},setup(t){return(n,r)=>(c(),m(h(Q),{items:t.items,"min-item-size":30,"key-field":t.keyProp,"page-mode":``},{default:u(({item:r,active:i,index:a})=>[T(h($),{item:r,active:i,"data-index":a},{default:u(()=>[e(n.$slots,`default`,p({key:r[t.keyProp]},{item:r,index:a,active:i}))]),_:2},1032,[`item`,`active`,`data-index`])]),_:3},8,[`items`,`key-field`]))}}),Pe=Object.assign(Ne,{__name:`DataVirtualList`});export{ue as n,Pe as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Bt as e,Jt as t,Nt as n,S as r,Tt as i,Vt as a,ct as o,en as s,ft as c,in as l,it as u,kt as d,lt as f,mt as p,ot as m,pt as h,st as g,tn as _,ut as v,y}from"#entry";import{t as b}from"./Jdu9jmuG.js";import{t as x}from"./17ealR8P.js";import"./B_mZ82Ef.js";import"./2OALqkc2.js";import{r as S,t as C}from"./DL1ysgP5.js";import{t as w}from"./CbzAqNxs.js";import"./DnpfwSMy.js";import{t as T}from"./SO3ppn9m.js";var E={flex:`~ col gap-2`},D={flex:`~ gap-1 items-center`,"font-mono":``,op50:``,"text-sm":``},O={"font-mono":``,"font-sm":``},k={key:0,flex:`~ gap-1 items-center`},A={key:0,op50:``,"text-xs":``,border:`~ base rounded-md`,px1:``,"font-mono":``},j=p({__name:`SessionSelector`,props:{sessionMode:{},sessions:{},selectedSessionIds:{},selectedSessions:{}},emits:[`select`],setup(e,{emit:t}){let r=e,p=t;function y(e){return T(e.meta.inputs[0]?.filename??``,e.meta.cwd).path}let x=m(()=>{let e=r.selectedSessions?.[0];return e?y(e):``});function j(e){return x.value&&x.value!==y(e)}function M(e){r.sessionMode===`compare`&&!j(e)&&p(`select`,e)}return(t,r)=>{let p=C,m=S,y=w;return i(),v(`div`,E,[(i(!0),v(u,null,d(e.sessions,t=>(i(),v(`div`,{key:t.id,flex:`~ row gap-2`,relative:``},[(i(),o(n(e.sessionMode===`list`?s(b):`div`),{to:`/session/${t.id}`,border:`~ rounded-md`,class:_(e.sessionMode===`list`?[`hover:bg-active`,`border-base`]:[e.selectedSessionIds.includes(t.id)?`border-active`:`border-base`,j(t)||e.selectedSessions.length===2&&!e.selectedSessionIds.includes(t.id)?`op50`:`hover:bg-active`]),flex:`~ col gap-1`,px4:``,py3:``,"w-full":``,onClick:e=>M(t)},{default:a(()=>[g(`div`,D,[r[0]||=g(`div`,{"i-ph-hash-duotone":``},null,-1),c(` `+l(t.id),1)]),g(`div`,O,l(t.meta.cwd),1),t.meta.inputs[0]?(i(),v(`div`,k,[h(p,{id:t.meta.inputs[0].filename,cwd:t.meta.cwd},null,8,[`id`,`cwd`]),h(m,{text:t.meta.inputs[0].name||`entry`},null,8,[`text`]),t.meta.inputs.length>1?(i(),v(`span`,A,` +`+l(t.meta.inputs.length-1),1)):f(``,!0)])):f(``,!0),h(y,{timestamp:t.timestamp,pt2:``,"text-sm":``,op50:``},null,8,[`timestamp`])]),_:2},1032,[`to`,`class`,`onClick`]))]))),128))])}}}),M=Object.assign(j,{__name:`PanelSessionSelector`}),N={p4:``,flex:`~ col gap-4`,"items-center":``,"justify-center":``,relative:``},P={op50:``},F={relative:``,flex:`~ col gap3 items-center`},I={fixed:``,"top-5":``,"right-5":``,flex:`~ col gap2`},L={flex:`~ row justify-around`,w20:``,h8:``,border:`~ base rounded-8`,"of-hidden":``},R=[`title`,`onClick`],z={key:0,fixed:``,"bottom-5":``,"right-5":``,border:`~ base rounded-2`,w100:``,"max-lg:w85":``,"bg-glass":``,"z-panel-content":``},B={flex:`~ justify-center`,p2:``},V={key:1,op80:``,"text-sm":``},H=p({__name:`index`,async setup(n){let p,S,C=t(`list`),w=[{label:`Session List`,icon:`i-ph-list-bullets-duotone`,value:`list`},{label:`Session Compare`,icon:`i-ph-git-diff-duotone`,value:`compare`}],T=t([]),E=m(()=>T.value.map(e=>e.id).sort()),D=m(()=>[...T.value].sort((e,t)=>e.timestamp-t.timestamp).map((e,t)=>({...e,createdAt:new Date(e.timestamp),title:t===0?`Session A`:`Session B`}))),O=y(),k=([p,S]=e(()=>O.value[`vite:rolldown:list-sessions`]()),p=await p,S(),p);function A(e){E.value.includes(e.id)?T.value=T.value.filter(t=>t.id!==e.id):T.value=[...T.value,e]}return(e,t)=>{let n=r,p=M,m=x,y=b;return i(),v(`div`,N,[h(n),g(`p`,P,l(C.value===`list`?`Select a build session to get started:`:`Select 2 build sessions to compare:`),1),g(`div`,F,[h(p,{"session-mode":C.value,sessions:s(k),"selected-session-ids":E.value,"selected-sessions":T.value,onSelect:A},null,8,[`session-mode`,`sessions`,`selected-session-ids`,`selected-sessions`])]),g(`div`,I,[g(`div`,L,[(i(),v(u,null,d(w,e=>g(`button`,{key:e.value,title:e.label,"flex-1":``,op50:``,flex:`~ items-center justify-center`,class:_({"bg-active text-base op100!":C.value===e.value}),hover:`bg-active text-base op100!`,onClick:t=>C.value=e.value},[g(`span`,{class:_([e.icon,`text-sm`])},null,2)],10,R)),64))])]),T.value.length>0&&C.value===`compare`?(i(),v(`div`,z,[h(m,{sessions:D.value,class:`flex-col gap0 [&>div]:border-none! [&>first-child]:border-b!`},null,8,[`sessions`]),g(`div`,B,[T.value.length===2?(i(),o(y,{key:0,tag:`button`,to:`/compare/${E.value.join(`,`)}`,"btn-action":``,"rounded-8":``,"text-3":``,flex:`~ justify-center`,w30:``,h8:``},{default:a(()=>[...t[0]||=[c(` Compare `,-1)]]),_:1},8,[`to`])):(i(),v(`div`,V,` Select one more session to compare. `))])])):f(``,!0)])}}});export{H as default};
|