@party-stack/ontology-devtools 0.6.1 → 0.7.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 (130) hide show
  1. package/README.md +195 -0
  2. package/lib/DisclosureSummary.d.ts +7 -0
  3. package/lib/DisclosureSummary.d.ts.map +1 -0
  4. package/lib/DisclosureSummary.js +20 -0
  5. package/lib/DisclosureSummary.js.map +1 -0
  6. package/lib/NativeQueryCode.d.ts +7 -0
  7. package/lib/NativeQueryCode.d.ts.map +1 -0
  8. package/lib/NativeQueryCode.js +35 -0
  9. package/lib/NativeQueryCode.js.map +1 -0
  10. package/lib/OntologyDevtools.d.ts +11 -49
  11. package/lib/OntologyDevtools.d.ts.map +1 -1
  12. package/lib/OntologyDevtools.js +310 -626
  13. package/lib/OntologyDevtools.js.map +1 -1
  14. package/lib/OntologyIcons.d.ts +14 -0
  15. package/lib/OntologyIcons.d.ts.map +1 -0
  16. package/lib/OntologyIcons.js +22 -0
  17. package/lib/OntologyIcons.js.map +1 -0
  18. package/lib/PanelBoundary.d.ts +10 -0
  19. package/lib/PanelBoundary.d.ts.map +1 -0
  20. package/lib/PanelBoundary.js +67 -0
  21. package/lib/PanelBoundary.js.map +1 -0
  22. package/lib/Pinned.d.ts +14 -0
  23. package/lib/Pinned.d.ts.map +1 -0
  24. package/lib/Pinned.js +142 -0
  25. package/lib/Pinned.js.map +1 -0
  26. package/lib/PinnedFamily.d.ts +13 -0
  27. package/lib/PinnedFamily.d.ts.map +1 -0
  28. package/lib/PinnedFamily.js +105 -0
  29. package/lib/PinnedFamily.js.map +1 -0
  30. package/lib/Queries.d.ts +12 -0
  31. package/lib/Queries.d.ts.map +1 -0
  32. package/lib/Queries.js +147 -0
  33. package/lib/Queries.js.map +1 -0
  34. package/lib/QueryOwners.d.ts +7 -0
  35. package/lib/QueryOwners.d.ts.map +1 -0
  36. package/lib/QueryOwners.js +46 -0
  37. package/lib/QueryOwners.js.map +1 -0
  38. package/lib/QueryPills.d.ts +17 -0
  39. package/lib/QueryPills.d.ts.map +1 -0
  40. package/lib/QueryPills.js +37 -0
  41. package/lib/QueryPills.js.map +1 -0
  42. package/lib/QueryPushdown.d.ts +26 -0
  43. package/lib/QueryPushdown.d.ts.map +1 -0
  44. package/lib/QueryPushdown.js +380 -0
  45. package/lib/QueryPushdown.js.map +1 -0
  46. package/lib/QueryTokens.d.ts +25 -0
  47. package/lib/QueryTokens.d.ts.map +1 -0
  48. package/lib/QueryTokens.js +49 -0
  49. package/lib/QueryTokens.js.map +1 -0
  50. package/lib/QueryView.d.ts +37 -0
  51. package/lib/QueryView.d.ts.map +1 -0
  52. package/lib/QueryView.js +547 -0
  53. package/lib/QueryView.js.map +1 -0
  54. package/lib/SchemaView.d.ts +8 -0
  55. package/lib/SchemaView.d.ts.map +1 -0
  56. package/lib/SchemaView.js +213 -0
  57. package/lib/SchemaView.js.map +1 -0
  58. package/lib/Storage.d.ts +17 -0
  59. package/lib/Storage.d.ts.map +1 -0
  60. package/lib/Storage.js +205 -0
  61. package/lib/Storage.js.map +1 -0
  62. package/lib/Tracing.d.ts +7 -0
  63. package/lib/Tracing.d.ts.map +1 -0
  64. package/lib/Tracing.js +344 -0
  65. package/lib/Tracing.js.map +1 -0
  66. package/lib/attribution/Highlight.d.ts +9 -0
  67. package/lib/attribution/Highlight.d.ts.map +1 -0
  68. package/lib/attribution/Highlight.js +73 -0
  69. package/lib/attribution/Highlight.js.map +1 -0
  70. package/lib/attribution/index.d.ts +12 -0
  71. package/lib/attribution/index.d.ts.map +1 -0
  72. package/lib/attribution/index.js +31 -0
  73. package/lib/attribution/index.js.map +1 -0
  74. package/lib/attribution/registry.d.ts +16 -0
  75. package/lib/attribution/registry.d.ts.map +1 -0
  76. package/lib/attribution/registry.js +31 -0
  77. package/lib/attribution/registry.js.map +1 -0
  78. package/lib/attribution/tanstack.d.ts +11 -0
  79. package/lib/attribution/tanstack.d.ts.map +1 -0
  80. package/lib/attribution/tanstack.js +81 -0
  81. package/lib/attribution/tanstack.js.map +1 -0
  82. package/lib/chrome.d.ts +9 -0
  83. package/lib/chrome.d.ts.map +1 -0
  84. package/lib/chrome.js +41 -0
  85. package/lib/chrome.js.map +1 -0
  86. package/lib/diagnostics.d.ts +15 -0
  87. package/lib/diagnostics.d.ts.map +1 -0
  88. package/lib/diagnostics.js +31 -0
  89. package/lib/diagnostics.js.map +1 -0
  90. package/lib/index.d.ts +4 -2
  91. package/lib/index.js +3 -2
  92. package/lib/plugin.d.ts +11 -0
  93. package/lib/plugin.d.ts.map +1 -0
  94. package/lib/plugin.js +62 -0
  95. package/lib/plugin.js.map +1 -0
  96. package/lib/queryIR.d.ts +9 -0
  97. package/lib/queryIR.d.ts.map +1 -0
  98. package/lib/queryIR.js +69 -0
  99. package/lib/queryIR.js.map +1 -0
  100. package/lib/replicationActivity.d.ts +52 -0
  101. package/lib/replicationActivity.d.ts.map +1 -0
  102. package/lib/replicationActivity.js +54 -0
  103. package/lib/replicationActivity.js.map +1 -0
  104. package/lib/schemaLayout.d.ts +35 -0
  105. package/lib/schemaLayout.d.ts.map +1 -0
  106. package/lib/schemaLayout.js +75 -0
  107. package/lib/schemaLayout.js.map +1 -0
  108. package/lib/styles.js +6 -0
  109. package/lib/styles.js.map +1 -0
  110. package/lib/traceTimeline.d.ts +15 -0
  111. package/lib/traceTimeline.d.ts.map +1 -0
  112. package/lib/traceTimeline.js +36 -0
  113. package/lib/traceTimeline.js.map +1 -0
  114. package/lib/traceWaterfall.d.ts +25 -0
  115. package/lib/traceWaterfall.d.ts.map +1 -0
  116. package/lib/traceWaterfall.js +70 -0
  117. package/lib/traceWaterfall.js.map +1 -0
  118. package/lib/typeDisplayName.d.ts +5 -0
  119. package/lib/typeDisplayName.d.ts.map +1 -0
  120. package/lib/typeDisplayName.js +28 -0
  121. package/lib/typeDisplayName.js.map +1 -0
  122. package/lib/types.d.ts +17 -0
  123. package/lib/types.d.ts.map +1 -0
  124. package/lib/types.js +1 -0
  125. package/lib/vite/index.d.ts +18 -0
  126. package/lib/vite/index.d.ts.map +1 -0
  127. package/lib/vite/index.js +148 -0
  128. package/lib/vite/index.js.map +1 -0
  129. package/package.json +26 -9
  130. package/lib/styles.css +0 -2
package/README.md ADDED
@@ -0,0 +1,195 @@
1
+ # Ontology devtools
2
+
3
+ The inspector reads a LiveOntology's locally cached collections. Opening it does
4
+ not create backend demand.
5
+
6
+ `createOntologyDevtoolsPlugin({ ontology })` mounts the inspector in TanStack
7
+ DevTools. Use `ontologyDevtoolsTrigger` for the shared 48-pixel Party Stack trigger,
8
+ or embed `OntologyDevtoolsPanel` directly in your own UI.
9
+
10
+ ## Style isolation
11
+
12
+ The panel renders in an open shadow root with its compiled stylesheet and local
13
+ reset. Host application selectors cannot override its controls, tables or icons;
14
+ the stylesheet is no longer injected into the application document. The plugin and
15
+ standalone `OntologyDevtoolsPanel` use the same boundary.
16
+
17
+ Menus, tooltips, attachment dialogs and component highlights portal into a second
18
+ styled shadow root mounted under the document body. This lets overlays escape the
19
+ devtools shell's clipping while keeping their styles private. The highlight keeps
20
+ its low stacking order beneath the panel. Both roots retain the React context;
21
+ closing the panel removes its overlay host and subscriptions. The panel is mounted
22
+ on the client, so server rendering does not access browser DOM APIs.
23
+
24
+ ## Pinned
25
+
26
+ Pinned shows the saved offline query as a collapsible tree, including nested
27
+ selections, captured bindings, conditions, ordering and page windows. Its status
28
+ reports readiness, errors, attachment-byte retention and whether an earlier graph
29
+ is retained during replacement. It observes `ontology.pins`; a tab targeting a
30
+ parent replica shows that parent's pin. Opening the view does not set a pin or
31
+ acquire additional object demand. Queries uses the same renderer for portable subsets.
32
+
33
+ ## Tracing
34
+
35
+ Tracing shows a sortable table of top-level operations, with status colors and operation icons.
36
+ Enable **Child spans** to expand nested operations in the table, or select an
37
+ operation to inspect its waterfall subtree in a bounded details drawer. The waterfall appears only in details. The drawer overlays
38
+ the table without changing its columns or viewport size. Pause freezes the recorded
39
+ spans, requests, and clock; Resume live follows incoming records. Request details
40
+ use real trace/span IDs to correlate queries with loads.
41
+
42
+ Pure Effect interruption is shown neutrally as **Stopped** for a subscription or
43
+ **Cancelled** for an operation. Unsubscribing or closing a scope is not an error.
44
+ A cause containing both interruption and an error/defect remains **Failed**.
45
+ Details explain cancellation and show real failures with their error message when
46
+ available, capped at 500 characters. Traces retain no error stack, cause object or
47
+ arbitrary error payload; older records without a captured message say so explicitly.
48
+
49
+ Subscription status and event counts appear in the table; watch and demand
50
+ lifetimes do not affect request waterfall details.
51
+ The Events column counts recorded span events; selecting a watch shows its actual
52
+ subscribed, invalidation and disconnected events. It does not count raw network frames.
53
+ Each span retains at most 100 events and a total count; arbitrary event names and
54
+ attributes are excluded from this diagnostic buffer. These are invalidation hints,
55
+ not copies of row payloads or network frames.
56
+
57
+ The source selector applies only to Tracing: **This tab** and, when present,
58
+ **Shared worker** (or the parent's actual location). Queries, Objects and Outbox
59
+ continue to reflect the current LiveOntology. The in-process fallback shows only
60
+ **This tab**, with no upstream selector. A missing parent trace store never falls
61
+ back to showing the child's spans under a parent label.
62
+
63
+ ## Queries
64
+
65
+ Queries shows current demand from the local LiveOntology, with object type icons and
66
+ names as part of each query, distinct field/operator/literal tokens, indented boolean
67
+ groups, sort order, limits, cursor/pagination and component counts.
68
+ Field display names come from the ontology definition; AND, OR and NOT grouping is
69
+ preserved. Default null placement (first ascending, last descending) is omitted;
70
+ nondefault placement is shown. Missing/undefined and explicit null values use muted
71
+ special-value tokens. LIKE/ILIKE patterns highlight `%` and `_` wildcard characters.
72
+ This view is named Queries so richer query definitions can grow into it.
73
+ Demand leases retain query consumers; row GC remains mark-and-sweep. Subscription
74
+ and watcher counts are omitted from the inspector; it shows attributed components.
75
+
76
+ The main query shows the original source request from TanStack when attribution is
77
+ available. Its header names up to three component types, grouping mounted instances
78
+ as `IssueList ×2`, then counting remaining instances as “and N other components”.
79
+ Expand **Pushdown** for the request path, for example **Query → Tab replica →
80
+ Shared worker replica → Foundry**. The detailed sections distinguish translation
81
+ into the tab replica's query from the shared replica's source request. Without a
82
+ parent, both happen in this tab. Broader replica requests are shown explicitly;
83
+ inline sentences explain filtering, sorting and limits that stay in the tab or
84
+ adapter. This is per-source demand, not the entire join query.
85
+
86
+ Adapters report placement against paths in the portable predicate tree:
87
+ **Pushed down** means a native condition, **Approximate pushdown** means source
88
+ narrowing followed by exact adapter filtering, and **Not pushed down** means
89
+ filtering only after the source returns rows. The summary describes filter pushdown;
90
+ it does not imply that sorting or pagination was also pushed down. An unsupported
91
+ branch inside OR can force the whole OR to remain in the adapter; supported siblings
92
+ must not be labeled as sent when they were dropped. A redundant adapter filter check
93
+ is omitted in the normal case; required residual filtering and adapter pagination
94
+ remain explicit. The renderer has no provider-specific expression parser. Optional
95
+ native JSON/SQL is displayed in a syntax-highlighted code block inside the **Native
96
+ query** disclosure, preserving its source text. Unknown formats use plain text;
97
+ highlighting never determines query execution or pushdown. Missing
98
+ reports are explicitly identified; these plans are diagnostic metadata, not a
99
+ capability/coverage contract.
100
+
101
+ The requested row limit stays with the query clauses. Matching fetched/returned
102
+ counts become one line, such as **Loaded 2 rows**. Different counts
103
+ show the source response and rows sent to the named receiving replica, with the
104
+ reported adapter processing between them. In a shared-worker setup this is the
105
+ worker replica importing its source response, before replication to the tab. These
106
+ are counts for the latest exact-query request, not current collection sizes or
107
+ database rows scanned. When the source count is unavailable, only the returned count
108
+ appears. Missing exact telemetry does not establish a cache hit or imply zero rows:
109
+ covering requests and eviction from the 100-call buffer can also prevent a match.
110
+ When the engine's last completed demand check explicitly reports `coveredBy`, the
111
+ inspector instead explains which maintained query supplied the existing data and
112
+ which replica reused it. This proof travels through the read-only status stream;
113
+ the UI never infers reuse just because a broad request exists in load history.
114
+ Queries reflect the tab even when load statistics come from its worker.
115
+
116
+ ## Schema
117
+
118
+ The read-only schema explorer uses React Flow for pan, zoom, fit-to-view and node
119
+ selection, with Dagre positioning. It refits after panel sizing settles. Each edge
120
+ shows just one cardinality label in its arrow's direction, such as **one-to-many**
121
+ for Project → Issue. Endpoint markers and relationship names are omitted from the
122
+ graph. Arrows run from the referenced object to its dependents. This presentation reverses
123
+ the IR's FK direction, **Issue.projectId → Project**. A link's source side names the
124
+ Issue end and its target side names the Project end; `cardinality` counts sources
125
+ per target. In the selected object's details, side display names are used as declared, with the object's plural name
126
+ as a fallback when a many-side label only repeats its singular object name. Custom
127
+ relationship labels are preserved. Select an object card to inspect all property
128
+ types, its primary key, and relationships. Node dragging changes only the diagram.
129
+ The tab order is Objects, Outbox, Queries, Tracing, Schema; Objects opens by default.
130
+
131
+ ### Highlighting query consumers
132
+
133
+ Enable the optional development-only Vite plugin in the application:
134
+
135
+ ```ts
136
+ import { demandAttribution } from "@party-stack/ontology-devtools/vite";
137
+
138
+ export default defineAppConfig({ plugins: [demandAttribution()] });
139
+ ```
140
+
141
+ Issue-tracker enables it. Attributed query cards show a component count. Hover or
142
+ keyboard focus highlights their mounted component regions; click, Enter, or Space
143
+ scrolls to an offscreen region. Each mounted instance has its own React ID, so a
144
+ shared query retains all its consumers. Registrations follow committed hook results
145
+ and are removed on unmount or query replacement, including React Strict Mode cleanup.
146
+
147
+ The initial transform covers named `useLiveQuery`, `useLiveInfiniteQuery`, and
148
+ `useLiveSuspenseQuery` imports (including aliases) called directly inside named
149
+ React function components. It tags native JSX elements, including elements in
150
+ fragments and portals, without changing refs or query arguments. Components that
151
+ only return other components have no native region to highlight. Custom-hook
152
+ indirection, namespace imports and unnamed components are not yet instrumented.
153
+ Source locations supplement instance identity; they are not the highlight target.
154
+ The highlight excludes devtools and its enclosing containers, and sits below the
155
+ devtools panel. Hover anywhere on a card to preview; the query itself is a keyboard
156
+ and click target. Issue-tracker's profile identity owns a primary-key user demand
157
+ directly, providing a small component example alongside its broader page queries.
158
+
159
+ Attribution reads existing collection subscriptions and matches their exact subset
160
+ requests. It never subscribes, reads rows or acquires extra demand. The private
161
+ TanStack DB 0.14 graph inspection is isolated in `attribution/tanstack.ts`, covered
162
+ by an integration test, and fails closed on unknown shapes. Unattributed demand
163
+ remains visible without guessing its component. Component metadata stays in the
164
+ tab and does not enter replication requests. The plugin only runs during Vite
165
+ serve; production builds do not inject helpers or DOM tags. Server rendering can
166
+ import the helpers safely; registration happens only after client commit.
167
+
168
+ ## Diagnostic transport
169
+
170
+ Diagnostics retain the latest 100 upstream calls and a lifetime count in memory,
171
+ including calls made before opening the panel. They capture query predicates and
172
+ failure messages, but never returned rows, invocation parameters or blob bytes.
173
+ The server authorizes the `ReplicaStatus` helper RPC independently of query/state-
174
+ transfer permissions. Traces and status use read-only helper streams on the same RPC
175
+ connection, separate from the replicated row/action contract.
176
+
177
+ The core Replica exposes `status` and `statuses` as an Effect and Stream.
178
+ `LiveOntology.diagnostics` supplies scoped, lazily subscribed monitors and trace
179
+ stores. Subscribing does not wake sync or acquire subset leases; changing source or
180
+ unmounting releases the subscription. Stream failures are displayed as stale state.
181
+
182
+ Outbox entries distinguish forwarding attempts from upstream execution attempts.
183
+ The card shows **Forwarding** before parent acceptance and **Attempts: N** for the
184
+ observed executing replica. Forwarding remains Waiting; Running starts when the
185
+ executing replica dispatches upstream. Stage and action state come from one atomic
186
+ read, so worker acceptance cannot mix a new stage with an old action snapshot.
187
+ Execution attempt counts survive receipt persistence and confirmation retries.
188
+
189
+ ## Example navigation lifecycle
190
+
191
+ Issue-tracker mounts the app and devtools once in a shared pathless route layout.
192
+ All Issues and Project routes change parameters within that shell. The plugin list
193
+ is memoized for the live ontology, preserving the selected inspector tab and trace
194
+ source during navigation. A full document reload or an ontology replacement still
195
+ creates a new view.
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/DisclosureSummary.d.ts
3
+ export declare function DisclosureSummary({ children }: {
4
+ children: ReactNode;
5
+ }): import("react").JSX.Element;
6
+ //#endregion
7
+ //# sourceMappingURL=DisclosureSummary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DisclosureSummary.d.ts","names":[],"sources":["../src/DisclosureSummary.tsx"],"mappings":";;wBAGgB,oBAAoB;EAAc,UAAU;oBAAW,IAAA"}
@@ -0,0 +1,20 @@
1
+ import { ChevronRight } from "lucide-react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ //#region src/DisclosureSummary.tsx
4
+ function DisclosureSummary({ children }) {
5
+ return /* @__PURE__ */ jsxs("summary", {
6
+ className: "ps-disclosure-summary",
7
+ children: [/* @__PURE__ */ jsx(ChevronRight, {
8
+ className: "ps-disclosure-chevron",
9
+ size: 12,
10
+ "aria-hidden": true
11
+ }), /* @__PURE__ */ jsx("span", {
12
+ className: "ps-disclosure-label",
13
+ children
14
+ })]
15
+ });
16
+ }
17
+ //#endregion
18
+ export { DisclosureSummary };
19
+
20
+ //# sourceMappingURL=DisclosureSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DisclosureSummary.js","names":[],"sources":["../src/DisclosureSummary.tsx"],"sourcesContent":["import { ChevronRight } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\n\nexport function DisclosureSummary({ children }: { children: ReactNode }) {\n return (\n <summary className=\"ps-disclosure-summary\">\n <ChevronRight className=\"ps-disclosure-chevron\" size={12} aria-hidden />\n <span className=\"ps-disclosure-label\">{children}</span>\n </summary>\n );\n}\n"],"mappings":";;;AAGA,SAAgB,kBAAkB,EAAE,YAAqC;CACrE,OACI,qBAAC,WAAD;EAAS,WAAU;EAAnB,UAAA,CACI,oBAAC,cAAD;GAAc,WAAU;GAAwB,MAAM;GAAI,eAAA;EAAa,CAAA,GACvE,oBAAC,QAAD;GAAM,WAAU;GAAuB;EAAe,CAAA,CACjD;;AAEjB"}
@@ -0,0 +1,7 @@
1
+ //#region src/NativeQueryCode.d.ts
2
+ export declare function NativeQueryCode({ language, text }: {
3
+ language: string;
4
+ text: string;
5
+ }): import("react").JSX.Element;
6
+ //#endregion
7
+ //# sourceMappingURL=NativeQueryCode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeQueryCode.d.ts","names":[],"sources":["../src/NativeQueryCode.tsx"],"mappings":";wBAgBgB,kBAAkB,UAAU;EAAU;EAAkB;oBAAc,IAAA"}
@@ -0,0 +1,35 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import hljs from "highlight.js/lib/core";
3
+ import json from "highlight.js/lib/languages/json";
4
+ import sql from "highlight.js/lib/languages/sql";
5
+ import { useMemo } from "react";
6
+ //#region src/NativeQueryCode.tsx
7
+ const highlighter = hljs.newInstance();
8
+ highlighter.registerLanguage("json", json);
9
+ highlighter.registerLanguage("sql", sql);
10
+ const aliases = /* @__PURE__ */ new Map([
11
+ ["json", "json"],
12
+ ["sql", "sql"],
13
+ ["postgres", "sql"],
14
+ ["postgresql", "sql"],
15
+ ["sqlite", "sql"]
16
+ ]);
17
+ function NativeQueryCode({ language, text }) {
18
+ const grammar = aliases.get(language.toLowerCase());
19
+ const highlighted = useMemo(() => grammar ? highlighter.highlight(text, {
20
+ language: grammar,
21
+ ignoreIllegals: true
22
+ }).value : void 0, [grammar, text]);
23
+ return /* @__PURE__ */ jsx("pre", {
24
+ className: "ps-native-code",
25
+ "aria-label": "Native query code",
26
+ children: highlighted === void 0 ? /* @__PURE__ */ jsx("code", { children: text }) : /* @__PURE__ */ jsx("code", {
27
+ className: `language-${grammar}`,
28
+ dangerouslySetInnerHTML: { __html: highlighted }
29
+ })
30
+ });
31
+ }
32
+ //#endregion
33
+ export { NativeQueryCode };
34
+
35
+ //# sourceMappingURL=NativeQueryCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeQueryCode.js","names":[],"sources":["../src/NativeQueryCode.tsx"],"sourcesContent":["import hljs from \"highlight.js/lib/core\";\nimport json from \"highlight.js/lib/languages/json\";\nimport sql from \"highlight.js/lib/languages/sql\";\nimport { useMemo } from \"react\";\n\nconst highlighter = hljs.newInstance();\nhighlighter.registerLanguage(\"json\", json);\nhighlighter.registerLanguage(\"sql\", sql);\nconst aliases = new Map([\n [\"json\", \"json\"],\n [\"sql\", \"sql\"],\n [\"postgres\", \"sql\"],\n [\"postgresql\", \"sql\"],\n [\"sqlite\", \"sql\"],\n]);\n\nexport function NativeQueryCode({ language, text }: { language: string; text: string }) {\n const grammar = aliases.get(language.toLowerCase());\n const highlighted = useMemo(\n () =>\n grammar\n ? highlighter.highlight(text, { language: grammar, ignoreIllegals: true }).value\n : undefined,\n [grammar, text]\n );\n return (\n <pre className=\"ps-native-code\" aria-label=\"Native query code\">\n {highlighted === undefined ? (\n <code>{text}</code>\n ) : (\n // Highlight.js escapes source text before adding its own token spans.\n <code className={`language-${grammar}`} dangerouslySetInnerHTML={{ __html: highlighted }} />\n )}\n </pre>\n );\n}\n"],"mappings":";;;;;;AAKA,MAAM,cAAc,KAAK,YAAY;AACrC,YAAY,iBAAiB,QAAQ,IAAI;AACzC,YAAY,iBAAiB,OAAO,GAAG;AACvC,MAAM,0BAAU,IAAI,IAAI;CACpB,CAAC,QAAQ,MAAM;CACf,CAAC,OAAO,KAAK;CACb,CAAC,YAAY,KAAK;CAClB,CAAC,cAAc,KAAK;CACpB,CAAC,UAAU,KAAK;AACpB,CAAC;AAED,SAAgB,gBAAgB,EAAE,UAAU,QAA4C;CACpF,MAAM,UAAU,QAAQ,IAAI,SAAS,YAAY,CAAC;CAClD,MAAM,cAAc,cAEZ,UACM,YAAY,UAAU,MAAM;EAAE,UAAU;EAAS,gBAAgB;CAAK,CAAC,CAAC,CAAC,QACzE,KAAA,GACV,CAAC,SAAS,IAAI,CAClB;CACA,OACI,oBAAC,OAAD;EAAK,WAAU;EAAiB,cAAW;EACtC,UAAA,gBAAgB,KAAA,IACb,oBAAC,QAAD,EAAA,UAAO,KAAW,CAAA,IAGlB,oBAAC,QAAD;GAAM,WAAW,YAAY;GAAW,yBAAyB,EAAE,QAAQ,YAAY;EAAI,CAAA;CAE9F,CAAA;AAEb"}
@@ -1,60 +1,22 @@
1
- import { Point } from "@dagrejs/dagre";
2
- import { IconName } from "@party-stack/icons";
3
- import { LiveOntology, ObjectTypeDef, OntologyDefinition, OntologyIR, OntologyOutboxEntry, TypeDef } from "@party-stack/ontology";
4
- import { TanStackDevtoolsReactPlugin } from "@tanstack/react-devtools";
1
+ import { layoutSchema } from "./schemaLayout.js";
2
+ import { typeDisplayName } from "./typeDisplayName.js";
3
+ import { OntologyIcon } from "./OntologyIcons.js";
4
+ import { OntologyDevtoolsPanelProps } from "./types.js";
5
+ import { OntologyDefinition, OntologyOutbox, OntologyOutboxEntry } from "@party-stack/ontology";
5
6
  //#region src/OntologyDevtools.d.ts
6
- export interface OntologyDevtoolsPanelProps<Ontology extends OntologyDefinition = OntologyDefinition, MetaOntology extends OntologyDefinition = OntologyDefinition> {
7
- ontology: LiveOntology<Ontology>;
8
- metaOntology?: LiveOntology<MetaOntology>;
9
- theme?: "light" | "dark";
10
- }
11
- export interface OntologyDevtoolsPluginOptions<Ontology extends OntologyDefinition = OntologyDefinition, MetaOntology extends OntologyDefinition = OntologyDefinition> {
12
- ontology: LiveOntology<Ontology>;
13
- id?: string;
14
- metaOntology?: LiveOntology<MetaOntology>;
15
- name?: TanStackDevtoolsReactPlugin["name"];
16
- defaultOpen?: boolean;
17
- }
18
- export interface OntologyDevtoolsChromeProps {
19
- theme: "light" | "dark";
20
- }
21
- export declare function OntologyIcon({ className, color, name }: {
22
- className?: string;
23
- color?: string;
24
- name: IconName;
7
+ export declare function OutboxEntryCard({ entry, outbox, now }: {
8
+ entry: OntologyOutboxEntry;
9
+ outbox: OntologyOutbox;
10
+ now: number;
25
11
  }): import("react").JSX.Element;
26
- export declare function OntologyDevtoolsPluginName({ theme }: OntologyDevtoolsChromeProps): import("react").JSX.Element;
27
- export declare function OntologyDevtoolsTrigger({ theme }: OntologyDevtoolsChromeProps): import("react").JSX.Element;
28
- export declare function ontologyDevtoolsTrigger(_element: HTMLElement, { theme }: OntologyDevtoolsChromeProps): import("react").JSX.Element;
29
12
  type OutboxActivity = "idle" | "draining" | "paused";
30
13
  export declare function getOutboxActivity(entries: OntologyOutboxEntry[]): OutboxActivity;
31
- export declare function typeDisplayName(type: TypeDef): string;
32
14
  export declare function timestampPreview(value: unknown): {
33
15
  display: string;
34
16
  exact: string;
35
17
  } | undefined;
36
18
  export declare function moveColumn(columnOrder: string[], sourceId: string, targetId: string): string[];
37
- interface SchemaNode {
38
- objectType: ObjectTypeDef;
39
- x: number;
40
- y: number;
41
- }
42
- interface SchemaEdge {
43
- id: string;
44
- label: string;
45
- labelWidth: number;
46
- labelX: number;
47
- labelY: number;
48
- points: Point[];
49
- }
50
- export declare function layoutSchema(ir: OntologyIR): {
51
- nodes: SchemaNode[];
52
- edges: SchemaEdge[];
53
- width: number;
54
- height: number;
55
- };
56
- export declare function schemaEdgePath(points: Point[], cornerRadius?: number): string;
57
- export declare function OntologyDevtoolsPanel<Ontology extends OntologyDefinition, MetaOntology extends OntologyDefinition = OntologyDefinition>({ metaOntology, ontology, theme }: OntologyDevtoolsPanelProps<Ontology, MetaOntology>): import("react").JSX.Element;
58
- export declare function createOntologyDevtoolsPlugin<Ontology extends OntologyDefinition, MetaOntology extends OntologyDefinition = OntologyDefinition>({ ontology, id, metaOntology, name, defaultOpen }: OntologyDevtoolsPluginOptions<Ontology, MetaOntology>): TanStackDevtoolsReactPlugin;
19
+ export declare function OntologyDevtoolsPanel<Ontology extends OntologyDefinition, MetaOntology extends OntologyDefinition = OntologyDefinition>(props: OntologyDevtoolsPanelProps<Ontology, MetaOntology>): import("react").JSX.Element;
59
20
  //#endregion
21
+ export { OntologyIcon, layoutSchema, typeDisplayName };
60
22
  //# sourceMappingURL=OntologyDevtools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OntologyDevtools.d.ts","names":[],"sources":["../src/OntologyDevtools.tsx"],"mappings":";;;;;iBAgFiB,2BACb,iBAAiB,qBAAqB,oBACtC,qBAAqB,qBAAqB;EAE1C,UAAU,aAAa;EACvB,eAAe,aAAa;EAC5B;;iBAGa,8BACb,iBAAiB,qBAAqB,oBACtC,qBAAqB,qBAAqB;EAE1C,UAAU,aAAa;EACvB;EACA,eAAe,aAAa;EAC5B,OAAO;EACP;;iBAGa;EACb;;wBAGY,eACZ,WACA,OACA;EAEA;EACA;EACA,MAAM;oBACT,IAAA;wBA0Ge,6BAA6B,SAAS,8CAA2B,IAAA;wBAQjE,0BAA0B,SAAS,8CAA2B,IAAA;wBA8B9D,wBAAwB,UAAU,eAAe,SAAS,8CAA2B,IAAA;KAmLhG;wBAEW,kBAAkB,SAAS,wBAAwB;wBAuEnD,gBAAgB,MAAM;wBA8JtB,iBAAiB;EAAmB;EAAiB;;wBAoLrD,WAAW,uBAAuB,kBAAkB;UAme1D;EACN,YAAY;EACZ;EACA;;UAGM;EACN;EACA;EACA;EACA;EACA;EACA,QAAQ;;wBAqBI,aAAa,IAAI;EAC7B,OAAO;EACP,OAAO;EACP;EACA;;wBAqEY,eAAe,QAAQ,SAAS;wBA4IhC,sBACZ,iBAAiB,oBACjB,qBAAqB,qBAAqB,sBAC1C,cAAc,UAAU,SAAkB,2BAA2B,UAAU,gCAAa,IAAA;wBAsFhF,6BACZ,iBAAiB,oBACjB,qBAAqB,qBAAqB,sBAE1C,UACA,IACA,cACA,MACA,eACD,8BAA8B,UAAU,gBAAgB"}
1
+ {"version":3,"file":"OntologyDevtools.d.ts","names":[],"sources":["../src/OntologyDevtools.tsx"],"mappings":";;;;;;wBAiJgB,kBACZ,OACA,QACA;EAEA,OAAO;EACP,QAAQ;EACR;oBACH,IAAA;KAmMI;wBAEW,kBAAkB,SAAS,wBAAwB;wBAmMnD,iBAAiB;EAAmB;EAAiB;;wBAwLrD,WAAW,uBAAuB,kBAAkB;wBAgfpD,sBACZ,iBAAiB,oBACjB,qBAAqB,qBAAqB,oBAC5C,OAAO,2BAA2B,UAAU,gCAAa,IAAA"}