@plumix/core 0.1.4 → 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.
Files changed (131) hide show
  1. package/dist/admin-bar/collect.d.ts.map +1 -1
  2. package/dist/admin-bar/collect.js +1 -15
  3. package/dist/admin-bar/collect.js.map +1 -1
  4. package/dist/admin-bar/styles.d.ts.map +1 -1
  5. package/dist/admin-bar/styles.js +1 -11
  6. package/dist/admin-bar/styles.js.map +1 -1
  7. package/dist/cli/worker-codegen.d.ts.map +1 -1
  8. package/dist/cli/worker-codegen.js +3 -5
  9. package/dist/cli/worker-codegen.js.map +1 -1
  10. package/dist/context/app.d.ts +8 -0
  11. package/dist/context/app.d.ts.map +1 -1
  12. package/dist/context/app.js +7 -0
  13. package/dist/context/app.js.map +1 -1
  14. package/dist/context/debug.d.ts +25 -0
  15. package/dist/context/debug.d.ts.map +1 -0
  16. package/dist/context/debug.js +13 -0
  17. package/dist/context/debug.js.map +1 -0
  18. package/dist/context/stores.d.ts +2 -0
  19. package/dist/context/stores.d.ts.map +1 -1
  20. package/dist/context/stores.js.map +1 -1
  21. package/dist/css-tag.d.ts +2 -0
  22. package/dist/css-tag.d.ts.map +1 -0
  23. package/dist/css-tag.js +13 -0
  24. package/dist/css-tag.js.map +1 -0
  25. package/dist/db/libsql.d.ts.map +1 -1
  26. package/dist/db/libsql.js +13 -2
  27. package/dist/db/libsql.js.map +1 -1
  28. package/dist/debug-bar/collect.d.ts.map +1 -1
  29. package/dist/debug-bar/collect.js +1 -15
  30. package/dist/debug-bar/collect.js.map +1 -1
  31. package/dist/debug-bar/collector.d.ts +9 -0
  32. package/dist/debug-bar/collector.d.ts.map +1 -0
  33. package/dist/debug-bar/collector.js +80 -0
  34. package/dist/debug-bar/collector.js.map +1 -0
  35. package/dist/debug-bar/component.d.ts.map +1 -1
  36. package/dist/debug-bar/component.js +15 -2
  37. package/dist/debug-bar/component.js.map +1 -1
  38. package/dist/debug-bar/core-panels.d.ts.map +1 -1
  39. package/dist/debug-bar/core-panels.js +12 -1
  40. package/dist/debug-bar/core-panels.js.map +1 -1
  41. package/dist/debug-bar/db-query.d.ts +21 -0
  42. package/dist/debug-bar/db-query.d.ts.map +1 -0
  43. package/dist/debug-bar/db-query.js +23 -0
  44. package/dist/debug-bar/db-query.js.map +1 -0
  45. package/dist/debug-bar/format-param.d.ts +14 -0
  46. package/dist/debug-bar/format-param.d.ts.map +1 -0
  47. package/dist/debug-bar/format-param.js +27 -0
  48. package/dist/debug-bar/format-param.js.map +1 -0
  49. package/dist/debug-bar/highlight-sql.d.ts +11 -0
  50. package/dist/debug-bar/highlight-sql.d.ts.map +1 -0
  51. package/dist/debug-bar/highlight-sql.js +82 -0
  52. package/dist/debug-bar/highlight-sql.js.map +1 -0
  53. package/dist/debug-bar/panels/app.d.ts +8 -0
  54. package/dist/debug-bar/panels/app.d.ts.map +1 -0
  55. package/dist/debug-bar/panels/app.js +32 -0
  56. package/dist/debug-bar/panels/app.js.map +1 -0
  57. package/dist/debug-bar/panels/database.d.ts +9 -0
  58. package/dist/debug-bar/panels/database.d.ts.map +1 -0
  59. package/dist/debug-bar/panels/database.js +33 -0
  60. package/dist/debug-bar/panels/database.js.map +1 -0
  61. package/dist/debug-bar/panels/request.d.ts +2 -2
  62. package/dist/debug-bar/panels/request.d.ts.map +1 -1
  63. package/dist/debug-bar/panels/request.js +24 -11
  64. package/dist/debug-bar/panels/request.js.map +1 -1
  65. package/dist/debug-bar/panels/template.d.ts +17 -0
  66. package/dist/debug-bar/panels/template.d.ts.map +1 -0
  67. package/dist/debug-bar/panels/template.js +26 -0
  68. package/dist/debug-bar/panels/template.js.map +1 -0
  69. package/dist/debug-bar/panels/timeline.d.ts +11 -0
  70. package/dist/debug-bar/panels/timeline.d.ts.map +1 -0
  71. package/dist/debug-bar/panels/timeline.js +46 -0
  72. package/dist/debug-bar/panels/timeline.js.map +1 -0
  73. package/dist/debug-bar/primitives.d.ts +12 -3
  74. package/dist/debug-bar/primitives.d.ts.map +1 -1
  75. package/dist/debug-bar/primitives.js +17 -1
  76. package/dist/debug-bar/primitives.js.map +1 -1
  77. package/dist/debug-bar/styles.d.ts.map +1 -1
  78. package/dist/debug-bar/styles.js +234 -17
  79. package/dist/debug-bar/styles.js.map +1 -1
  80. package/dist/debug-bar/template-node-label.d.ts +6 -0
  81. package/dist/debug-bar/template-node-label.d.ts.map +1 -0
  82. package/dist/debug-bar/template-node-label.js +20 -0
  83. package/dist/debug-bar/template-node-label.js.map +1 -0
  84. package/dist/debug-bar/timeline-geometry.d.ts +30 -0
  85. package/dist/debug-bar/timeline-geometry.d.ts.map +1 -0
  86. package/dist/debug-bar/timeline-geometry.js +26 -0
  87. package/dist/debug-bar/timeline-geometry.js.map +1 -0
  88. package/dist/debug-bar/timeline-model.d.ts +23 -0
  89. package/dist/debug-bar/timeline-model.d.ts.map +1 -0
  90. package/dist/debug-bar/timeline-model.js +34 -0
  91. package/dist/debug-bar/timeline-model.js.map +1 -0
  92. package/dist/debug-bar/trace-libsql.d.ts +18 -0
  93. package/dist/debug-bar/trace-libsql.d.ts.map +1 -0
  94. package/dist/debug-bar/trace-libsql.js +42 -0
  95. package/dist/debug-bar/trace-libsql.js.map +1 -0
  96. package/dist/debug-bar/types.d.ts +6 -0
  97. package/dist/debug-bar/types.d.ts.map +1 -1
  98. package/dist/hooks/registry.d.ts +14 -3
  99. package/dist/hooks/registry.d.ts.map +1 -1
  100. package/dist/hooks/registry.js +22 -0
  101. package/dist/hooks/registry.js.map +1 -1
  102. package/dist/index.d.ts +1 -0
  103. package/dist/index.d.ts.map +1 -1
  104. package/dist/index.js +3 -0
  105. package/dist/index.js.map +1 -1
  106. package/dist/plugin/manifest.d.ts +3 -0
  107. package/dist/plugin/manifest.d.ts.map +1 -1
  108. package/dist/plugin/manifest.js +1 -0
  109. package/dist/plugin/manifest.js.map +1 -1
  110. package/dist/plugin/register.d.ts.map +1 -1
  111. package/dist/plugin/register.js +1 -0
  112. package/dist/plugin/register.js.map +1 -1
  113. package/dist/route/render/render-template.d.ts +1 -1
  114. package/dist/route/render/render-template.d.ts.map +1 -1
  115. package/dist/route/render/render-template.js +17 -1
  116. package/dist/route/render/render-template.js.map +1 -1
  117. package/dist/runtime/app.d.ts +8 -5
  118. package/dist/runtime/app.d.ts.map +1 -1
  119. package/dist/runtime/app.js +1 -1
  120. package/dist/runtime/app.js.map +1 -1
  121. package/dist/runtime/dispatcher.d.ts.map +1 -1
  122. package/dist/runtime/dispatcher.js +4 -2
  123. package/dist/runtime/dispatcher.js.map +1 -1
  124. package/dist/test/dispatcher.d.ts +3 -0
  125. package/dist/test/dispatcher.d.ts.map +1 -1
  126. package/dist/test/dispatcher.js +8 -2
  127. package/dist/test/dispatcher.js.map +1 -1
  128. package/dist/test/harness.d.ts.map +1 -1
  129. package/dist/test/harness.js +12 -2
  130. package/dist/test/harness.js.map +1 -1
  131. package/package.json +2 -2
@@ -0,0 +1,23 @@
1
+ import { tryGetContext } from "../context/stores.js";
2
+ /** Panel id + collector namespace for database queries. */
3
+ export const DB_PANEL_ID = "database";
4
+ /**
5
+ * A drizzle `Logger` that feeds the Database panel. Pass it as the `logger`
6
+ * option to `drizzle(...)` (dev-gated) — one uniform mechanism across every
7
+ * driver, giving the `?`-form SQL plus the bound params. It reaches the
8
+ * request's collector via the request-store ALS, so it's a no-op outside a
9
+ * request (and in prod, where `ctx.debug` is the no-op collector). Per-query
10
+ * timing is not part of drizzle's logger contract; the Timeline panel measures
11
+ * it via spans instead.
12
+ *
13
+ * Driver-agnostic and free of any driver type import, so it can be shared with
14
+ * runtime adapters (D1) over a narrow subpath without dragging libsql types in.
15
+ */
16
+ export function createDebugSqlLogger() {
17
+ return {
18
+ logQuery(sql, params) {
19
+ tryGetContext()?.debug.record(DB_PANEL_ID, { sql, params });
20
+ },
21
+ };
22
+ }
23
+ //# sourceMappingURL=db-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db-query.js","sourceRoot":"","sources":["../../src/debug-bar/db-query.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,2DAA2D;AAC3D,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;AAOtC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO;QACL,QAAQ,CAAC,GAAG,EAAE,MAAM;YAClB,aAAa,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;QAC9D,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ type SqlParamKind = "string" | "number" | "boolean" | "null" | "blob";
2
+ export interface DescribedParam {
3
+ readonly kind: SqlParamKind;
4
+ readonly text: string;
5
+ }
6
+ /**
7
+ * Describe a bound SQL parameter for the Database panel: its `kind` (for
8
+ * per-type coloring) and display `text` (strings quoted, numbers/bigints/
9
+ * booleans/null as literals, long strings truncated) — the `?`-form SQL stays
10
+ * copyable. One pass so the kind and text can't drift apart.
11
+ */
12
+ export declare function describeSqlParam(value: unknown): DescribedParam;
13
+ export {};
14
+ //# sourceMappingURL=format-param.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-param.d.ts","sourceRoot":"","sources":["../../src/debug-bar/format-param.ts"],"names":[],"mappings":"AAEA,KAAK,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAiB/D"}
@@ -0,0 +1,27 @@
1
+ const MAX_LEN = 80;
2
+ /**
3
+ * Describe a bound SQL parameter for the Database panel: its `kind` (for
4
+ * per-type coloring) and display `text` (strings quoted, numbers/bigints/
5
+ * booleans/null as literals, long strings truncated) — the `?`-form SQL stays
6
+ * copyable. One pass so the kind and text can't drift apart.
7
+ */
8
+ export function describeSqlParam(value) {
9
+ if (value === null || value === undefined)
10
+ return { kind: "null", text: "null" };
11
+ if (typeof value === "string") {
12
+ const text = value.length > MAX_LEN ? `${value.slice(0, MAX_LEN)}…` : value;
13
+ return { kind: "string", text: `"${text}"` };
14
+ }
15
+ if (typeof value === "bigint")
16
+ return { kind: "number", text: value.toString() };
17
+ if (typeof value === "number")
18
+ return { kind: "number", text: String(value) };
19
+ if (typeof value === "boolean")
20
+ return { kind: "boolean", text: String(value) };
21
+ if (value instanceof Uint8Array) {
22
+ return { kind: "blob", text: `<blob ${value.byteLength} bytes>` };
23
+ }
24
+ // Objects/dates are unusual as bound params — JSON gives a readable form.
25
+ return { kind: "string", text: JSON.stringify(value) };
26
+ }
27
+ //# sourceMappingURL=format-param.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-param.js","sourceRoot":"","sources":["../../src/debug-bar/format-param.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,EAAE,CAAC;AASnB;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QACvC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;QAC5E,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC;IAC/C,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAC3B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IAC9E,IAAI,OAAO,KAAK,KAAK,SAAS;QAC5B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IAClD,IAAI,KAAK,YAAY,UAAU,EAAE,CAAC;QAChC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,CAAC,UAAU,SAAS,EAAE,CAAC;IACpE,CAAC;IACD,0EAA0E;IAC1E,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;AACzD,CAAC"}
@@ -0,0 +1,11 @@
1
+ type SqlTokenKind = "keyword" | "string" | "number" | "text";
2
+ export interface SqlToken {
3
+ readonly text: string;
4
+ readonly kind: SqlTokenKind;
5
+ }
6
+ export declare function tokenizeSql(sql: string): readonly SqlToken[];
7
+ export type QueryKind = "select" | "insert" | "update" | "delete" | "other";
8
+ /** The leading statement kind, for the per-query badge/color. */
9
+ export declare function queryKind(sql: string): QueryKind;
10
+ export {};
11
+ //# sourceMappingURL=highlight-sql.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highlight-sql.d.ts","sourceRoot":"","sources":["../../src/debug-bar/highlight-sql.ts"],"names":[],"mappings":"AAuDA,KAAK,YAAY,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE7D,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;CAC7B;AAQD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,QAAQ,EAAE,CAa5D;AAED,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAI5E,iEAAiE;AACjE,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAGhD"}
@@ -0,0 +1,82 @@
1
+ // A small SQL syntax-highlighter for the Database panel (idea borrowed from
2
+ // drizzle-query-logger, adapted from terminal colors to CSS token spans).
3
+ const KEYWORDS = new Set([
4
+ "select",
5
+ "distinct",
6
+ "from",
7
+ "where",
8
+ "and",
9
+ "or",
10
+ "not",
11
+ "in",
12
+ "is",
13
+ "null",
14
+ "like",
15
+ "between",
16
+ "insert",
17
+ "into",
18
+ "values",
19
+ "update",
20
+ "set",
21
+ "delete",
22
+ "join",
23
+ "left",
24
+ "right",
25
+ "inner",
26
+ "outer",
27
+ "cross",
28
+ "on",
29
+ "as",
30
+ "order",
31
+ "by",
32
+ "group",
33
+ "having",
34
+ "limit",
35
+ "offset",
36
+ "asc",
37
+ "desc",
38
+ "union",
39
+ "all",
40
+ "count",
41
+ "sum",
42
+ "avg",
43
+ "min",
44
+ "max",
45
+ "returning",
46
+ "exists",
47
+ "case",
48
+ "when",
49
+ "then",
50
+ "else",
51
+ "end",
52
+ "pragma",
53
+ ]);
54
+ // One alternation per token class; the last branch mops up whitespace and
55
+ // punctuation (including `?` placeholders, and a lone unterminated `'`) so
56
+ // tokenization stays lossless for any input.
57
+ const TOKEN = /('(?:[^']|'')*')|(\d+(?:\.\d+)?)|([A-Za-z_][A-Za-z0-9_]*)|(\s+|[^\w'\s]+|')/g;
58
+ export function tokenizeSql(sql) {
59
+ const tokens = [];
60
+ for (const m of sql.matchAll(TOKEN)) {
61
+ if (m[1] !== undefined)
62
+ tokens.push({ text: m[1], kind: "string" });
63
+ else if (m[2] !== undefined)
64
+ tokens.push({ text: m[2], kind: "number" });
65
+ else if (m[3] !== undefined) {
66
+ tokens.push({
67
+ text: m[3],
68
+ kind: KEYWORDS.has(m[3].toLowerCase()) ? "keyword" : "text",
69
+ });
70
+ }
71
+ else
72
+ tokens.push({ text: m[4] ?? "", kind: "text" });
73
+ }
74
+ return tokens;
75
+ }
76
+ const KNOWN_KINDS = new Set(["select", "insert", "update", "delete"]);
77
+ /** The leading statement kind, for the per-query badge/color. */
78
+ export function queryKind(sql) {
79
+ const first = sql.trimStart().split(/\s/, 1)[0]?.toLowerCase() ?? "";
80
+ return (KNOWN_KINDS.has(first) ? first : "other");
81
+ }
82
+ //# sourceMappingURL=highlight-sql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highlight-sql.js","sourceRoot":"","sources":["../../src/debug-bar/highlight-sql.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,0EAA0E;AAE1E,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;IACvB,QAAQ;IACR,UAAU;IACV,MAAM;IACN,OAAO;IACP,KAAK;IACL,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,MAAM;IACN,SAAS;IACT,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,MAAM;IACN,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,OAAO;IACP,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,KAAK;IACL,MAAM;IACN,OAAO;IACP,KAAK;IACL,OAAO;IACP,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,WAAW;IACX,QAAQ;IACR,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,QAAQ;CACT,CAAC,CAAC;AASH,0EAA0E;AAC1E,2EAA2E;AAC3E,6CAA6C;AAC7C,M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CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IACrE,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAc,CAAC;AACjE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { DebugPanel } from "../types.js";
2
+ /**
3
+ * The App panel: the site's static setup — the same across every page, so it's
4
+ * consolidated into one tab (config, locale, wired slots, installed plugins,
5
+ * and registered content types) rather than a tab each.
6
+ */
7
+ export declare const appPanel: DebugPanel;
8
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/debug-bar/panels/app.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAU9C;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,UAgDtB,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { DebugKV, DebugSection } from "../primitives.js";
3
+ const wired = (slot) => (slot ? "✓" : "—");
4
+ const list = (values) => values.join(", ") || "—";
5
+ const keys = (map) => list([...map.keys()]);
6
+ /**
7
+ * The App panel: the site's static setup — the same across every page, so it's
8
+ * consolidated into one tab (config, locale, wired slots, installed plugins,
9
+ * and registered content types) rather than a tab each.
10
+ */
11
+ export const appPanel = {
12
+ id: "app",
13
+ title: "App",
14
+ order: 40,
15
+ render: (ctx) => (_jsxs(_Fragment, { children: [_jsx(DebugSection, { title: "Config", children: _jsx(DebugKV, { rows: [
16
+ { label: "Site name", value: ctx.siteName ?? "—" },
17
+ { label: "Origin", value: ctx.origin },
18
+ { label: "Base path", value: ctx.basePath || "/" },
19
+ ] }) }), _jsx(DebugSection, { title: "Locale", children: _jsx(DebugKV, { rows: [
20
+ { label: "Resolved", value: ctx.locale.code },
21
+ { label: "Direction", value: ctx.locale.direction },
22
+ ] }) }), _jsx(DebugSection, { title: "Slots", children: _jsx(DebugKV, { rows: [
23
+ { label: "Cache", value: wired(ctx.cache) },
24
+ { label: "Storage", value: wired(ctx.storage) },
25
+ { label: "Mailer", value: wired(ctx.mailer) },
26
+ { label: "Images", value: wired(ctx.imageDelivery) },
27
+ ] }) }), _jsx(DebugSection, { title: "Plugins", children: _jsx(DebugKV, { rows: [{ label: "Installed", value: list(ctx.plugins.pluginIds) }] }) }), _jsx(DebugSection, { title: "Content types", children: _jsx(DebugKV, { rows: [
28
+ { label: "Entry types", value: keys(ctx.plugins.entryTypes) },
29
+ { label: "Taxonomies", value: keys(ctx.plugins.termTaxonomies) },
30
+ ] }) })] })),
31
+ };
32
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/debug-bar/panels/app.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,KAAK,GAAG,CAAC,IAAa,EAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAE5D,MAAM,IAAI,GAAG,CAAC,MAAyB,EAAU,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;AAE7E,MAAM,IAAI,GAAG,CAAC,GAAiC,EAAU,EAAE,CACzD,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAe;IAClC,EAAE,EAAE,KAAK;IACT,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,CAAC,GAAe,EAAE,EAAE,CAAC,CAC3B,8BACE,KAAC,YAAY,IAAC,KAAK,EAA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,GACW,EACf,KAAC,YAAY,IAAC,KAAK,EAAC,eAAe,YACjC,KAAC,OAAO,IACN,IAAI,EAAE;wBACJ,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;wBAC7D,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;qBACjE,GACD,GACW,IACd,CACJ;CACF,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { DebugPanel } from "../types.js";
2
+ /**
3
+ * The Database panel: every query recorded for this request (via the drizzle
4
+ * logger), with SQL syntax highlighting, a per-query kind badge, and the bound
5
+ * params shown separately (typed-colored) — the `?`-form SQL stays copyable.
6
+ * Per-query timing arrives with the Timeline slice.
7
+ */
8
+ export declare const databasePanel: DebugPanel;
9
+ //# sourceMappingURL=database.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../src/debug-bar/panels/database.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAsB9C;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,UAgD3B,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { DB_PANEL_ID } from "../db-query.js";
3
+ import { describeSqlParam } from "../format-param.js";
4
+ import { queryKind, tokenizeSql } from "../highlight-sql.js";
5
+ import { DebugSection } from "../primitives.js";
6
+ function HighlightedSql({ sql }) {
7
+ return (_jsx("code", { className: "plumix-debug-bar__sql", children: tokenizeSql(sql).map((token, i) => token.kind === "text" ? (token.text) : (_jsx("span", { className: `plumix-debug-bar__tok--${token.kind}`, children: token.text }, i))) }));
8
+ }
9
+ /**
10
+ * The Database panel: every query recorded for this request (via the drizzle
11
+ * logger), with SQL syntax highlighting, a per-query kind badge, and the bound
12
+ * params shown separately (typed-colored) — the `?`-form SQL stays copyable.
13
+ * Per-query timing arrives with the Timeline slice.
14
+ */
15
+ export const databasePanel = {
16
+ id: DB_PANEL_ID,
17
+ title: "Database",
18
+ order: 20,
19
+ render: (ctx) => {
20
+ const queries = ctx.debug.get(DB_PANEL_ID);
21
+ if (queries.length === 0) {
22
+ return _jsx("p", { className: "plumix-debug-bar__empty", children: "No queries recorded." });
23
+ }
24
+ return (_jsx(DebugSection, { title: `${queries.length} ${queries.length === 1 ? "query" : "queries"}`, children: _jsx("ol", { className: "plumix-debug-bar__queries", children: queries.map((query, i) => {
25
+ const kind = queryKind(query.sql);
26
+ return (_jsxs("li", { className: "plumix-debug-bar__query", children: [_jsxs("div", { className: "plumix-debug-bar__query-head", children: [_jsx("span", { className: `plumix-debug-bar__kind plumix-debug-bar__kind--${kind}`, children: kind }), _jsx(HighlightedSql, { sql: query.sql })] }), query.params.length > 0 ? (_jsx("div", { className: "plumix-debug-bar__params", children: query.params.map((param, j) => {
27
+ const { kind: paramKind, text } = describeSqlParam(param);
28
+ return (_jsx("span", { className: `plumix-debug-bar__param plumix-debug-bar__param--${paramKind}`, children: text }, j));
29
+ }) })) : null] }, i));
30
+ }) }) }));
31
+ },
32
+ };
33
+ //# sourceMappingURL=database.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.js","sourceRoot":"","sources":["../../../src/debug-bar/panels/database.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,SAAS,cAAc,CAAC,EAAE,GAAG,EAA4B;IACvD,OAAO,CACL,eAAM,SAAS,EAAC,uBAAuB,YACpC,WAAW,CAAC,GAA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CAAC,CAAC,CAAC,CAAC,CACzB,cAAK,SAAS,EAAC,0BAA0B,YACtC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;oCAC7B,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;oCAC1D,OAAO,CACL,eAEE,SAAS,EAAE,oDAAoD,SAAS,EAAE,YAEzE,IAAI,IAHA,CAAC,CAID,CACR,CAAC;gCACJ,CAAC,CAAC,GACE,CACP,CAAC,CAAC,CAAC,IAAI,KAvBD,CAAC,CAwBL,CACN,CAAC;gBACJ,CAAC,CAAC,GACC,GACQ,CAChB,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import type { DebugPanel } from "../types.js";
2
2
  /**
3
- * The Request panel: how the router saw this request. All read straight
4
- * off the app context no instrumentation needed.
3
+ * The Request panel: the full context of this request how the router saw it,
4
+ * and who made it. All read straight off the app context, no instrumentation.
5
5
  */
6
6
  export declare const requestPanel: DebugPanel;
7
7
  //# sourceMappingURL=request.d.ts.map
@@ -1 +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,UAkB1B,CAAC"}
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"}
@@ -1,8 +1,8 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { DebugKV } from "../primitives.js";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { DebugKV, DebugSection } from "../primitives.js";
3
3
  /**
4
- * The Request panel: how the router saw this request. All read straight
5
- * off the app context no instrumentation needed.
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
6
  */
7
7
  export const requestPanel = {
8
8
  id: "request",
@@ -10,13 +10,26 @@ export const requestPanel = {
10
10
  order: 10,
11
11
  render: (ctx) => {
12
12
  const url = new URL(ctx.request.url);
13
- return (_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
- ] }));
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
+ ] }) })] }));
20
33
  },
21
34
  };
22
35
  //# sourceMappingURL=request.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/debug-bar/panels/request.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAe;IACtC,EAAE,EAAE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G,CAAC,OAAO,CAAC,MAAM,EAAE;4BAC9C,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,QAAQ,EAAE;4BACtC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE;4BACtC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,QAAQ,IAAI,GAAG,EAAE;4BAClD,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,CAAC,cAAc,EAAE,IAAI,IAAI,GAAG,EAAE;yBAC5D,GACD,GACW,EACf,KAAC,YAAY,IAAC,KAAK,EAAC,MAAM,YACxB,KAAC,OAAO,IACN,IAAI,EAAE;4BACJ;gCACE,KAAK,EAAE,MAAM;gCACb,KAAK,EAAE,GAAG,CAAC,IAAI;oCACb,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG;oCACxC,CAAC,CAAC,WAAW;6BAChB;4BACD;gCACE,KAAK,EAAE,QAAQ;gCACf,KAAK,EACH,GAAG,CAAC,WAAW,KAAK,IAAI;oCACtB,CAAC,CAAC,0BAA0B;oCAC5B,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM;6BAC3C;yBACF,GACD,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,EA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I,GACL,EACP,eACE,SAAS,EAAC,gCAAgC,EAC1C,CAAC,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"}
@@ -1,10 +1,14 @@
1
1
  import type { ReactNode } from "react";
2
2
  /**
3
3
  * Presentational primitives shared by core and plugin debug panels so every
4
- * panel reads uniformly. `DebugKV` is the two-column key/value table the
5
- * scalar panels use; richer primitives (sections, columnar tables) arrive
6
- * with the panels that need them.
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
7
  */
8
+ export declare function DebugSection({ title, children, }: {
9
+ readonly title?: string;
10
+ readonly children: ReactNode;
11
+ }): ReactNode;
8
12
  export interface DebugKVRow {
9
13
  readonly label: string;
10
14
  readonly value: ReactNode;
@@ -12,4 +16,9 @@ export interface DebugKVRow {
12
16
  export declare function DebugKV({ rows, }: {
13
17
  readonly rows: readonly DebugKVRow[];
14
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;
15
24
  //# sourceMappingURL=primitives.d.ts.map
@@ -1 +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;AAEvC;;;;;GAKG;AAEH,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"}
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"}
@@ -1,5 +1,21 @@
1
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
+ }
2
12
  export function DebugKV({ rows, }) {
3
- return (_jsx("table", { children: _jsx("tbody", { children: rows.map((row) => (_jsxs("tr", { children: [_jsx("th", { scope: "row", children: row.label }), _jsx("td", { className: "plumix-debug-bar__val", children: row.value })] }, row.label))) }) }));
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))) })] }));
4
20
  }
5
21
  //# sourceMappingURL=primitives.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../src/debug-bar/primitives.tsx"],"names":[],"mappings":";AAcA,MAAM,UAAU,OAAO,CAAC,EACtB,IAAI,GAGL;IACC,OAAO,CACL,0BACE,0BACG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACjB,yBACE,aAAI,KAAK,EAAC,KAAK,YAAE,GAAG,CAAC,KAAK,GAAM,EAChC,aAAI,SAAS,EAAC,uBAAuB,YAAE,GAAG,CAAC,KAAK,GAAM,KAF/C,GAAG,CAAC,KAAK,CAGb,CACN,CAAC,GACI,GACF,CACT,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../src/debug-bar/primitives.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC;;;;;GAKG;AAEH,MAAM,UAAU,YAAY,CAAC,EAC3B,KAAK,EACL,QAAQ,GAIT;IACC,OAAO,CACL,8BACG,KAAK,CAAC,CAAC,CAAC,CACP,YAAG,SAAS,EAAC,iCAAiC,YAAE,KAAK,GAAK,CAC3D,CAAC,CAAC,CAAC,IAAI,EACP,QAAQ,IACD,CACX,CAAC;AACJ,CAAC;AAOD,MAAM,UAAU,OAAO,CAAC,EACtB,IAAI,GAGL;IACC,6EAA6E;IAC7E,yEAAyE;IACzE,OAAO,CACL,aAAI,SAAS,EAAC,sBAAsB,YACjC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACjB,MAAC,QAAQ,eACP,uBAAK,GAAG,CAAC,KAAK,GAAM,EACpB,uBAAK,GAAG,CAAC,KAAK,GAAM,KAFP,GAAG,CAAC,KAAK,CAGb,CACZ,CAAC,GACC,CACN,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,UAAU,CAAC,EACzB,OAAO,EACP,IAAI,GAIL;IACC,OAAO,CACL,4BACE,0BACE,uBACG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAClB,aAAY,KAAK,EAAC,KAAK,YACpB,CAAC,IADK,CAAC,CAEL,CACN,CAAC,GACC,GACC,EACR,0BACG,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,uBACG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,aAAY,SAAS,EAAC,uBAAuB,YAC1C,IAAI,IADE,CAAC,CAEL,CACN,CAAC,IALK,CAAC,CAML,CACN,CAAC,GACI,IACF,CACT,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/debug-bar/styles.ts"],"names":[],"mappings":"AAgDA,eAAO,MAAM,aAAa,QAkHd,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/debug-bar/styles.ts"],"names":[],"mappings":"AAyCA,eAAO,MAAM,aAAa,QA+Ud,CAAC"}