@plumix/core 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin-bar/collect.d.ts.map +1 -1
- package/dist/admin-bar/collect.js +1 -15
- package/dist/admin-bar/collect.js.map +1 -1
- package/dist/admin-bar/i18n.d.ts +6 -0
- package/dist/admin-bar/i18n.d.ts.map +1 -1
- package/dist/admin-bar/i18n.js +1 -1
- package/dist/admin-bar/i18n.js.map +1 -1
- package/dist/admin-bar/styles.d.ts.map +1 -1
- package/dist/admin-bar/styles.js +1 -11
- package/dist/admin-bar/styles.js.map +1 -1
- package/dist/auth/authenticator.d.ts +20 -0
- package/dist/auth/authenticator.d.ts.map +1 -1
- package/dist/auth/authenticator.js +21 -0
- package/dist/auth/authenticator.js.map +1 -1
- package/dist/cli/worker-codegen.d.ts.map +1 -1
- package/dist/cli/worker-codegen.js +3 -5
- package/dist/cli/worker-codegen.js.map +1 -1
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/context/app.d.ts +16 -0
- package/dist/context/app.d.ts.map +1 -1
- package/dist/context/app.js +8 -0
- package/dist/context/app.js.map +1 -1
- package/dist/context/debug.d.ts +25 -0
- package/dist/context/debug.d.ts.map +1 -0
- package/dist/context/debug.js +13 -0
- package/dist/context/debug.js.map +1 -0
- package/dist/context/stores.d.ts +2 -0
- package/dist/context/stores.d.ts.map +1 -1
- package/dist/context/stores.js.map +1 -1
- package/dist/css-tag.d.ts +2 -0
- package/dist/css-tag.d.ts.map +1 -0
- package/dist/css-tag.js +13 -0
- package/dist/css-tag.js.map +1 -0
- package/dist/db/libsql.d.ts.map +1 -1
- package/dist/db/libsql.js +13 -2
- package/dist/db/libsql.js.map +1 -1
- package/dist/debug-bar/collect.d.ts +13 -0
- package/dist/debug-bar/collect.d.ts.map +1 -0
- package/dist/debug-bar/collect.js +22 -0
- package/dist/debug-bar/collect.js.map +1 -0
- package/dist/debug-bar/collector.d.ts +9 -0
- package/dist/debug-bar/collector.d.ts.map +1 -0
- package/dist/debug-bar/collector.js +80 -0
- package/dist/debug-bar/collector.js.map +1 -0
- package/dist/debug-bar/component.d.ts +13 -0
- package/dist/debug-bar/component.d.ts.map +1 -0
- package/dist/debug-bar/component.js +36 -0
- package/dist/debug-bar/component.js.map +1 -0
- package/dist/debug-bar/config.d.ts +17 -0
- package/dist/debug-bar/config.d.ts.map +1 -0
- package/dist/debug-bar/config.js +13 -0
- package/dist/debug-bar/config.js.map +1 -0
- package/dist/debug-bar/core-panels.d.ts +8 -0
- package/dist/debug-bar/core-panels.d.ts.map +1 -0
- package/dist/debug-bar/core-panels.js +21 -0
- package/dist/debug-bar/core-panels.js.map +1 -0
- package/dist/debug-bar/db-query.d.ts +21 -0
- package/dist/debug-bar/db-query.d.ts.map +1 -0
- package/dist/debug-bar/db-query.js +23 -0
- package/dist/debug-bar/db-query.js.map +1 -0
- package/dist/debug-bar/format-param.d.ts +14 -0
- package/dist/debug-bar/format-param.d.ts.map +1 -0
- package/dist/debug-bar/format-param.js +27 -0
- package/dist/debug-bar/format-param.js.map +1 -0
- package/dist/debug-bar/highlight-sql.d.ts +11 -0
- package/dist/debug-bar/highlight-sql.d.ts.map +1 -0
- package/dist/debug-bar/highlight-sql.js +82 -0
- package/dist/debug-bar/highlight-sql.js.map +1 -0
- package/dist/debug-bar/panels/app.d.ts +8 -0
- package/dist/debug-bar/panels/app.d.ts.map +1 -0
- package/dist/debug-bar/panels/app.js +32 -0
- package/dist/debug-bar/panels/app.js.map +1 -0
- package/dist/debug-bar/panels/database.d.ts +9 -0
- package/dist/debug-bar/panels/database.d.ts.map +1 -0
- package/dist/debug-bar/panels/database.js +33 -0
- package/dist/debug-bar/panels/database.js.map +1 -0
- package/dist/debug-bar/panels/request.d.ts +7 -0
- package/dist/debug-bar/panels/request.d.ts.map +1 -0
- package/dist/debug-bar/panels/request.js +35 -0
- package/dist/debug-bar/panels/request.js.map +1 -0
- package/dist/debug-bar/panels/template.d.ts +17 -0
- package/dist/debug-bar/panels/template.d.ts.map +1 -0
- package/dist/debug-bar/panels/template.js +26 -0
- package/dist/debug-bar/panels/template.js.map +1 -0
- package/dist/debug-bar/panels/timeline.d.ts +11 -0
- package/dist/debug-bar/panels/timeline.d.ts.map +1 -0
- package/dist/debug-bar/panels/timeline.js +46 -0
- package/dist/debug-bar/panels/timeline.js.map +1 -0
- package/dist/debug-bar/primitives.d.ts +24 -0
- package/dist/debug-bar/primitives.d.ts.map +1 -0
- package/dist/debug-bar/primitives.js +21 -0
- package/dist/debug-bar/primitives.js.map +1 -0
- package/dist/debug-bar/styles.d.ts +2 -0
- package/dist/debug-bar/styles.d.ts.map +1 -0
- package/dist/debug-bar/styles.js +372 -0
- package/dist/debug-bar/styles.js.map +1 -0
- package/dist/debug-bar/template-node-label.d.ts +6 -0
- package/dist/debug-bar/template-node-label.d.ts.map +1 -0
- package/dist/debug-bar/template-node-label.js +20 -0
- package/dist/debug-bar/template-node-label.js.map +1 -0
- package/dist/debug-bar/timeline-geometry.d.ts +30 -0
- package/dist/debug-bar/timeline-geometry.d.ts.map +1 -0
- package/dist/debug-bar/timeline-geometry.js +26 -0
- package/dist/debug-bar/timeline-geometry.js.map +1 -0
- package/dist/debug-bar/timeline-model.d.ts +23 -0
- package/dist/debug-bar/timeline-model.d.ts.map +1 -0
- package/dist/debug-bar/timeline-model.js +34 -0
- package/dist/debug-bar/timeline-model.js.map +1 -0
- package/dist/debug-bar/trace-libsql.d.ts +18 -0
- package/dist/debug-bar/trace-libsql.d.ts.map +1 -0
- package/dist/debug-bar/trace-libsql.js +42 -0
- package/dist/debug-bar/trace-libsql.js.map +1 -0
- package/dist/debug-bar/types.d.ts +28 -0
- package/dist/debug-bar/types.d.ts.map +1 -0
- package/dist/debug-bar/types.js +1 -0
- package/dist/debug-bar/types.js.map +1 -0
- package/dist/hooks/registry.d.ts +14 -3
- package/dist/hooks/registry.d.ts.map +1 -1
- package/dist/hooks/registry.js +22 -0
- package/dist/hooks/registry.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin/manifest.d.ts +3 -0
- package/dist/plugin/manifest.d.ts.map +1 -1
- package/dist/plugin/manifest.js +1 -0
- package/dist/plugin/manifest.js.map +1 -1
- package/dist/plugin/register.d.ts.map +1 -1
- package/dist/plugin/register.js +1 -0
- package/dist/plugin/register.js.map +1 -1
- package/dist/route/render/render-template.d.ts +1 -1
- package/dist/route/render/render-template.d.ts.map +1 -1
- package/dist/route/render/render-template.js +26 -2
- package/dist/route/render/render-template.js.map +1 -1
- package/dist/runtime/app.d.ts +8 -5
- package/dist/runtime/app.d.ts.map +1 -1
- package/dist/runtime/app.js +8 -1
- package/dist/runtime/app.js.map +1 -1
- package/dist/runtime/dispatcher.d.ts.map +1 -1
- package/dist/runtime/dispatcher.js +4 -2
- package/dist/runtime/dispatcher.js.map +1 -1
- package/dist/runtime/load-user-for-public-request.d.ts.map +1 -1
- package/dist/runtime/load-user-for-public-request.js +5 -2
- package/dist/runtime/load-user-for-public-request.js.map +1 -1
- package/dist/test/dispatcher.d.ts +3 -0
- package/dist/test/dispatcher.d.ts.map +1 -1
- package/dist/test/dispatcher.js +8 -2
- package/dist/test/dispatcher.js.map +1 -1
- package/dist/test/harness.d.ts.map +1 -1
- package/dist/test/harness.js +12 -2
- package/dist/test/harness.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/debug-bar/panels/request.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,UAyC1B,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DebugKV, DebugSection } from "../primitives.js";
|
|
3
|
+
/**
|
|
4
|
+
* The Request panel: the full context of this request — how the router saw it,
|
|
5
|
+
* and who made it. All read straight off the app context, no instrumentation.
|
|
6
|
+
*/
|
|
7
|
+
export const requestPanel = {
|
|
8
|
+
id: "request",
|
|
9
|
+
title: "Request",
|
|
10
|
+
order: 10,
|
|
11
|
+
render: (ctx) => {
|
|
12
|
+
const url = new URL(ctx.request.url);
|
|
13
|
+
return (_jsxs(_Fragment, { children: [_jsx(DebugSection, { title: "Request", children: _jsx(DebugKV, { rows: [
|
|
14
|
+
{ label: "Method", value: ctx.request.method },
|
|
15
|
+
{ label: "Path", value: url.pathname },
|
|
16
|
+
{ label: "Origin", value: ctx.origin },
|
|
17
|
+
{ label: "Base path", value: ctx.basePath || "/" },
|
|
18
|
+
{ label: "Entity", value: ctx.resolvedEntity?.kind ?? "—" },
|
|
19
|
+
] }) }), _jsx(DebugSection, { title: "Auth", children: _jsx(DebugKV, { rows: [
|
|
20
|
+
{
|
|
21
|
+
label: "User",
|
|
22
|
+
value: ctx.user
|
|
23
|
+
? `${ctx.user.email} (${ctx.user.role})`
|
|
24
|
+
: "anonymous",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: "Scopes",
|
|
28
|
+
value: ctx.tokenScopes === null
|
|
29
|
+
? "unrestricted (role caps)"
|
|
30
|
+
: ctx.tokenScopes.join(", ") || "none",
|
|
31
|
+
},
|
|
32
|
+
] }) })] }));
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/debug-bar/panels/request.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;;GAGG;AACH,MAAM,CA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GACW,IACd,CACJ,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DebugPanel } from "../types.js";
|
|
2
|
+
/** Recorded by the renderer; read by the panel. */
|
|
3
|
+
export interface TemplateResolution {
|
|
4
|
+
/** Human label for the resolved route node, e.g. "post: hello-world". */
|
|
5
|
+
readonly nodeLabel: string;
|
|
6
|
+
/** Ordered candidate template names (after the `template:hierarchy` filter). */
|
|
7
|
+
readonly candidates: readonly string[];
|
|
8
|
+
/** The winning candidate — the template that rendered. */
|
|
9
|
+
readonly picked: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The Template panel: how the WordPress-style template hierarchy resolved for
|
|
13
|
+
* this request — the ordered candidate list and which one won. Empty on error
|
|
14
|
+
* pages, which don't run the hierarchy.
|
|
15
|
+
*/
|
|
16
|
+
export declare const templatePanel: DebugPanel;
|
|
17
|
+
//# sourceMappingURL=template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../src/debug-bar/panels/template.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9C,mDAAmD;AACnD,MAAM,WAAW,kBAAkB;IACjC,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,gFAAgF;IAChF,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,UA2C3B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DebugKV, DebugSection } from "../primitives.js";
|
|
3
|
+
import { TEMPLATE_PANEL_ID } from "../template-node-label.js";
|
|
4
|
+
/**
|
|
5
|
+
* The Template panel: how the WordPress-style template hierarchy resolved for
|
|
6
|
+
* this request — the ordered candidate list and which one won. Empty on error
|
|
7
|
+
* pages, which don't run the hierarchy.
|
|
8
|
+
*/
|
|
9
|
+
export const templatePanel = {
|
|
10
|
+
id: TEMPLATE_PANEL_ID,
|
|
11
|
+
title: "Template",
|
|
12
|
+
order: 15,
|
|
13
|
+
render: (ctx) => {
|
|
14
|
+
const resolution = ctx.debug.get(TEMPLATE_PANEL_ID)[0];
|
|
15
|
+
if (!resolution) {
|
|
16
|
+
return (_jsx("p", { className: "plumix-debug-bar__empty", children: "No template resolution \u2014 this is likely an error page." }));
|
|
17
|
+
}
|
|
18
|
+
return (_jsxs(_Fragment, { children: [_jsx(DebugSection, { title: "Resolution", children: _jsx(DebugKV, { rows: [
|
|
19
|
+
{ label: "Resolved", value: resolution.nodeLabel },
|
|
20
|
+
{ label: "Matched", value: resolution.picked },
|
|
21
|
+
] }) }), _jsx(DebugSection, { title: "Candidates", children: _jsx("ol", { className: "plumix-debug-bar__candidates", children: resolution.candidates.map((candidate) => (_jsx("li", { className: `plumix-debug-bar__candidate ${candidate === resolution.picked
|
|
22
|
+
? "plumix-debug-bar__candidate--picked"
|
|
23
|
+
: ""}`, children: candidate }, candidate))) }) })] }));
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/debug-bar/panels/template.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAY9D;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAe;IACvC,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,CAAC,GAAe,EAAE,EAAE;QAC1B,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CACrB,CAAC;QACjC,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,CACL,YAAG,SAAS,EAAC,yBAAyB,4EAElC,CACL,CAAC;QACJ,CAAC;QACD,OAAO,CACL,8BACE,KAAC,YAAY,IAAC,KAAK,EAAC,YAAY,YAC9B,KAAC,OAAO,IACN,IAAI,EAAE;4BACJ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,SAAS,EAAE;4BAClD,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE;yBAC/C,GACD,GACW,EACf,KAAC,YAAY,IAAC,KAAK,EAAC,YAAY,YAC9B,aAAI,SAAS,EAAC,8BAA8B,YACzC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CACxC,aAEE,SAAS,EAAE,+BACT,SAAS,KAAK,UAAU,CAAC,MAAM;gCAC7B,CAAC,CAAC,qCAAqC;gCACvC,CAAC,CAAC,EACN,EAAE,YAED,SAAS,IAPL,SAAS,CAQX,CACN,CAAC,GACC,GACQ,IACd,CACJ,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DebugPanel } from "../types.js";
|
|
2
|
+
/** Panel id, also the disable-denylist key and tab testid suffix. */
|
|
3
|
+
export declare const TIMELINE_PANEL_ID = "timeline";
|
|
4
|
+
/**
|
|
5
|
+
* The Timeline panel: a zero-JS SVG waterfall of the request's spans (dispatch,
|
|
6
|
+
* resolve, render, and each database query), read from the collector's span
|
|
7
|
+
* tree. Empty when nothing was timed — e.g. a route that touches no database
|
|
8
|
+
* and isn't instrumented, or the panel's own collection disabled.
|
|
9
|
+
*/
|
|
10
|
+
export declare const timelinePanel: DebugPanel;
|
|
11
|
+
//# sourceMappingURL=timeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../../src/debug-bar/panels/timeline.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAkE5C;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,UAe3B,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DebugSection } from "../primitives.js";
|
|
3
|
+
import { timelineGeometry } from "../timeline-geometry.js";
|
|
4
|
+
import { buildTimeline } from "../timeline-model.js";
|
|
5
|
+
/** Panel id, also the disable-denylist key and tab testid suffix. */
|
|
6
|
+
export const TIMELINE_PANEL_ID = "timeline";
|
|
7
|
+
// SVG is drawn in a nominal coordinate space and scaled to 100% width by the
|
|
8
|
+
// viewBox. A fixed left gutter holds the (depth-indented) span names, a fixed
|
|
9
|
+
// right column holds right-aligned durations, and bars scale into the middle.
|
|
10
|
+
const VIEW_WIDTH = 400;
|
|
11
|
+
const GUTTER = 132;
|
|
12
|
+
const MS_COL = 34;
|
|
13
|
+
const ROW_HEIGHT = 13;
|
|
14
|
+
const ROW_GAP = 4;
|
|
15
|
+
function TimelineChart({ timeline, }) {
|
|
16
|
+
const geometry = timelineGeometry(timeline, {
|
|
17
|
+
width: VIEW_WIDTH - GUTTER - MS_COL,
|
|
18
|
+
rowHeight: ROW_HEIGHT,
|
|
19
|
+
rowGap: ROW_GAP,
|
|
20
|
+
minBarWidth: 2,
|
|
21
|
+
});
|
|
22
|
+
return (_jsx("svg", { className: "plumix-debug-bar__timeline", viewBox: `0 0 ${VIEW_WIDTH} ${geometry.height}`, width: "100%", height: geometry.height, role: "img", children: geometry.rects.map((rect, i) => {
|
|
23
|
+
const depth = timeline.rows[i]?.depth ?? 0;
|
|
24
|
+
const textY = rect.y + ROW_HEIGHT - 3;
|
|
25
|
+
return (_jsxs("g", { children: [_jsx("text", { className: "plumix-debug-bar__timeline-name", x: 4 + depth * 8, y: textY, children: rect.name }), _jsx("rect", { className: "plumix-debug-bar__timeline-bar", x: GUTTER + rect.x, y: rect.y, width: rect.width, height: rect.height, rx: 2 }), _jsxs("text", { className: "plumix-debug-bar__timeline-ms", x: VIEW_WIDTH, y: textY, textAnchor: "end", children: [timeline.rows[i]?.durationMs ?? 0, "ms"] })] }, i));
|
|
26
|
+
}) }));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The Timeline panel: a zero-JS SVG waterfall of the request's spans (dispatch,
|
|
30
|
+
* resolve, render, and each database query), read from the collector's span
|
|
31
|
+
* tree. Empty when nothing was timed — e.g. a route that touches no database
|
|
32
|
+
* and isn't instrumented, or the panel's own collection disabled.
|
|
33
|
+
*/
|
|
34
|
+
export const timelinePanel = {
|
|
35
|
+
id: TIMELINE_PANEL_ID,
|
|
36
|
+
title: "Timeline",
|
|
37
|
+
order: 50,
|
|
38
|
+
render: (ctx) => {
|
|
39
|
+
const timeline = buildTimeline(ctx.debug.getSpans());
|
|
40
|
+
if (timeline.rows.length === 0) {
|
|
41
|
+
return _jsx("p", { className: "plumix-debug-bar__empty", children: "No spans recorded." });
|
|
42
|
+
}
|
|
43
|
+
return (_jsx(DebugSection, { title: `Total ${timeline.totalMs}ms`, children: _jsx(TimelineChart, { timeline: timeline }) }));
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline.js","sourceRoot":"","sources":["../../../src/debug-bar/panels/timeline.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,gBAAgB,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EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,EAClB,CAAC,EAAE,IAAI,CAAC,CAAC,EACT,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,EAAE,EAAE,CAAC,GACL,EACF,gBACE,SAAS,EAAC,+BAA+B,EACzC,CAAC,EAAE,UAAU,EACb,CAAC,EAAE,KAAK,EACR,UAAU,EAAC,KAAK,aAEf,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,IAAI,CAAC,UAC7B,KAvBD,CAAC,CAwBL,CACL,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAe;IACvC,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,CAAC,GAAe,EAAE,EAAE;QAC1B,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QACrD,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,OAAO,YAAG,SAAS,EAAC,yBAAyB,mCAAuB,CAAC;QACvE,CAAC;QACD,OAAO,CACL,KAAC,YAAY,IAAC,KAAK,EAAE,SAAS,QAAQ,CAAC,OAAO,IAAI,YAChD,KAAC,aAAa,IAAC,QAAQ,EAAE,QAAQ,GAAI,GACxB,CAChB,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Presentational primitives shared by core and plugin debug panels so every
|
|
4
|
+
* panel reads uniformly. Panels may drop to raw markup, but these give them
|
|
5
|
+
* the bar's look for free: `DebugSection` groups a titled block, `DebugKV` is
|
|
6
|
+
* the key/value description list, `DebugTable` a columnar list.
|
|
7
|
+
*/
|
|
8
|
+
export declare function DebugSection({ title, children, }: {
|
|
9
|
+
readonly title?: string;
|
|
10
|
+
readonly children: ReactNode;
|
|
11
|
+
}): ReactNode;
|
|
12
|
+
export interface DebugKVRow {
|
|
13
|
+
readonly label: string;
|
|
14
|
+
readonly value: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare function DebugKV({ rows, }: {
|
|
17
|
+
readonly rows: readonly DebugKVRow[];
|
|
18
|
+
}): ReactNode;
|
|
19
|
+
/** A columnar table for list-shaped panel data (queries, spans, candidates). */
|
|
20
|
+
export declare function DebugTable({ headers, rows, }: {
|
|
21
|
+
readonly headers: readonly string[];
|
|
22
|
+
readonly rows: readonly (readonly ReactNode[])[];
|
|
23
|
+
}): ReactNode;
|
|
24
|
+
//# sourceMappingURL=primitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/debug-bar/primitives.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;GAKG;AAEH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,QAAQ,GACT,EAAE;IACD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B,GAAG,SAAS,CASZ;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;CAC3B;AAED,wBAAgB,OAAO,CAAC,EACtB,IAAI,GACL,EAAE;IACD,QAAQ,CAAC,IAAI,EAAE,SAAS,UAAU,EAAE,CAAC;CACtC,GAAG,SAAS,CAaZ;AAED,gFAAgF;AAChF,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,IAAI,GACL,EAAE;IACD,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,SAAS,EAAE,CAAC,EAAE,CAAC;CAClD,GAAG,SAAS,CAyBZ"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Presentational primitives shared by core and plugin debug panels so every
|
|
5
|
+
* panel reads uniformly. Panels may drop to raw markup, but these give them
|
|
6
|
+
* the bar's look for free: `DebugSection` groups a titled block, `DebugKV` is
|
|
7
|
+
* the key/value description list, `DebugTable` a columnar list.
|
|
8
|
+
*/
|
|
9
|
+
export function DebugSection({ title, children, }) {
|
|
10
|
+
return (_jsxs("section", { children: [title ? (_jsx("p", { className: "plumix-debug-bar__section-title", children: title })) : null, children] }));
|
|
11
|
+
}
|
|
12
|
+
export function DebugKV({ rows, }) {
|
|
13
|
+
// A description list is the semantic fit for key/value pairs; a fixed-column
|
|
14
|
+
// grid (in CSS) aligns every value the same distance in across sections.
|
|
15
|
+
return (_jsx("dl", { className: "plumix-debug-bar__kv", children: rows.map((row) => (_jsxs(Fragment, { children: [_jsx("dt", { children: row.label }), _jsx("dd", { children: row.value })] }, row.label))) }));
|
|
16
|
+
}
|
|
17
|
+
/** A columnar table for list-shaped panel data (queries, spans, candidates). */
|
|
18
|
+
export function DebugTable({ headers, rows, }) {
|
|
19
|
+
return (_jsxs("table", { children: [_jsx("thead", { children: _jsx("tr", { children: headers.map((h) => (_jsx("th", { scope: "col", children: h }, h))) }) }), _jsx("tbody", { children: rows.map((cells, r) => (_jsx("tr", { children: cells.map((cell, c) => (_jsx("td", { className: "plumix-debug-bar__val", children: cell }, c))) }, r))) })] }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../src/debug-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version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/debug-bar/styles.ts"],"names":[],"mappings":"AAyCA,eAAO,MAAM,aAAa,QA+Ud,CAAC"}
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
// Inline CSS for the debug bar, emitted once per render inside the bar —
|
|
2
|
+
// same tsc-only-friendly approach as the admin bar (core has no bundler CSS
|
|
3
|
+
// pipeline). All selectors scoped under `.plumix-debug-bar`, so the bar's CSS
|
|
4
|
+
// can't leak out. Guarding the other direction (theme CSS leaking *in*) short
|
|
5
|
+
// of a shadow DOM: `all: revert` on the root plus a reset on the inner
|
|
6
|
+
// structural elements, which neutralizes the common `table {}`/`label {}`-style
|
|
7
|
+
// theme element selectors — not airtight, but enough for a dev tool. Zero-JS:
|
|
8
|
+
// a native <details> toggles the panel and radio inputs drive the tabs.
|
|
9
|
+
import { css } from "../css-tag.js";
|
|
10
|
+
// Upper bound on pure-CSS tab wiring. Panels beyond this still render but
|
|
11
|
+
// their tab won't toggle; core ships far fewer than this.
|
|
12
|
+
const MAX_TABS = 16;
|
|
13
|
+
function tabRules() {
|
|
14
|
+
let out = "";
|
|
15
|
+
for (let n = 1; n <= MAX_TABS; n++) {
|
|
16
|
+
// Show the checked tab's pane...
|
|
17
|
+
out += `.plumix-debug-bar__radio:nth-of-type(${n}):checked ~ .plumix-debug-bar__panes > .plumix-debug-bar__pane:nth-of-type(${n}){display:block}`;
|
|
18
|
+
// ...and highlight its label so the active tab is obvious.
|
|
19
|
+
out += `.plumix-debug-bar__radio:nth-of-type(${n}):checked ~ .plumix-debug-bar__labels > label:nth-of-type(${n}){background:#1d2327;color:#fff}`;
|
|
20
|
+
}
|
|
21
|
+
return out;
|
|
22
|
+
}
|
|
23
|
+
const POSITION_CSS = css `
|
|
24
|
+
.plumix-debug-bar[data-position="bottom-right"] {
|
|
25
|
+
inset: auto 12px 12px auto;
|
|
26
|
+
}
|
|
27
|
+
.plumix-debug-bar[data-position="bottom-left"] {
|
|
28
|
+
inset: auto auto 12px 12px;
|
|
29
|
+
}
|
|
30
|
+
.plumix-debug-bar[data-position="top-right"] {
|
|
31
|
+
inset: 12px 12px auto auto;
|
|
32
|
+
}
|
|
33
|
+
.plumix-debug-bar[data-position="top-left"] {
|
|
34
|
+
inset: 12px auto auto 12px;
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
export const DEBUG_BAR_CSS = css `
|
|
38
|
+
.plumix-debug-bar {
|
|
39
|
+
all: revert;
|
|
40
|
+
position: fixed;
|
|
41
|
+
z-index: var(--plumix-debug-bar-z-index, 2147483000);
|
|
42
|
+
direction: ltr;
|
|
43
|
+
font-family:
|
|
44
|
+
ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
|
|
45
|
+
font-size: 12px;
|
|
46
|
+
line-height: 1.5;
|
|
47
|
+
color: #e6e6e6;
|
|
48
|
+
/* Fixed width (not max-width) so switching tabs can't resize the bar —
|
|
49
|
+
a content-driven width shifts the anchored edges and moves the tab
|
|
50
|
+
labels out from under the cursor. */
|
|
51
|
+
width: min(440px, calc(100vw - 24px));
|
|
52
|
+
}
|
|
53
|
+
.plumix-debug-bar *,
|
|
54
|
+
.plumix-debug-bar *::before,
|
|
55
|
+
.plumix-debug-bar *::after {
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
}
|
|
58
|
+
/* Neutralize theme element selectors bleeding into the bar's bare tags.
|
|
59
|
+
The specific rules below re-set what each element needs, winning by
|
|
60
|
+
source order (equal specificity). */
|
|
61
|
+
.plumix-debug-bar details,
|
|
62
|
+
.plumix-debug-bar summary,
|
|
63
|
+
.plumix-debug-bar nav,
|
|
64
|
+
.plumix-debug-bar section,
|
|
65
|
+
.plumix-debug-bar label,
|
|
66
|
+
.plumix-debug-bar input,
|
|
67
|
+
.plumix-debug-bar table,
|
|
68
|
+
.plumix-debug-bar tbody,
|
|
69
|
+
.plumix-debug-bar tr,
|
|
70
|
+
.plumix-debug-bar th,
|
|
71
|
+
.plumix-debug-bar td,
|
|
72
|
+
.plumix-debug-bar dl,
|
|
73
|
+
.plumix-debug-bar dt,
|
|
74
|
+
.plumix-debug-bar dd {
|
|
75
|
+
margin: 0;
|
|
76
|
+
padding: 0;
|
|
77
|
+
border: 0;
|
|
78
|
+
background: none;
|
|
79
|
+
font: inherit;
|
|
80
|
+
color: inherit;
|
|
81
|
+
text-align: inherit;
|
|
82
|
+
/* The font shorthand omits these — reset them so a theme's element
|
|
83
|
+
rules (e.g. label text-transform/letter-spacing) can't bleed in. */
|
|
84
|
+
text-transform: none;
|
|
85
|
+
letter-spacing: normal;
|
|
86
|
+
word-spacing: normal;
|
|
87
|
+
text-decoration: none;
|
|
88
|
+
text-indent: 0;
|
|
89
|
+
white-space: normal;
|
|
90
|
+
box-shadow: none;
|
|
91
|
+
}
|
|
92
|
+
.plumix-debug-bar > details {
|
|
93
|
+
background: #1d2327;
|
|
94
|
+
border: 1px solid #3c434a;
|
|
95
|
+
border-radius: 8px;
|
|
96
|
+
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
|
|
97
|
+
overflow: hidden;
|
|
98
|
+
}
|
|
99
|
+
.plumix-debug-bar summary {
|
|
100
|
+
list-style: none;
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
padding: 6px 12px;
|
|
103
|
+
font-weight: 600;
|
|
104
|
+
background: #2c3338;
|
|
105
|
+
user-select: none;
|
|
106
|
+
}
|
|
107
|
+
.plumix-debug-bar summary::-webkit-details-marker {
|
|
108
|
+
display: none;
|
|
109
|
+
}
|
|
110
|
+
/* Toggle affordance: chevron points right when collapsed, down when open,
|
|
111
|
+
so it's clear the header opens and closes the bar. */
|
|
112
|
+
.plumix-debug-bar summary::after {
|
|
113
|
+
content: "▸";
|
|
114
|
+
float: right;
|
|
115
|
+
opacity: 0.6;
|
|
116
|
+
}
|
|
117
|
+
.plumix-debug-bar > details[open] > summary::after {
|
|
118
|
+
content: "▾";
|
|
119
|
+
}
|
|
120
|
+
.plumix-debug-bar__radio {
|
|
121
|
+
position: absolute;
|
|
122
|
+
opacity: 0;
|
|
123
|
+
pointer-events: none;
|
|
124
|
+
}
|
|
125
|
+
/* Qualified with nav so this out-specifies the element reset (which zeroes
|
|
126
|
+
nav padding) — otherwise the tabs get no left inset and hug the border. */
|
|
127
|
+
.plumix-debug-bar nav.plumix-debug-bar__labels {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-wrap: wrap;
|
|
130
|
+
gap: 6px;
|
|
131
|
+
/* 12px left inset matches the summary and panes; generous top padding
|
|
132
|
+
gives the tab row space below the header. */
|
|
133
|
+
padding: 14px 12px 0;
|
|
134
|
+
border-top: 1px solid #3c434a;
|
|
135
|
+
}
|
|
136
|
+
.plumix-debug-bar__labels label {
|
|
137
|
+
/* No LEFT padding, so the tab text aligns exactly with the title and
|
|
138
|
+
content at 12px. Right padding gives the active box separation without
|
|
139
|
+
letting it overhang toward the border. */
|
|
140
|
+
padding: 3px 8px 3px 0;
|
|
141
|
+
border-radius: 4px 4px 0 0;
|
|
142
|
+
cursor: pointer;
|
|
143
|
+
color: #b9c0c7;
|
|
144
|
+
/* Intentional small-caps tab look, matching __section-title. Our own
|
|
145
|
+
rule (wins over the reset by source order), so it's theme-independent. */
|
|
146
|
+
font-size: 11px;
|
|
147
|
+
text-transform: uppercase;
|
|
148
|
+
letter-spacing: 0.04em;
|
|
149
|
+
}
|
|
150
|
+
.plumix-debug-bar__labels label:hover {
|
|
151
|
+
background: #2c3338;
|
|
152
|
+
color: #fff;
|
|
153
|
+
}
|
|
154
|
+
.plumix-debug-bar__panes {
|
|
155
|
+
/* Small horizontal inset so cards sit just off the bar edge; the card's
|
|
156
|
+
own padding adds the rest, landing content text at 12px — flush with
|
|
157
|
+
the summary title and tab row above. */
|
|
158
|
+
padding: 10px 4px 12px;
|
|
159
|
+
/* Fixed height (not max-height) so the bar doesn't grow/shrink between
|
|
160
|
+
tabs; each pane scrolls within the stable frame. */
|
|
161
|
+
height: min(50vh, 320px);
|
|
162
|
+
overflow: auto;
|
|
163
|
+
/* Narrow, theme-matched scrollbar instead of the OS default. */
|
|
164
|
+
scrollbar-width: thin;
|
|
165
|
+
scrollbar-color: #3c434a transparent;
|
|
166
|
+
}
|
|
167
|
+
.plumix-debug-bar__panes::-webkit-scrollbar {
|
|
168
|
+
width: 8px;
|
|
169
|
+
height: 8px;
|
|
170
|
+
}
|
|
171
|
+
.plumix-debug-bar__panes::-webkit-scrollbar-thumb {
|
|
172
|
+
background: #3c434a;
|
|
173
|
+
border-radius: 4px;
|
|
174
|
+
}
|
|
175
|
+
.plumix-debug-bar__panes::-webkit-scrollbar-thumb:hover {
|
|
176
|
+
background: #4a535b;
|
|
177
|
+
}
|
|
178
|
+
.plumix-debug-bar__panes::-webkit-scrollbar-track {
|
|
179
|
+
background: transparent;
|
|
180
|
+
}
|
|
181
|
+
.plumix-debug-bar__pane {
|
|
182
|
+
display: none;
|
|
183
|
+
}
|
|
184
|
+
.plumix-debug-bar__section-title {
|
|
185
|
+
margin: 0 0 6px;
|
|
186
|
+
font-size: 11px;
|
|
187
|
+
text-transform: uppercase;
|
|
188
|
+
letter-spacing: 0.04em;
|
|
189
|
+
color: #8a929a;
|
|
190
|
+
}
|
|
191
|
+
/* Key/value description list — a fixed first column so every value lines
|
|
192
|
+
up the same distance in, across all sections. */
|
|
193
|
+
.plumix-debug-bar__kv {
|
|
194
|
+
display: grid;
|
|
195
|
+
grid-template-columns: 104px 1fr;
|
|
196
|
+
gap: 3px 8px;
|
|
197
|
+
align-items: baseline;
|
|
198
|
+
}
|
|
199
|
+
.plumix-debug-bar__kv dt {
|
|
200
|
+
color: #8a929a;
|
|
201
|
+
}
|
|
202
|
+
.plumix-debug-bar__kv dd {
|
|
203
|
+
color: #fff;
|
|
204
|
+
overflow-wrap: anywhere;
|
|
205
|
+
}
|
|
206
|
+
/* Group each section as a subtle card. */
|
|
207
|
+
.plumix-debug-bar__pane > section {
|
|
208
|
+
background: #23282f;
|
|
209
|
+
border-radius: 6px;
|
|
210
|
+
padding: 8px;
|
|
211
|
+
}
|
|
212
|
+
.plumix-debug-bar__pane > section + section {
|
|
213
|
+
margin-top: 8px;
|
|
214
|
+
}
|
|
215
|
+
.plumix-debug-bar__error {
|
|
216
|
+
margin: 0;
|
|
217
|
+
color: #f0a5a5;
|
|
218
|
+
}
|
|
219
|
+
.plumix-debug-bar table {
|
|
220
|
+
width: 100%;
|
|
221
|
+
border-collapse: collapse;
|
|
222
|
+
/* Data is technical — force LTR regardless of page locale. */
|
|
223
|
+
direction: ltr;
|
|
224
|
+
text-align: left;
|
|
225
|
+
}
|
|
226
|
+
.plumix-debug-bar th,
|
|
227
|
+
.plumix-debug-bar td {
|
|
228
|
+
padding: 3px 8px 3px 0;
|
|
229
|
+
vertical-align: top;
|
|
230
|
+
border: 0;
|
|
231
|
+
font-weight: 400;
|
|
232
|
+
white-space: nowrap;
|
|
233
|
+
}
|
|
234
|
+
.plumix-debug-bar td.plumix-debug-bar__val {
|
|
235
|
+
white-space: normal;
|
|
236
|
+
/* Wrap long values at spaces (and break a word only if it would
|
|
237
|
+
overflow) without squeezing short cells — word-break:break-word
|
|
238
|
+
shrank the numeric columns until a value like 1.8 wrapped. */
|
|
239
|
+
overflow-wrap: break-word;
|
|
240
|
+
color: #fff;
|
|
241
|
+
}
|
|
242
|
+
.plumix-debug-bar th {
|
|
243
|
+
color: #8a929a;
|
|
244
|
+
}
|
|
245
|
+
.plumix-debug-bar__empty {
|
|
246
|
+
margin: 0;
|
|
247
|
+
color: #8a929a;
|
|
248
|
+
}
|
|
249
|
+
/* Template panel — candidate hierarchy */
|
|
250
|
+
.plumix-debug-bar__candidates {
|
|
251
|
+
list-style: none;
|
|
252
|
+
margin: 0;
|
|
253
|
+
padding: 0;
|
|
254
|
+
}
|
|
255
|
+
.plumix-debug-bar__candidate {
|
|
256
|
+
padding: 1px 0 1px 14px;
|
|
257
|
+
color: #8a929a;
|
|
258
|
+
}
|
|
259
|
+
.plumix-debug-bar__candidate--picked {
|
|
260
|
+
color: #7ee787;
|
|
261
|
+
font-weight: 600;
|
|
262
|
+
}
|
|
263
|
+
.plumix-debug-bar__candidate--picked::before {
|
|
264
|
+
content: "▸ ";
|
|
265
|
+
margin-left: -14px;
|
|
266
|
+
}
|
|
267
|
+
/* Timeline panel — SVG waterfall */
|
|
268
|
+
.plumix-debug-bar__timeline {
|
|
269
|
+
display: block;
|
|
270
|
+
overflow: visible;
|
|
271
|
+
}
|
|
272
|
+
.plumix-debug-bar__timeline-bar {
|
|
273
|
+
fill: #6ea8fe;
|
|
274
|
+
}
|
|
275
|
+
.plumix-debug-bar__timeline-name {
|
|
276
|
+
fill: #e6e6e6;
|
|
277
|
+
font-size: 10px;
|
|
278
|
+
}
|
|
279
|
+
.plumix-debug-bar__timeline-ms {
|
|
280
|
+
fill: #8a929a;
|
|
281
|
+
font-size: 9px;
|
|
282
|
+
}
|
|
283
|
+
/* Database panel — query list */
|
|
284
|
+
.plumix-debug-bar__queries {
|
|
285
|
+
list-style: none;
|
|
286
|
+
margin: 0;
|
|
287
|
+
padding: 0;
|
|
288
|
+
display: flex;
|
|
289
|
+
flex-direction: column;
|
|
290
|
+
gap: 8px;
|
|
291
|
+
}
|
|
292
|
+
.plumix-debug-bar__query {
|
|
293
|
+
display: flex;
|
|
294
|
+
flex-direction: column;
|
|
295
|
+
gap: 3px;
|
|
296
|
+
padding-bottom: 8px;
|
|
297
|
+
border-bottom: 1px solid #2c3338;
|
|
298
|
+
}
|
|
299
|
+
.plumix-debug-bar__query:last-child {
|
|
300
|
+
border-bottom: 0;
|
|
301
|
+
padding-bottom: 0;
|
|
302
|
+
}
|
|
303
|
+
.plumix-debug-bar__query-head {
|
|
304
|
+
display: flex;
|
|
305
|
+
gap: 6px;
|
|
306
|
+
align-items: baseline;
|
|
307
|
+
}
|
|
308
|
+
.plumix-debug-bar__kind {
|
|
309
|
+
flex: 0 0 auto;
|
|
310
|
+
font-size: 9px;
|
|
311
|
+
text-transform: uppercase;
|
|
312
|
+
letter-spacing: 0.04em;
|
|
313
|
+
padding: 1px 5px;
|
|
314
|
+
border-radius: 3px;
|
|
315
|
+
background: #2c3338;
|
|
316
|
+
color: #b9c0c7;
|
|
317
|
+
}
|
|
318
|
+
.plumix-debug-bar__kind--select {
|
|
319
|
+
background: rgba(126, 231, 135, 0.15);
|
|
320
|
+
color: #7ee787;
|
|
321
|
+
}
|
|
322
|
+
.plumix-debug-bar__kind--insert {
|
|
323
|
+
background: rgba(110, 168, 254, 0.15);
|
|
324
|
+
color: #6ea8fe;
|
|
325
|
+
}
|
|
326
|
+
.plumix-debug-bar__kind--update {
|
|
327
|
+
background: rgba(227, 179, 65, 0.15);
|
|
328
|
+
color: #e3b341;
|
|
329
|
+
}
|
|
330
|
+
.plumix-debug-bar__kind--delete {
|
|
331
|
+
background: rgba(240, 165, 165, 0.15);
|
|
332
|
+
color: #f0a5a5;
|
|
333
|
+
}
|
|
334
|
+
.plumix-debug-bar__sql {
|
|
335
|
+
font-family: inherit;
|
|
336
|
+
color: #c9d1d9;
|
|
337
|
+
overflow-wrap: anywhere;
|
|
338
|
+
}
|
|
339
|
+
.plumix-debug-bar__tok--keyword {
|
|
340
|
+
color: #6ea8fe;
|
|
341
|
+
}
|
|
342
|
+
.plumix-debug-bar__tok--string {
|
|
343
|
+
color: #7ee787;
|
|
344
|
+
}
|
|
345
|
+
.plumix-debug-bar__tok--number {
|
|
346
|
+
color: #56d4dd;
|
|
347
|
+
}
|
|
348
|
+
.plumix-debug-bar__params {
|
|
349
|
+
display: flex;
|
|
350
|
+
flex-wrap: wrap;
|
|
351
|
+
gap: 6px;
|
|
352
|
+
padding-left: 10px;
|
|
353
|
+
}
|
|
354
|
+
.plumix-debug-bar__param {
|
|
355
|
+
color: #b9c0c7;
|
|
356
|
+
}
|
|
357
|
+
.plumix-debug-bar__param--string {
|
|
358
|
+
color: #7ee787;
|
|
359
|
+
}
|
|
360
|
+
.plumix-debug-bar__param--number {
|
|
361
|
+
color: #56d4dd;
|
|
362
|
+
}
|
|
363
|
+
.plumix-debug-bar__param--boolean {
|
|
364
|
+
color: #e3b341;
|
|
365
|
+
}
|
|
366
|
+
.plumix-debug-bar__param--null {
|
|
367
|
+
color: #8a929a;
|
|
368
|
+
}
|
|
369
|
+
` +
|
|
370
|
+
POSITION_CSS +
|
|
371
|
+
tabRules();
|
|
372
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/debug-bar/styles.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,4EAA4E;AAC5E,8EAA8E;AAC9E,8EAA8E;AAC9E,uEAAuE;AACvE,gFAAgF;AAChF,8EAA8E;AAC9E,wEAAwE;AAExE,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,0EAA0E;AAC1E,0DAA0D;AAC1D,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB,SAAS,QAAQ;IACf,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;QACnC,iCAAiC;QACjC,GAAG,IAAI,wCAAwC,CAAC,8EAA8E,CAAC,kBAAkB,CAAC;QAClJ,2DAA2D;QAC3D,GAAG,IAAI,wCAAwC,CAAC,6DAA6D,CAAC,kCAAkC,CAAC;IACnJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;;;;;;;;CAavB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GACxB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4UF;IACD,YAAY;IACZ,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ResolvedNode } from "../route/render/template-hierarchy.js";
|
|
2
|
+
/** Panel id + collector namespace for the template hierarchy resolution. */
|
|
3
|
+
export declare const TEMPLATE_PANEL_ID = "template";
|
|
4
|
+
/** A human label for the resolved route node, for the Template panel. */
|
|
5
|
+
export declare function templateNodeLabel(node: ResolvedNode): string;
|
|
6
|
+
//# sourceMappingURL=template-node-label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-node-label.d.ts","sourceRoot":"","sources":["../../src/debug-bar/template-node-label.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAE1E,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAE5C,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAe5D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Panel id + collector namespace for the template hierarchy resolution. */
|
|
2
|
+
export const TEMPLATE_PANEL_ID = "template";
|
|
3
|
+
/** A human label for the resolved route node, for the Template panel. */
|
|
4
|
+
export function templateNodeLabel(node) {
|
|
5
|
+
switch (node.kind) {
|
|
6
|
+
case "content":
|
|
7
|
+
return `${node.entryType}: ${node.slug}`;
|
|
8
|
+
case "term":
|
|
9
|
+
return `${node.taxonomy}: ${node.slug}`;
|
|
10
|
+
case "content-type-archive":
|
|
11
|
+
return `${node.entryType} archive`;
|
|
12
|
+
case "front-page":
|
|
13
|
+
return "front page";
|
|
14
|
+
case "posts-page":
|
|
15
|
+
return "posts page";
|
|
16
|
+
case "search":
|
|
17
|
+
return "search";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=template-node-label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-node-label.js","sourceRoot":"","sources":["../../src/debug-bar/template-node-label.ts"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAE5C,yEAAyE;AACzE,MAAM,UAAU,iBAAiB,CAAC,IAAkB;IAClD,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,SAAS;YACZ,OAAO,GAAG,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;QAC3C,KAAK,MAAM;YACT,OAAO,GAAG,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;QAC1C,KAAK,sBAAsB;YACzB,OAAO,GAAG,IAAI,CAAC,SAAS,UAAU,CAAC;QACrC,KAAK,YAAY;YACf,OAAO,YAAY,CAAC;QACtB,KAAK,YAAY;YACf,OAAO,YAAY,CAAC;QACtB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC"}
|