@dudousxd/nestjs-catalog-react 0.35.0 → 0.37.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 (132) hide show
  1. package/{LICENSE-bklit → LICENSE} +1 -1
  2. package/README.md +12 -3
  3. package/THIRD_PARTY_NOTICES.md +34 -0
  4. package/dist/AccessConsole.js +14 -14
  5. package/dist/CatalogManager.d.ts +21 -1
  6. package/dist/CatalogManager.js +67 -25
  7. package/dist/EditableField.d.ts +7 -1
  8. package/dist/EditableField.js +7 -1
  9. package/dist/FlowView.js +1 -1
  10. package/dist/GovernanceTimeline.js +5 -3
  11. package/dist/LoadExpectationSection.d.ts +7 -1
  12. package/dist/LoadExpectationSection.js +5 -5
  13. package/dist/ObjectExplorer.d.ts +16 -1
  14. package/dist/ObjectExplorer.js +32 -16
  15. package/dist/TraceExplorer.d.ts +3 -2
  16. package/dist/TraceExplorer.js +19 -11
  17. package/dist/charts/bklit/animation.d.ts +1 -1
  18. package/dist/charts/bklit/area-chart-loading.js +1 -1
  19. package/dist/charts/bklit/area-chart.js +1 -1
  20. package/dist/charts/bklit/area-gradient-defs.d.ts +1 -1
  21. package/dist/charts/bklit/area-gradient-defs.js +1 -1
  22. package/dist/charts/bklit/area.js +1 -1
  23. package/dist/charts/bklit/bar-chart-loading.js +1 -1
  24. package/dist/charts/bklit/bar-chart.js +1 -1
  25. package/dist/charts/bklit/bar-depth-geometry.d.ts +1 -1
  26. package/dist/charts/bklit/bar-depth-geometry.js +1 -1
  27. package/dist/charts/bklit/bar-squares-layout.d.ts +1 -1
  28. package/dist/charts/bklit/bar-x-axis.js +1 -1
  29. package/dist/charts/bklit/bar-y-axis.js +1 -1
  30. package/dist/charts/bklit/chart-child-passthrough.d.ts +1 -1
  31. package/dist/charts/bklit/chart-child-passthrough.js +1 -1
  32. package/dist/charts/bklit/chart-config-context.d.ts +1 -1
  33. package/dist/charts/bklit/chart-config-context.js +1 -1
  34. package/dist/charts/bklit/chart-context.d.ts +1 -1
  35. package/dist/charts/bklit/chart-defs.d.ts +1 -1
  36. package/dist/charts/bklit/chart-defs.js +1 -1
  37. package/dist/charts/bklit/chart-formatters.d.ts +1 -1
  38. package/dist/charts/bklit/chart-formatters.js +1 -1
  39. package/dist/charts/bklit/chart-legend-hover.d.ts +1 -1
  40. package/dist/charts/bklit/chart-legend-hover.js +1 -1
  41. package/dist/charts/bklit/chart-loading-label.js +1 -1
  42. package/dist/charts/bklit/chart-phase.d.ts +1 -1
  43. package/dist/charts/bklit/chart-reveal-clip.d.ts +1 -1
  44. package/dist/charts/bklit/dash-tail-stroke.js +1 -1
  45. package/dist/charts/bklit/decimate-time-series.d.ts +1 -1
  46. package/dist/charts/bklit/decimate-time-series.js +1 -1
  47. package/dist/charts/bklit/fade-edges.d.ts +1 -1
  48. package/dist/charts/bklit/filter-data-by-x-domain.d.ts +1 -1
  49. package/dist/charts/bklit/filter-data-by-x-domain.js +1 -1
  50. package/dist/charts/bklit/generate-chart-skeleton-data.d.ts +1 -1
  51. package/dist/charts/bklit/generate-chart-skeleton-data.js +1 -1
  52. package/dist/charts/bklit/grid.js +1 -1
  53. package/dist/charts/bklit/highlight-segment-bounds.d.ts +1 -1
  54. package/dist/charts/bklit/highlight-segment.d.ts +1 -1
  55. package/dist/charts/bklit/highlight-segment.js +1 -1
  56. package/dist/charts/bklit/indicator-fade.d.ts +1 -1
  57. package/dist/charts/bklit/line-chart-loading.js +1 -1
  58. package/dist/charts/bklit/line-chart.js +1 -1
  59. package/dist/charts/bklit/line-loading-pulse.js +1 -1
  60. package/dist/charts/bklit/line-loading-timing.d.ts +1 -1
  61. package/dist/charts/bklit/line-loading-timing.js +1 -1
  62. package/dist/charts/bklit/line-series-terminal-marker.js +1 -1
  63. package/dist/charts/bklit/line.js +1 -1
  64. package/dist/charts/bklit/loading-sweep.js +1 -1
  65. package/dist/charts/bklit/motion-utils.d.ts +1 -1
  66. package/dist/charts/bklit/path-stroke-utils.d.ts +1 -1
  67. package/dist/charts/bklit/path-stroke-utils.js +1 -1
  68. package/dist/charts/bklit/pattern-area.js +1 -1
  69. package/dist/charts/bklit/pattern-preset.d.ts +1 -1
  70. package/dist/charts/bklit/projection-config.d.ts +1 -1
  71. package/dist/charts/bklit/projection-config.js +1 -1
  72. package/dist/charts/bklit/projection-line-end-marker.js +1 -1
  73. package/dist/charts/bklit/projection-line.js +1 -1
  74. package/dist/charts/bklit/projection-utils.d.ts +1 -1
  75. package/dist/charts/bklit/reference-area-config.d.ts +1 -1
  76. package/dist/charts/bklit/reference-area-config.js +1 -1
  77. package/dist/charts/bklit/reference-area-registration-context.js +1 -1
  78. package/dist/charts/bklit/series-bar-layout.d.ts +1 -1
  79. package/dist/charts/bklit/series-bar-layout.js +1 -1
  80. package/dist/charts/bklit/series-dash-tail-overlay.js +1 -1
  81. package/dist/charts/bklit/series-highlight-layer.d.ts +1 -1
  82. package/dist/charts/bklit/series-hover-dim.js +1 -1
  83. package/dist/charts/bklit/series-markers.js +1 -1
  84. package/dist/charts/bklit/series-path-utils.js +1 -1
  85. package/dist/charts/bklit/static-chart-preview-context.d.ts +1 -1
  86. package/dist/charts/bklit/static-chart-preview-context.js +1 -1
  87. package/dist/charts/bklit/time-series-chart-shell.js +1 -1
  88. package/dist/charts/bklit/tooltip/chart-tooltip.js +1 -1
  89. package/dist/charts/bklit/tooltip/date-ticker.js +1 -1
  90. package/dist/charts/bklit/tooltip/index.d.ts +1 -1
  91. package/dist/charts/bklit/tooltip/index.js +1 -1
  92. package/dist/charts/bklit/tooltip/tooltip-box.d.ts +1 -1
  93. package/dist/charts/bklit/tooltip/tooltip-box.js +1 -1
  94. package/dist/charts/bklit/tooltip/tooltip-content.d.ts +1 -1
  95. package/dist/charts/bklit/tooltip/tooltip-dot.js +1 -1
  96. package/dist/charts/bklit/tooltip/tooltip-indicator.js +1 -1
  97. package/dist/charts/bklit/use-animated-series-path.js +1 -1
  98. package/dist/charts/bklit/use-animated-y-domains.js +1 -1
  99. package/dist/charts/bklit/use-chart-interaction.js +1 -1
  100. package/dist/charts/bklit/use-chart-phase-orchestrator.js +1 -1
  101. package/dist/charts/bklit/use-enter-complete.d.ts +1 -1
  102. package/dist/charts/bklit/use-grid-shimmer.js +1 -1
  103. package/dist/charts/bklit/use-highlight-segment.d.ts +1 -1
  104. package/dist/charts/bklit/use-highlight-segment.js +1 -1
  105. package/dist/charts/bklit/use-mount-progress.d.ts +1 -1
  106. package/dist/charts/bklit/use-mount-progress.js +1 -1
  107. package/dist/charts/bklit/use-scheduled-tooltip.js +1 -1
  108. package/dist/charts/bklit/visx-pattern.d.ts +1 -1
  109. package/dist/charts/bklit/visx-pattern.js +1 -1
  110. package/dist/charts/bklit/x-axis.js +1 -1
  111. package/dist/charts/bklit/y-axis-scales.d.ts +1 -1
  112. package/dist/charts/bklit/y-axis-scales.js +1 -1
  113. package/dist/charts/bklit/y-axis-ticks.d.ts +1 -1
  114. package/dist/charts/bklit/y-axis-ticks.js +1 -1
  115. package/dist/charts/bklit/y-domain-utils.js +1 -1
  116. package/dist/charts/bklit.js +1 -1
  117. package/dist/charts/components/shimmering-text.d.ts +1 -1
  118. package/dist/charts/components/shimmering-text.js +1 -1
  119. package/dist/context.d.ts +47 -21
  120. package/dist/context.js +47 -15
  121. package/dist/index.d.ts +1 -1
  122. package/dist/index.js +1 -1
  123. package/dist/manager.d.ts +13 -0
  124. package/dist/manager.js +13 -0
  125. package/dist/routes.d.ts +3 -2
  126. package/dist/routes.js +4 -4
  127. package/dist/search-console.d.ts +2 -2
  128. package/dist/search-console.js +5 -5
  129. package/dist/ui/rich-text-field.d.ts +3 -1
  130. package/dist/ui/rich-text-field.js +4 -1
  131. package/dist/workflow/runs.js +1 -1
  132. package/package.json +15 -6
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 uixmat
3
+ Copyright (c) 2026 Davide Carvalho
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -37,9 +37,16 @@ Requires a `QueryClientProvider` from `@tanstack/react-query` above it.
37
37
  - **`<CatalogManager />`** — browse types by group, see every property beside the
38
38
  column it came from, and edit labels, descriptions and units inline. Edits are
39
39
  presentation-only; nothing here can reach a migration.
40
+ `canEdit={false}` shows the same screen read-only (no editors, no Hide/Show, no
41
+ **Reset edits**, no writes), and `pipeline={false}` leaves out the **Loaded by**
42
+ and **Load expectation** sections, which read the host's pipeline endpoints.
43
+ Import it from `@dudousxd/nestjs-catalog-react/manager` to pull in this screen
44
+ alone.
40
45
  - **`<ObjectExplorer />`** — one table for every type in the catalog. Columns,
41
46
  labels, alignment and units all arrive with the data, so it knows nothing about
42
47
  your domain.
48
+ `search={false}` leaves out the search box for a server that cannot search,
49
+ and `rowCountCap={10_000}` shows a count the server capped as "10,000+ rows".
43
50
  - **`<QueryConsole />`**, **`<DashboardBoard />`** — SQL over the published
44
51
  snapshots, saved queries, and cards built from them.
45
52
  - **`<GovernanceTimeline />`**, **`<TraceExplorer />`** — what happened, flat and
@@ -132,6 +139,7 @@ These routes on top of the pipeline base path, listed by `pipelineRoutes()`:
132
139
  | `POST {base}/workflows/:id/run` | execute, optionally carrying `expectShrink` |
133
140
  | `PUT {base}/workflows/:id/schedule` | set the cron and whether it runs at all |
134
141
  | `POST {base}/workflows/:id/nodes/:nodeId/discover` | ask one source what its columns are |
142
+ | `GET {base}/runs` | the newest runs, `filter[connector]=id` and `size`; answers `{ data }` |
135
143
 
136
144
  **A connector is not one of them.** It is what a published graph runs as: minted
137
145
  by `publish`, disabled by `unpublish`, removed with the graph, and there is no
@@ -330,8 +338,8 @@ The chart components under `src/charts/bklit/` (and
330
338
  `src/charts/components/shimmering-text.tsx`) are vendored from
331
339
  [**bklit-ui**](https://github.com/bklit/bklit-ui), Copyright (c) 2026 uixmat,
332
340
  released under the **MIT licence**. The full licence text ships with this
333
- package as [`LICENSE-bklit`](./LICENSE-bklit), and every vendored file carries a
334
- header naming its origin.
341
+ package in [`THIRD_PARTY_NOTICES.md`](./THIRD_PARTY_NOTICES.md), and every
342
+ vendored file carries a header naming its origin.
335
343
 
336
344
  They are vendored rather than depended on because bklit-ui is a shadcn-style
337
345
  registry — components you own, not a package you install. The only local change
@@ -341,4 +349,5 @@ upstream stays a diff rather than a merge.
341
349
 
342
350
  ## License
343
351
 
344
- MIT (see `LICENSE-bklit` for the vendored bklit-ui components).
352
+ MIT, in [`LICENSE`](./LICENSE). The vendored bklit-ui components keep their own MIT
353
+ licence, in [`THIRD_PARTY_NOTICES.md`](./THIRD_PARTY_NOTICES.md).
@@ -0,0 +1,34 @@
1
+ # Third-party notices
2
+
3
+ `@dudousxd/nestjs-catalog-react` is licensed under the MIT licence in `LICENSE`, copyright Davide
4
+ Carvalho. It also ships code vendored from the projects below, each under its own licence. That
5
+ code keeps its original copyright, and each vendored file names its source in its header.
6
+
7
+ ## bklit-ui
8
+
9
+ Source: https://github.com/bklit/bklit-ui. Vendored into `src/charts/` (mostly
10
+ `src/charts/bklit/`), shipped in `dist/charts/`. Only the `./bklit` entry reaches this code.
11
+
12
+ ```text
13
+ MIT License
14
+
15
+ Copyright (c) 2026 uixmat
16
+
17
+ Permission is hereby granted, free of charge, to any person obtaining a copy
18
+ of this software and associated documentation files (the "Software"), to deal
19
+ in the Software without restriction, including without limitation the rights
20
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21
+ copies of the Software, and to permit persons to whom the Software is
22
+ furnished to do so, subject to the following conditions:
23
+
24
+ The above copyright notice and this permission notice shall be included in all
25
+ copies or substantial portions of the Software.
26
+
27
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
+ SOFTWARE.
34
+ ```
@@ -21,14 +21,14 @@ function PeopleSearch({ value, onChange, }) {
21
21
  * of UI on, because an operator who reads it as complete concludes somebody has
22
22
  * no access when they were merely on the next page.
23
23
  */
24
- function PageBar({ page, onOffset, busy, }) {
25
- const shown = page.people.length;
26
- const first = page.total === 0 ? 0 : page.offset + 1;
27
- const last = page.offset + shown;
28
- const hasMore = last < page.total;
29
- return (_jsxs("div", { className: cn('mt-3 flex items-center justify-between text-xs', MUTED), children: [_jsx("span", { children: page.total === 0
30
- ? 'No people'
31
- : `Showing ${first}–${last} of ${page.total.toLocaleString()}` }), (page.offset > 0 || hasMore) && (_jsxs("span", { className: "flex gap-2", children: [_jsx("button", { type: "button", disabled: page.offset === 0 || busy, onClick: () => onOffset(Math.max(0, page.offset - page.limit)), className: "disabled:opacity-40", children: "Previous" }), _jsx("button", { type: "button", disabled: !hasMore || busy, onClick: () => onOffset(page.offset + page.limit), className: "disabled:opacity-40", children: "Next" })] }))] }));
24
+ function PageBar({ page, onPage, busy, }) {
25
+ const { total, perPage, currentPage, lastPage } = page.meta;
26
+ const offset = (currentPage - 1) * perPage;
27
+ const shown = page.data.length;
28
+ const first = total === 0 ? 0 : offset + 1;
29
+ const last = offset + shown;
30
+ const hasMore = currentPage < lastPage;
31
+ return (_jsxs("div", { className: cn('mt-3 flex items-center justify-between text-xs', MUTED), children: [_jsx("span", { children: total === 0 ? 'No people' : `Showing ${first}–${last} of ${total.toLocaleString()}` }), (currentPage > 1 || hasMore) && (_jsxs("span", { className: "flex gap-2", children: [_jsx("button", { type: "button", disabled: currentPage <= 1 || busy, onClick: () => onPage(Math.max(1, currentPage - 1)), className: "disabled:opacity-40", children: "Previous" }), _jsx("button", { type: "button", disabled: !hasMore || busy, onClick: () => onPage(currentPage + 1), className: "disabled:opacity-40", children: "Next" })] }))] }));
32
32
  }
33
33
  /**
34
34
  * One page answering the two questions a shared catalog creates: which
@@ -52,10 +52,10 @@ export function AccessConsole({ identity, onSignOut, signOutPending, canAddPeopl
52
52
  // what it will return regardless of what is asked for. The key carries the
53
53
  // query so a search does not read a previous search's page from the cache.
54
54
  const [search, setSearch] = useState('');
55
- const [offset, setOffset] = useState(0);
55
+ const [page, setPage] = useState(1);
56
56
  const people = useQuery({
57
- queryKey: [...catalogQueryKeys.people, { search, offset }],
58
- queryFn: () => client.listPeople({ ...(search ? { search } : {}), offset }),
57
+ queryKey: [...catalogQueryKeys.people, { search, page }],
58
+ queryFn: () => client.listPeople({ ...(search ? { search } : {}), page }),
59
59
  staleTime: 30_000,
60
60
  // The count and the page it describes must not be shown apart. Without
61
61
  // this, typing into the search blanks the list to a spinner and then shows
@@ -67,11 +67,11 @@ export function AccessConsole({ identity, onSignOut, signOutPending, canAddPeopl
67
67
  setSearch(next);
68
68
  // Back to the first page. Staying on page 3 of the previous
69
69
  // search shows an empty list for a search that has matches.
70
- setOffset(0);
70
+ setPage(1);
71
71
  } }), mayAdminister && _jsx(AddPerson, {}), people.isPending && _jsx(Placeholder, { children: "Reading people\u2026" }), people.isError && (_jsx(Failed, { message: people.error instanceof Error
72
72
  ? people.error.message
73
- : 'Could not read the people list.', onRetry: () => people.refetch() })), people.data?.people.map((person) => (_jsx(PersonCard, { person: person }, person.email))), people.data?.people.length === 0 &&
74
- (search ? (_jsxs(Placeholder, { children: ["Nobody matches \u201C", search, "\u201D."] })) : (_jsx(Placeholder, { children: "Nobody can sign in yet. Seed the first administrator from the environment before anybody can reach this console as a person." }))), people.data && (_jsx(PageBar, { page: people.data, onOffset: setOffset, busy: people.isFetching }))] }), _jsxs(Section, { title: "Applications", note: "Provisioned by an operator \u2014 a console that could hand grants out is one that stops leaving a trail.", children: [applications.isPending && _jsx(Placeholder, { children: "Reading applications\u2026" }), applications.isError && (_jsx(Failed, { message: applications.error instanceof Error
73
+ : 'Could not read the people list.', onRetry: () => people.refetch() })), people.data?.data.map((person) => (_jsx(PersonCard, { person: person }, person.email))), people.data?.data.length === 0 &&
74
+ (search ? (_jsxs(Placeholder, { children: ["Nobody matches \u201C", search, "\u201D."] })) : (_jsx(Placeholder, { children: "Nobody can sign in yet. Seed the first administrator from the environment before anybody can reach this console as a person." }))), people.data && _jsx(PageBar, { page: people.data, onPage: setPage, busy: people.isFetching })] }), _jsxs(Section, { title: "Applications", note: "Provisioned by an operator \u2014 a console that could hand grants out is one that stops leaving a trail.", children: [applications.isPending && _jsx(Placeholder, { children: "Reading applications\u2026" }), applications.isError && (_jsx(Failed, { message: applications.error instanceof Error
75
75
  ? applications.error.message
76
76
  : 'Could not read the application list.', onRetry: () => applications.refetch() })), applications.data?.map((principal) => (_jsx(PrincipalCard, { principal: principal }, principal.id))), applications.data?.length === 0 && (_jsx(Placeholder, { children: "No applications are provisioned." }))] })] }) }));
77
77
  }
@@ -29,6 +29,26 @@ export interface CatalogManagerProps {
29
29
  /** Heading copy, so the host can call this whatever its users call it. */
30
30
  title?: string;
31
31
  eyebrow?: string;
32
+ /**
33
+ * Defaults to a sentence that matches `canEdit`: an invitation to rename
34
+ * things on an editable screen, a plain description on a read-only one.
35
+ */
32
36
  intro?: string;
37
+ /**
38
+ * Set false where the viewer is known to be read-only. Every curated field
39
+ * (name, description, group, plural, icon, unit, link labels) renders as plain
40
+ * text, the Hide/Show toggle and **Reset edits** are not offered, and nothing
41
+ * on the screen issues a write. The endpoints refuse regardless; this only
42
+ * stops the screen offering edits that always fail. The same prop, with the
43
+ * same meaning, as on `PipelineConsole` and `WorkflowCanvas`.
44
+ */
45
+ canEdit?: boolean;
46
+ /**
47
+ * Set false to leave out the two sections served by the HOST's pipeline
48
+ * endpoints — **Loaded by** and **Load expectation** — for a host that does
49
+ * not mount them, or a screen that should show the model alone. Neither
50
+ * section is rendered and neither endpoint is requested.
51
+ */
52
+ pipeline?: boolean;
33
53
  }
34
- export declare function CatalogManager({ type: typeProp, explorerHref, workflowHref, title, eyebrow, intro, }: CatalogManagerProps): import("react").JSX.Element;
54
+ export declare function CatalogManager({ type: typeProp, explorerHref, workflowHref, title, eyebrow, canEdit, pipeline, intro, }: CatalogManagerProps): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
3
- import { ArrowLeft, ArrowRight, ArrowUpRight, Eye, EyeOff, RotateCcw, Search, Unlink, } from 'lucide-react';
3
+ import { ArrowLeft, ArrowRight, ArrowUpRight, Eye, EyeOff, RotateCcw, Search, Unlink, X, } from 'lucide-react';
4
4
  import { useEffect, useMemo, useState } from 'react';
5
5
  import { CoverageLedger } from './CoverageLedger.js';
6
6
  import { EditableField } from './EditableField.js';
@@ -37,7 +37,9 @@ const HAIRLINE = 'border-zinc-100 dark:border-zinc-900';
37
37
  function ScalarBadge({ type }) {
38
38
  return (_jsx("span", { className: cn('rounded-sm bg-zinc-100 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wider dark:bg-zinc-800', TYPE_TONE[type]), children: type }));
39
39
  }
40
- export function CatalogManager({ type: typeProp, explorerHref, workflowHref, title = 'Catalog', eyebrow = 'Semantic layer', intro = 'Every object type the system already holds, derived from the ORM. Names, descriptions and units are yours to change — none of it touches the database.', }) {
40
+ const EDITABLE_INTRO = 'Every object type the system already holds, derived from the ORM. Names, descriptions and units are yours to change — none of it touches the database.';
41
+ const READ_ONLY_INTRO = 'Every object type the system already holds, derived from the ORM, with the names, descriptions and units people have given them.';
42
+ export function CatalogManager({ type: typeProp, explorerHref, workflowHref, title = 'Catalog', eyebrow = 'Semantic layer', canEdit = true, pipeline = true, intro = canEdit ? EDITABLE_INTRO : READ_ONLY_INTRO, }) {
41
43
  const client = useCatalogClient();
42
44
  const queryClient = useQueryClient();
43
45
  const { data, isLoading, isError } = useQuery({
@@ -48,6 +50,21 @@ export function CatalogManager({ type: typeProp, explorerHref, workflowHref, tit
48
50
  const [selectedName, setSelectedName] = useSelectedType(typeProp);
49
51
  const [filter, setFilter] = useState('');
50
52
  const [onlyUnnamed, setOnlyUnnamed] = useState(false);
53
+ /**
54
+ * The last edit the server refused, said out loud.
55
+ *
56
+ * Edits are not applied optimistically — the snapshot changes only when the
57
+ * server answers — so a refused edit leaves the field showing its old value.
58
+ * Without this, that read as the screen quietly undoing what somebody typed.
59
+ */
60
+ const [editError, setEditError] = useState(null);
61
+ function refused(what) {
62
+ return (error) => setEditError(`${what} was not saved${error instanceof Error && error.message ? `: ${error.message}` : '.'}`);
63
+ }
64
+ function saved(updated) {
65
+ setEditError(null);
66
+ applyToSnapshot(updated);
67
+ }
51
68
  /** Presentation edits should feel like typing, not like saving. */
52
69
  function applyToSnapshot(updated) {
53
70
  if (!updated || typeof updated !== 'object' || !('name' in updated))
@@ -66,15 +83,21 @@ export function CatalogManager({ type: typeProp, explorerHref, workflowHref, tit
66
83
  }
67
84
  const typeMutation = useMutation({
68
85
  mutationFn: ({ name, patch }) => client.patchType(name, patch),
69
- onSuccess: applyToSnapshot,
86
+ onSuccess: saved,
87
+ onError: refused('That edit'),
70
88
  });
71
89
  const propertyMutation = useMutation({
72
90
  mutationFn: ({ name, property, patch, }) => client.patchProperty(name, property, patch),
73
- onSuccess: applyToSnapshot,
91
+ onSuccess: saved,
92
+ onError: refused('That edit'),
74
93
  });
75
94
  const resetMutation = useMutation({
76
95
  mutationFn: () => client.reset(),
77
- onSuccess: (snapshot) => queryClient.setQueryData(catalogQueryKeys.snapshot, snapshot),
96
+ onSuccess: (snapshot) => {
97
+ setEditError(null);
98
+ queryClient.setQueryData(catalogQueryKeys.snapshot, snapshot);
99
+ },
100
+ onError: refused('The reset'),
78
101
  });
79
102
  const types = useMemo(() => data?.types ?? [], [data]);
80
103
  /**
@@ -115,15 +138,25 @@ export function CatalogManager({ type: typeProp, explorerHref, workflowHref, tit
115
138
  if (isError || !data) {
116
139
  return (_jsx("div", { className: "flex h-full items-center justify-center px-6", children: _jsxs("div", { className: "max-w-md text-center", children: [_jsx("h2", { className: "text-lg font-medium", children: "The catalog did not load" }), _jsx("p", { className: cn('mt-1 text-sm', SECONDARY), children: "The server builds it from ORM metadata at boot. Check that the API is reachable and that your account may read it." })] }) }));
117
140
  }
118
- return (_jsx(TooltipProvider, { children: _jsxs("div", { className: "flex h-full flex-col bg-zinc-50 dark:bg-zinc-950", children: [_jsxs("header", { className: cn('shrink-0 border-b px-8 py-6', RULE, PANEL), children: [_jsxs("div", { className: "flex flex-wrap items-start justify-between gap-6", children: [_jsxs("div", { children: [_jsx("p", { className: cn('font-mono text-[11px] uppercase tracking-[0.18em]', MUTED), children: eyebrow }), _jsx("h1", { className: "mt-1 text-2xl font-semibold tracking-tight", children: title }), _jsx("p", { className: cn('mt-1 max-w-xl text-sm', SECONDARY), children: intro })] }), _jsxs("div", { className: "flex items-center gap-6", children: [_jsx(Stat, { label: "Types", value: data.stats.types }), _jsx(Stat, { label: "Properties", value: data.stats.properties }), _jsx(Tooltip, { content: "Relations declared across every type. A link declared at both ends counts twice \u2014 the graph draws it once.", children: _jsx("span", { className: "cursor-help", children: _jsx(Stat, { label: "Relations", value: data.stats.relations }) }) }), _jsxs("button", { type: "button", onClick: () => resetMutation.mutate(), disabled: resetMutation.isPending, className: cn('flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs', RULE, SECONDARY, 'transition-colors hover:bg-zinc-50 disabled:opacity-50 dark:hover:bg-zinc-800'), children: [_jsx(RotateCcw, { size: 13 }), "Reset edits"] })] })] }), _jsx("div", { className: "mt-6", children: _jsx(CoverageLedger, { types: types, selected: selected?.name, onSelect: setSelectedName }) })] }), _jsxs("div", { className: "flex min-h-0 flex-1", children: [_jsxs("aside", { className: cn('flex w-72 shrink-0 flex-col border-r', RULE, PANEL), children: [_jsxs("div", { className: cn('shrink-0 space-y-2 border-b p-3', HAIRLINE), children: [_jsxs("div", { className: "relative", children: [_jsx(Search, { size: 14, className: cn('pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2', MUTED) }), _jsx("input", { type: "text", value: filter, onChange: (e) => setFilter(e.target.value), placeholder: "Find a type or table", "aria-label": "Filter object types", className: cn('w-full rounded-md border bg-zinc-50 py-1.5 pl-8 pr-2 text-sm outline-none dark:bg-zinc-950', RULE, 'placeholder:text-zinc-400 focus:border-sky-500 focus:ring-2 focus:ring-sky-500/15') })] }), _jsxs("label", { className: cn('flex cursor-pointer items-center gap-2 px-0.5 text-xs', SECONDARY), children: [_jsx("input", { type: "checkbox", checked: onlyUnnamed, onChange: (e) => setOnlyUnnamed(e.target.checked), className: "accent-amber-500" }), "Only types nobody has named"] })] }), _jsxs("nav", { className: "min-h-0 flex-1 overflow-y-auto p-2", children: [grouped.length === 0 && (_jsxs("p", { className: cn('px-2 py-6 text-center text-xs', MUTED), children: ["Nothing matches \u201C", filter, "\u201D."] })), grouped.map(([group, groupTypes]) => (_jsxs("div", { className: "mb-3", children: [_jsxs("div", { className: "flex items-baseline justify-between px-2 py-1", children: [_jsx("span", { className: cn('font-mono text-[10px] uppercase tracking-[0.14em]', MUTED), children: group }), _jsx("span", { className: cn('font-mono text-[10px]', MUTED), children: groupTypes.length })] }), groupTypes.map((type) => (_jsxs("button", { type: "button", onClick: () => setSelectedName(type.name), className: cn('group flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors', selected?.name === type.name
141
+ return (_jsx(TooltipProvider, { children: _jsxs("div", { className: "flex h-full flex-col bg-zinc-50 dark:bg-zinc-950", children: [_jsxs("header", { className: cn('shrink-0 border-b px-8 py-6', RULE, PANEL), children: [_jsxs("div", { className: "flex flex-wrap items-start justify-between gap-6", children: [_jsxs("div", { children: [_jsx("p", { className: cn('font-mono text-[11px] uppercase tracking-[0.18em]', MUTED), children: eyebrow }), _jsx("h1", { className: "mt-1 text-2xl font-semibold tracking-tight", children: title }), _jsx("p", { className: cn('mt-1 max-w-xl text-sm', SECONDARY), children: intro })] }), _jsxs("div", { className: "flex items-center gap-6", children: [_jsx(Stat, { label: "Types", value: data.stats.types }), _jsx(Stat, { label: "Properties", value: data.stats.properties }), _jsx(Tooltip, { content: "Relations declared across every type. A link declared at both ends counts twice \u2014 the graph draws it once.", children: _jsx("span", { className: "cursor-help", children: _jsx(Stat, { label: "Relations", value: data.stats.relations }) }) }), canEdit && (_jsxs("button", { type: "button", onClick: () => resetMutation.mutate(), disabled: resetMutation.isPending, className: cn('flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs', RULE, SECONDARY, 'transition-colors hover:bg-zinc-50 disabled:opacity-50 dark:hover:bg-zinc-800'), children: [_jsx(RotateCcw, { size: 13 }), "Reset edits"] }))] })] }), editError && (_jsxs("div", { role: "alert", className: cn('mt-4 flex items-start justify-between gap-3 rounded-md border px-3 py-2 text-sm', 'border-rose-200 bg-rose-50 text-rose-800', 'dark:border-rose-900 dark:bg-rose-950/40 dark:text-rose-200'), children: [_jsx("span", { children: editError }), _jsx("button", { type: "button", onClick: () => setEditError(null), "aria-label": "Dismiss", className: "shrink-0 rounded-sm p-0.5 hover:bg-rose-100 dark:hover:bg-rose-900", children: _jsx(X, { size: 14 }) })] })), _jsx("div", { className: "mt-6", children: _jsx(CoverageLedger, { types: types, selected: selected?.name, onSelect: setSelectedName }) })] }), _jsxs("div", { className: "flex min-h-0 flex-1", children: [_jsxs("aside", { className: cn('flex w-72 shrink-0 flex-col border-r', RULE, PANEL), children: [_jsxs("div", { className: cn('shrink-0 space-y-2 border-b p-3', HAIRLINE), children: [_jsxs("div", { className: "relative", children: [_jsx(Search, { size: 14, className: cn('pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2', MUTED) }), _jsx("input", { type: "text", value: filter, onChange: (e) => setFilter(e.target.value), placeholder: "Find a type or table", "aria-label": "Filter object types", className: cn('w-full rounded-md border bg-zinc-50 py-1.5 pl-8 pr-2 text-sm outline-none dark:bg-zinc-950', RULE, 'placeholder:text-zinc-400 focus:border-sky-500 focus:ring-2 focus:ring-sky-500/15') })] }), _jsxs("label", { className: cn('flex cursor-pointer items-center gap-2 px-0.5 text-xs', SECONDARY), children: [_jsx("input", { type: "checkbox", checked: onlyUnnamed, onChange: (e) => setOnlyUnnamed(e.target.checked), className: "accent-amber-500" }), "Only types nobody has named"] })] }), _jsxs("nav", { className: "min-h-0 flex-1 overflow-y-auto p-2", children: [grouped.length === 0 && (_jsxs("p", { className: cn('px-2 py-6 text-center text-xs', MUTED), children: ["Nothing matches \u201C", filter, "\u201D."] })), grouped.map(([group, groupTypes]) => (_jsxs("div", { className: "mb-3", children: [_jsxs("div", { className: "flex items-baseline justify-between px-2 py-1", children: [_jsx("span", { className: cn('font-mono text-[10px] uppercase tracking-[0.14em]', MUTED), children: group }), _jsx("span", { className: cn('font-mono text-[10px]', MUTED), children: groupTypes.length })] }), groupTypes.map((type) => (_jsxs("button", { type: "button", onClick: () => setSelectedName(type.name), className: cn('group flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors', selected?.name === type.name
119
142
  ? 'bg-sky-100 dark:bg-sky-950'
120
- : 'hover:bg-zinc-50 dark:hover:bg-zinc-800'), children: [_jsx("span", { "aria-hidden": true, className: cn('h-1.5 w-1.5 shrink-0 rounded-full', type.enriched ? 'bg-emerald-500' : 'bg-amber-400/60') }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsxs("span", { className: "block truncate text-sm", children: [type.icon ? `${type.icon} ` : '', type.displayName] }), _jsxs("span", { className: cn('block truncate font-mono text-[10px]', MUTED), children: [type.tableName, _jsx(FreshnessNote, { type: type })] })] })] }, type.name)))] }, group)))] })] }), _jsxs("main", { className: "min-w-0 flex-1 overflow-y-auto", children: [missing && _jsx(NoSuchType, { name: missing }), selected && (_jsx(TypeDetail, { type: selected, workflowHref: workflowHref,
143
+ : 'hover:bg-zinc-50 dark:hover:bg-zinc-800'), children: [_jsx("span", { "aria-hidden": true, className: cn('h-1.5 w-1.5 shrink-0 rounded-full', type.enriched ? 'bg-emerald-500' : 'bg-amber-400/60') }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsxs("span", { className: "block truncate text-sm", children: [type.icon ? `${type.icon} ` : '', type.displayName] }), _jsxs("span", { className: cn('block truncate font-mono text-[10px]', MUTED), children: [type.tableName, _jsx(FreshnessNote, { type: type })] })] })] }, type.name)))] }, group)))] })] }), _jsxs("main", { className: "min-w-0 flex-1 overflow-y-auto", children: [missing && _jsx(NoSuchType, { name: missing }), selected && (_jsx(TypeDetail, { type: selected, canEdit: canEdit, pipeline: pipeline, workflowHref: workflowHref,
121
144
  // The whole catalog, so the detail pane can answer what points
122
145
  // AT this type. Nothing on a type records its inbound links —
123
146
  // one row per declaration, and the declaration lives on the
124
147
  // other end — so the only place that question can be answered
125
148
  // is somewhere holding every type.
126
- types: types, explorerHref: explorerHref, onPatchType: (patch) => typeMutation.mutate({ name: selected.name, patch }), onPatchProperty: (property, patch) => propertyMutation.mutate({ name: selected.name, property, patch }), onNavigate: setSelectedName }, selected.name))] })] })] }) }));
149
+ types: types, explorerHref: explorerHref,
150
+ // Guarded here as well as by every control being absent: a
151
+ // read-only screen must not be able to write even if a child
152
+ // forgets to honour `canEdit`.
153
+ onPatchType: (patch) => {
154
+ if (canEdit)
155
+ typeMutation.mutate({ name: selected.name, patch });
156
+ }, onPatchProperty: (property, patch) => {
157
+ if (canEdit)
158
+ propertyMutation.mutate({ name: selected.name, property, patch });
159
+ }, onNavigate: setSelectedName }, selected.name))] })] })] }) }));
127
160
  }
128
161
  /**
129
162
  * Which type this screen is showing, and how it gets chosen.
@@ -177,9 +210,11 @@ function NoSuchType({ name }) {
177
210
  function Stat({ label, value }) {
178
211
  return (_jsxs("div", { className: "text-right", children: [_jsx("div", { className: "font-mono text-xl leading-none tabular-nums", children: value }), _jsx("div", { className: cn('mt-1 font-mono text-[10px] uppercase tracking-[0.14em]', MUTED), children: label })] }));
179
212
  }
180
- function TypeDetail({ type, types, explorerHref, workflowHref, onPatchType, onPatchProperty, onNavigate, }) {
213
+ function TypeDetail({ type, types, explorerHref, workflowHref, canEdit, pipeline, onPatchType, onPatchProperty, onNavigate, }) {
181
214
  const visible = type.properties.filter((p) => !p.hidden).length;
182
- return (_jsxs("div", { className: "mx-auto max-w-5xl px-8 py-8", children: [_jsxs("div", { className: "flex flex-wrap items-start justify-between gap-4", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-baseline gap-2", children: [_jsx("span", { className: "text-2xl leading-none", children: type.icon ?? '◈' }), _jsx(EditableField, { label: "display name", value: type.displayName, onSave: (displayName) => onPatchType({ displayName }), className: "text-2xl font-semibold tracking-tight", inputClassName: "text-2xl font-semibold tracking-tight" })] }), _jsxs("div", { className: cn('mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 pl-1 font-mono text-[11px]', MUTED), children: [_jsx("span", { children: type.name }), _jsx("span", { "aria-hidden": true, children: "\u00B7" }), _jsx("span", { children: type.tableName }), _jsx("span", { "aria-hidden": true, children: "\u00B7" }), _jsxs("span", { children: ["pk ", type.primaryKey.join(', ') || 'none'] }), _jsx("span", { "aria-hidden": true, children: "\u00B7" }), _jsxs("span", { children: [visible, " of ", type.properties.length, " shown"] })] })] }), explorerHref && (_jsxs("a", { href: explorerHref(type.name), className: cn('flex items-center gap-1.5 rounded-md bg-zinc-950 px-3 py-2 text-xs text-zinc-50', 'transition-colors hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-950 dark:hover:bg-zinc-300'), children: ["Open ", type.pluralDisplayName, _jsx(ArrowUpRight, { size: 13 })] }))] }), _jsx("div", { className: "mt-5 border-l-2 border-sky-200 pl-4 dark:border-sky-900", children: _jsx(RichTextField, { label: "description", value: type.description ?? '', placeholder: "No one has written down what this type means yet.", onSave: (description) => onPatchType({ description }), className: cn('text-sm leading-relaxed', SECONDARY) }) }), _jsxs("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [_jsx(FieldChip, { label: "Group", value: type.group, onSave: (group) => onPatchType({ group }) }), _jsx(FieldChip, { label: "Plural", value: type.pluralDisplayName, onSave: (pluralDisplayName) => onPatchType({ pluralDisplayName }) }), _jsx(FieldChip, { label: "Icon", value: type.icon ?? '', onSave: (icon) => onPatchType({ icon }) })] }), _jsxs("section", { className: "mt-10", children: [_jsx(SectionHeading, { title: "Properties", note: "The column and its SQL type are read from the ORM. The label, description and unit are yours." }), _jsx("div", { className: cn('overflow-hidden rounded-lg border', RULE, PANEL), children: _jsx(PropertyTable, { properties: type.properties, onPatchProperty: onPatchProperty }) })] }), _jsx(LoadedBySection, { typeName: type.name, displayName: type.displayName, workflowHref: workflowHref }), _jsx(LoadExpectationSection, { typeName: type.name, displayName: type.displayName }), _jsx(LinkSection, { type: type, types: types, onPatchProperty: onPatchProperty, onNavigate: onNavigate })] }));
215
+ return (_jsxs("div", { className: "mx-auto max-w-5xl px-8 py-8", children: [_jsxs("div", { className: "flex flex-wrap items-start justify-between gap-4", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-baseline gap-2", children: [_jsx("span", { className: "text-2xl leading-none", children: type.icon ?? '◈' }), _jsx(EditableField, { label: "display name", value: type.displayName, onSave: (displayName) => onPatchType({ displayName }), readOnly: !canEdit, className: "text-2xl font-semibold tracking-tight", inputClassName: "text-2xl font-semibold tracking-tight" })] }), _jsxs("div", { className: cn('mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 pl-1 font-mono text-[11px]', MUTED), children: [_jsx("span", { children: type.name }), _jsx("span", { "aria-hidden": true, children: "\u00B7" }), _jsx("span", { children: type.tableName }), _jsx("span", { "aria-hidden": true, children: "\u00B7" }), _jsxs("span", { children: ["pk ", type.primaryKey.join(', ') || 'none'] }), _jsx("span", { "aria-hidden": true, children: "\u00B7" }), _jsxs("span", { children: [visible, " of ", type.properties.length, " shown"] })] })] }), explorerHref && (_jsxs("a", { href: explorerHref(type.name), className: cn('flex items-center gap-1.5 rounded-md bg-zinc-950 px-3 py-2 text-xs text-zinc-50', 'transition-colors hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-950 dark:hover:bg-zinc-300'), children: ["Open ", type.pluralDisplayName, _jsx(ArrowUpRight, { size: 13 })] }))] }), _jsx("div", { className: "mt-5 border-l-2 border-sky-200 pl-4 dark:border-sky-900", children: _jsx(RichTextField, { label: "description", value: type.description ?? '', placeholder: "No one has written down what this type means yet.", onSave: (description) => onPatchType({ description }), readOnly: !canEdit, className: cn('text-sm leading-relaxed', SECONDARY) }) }), _jsxs("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [_jsx(FieldChip, { label: "Group", value: type.group, readOnly: !canEdit, onSave: (group) => onPatchType({ group }) }), _jsx(FieldChip, { label: "Plural", value: type.pluralDisplayName, readOnly: !canEdit, onSave: (pluralDisplayName) => onPatchType({ pluralDisplayName }) }), _jsx(FieldChip, { label: "Icon", value: type.icon ?? '', readOnly: !canEdit, onSave: (icon) => onPatchType({ icon }) })] }), _jsxs("section", { className: "mt-10", children: [_jsx(SectionHeading, { title: "Properties", note: canEdit
216
+ ? 'The column and its SQL type are read from the ORM. The label, description and unit are yours.'
217
+ : 'The column and its SQL type are read from the ORM. The label, description and unit were written by people.' }), _jsx("div", { className: cn('overflow-hidden rounded-lg border', RULE, PANEL), children: _jsx(PropertyTable, { properties: type.properties, canEdit: canEdit, onPatchProperty: onPatchProperty }) })] }), pipeline && (_jsx(LoadedBySection, { typeName: type.name, displayName: type.displayName, workflowHref: workflowHref })), pipeline && (_jsx(LoadExpectationSection, { typeName: type.name, displayName: type.displayName, canEdit: canEdit })), _jsx(LinkSection, { type: type, types: types, canEdit: canEdit, onPatchProperty: onPatchProperty, onNavigate: onNavigate })] }));
183
218
  }
184
219
  /** What each kind actually says, for people who do not read `m:n` fluently. */
185
220
  const KIND_MEANING = {
@@ -224,10 +259,12 @@ function inboundLinks(type, types) {
224
259
  }
225
260
  return inbound;
226
261
  }
227
- function LinkSection({ type, types, onPatchProperty, onNavigate, }) {
262
+ function LinkSection({ type, types, canEdit, onPatchProperty, onNavigate, }) {
228
263
  const inbound = useMemo(() => inboundLinks(type, types), [type, types]);
229
264
  const labelFor = useMemo(() => new Map(types.map((t) => [t.name, t.displayName])), [types]);
230
- return (_jsxs("section", { className: "mt-10 pb-16", children: [_jsx(SectionHeading, { title: "Links", note: "Read from the foreign keys. What a link is called is yours to change; where it points is not." }), type.relations.length === 0 && inbound.length === 0 ? (_jsxs("p", { className: cn('rounded-lg border border-dashed px-4 py-6 text-center text-sm', RULE, MUTED), children: ["Nothing links to or from ", type.displayName, " yet."] })) : (_jsxs("div", { className: "space-y-5", children: [type.relations.length > 0 && (_jsxs("div", { children: [_jsxs("p", { className: cn('mb-2 font-mono text-[10px] uppercase tracking-[0.14em]', MUTED), children: [type.displayName, " points at"] }), _jsx("ul", { className: "space-y-1.5", children: type.relations.map((relation) => (_jsx(OutboundLink, { relation: relation, targetLabel: labelFor.get(relation.targetType), onPatchProperty: onPatchProperty, onNavigate: onNavigate }, relation.name))) })] })), inbound.length > 0 && (_jsxs("div", { children: [_jsxs("p", { className: cn('mb-2 font-mono text-[10px] uppercase tracking-[0.14em]', MUTED), children: ["Points at ", type.displayName] }), _jsx("ul", { className: "space-y-1.5", children: inbound.map(({ from, relation }) => (_jsx("li", { children: _jsxs("button", { type: "button", onClick: () => onNavigate(from.name), className: cn('flex w-full items-center gap-2 rounded-md border px-3 py-2 text-left transition-colors', RULE, PANEL, 'hover:border-sky-500 hover:bg-sky-100 dark:hover:bg-sky-950'), children: [_jsx(ArrowLeft, { size: 13, className: MUTED }), _jsx("span", { className: "text-sm", children: from.displayName }), _jsxs("span", { className: cn('font-mono text-[10px]', MUTED), children: [relation.kind, " \u00B7 ", from.name, ".", relation.name] })] }) }, `${from.name}.${relation.name}`))) }), _jsx("p", { className: cn('mt-1.5 text-[11px]', MUTED), children: "Declared on the other type. Open it to rename the link." })] }))] }))] }));
265
+ return (_jsxs("section", { className: "mt-10 pb-16", children: [_jsx(SectionHeading, { title: "Links", note: canEdit
266
+ ? 'Read from the foreign keys. What a link is called is yours to change; where it points is not.'
267
+ : 'Read from the foreign keys.' }), type.relations.length === 0 && inbound.length === 0 ? (_jsxs("p", { className: cn('rounded-lg border border-dashed px-4 py-6 text-center text-sm', RULE, MUTED), children: ["Nothing links to or from ", type.displayName, " yet."] })) : (_jsxs("div", { className: "space-y-5", children: [type.relations.length > 0 && (_jsxs("div", { children: [_jsxs("p", { className: cn('mb-2 font-mono text-[10px] uppercase tracking-[0.14em]', MUTED), children: [type.displayName, " points at"] }), _jsx("ul", { className: "space-y-1.5", children: type.relations.map((relation) => (_jsx(OutboundLink, { relation: relation, targetLabel: labelFor.get(relation.targetType), canEdit: canEdit, onPatchProperty: onPatchProperty, onNavigate: onNavigate }, relation.name))) })] })), inbound.length > 0 && (_jsxs("div", { children: [_jsxs("p", { className: cn('mb-2 font-mono text-[10px] uppercase tracking-[0.14em]', MUTED), children: ["Points at ", type.displayName] }), _jsx("ul", { className: "space-y-1.5", children: inbound.map(({ from, relation }) => (_jsx("li", { children: _jsxs("button", { type: "button", onClick: () => onNavigate(from.name), className: cn('flex w-full items-center gap-2 rounded-md border px-3 py-2 text-left transition-colors', RULE, PANEL, 'hover:border-sky-500 hover:bg-sky-100 dark:hover:bg-sky-950'), children: [_jsx(ArrowLeft, { size: 13, className: MUTED }), _jsx("span", { className: "text-sm", children: from.displayName }), _jsxs("span", { className: cn('font-mono text-[10px]', MUTED), children: [relation.kind, " \u00B7 ", from.name, ".", relation.name] })] }) }, `${from.name}.${relation.name}`))) }), canEdit && (_jsx("p", { className: cn('mt-1.5 text-[11px]', MUTED), children: "Declared on the other type. Open it to rename the link." }))] }))] }))] }));
231
268
  }
232
269
  /**
233
270
  * One link this type declares.
@@ -237,8 +274,8 @@ function LinkSection({ type, types, onPatchProperty, onNavigate, }) {
237
274
  * rename a link was to first go somewhere else. A nested interactive element is
238
275
  * also the one thing a screen reader cannot describe.
239
276
  */
240
- function OutboundLink({ relation, targetLabel, onPatchProperty, onNavigate, }) {
241
- return (_jsxs("li", { className: cn('flex items-center gap-2 rounded-md border px-3 py-2', RULE, PANEL, relation.hidden && 'opacity-45'), children: [_jsx(Tooltip, { content: KIND_MEANING[relation.kind], children: _jsx("span", { className: cn('cursor-help font-mono text-[10px] uppercase tracking-wider', MUTED), children: relation.kind }) }), _jsx("span", { className: "min-w-0 flex-1", children: _jsx(EditableField, { label: `label for ${relation.name}`, value: relation.displayName, onSave: (displayName) => onPatchProperty(relation.name, { displayName }), className: "text-sm", inputClassName: "text-sm" }) }), _jsxs("span", { className: cn('shrink-0 font-mono text-[10px]', MUTED), children: [relation.name, relation.localKey ? ` · ${relation.localKey}` : ''] }), _jsx("span", { className: "shrink-0", children: relation.targetPublished ? (_jsxs("button", { type: "button", onClick: () => onNavigate(relation.targetType), className: cn('flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-xs transition-colors', SECONDARY, 'hover:bg-sky-100 dark:hover:bg-sky-950'), children: [_jsx(ArrowRight, { size: 13 }), targetLabel ?? relation.targetType] })) : (
277
+ function OutboundLink({ relation, targetLabel, canEdit, onPatchProperty, onNavigate, }) {
278
+ return (_jsxs("li", { className: cn('flex items-center gap-2 rounded-md border px-3 py-2', RULE, PANEL, relation.hidden && 'opacity-45'), children: [_jsx(Tooltip, { content: KIND_MEANING[relation.kind], children: _jsx("span", { className: cn('cursor-help font-mono text-[10px] uppercase tracking-wider', MUTED), children: relation.kind }) }), _jsx("span", { className: "min-w-0 flex-1", children: _jsx(EditableField, { label: `label for ${relation.name}`, value: relation.displayName, onSave: (displayName) => onPatchProperty(relation.name, { displayName }), readOnly: !canEdit, className: "text-sm", inputClassName: "text-sm" }) }), _jsxs("span", { className: cn('shrink-0 font-mono text-[10px]', MUTED), children: [relation.name, relation.localKey ? ` · ${relation.localKey}` : ''] }), _jsx("span", { className: "shrink-0", children: relation.targetPublished ? (_jsxs("button", { type: "button", onClick: () => onNavigate(relation.targetType), className: cn('flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-xs transition-colors', SECONDARY, 'hover:bg-sky-100 dark:hover:bg-sky-950'), children: [_jsx(ArrowRight, { size: 13 }), targetLabel ?? relation.targetType] })) : (
242
279
  // Kept, and marked. Dropping it would leave the type looking less
243
280
  // connected than it is; making it navigable would send the reader to
244
281
  // a type that is not there — the button used to do exactly that, and
@@ -248,8 +285,8 @@ function OutboundLink({ relation, targetLabel, onPatchProperty, onNavigate, }) {
248
285
  function SectionHeading({ title, note }) {
249
286
  return (_jsxs("div", { className: "mb-3", children: [_jsx("h2", { className: cn('font-mono text-[11px] uppercase tracking-[0.16em]', MUTED), children: title }), _jsx("p", { className: cn('mt-1 text-xs', MUTED), children: note })] }));
250
287
  }
251
- function FieldChip({ label, value, onSave, }) {
252
- return (_jsxs("div", { className: cn('flex items-center gap-1.5 rounded-md border px-2 py-1', RULE, PANEL), children: [_jsx("span", { className: cn('font-mono text-[10px] uppercase tracking-wider', MUTED), children: label }), _jsx(EditableField, { label: label, value: value, placeholder: "\u2014", onSave: onSave, className: "text-xs", inputClassName: "text-xs" })] }));
288
+ function FieldChip({ label, value, readOnly, onSave, }) {
289
+ return (_jsxs("div", { className: cn('flex items-center gap-1.5 rounded-md border px-2 py-1', RULE, PANEL), children: [_jsx("span", { className: cn('font-mono text-[10px] uppercase tracking-wider', MUTED), children: label }), _jsx(EditableField, { label: label, value: value, placeholder: "\u2014", onSave: onSave, readOnly: readOnly, className: "text-xs", inputClassName: "text-xs" })] }));
253
290
  }
254
291
  /**
255
292
  * The properties of one type, as a table.
@@ -263,13 +300,13 @@ function FieldChip({ label, value, onSave, }) {
263
300
  * declaring them at all: these cells contain inputs, and a column that sizes to
264
301
  * its content reflows the whole table on every keystroke.
265
302
  */
266
- function PropertyTable({ properties, onPatchProperty, }) {
303
+ function PropertyTable({ properties, canEdit, onPatchProperty, }) {
267
304
  const columns = useMemo(() => [
268
305
  {
269
306
  id: 'label',
270
307
  header: 'Label',
271
308
  accessorFn: (p) => p.displayName,
272
- cell: ({ row }) => (_jsx(PropertyLabelCell, { property: row.original, onPatchProperty: onPatchProperty })),
309
+ cell: ({ row }) => (_jsx(PropertyLabelCell, { property: row.original, canEdit: canEdit, onPatchProperty: onPatchProperty })),
273
310
  },
274
311
  {
275
312
  id: 'column',
@@ -287,21 +324,21 @@ function PropertyTable({ properties, onPatchProperty, }) {
287
324
  id: 'unit',
288
325
  header: 'Unit',
289
326
  accessorFn: (p) => p.unit ?? '',
290
- cell: ({ row }) => (_jsx(EditableField, { label: `unit for ${row.original.name}`, value: row.original.unit ?? '', placeholder: "\u2014", onSave: (unit) => onPatchProperty(row.original.name, { unit }), inputClassName: "text-xs", className: "text-xs" })),
327
+ cell: ({ row }) => (_jsx(EditableField, { label: `unit for ${row.original.name}`, value: row.original.unit ?? '', placeholder: "\u2014", onSave: (unit) => onPatchProperty(row.original.name, { unit }), readOnly: !canEdit, inputClassName: "text-xs", className: "text-xs" })),
291
328
  },
292
329
  {
293
330
  id: 'meaning',
294
331
  header: 'Meaning',
295
332
  accessorFn: (p) => p.description ?? '',
296
- cell: ({ row }) => (_jsx(RichTextField, { label: `description for ${row.original.name}`, value: row.original.description ?? '', placeholder: "\u2014", onSave: (description) => onPatchProperty(row.original.name, { description }), className: cn('text-xs leading-snug', SECONDARY) })),
333
+ cell: ({ row }) => (_jsx(RichTextField, { label: `description for ${row.original.name}`, value: row.original.description ?? '', placeholder: "\u2014", onSave: (description) => onPatchProperty(row.original.name, { description }), readOnly: !canEdit, className: cn('text-xs leading-snug', SECONDARY) })),
297
334
  },
298
335
  {
299
336
  id: 'shown',
300
337
  header: 'Shown',
301
338
  accessorFn: (p) => !p.hidden,
302
- cell: ({ row }) => (_jsx(VisibilityToggle, { property: row.original, onPatchProperty: onPatchProperty })),
339
+ cell: ({ row }) => (_jsx(VisibilityToggle, { property: row.original, canEdit: canEdit, onPatchProperty: onPatchProperty })),
303
340
  },
304
- ], [onPatchProperty]);
341
+ ], [onPatchProperty, canEdit]);
305
342
  return (_jsx(DataTable, { data: properties, columns: columns, getRowId: (property) => property.name,
306
343
  // Dimmed rather than dropped: a hidden property is still stored, and a
307
344
  // screen that simply omitted it could not tell you that showing it again
@@ -320,15 +357,20 @@ const PROPERTY_WIDTHS = {
320
357
  shown: 'w-[6%] text-right',
321
358
  };
322
359
  /** The label cell: the curated name, with the physical name and its constraints beneath. */
323
- function PropertyLabelCell({ property, onPatchProperty, }) {
324
- return (_jsxs(_Fragment, { children: [_jsx(EditableField, { label: `label for ${property.name}`, value: property.displayName, onSave: (displayName) => onPatchProperty(property.name, { displayName }), inputClassName: "text-sm" }), _jsxs("div", { className: cn('px-1.5 font-mono text-[10px]', MUTED), children: [property.name, property.primary && (_jsx(Tooltip, { content: "Primary key. Always fetched, even when hidden, so a row keeps a stable identity.", children: _jsx("span", { className: "ml-1.5 cursor-help text-sky-600 dark:text-sky-400", children: "pk" }) })), !property.nullable && !property.primary && (_jsx(Tooltip, { content: "NOT NULL in the database. Read from the ORM, not something this screen can change.", children: _jsx("span", { className: "ml-1.5 cursor-help text-amber-600", children: "required" }) }))] })] }));
360
+ function PropertyLabelCell({ property, canEdit, onPatchProperty, }) {
361
+ return (_jsxs(_Fragment, { children: [_jsx(EditableField, { label: `label for ${property.name}`, value: property.displayName, onSave: (displayName) => onPatchProperty(property.name, { displayName }), readOnly: !canEdit, inputClassName: "text-sm" }), _jsxs("div", { className: cn('px-1.5 font-mono text-[10px]', MUTED), children: [property.name, property.primary && (_jsx(Tooltip, { content: "Primary key. Always fetched, even when hidden, so a row keeps a stable identity.", children: _jsx("span", { className: "ml-1.5 cursor-help text-sky-600 dark:text-sky-400", children: "pk" }) })), !property.nullable && !property.primary && (_jsx(Tooltip, { content: "NOT NULL in the database. Read from the ORM, not something this screen can change.", children: _jsx("span", { className: "ml-1.5 cursor-help text-amber-600", children: "required" }) }))] })] }));
325
362
  }
326
363
  /**
327
364
  * Hiding is presentation, not schema — the tooltip says so on both sides,
328
365
  * because "hidden" next to a database column reads as destructive until
329
366
  * somebody tells you it is not.
330
367
  */
331
- function VisibilityToggle({ property, onPatchProperty, }) {
368
+ function VisibilityToggle({ property, canEdit, onPatchProperty, }) {
369
+ if (!canEdit) {
370
+ // The state, without the switch: the row is still dimmed when hidden, and
371
+ // the icon says which it is to somebody who cannot see the dimming.
372
+ return (_jsx("span", { role: "img", "aria-label": `${property.displayName} is ${property.hidden ? 'hidden' : 'shown'}`, className: cn('inline-flex p-1', MUTED), children: property.hidden ? _jsx(EyeOff, { size: 14 }) : _jsx(Eye, { size: 14 }) }));
373
+ }
332
374
  return (_jsx(Tooltip, { content: property.hidden
333
375
  ? `Hidden from tables and search. ${property.displayName} is still stored — showing it again needs no migration.`
334
376
  : 'Shown in tables and search. Hiding it only changes what is displayed; the column is untouched.', children: _jsx("button", { type: "button", "aria-label": `${property.hidden ? 'Show' : 'Hide'} ${property.displayName}`, onClick: () => onPatchProperty(property.name, { hidden: !property.hidden }), className: cn('rounded-sm p-1 hover:bg-zinc-100 dark:hover:bg-zinc-800', MUTED), children: property.hidden ? _jsx(EyeOff, { size: 14 }) : _jsx(Eye, { size: 14 }) }) }));
@@ -6,6 +6,12 @@ interface EditableFieldProps {
6
6
  className?: string;
7
7
  inputClassName?: string;
8
8
  label: string;
9
+ /**
10
+ * Render the value as plain text, with no edit affordance at all — no button,
11
+ * no pencil, nothing a click turns into a write. For a viewer who may read the
12
+ * catalog but not change it.
13
+ */
14
+ readOnly?: boolean;
9
15
  }
10
16
  /**
11
17
  * Click to edit, Enter to save, Escape to cancel.
@@ -14,5 +20,5 @@ interface EditableFieldProps {
14
20
  * None of it reaches a migration, which is the only reason it is safe to make
15
21
  * editing this casual.
16
22
  */
17
- export declare function EditableField({ value, placeholder, onSave, multiline, className, inputClassName, label, }: EditableFieldProps): import("react").JSX.Element;
23
+ export declare function EditableField({ value, placeholder, onSave, multiline, className, inputClassName, label, readOnly, }: EditableFieldProps): import("react").JSX.Element;
18
24
  export {};
@@ -9,7 +9,7 @@ import { cn } from './cn.js';
9
9
  * None of it reaches a migration, which is the only reason it is safe to make
10
10
  * editing this casual.
11
11
  */
12
- export function EditableField({ value, placeholder = 'Not named yet', onSave, multiline = false, className, inputClassName, label, }) {
12
+ export function EditableField({ value, placeholder = 'Not named yet', onSave, multiline = false, className, inputClassName, label, readOnly = false, }) {
13
13
  const [editing, setEditing] = useState(false);
14
14
  const [draft, setDraft] = useState(value);
15
15
  // Two refs rather than one union-typed ref: React types `ref` per element, so
@@ -37,6 +37,12 @@ export function EditableField({ value, placeholder = 'Not named yet', onSave, mu
37
37
  setDraft(value);
38
38
  setEditing(false);
39
39
  }
40
+ if (readOnly) {
41
+ return (_jsx("span", { className: cn('flex w-full items-start px-1.5 py-0.5 text-left',
42
+ // The same box the button draws, minus the border that only exists to
43
+ // be hovered, so a read-only screen lines up with an editable one.
44
+ className), children: _jsx("span", { className: cn(!value && 'italic text-zinc-400 dark:text-zinc-500'), children: value || placeholder }) }));
45
+ }
40
46
  if (editing) {
41
47
  const shared = {
42
48
  value: draft,
package/dist/FlowView.js CHANGED
@@ -28,7 +28,7 @@ export function FlowView() {
28
28
  });
29
29
  const { data: events = [], isLoading } = useQuery({
30
30
  queryKey: ['catalog', 'flow-events'],
31
- queryFn: () => client.listEvents({ limit: 500 }),
31
+ queryFn: () => client.listEvents({ size: 500 }).then((page) => page.data),
32
32
  refetchInterval: 20_000,
33
33
  });
34
34
  const lanes = useMemo(() => buildLanes(snapshot?.types ?? [], events), [snapshot, events]);
@@ -38,11 +38,13 @@ export function GovernanceTimeline({ traceSource, } = {}) {
38
38
  const [principal, setPrincipal] = useState('');
39
39
  const { data: events = [], isLoading } = useQuery({
40
40
  queryKey: ['catalog', 'events', event, principal],
41
- queryFn: () => client.listEvents({
41
+ queryFn: () => client
42
+ .listEvents({
42
43
  event: event || undefined,
43
44
  principalId: principal || undefined,
44
- limit: 200,
45
- }),
45
+ size: 200,
46
+ })
47
+ .then((page) => page.data),
46
48
  refetchInterval: 15_000,
47
49
  });
48
50
  const principals = useMemo(() => [...new Set(events.map((e) => e.principalId).filter(Boolean))], [events]);
@@ -8,5 +8,11 @@ export interface LoadExpectationSectionProps {
8
8
  typeName: string;
9
9
  /** What a person calls the type. Used in the sentences, which are about the type. */
10
10
  displayName: string;
11
+ /**
12
+ * Set false where the viewer is known to be read-only. The expectation in
13
+ * force, its reason and where each field came from are still shown; the form
14
+ * that sets it is not rendered, so nothing here can issue a write.
15
+ */
16
+ canEdit?: boolean;
11
17
  }
12
- export declare function LoadExpectationSection({ typeName, displayName }: LoadExpectationSectionProps): import("react").JSX.Element;
18
+ export declare function LoadExpectationSection({ typeName, displayName, canEdit, }: LoadExpectationSectionProps): import("react").JSX.Element;
@@ -224,7 +224,7 @@ function describeInterval(ms) {
224
224
  return `${trim(hours)} hours`;
225
225
  return `${trim(ms / 60_000)} minutes`;
226
226
  }
227
- export function LoadExpectationSection({ typeName, displayName }) {
227
+ export function LoadExpectationSection({ typeName, displayName, canEdit = true, }) {
228
228
  const client = useCatalogClient();
229
229
  const { data: view, isPending, isError, error, } = useQuery({
230
230
  queryKey: catalogQueryKeys.loadExpectation(typeName),
@@ -234,19 +234,19 @@ export function LoadExpectationSection({ typeName, displayName }) {
234
234
  // section that says nothing for half a minute before saying that.
235
235
  retry: false,
236
236
  });
237
- return (_jsxs("section", { className: "mt-10", children: [_jsxs("div", { className: "mb-3", children: [_jsx("h2", { className: cn('font-mono text-[11px] uppercase tracking-[0.16em]', MUTED), children: "Load expectation" }), _jsx("p", { className: cn('mt-1 text-xs', MUTED), children: "How this type reconciles rows deleted at the source, and how far one load may move its row count. Checked before a load is allowed to become the data everybody reads." })] }), isPending && _jsx("p", { className: cn('font-mono text-xs', MUTED), children: "Reading the expectation\u2026" }), isError && (_jsxs("div", { className: cn('rounded-lg border px-4 py-3', RULE, PANEL), children: [_jsx("p", { className: "text-sm", children: "Could not read the load expectation." }), _jsxs("p", { className: cn('mt-1 text-xs', SECONDARY), children: ["It is served by the pipeline endpoints, which are the host's rather than this library's \u2014 this deployment may not mount them, or this account may not read them. Nothing here says whether a load of ", displayName, " would be refused."] }), error instanceof Error && (_jsx("p", { className: cn('mt-1 font-mono text-[11px]', MUTED), children: error.message }))] })), view && _jsx(LoadExpectationBody, { view: view, displayName: displayName })] }));
237
+ return (_jsxs("section", { className: "mt-10", children: [_jsxs("div", { className: "mb-3", children: [_jsx("h2", { className: cn('font-mono text-[11px] uppercase tracking-[0.16em]', MUTED), children: "Load expectation" }), _jsx("p", { className: cn('mt-1 text-xs', MUTED), children: "How this type reconciles rows deleted at the source, and how far one load may move its row count. Checked before a load is allowed to become the data everybody reads." })] }), isPending && _jsx("p", { className: cn('font-mono text-xs', MUTED), children: "Reading the expectation\u2026" }), isError && (_jsxs("div", { className: cn('rounded-lg border px-4 py-3', RULE, PANEL), children: [_jsx("p", { className: "text-sm", children: "Could not read the load expectation." }), _jsxs("p", { className: cn('mt-1 text-xs', SECONDARY), children: ["It is served by the pipeline endpoints, which are the host's rather than this library's \u2014 this deployment may not mount them, or this account may not read them. Nothing here says whether a load of ", displayName, " would be refused."] }), error instanceof Error && (_jsx("p", { className: cn('mt-1 font-mono text-[11px]', MUTED), children: error.message }))] })), view && _jsx(LoadExpectationBody, { view: view, displayName: displayName, canEdit: canEdit })] }));
238
238
  }
239
- function LoadExpectationBody({ view, displayName, }) {
239
+ function LoadExpectationBody({ view, displayName, canEdit, }) {
240
240
  const deletes = view.resolved.deletes;
241
241
  return (_jsxs("div", { className: "space-y-4", children: [view.deletesFrom === 'none' ? (
242
242
  // The whole reason somebody opens this section. Said in words, and
243
243
  // said first: a blank strategy field is read as "not filled in yet",
244
244
  // which is exactly the wrong conclusion — the load is already refused.
245
- _jsxs("div", { className: cn('rounded-lg border border-amber-300 bg-amber-50 px-4 py-3', 'dark:border-amber-900 dark:bg-amber-950/40'), children: [_jsxs("p", { className: "text-sm text-amber-900 dark:text-amber-200", children: ["Nothing declares how ", displayName, " reconciles deletes, so an incremental load of it will be refused."] }), _jsx("p", { className: "mt-1 text-xs text-amber-800 dark:text-amber-300/80", children: "A full load still commits \u2014 it replaces the whole type, so deletions reconcile by construction. What is blocked is the incremental path, until somebody chooses a strategy below and writes down why." })] })) : (_jsxs("div", { className: cn('rounded-lg border px-4 py-3', RULE, PANEL), children: [_jsxs("div", { className: "flex flex-wrap items-baseline justify-between gap-2", children: [_jsxs("p", { className: "text-sm", children: ["Deletes: ", _jsx("span", { className: "font-mono", children: deletes?.strategy }), deletes?.strategy === 'periodic-full-reload' && (_jsxs("span", { className: SECONDARY, children: [' ', "\u00B7 reconciled every ", describeInterval(deletes.withinMs)] })), deletes?.strategy === 'soft-deleted-at-source' && deletes.column && (_jsxs("span", { className: SECONDARY, children: [" \u00B7 column ", deletes.column] }))] }), _jsx(SourceBadge, { source: view.deletesFrom })] }), deletes && (
245
+ _jsxs("div", { className: cn('rounded-lg border border-amber-300 bg-amber-50 px-4 py-3', 'dark:border-amber-900 dark:bg-amber-950/40'), children: [_jsxs("p", { className: "text-sm text-amber-900 dark:text-amber-200", children: ["Nothing declares how ", displayName, " reconciles deletes, so an incremental load of it will be refused."] }), _jsxs("p", { className: "mt-1 text-xs text-amber-800 dark:text-amber-300/80", children: ["A full load still commits \u2014 it replaces the whole type, so deletions reconcile by construction. What is blocked is the incremental path, until somebody chooses a strategy", canEdit ? ' below' : '', " and writes down why."] })] })) : (_jsxs("div", { className: cn('rounded-lg border px-4 py-3', RULE, PANEL), children: [_jsxs("div", { className: "flex flex-wrap items-baseline justify-between gap-2", children: [_jsxs("p", { className: "text-sm", children: ["Deletes: ", _jsx("span", { className: "font-mono", children: deletes?.strategy }), deletes?.strategy === 'periodic-full-reload' && (_jsxs("span", { className: SECONDARY, children: [' ', "\u00B7 reconciled every ", describeInterval(deletes.withinMs)] })), deletes?.strategy === 'soft-deleted-at-source' && deletes.column && (_jsxs("span", { className: SECONDARY, children: [" \u00B7 column ", deletes.column] }))] }), _jsx(SourceBadge, { source: view.deletesFrom })] }), deletes && (
246
246
  // Prose, and marked up as prose: this is a sentence somebody is
247
247
  // accountable for, not a config value. In the table below it would
248
248
  // be skimmed like one.
249
- _jsxs("blockquote", { className: "mt-2 border-l-2 border-sky-200 pl-4 dark:border-sky-900", children: [_jsx("p", { className: "text-sm leading-relaxed", children: deletes.because }), _jsx(Attribution, { view: view })] }))] })), _jsx(ProvenanceTable, { view: view }), _jsx(ExpectationForm, { view: view, displayName: displayName })] }));
249
+ _jsxs("blockquote", { className: "mt-2 border-l-2 border-sky-200 pl-4 dark:border-sky-900", children: [_jsx("p", { className: "text-sm leading-relaxed", children: deletes.because }), _jsx(Attribution, { view: view })] }))] })), _jsx(ProvenanceTable, { view: view }), canEdit && _jsx(ExpectationForm, { view: view, displayName: displayName })] }));
250
250
  }
251
251
  /**
252
252
  * Who wrote the sentence above, and when.
@@ -5,6 +5,21 @@ export interface ObjectExplorerProps {
5
5
  /** Where to send the "back" link. Omit to hide it. */
6
6
  backHref?: string;
7
7
  backLabel?: string;
8
+ /**
9
+ * Set false to leave out the search box, for a host whose object endpoint
10
+ * does not support `search`. Without the box nothing sends the parameter, so
11
+ * a server that ignores it can no longer present an unsearched page as the
12
+ * answer to a search.
13
+ */
14
+ search?: boolean;
15
+ /**
16
+ * The most rows the host's server will count. A page whose `total` is at
17
+ * least this is shown as "10,000+ rows" rather than "10,000 rows", because a
18
+ * capped count is a lower bound and the exact figure reads as the real size.
19
+ * Omit when the server counts every row. A cap that is not a positive whole
20
+ * number is ignored, and the count is shown exactly.
21
+ */
22
+ rowCountCap?: number;
8
23
  }
9
24
  /**
10
25
  * A parameter asked for in the URL, wherever the host keeps it.
@@ -29,4 +44,4 @@ export interface ObjectExplorerProps {
29
44
  * object type is, and it should move the day a third concern needs it.
30
45
  */
31
46
  export declare function paramFromLocation(name: string): string | null;
32
- export declare function ObjectExplorer({ type: typeProp, pageSize, backHref, backLabel, }: ObjectExplorerProps): import("react").JSX.Element;
47
+ export declare function ObjectExplorer({ type: typeProp, pageSize, backHref, backLabel, search: searchable, rowCountCap, }: ObjectExplorerProps): import("react").JSX.Element;