vite-devtools-svelte 0.5.0 → 0.6.1
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 +17 -5
- package/dist/analyzers/api.d.ts +17 -4
- package/dist/analyzers/assets.d.ts +0 -1
- package/dist/analyzers/build.d.ts +7 -1
- package/dist/analyzers/html.d.ts +24 -0
- package/dist/analyzers/http.d.ts +9 -0
- package/dist/analyzers/module-graph.d.ts +9 -0
- package/dist/analyzers/og.d.ts +18 -4
- package/dist/analyzers/project.d.ts +1 -0
- package/dist/analyzers/routes.d.ts +22 -1
- package/dist/analyzers/script.d.ts +26 -0
- package/dist/analyzers/source.d.ts +8 -3
- package/dist/analyzers/text.d.ts +6 -0
- package/dist/client/assets/ApiPlayground-r3PMCbhw.js +3 -0
- package/dist/client/assets/Assets-F6ySiRNw.js +1 -0
- package/dist/client/assets/BuildAnalysis-Ci5Or0e4.js +1 -0
- package/dist/client/assets/CaptureNotice-DNYJjRjY.js +1 -0
- package/dist/client/assets/{Components-Co50xTrv.css → Components-DcHDCSmh.css} +1 -1
- package/dist/client/assets/Components-DzrFq-Jl.js +2 -0
- package/dist/client/assets/DataTable-C8wIHfdk.js +1 -0
- package/dist/client/assets/DataTable-gMBzprA7.css +1 -0
- package/dist/client/assets/ErrorDashboard-DvBrkCGu.js +1 -0
- package/dist/client/assets/FpsMonitor-Bot5x4nP.js +1 -0
- package/dist/client/assets/FpsMonitor-D0MLqumc.css +1 -0
- package/dist/client/assets/Inspect-TF2sVdn4.js +4 -0
- package/dist/client/assets/Inspector-pD5_jg0-.js +1 -0
- package/dist/client/assets/LiveControls-BDWnVlkm.js +1 -0
- package/dist/client/assets/LoadProfiler-9jiBcPzy.css +1 -0
- package/dist/client/assets/LoadProfiler-RcwiKanZ.js +1 -0
- package/dist/client/assets/ModuleGraph-BscNTo-U.js +1 -0
- package/dist/client/assets/OGPreview-Ca39RUrW.js +1 -0
- package/dist/client/assets/Overview-CNCVS-EJ.js +1 -0
- package/dist/client/assets/Panel-BoUvB1nh.js +1 -0
- package/dist/client/assets/Panel-b1jDvzob.css +1 -0
- package/dist/client/assets/ReactiveGraph-BInCBdAu.css +1 -0
- package/dist/client/assets/ReactiveGraph-BmQbARuQ.js +17 -0
- package/dist/client/assets/RefreshButton-QYzgSJG9.js +1 -0
- package/dist/client/assets/RenderProfiler-Brp8i8K4.js +1 -0
- package/dist/client/assets/RenderProfiler-C0XQZUzw.css +1 -0
- package/dist/client/assets/ResourceEmpty-BBhK6GZB.js +1 -0
- package/dist/client/assets/Routes-BS5YDx3C.js +1 -0
- package/dist/client/assets/SearchField-C1RVVJht.js +1 -0
- package/dist/client/assets/Segmented-CK2euuus.js +1 -0
- package/dist/client/assets/SplitView-D7jY4n9A.js +1 -0
- package/dist/client/assets/StatList-Cd2sByRK.js +1 -0
- package/dist/client/assets/StatList-CwVfs0x8.css +1 -0
- package/dist/client/assets/StateTimeline-CaYBN88_.js +1 -0
- package/dist/client/assets/TreeView-T5wWFSLQ.js +1 -0
- package/dist/client/assets/VirtualList-CLxNqdaN.js +1 -0
- package/dist/client/assets/browser-agent-rpc-BXhoSh1z-DrvKG05N.js +1 -0
- package/dist/client/assets/capture.svelte-CetYVdiG.js +1 -0
- package/dist/client/assets/collections-BtFss6Lo.js +1 -0
- package/dist/client/assets/index-BBFupqc_.js +3 -0
- package/dist/client/assets/index-C_6yCKMs.css +1 -0
- package/dist/client/assets/kind-options-BLIV2wQY.js +1 -0
- package/dist/client/assets/nanoid-Cya-tyvy.js +1 -0
- package/dist/client/assets/reactive-BQ_s2f5H.js +1 -0
- package/dist/client/assets/reactive-selection.svelte-DI6qEBmx.js +1 -0
- package/dist/client/assets/resource-f-V9vBwK.css +1 -0
- package/dist/client/assets/resource.svelte-GBY8qvgR.js +5 -0
- package/dist/client/assets/versions-Dmo1-Hsc.js +1 -0
- package/dist/client/index.html +5 -2
- package/dist/index.mjs +2464 -1951
- package/dist/index.mjs.map +1 -1
- package/dist/mcp/http.d.ts +24 -0
- package/dist/mcp/issues.d.ts +10 -6
- package/dist/mcp/server.d.ts +6 -17
- package/dist/mcp/sessions.d.ts +27 -17
- package/dist/mcp/stats.d.ts +13 -0
- package/dist/plugin.d.ts +14 -22
- package/dist/runtime/ids.d.ts +3 -0
- package/dist/runtime/index.d.ts +18 -0
- package/dist/runtime/transform.d.ts +22 -0
- package/dist/{collector.d.ts → server/collector.d.ts} +59 -119
- package/dist/server/compiler-warnings.d.ts +13 -0
- package/dist/{devframe.d.ts → server/devframe.d.ts} +11 -11
- package/dist/server/load-profile.d.ts +12 -0
- package/dist/{mount.d.ts → server/mount.d.ts} +6 -9
- package/dist/server/payload.d.ts +11 -0
- package/dist/server/reactive.d.ts +30 -0
- package/dist/server/ring.d.ts +11 -0
- package/dist/{security.d.ts → server/security.d.ts} +13 -3
- package/dist/server/state-timeline.d.ts +72 -0
- package/package.json +9 -4
- package/skills/vite-devtools-svelte-perf-audit/SKILL.md +2 -2
- package/skills/vite-devtools-svelte-perf-fix/SKILL.md +3 -3
- package/dist/client/assets/ApiPlayground-B28mCUlr.js +0 -3
- package/dist/client/assets/Assets-BVT22xZ3.js +0 -1
- package/dist/client/assets/Badge-BBLKgCiU.css +0 -1
- package/dist/client/assets/Badge-x4Lbd8pc.js +0 -1
- package/dist/client/assets/BuildAnalysis-BscZFEWI.js +0 -1
- package/dist/client/assets/CaptureNotice-D0u6WNeR.js +0 -1
- package/dist/client/assets/Components-sw5zdu0k.js +0 -1
- package/dist/client/assets/DataTable-CdM2Vyvn.js +0 -1
- package/dist/client/assets/DataTable-CdVIFm8T.css +0 -1
- package/dist/client/assets/ErrorDashboard-BwGMVW_-.js +0 -1
- package/dist/client/assets/FpsMonitor-BmS11Tn7.css +0 -1
- package/dist/client/assets/FpsMonitor-C0FeLiag.js +0 -1
- package/dist/client/assets/Inspect-B-jb8MaB.js +0 -3
- package/dist/client/assets/Inspector-C4wr2Zb4.js +0 -1
- package/dist/client/assets/LoadProfiler-WeP1orWN.js +0 -1
- package/dist/client/assets/LoadProfiler-cg28l5zW.css +0 -1
- package/dist/client/assets/ModuleGraph-BYer7OEL.js +0 -1
- package/dist/client/assets/OGPreview-MRxnmCmb.js +0 -1
- package/dist/client/assets/Overview-CDBKKylY.js +0 -1
- package/dist/client/assets/ReactiveGraph-Bni33DP4.js +0 -5
- package/dist/client/assets/ReactiveGraph-Bq_aP4uo.css +0 -1
- package/dist/client/assets/RenderProfiler-2rA8kCUf.js +0 -1
- package/dist/client/assets/RenderProfiler-CS1FAvX6.css +0 -1
- package/dist/client/assets/Routes-BZ5XcmEt.js +0 -1
- package/dist/client/assets/SearchField-D85HSGV_.js +0 -1
- package/dist/client/assets/Segmented-BCcIUjA2.js +0 -1
- package/dist/client/assets/SplitView-DVk1HAf9.js +0 -1
- package/dist/client/assets/StateTimeline-DjTXe54T.js +0 -1
- package/dist/client/assets/TreeView-e7dNH8HW.js +0 -1
- package/dist/client/assets/VirtualList-Ba0GhFn8.js +0 -1
- package/dist/client/assets/browser-agent-rpc-BXhoSh1z-UMmvacmP.js +0 -1
- package/dist/client/assets/capture.svelte-fve1ihQA.js +0 -1
- package/dist/client/assets/format-CW_NXiBg.js +0 -1
- package/dist/client/assets/index-CuoAAt-d.js +0 -7
- package/dist/client/assets/index-u73uo_Ri.css +0 -1
- package/dist/client/assets/reactive-BSjTkgqc.js +0 -1
- package/dist/client/assets/reactive-selection.svelte-BmjgYyWR.js +0 -1
- package/dist/client/assets/versions-zyEGB_mz.js +0 -1
- package/dist/runtime.d.ts +0 -19
- /package/dist/client/assets/{versions-CMau2xlU.css → LiveControls-CMau2xlU.css} +0 -0
- /package/dist/{template-injector.d.ts → server/template-injector.d.ts} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DevframeDefinition } from 'devframe';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { GraphModuleLike } from '
|
|
3
|
+
import { GraphModuleLike } from '../analyzers/module-graph.js';
|
|
4
|
+
import { ApiResponse, InspectResult, OGPreview, ReactiveGraphResult, ReactiveSummary, StateTimelineDelta, LiveComponentsMeta } from '../types.js';
|
|
4
5
|
import { Collector } from './collector.js';
|
|
5
|
-
import { ApiResponse, InspectResult, OGPreview, ReactiveGraphResult, ReactiveSummary, StateTimelineDelta, LiveComponentsMeta } from './types.js';
|
|
6
6
|
export declare const DEVFRAME_ID = "svelte-devtools";
|
|
7
7
|
/** Mount base for both hosts (standalone and Vite DevTools), so the SPA URL never changes. */
|
|
8
8
|
export declare const DEVFRAME_BASE = "/.svelte-devtools/";
|
|
@@ -32,10 +32,10 @@ export interface SvelteDevtoolsHost {
|
|
|
32
32
|
/** Open `file[:line]` in the user's editor. */
|
|
33
33
|
openInEditor: (target: string) => void;
|
|
34
34
|
}
|
|
35
|
-
export declare function createRpcFunctions(host: SvelteDevtoolsHost): readonly [import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-project", "query", [], import('
|
|
35
|
+
export declare function createRpcFunctions(host: SvelteDevtoolsHost): readonly [import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-project", "query" | "action", [], import('../types.js').ProjectInfo, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-routes", "query" | "action", [], import('../types.js').RouteInfo[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-assets", "query" | "action", [], import('../types.js').AssetInfo[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-component-relations", "query" | "action", [], import('../types.js').ComponentRelation[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-svelte-files", "query" | "action", [], {
|
|
36
36
|
file: string;
|
|
37
37
|
name: string;
|
|
38
|
-
}[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-live-components", "query", [], import('
|
|
38
|
+
}[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-live-components", "query" | "action", [], import('../types.js').ComponentInstance[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-live-components-meta", "query" | "action", [], LiveComponentsMeta, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithSchemas<"set-active", "action", readonly [z.ZodObject<{
|
|
39
39
|
client: z.ZodString;
|
|
40
40
|
active: z.ZodBoolean;
|
|
41
41
|
}, z.core.$strip>], z.ZodVoid, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithSchemas<"open-in-editor", "action", readonly [z.ZodObject<{
|
|
@@ -45,7 +45,7 @@ export declare function createRpcFunctions(host: SvelteDevtoolsHost): readonly [
|
|
|
45
45
|
file: z.ZodString;
|
|
46
46
|
name: z.ZodString;
|
|
47
47
|
type: z.ZodString;
|
|
48
|
-
}, z.core.$strip>], z.ZodVoid, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-render-profiles", "query", [], import('
|
|
48
|
+
}, z.core.$strip>], z.ZodVoid, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-render-profiles", "query" | "action", [], import('../types.js').RenderProfile[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithSchemas<"get-reactive-graph", "query", readonly [z.ZodOptional<z.ZodObject<{
|
|
49
49
|
componentId: z.ZodOptional<z.ZodNumber>;
|
|
50
50
|
epoch: z.ZodOptional<z.ZodString>;
|
|
51
51
|
maxNodes: z.ZodOptional<z.ZodNumber>;
|
|
@@ -53,9 +53,9 @@ export declare function createRpcFunctions(host: SvelteDevtoolsHost): readonly [
|
|
|
53
53
|
}, z.core.$strip>>], z.ZodCustom<ReactiveGraphResult, ReactiveGraphResult>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithSchemas<"get-reactive-summary", "query", readonly [z.ZodOptional<z.ZodObject<{
|
|
54
54
|
topK: z.ZodOptional<z.ZodNumber>;
|
|
55
55
|
windowMs: z.ZodOptional<z.ZodNumber>;
|
|
56
|
-
}, z.core.$strip>>], z.ZodCustom<ReactiveSummary, ReactiveSummary>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-capture-info", "query", [], Partial<Record<import('
|
|
56
|
+
}, z.core.$strip>>], z.ZodCustom<ReactiveSummary, ReactiveSummary>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-capture-info", "query" | "action", [], Partial<Record<import('../types.js').CaptureKey, import('../types.js').CaptureInfo>>, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-load-profiles", "query" | "action", [], import('../types.js').LoadProfile[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"clear-load-profiles", "query" | "action", [], void, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-state-timeline", "query" | "action", [], Promise<import('../types.js').StateChange[]>, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithSchemas<"get-state-timeline-delta", "query", readonly [z.ZodObject<{
|
|
57
57
|
since: z.ZodOptional<z.ZodNumber>;
|
|
58
|
-
}, z.core.$strip>], z.ZodCustom<StateTimelineDelta, StateTimelineDelta>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-versions", "query", [], {
|
|
58
|
+
}, z.core.$strip>], z.ZodCustom<StateTimelineDelta, StateTimelineDelta>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-versions", "query" | "action", [], {
|
|
59
59
|
components: number;
|
|
60
60
|
renderProfiles: number;
|
|
61
61
|
loadProfiles: number;
|
|
@@ -63,7 +63,7 @@ export declare function createRpcFunctions(host: SvelteDevtoolsHost): readonly [
|
|
|
63
63
|
reactiveGraph: number;
|
|
64
64
|
errors: number;
|
|
65
65
|
fps: number;
|
|
66
|
-
}, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"clear-state-timeline", "action", [], void, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-api-endpoints", "query", [], import('
|
|
66
|
+
}, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"clear-state-timeline", "query" | "action", [], void, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-api-endpoints", "query" | "action", [], import('../types.js').ApiEndpoint[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithSchemas<"send-api-request", "action", readonly [z.ZodObject<{
|
|
67
67
|
url: z.ZodString;
|
|
68
68
|
method: z.ZodEnum<{
|
|
69
69
|
GET: "GET";
|
|
@@ -76,11 +76,11 @@ export declare function createRpcFunctions(host: SvelteDevtoolsHost): readonly [
|
|
|
76
76
|
}>;
|
|
77
77
|
headers: z.ZodString;
|
|
78
78
|
body: z.ZodString;
|
|
79
|
-
}, z.core.$strip>], z.ZodCustom<ApiResponse, ApiResponse>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-compiler-warnings", "query", [], import('
|
|
79
|
+
}, z.core.$strip>], z.ZodCustom<ApiResponse, ApiResponse>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-compiler-warnings", "query" | "action", [], import('../types.js').CompilerWarning[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-runtime-errors", "query" | "action", [], import('../types.js').RuntimeError[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"clear-errors", "query" | "action", [], void, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithSchemas<"inspect-file", "query", readonly [z.ZodObject<{
|
|
80
80
|
file: z.ZodString;
|
|
81
|
-
}, z.core.$strip>], z.ZodCustom<InspectResult, InspectResult>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-module-graph", "query", [], import('
|
|
81
|
+
}, z.core.$strip>], z.ZodCustom<InspectResult, InspectResult>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-module-graph", "query" | "action", [], import('../types.js').ModuleGraphData, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithSchemas<"get-og-preview", "action", readonly [z.ZodObject<{
|
|
82
82
|
url: z.ZodString;
|
|
83
|
-
}, z.core.$strip>], z.ZodCustom<OGPreview, OGPreview>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-build-analysis", "query", [], import('
|
|
83
|
+
}, z.core.$strip>], z.ZodCustom<OGPreview, OGPreview>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-build-analysis", "query" | "action", [], import('../types.js').BuildAnalysis, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-fps", "query" | "action", [], import('../types.js').FpsSample[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"clear-fps", "query" | "action", [], void, undefined, undefined, import('devframe').DevframeNodeContext>];
|
|
84
84
|
/**
|
|
85
85
|
* The portable Svelte DevTools tool. Host-agnostic: the same definition is
|
|
86
86
|
* mounted standalone (`initDevframe`) or inside Vite DevTools
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Server-side hook the profiled `load` wrappers report to (set by the plugin on the dev server). */
|
|
2
|
+
export declare const LOAD_RECORDER = "__svelte_devtools_record_load";
|
|
3
|
+
/**
|
|
4
|
+
* Wrap the exported `load` of a SvelteKit load file (`+page.ts`,
|
|
5
|
+
* `+layout.server.js`, …) so each call reports its duration and data size,
|
|
6
|
+
* or `null` when `id` is not a load file or declares no exported `load`.
|
|
7
|
+
*
|
|
8
|
+
* Only the `export` keyword is removed (the local binding stays, so the
|
|
9
|
+
* module's own references keep the original) and a profiled wrapper is
|
|
10
|
+
* exported as `load` instead; line numbers are unchanged.
|
|
11
|
+
*/
|
|
12
|
+
export declare function profileLoad(code: string, id: string, root: string): string | null;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { AddressInfo } from 'node:net';
|
|
2
|
-
import { ViteDevServer } from 'vite';
|
|
3
1
|
import { DevframeDefinition } from 'devframe';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* origins by default and rejects every other WS `Origin` unless listed.
|
|
8
|
-
*/
|
|
9
|
-
export declare function networkOrigins(address: AddressInfo, proto: string): string[];
|
|
2
|
+
import { ViteDevServer } from 'vite';
|
|
3
|
+
/** `address` as a URL host: `localhost` for loopback / wildcard bindings, IPv6 bracketed. */
|
|
4
|
+
export declare function urlHost(address: string): string;
|
|
10
5
|
/**
|
|
11
6
|
* Serve the devframe standalone on this dev server: SPA, discovery,
|
|
12
7
|
* WebSocket RPC on Vite's own HTTP server at `<base>__ws`, auth gate.
|
|
@@ -15,4 +10,6 @@ export declare function networkOrigins(address: AddressInfo, proto: string): str
|
|
|
15
10
|
* event, so a restart (which builds the new server before closing the old
|
|
16
11
|
* one) can never tear down the new instance.
|
|
17
12
|
*/
|
|
18
|
-
export declare function mountStandalone(server: ViteDevServer, def: DevframeDefinition
|
|
13
|
+
export declare function mountStandalone(server: ViteDevServer, def: DevframeDefinition, { auth }?: {
|
|
14
|
+
auth?: boolean;
|
|
15
|
+
}): (() => Promise<void>) | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** A hot-channel payload: an untrusted JSON object from the app's runtime. */
|
|
2
|
+
export type Payload = Record<string, unknown>;
|
|
3
|
+
export declare function asPayload(value: unknown): Payload | undefined;
|
|
4
|
+
/** An integer within [min, max], or `fallback` when absent / not a number. */
|
|
5
|
+
export declare function clampInt(value: unknown, min: number, max: number, fallback: number): number;
|
|
6
|
+
/** A non-negative safe integer, 0 when absent / not a number. */
|
|
7
|
+
export declare function nonNegInt(value: unknown): number;
|
|
8
|
+
/** A finite number, or `null` when absent / not one. */
|
|
9
|
+
export declare function finiteOrNull(value: unknown): number | null;
|
|
10
|
+
/** The array's elements (none when it is not an array). */
|
|
11
|
+
export declare function arrayOf<T>(value: unknown): T[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactiveGraphResult, ReactiveSummary } from '../types.js';
|
|
2
|
+
import { Payload } from './payload.js';
|
|
3
|
+
/** Most nodes / edges one graph answer holds. */
|
|
4
|
+
export declare const GRAPH_LIMITS: {
|
|
5
|
+
readonly nodes: 5000;
|
|
6
|
+
readonly edges: 20000;
|
|
7
|
+
};
|
|
8
|
+
/** Defaults and bounds for `get-reactive-summary` (§6.7 I). */
|
|
9
|
+
export declare const SUMMARY_DEFAULTS: {
|
|
10
|
+
readonly topK: 50;
|
|
11
|
+
readonly maxTopK: 200;
|
|
12
|
+
readonly windowMs: 10000;
|
|
13
|
+
readonly minWindowMs: 1000;
|
|
14
|
+
readonly maxWindowMs: 60000;
|
|
15
|
+
};
|
|
16
|
+
export type StaleReason = NonNullable<ReactiveGraphResult['staleReason']>;
|
|
17
|
+
/** An empty graph answer, marked stale for `reason`. */
|
|
18
|
+
export declare function emptyGraph(scope: number | null, epoch: string | null, reason: StaleReason): ReactiveGraphResult;
|
|
19
|
+
/** An empty summary answer, marked stale for `reason`. */
|
|
20
|
+
export declare function emptySummary(epoch: string | null, windowMs: number, reason: 'timeout' | 'no-runtime'): ReactiveSummary;
|
|
21
|
+
/**
|
|
22
|
+
* Shape a runtime reply into a {@link ReactiveGraphResult}: apply the caps
|
|
23
|
+
* (nodes, then only edges between kept nodes, then the edge cap) and report
|
|
24
|
+
* what was left out. Totals come from the runtime; an older runtime's (no
|
|
25
|
+
* `requestId`) are the counts it sent (`nodesKind: 'sent'`), or unknown when
|
|
26
|
+
* the server had to scope its whole-app graph.
|
|
27
|
+
*/
|
|
28
|
+
export declare function normalizeGraph(data: Payload | undefined, scope: number | null, epoch: string | null): ReactiveGraphResult;
|
|
29
|
+
/** Shape a runtime summary reply (§6.7 I); every field is validated, nothing assumed. */
|
|
30
|
+
export declare function normalizeSummary(data: Payload | undefined, epoch: string | null): ReactiveSummary;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CaptureInfo } from '../types.js';
|
|
2
|
+
/** A tail-capped dataset that counts what it received since the last clear. */
|
|
3
|
+
export declare class Ring<T> {
|
|
4
|
+
items: T[];
|
|
5
|
+
received: number;
|
|
6
|
+
private readonly max;
|
|
7
|
+
constructor(max: number);
|
|
8
|
+
push(item: T): void;
|
|
9
|
+
clear(): void;
|
|
10
|
+
get info(): CaptureInfo;
|
|
11
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Validate that a URL does not target private/internal network addresses (SSRF prevention).
|
|
3
3
|
* Allows only http/https schemes and blocks private IP ranges.
|
|
4
4
|
*/
|
|
5
|
-
export declare function validateExternalUrl(urlStr: string):
|
|
5
|
+
export declare function validateExternalUrl(urlStr: string): URL;
|
|
6
6
|
export interface OutboundUrlOptions {
|
|
7
7
|
/**
|
|
8
8
|
* Origins that may be fetched even though they are local — the dev
|
|
@@ -12,13 +12,23 @@ export interface OutboundUrlOptions {
|
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Like {@link validateExternalUrl}, but also resolves the hostname and
|
|
15
|
-
* rejects names that point at private / loopback addresses (DNS-based SSRF)
|
|
16
|
-
* Exact dev-server origins in
|
|
15
|
+
* rejects names that point at private / loopback addresses (DNS-based SSRF),
|
|
16
|
+
* or that do not resolve at all. Exact dev-server origins in
|
|
17
|
+
* `allowedOrigins` bypass the private checks.
|
|
17
18
|
* Callers must also fetch with `redirect: 'manual'` so a public URL cannot
|
|
18
19
|
* bounce the request to a private one.
|
|
19
20
|
*/
|
|
20
21
|
export declare function assertOutboundUrl(urlStr: string, options?: OutboundUrlOptions): Promise<URL>;
|
|
22
|
+
/**
|
|
23
|
+
* Whether `ip` (an IPv4 or IPv6 literal, IPv6 optionally in brackets) is a
|
|
24
|
+
* private, loopback or otherwise non-public address. IPv6 forms that embed
|
|
25
|
+
* an IPv4 address (mapped, compatible, NAT64, 6to4) are judged by that
|
|
26
|
+
* address. Anything that is not a valid IP literal counts as private, so a
|
|
27
|
+
* malformed value is never let through.
|
|
28
|
+
*/
|
|
21
29
|
export declare function isPrivateIP(ip: string): boolean;
|
|
30
|
+
/** Whether `file` lies inside `dir` (`..foo/x` does; `dir` itself, `../x` and other drives do not). */
|
|
31
|
+
export declare function isInside(dir: string, file: string): boolean;
|
|
22
32
|
/**
|
|
23
33
|
* Resolve a user-supplied file path strictly under `root`. Symlinks are
|
|
24
34
|
* followed via realpathSync so that symlinks inside the project cannot be
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { CaptureInfo, StateTimelineDelta, StateTimelineEntry, TimelineBaseline } from '../types.js';
|
|
2
|
+
/** Most entries the server-side state timeline keeps. */
|
|
3
|
+
export declare const STATE_TIMELINE_LIMIT = 500;
|
|
4
|
+
/** Byte budget (JSON length, measured once at ingest) for the server-side state timeline. */
|
|
5
|
+
export declare const STATE_TIMELINE_BYTES: number;
|
|
6
|
+
/** Epoch for runtimes that send payloads without an epoch. */
|
|
7
|
+
export declare const LEGACY_EPOCH = "(legacy)";
|
|
8
|
+
export declare const nextSeq: () => number;
|
|
9
|
+
export declare function isBaseline(b: unknown): b is TimelineBaseline;
|
|
10
|
+
/** A runtime timeline push (docs/devframe-migration.md §6.4), untrusted. */
|
|
11
|
+
export interface TimelinePush {
|
|
12
|
+
changes?: unknown;
|
|
13
|
+
epoch?: unknown;
|
|
14
|
+
reset?: unknown;
|
|
15
|
+
dropped?: unknown;
|
|
16
|
+
valueTooLarge?: unknown;
|
|
17
|
+
baseline?: unknown;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The server-side state timeline: entries of every tracked page load
|
|
21
|
+
* (epoch), oldest first, capped by count and bytes, read through cursors.
|
|
22
|
+
* Losses are counted per epoch and reason until the epoch is forgotten or
|
|
23
|
+
* the timeline cleared (§6.7 B/C). `onChange` runs whenever what a reader
|
|
24
|
+
* sees changes.
|
|
25
|
+
*/
|
|
26
|
+
export declare class StateTimeline {
|
|
27
|
+
private stored;
|
|
28
|
+
private entriesCache;
|
|
29
|
+
private bytes;
|
|
30
|
+
/** Newest seq issued (= the current cursor). */
|
|
31
|
+
private seq;
|
|
32
|
+
/** Cursor value at the last removal; older cursors must start over. */
|
|
33
|
+
private resetAt;
|
|
34
|
+
/** Seq of the newest entry trimmed by the caps; cursors below it missed entries. */
|
|
35
|
+
private trimmedAt;
|
|
36
|
+
private drops;
|
|
37
|
+
private tooLarge;
|
|
38
|
+
/** Per epoch: whether the runtime has a first sample of every tracked $state yet. */
|
|
39
|
+
private baselines;
|
|
40
|
+
private readonly onChange;
|
|
41
|
+
constructor(onChange: () => void);
|
|
42
|
+
get entries(): StateTimelineEntry[];
|
|
43
|
+
/**
|
|
44
|
+
* Two payload shapes (§6.4):
|
|
45
|
+
* - delta: `{ epoch, changes, reset? }` — `changes` are new since the
|
|
46
|
+
* previous push from that page load; `reset` replaces that epoch's
|
|
47
|
+
* entries. Entries are kept per epoch, so several app tabs (or a reload)
|
|
48
|
+
* interleave instead of wiping each other.
|
|
49
|
+
* - legacy full snapshot: `{ changes }` — only the entries after the
|
|
50
|
+
* newest one already held are appended, so clients still get deltas.
|
|
51
|
+
*/
|
|
52
|
+
ingest(data: TimelinePush | undefined): void;
|
|
53
|
+
private appendLegacy;
|
|
54
|
+
/** Changes after `since` (a previous `cursor`), or the whole buffer when the cursor is stale. */
|
|
55
|
+
delta(since?: number): StateTimelineDelta;
|
|
56
|
+
/** Remove `epoch`'s entries, invalidating every cursor issued so far. */
|
|
57
|
+
dropEpoch(epoch: string): void;
|
|
58
|
+
/** An evicted page load: its entries and every counter about it. */
|
|
59
|
+
forget(epoch: string): void;
|
|
60
|
+
clear(): void;
|
|
61
|
+
/** Capture info (§6.7 B); the baseline is the served `epoch`'s. */
|
|
62
|
+
captureInfo(epoch: string | undefined): CaptureInfo;
|
|
63
|
+
private markReset;
|
|
64
|
+
/**
|
|
65
|
+
* Add the runtime's own losses (unsent entries it evicted, §6.7 C) and
|
|
66
|
+
* too-large values to the epoch's counters. Only runtime reasons are
|
|
67
|
+
* accepted from the runtime; server reasons are counted here.
|
|
68
|
+
*/
|
|
69
|
+
private countRuntimeLosses;
|
|
70
|
+
private addDrop;
|
|
71
|
+
private append;
|
|
72
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-devtools-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Svelte DevTools for Vite: standalone on your dev server or inside the Vite DevTools dock",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"devtools",
|
|
@@ -26,14 +26,16 @@
|
|
|
26
26
|
"skills"
|
|
27
27
|
],
|
|
28
28
|
"type": "module",
|
|
29
|
+
"sideEffects": false,
|
|
29
30
|
"main": "./dist/index.mjs",
|
|
30
31
|
"module": "./dist/index.mjs",
|
|
31
32
|
"types": "./dist/index.d.ts",
|
|
32
33
|
"exports": {
|
|
33
34
|
".": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
}
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.mjs"
|
|
37
|
+
},
|
|
38
|
+
"./package.json": "./package.json"
|
|
37
39
|
},
|
|
38
40
|
"publishConfig": {
|
|
39
41
|
"access": "public"
|
|
@@ -47,6 +49,8 @@
|
|
|
47
49
|
"devDependencies": {
|
|
48
50
|
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
|
49
51
|
"@types/node": "^25.6.2",
|
|
52
|
+
"@vitest/coverage-v8": "^5.0.3",
|
|
53
|
+
"fast-check": "^4.10.2",
|
|
50
54
|
"happy-dom": "^20.14.5",
|
|
51
55
|
"svelte": "^5.57.1",
|
|
52
56
|
"typescript": "^6.0.3",
|
|
@@ -64,6 +68,7 @@
|
|
|
64
68
|
"build": "vite build",
|
|
65
69
|
"dev": "vite build --watch",
|
|
66
70
|
"test": "vitest run",
|
|
71
|
+
"test:coverage": "vitest run --coverage",
|
|
67
72
|
"test:watch": "vitest"
|
|
68
73
|
}
|
|
69
74
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: vite-devtools-svelte
|
|
2
|
+
name: vite-devtools-svelte-perf-audit
|
|
3
3
|
description: Use when the user asks to audit Svelte/SvelteKit app performance, find render hotspots, or identify what to optimize. Requires the vite-devtools-svelte MCP server to be registered (the dev server prints `claude mcp add ...` on startup). Always interactive — the user picks which issues to fix; never starts editing on its own.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -21,7 +21,7 @@ If either is missing, stop and tell the user what to do; do not invent metrics.
|
|
|
21
21
|
3. Call `end_session` with `keep: "memory"`. Note the session id from the response — you will need it later.
|
|
22
22
|
4. Call `list_performance_issues` (no thresholds first; defaults are sensible). Read the `issues` array.
|
|
23
23
|
5. Present the top 3 issues to the user as a compact table: `severity | kind | summary | file`. Add any context from the `metric` field that aids interpretation.
|
|
24
|
-
6. Ask the user which issue (if any) to investigate. **Do not implement fixes in this skill.** Hand off to `/vite-devtools-svelte
|
|
24
|
+
6. Ask the user which issue (if any) to investigate. **Do not implement fixes in this skill.** Hand off to `/vite-devtools-svelte-perf-fix <issue id or summary>` once they pick one.
|
|
25
25
|
|
|
26
26
|
## Guardrails
|
|
27
27
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: vite-devtools-svelte
|
|
3
|
-
description: Use to apply a single, scoped performance fix to a Svelte/SvelteKit app and verify the change with before/after measurements. Pairs with /vite-devtools-svelte
|
|
2
|
+
name: vite-devtools-svelte-perf-fix
|
|
3
|
+
description: Use to apply a single, scoped performance fix to a Svelte/SvelteKit app and verify the change with before/after measurements. Pairs with /vite-devtools-svelte-perf-audit (which identifies issues). One issue per invocation. Requires the vite-devtools-svelte MCP server.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Svelte performance fix
|
|
@@ -9,7 +9,7 @@ You are about to fix exactly **one** performance issue and verify it with measur
|
|
|
9
9
|
|
|
10
10
|
## Inputs
|
|
11
11
|
|
|
12
|
-
The user will name an issue. Resolve it to a target by calling the matching detail tool — `get_component_hotspots`, `get_reactive_graph_problems`, `get_load_waterfall`, `get_fps_drops`, or `get_render_profile` — based on the issue `kind` / `suggestedTool` from `/vite-devtools-svelte
|
|
12
|
+
The user will name an issue. Resolve it to a target by calling the matching detail tool — `get_component_hotspots`, `get_reactive_graph_problems`, `get_load_waterfall`, `get_fps_drops`, or `get_render_profile` — based on the issue `kind` / `suggestedTool` from `/vite-devtools-svelte-perf-audit`.
|
|
13
13
|
|
|
14
14
|
## Workflow
|
|
15
15
|
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{A as e,At as t,Dt as n,F as r,I as i,J as a,Mt as o,N as s,Nt as c,O as l,Ot as u,P as d,Pt as ee,St as f,T as p,Tt as m,U as h,X as g,Y as te,a as _,at as v,bt as y,ct as b,dt as x,ft as S,gt as C,it as w,jt as T,kt as ne,mt as E,ot as D,pt as re,q as ie,st as O,tt as k,ut as A,wt as j,xt as M,yt as N}from"./index-CuoAAt-d.js";import{i as ae,o as oe}from"./format-CW_NXiBg.js";import{n as se,t as P}from"./Badge-x4Lbd8pc.js";import{t as ce}from"./SplitView-DVk1HAf9.js";import{t as F}from"./VirtualList-Ba0GhFn8.js";import{t as I}from"./SearchField-D85HSGV_.js";var L=b(`<span class="methods svelte-1wcbixy"><!> <!></span> <span class="truncate mono path svelte-1wcbixy"><!></span>`,1),le=b(`<option> </option>`),ue=b(`<span class="err-dot svelte-1wcbixy"></span>`),de=b(`<button class="file mono svelte-1wcbixy" title="Open handler in editor"> </button>`),fe=b(`<textarea class="input editor svelte-1wcbixy" aria-label="Request body" spellcheck="false"></textarea>`),pe=b(`<p class="hint svelte-1wcbixy"> </p>`),me=b(`<p class="hint error svelte-1wcbixy"> </p>`),he=b(`<textarea class="input editor svelte-1wcbixy" aria-label="Request headers as JSON" spellcheck="false"></textarea> <!>`,1),ge=b(`<p class="mono"> </p>`),_e=b(`<dt class="mono"> </dt><dd class="mono"> </dd>`,1),ve=b(`<header class="res-head svelte-1wcbixy"><!> <span class="num muted"> </span> <span class="num muted"> </span> <details class="hdrs svelte-1wcbixy"><summary class="svelte-1wcbixy"> </summary> <dl class="kv svelte-1wcbixy"></dl></details></header> <pre class="body mono svelte-1wcbixy"> </pre>`,1),ye=b(`<p>Pick an endpoint on the left or type any URL. <kbd class="svelte-1wcbixy">⌘</kbd> <kbd class="svelte-1wcbixy">↵</kbd> sends.</p>`),be=b(`<div class="client svelte-1wcbixy"><form class="bar svelte-1wcbixy"><select class="select method svelte-1wcbixy" aria-label="HTTP method"></select> <input class="input url mono svelte-1wcbixy" placeholder="http://localhost:5173/api/…" aria-label="Request URL" spellcheck="false"/> <!></form> <div class="tabs svelte-1wcbixy" role="tablist" aria-label="Request parts"><button role="tab" class="svelte-1wcbixy">Body</button> <button role="tab" class="svelte-1wcbixy">Headers <!></button> <!></div> <div class="req svelte-1wcbixy" role="tabpanel"><!></div> <section class="res svelte-1wcbixy" aria-label="Response" aria-live="polite"><!></section></div>`);function R(b,x){t(x,!0);let R=i(_,{initial:[]}),xe=[`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`HEAD`,`OPTIONS`],z=e=>e===`GET`?`blue`:e===`POST`?`green`:e===`DELETE`?`red`:e===`HEAD`||e===`OPTIONS`?`neutral`:`yellow`,B=m(``),V=m(null),H=m(`GET`),U=m(``),W=m(`{
|
|
2
|
-
|
|
3
|
-
}`),G=m(``),K=m(`body`),q=m(!1),J=m(null),Y=m(null),X=n(()=>{let e=s(E(B));return e?R.data.filter(t=>e(t.path,t.route,t.methods.join(` `))):R.data}),Z=n(()=>E(V)?R.data.find(e=>e.route===E(V))??null:null),Q=n(()=>{if(!E(W).trim())return null;try{let e=JSON.parse(E(W));return e&&typeof e==`object`&&!Array.isArray(e)?null:`Headers must be a JSON object`}catch(e){return e.message}}),Se=n(()=>E(H)!==`GET`&&E(H)!==`HEAD`),Ce=n(()=>{if(!E(J)?.body)return``;if((Object.entries(E(J).headers).find(([e])=>e.toLowerCase()===`content-type`)?.[1]??``).includes(`json`)||/^\s*[[{]/.test(E(J).body))try{return JSON.stringify(JSON.parse(E(J).body),null,2)}catch{}return E(J).body});function we(e){j(V,e.route,!0),j(H,e.methods[0]??`GET`,!0),j(U,new URL(e.path,location.origin).href,!0),j(J,null),j(Y,null)}async function $(){if(!(!E(U)||E(Q)||E(q))){j(q,!0),j(Y,null);try{j(J,await l(E(U),E(H),E(W).trim()||`{}`,E(Se)?E(G):``),!0)}catch(e){j(J,null),j(Y,e instanceof Error?e.message:String(e),!0)}finally{j(q,!1)}}}function Te(e){(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),$())}function Ee(e){return e>=200&&e<300?`green`:e>=300&&e<400?`yellow`:e>=400?`red`:`neutral`}se(b,{title:`API`,get count(){return R.data.length},toolbar:e=>{I(e,{placeholder:`Filter endpoints…`,get count(){return E(X).length},get value(){return E(B)},set value(e){j(B,e,!0)}})},actions:e=>{d(e,{icon:`refresh`,variant:`ghost`,label:`Rescan endpoints`,get disabled(){return R.busy},onclick:()=>R.refresh()})},children:(t,i)=>{ce(t,{id:`api`,side:`start`,initial:300,min:200,aside:t=>{F(t,{get items(){return E(X)},getKey:e=>e.route,label:`API endpoints`,onselect:we,get selected(){return E(V)},set selected(e){j(V,e,!0)},row:(t,r=c)=>{var i=L(),a=y(i),s=N(a);k(s,16,()=>r().methods.slice(0,3),e=>e,(e,t)=>{{let r=n(()=>z(t));P(e,{get tone(){return E(r)},children:(e,n)=>{T();var r=A();C(()=>v(r,t)),D(e,r)},$$slots:{default:!0}})}});var l=f(s,2),u=e=>{P(e,{children:(e,t)=>{T();var n=A();C(()=>v(n,`+${r().methods.length-3}`)),D(e,n)},$$slots:{default:!0}})};w(l,e=>{r().methods.length>3&&e(u)}),o(a);var d=f(a,2),ee=N(d);e(ee,{get text(){return r().path},get query(){return E(B)}}),o(d),D(t,i)},empty:e=>{var t=O(),i=y(t),a=e=>{r(e,{title:`Scanning +server files…`})},o=e=>{{let t=n(()=>R.data.length?`No endpoints match`:`No +server endpoints`);r(e,{icon:`api`,get title(){return E(t)}})}};w(i,e=>{R.loading?e(a):e(o,-1)}),D(e,t)},$$slots:{row:!0,empty:!0}})},children:(e,t)=>{var i=be(),s=N(i),c=N(s);k(c,20,()=>E(Z)?.methods.length?E(Z).methods:xe,e=>e,(e,t)=>{var n=le(),r=M(n,!0),i={};C(()=>{v(r,t),i!==(i=t)&&(n.__value=i)}),D(e,n)}),o(c),g(c);var l=f(c,2);ie(l);var m=f(l,2);{let e=n(()=>!E(U)||!!E(Q)||E(q));d(m,{type:`submit`,variant:`primary`,icon:`send`,get disabled(){return E(e)},title:`Send (⌘↵)`,children:(e,t)=>{T();var n=A();C(()=>v(n,E(q)?`Sending…`:`Send`)),D(e,n)},$$slots:{default:!0}})}o(s);var _=f(s,2),b=N(_),x=f(b,2),ne=f(N(x)),se=e=>{var t=ue();C(()=>a(t,`title`,E(Q))),D(e,t)};w(ne,e=>{E(Q)&&e(se)}),o(x);var ce=f(x,2),F=e=>{var t=de(),n=M(t,!0);C(()=>v(n,E(Z).file)),S(`click`,t,()=>p(E(Z).file).catch(()=>{})),D(e,t)};w(ce,e=>{E(Z)&&e(F)}),o(_);var I=f(_,2),L=N(I),R=e=>{var t=O(),n=y(t),r=e=>{var t=fe();u(t),a(t,`placeholder`,`{ "name": "value" }`),h(t,()=>E(G),e=>j(G,e)),D(e,t)},i=e=>{var t=pe(),n=M(t);C(()=>v(n,`${E(H)??``} requests have no body.`)),D(e,t)};w(n,e=>{E(Se)?e(r):e(i,-1)}),D(e,t)},z=e=>{var t=he(),n=y(t);u(n);var r=f(n,2),i=e=>{var t=me(),n=M(t,!0);C(()=>v(n,E(Q))),D(e,t)};w(r,e=>{E(Q)&&e(i)}),C(()=>a(n,`aria-invalid`,!!E(Q))),h(n,()=>E(W),e=>j(W,e)),D(e,t)};w(L,e=>{E(K)===`body`?e(R):e(z,-1)}),o(I);var B=f(I,2),V=N(B),X=e=>{r(e,{icon:`errors`,tone:`error`,title:`Request failed`,children:(e,t)=>{var n=ge(),r=M(n,!0);C(()=>v(r,E(Y))),D(e,n)},$$slots:{default:!0}})},we=e=>{var t=ve(),r=y(t),i=N(r);{let e=n(()=>Ee(E(J).status));P(i,{get tone(){return E(e)},children:(e,t)=>{T();var n=A();C(()=>v(n,`${E(J).status??``} ${E(J).statusText??``}`)),D(e,n)},$$slots:{default:!0}})}var a=f(i,2),s=M(a,!0),c=f(a,2),l=M(c,!0),u=f(c,2),d=N(u),p=M(d),m=f(d,2);k(m,21,()=>Object.entries(E(J).headers),([e,t])=>e,(e,t)=>{var r=n(()=>ee(E(t),2));let i=()=>E(r)[0],a=()=>E(r)[1];var o=_e(),s=y(o),c=M(s,!0),l=f(s),u=M(l,!0);C(()=>{v(c,i()),v(u,a())}),D(e,o)}),o(m),o(u),o(r);var h=f(r,2),g=M(h,!0);C((e,t,n)=>{v(s,e),v(l,t),v(p,`${n??``} headers`),v(g,E(Ce)||`(empty body)`)},[()=>oe(E(J).duration),()=>ae(new Blob([E(J).body]).size),()=>Object.keys(E(J).headers).length]),D(e,t)},De=e=>{r(e,{icon:`send`,title:`Send a request`,children:(e,t)=>{var n=ye();D(e,n)},$$slots:{default:!0}})};w(V,e=>{E(Y)?e(X):E(J)?e(we,1):e(De,-1)}),o(B),o(i),C(()=>{a(b,`aria-selected`,E(K)===`body`),a(x,`aria-selected`,E(K)===`headers`)}),S(`keydown`,i,Te),re(`submit`,s,e=>{e.preventDefault(),$()}),te(c,()=>E(H),e=>j(H,e)),h(l,()=>E(U),e=>j(U,e)),S(`click`,b,()=>j(K,`body`)),S(`click`,x,()=>j(K,`headers`)),D(e,i)},$$slots:{aside:!0,default:!0}})},$$slots:{toolbar:!0,actions:!0,default:!0}}),ne()}x([`keydown`,`click`]);export{R as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,At as t,Ct as n,Dt as r,F as i,I as a,J as o,L as s,Mt as c,N as l,Nt as u,P as d,St as f,T as p,Tt as m,Z as h,at as g,bt as _,ct as v,gt as y,it as b,jt as x,kt as S,mt as C,o as w,ot as T,st as E,ut as D,wt as O,xt as k,yt as A}from"./index-CuoAAt-d.js";import{i as j}from"./format-CW_NXiBg.js";import{n as M,t as N}from"./Badge-x4Lbd8pc.js";import{t as P}from"./SplitView-DVk1HAf9.js";import{t as F}from"./SearchField-D85HSGV_.js";import{t as I}from"./DataTable-CdM2Vyvn.js";import{t as L}from"./Inspector-C4wr2Zb4.js";import{t as R}from"./Segmented-BCcIUjA2.js";var z=v(`<!> <!>`,1),B=v(`<span class="total num svelte-qp140w" title="Total size of shown assets"> </span> <!>`,1),V=v(`<div class="preview svelte-qp140w"><img loading="lazy" class="svelte-qp140w"/></div>`),H=v(`<!> <h3 class="section-title">Details</h3> <dl class="kv"><dt>Public URL</dt><dd class="mono"> </dd> <dt>Size</dt><dd class="num"> <span class="faint"> </span></dd> <dt>Modified</dt><dd> </dd> <dt>Disk path</dt><dd class="mono faint"> </dd></dl>`,1),ee=v(`<span class="muted truncate mono small svelte-qp140w"> </span>`),te=v(`<span class="end faint num small svelte-qp140w"> </span>`),ne=v(`<span class="file svelte-qp140w"><!> <span class="truncate"><!></span></span> <!> <!> <span class="size end svelte-qp140w"><span class="bar svelte-qp140w"></span> <span class="num"> </span></span>`,1),re=v(`<p class="mono"> </p>`);function U(v,U){t(U,!0);let W=a(w,{initial:[]});function G(e){let t=e.split(`/`)[0];return t===`image`||t===`font`||t===`video`||t===`audio`||t===`text`?t:`other`}let ie={image:`assets`,font:`file`,video:`play`,audio:`play`,text:`file`,other:`file`},K=m(``),q=m(`all`),J=m(n({id:`size`,desc:!0})),Y=m(null),X=r(()=>{let e=new Map;for(let t of W.data)e.set(G(t.type),(e.get(G(t.type))??0)+1);return e}),ae=r(()=>[{value:`all`,label:`All`,count:W.data.length},...[`image`,`font`,`video`,`audio`,`text`,`other`].filter(e=>C(X).get(e)).map(e=>({value:e,label:e[0].toUpperCase()+e.slice(1),count:C(X).get(e)}))]),Z=r(()=>{let e=l(C(K));return W.data.filter(t=>(C(q)===`all`||G(t.type)===C(q))&&(!e||e(t.relativePath,t.type)))}),oe=r(()=>C(Z).reduce((e,t)=>e+t.size,0)),se=r(()=>W.data.reduce((e,t)=>Math.max(e,t.size),1)),Q=r(()=>C(Y)?W.data.find(e=>e.path===C(Y))??null:null),ce=[{id:`name`,label:`File`,width:`minmax(0, 1fr)`,sort:(e,t)=>e.relativePath.localeCompare(t.relativePath)},{id:`type`,label:`Type`,width:`120px`,minWidth:640,sort:(e,t)=>e.type.localeCompare(t.type)},{id:`mtime`,label:`Modified`,width:`96px`,align:`end`,minWidth:760,descFirst:!0,sort:(e,t)=>e.mtime-t.mtime},{id:`size`,label:`Size`,width:`140px`,align:`end`,descFirst:!0,sort:(e,t)=>e.size-t.size}];function $(e){return e.url||`/`+e.relativePath}M(v,{title:`Assets`,get count(){return W.data.length},toolbar:e=>{var t=z(),n=_(t);R(n,{label:`Asset type`,get options(){return C(ae)},get value(){return C(q)},set value(e){O(q,e,!0)}});var r=f(n,2);F(r,{placeholder:`Filter assets…`,get count(){return C(Z).length},get value(){return C(K)},set value(e){O(K,e,!0)}}),T(e,t)},actions:e=>{var t=B(),n=_(t),r=k(n,!0),i=f(n,2);d(i,{icon:`refresh`,variant:`ghost`,label:`Rescan static directory`,get disabled(){return W.busy},onclick:()=>W.refresh()}),y(e=>g(r,e),[()=>j(C(oe))]),T(e,t)},children:(t,n)=>{{let n=e=>{var t=E(),n=_(t),i=e=>{L(e,{get title(){return C(Q).name},get subtitle(){return C(Q).relativePath},onclose:()=>O(Y,null),badges:e=>{var t=z(),n=_(t);N(n,{children:(e,t)=>{x();var n=D();y(()=>g(n,C(Q).type)),T(e,n)},$$slots:{default:!0}});var i=f(n,2);{let e=r(()=>C(Q).size>5e5?`yellow`:`neutral`);N(i,{get tone(){return C(e)},children:(e,t)=>{x();var n=D();y(e=>g(n,e),[()=>j(C(Q).size)]),T(e,n)},$$slots:{default:!0}})}T(e,t)},actions:e=>{var t=z(),n=_(t);d(n,{icon:`external`,onclick:()=>window.open($(C(Q)),`_blank`,`noopener`),children:(e,t)=>{x();var n=D(`Open URL`);T(e,n)},$$slots:{default:!0}});var r=f(n,2);d(r,{icon:`editor`,onclick:()=>p(C(Q).path).catch(()=>{}),children:(e,t)=>{x();var n=D(`Reveal`);T(e,n)},$$slots:{default:!0}}),T(e,t)},children:(e,t)=>{var n=H(),i=_(n),a=e=>{var t=V(),n=k(t);y(e=>{o(n,`src`,e),o(n,`alt`,C(Q).name)},[()=>$(C(Q))]),T(e,t)},s=r(()=>C(Q).type.startsWith(`image/`));b(i,e=>{C(s)&&e(a)});var l=f(i,4),u=f(A(l)),d=k(u,!0),p=f(u,3),m=A(p),h=f(m),v=k(h);c(p);var x=f(p,3),S=k(x,!0),w=f(x,3),E=k(w,!0);c(l),y((e,t,n,r)=>{g(d,e),g(m,`${t??``} `),g(v,`(${n??``} bytes)`),g(S,r),g(E,C(Q).path)},[()=>$(C(Q)),()=>j(C(Q).size),()=>C(Q).size.toLocaleString(),()=>new Date(C(Q).mtime).toLocaleString()]),T(e,n)},$$slots:{badges:!0,actions:!0,default:!0}})};b(n,e=>{C(Q)&&e(i)}),T(e,t)},a=r(()=>!!C(Q));P(t,{id:`assets`,get open(){return C(a)},aside:n,children:(t,n)=>{I(t,{get items(){return C(Z)},get columns(){return ce},getKey:e=>e.path,label:`Static assets`,onactivate:e=>p(e.path).catch(()=>{}),get sort(){return C(J)},set sort(e){O(J,e,!0)},get selected(){return C(Y)},set selected(e){O(Y,e,!0)},row:(t,n=u,i)=>{let a=()=>(i?.()).visible;var o=ne(),l=_(o),d=A(l);{let e=r(()=>ie[G(n().type)]);s(d,{get name(){return C(e)},size:14})}var p=f(d,2),m=A(p);e(m,{get text(){return n().relativePath},get query(){return C(K)}}),c(p),c(l);var v=f(l,2),x=e=>{var t=ee(),r=k(t,!0);y(()=>g(r,n().type)),T(e,t)},S=r(()=>a().has(`type`));b(v,e=>{C(S)&&e(x)});var w=f(v,2),E=e=>{var t=te(),r=k(t,!0);y(e=>g(r,e),[()=>new Date(n().mtime).toLocaleDateString()]),T(e,t)},D=r(()=>a().has(`mtime`));b(w,e=>{C(D)&&e(E)});var O=f(w,2),M=A(O);let N;var P=f(M,2),F=k(P,!0);c(O),y((e,t)=>{N=h(M,``,N,{width:e}),g(F,t)},[()=>`${Math.max(2,n().size/C(se)*56)}px`,()=>j(n().size)]),T(t,o)},empty:e=>{var t=E(),n=_(t),a=e=>{i(e,{title:`Scanning static directory…`})},o=e=>{i(e,{icon:`errors`,tone:`error`,title:`Could not read assets`,children:(e,t)=>{var n=re(),r=k(n,!0);y(()=>g(r,W.error)),T(e,n)},$$slots:{default:!0}})},s=e=>{{let t=r(()=>W.data.length?`No assets match`:`No static assets`);i(e,{icon:`assets`,get title(){return C(t)}})}};b(n,e=>{W.loading?e(a):W.error?e(o,1):e(s,-1)}),T(e,t)},$$slots:{row:!0,empty:!0}})},$$slots:{aside:!0,default:!0}})}},$$slots:{toolbar:!0,actions:!0,default:!0}}),S()}export{U as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.panel.svelte-6jyhgm{flex-direction:column;min-width:0;height:100%;display:flex}.header.svelte-6jyhgm{min-height:var(--header-h);border-bottom:1px solid var(--border);flex-wrap:wrap;flex-shrink:0;align-items:center;gap:6px 10px;padding:8px 12px 8px 16px;display:flex}.title.svelte-6jyhgm{font-size:var(--fs-md);letter-spacing:-.005em;white-space:nowrap;align-items:baseline;gap:8px;margin:0 6px 0 0;font-weight:600;display:flex}.count.svelte-6jyhgm{font-size:var(--fs-xs);color:var(--fg-faint);font-weight:500}.toolbar.svelte-6jyhgm{flex-wrap:wrap;flex:260px;align-items:center;gap:6px;min-width:0;display:flex}.actions.svelte-6jyhgm{align-items:center;gap:4px;margin-left:auto;display:flex}.body.svelte-6jyhgm{flex:1;min-height:0;position:relative}.body.scroll.svelte-6jyhgm{overflow:auto}.badge.svelte-1fmrh5r{border-radius:var(--radius-sm);height:17px;font-size:var(--fs-2xs);letter-spacing:.01em;white-space:nowrap;font-variant-numeric:tabular-nums;flex-shrink:0;align-items:center;gap:3px;padding:0 6px;font-weight:600;line-height:1;display:inline-flex}.neutral.svelte-1fmrh5r{background:var(--bg-active);color:var(--fg-muted)}.accent.svelte-1fmrh5r{background:var(--bg-selected);color:var(--accent-fg)}.green.svelte-1fmrh5r{background:var(--green-bg);color:var(--green)}.yellow.svelte-1fmrh5r{background:var(--yellow-bg);color:var(--yellow)}.red.svelte-1fmrh5r{background:var(--red-bg);color:var(--red)}.blue.svelte-1fmrh5r{background:var(--blue-bg);color:var(--blue)}.purple.svelte-1fmrh5r{background:var(--purple-bg);color:var(--purple)}.cyan.svelte-1fmrh5r{background:var(--cyan-bg);color:var(--cyan)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,B as t,J as n,Mt as r,Q as i,St as a,at as o,ct as s,gt as c,it as l,ot as u,xt as d,yt as f}from"./index-CuoAAt-d.js";var p=s(`<span class="count num svelte-6jyhgm"> </span>`),m=s(`<div class="toolbar svelte-6jyhgm"><!></div>`),h=s(`<div class="actions svelte-6jyhgm"><!></div>`),g=s(`<section class="panel svelte-6jyhgm"><header class="header svelte-6jyhgm"><h1 class="title svelte-6jyhgm"> <!></h1> <!> <!></header> <div><!></div></section>`);function _(s,_){let v=t(_,`count`,3,null),y=t(_,`scroll`,3,!1);var b=g(),x=f(b),S=f(x),C=f(S),w=a(C),T=e=>{var t=p(),n=d(t,!0);c(()=>o(n,v())),u(e,t)};l(w,e=>{v()!=null&&e(T)}),r(S);var E=a(S,2),D=t=>{var n=m(),i=f(n);e(i,()=>_.toolbar),r(n),u(t,n)};l(E,e=>{_.toolbar&&e(D)});var O=a(E,2),k=t=>{var n=h(),i=f(n);e(i,()=>_.actions),r(n),u(t,n)};l(O,e=>{_.actions&&e(k)}),r(x);var A=a(x,2);let j;var M=f(A);e(M,()=>_.children),r(A),r(b),c(()=>{n(b,`aria-label`,_.title),o(C,`${_.title??``} `),j=i(A,1,`body svelte-6jyhgm`,null,j,{scroll:y()})}),u(s,b)}var v=s(`<span><!></span>`);function y(a,o){let s=t(o,`tone`,3,`neutral`);var l=v(),d=f(l);e(d,()=>o.children),r(l),c(()=>{i(l,1,`badge ${s()??``}`,`svelte-1fmrh5r`),n(l,`title`,o.title)}),u(a,l)}export{_ as n,y as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,At as t,Ct as n,Dt as r,F as i,I as a,J as o,Mt as s,N as c,Nt as l,P as u,Q as d,St as f,Tt as p,Z as m,at as h,bt as g,ct as _,gt as v,it as y,jt as b,kt as x,mt as S,nt as C,ot as w,s as T,st as E,tt as D,ut as O,wt as k,xt as A,yt as j}from"./index-CuoAAt-d.js";import{i as M,t as ee}from"./format-CW_NXiBg.js";import{n as N,t as P}from"./Badge-x4Lbd8pc.js";import{t as F}from"./SplitView-DVk1HAf9.js";import{t as I}from"./SearchField-D85HSGV_.js";import{t as L}from"./DataTable-CdM2Vyvn.js";import{t as R}from"./Inspector-C4wr2Zb4.js";import{t as z}from"./Segmented-BCcIUjA2.js";var B=_(`<!> <!>`,1),te=_(`<span class="stamp svelte-1fwnyq9"> </span>`),ne=_(`<p>Run <code>vite build</code> (or <code>pnpm build</code>) to produce chunks, then refresh.</p> <!>`,1),re=_(`<span></span>`),ie=_(`<span class="svelte-1fwnyq9"><i></i> <span class="num muted svelte-1fwnyq9"> </span></span>`),ae=_(`<!> <!> <!>`,1),oe=_(`<li class="mono truncate svelte-1fwnyq9"><!></li>`),se=_(`<h3 class="section-title">Modules <span class="num"> </span></h3> <ul class="mods svelte-1fwnyq9"></ul>`,1),ce=_(`<span class="end num muted"> </span>`),le=_(`<span class="end num faint"> </span>`),ue=_(`<span class="chunk svelte-1fwnyq9"><!> <span class="truncate mono file svelte-1fwnyq9"><!></span> <!></span> <!> <!> <span class="size end svelte-1fwnyq9"><span></span> <span> </span></span>`,1),de=_(`<div class="layout svelte-1fwnyq9"><div class="composition svelte-1fwnyq9" aria-label="Bundle composition"><div class="total svelte-1fwnyq9"><span class="muted">Total</span> <strong class="num svelte-1fwnyq9"> </strong></div> <div class="stack svelte-1fwnyq9" role="img"></div> <div class="legend svelte-1fwnyq9"></div></div> <div class="table svelte-1fwnyq9"><!></div></div>`);function V(_,V){t(V,!0);let H=a(T,{initial:null}),U=p(``),W=p(`all`),G=p(n({id:`size`,desc:!0})),K=p(null),q=e=>e.file.split(`.`).pop()??``,J=e=>q(e)===`js`||q(e)===`mjs`?`js`:q(e)===`css`?`css`:`other`,Y={js:`yellow`,css:`purple`,other:`neutral`},X=r(()=>H.data?.chunks??[]),fe=r(()=>{let e=c(S(U));return S(X).filter(t=>(S(W)===`all`||J(t)===S(W))&&(!e||e(t.file,t.name,...t.modules)))}),Z=r(()=>H.data?.totalSize??0),pe=r(()=>S(X).reduce((e,t)=>Math.max(e,t.size),1)),Q=r(()=>S(K)?S(X).find(e=>e.file===S(K))??null:null),$=r(()=>{let e={js:0,css:0,other:0};for(let t of S(X))e[J(t)]+=t.size;return e}),me=[{id:`file`,label:`Chunk`,width:`minmax(0, 1fr)`,sort:(e,t)=>e.file.localeCompare(t.file)},{id:`modules`,label:`Modules`,width:`72px`,align:`end`,descFirst:!0,minWidth:560,sort:(e,t)=>e.modules.length-t.modules.length},{id:`share`,label:`Share`,width:`64px`,align:`end`,descFirst:!0,minWidth:640,sort:(e,t)=>e.size-t.size},{id:`size`,label:`Size`,width:`150px`,align:`end`,descFirst:!0,sort:(e,t)=>e.size-t.size}];N(_,{title:`Build`,get count(){return S(X).length},toolbar:e=>{var t=B(),n=g(t);{let e=r(()=>[{value:`all`,label:`All`},{value:`js`,label:`JS`,count:S(X).filter(e=>J(e)===`js`).length},{value:`css`,label:`CSS`,count:S(X).filter(e=>J(e)===`css`).length},{value:`other`,label:`Other`,count:S(X).filter(e=>J(e)===`other`).length}]);z(n,{label:`Chunk type`,get options(){return S(e)},get value(){return S(W)},set value(e){k(W,e,!0)}})}var i=f(n,2);I(i,{placeholder:`Filter chunks or modules…`,get count(){return S(fe).length},get value(){return S(U)},set value(e){k(U,e,!0)}}),w(e,t)},actions:e=>{var t=B(),n=g(t),r=e=>{var t=te(),n=A(t);v(e=>h(n,`built ${e??``}`),[()=>new Date(H.data.timestamp).toLocaleString()]),w(e,t)};y(n,e=>{H.data?.timestamp&&e(r)});var i=f(n,2);u(i,{icon:`refresh`,variant:`ghost`,label:`Re-read build output`,get disabled(){return H.busy},onclick:()=>H.refresh()}),w(e,t)},children:(t,n)=>{var a=E(),c=g(a),p=e=>{i(e,{icon:`build`,title:`No build output found`,children:(e,t)=>{var n=ne(),r=f(g(n),2);u(r,{icon:`refresh`,onclick:()=>H.refresh(),children:(e,t)=>{b();var n=O(`Refresh`);w(e,n)},$$slots:{default:!0}}),w(e,n)},$$slots:{default:!0}})},_=t=>{var n=de(),a=j(n),c=j(a),u=f(j(c),2),p=A(u,!0);s(c);var _=f(c,2);D(_,20,()=>[`js`,`css`,`other`],e=>e,(e,t)=>{var n=E(),r=g(n),i=e=>{var n=re();let r;v(e=>{d(n,1,`seg ${t??``}`,`svelte-1fwnyq9`),o(n,`title`,`${t??``}: ${e??``}`),r=m(n,``,r,{"flex-grow":S($)[t]})},[()=>M(S($)[t])]),w(e,n)};y(r,e=>{S($)[t]&&e(i)}),w(e,n)}),s(_);var x=f(_,2);D(x,20,()=>[`js`,`css`,`other`],e=>e,(e,t)=>{var n=ie(),r=j(n),i=f(r),a=f(i),o=A(a,!0);s(n),v((e,n)=>{d(r,1,`dot ${t??``}`,`svelte-1fwnyq9`),h(i,`${e??``} `),h(o,n)},[()=>t.toUpperCase(),()=>M(S($)[t])]),w(e,n)}),s(x),s(a);var T=f(a,2),N=j(T);{let t=t=>{var n=E(),i=g(n),a=t=>{{let n=e=>{var t=ae(),n=g(t);{let e=r(()=>Y[J(S(Q))]);P(n,{get tone(){return S(e)},children:(e,t)=>{b();var n=O();v(e=>h(n,e),[()=>q(S(Q))]),w(e,n)},$$slots:{default:!0}})}var i=f(n,2);P(i,{children:(e,t)=>{b();var n=O();v(e=>h(n,e),[()=>M(S(Q).size)]),w(e,n)},$$slots:{default:!0}});var a=f(i,2),o=e=>{P(e,{tone:`accent`,children:(e,t)=>{b();var n=O(`entry`);w(e,n)},$$slots:{default:!0}})};y(a,e=>{S(Q).isEntry&&e(o)}),w(e,t)},i=r(()=>ee(S(Q).file));R(t,{get title(){return S(i)},get subtitle(){return S(Q).file},onclose:()=>k(K,null),badges:n,children:(t,n)=>{var r=se(),i=g(r),a=f(j(i)),c=A(a,!0);s(i);var l=f(i,2);D(l,21,()=>S(Q).modules.slice(0,1e3),C,(t,n)=>{var r=oe(),i=j(r);e(i,{get text(){return S(n)},get query(){return S(U)}}),s(r),v(()=>o(r,`title`,S(n))),w(t,r)}),s(l),v(()=>h(c,S(Q).modules.length)),w(t,r)},$$slots:{badges:!0,default:!0}})}};y(i,e=>{S(Q)&&e(a)}),w(t,n)},n=r(()=>!!S(Q));F(N,{id:`build`,get open(){return S(n)},aside:t,children:(t,n)=>{L(t,{get items(){return S(fe)},get columns(){return me},getKey:e=>e.file,label:`Build chunks`,get sort(){return S(G)},set sort(e){k(G,e,!0)},get selected(){return S(K)},set selected(e){k(K,e,!0)},row:(t,n=l,i)=>{let a=()=>(i?.()).visible;var o=ue(),c=g(o),u=j(c);{let e=r(()=>Y[J(n())]);P(u,{get tone(){return S(e)},children:(e,t)=>{b();var r=O();v(e=>h(r,e),[()=>q(n())]),w(e,r)},$$slots:{default:!0}})}var p=f(u,2),_=j(p);e(_,{get text(){return n().file},get query(){return S(U)}}),s(p);var x=f(p,2),C=e=>{P(e,{tone:`accent`,children:(e,t)=>{b();var n=O(`entry`);w(e,n)},$$slots:{default:!0}})};y(x,e=>{n().isEntry&&e(C)}),s(c);var T=f(c,2),E=e=>{var t=ce(),r=A(t,!0);v(()=>h(r,n().modules.length)),w(e,t)},D=r(()=>a().has(`modules`));y(T,e=>{S(D)&&e(E)});var k=f(T,2),ee=e=>{var t=le(),r=A(t);v(e=>h(r,`${e??``}%`),[()=>S(Z)?(n().size/S(Z)*100).toFixed(1):0]),w(e,t)},N=r(()=>a().has(`share`));y(k,e=>{S(N)&&e(ee)});var F=f(k,2),I=j(F);let L;var R=f(I,2);let z;var B=A(R,!0);s(F),v((e,t,r)=>{d(I,1,`bar ${e??``}`,`svelte-1fwnyq9`),L=m(I,``,L,{width:t}),z=d(R,1,`num svelte-1fwnyq9`,null,z,{big:n().size>25e4}),h(B,r)},[()=>J(n()),()=>`${Math.max(2,n().size/S(pe)*60)}px`,()=>M(n().size)]),w(t,o)},empty:e=>{{let t=r(()=>H.loading?void 0:`search`),n=r(()=>H.loading?`Reading build output…`:`No chunks match`);i(e,{get icon(){return S(t)},get title(){return S(n)}})}},$$slots:{row:!0,empty:!0}})},$$slots:{aside:!0,default:!0}})}s(T),s(n),v((e,t,n,r)=>{h(p,e),o(_,`aria-label`,`JS ${t??``}, CSS ${n??``}, other ${r??``}`)},[()=>M(S(Z)),()=>M(S($).js),()=>M(S($).css),()=>M(S($).other)]),w(t,n)};y(c,e=>{!H.loading&&S(X).length===0?e(p):e(_,-1)}),w(t,a)},$$slots:{toolbar:!0,actions:!0,default:!0}}),x()}export{V as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{At as e,B as t,Dt as n,J as r,L as i,Mt as a,St as o,at as s,bt as c,ct as l,gt as u,it as d,jt as f,kt as p,mt as m,ot as h,st as g,ut as _,xt as v,yt as y}from"./index-CuoAAt-d.js";var b=l(`of <span class="num"> </span>`,1),x=l(`Showing <!> <strong class="num svelte-52vxjm"> </strong> <!>`,1),S=l(`<!> <span class="num"> </span> dropped`,1),C=l(`<!> <span class="num"> </span> detached`,1),w=l(`<!> stale`,1),T=l(`<span class="notice svelte-52vxjm" role="status"><!> <!> <!> <!> <!></span>`);function E(l,E){e(E,!0);let D=t(E,`noun`,3,`items`),O=t(E,`detached`,3,0),k=t(E,`stale`,3,null),A={"runtime-count":`the app buffer was full before they were sent`,"runtime-bytes":`the app buffer hit its size budget before they were sent`,"server-count":`the dev server buffer was full`,"server-bytes":`the dev server buffer hit its size budget`},j=n(()=>!!E.info?.truncated&&(E.info.total===null||E.info.total>E.info.captured)),M=n(()=>E.info?.dropped?.reduce((e,t)=>e+t.count,0)??0),N=n(()=>[m(j)?E.info.total===null?`The dev server keeps ${E.info.captured.toLocaleString()} ${D()}; more exist in the app (total not reported).`:`The dev server keeps ${E.info.captured.toLocaleString()} ${D()}; ${(E.info.total-E.info.captured).toLocaleString()} more exist in the app.`:``,E.info?.policy?`Policy: ${E.info.policy}.`:``,...(E.info?.dropped??[]).filter(e=>e.count>0).map(e=>`${e.count.toLocaleString()} dropped: ${A[e.reason]??e.reason}.`),E.info?.valueTooLarge?`${E.info.valueTooLarge.toLocaleString()} values were too large to snapshot (shown as a size).`:``,O()?`${O().toLocaleString()} ${D()} are shown as roots because their parent was not captured.`:``,k()?`Stale: ${k()}.`:``].filter(Boolean).join(` `));var P=g(),F=c(P),I=e=>{var t=T(),n=y(t);i(n,{name:`warning`,size:12});var l=o(n,2),p=e=>{var t=x(),n=o(c(t)),r=e=>{var t=_();u(()=>s(t,E.info.policy)),h(e,t)};d(n,e=>{E.info.policy&&e(r)});var i=o(n,2),a=v(i,!0),l=o(i,2),f=e=>{var t=_(`of ?`);h(e,t)},p=e=>{var t=b(),n=o(c(t)),r=v(n,!0);u(e=>s(r,e),[()=>E.info.total.toLocaleString()]),h(e,t)};d(l,e=>{E.info.total===null?e(f):e(p,-1)}),u(e=>s(a,e),[()=>E.info.captured.toLocaleString()]),h(e,t)};d(l,e=>{m(j)&&e(p)});var g=o(l,2),D=e=>{var t=S(),n=c(t),r=e=>{var t=_(`·`);h(e,t)};d(n,e=>{m(j)&&e(r)});var i=o(n,2),a=v(i,!0);f(),u(e=>s(a,e),[()=>m(M).toLocaleString()]),h(e,t)};d(g,e=>{m(M)&&e(D)});var A=o(g,2),P=e=>{var t=C(),n=c(t),r=e=>{var t=_(`·`);h(e,t)};d(n,e=>{(m(j)||m(M))&&e(r)});var i=o(n,2),a=v(i,!0);f(),u(e=>s(a,e),[()=>O().toLocaleString()]),h(e,t)};d(A,e=>{O()&&e(P)});var F=o(A,2),I=e=>{var t=w(),n=c(t),r=e=>{var t=_(`·`);h(e,t)};d(n,e=>{(m(j)||m(M)||O())&&e(r)}),f(),h(e,t)};d(F,e=>{k()&&e(I)}),a(t),u(()=>r(t,`title`,m(N))),h(e,t)};d(F,e=>{(m(j)||m(M)||O()||k())&&e(I)}),h(l,P),p()}export{E as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,At as t,Ct as n,Dt as r,F as i,I as a,J as o,Mt as s,N as c,Nt as l,P as u,Q as d,R as f,St as p,T as m,Tt as h,V as g,_t as _,at as v,bt as y,ct as b,d as x,dt as S,f as ee,ft as C,gt as w,ht as te,it as T,jt as E,kt as ne,l as re,mt as D,ot as O,st as k,tt as A,ut as j,vt as ie,wt as M,xt as N,yt as P,z as ae}from"./index-CuoAAt-d.js";import{l as F,n as oe}from"./format-CW_NXiBg.js";import{n as se,t as ce}from"./Badge-x4Lbd8pc.js";import{t as le}from"./SplitView-DVk1HAf9.js";import{t as ue}from"./SearchField-D85HSGV_.js";import{t as de}from"./DataTable-CdM2Vyvn.js";import{t as fe}from"./Inspector-C4wr2Zb4.js";import{t as pe}from"./Segmented-BCcIUjA2.js";import{i as me,n as he,r as ge,t as _e}from"./TreeView-e7dNH8HW.js";import{n as ve,t as ye}from"./versions-zyEGB_mz.js";import{t as be}from"./CaptureNotice-D0u6WNeR.js";import{t as xe}from"./reactive-selection.svelte-BmjgYyWR.js";var Se=b(`<!> <!> <!>`,1),I=b(`<!> <!>`,1),Ce=b(`<li class="svelte-grpov"><button class="svelte-grpov"> </button></li>`),we=b(`<h3 class="section-title">Ancestors</h3> <ol class="crumbs svelte-grpov"><!> <li aria-current="true" class="svelte-grpov"> </li></ol>`,1),Te=b(`<li><button><span class="truncate"> </span><span class="sub mono"> </span></button></li>`),Ee=b(`<h3 class="section-title">Children <span class="num"> </span></h3> <ul class="link-list"></ul>`,1),L=b(`<li><button><span class="truncate"> </span><span class="sub truncate"> </span></button></li>`),De=b(`<h3 class="section-title">Imports <span class="num"> </span></h3> <ul class="link-list"></ul>`,1),Oe=b(`<!> <h3 class="section-title">Instance</h3> <dl class="kv"><dt>Children</dt><dd class="num"> </dd> <dt>Same file</dt> <dd><button class="link svelte-grpov"> </button></dd></dl> <!> <!>`,1),ke=b(`<p class="mono"> </p>`),Ae=b(`<span class="detached svelte-grpov">detached</span>`),je=b(`<span class="kids num svelte-grpov"> </span>`),Me=b(`<span><span class="lt svelte-grpov"><</span><!><span class="lt svelte-grpov">></span></span> <span class="file truncate svelte-grpov"><!></span> <!> <!>`,1),Ne=b(`<p>Open your app in another tab — the tree updates live as components mount and unmount.</p> <!>`,1),Pe=b(`<ul class="link-list"></ul>`),Fe=b(`<p class="none svelte-grpov">Imports no other components.</p>`),Ie=b(`<p class="none svelte-grpov">Not imported by any component (route or entry).</p>`),Le=b(`<h3 class="section-title">Imports <span class="num"> </span></h3> <!> <h3 class="section-title">Used by <span class="num"> </span></h3> <!>`,1),Re=b(`<span> </span>`),ze=b(`<span class="name-cell svelte-grpov"><span class="cname svelte-grpov"><!></span> <span class="file truncate svelte-grpov"><!></span></span> <span class="end num muted"> </span> <span class="end num muted"> </span> <!>`,1);function R(b,S){t(S,!0);let R=f(`components:mode`,`tree`),z=h(``),B=a(async()=>{let e=await ee(),t=await x(),n=await ee();return{list:t,meta:n,epoch:e.epoch===n.epoch?n.epoch??``:null}},{initial:{list:[],meta:null,epoch:``},interval:2e3,version:ye(`components`)}),V=r(()=>B.data.list),H=r(()=>{let e=new Map;for(let t of D(V))e.set(t.id,{c:t,key:``,children:[]});let t=[],n=new Set;for(let r of e.values()){let i=r.c.parentId==null?void 0:e.get(r.c.parentId);i?i.children.push(r):(t.push(r),r.c.parentId!=null&&n.add(r))}let r=new Map,i=(e,t)=>{let a=new Map;for(let o of e){let e=a.get(o.c.name)??0;a.set(o.c.name,e+1),o.key=`${t}${n.has(o)?`~`:``}${o.c.name}#${e}`,r.set(o.key,o),o.children.length&&i(o.children,o.key+`/`)}};return i(t,``),{roots:t,byId:e,byKey:r,detached:new Set([...n].map(e=>e.key)),epoch:B.data.epoch}}),Be=r(()=>{let e=B.data.meta;return e?{captured:e.kept,total:e.total,truncated:e.truncated,policy:`parents first`}:null}),U=r(()=>{let e=new Map;for(let t of D(V))e.set(t.file,(e.get(t.file)??0)+1);return e}),W=h(n(new Set)),G=h(null),Ve=h(null),He,Ue=null,We=e=>e.c.id,K=e=>e.key;ie(()=>{let e=D(H);te(()=>{let t=Ue;if(Ue=e,t&&t!==e){if(D(W).size){let n=me(D(W),t,e,We,K);(n.length!==D(W).size||n.some(e=>!D(W).has(e)))&&M(W,new Set(n),!0)}D(G)!=null&&M(G,me([D(G)],t,e,We,K)[0]??null,!0)}})}),_(()=>{if(D(H).epoch===null||He===D(H).epoch)return;let e=ge(D(H).roots,e=>e.children,K);e.length!==0&&(He=D(H).epoch,te(()=>M(W,new Set([...D(W),...e]),!0)))});let Ge=r(()=>{let e=c(D(z));return e?t=>e(t.c.name,t.c.file):null}),Ke=r(()=>D(Ge)?D(V).filter(e=>D(Ge)({c:e})).length:null),q=r(()=>D(G)==null?null:D(H).byKey.get(D(G))??null);function qe(e){let t=[],n=D(H).byId.get(e);for(;n&&n.c.parentId!=null;){let e=D(H).byId.get(n.c.parentId);if(!e)break;t.unshift(e),n=e}return t}function Je(e){let t=D(H).byId.get(e);t&&D(Ve)?.reveal(t.key,qe(e).map(e=>e.key))}let J=a(re,{initial:[],when:()=>R.value===`files`||D(G)!=null}),Y=r(()=>{let e=new Map;for(let t of J.data)for(let n of t.imports){let r=e.get(n);r?r.push(t):e.set(n,[t])}return e}),Ye=r(()=>new Map(J.data.map(e=>[e.file,e]))),Xe=r(()=>{let e=c(D(z));return e?J.data.filter(t=>e(t.name,t.file)):J.data}),Ze=h(n({id:`name`,desc:!1})),X=h(null),Z=r(()=>D(X)?D(Ye).get(D(X))??null:null),Qe=[{id:`name`,label:`Component`,width:`minmax(0, 1fr)`,sort:(e,t)=>e.name.localeCompare(t.name)},{id:`imports`,label:`Imports`,width:`72px`,align:`end`,descFirst:!0,sort:(e,t)=>e.imports.length-t.imports.length},{id:`used`,label:`Used by`,width:`72px`,align:`end`,descFirst:!0,sort:(e,t)=>(D(Y).get(e.file)?.length??0)-(D(Y).get(t.file)?.length??0)},{id:`live`,label:`Mounted`,width:`72px`,align:`end`,descFirst:!0,minWidth:520,sort:(e,t)=>(D(U).get(e.file)??0)-(D(U).get(t.file)??0)}],Q=r(()=>B.data.epoch||null);_(()=>{B.data.epoch===null&&te(()=>B.refresh())});function $e(e){D(Q)&&(xe.set({componentId:e.id,epoch:D(Q),label:`<${e.name}>`,file:e.file}),ae.go(`reactive`))}function $(e){m(e).catch(()=>{})}function et(e){R.value=`files`,M(z,``),M(X,e,!0)}function tt(e){let t=D(V).find(t=>t.file===e);R.value=`tree`,M(z,``),t&&queueMicrotask(()=>Je(t.id))}{let t=e=>{var t=Se(),n=y(t);pe(n,{label:`View`,options:[{value:`tree`,label:`Live tree`},{value:`files`,label:`Files`}],get value(){return R.value},set value(e){R.value=e}});var i=p(n,2);{let e=r(()=>R.value===`tree`?`Filter instances…`:`Filter components…`),t=r(()=>R.value===`tree`?D(Ke):D(Xe).length);ue(i,{get placeholder(){return D(e)},get count(){return D(t)},get value(){return D(z)},set value(e){M(z,e,!0)}})}var a=p(i,2),o=e=>{var t=Se(),n=y(t);be(n,{get info(){return D(Be)},noun:`components`,get detached(){return D(H).detached.size}});var r=p(n,2);u(r,{icon:`expand`,variant:`ghost`,label:`Expand all`,onclick:()=>M(W,he(D(H).roots,{key:e=>e.key,children:e=>e.children}),!0)});var i=p(r,2);u(i,{icon:`collapse`,variant:`ghost`,label:`Collapse all`,onclick:()=>M(W,new Set,!0)}),O(e,t)};T(a,e=>{R.value===`tree`&&e(o)}),O(e,t)},n=e=>{var t=k(),n=y(t),r=e=>{ve(e,{get res(){return B}})},i=e=>{u(e,{icon:`refresh`,variant:`ghost`,label:`Re-analyze`,get disabled(){return J.busy},onclick:()=>J.refresh()})};T(n,e=>{R.value===`tree`?e(r):e(i,-1)}),O(e,t)},a=r(()=>R.value===`tree`?D(V).length:J.data.length);se(b,{title:`Components`,get count(){return D(a)},toolbar:t,actions:n,children:(t,n)=>{var a=k(),c=y(a),f=t=>{{let n=e=>{var t=k(),n=y(t),i=e=>{let t=r(()=>D(q).c),n=r(()=>D(Ye).get(D(t).file)),i=r(()=>qe(D(t).id));fe(e,{get title(){return`<${D(t).name??``}>`},get subtitle(){return D(t).file},onclose:()=>M(G,null),badges:e=>{var n=I(),i=y(n);{let e=r(()=>D(t).mounted?`green`:`neutral`);ce(i,{get tone(){return D(e)},children:(e,n)=>{E();var r=j();w(()=>v(r,D(t).mounted?`mounted`:`unmounted`)),O(e,r)},$$slots:{default:!0}})}var a=p(i,2);ce(a,{children:(e,n)=>{E();var r=j();w(()=>v(r,`#${D(t).id??``}`)),O(e,r)},$$slots:{default:!0}}),O(e,n)},actions:e=>{var n=I(),i=y(n);u(i,{icon:`editor`,onclick:()=>$(D(t).file),children:(e,t)=>{E();var n=j(`Open in editor`);O(e,n)},$$slots:{default:!0}});var a=p(i,2),o=e=>{{let n=r(()=>!D(Q));u(e,{icon:`reactive`,get disabled(){return D(n)},onclick:()=>$e(D(t)),children:(e,t)=>{E();var n=j();w(()=>v(n,D(Q)?`Show reactivity`:`Show reactivity (waiting for a consistent snapshot)`)),O(e,n)},$$slots:{default:!0}})}};T(a,e=>{D(t).mounted&&e(o)}),O(e,n)},children:(e,r)=>{var a=Oe(),c=y(a),l=e=>{var n=we(),r=p(y(n),2),a=P(r);A(a,17,()=>D(i),e=>e.key,(e,t)=>{var n=Ce(),r=P(n),i=N(r,!0);s(n),w(()=>v(i,D(t).c.name)),C(`click`,r,()=>Je(D(t).c.id)),O(e,n)});var o=p(a,2),c=N(o,!0);s(r),w(()=>v(c,D(t).name)),O(e,n)};T(c,e=>{D(i).length&&e(l)});var u=p(c,4),d=p(P(u)),f=N(d,!0),m=p(d,4),h=P(m),g=N(h);s(m),s(u);var _=p(u,2),b=e=>{var t=Ee(),n=y(t),r=p(P(n)),i=N(r,!0);s(n);var a=p(n,2);A(a,21,()=>D(q).children.slice(0,200),e=>e.key,(e,t)=>{var n=Te(),r=P(n),i=P(r),a=N(i,!0),o=p(i),c=N(o);s(r),s(n),w(()=>{v(a,D(t).c.name),v(c,`#${D(t).c.id??``}`)}),C(`click`,r,()=>Je(D(t).c.id)),O(e,n)}),s(a),w(()=>v(i,D(q).children.length)),O(e,t)};T(_,e=>{D(q).children.length&&e(b)});var x=p(_,2),S=e=>{var t=De(),r=y(t),i=p(P(r)),a=N(i,!0);s(r);var c=p(r,2);A(c,20,()=>D(n).imports,e=>e,(e,t)=>{var n=L(),r=P(n),i=P(r),a=N(i,!0),c=p(i),l=N(c,!0);s(r),s(n),w((e,n)=>{o(r,`title`,`Open ${t??``}`),v(a,e),v(l,n)},[()=>oe(t),()=>F(t)]),C(`click`,r,()=>$(t)),O(e,n)}),s(c),w(()=>v(a,D(n).imports.length)),O(e,t)};T(x,e=>{D(n)&&D(n).imports.length&&e(S)}),w((e,t)=>{v(f,D(q).children.length),v(g,`${e??``} mounted instance${t??``}`)},[()=>D(U).get(D(t).file)??1,()=>(D(U).get(D(t).file)??1)===1?``:`s`]),C(`click`,h,()=>et(D(t).file)),O(e,a)},$$slots:{badges:!0,actions:!0,default:!0}})};T(n,e=>{D(q)&&e(i)}),O(e,t)},a=r(()=>!!D(q));le(t,{id:`components-tree`,get open(){return D(a)},aside:n,children:(t,n)=>{var a=k(),c=y(a),f=e=>{i(e,{icon:`errors`,tone:`error`,title:`Could not read live components`,children:(e,t)=>{var n=ke(),r=N(n,!0);w(()=>v(r,B.error)),O(e,n)},$$slots:{default:!0}})},m=t=>{g(_e(t,{get roots(){return D(H).roots},getKey:e=>e.key,getChildren:e=>e.children,get filter(){return D(Ge)},label:`Mounted component tree`,onactivate:e=>$(e.c.file),get expanded(){return D(W)},set expanded(e){M(W,e,!0)},get selected(){return D(G)},set selected(e){M(G,e,!0)},row:(t,n=l,i=l)=>{var a=Me(),c=y(a);let u;var f=p(P(c));e(f,{get text(){return n().c.name},get query(){return D(z)}}),E(),s(c);var m=p(c,2),h=P(m);{let t=r(()=>F(n().c.file));e(h,{get text(){return D(t)},get query(){return D(z)}})}s(m);var g=p(m,2),_=e=>{var t=Ae();w(()=>o(t,`title`,`Parent #${n().c.parentId??``} is outside the captured set`)),O(e,t)},b=r(()=>D(H).detached.has(n().key));T(g,e=>{D(b)&&e(_)});var x=p(g,2),S=e=>{var t=je(),r=N(t,!0);w(()=>v(r,n().children.length)),O(e,t)};T(x,e=>{i().hasChildren&&!i().expanded&&e(S)}),w(()=>u=d(c,1,`tag svelte-grpov`,null,u,{dim:!n().c.mounted})),O(t,a)},empty:e=>{var t=k(),n=y(t),r=e=>{i(e,{title:`Connecting to the app…`})},a=e=>{i(e,{icon:`search`,get title(){return`No instances match “${D(z)??``}”`}})},o=e=>{i(e,{icon:`components`,title:`No mounted components`,children:(e,t)=>{var n=Ne(),r=p(y(n),2);u(r,{onclick:()=>R.value=`files`,children:(e,t)=>{E();var n=j(`Browse component files instead`);O(e,n)},$$slots:{default:!0}}),O(e,n)},$$slots:{default:!0}})};T(n,e=>{B.loading?e(r):D(z)?e(a,1):e(o,-1)}),O(e,t)},$$slots:{row:!0,empty:!0}}),e=>M(Ve,e,!0),()=>D(Ve))};T(c,e=>{B.error&&D(V).length===0?e(f):e(m,-1)}),O(t,a)},$$slots:{aside:!0,default:!0}})}},m=t=>{{let n=e=>{var t=k(),n=y(t),i=e=>{let t=r(()=>D(Y).get(D(Z).file)??[]);fe(e,{get title(){return D(Z).name},get subtitle(){return D(Z).file},onclose:()=>M(X,null),actions:e=>{var t=I(),n=y(t),i=e=>{u(e,{icon:`tree`,onclick:()=>tt(D(Z).file),children:(e,t)=>{E();var n=j(`Show in tree`);O(e,n)},$$slots:{default:!0}})},a=r(()=>D(U).get(D(Z).file));T(n,e=>{D(a)&&e(i)});var o=p(n,2);u(o,{icon:`editor`,onclick:()=>$(D(Z).file),children:(e,t)=>{E();var n=j(`Open in editor`);O(e,n)},$$slots:{default:!0}}),O(e,t)},children:(e,n)=>{var r=Le(),i=y(r),a=p(P(i)),o=N(a,!0);s(i);var c=p(i,2),l=e=>{var t=Pe();A(t,20,()=>D(Z).imports,e=>e,(e,t)=>{var n=L(),r=P(n),i=P(r),a=N(i,!0),o=p(i),c=N(o,!0);s(r),s(n),w((e,t)=>{v(a,e),v(c,t)},[()=>oe(t),()=>F(t)]),C(`click`,r,()=>D(Ye).has(t)?M(X,t,!0):$(t)),O(e,n)}),s(t),O(e,t)},u=e=>{var t=Fe();O(e,t)};T(c,e=>{D(Z).imports.length?e(l):e(u,-1)});var d=p(c,2),f=p(P(d)),m=N(f,!0);s(d);var h=p(d,2),g=e=>{var n=Pe();A(n,21,()=>D(t),e=>e.file,(e,t)=>{var n=L(),r=P(n),i=P(r),a=N(i,!0),o=p(i),c=N(o,!0);s(r),s(n),w(e=>{v(a,D(t).name),v(c,e)},[()=>F(D(t).file)]),C(`click`,r,()=>M(X,D(t).file,!0)),O(e,n)}),s(n),O(e,n)},_=e=>{var t=Ie();O(e,t)};T(h,e=>{D(t).length?e(g):e(_,-1)}),w(()=>{v(o,D(Z).imports.length),v(m,D(t).length)}),O(e,r)},$$slots:{actions:!0,default:!0}})};T(n,e=>{D(Z)&&e(i)}),O(e,t)},a=r(()=>!!D(Z));le(t,{id:`components-files`,get open(){return D(a)},aside:n,children:(t,n)=>{de(t,{get items(){return D(Xe)},get columns(){return Qe},getKey:e=>e.file,label:`Component files`,onactivate:e=>$(e.file),get sort(){return D(Ze)},set sort(e){M(Ze,e,!0)},get selected(){return D(X)},set selected(e){M(X,e,!0)},row:(t,n=l,i)=>{let a=()=>(i?.()).visible;var o=ze(),c=y(o),u=P(c),f=P(u);e(f,{get text(){return n().name},get query(){return D(z)}}),s(u);var m=p(u,2),h=P(m);e(h,{get text(){return n().file},get query(){return D(z)}}),s(m),s(c);var g=p(c,2),_=N(g,!0),b=p(g,2),x=N(b,!0),S=p(b,2),ee=e=>{var t=Re();let r;var i=N(t,!0);w((e,n)=>{r=d(t,1,`end num`,null,r,{faint:e}),v(i,n)},[()=>!D(U).get(n().file),()=>D(U).get(n().file)??`–`]),O(e,t)},C=r(()=>a().has(`live`));T(S,e=>{D(C)&&e(ee)}),w(e=>{v(_,n().imports.length||``),v(x,e)},[()=>D(Y).get(n().file)?.length||``]),O(t,o)},empty:e=>{var t=k(),n=y(t),a=e=>{i(e,{title:`Analyzing components…`})},o=e=>{i(e,{icon:`errors`,tone:`error`,title:`Analysis failed`,children:(e,t)=>{var n=ke(),r=N(n,!0);w(()=>v(r,J.error)),O(e,n)},$$slots:{default:!0}})},s=e=>{{let t=r(()=>D(z)?`No components match “${D(z)}”`:`No .svelte files found`);i(e,{icon:`search`,get title(){return D(t)}})}};T(n,e=>{J.loading?e(a):J.error?e(o,1):e(s,-1)}),O(e,t)},$$slots:{row:!0,empty:!0}})},$$slots:{aside:!0,default:!0}})}};T(c,e=>{R.value===`tree`?e(f):e(m,-1)}),O(t,a)},$$slots:{toolbar:!0,actions:!0,default:!0}})}ne()}S([`click`]);export{R as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,At as t,B as n,Dt as r,H as i,J as a,L as o,Mt as s,Nt as c,Q as l,St as u,Tt as d,Z as f,at as p,ct as m,dt as h,ft as g,gt as _,it as v,kt as y,mt as b,ot as x,tt as S,wt as C,xt as w,yt as T}from"./index-CuoAAt-d.js";import{t as E}from"./VirtualList-Ba0GhFn8.js";var D=m(`<span><!></span>`),O=m(`<button><span class="truncate"> </span> <!></button>`),k=m(`<span class="truncate"> </span>`),A=m(`<div role="columnheader"><!></div>`),j=m(`<div class="tr svelte-b78yyc"><!></div>`),M=m(`<div class="table svelte-b78yyc"><div class="head svelte-b78yyc" role="row"></div> <div class="body svelte-b78yyc"><!></div></div>`);function N(m,h){t(h,!0);let N=n(h,`sort`,15,null),P=n(h,`selected`,15,null),F=n(h,`rowHeight`,3,28),I=d(1e3),L=r(()=>h.columns.filter(e=>!e.minWidth||b(I)>=e.minWidth)),R=r(()=>new Set(b(L).map(e=>e.id))),z=r(()=>b(L).map(e=>e.width).join(` `)),B=r(()=>{let e=N()&&h.columns.find(e=>e.id===N().id);if(!e?.sort)return h.items;let t=e.sort,n=N().desc?-1:1;return[...h.items].sort((e,r)=>n*t(e,r))});function V(e){e.sort&&(N()?.id===e.id?N({id:e.id,desc:!N().desc}):N({id:e.id,desc:!!e.descFirst}))}function H(e){if(e.sort)return N()?.id===e.id?N().desc?`descending`:`ascending`:`none`}var U=M();let W;var G=T(U);S(G,21,()=>b(L),e=>e.id,(e,t)=>{var n=A();let r;var i=T(n),c=e=>{var n=O();let r;var i=T(n),a=w(i,!0),c=u(i,2),d=e=>{var t=D();let n;var r=T(t);o(r,{name:`chevronDown`,size:11}),s(t),_(()=>n=l(t,1,`dir svelte-b78yyc`,null,n,{desc:N().desc})),x(e,t)};v(c,e=>{N()?.id===b(t).id&&e(d)}),s(n),_(()=>{r=l(n,1,`sort svelte-b78yyc`,null,r,{active:N()?.id===b(t).id}),p(a,b(t).label)}),g(`click`,n,()=>V(b(t))),x(e,n)},d=e=>{var n=k(),r=w(n,!0);_(()=>p(r,b(t).label)),x(e,n)};v(i,e=>{b(t).sort?e(c):e(d,-1)}),s(n),_(e=>{r=l(n,1,`th svelte-b78yyc`,null,r,{end:b(t).align===`end`}),a(n,`aria-sort`,e)},[()=>H(b(t))]),x(e,n)}),s(G);var K=u(G,2),q=T(K);E(q,{get items(){return b(B)},getKey:e=>h.getKey(e),get label(){return h.label},get rowHeight(){return F()},get empty(){return h.empty},onselect:e=>h.onselect?.(e),onactivate:e=>h.onactivate?.(e),get selected(){return P()},set selected(e){P(e)},row:(t,n=c,r=c)=>{var i=j(),a=T(i);e(a,()=>h.row,n,()=>({visible:b(R),state:r()})),s(i),x(t,i)},$$slots:{row:!0}}),s(K),s(U),_(()=>W=f(U,``,W,{"--cols":b(z)})),i(U,`clientWidth`,e=>C(I,e)),x(m,U),y()}h([`click`]);export{N as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.table.svelte-b78yyc{flex-direction:column;min-width:0;height:100%;min-height:0;display:flex}.head.svelte-b78yyc,.tr.svelte-b78yyc{grid-template-columns:var(--cols);align-items:center;column-gap:12px;width:100%;min-width:0;display:grid}.head.svelte-b78yyc{border-bottom:1px solid var(--border);background:var(--bg-subtle);height:28px;font-size:var(--fs-xs);color:var(--fg-faint);flex-shrink:0;padding:0 12px;font-weight:500}.th.svelte-b78yyc{min-width:0;display:flex}.th.end.svelte-b78yyc{justify-content:flex-end}.sort.svelte-b78yyc{border-radius:var(--radius-sm);min-width:0;color:inherit;font-weight:inherit;background:0 0;border:0;align-items:center;gap:3px;margin:0 -4px;padding:2px 4px;display:inline-flex}.sort.svelte-b78yyc:hover,.sort.active.svelte-b78yyc{color:var(--fg)}.dir.svelte-b78yyc{display:inline-flex;transform:rotate(180deg)}.dir.desc.svelte-b78yyc{transform:none}.body.svelte-b78yyc{flex:1;min-height:0}.tr.svelte-b78yyc>*{min-width:0}.tr.svelte-b78yyc .end{text-align:right;justify-self:end}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,At as t,Dt as n,F as r,I as i,J as a,L as o,Mt as s,N as c,Nt as l,P as u,Pt as d,Q as f,St as p,T as m,Tt as h,at as g,bt as _,c as v,ct as y,dt as b,ft as x,gt as S,it as C,jt as w,kt as T,mt as E,ot as D,st as O,t as k,tt as A,ut as j,wt as M,x as ee,xt as N,yt as P}from"./index-CuoAAt-d.js";import{a as F,l as te}from"./format-CW_NXiBg.js";import{n as I,t as L}from"./Badge-x4Lbd8pc.js";import{t as ne}from"./SplitView-DVk1HAf9.js";import{t as re}from"./VirtualList-Ba0GhFn8.js";import{t as ie}from"./SearchField-D85HSGV_.js";import{t as ae}from"./Inspector-C4wr2Zb4.js";import{t as oe}from"./Segmented-BCcIUjA2.js";import{n as se,t as ce}from"./versions-zyEGB_mz.js";import{t as R}from"./CaptureNotice-D0u6WNeR.js";import{t as le}from"./capture.svelte-fve1ihQA.js";var z=y(`<button> <span class="num svelte-fcxvld"> </span></button>`),B=y(`<!> <!> <!> <!> <!>`,1),V=y(`<!> <!>`,1),H=y(`<h3 class="section-title">Stack</h3> <pre class="code-block"> </pre>`,1),U=y(`<h3 class="section-title">Reference</h3> <p class="message svelte-fcxvld"><a target="_blank" rel="noopener noreferrer" class="svelte-fcxvld"> </a></p>`,1),ue=y(`<h3 class="section-title">Message</h3> <p class="message svelte-fcxvld"> </p> <!> <!>`,1),de=y(`<span class="code mono svelte-fcxvld"><!></span>`),fe=y(`<span class="loc mono truncate svelte-fcxvld"><!></span>`),pe=y(`<span class="faint num svelte-fcxvld"> </span>`),me=y(`<button class="open svelte-fcxvld" tabindex="-1" title="Open in editor"><!></button>`),he=y(`<span><!></span> <span class="text svelte-fcxvld"><span class="msg truncate svelte-fcxvld"><!></span> <span class="meta svelte-fcxvld"><!> <!> <!></span></span> <!>`,1),ge=y(`<p>Compiler warnings and runtime errors from your app show up here as they happen.</p>`);function W(y,b){t(b,!0);let W=i(async()=>{let[e,t]=await Promise.all([v(),ee()]);return{warnings:e,errors:t}},{initial:{warnings:[],errors:[]},interval:3e3,version:ce(`errors`)}),G=le(3e3),K=h(`all`),q=h(``),J=h(null),Y=n(()=>{let e=[...W.data.errors].reverse().map((e,t)=>({key:`e:${e.timestamp}:${t}`,kind:`error`,message:e.message,file:e.file,line:e.line,column:e.column,stack:e.stack,timestamp:e.timestamp})),t=W.data.warnings.map((e,t)=>({key:`w:${e.file}:${e.line??0}:${e.column??0}:${e.code}:${t}`,kind:`warning`,message:e.message,code:e.code,file:e.file,line:e.line,column:e.column}));return[...e,...t]}),X=n(()=>{let e=c(E(q));return E(Y).filter(t=>(E(K)===`all`||t.kind===E(K))&&(!e||e(t.message,t.code,t.file)))}),Z=n(()=>E(J)?E(Y).find(e=>e.key===E(J))??null:null),_e=n(()=>{let e=new Map;for(let t of W.data.warnings)e.set(t.code,(e.get(t.code)??0)+1);return[...e].sort((e,t)=>t[1]-e[1]).slice(0,4)});function Q(e){e.file&&m(e.file,e.line).catch(()=>{})}async function ve(){await k().catch(()=>{}),W.set({warnings:[],errors:[]}),M(J,null)}let $=e=>e.file?`${te(e.file,3)}${e.line?`:${e.line}`:``}${e.column?`:${e.column}`:``}`:``;I(y,{title:`Problems`,get count(){return E(Y).length},toolbar:e=>{var t=B(),r=_(t);{let e=n(()=>[{value:`all`,label:`All`,count:E(Y).length},{value:`error`,label:`Errors`,count:W.data.errors.length},{value:`warning`,label:`Warnings`,count:W.data.warnings.length}]);oe(r,{label:`Severity`,get options(){return E(e)},get value(){return E(K)},set value(e){M(K,e,!0)}})}var i=p(r,2);ie(i,{placeholder:`Filter by message, code or file…`,get count(){return E(X).length},get value(){return E(q)},set value(e){M(q,e,!0)}});var o=p(i,2);R(o,{get info(){return G.data.runtimeErrors},noun:`runtime errors`});var c=p(o,2);R(c,{get info(){return G.data.compilerWarnings},noun:`warnings`});var l=p(c,2);A(l,17,()=>E(_e),([e,t])=>e,(e,t)=>{var r=n(()=>d(E(t),2));let i=()=>E(r)[0],o=()=>E(r)[1];var c=z();let l;var u=P(c,!0),m=p(u),h=N(m,!0);s(c),S(()=>{l=f(c,1,`chip svelte-fcxvld`,null,l,{on:E(q)===i()}),a(c,`title`,`Filter by ${i()??``}`),g(u,i()),g(h,o())}),x(`click`,c,()=>M(q,E(q)===i()?``:i(),!0)),D(e,c)}),D(e,t)},actions:e=>{se(e,{get res(){return W},onclear:ve})},children:(t,i)=>{{let i=e=>{var t=O(),r=_(t),i=e=>{{let t=e=>{var t=V(),r=_(t);{let e=n(()=>E(Z).kind===`error`?`red`:`yellow`);L(r,{get tone(){return E(e)},children:(e,t)=>{w();var n=j();S(()=>g(n,E(Z).kind)),D(e,n)},$$slots:{default:!0}})}var i=p(r,2),a=e=>{L(e,{children:(e,t)=>{w();var n=j();S(e=>g(n,e),[()=>F(E(Z).timestamp,!0)]),D(e,n)},$$slots:{default:!0}})};C(i,e=>{E(Z).timestamp&&e(a)}),D(e,t)},r=e=>{var t=O(),n=_(t),r=e=>{u(e,{icon:`editor`,onclick:()=>Q(E(Z)),children:(e,t)=>{w();var n=j();S(()=>g(n,`Open ${E(Z).line?`line ${E(Z).line}`:`file`}`)),D(e,n)},$$slots:{default:!0}})};C(n,e=>{E(Z).file&&e(r)}),D(e,t)},i=n(()=>E(Z).kind===`error`?`Runtime error`:E(Z).code??`Warning`),o=n(()=>$(E(Z)));ae(e,{get title(){return E(i)},get subtitle(){return E(o)},onclose:()=>M(J,null),badges:t,actions:r,children:(e,t)=>{var n=ue(),r=p(_(n),2),i=N(r,!0),o=p(r,2),c=e=>{var t=H(),n=p(_(t),2),r=N(n,!0);S(()=>g(r,E(Z).stack)),D(e,t)};C(o,e=>{E(Z).stack&&e(c)});var l=p(o,2),u=e=>{var t=U(),n=p(_(t),2),r=P(n),i=N(r);s(n),S(()=>{a(r,`href`,`https://svelte.dev/docs/svelte/compiler-warnings#${E(Z).code??``}`),g(i,`svelte.dev — ${E(Z).code??``}`)}),D(e,t)};C(l,e=>{E(Z).code&&e(u)}),S(()=>g(i,E(Z).message)),D(e,n)},$$slots:{badges:!0,actions:!0,default:!0}})}};C(r,e=>{E(Z)&&e(i)}),D(e,t)},c=n(()=>!!E(Z));ne(t,{id:`problems`,get open(){return E(c)},aside:i,children:(t,i)=>{re(t,{get items(){return E(X)},getKey:e=>e.key,rowHeight:44,label:`Problems`,onactivate:Q,get selected(){return E(J)},set selected(e){M(J,e,!0)},row:(t,r=l)=>{var i=he(),a=_(i),c=P(a);{let e=n(()=>r().kind===`error`?`errors`:`warning`);o(c,{get name(){return E(e)},size:14})}s(a);var u=p(a,2),d=P(u),m=P(d);e(m,{get text(){return r().message},get query(){return E(q)}}),s(d);var h=p(d,2),v=P(h),y=t=>{var n=de(),i=P(n);e(i,{get text(){return r().code},get query(){return E(q)}}),s(n),D(t,n)};C(v,e=>{r().code&&e(y)});var b=p(v,2),w=t=>{var i=fe(),a=P(i);{let t=n(()=>$(r()));e(a,{get text(){return E(t)},get query(){return E(q)}})}s(i),D(t,i)};C(b,e=>{r().file&&e(w)});var T=p(b,2),O=e=>{var t=pe(),n=N(t,!0);S(e=>g(n,e),[()=>F(r().timestamp)]),D(e,t)};C(T,e=>{r().timestamp&&e(O)}),s(h),s(u);var k=p(u,2),A=e=>{var t=me(),n=P(t);o(n,{name:`editor`,size:13}),s(t),x(`click`,t,e=>(e.stopPropagation(),Q(r()))),D(e,t)};C(k,e=>{r().file&&e(A)}),S(()=>f(a,1,`sev ${r().kind??``}`,`svelte-fcxvld`)),D(t,i)},empty:e=>{var t=O(),n=_(t),i=e=>{r(e,{title:`Collecting diagnostics…`})},a=e=>{r(e,{icon:`check`,title:`No problems`,children:(e,t)=>{var n=ge();D(e,n)},$$slots:{default:!0}})},o=e=>{r(e,{icon:`search`,title:`No problems match`})};C(n,e=>{W.loading?e(i):E(Y).length===0?e(a,1):e(o,-1)}),D(e,t)},$$slots:{row:!0,empty:!0}})},$$slots:{aside:!0,default:!0}})}},$$slots:{toolbar:!0,actions:!0,default:!0}}),T()}b([`click`]);export{W as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.wrap.svelte-k0bxx6{flex-direction:column;gap:16px;padding:16px;display:flex}.top.svelte-k0bxx6{flex-wrap:wrap;align-items:center;gap:16px 32px;display:flex}.now.svelte-k0bxx6{align-items:baseline;gap:6px;display:flex}.big.svelte-k0bxx6{letter-spacing:-.03em;font-size:44px;font-weight:650;line-height:1}.unit.svelte-k0bxx6{color:var(--fg-muted);margin-right:8px}.stats.svelte-k0bxx6{border:1px solid var(--border);border-radius:var(--radius-lg);flex-wrap:wrap;margin:0;display:flex;overflow:hidden}.stats.svelte-k0bxx6 div:where(.svelte-k0bxx6){border-right:1px solid var(--border);padding:6px 14px}.stats.svelte-k0bxx6 div:where(.svelte-k0bxx6):last-child{border-right:0}.stats.svelte-k0bxx6 dt:where(.svelte-k0bxx6){font-size:var(--fs-xs);color:var(--fg-muted)}.stats.svelte-k0bxx6 dd:where(.svelte-k0bxx6){font-size:var(--fs-lg);margin:0;font-weight:600}.good.svelte-k0bxx6{color:var(--green)}.fair.svelte-k0bxx6{color:var(--yellow)}.poor.svelte-k0bxx6{color:var(--red)}.chart.svelte-k0bxx6{border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--bg-subtle);height:220px;margin:0;padding:0 0 18px 24px;position:relative}svg.svelte-k0bxx6{width:100%;height:100%;display:block}.grid.svelte-k0bxx6{stroke-dasharray:4 4;stroke-width:1px;vector-effect:non-scaling-stroke}.target.svelte-k0bxx6{stroke:color-mix(in srgb, var(--green) 45%, transparent)}.warn.svelte-k0bxx6{stroke:color-mix(in srgb, var(--red) 45%, transparent)}.area.svelte-k0bxx6{fill:color-mix(in srgb, var(--accent) 14%, transparent)}.line.svelte-k0bxx6{fill:none;stroke:var(--accent);stroke-width:1.75px;stroke-linejoin:round}.drop.svelte-k0bxx6{stroke:var(--red);stroke-width:1px;opacity:.6}.region.svelte-k0bxx6{fill:var(--red-bg)}.label.svelte-k0bxx6{font-size:var(--fs-2xs);color:var(--fg-faint);font-family:var(--font-mono);position:absolute;left:6px;transform:translateY(-50%)}.axis.svelte-k0bxx6{font-size:var(--fs-2xs);color:var(--fg-faint);justify-content:space-between;display:flex;position:absolute;bottom:2px;left:24px;right:8px}.rec.svelte-k0bxx6 .section-title:where(.svelte-k0bxx6){padding-left:0}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{At as e,Dt as t,F as n,I as r,J as i,Mt as a,P as o,Q as s,St as c,Tt as l,Z as u,at as d,bt as f,ct as p,gt as m,it as h,jt as g,kt as _,lt as v,mt as y,n as b,ot as x,st as S,tt as C,u as w,ut as T,wt as E,xt as D,yt as O}from"./index-CuoAAt-d.js";import{n as k,t as ee}from"./Badge-x4Lbd8pc.js";import{t as te}from"./Segmented-BCcIUjA2.js";import{n as A,t as j}from"./versions-zyEGB_mz.js";var M=p(`<!> <!>`,1),N=p(`<p>Keep your app open in a visible tab — it reports its frame rate twice a second.</p>`),ne=p(`<dl class="stats svelte-k0bxx6"><div class="svelte-k0bxx6"><dt class="svelte-k0bxx6">Min</dt><dd> </dd></div> <div class="svelte-k0bxx6"><dt class="svelte-k0bxx6">1% low</dt><dd> </dd></div> <div class="svelte-k0bxx6"><dt class="svelte-k0bxx6">Avg</dt><dd> </dd></div> <div class="svelte-k0bxx6"><dt class="svelte-k0bxx6">Max</dt><dd class="num svelte-k0bxx6"> </dd></div> <div class="svelte-k0bxx6"><dt class="svelte-k0bxx6">Drops <30</dt><dd> </dd></div></dl>`),re=v(`<rect y="0" class="region svelte-k0bxx6"></rect>`),ie=v(`<path class="area svelte-k0bxx6"></path>`),ae=v(`<path class="line svelte-k0bxx6" vector-effect="non-scaling-stroke"></path>`),oe=v(`<line class="drop svelte-k0bxx6" vector-effect="non-scaling-stroke"></line>`),se=p(`<section class="rec svelte-k0bxx6" aria-label="Recording result"><h3 class="section-title svelte-k0bxx6"> </h3> <dl class="stats svelte-k0bxx6"><div class="svelte-k0bxx6"><dt class="svelte-k0bxx6">Min</dt><dd> </dd></div> <div class="svelte-k0bxx6"><dt class="svelte-k0bxx6">1% low</dt><dd> </dd></div> <div class="svelte-k0bxx6"><dt class="svelte-k0bxx6">Avg</dt><dd> </dd></div> <div class="svelte-k0bxx6"><dt class="svelte-k0bxx6">Max</dt><dd class="num svelte-k0bxx6"> </dd></div> <div class="svelte-k0bxx6"><dt class="svelte-k0bxx6">Drops <30</dt><dd> </dd></div></dl></section>`),ce=p(`<div class="wrap svelte-k0bxx6"><div class="top svelte-k0bxx6"><div class="now svelte-k0bxx6"><span> </span> <span class="unit svelte-k0bxx6">fps</span> <!></div> <!></div> <figure class="chart svelte-k0bxx6"><svg preserveAspectRatio="none" role="img" class="svelte-k0bxx6"><line x1="0" class="grid target svelte-k0bxx6"></line><line x1="0" class="grid warn svelte-k0bxx6"></line><!><!><!><!></svg> <span class="label l60 svelte-k0bxx6">60</span> <span class="label l30 svelte-k0bxx6">30</span> <figcaption class="axis svelte-k0bxx6"><span> </span><span>now</span></figcaption></figure> <!></div>`);function P(p,v){e(v,!0);let P=r(w,{initial:[],interval:500,version:j(`fps`)}),F=1e3,I=l(`30`),L=l(!1),R=l(0),z=l(0),B=t(()=>P.data.at(-1)?.timestamp??Date.now()),V=t(()=>Number(y(I))*1e3),H=t(()=>P.data.filter(e=>e.timestamp>=y(B)-y(V))),U=t(()=>P.data.at(-1)?.fps??0),W=e=>(e-(y(B)-y(V)))/y(V)*F,G=e=>200-Math.min(e,120)/120*200,K=t(()=>y(H).length>1?`M`+y(H).map(e=>`${W(e.timestamp).toFixed(1)},${G(e.fps).toFixed(1)}`).join(`L`):``),q=t(()=>y(K)?`${y(K)}L${W(y(H).at(-1).timestamp).toFixed(1)},200L${W(y(H)[0].timestamp).toFixed(1)},200Z`:``),le=t(()=>y(H).filter(e=>e.fps<30)),J=t(()=>{if(!y(R))return[];let e=y(L)?1/0:y(z);return P.data.filter(t=>t.timestamp>=y(R)&&t.timestamp<=e)});function Y(e){if(!e.length)return null;let t=1/0,n=-1/0,r=0,i=0;for(let a of e)t=Math.min(t,a.fps),n=Math.max(n,a.fps),r+=a.fps,a.fps<30&&i++;let a=e.map(e=>e.fps).sort((e,t)=>e-t);return{min:t,max:n,avg:Math.round(r/e.length),p1:a[Math.floor(a.length*.01)],drops:i,count:e.length}}let X=t(()=>Y(y(H))),Z=t(()=>Y(y(J))),Q=t(()=>{if(!y(R))return null;let e=Math.max(0,W(y(R))),t=Math.min(F,y(L)?F:W(y(z)));return t>e?{x:e,w:t-e}:null});function $(e){return e>=55?`good`:e>=30?`fair`:`poor`}function ue(){y(L)?(E(L,!1),E(z,y(B),!0)):(E(L,!0),E(R,y(B),!0),E(z,0))}async function de(){await b().catch(()=>{}),P.set([]),E(L,!1),E(R,E(z,0),!0)}k(p,{title:`Frame rate`,scroll:!0,toolbar:e=>{var n=M(),r=f(n);te(r,{label:`Time window`,options:[{value:`15`,label:`15 s`},{value:`30`,label:`30 s`},{value:`60`,label:`60 s`}],get value(){return y(I)},set value(e){E(I,e,!0)}});var i=c(r,2);{let e=t(()=>y(L)?`stop`:`record`),n=t(()=>y(L)?`primary`:`default`);o(i,{get icon(){return y(e)},get variant(){return y(n)},onclick:ue,children:(e,t)=>{g();var n=T();m(()=>d(n,y(L)?`Stop recording`:`Record`)),x(e,n)},$$slots:{default:!0}})}x(e,n)},actions:e=>{A(e,{get res(){return P},onclear:de})},children:(e,t)=>{var r=S(),o=f(r),l=e=>{var t=S(),r=f(t),i=e=>{n(e,{title:`Waiting for frames…`})},a=e=>{n(e,{icon:`fps`,title:`No frame samples yet`,children:(e,t)=>{var n=N();x(e,n)},$$slots:{default:!0}})};h(r,e=>{P.loading?e(i):e(a,-1)}),x(e,t)},p=e=>{var t=ce(),n=O(t),r=O(n),o=O(r),l=D(o,!0),f=c(o,4),p=e=>{ee(e,{tone:`red`,children:(e,t)=>{g();var n=T(`● REC`);x(e,n)},$$slots:{default:!0}})};h(f,e=>{y(L)&&e(p)}),a(r);var _=c(r,2),v=e=>{var t=ne(),n=O(t),r=c(O(n)),i=D(r,!0);a(n);var o=c(n,2),l=c(O(o)),u=D(l,!0);a(o);var f=c(o,2),p=c(O(f)),h=D(p,!0);a(f);var g=c(f,2),_=c(O(g)),v=D(_,!0);a(g);var b=c(g,2),S=c(O(b));let C;var w=D(S,!0);a(b),a(t),m((e,t,n)=>{s(r,1,`num ${e??``}`,`svelte-k0bxx6`),d(i,y(X).min),s(l,1,`num ${t??``}`,`svelte-k0bxx6`),d(u,y(X).p1),s(p,1,`num ${n??``}`,`svelte-k0bxx6`),d(h,y(X).avg),d(v,y(X).max),C=s(S,1,`num svelte-k0bxx6`,null,C,{poor:y(X).drops>0}),d(w,y(X).drops)},[()=>$(y(X).min),()=>$(y(X).p1),()=>$(y(X).avg)]),x(e,t)};h(_,e=>{y(X)&&e(v)}),a(n);var b=c(n,2),S=O(b);i(S,`viewBox`,`0 0 1000 200`);var w=O(S);i(w,`x2`,F);var E=c(w);i(E,`x2`,F);var k=c(E),te=e=>{var t=re();i(t,`height`,200),m(()=>{i(t,`x`,y(Q).x),i(t,`width`,y(Q).w)}),x(e,t)};h(k,e=>{y(Q)&&e(te)});var A=c(k),j=e=>{var t=ie();m(()=>i(t,`d`,y(q))),x(e,t)};h(A,e=>{y(q)&&e(j)});var M=c(A),N=e=>{var t=ae();m(()=>i(t,`d`,y(K))),x(e,t)};h(M,e=>{y(K)&&e(N)});var P=c(M);C(P,17,()=>y(le),e=>e.timestamp,(e,t)=>{var n=oe();i(n,`y2`,200),m((e,t,r)=>{i(n,`x1`,e),i(n,`x2`,t),i(n,`y1`,r)},[()=>W(y(t).timestamp),()=>W(y(t).timestamp),()=>G(y(t).fps)]),x(e,n)}),a(S);var B=c(S,2);let V;var H=c(B,2);let J;var Y=c(H,2),ue=O(Y),de=D(ue);g(),a(Y),a(b);var fe=c(b,2),pe=e=>{var t=se(),n=O(t),r=D(n),i=c(n,2),o=O(i),l=c(O(o)),u=D(l,!0);a(o);var f=c(o,2),p=c(O(f)),h=D(p,!0);a(f);var g=c(f,2),_=c(O(g)),v=D(_,!0);a(g);var b=c(g,2),S=c(O(b)),C=D(S,!0);a(b);var w=c(b,2),T=c(O(w));let E;var k=D(T,!0);a(w),a(i),a(t),m((e,t,n,i)=>{d(r,`Recording · ${e??``} s · ${y(Z).count??``} samples`),s(l,1,`num ${t??``}`,`svelte-k0bxx6`),d(u,y(Z).min),s(p,1,`num ${n??``}`,`svelte-k0bxx6`),d(h,y(Z).p1),s(_,1,`num ${i??``}`,`svelte-k0bxx6`),d(v,y(Z).avg),d(C,y(Z).max),E=s(T,1,`num svelte-k0bxx6`,null,E,{poor:y(Z).drops>0}),d(k,y(Z).drops)},[()=>((y(z)-y(R))/1e3).toFixed(1),()=>$(y(Z).min),()=>$(y(Z).p1),()=>$(y(Z).avg)]),x(e,t)};h(fe,e=>{y(Z)&&!y(L)&&e(pe)}),a(t),m((e,t,n,r,a,c,f)=>{s(o,1,`big num ${e??``}`,`svelte-k0bxx6`),d(l,y(U)),i(S,`aria-label`,`Frame rate over the last ${y(I)??``} seconds`),i(w,`y1`,t),i(w,`y2`,n),i(E,`y1`,r),i(E,`y2`,a),V=u(B,``,V,{top:c}),J=u(H,``,J,{top:f}),d(de,`−${y(I)??``}s`)},[()=>$(y(U)),()=>G(60),()=>G(60),()=>G(30),()=>G(30),()=>`${G(60)/200*100}%`,()=>`${G(30)/200*100}%`]),x(e,t)};h(o,e=>{P.data.length===0?e(l):e(p,-1)}),x(e,r)},$$slots:{toolbar:!0,actions:!0,default:!0}}),_()}export{P as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{A as e,At as t,B as n,C as r,Ct as i,Dt as a,F as o,H as s,I as c,J as l,Mt as u,N as d,Nt as f,P as p,Q as ee,St as m,T as h,Tt as g,V as _,Z as v,at as y,bt as b,ct as x,dt as S,et as C,ft as w,gt as T,it as E,jt as D,kt as te,lt as O,mt as k,nt as A,ot as j,pt as M,st as N,tt as ne,ut as P,w as re,wt as F,xt as I,yt as L}from"./index-CuoAAt-d.js";import{l as R}from"./format-CW_NXiBg.js";import{n as z,t as B}from"./Badge-x4Lbd8pc.js";import{t as ie}from"./SplitView-DVk1HAf9.js";import{t as ae}from"./VirtualList-Ba0GhFn8.js";import{t as oe}from"./SearchField-D85HSGV_.js";var V=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,H=new Map;for(let e=0;e<64;e++)H.set(V[e],e);function U(e){let t=[],n=0,r=0;for(let i of e){let e=H.get(i);e!==void 0&&(r+=(e&31)<<n,e&32?n+=5:(t.push(r&1?-(r>>1):r>>1),r=0,n=0))}return t}function se(e){let t=new Map,n=new Map,r=0,i=e.split(`;`);for(let e=0;e<i.length;e++){let a=i[e];if(a)for(let i of a.split(`,`)){let a=U(i);if(a.length<4)continue;r+=a[2];let o=e+1,s=r+1;(t.get(o)??t.set(o,new Set).get(o)).add(s),(n.get(s)??n.set(s,new Set).get(s)).add(o)}}return{compiledToSource:t,sourceToCompiled:n}}var W=new Set(`const,let,var,function,return,if,else,for,while,do,switch,case,break,continue,new,this,typeof,instanceof,void,delete,throw,try,catch,finally,class,extends,super,import,export,from,default,async,await,yield,of,in`.split(`,`)),G=new Set(`true,false,null,undefined,NaN,Infinity`.split(`,`)),K=new Set([`$state`,`$derived`,`$effect`,`$props`,`$inspect`,`$bindable`,`$host`]);function q(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function J(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(/\s/.test(r)){let r=n;for(;r<e.length&&/\s/.test(e[r]);)r++;t.push({t:e.slice(n,r)}),n=r;continue}if(r===`/`&&e[n+1]===`/`){t.push({t:e.slice(n),c:`hl-cm`});break}if(r==="`"||r===`"`||r===`'`){let i=n+1;for(;i<e.length&&e[i]!==r;)e[i]===`\\`&&i++,i++;t.push({t:e.slice(n,i+1),c:`hl-st`}),n=i+1;continue}if(/\d/.test(r)&&(n===0||!/\w/.test(e[n-1]))){let r=n;for(;r<e.length&&/[\d.e_]/.test(e[r]);)r++;t.push({t:e.slice(n,r),c:`hl-nm`}),n=r;continue}if(/[a-zA-Z_$]/.test(r)){let r=n;for(;r<e.length&&/[\w$.]/.test(e[r]);)r++;let i=e.slice(n,r),a;i.startsWith(`$.`)||K.has(i.split(`.`)[0])?a=`hl-sv`:W.has(i)?a=`hl-kw`:G.has(i)?a=`hl-lt`:e[r]===`(`&&(a=`hl-fn`),t.push({t:i,c:a}),n=r;continue}t.push({t:r}),n++}return t}function Y(e){let t=[],n=0;for(;n<e.length;){if(e[n]===`<`){let r=n;for(;r<e.length&&e[r]!==`>`;)r++;let i=e.slice(n,r+1),a=i.match(/^(<\/?[\w:-]+)/);if(!a){t.push({t:i,c:`hl-tg`}),n=r+1;continue}t.push({t:a[1],c:`hl-tg`});let o=i.slice(a[1].length);for(;o.length>0;){let e=o.match(/^(\s+)([\w:|-]+)(=)/);if(e){if(t.push({t:e[1]},{t:e[2],c:`hl-at`},{t:`=`}),o=o.slice(e[0].length),o[0]===`"`||o[0]===`'`){let e=o[0],n=1;for(;n<o.length&&o[n]!==e;)n++;t.push({t:o.slice(0,n+1),c:`hl-st`}),o=o.slice(n+1)}else if(o[0]===`{`){let e=1,n=1;for(;e<o.length&&n>0;)o[e]===`{`&&n++,o[e]===`}`&&n--,e++;t.push({t:o.slice(0,e),c:`hl-ex`}),o=o.slice(e)}continue}let n=o.match(/^(\s+)([\w:|-]+)/);n?(t.push({t:n[1]},{t:n[2],c:`hl-at`}),o=o.slice(n[0].length)):(t.push({t:o[0],c:o[0]===`>`||o[0]===`/`?`hl-tg`:void 0}),o=o.slice(1))}n=r+1;continue}if(e[n]===`{`){let r=n+1,i=1;for(;r<e.length&&i>0;)e[r]===`{`&&i++,e[r]===`}`&&i--,r++;t.push({t:e.slice(n,r),c:`hl-ex`}),n=r;continue}let r=n;for(;r<e.length&&e[r]!==`<`&&e[r]!==`{`;)r++;t.push({t:e.slice(n,Math.max(r,n+1))}),n=Math.max(r,n+1)}return t}function X(e){let t=e.trimStart(),n=e.slice(0,e.length-t.length),r=t.match(/^([\w-]+)(\s*:\s*)(.+?)(;?\s*)$/);if(r)return[{t:n},{t:r[1],c:`hl-cp`},{t:r[2]},{t:r[3],c:`hl-cv`},{t:r[4]}];let i=t.match(/^([^{]+)(\s*\{)\s*$/);return i?[{t:n},{t:i[1],c:`hl-cs`},{t:i[2]}]:[{t:e}]}function Z(e){let t=``;for(let n of e)t+=n.c?`<span class="${n.c}">${q(n.t)}</span>`:q(n.t);return t}function ce(e){let t=`template`;return e.map(e=>{let n=e.trim();return n.startsWith(`<script`)?(n.includes(`<\/script>`)||(t=`script`),Z(Y(e))):n.startsWith(`<\/script`)?(t=`template`,Z(Y(e))):n.startsWith(`<style`)?(n.includes(`</style>`)||(t=`style`),Z(Y(e))):n.startsWith(`</style`)?(t=`template`,Z(Y(e))):Z(t===`script`?J(e):t===`style`?X(e):Y(e))})}function le(e){return e.map(e=>Z(J(e)))}var ue=x(`<div><span class="ln num svelte-14u3s6p"> </span><span class="src svelte-14u3s6p"></span></div>`),de=x(`<div class="pane svelte-14u3s6p"><div class="title svelte-14u3s6p"><span> </span> <span class="faint num"> </span></div> <div class="viewport svelte-14u3s6p" tabindex="0" role="region"><div class="spacer svelte-14u3s6p"></div></div></div>`);function fe(e,r){t(r,!0);let i=n(r,`origin`,3,!1),o=n(r,`scrollTop`,15,0),c=n(r,`lineHeight`,3,18),d=g(null),f=g(0),p=a(()=>Math.max(0,Math.floor(o()/c())-20)),h=a(()=>Math.min(r.html.length,Math.ceil((o()+k(f))/c())+20)),b=a(()=>String(r.html.length).length+1);function x(e){if(!k(d))return;let t=(e-1)*c();(t<k(d).scrollTop||t>k(d).scrollTop+k(f)-c())&&k(d).scrollTo({top:Math.max(0,t-k(f)/3),behavior:`smooth`})}function S(e){if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=r.highlighted.size&&i()?Math.min(...r.highlighted):0,n=Math.max(1,Math.min(r.html.length,t+(e.key===`ArrowDown`?1:-1)));e.preventDefault(),r.onlineclick?.(n),x(n)}var E={scrollToLine:x},D=de(),O=L(D),A=L(O),N=I(A,!0),P=m(A,2),re=I(P);u(O);var R=m(O,2),z=L(R);let B;return ne(z,23,()=>({length:k(h)-k(p)}),(e,t)=>k(p)+t,(e,t,n)=>{let o=a(()=>k(p)+k(n)+1);var s=ue();let l,d;var f=L(s),h=I(f,!0),g=m(f);C(g,()=>r.html[k(o)-1]||` `,!0),u(g),u(s),T((e,t)=>{l=ee(s,1,`line svelte-14u3s6p`,null,l,{hl:e,origin:t}),d=v(s,``,d,{transform:`translateY(${(k(o)-1)*c()}px)`}),y(h,k(o))},[()=>r.highlighted.has(k(o)),()=>i()&&r.highlighted.has(k(o))]),w(`click`,s,()=>r.onlineclick?.(k(o))),j(e,s)}),u(z),u(R),_(R,e=>F(d,e),()=>k(d)),u(D),T(()=>{y(N,r.title),y(re,`${r.html.length??``} lines`),l(R,`aria-label`,`${r.title??``} code`),B=v(z,``,B,{height:`${r.html.length*c()}px`,"--lh":`${c()??``}px`,"--gutter":`${k(b)??``}ch`})}),M(`scroll`,R,()=>k(d)&&o(k(d).scrollTop)),w(`keydown`,R,S),s(R,`clientHeight`,e=>F(f,e)),j(e,D),te(E)}S([`keydown`,`click`]);var pe=x(`<span class="file mono truncate svelte-1puslgj"> </span> <!>`,1),me=x(`<!> <!>`,1),he=x(`<span class="name truncate svelte-1puslgj"><!></span> <span class="path truncate svelte-1puslgj"><!></span>`,1),ge=x(`<p class="mono"> </p>`),_e=x(`<p>See exactly what the Svelte compiler emits. Click any line to jump to its source-mapped counterpart.</p>`),ve=O(`<path class="svelte-1puslgj"></path>`),ye=x(`<div class="gutter svelte-1puslgj" aria-hidden="true"><svg width="100%" height="100%" preserveAspectRatio="none" class="svelte-1puslgj"></svg></div>`),be=x(`<!> <!> <!>`,1),xe=x(`<div><!></div>`);function Q(n,v){t(v,!0);let x=c(r,{initial:[]}),S=g(``),C=g(null),w=g(null),O=g(null),M=g(!1),V=g(null),H=g(i(new Set)),U=g(i(new Set)),W=g(null),G=g(0),K=g(0),q=g(0),J=g(null),Y=g(null),X=g(1e3),Z=a(()=>{let e=d(k(S));return e?x.data.filter(t=>e(t.name,t.file)):x.data}),ue=a(()=>k(w)?ce(k(w).source.split(`
|
|
2
|
-
`)):[]),de=a(()=>k(w)?le(k(w).compiled.split(`
|
|
3
|
-
`)):[]),Q=a(()=>k(X)<700),$=0;async function Se(e){let t=++$;F(M,!0),F(V,null),F(H,new Set,!0),F(U,new Set,!0),F(W,null);try{let n=await re(e);if(t!==$)return;F(w,n),F(O,n.mappings?se(n.mappings):null)}catch(e){if(t!==$)return;F(w,null),F(O,null),F(V,e instanceof Error?e.message:String(e),!0)}finally{t===$&&F(M,!1)}}function Ce(e){F(W,`source`),F(H,new Set([e]),!0);let t=k(O)?.sourceToCompiled.get(e);F(U,new Set(t??[]),!0),t?.size&&k(Y)?.scrollToLine(Math.min(...t))}function we(e){F(W,`compiled`),F(U,new Set([e]),!0);let t=k(O)?.compiledToSource.get(e);F(H,new Set(t??[]),!0),t?.size&&k(J)?.scrollToLine(Math.min(...t))}let Te=a(()=>{if(!k(O)||k(Q))return[];let e=[],t=k(W)===`compiled`?k(U):k(H);for(let n of t){let t=k(W)===`compiled`?k(O).compiledToSource.get(n):k(O).sourceToCompiled.get(n);for(let r of t??[]){let[t,i]=k(W)===`compiled`?[r,n]:[n,r];e.push({a:(t-.5)*18-k(G),b:(i-.5)*18-k(K)})}}return e.filter(e=>(e.a>-18||e.b>-18)&&(e.a<k(q)+18||e.b<k(q)+18)).slice(0,200)});z(n,{title:`Compiled output`,get count(){return x.data.length},toolbar:e=>{var t=me(),n=b(t);oe(n,{placeholder:`Find a .svelte file…`,get count(){return k(Z).length},get value(){return k(S)},set value(e){F(S,e,!0)}});var r=m(n,2),i=e=>{var t=pe(),n=b(t),r=I(n,!0),i=m(n,2),a=e=>{B(e,{tone:`green`,children:(e,t)=>{D();var n=P(`source map`);j(e,n)},$$slots:{default:!0}})},o=e=>{B(e,{children:(e,t)=>{D();var n=P(`no source map`);j(e,n)},$$slots:{default:!0}})};E(i,e=>{k(O)?e(a):e(o,-1)}),T(e=>{l(n,`title`,k(w).file),y(r,e)},[()=>R(k(w).file,3)]),j(e,t)};E(r,e=>{k(w)&&e(i)}),j(e,t)},actions:e=>{var t=N(),n=b(t),r=e=>{var t=me(),n=b(t);p(n,{icon:`editor`,variant:`ghost`,label:`Open source in editor`,onclick:()=>h(k(w).file).catch(()=>{})});var r=m(n,2);p(r,{icon:`refresh`,variant:`ghost`,label:`Recompile`,get disabled(){return k(M)},onclick:()=>k(C)&&Se(k(C))}),j(e,t)};E(n,e=>{k(w)&&e(r)}),j(e,t)},children:(t,n)=>{ie(t,{id:`inspect`,side:`start`,initial:280,min:180,open:!0,aside:t=>{ae(t,{get items(){return k(Z)},getKey:e=>e.file,label:`Svelte files`,onselect:e=>Se(e.file),get selected(){return k(C)},set selected(e){F(C,e,!0)},row:(t,n=f)=>{var r=he(),i=b(r),o=L(i);e(o,{get text(){return n().name},get query(){return k(S)}}),u(i);var s=m(i,2),c=L(s);{let t=a(()=>R(n().file,3));e(c,{get text(){return k(t)},get query(){return k(S)}})}u(s),j(t,r)},empty:e=>{{let t=a(()=>x.loading?void 0:`search`),n=a(()=>x.loading?`Listing files…`:`No files match`);o(e,{get icon(){return k(t)},get title(){return k(n)}})}},$$slots:{row:!0,empty:!0}})},children:(e,t)=>{var n=xe();let r;var i=L(n),c=e=>{o(e,{icon:`errors`,tone:`error`,title:`Could not compile this file`,children:(e,t)=>{var n=ge(),r=I(n,!0);T(()=>y(r,k(V))),j(e,n)},$$slots:{default:!0}})},d=e=>{{let t=a(()=>k(M)?`Compiling…`:`Pick a component`);o(e,{icon:`inspect`,get title(){return k(t)},children:(e,t)=>{var n=N(),r=b(n),i=e=>{var t=_e();j(e,t)};E(r,e=>{k(M)||e(i)}),j(e,n)},$$slots:{default:!0}})}},f=e=>{var t=be(),n=b(t);{let e=a(()=>k(W)===`source`);_(fe(n,{title:`Source`,get html(){return k(ue)},get highlighted(){return k(H)},get origin(){return k(e)},lineHeight:18,onlineclick:Ce,get scrollTop(){return k(G)},set scrollTop(e){F(G,e,!0)}}),e=>F(J,e,!0),()=>k(J))}var r=m(n,2),i=e=>{var t=ye(),n=L(t);ne(n,21,()=>k(Te),A,(e,t)=>{var n=ve();T(()=>l(n,`d`,`M0 ${k(t).a+28} C 24 ${k(t).a+28}, 24 ${k(t).b+28}, 48 ${k(t).b+28}`)),j(e,n)}),u(n),u(t),s(t,`clientHeight`,e=>F(q,e)),j(e,t)};E(r,e=>{k(Q)||e(i)});var o=m(r,2);{let e=a(()=>k(W)===`compiled`);_(fe(o,{title:`Compiled JS`,get html(){return k(de)},get highlighted(){return k(U)},get origin(){return k(e)},lineHeight:18,onlineclick:we,get scrollTop(){return k(K)},set scrollTop(e){F(K,e,!0)}}),e=>F(Y,e,!0),()=>k(Y))}j(e,t)};E(i,e=>{k(V)?e(c):k(w)?e(f,-1):e(d,1)}),u(n),T(()=>{r=ee(n,1,`code svelte-1puslgj`,null,r,{stacked:k(Q)}),l(n,`aria-busy`,k(M))}),s(n,`clientWidth`,e=>F(X,e)),j(e,n)},$$slots:{aside:!0,default:!0}})},$$slots:{toolbar:!0,actions:!0,default:!0}}),te()}export{Q as default};
|