@tristan2828/ui-foundation 4.75.0 → 4.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/conventions/docs/add-an-entity.md +20 -9
- package/conventions/docs/cell-patterns.md +81 -35
- package/conventions/docs/design-language.md +158 -26
- package/dist/components/app/data-table.d.ts +11 -1
- package/dist/components/app/data-table.js +16 -6
- package/dist/components/app/entity-view.d.ts +31 -1
- package/dist/components/app/entity-view.js +77 -10
- package/dist/components/app/markdown.d.ts +13 -1
- package/dist/components/app/markdown.js +44 -2
- package/dist/components/ui/table.d.ts +2 -1
- package/dist/components/ui/table.js +3 -3
- package/dist/components/ui/tabs.d.ts +10 -0
- package/dist/components/ui/tabs.js +28 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/lib/entity-view-tab.d.ts +2 -0
- package/dist/lib/entity-view-tab.js +11 -0
- package/dist/lib/markdown-inline.d.ts +10 -0
- package/dist/lib/markdown-inline.js +204 -0
- package/package.json +1 -1
- package/styles/index.css +120 -0
- package/styles/theme.css +391 -1
|
@@ -55,8 +55,24 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
55
55
|
// it for: notes, a checklist). The DOM is in that order at every width, so
|
|
56
56
|
// reading and tab order match the screen: beside each other, the columns'
|
|
57
57
|
// places come from the grid, not the DOM.
|
|
58
|
+
//
|
|
59
|
+
// Tabs (4.76, #303): a main section with a `tab` goes under a tab list at
|
|
60
|
+
// the top of the main column, one tab per distinct name in the order the
|
|
61
|
+
// sections first give it, and only the selected tab's sections show. The
|
|
62
|
+
// rest of the main column stays above the list, and the rail always shows.
|
|
63
|
+
// The selected tab is `?tab=<slug>` (the history entry replaced, its state
|
|
64
|
+
// kept, so a record over its list stays the dialog); the first tab is the
|
|
65
|
+
// bare address, and an unknown slug reads as the first. Every tab's
|
|
66
|
+
// sections stay mounted, hidden, so a field open in place survives a
|
|
67
|
+
// switch. With no `tab` on any section, nothing changes.
|
|
68
|
+
//
|
|
69
|
+
// `leading`, left of the title: the record's mark or avatar, with the
|
|
70
|
+
// title, subtitle and badges beside it at every width. `railFields`
|
|
71
|
+
// `beside` puts a rail field's label to the left of its value, as in an
|
|
72
|
+
// issue tracker's sidebar, stacked again where the rail's list is too
|
|
73
|
+
// narrow for both.
|
|
58
74
|
import { useEffect, useId, useState, useSyncExternalStore } from 'react';
|
|
59
|
-
import { Link } from 'react-router';
|
|
75
|
+
import { Link, useLocation, useNavigate } from 'react-router';
|
|
60
76
|
import { ArrowLeftIcon, SearchXIcon } from 'lucide-react';
|
|
61
77
|
import { cn } from 'cn';
|
|
62
78
|
import { ErrorState } from './error-state.js';
|
|
@@ -64,6 +80,7 @@ import { Button } from '../ui/button.js';
|
|
|
64
80
|
import { Card, CardContent, CardHeader } from '../ui/card.js';
|
|
65
81
|
import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, } from '../ui/empty.js';
|
|
66
82
|
import { Skeleton } from '../ui/skeleton.js';
|
|
83
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from '../ui/tabs.js';
|
|
67
84
|
import { useDocumentTitle } from '../../hooks/use-document-title.js';
|
|
68
85
|
import { PrintNotes } from './entity-view-print.js';
|
|
69
86
|
import { EditInPlaceContext } from './edit-in-place.js';
|
|
@@ -71,6 +88,7 @@ import { EditInPlaceStore } from './edit-in-place-store.js';
|
|
|
71
88
|
import { EditableList } from './editable-list.js';
|
|
72
89
|
import { EditableValue, LeaveGuard } from './editable-value.js';
|
|
73
90
|
import { useRecordDialog } from './record-dialog-context.js';
|
|
91
|
+
import { entityViewTabSlug } from '../../lib/entity-view-tab.js';
|
|
74
92
|
const DEFAULT_EMPTY_LABEL = 'Not set';
|
|
75
93
|
function isEmptyValue(value) {
|
|
76
94
|
return (value === null ||
|
|
@@ -90,18 +108,22 @@ function orEmptyLabel(value, emptyLabel) {
|
|
|
90
108
|
// the rail the list's own width decides instead (a container query on the
|
|
91
109
|
// <dl>): label above value in the narrow rail, beside it once the rail's
|
|
92
110
|
// sections stack full width under the header.
|
|
111
|
+
// `railFields="beside"` (4.76) puts them side by side in the rail too,
|
|
112
|
+
// from an 18rem list (a rail card beside the main column is ~19rem
|
|
113
|
+
// inside), with a narrower label column, and stacked below that.
|
|
93
114
|
const FIELD_ROW = {
|
|
94
115
|
page: 'sm:grid sm:grid-cols-[minmax(--spacing(32),--spacing(48))_1fr] sm:gap-6',
|
|
95
116
|
rail: '@lg/fields:grid @lg/fields:grid-cols-[minmax(--spacing(32),--spacing(48))_1fr] @lg/fields:gap-6',
|
|
117
|
+
railBeside: '@2xs/fields:grid @2xs/fields:grid-cols-[minmax(--spacing(24),--spacing(28))_minmax(0,1fr)] @2xs/fields:items-baseline @2xs/fields:gap-4 @2xs/fields:py-2.5 @lg/fields:grid-cols-[minmax(--spacing(32),--spacing(48))_1fr] @lg/fields:gap-6',
|
|
96
118
|
};
|
|
97
|
-
function FieldRow({ field,
|
|
119
|
+
function FieldRow({ field, place }) {
|
|
98
120
|
// A preset shows its own value unless the screen gives one.
|
|
99
121
|
const value = field.value !== undefined ? field.value : field.edit?.shown;
|
|
100
|
-
return (_jsxs("div", { className: cn('flex flex-col gap-1 py-3 first:pt-0 last:pb-0', FIELD_ROW[
|
|
122
|
+
return (_jsxs("div", { className: cn('flex flex-col gap-1 py-3 first:pt-0 last:pb-0', FIELD_ROW[place]), children: [_jsx("dt", { className: "type-label text-muted-foreground", children: field.label }), _jsx("dd", { className: "min-w-0 type-body break-words text-foreground", children: field.edit ? (_jsx(EditableValue, { label: field.label, edit: field.edit, children: orEmptyLabel(value, field.emptyLabel) })) : (orEmptyLabel(value, field.emptyLabel)) })] }));
|
|
101
123
|
}
|
|
102
|
-
function ViewSection({ section, inRail = false }) {
|
|
124
|
+
function ViewSection({ section, inRail = false, railFields = 'stacked', }) {
|
|
103
125
|
const headingId = useId();
|
|
104
|
-
return (_jsx("section", { "aria-labelledby": headingId, children: _jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx("h2", { id: headingId, className: "type-section-title text-foreground", children: section.title }) }), _jsx(CardContent, { children: 'fields' in section ? (_jsx("dl", { className: cn('flex flex-col divide-y divide-border', inRail && '@container/fields'), children: section.fields.map((field) => (_jsx(FieldRow, { field: field,
|
|
126
|
+
return (_jsx("section", { "aria-labelledby": headingId, children: _jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx("h2", { id: headingId, className: "type-section-title text-foreground", children: section.title }) }), _jsx(CardContent, { children: 'fields' in section ? (_jsx("dl", { className: cn('flex flex-col divide-y divide-border', inRail && '@container/fields'), children: section.fields.map((field) => (_jsx(FieldRow, { field: field, place: !inRail ? 'page' : railFields === 'beside' ? 'railBeside' : 'rail' }, field.label))) })) : section.edit?.kind === 'list' ? (_jsxs("div", { className: "flex min-w-0 flex-col gap-2 type-body break-words text-foreground", children: [!isEmptyValue(section.content) && section.content, _jsx(EditableList, { label: section.title, edit: section.edit, emptyLabel: section.emptyLabel ?? DEFAULT_EMPTY_LABEL })] })) : (_jsx("div", { className: "min-w-0 type-body break-words text-foreground", children: section.edit ? (_jsx(EditableValue, { label: section.title, edit: section.edit, children: orEmptyLabel(section.content, section.emptyLabel) })) : (orEmptyLabel(section.content, section.emptyLabel)) })) })] }) }));
|
|
105
127
|
}
|
|
106
128
|
// The rail layout's columns. The view is a container, so the switch to
|
|
107
129
|
// two columns follows the width the page actually has (the sidebar open
|
|
@@ -157,11 +179,48 @@ function useFitsWindow() {
|
|
|
157
179
|
}, [element]);
|
|
158
180
|
return [setElement, fits];
|
|
159
181
|
}
|
|
160
|
-
function Rail({ label, sections }) {
|
|
182
|
+
function Rail({ label, sections, fields, }) {
|
|
161
183
|
const [ref, fits] = useFitsWindow();
|
|
162
|
-
return (_jsx("aside", { ref: ref, "aria-label": label, "data-fits": fits ? '' : undefined, className: cn(RAIL_LAYOUT.rail, RAIL_LAYOUT.sticky, 'flex min-w-0 flex-col gap-6'), children: sections.map((section) => (_jsx(ViewSection, { section: section, inRail: true }, section.title))) }));
|
|
184
|
+
return (_jsx("aside", { ref: ref, "aria-label": label, "data-fits": fits ? '' : undefined, className: cn(RAIL_LAYOUT.rail, RAIL_LAYOUT.sticky, 'flex min-w-0 flex-col gap-6'), children: sections.map((section) => (_jsx(ViewSection, { section: section, inRail: true, railFields: fields }, section.title))) }));
|
|
185
|
+
}
|
|
186
|
+
const TAB_PARAM = 'tab';
|
|
187
|
+
// The main sections' tabs, in the order the sections first name them. Two
|
|
188
|
+
// names with one slug ("Notes", "notes") are one tab, under the first.
|
|
189
|
+
function tabsOf(sections) {
|
|
190
|
+
const tabs = [];
|
|
191
|
+
for (const section of sections) {
|
|
192
|
+
if (section.tab === undefined)
|
|
193
|
+
continue;
|
|
194
|
+
const slug = entityViewTabSlug(section.tab);
|
|
195
|
+
const tab = tabs.find((each) => each.slug === slug);
|
|
196
|
+
if (tab)
|
|
197
|
+
tab.sections.push(section);
|
|
198
|
+
else
|
|
199
|
+
tabs.push({ slug, name: section.tab, sections: [section] });
|
|
200
|
+
}
|
|
201
|
+
return tabs;
|
|
202
|
+
}
|
|
203
|
+
// The tab list, under the sections with no tab, and every tab's sections
|
|
204
|
+
// (hidden but mounted unless selected). The selected tab is the address's,
|
|
205
|
+
// changed in place: the entry replaced, its state kept (a record over its
|
|
206
|
+
// list stays the dialog), the scroll where it was.
|
|
207
|
+
function MainTabs({ tabs, label }) {
|
|
208
|
+
const location = useLocation();
|
|
209
|
+
const navigate = useNavigate();
|
|
210
|
+
const asked = new URLSearchParams(location.search).get(TAB_PARAM);
|
|
211
|
+
const selected = tabs.find((tab) => tab.slug === asked)?.slug ?? tabs[0].slug;
|
|
212
|
+
const select = (slug) => {
|
|
213
|
+
const params = new URLSearchParams(location.search);
|
|
214
|
+
if (slug === tabs[0].slug)
|
|
215
|
+
params.delete(TAB_PARAM);
|
|
216
|
+
else
|
|
217
|
+
params.set(TAB_PARAM, slug);
|
|
218
|
+
const search = params.toString();
|
|
219
|
+
void navigate({ pathname: location.pathname, search: search ? `?${search}` : '', hash: location.hash }, { replace: true, state: location.state, preventScrollReset: true });
|
|
220
|
+
};
|
|
221
|
+
return (_jsxs(Tabs, { value: selected, onValueChange: (value) => select(String(value)), "data-slot": "entity-view-tabs", className: "min-w-0 gap-6", children: [_jsx(TabsList, { variant: "line", activateOnFocus: true, "aria-label": label, className: "h-auto w-full max-w-full justify-start gap-1 overflow-x-auto overflow-y-hidden border-b border-border p-0 [scrollbar-width:thin]", children: tabs.map((tab) => (_jsx(TabsTrigger, { value: tab.slug, className: "h-9 flex-none px-3 text-muted-foreground group-data-horizontal/tabs:after:bottom-0 pointer-coarse:h-11 dark:text-muted-foreground", children: tab.name }, tab.slug))) }), tabs.map((tab) => (_jsx(TabsContent, { value: tab.slug, keepMounted: true, className: "flex min-w-0 flex-col gap-6 [font-size:inherit]", children: tab.sections.map((section) => (_jsx(ViewSection, { section: section }, section.title))) }, tab.slug)))] }));
|
|
163
222
|
}
|
|
164
|
-
export function EntityView({ title, documentTitle, titleEdit, subtitle, badges, actions, notice, strip, sections, footer, layout = 'column', mobileOrder = 'rail-first', railLabel, printLabel = 'Print notes', isLoading, error, onRetry, back, }) {
|
|
223
|
+
export function EntityView({ title, documentTitle, titleEdit, leading, subtitle, badges, actions, notice, strip, sections, footer, layout = 'column', mobileOrder = 'rail-first', railLabel, railFields = 'stacked', printLabel = 'Print notes', isLoading, error, onRetry, back, }) {
|
|
165
224
|
// Editing in place: one store per view, and the leave-page prompt only
|
|
166
225
|
// while a field is open (or one is always editable).
|
|
167
226
|
const [store] = useState(() => new EditInPlaceStore());
|
|
@@ -196,6 +255,14 @@ export function EntityView({ title, documentTitle, titleEdit, subtitle, badges,
|
|
|
196
255
|
const printButton = printSections.length > 0 && (_jsx(PrintNotes, { label: printLabel, title: title, subtitle: subtitle, sections: printSections }));
|
|
197
256
|
const railSections = sections.filter((section) => section.placement === 'rail');
|
|
198
257
|
const mainSections = sections.filter((section) => section.placement !== 'rail');
|
|
199
|
-
|
|
200
|
-
|
|
258
|
+
// Tabs: a main section's `tab` (a rail one's is ignored, in either layout).
|
|
259
|
+
const tabs = tabsOf(mainSections);
|
|
260
|
+
const tabbed = (section) => section.placement !== 'rail' && section.tab !== undefined;
|
|
261
|
+
const tabList = tabs.length > 0 && _jsx(MainTabs, { tabs: tabs, label: `${title ?? 'Record'} sections` });
|
|
262
|
+
const main = (_jsxs("div", { className: cn(RAIL_LAYOUT.main, railSections.length === 0 && RAIL_LAYOUT.mainAlone), children: [mainSections
|
|
263
|
+
.filter((section) => !tabbed(section))
|
|
264
|
+
.map((section) => (_jsx(ViewSection, { section: section }, section.title))), tabList] }));
|
|
265
|
+
return (_jsx(EditInPlaceContext.Provider, { value: store, children: _jsxs("div", { className: layout === 'rail' ? RAIL_LAYOUT.page : 'flex max-w-4xl flex-col gap-6', "data-state": "success", "data-layout": layout, children: [editing && _jsx(LeaveGuard, { store: store }), !dialog && _jsx(BackLink, { back: back }), _jsxs("header", { className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between", children: [_jsxs("div", { className: "flex min-w-0 flex-1 items-start gap-3 sm:min-w-64 sm:gap-4", children: [leading && (_jsx("div", { "data-slot": "entity-view-leading", className: "flex shrink-0 items-center", children: leading })), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [_jsx("h1", { id: dialog?.titleId, className: "type-page-title break-words text-foreground", children: titleEdit ? (_jsx(EditableValue, { label: titleEdit.label, edit: titleEdit, layout: "inline", className: "w-full", children: title })) : (title) }), subtitle && (_jsx("div", { "data-slot": "entity-view-subtitle", className: "type-body break-words text-muted-foreground", children: subtitle })), badges && _jsx("div", { className: "flex flex-wrap items-center gap-1.5", children: badges })] })] }), (actions || printButton) && (_jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2 sm:justify-end", children: [printButton, actions] }))] }), _jsx("div", { role: "status", "data-slot": "entity-view-notice", className: "empty:hidden", children: notice }), strip && _jsx("div", { "data-slot": "entity-view-strip", children: strip }), layout === 'rail' ? (_jsxs("div", { className: RAIL_LAYOUT.columns, children: [mobileOrder === 'main-first' && main, railSections.length > 0 && (_jsx(Rail, { label: railLabel ?? `${title ?? 'Record'} details`, sections: railSections, fields: railFields })), mobileOrder === 'rail-first' && main] })) : (_jsxs(_Fragment, { children: [sections
|
|
266
|
+
.filter((section) => !tabbed(section))
|
|
267
|
+
.map((section) => (_jsx(ViewSection, { section: section }, section.title))), tabList] })), footer && (_jsx("footer", { "data-slot": "entity-view-footer", className: "type-caption text-muted-foreground", children: footer }))] }) }));
|
|
201
268
|
}
|
|
@@ -62,6 +62,18 @@ export type MarkdownProps = {
|
|
|
62
62
|
* may nest to any depth: the package never asks whose page it is.
|
|
63
63
|
*/
|
|
64
64
|
pageLink?: PageLinkResolver;
|
|
65
|
+
/**
|
|
66
|
+
* For a one-line value (a table cell, a card's line, a summary): a
|
|
67
|
+
* `<span>` of one run of words, in the font and colour of wherever it
|
|
68
|
+
* sits, with no block margins, so a row it's in keeps its height. Bold,
|
|
69
|
+
* italic, code and links keep their marks; every other mark is its
|
|
70
|
+
* words. A list, table or other block written in it still reads: a
|
|
71
|
+
* list's items joined with " · ", a table's rows as `Header: value`
|
|
72
|
+
* pairs. A link's click and Enter never reach the row or card it sits
|
|
73
|
+
* in. The headings, folding, tasks, table and page-link props don't
|
|
74
|
+
* apply. Default `false`.
|
|
75
|
+
*/
|
|
76
|
+
inline?: boolean;
|
|
65
77
|
className?: string;
|
|
66
78
|
} & Omit<ComponentProps<'div'>, 'children'>;
|
|
67
|
-
export declare function Markdown({
|
|
79
|
+
export declare function Markdown({ inline, ...props }: MarkdownProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
// Long text written as Markdown, rendered to read: headings, lists, links,
|
|
3
3
|
// tables (GitHub-flavoured), code and quotes, in the design language's
|
|
4
4
|
// type roles and tokens. A record's notes on its view (EntityView) are the
|
|
@@ -62,6 +62,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
62
62
|
// the app reports removed shows "Page removed", with Restore when the app
|
|
63
63
|
// gives one. Every other link is as it was; the text is never changed.
|
|
64
64
|
//
|
|
65
|
+
// With `inline`, it's a one-line value's Markdown (a table cell, a card's
|
|
66
|
+
// line): bold, italic, code and links on one run of words, in the font and
|
|
67
|
+
// colour of wherever it sits, with no block margins, so a row it's in
|
|
68
|
+
// keeps its height. Blocks written in it become their words, joined so
|
|
69
|
+
// they still read (a list's items with " · ", a table's rows as
|
|
70
|
+
// `Header: value` pairs: src/lib/markdown-inline.ts). A link's click and
|
|
71
|
+
// Enter stay its own: they never reach a row or card it sits in.
|
|
72
|
+
//
|
|
65
73
|
// A task item (`- [ ] to do`, `- [x] done`) shows its box as a glyph
|
|
66
74
|
// with its state in words: read-only text has nothing to tick. With
|
|
67
75
|
// `onTasksChange`, each box is a real checkbox, named for its item's
|
|
@@ -77,6 +85,7 @@ import { Checkbox } from '../ui/checkbox.js';
|
|
|
77
85
|
import { useFolds } from '../../hooks/fold-store.js';
|
|
78
86
|
import { CALLOUT_KINDS, remarkCallouts } from '../../lib/markdown-callout.js';
|
|
79
87
|
import { rehypeFold, toggleFold } from '../../lib/markdown-fold.js';
|
|
88
|
+
import { rehypeInline } from '../../lib/markdown-inline.js';
|
|
80
89
|
import { isHighlightColor, remarkHighlights } from '../../lib/markdown-highlight.js';
|
|
81
90
|
import { rehypeTables } from '../../lib/markdown-table.js';
|
|
82
91
|
import { remarkToggleHeadings } from '../../lib/markdown-toggle.js';
|
|
@@ -177,6 +186,29 @@ function MarkdownParagraph(props) {
|
|
|
177
186
|
return _jsx("p", { ...rest, "data-page-line": "", className: "page-line" });
|
|
178
187
|
return _jsx("p", { ...rest });
|
|
179
188
|
}
|
|
189
|
+
// A link in `inline` text: an ordinary link, opening in a new tab, whose
|
|
190
|
+
// click and Enter never reach what the text sits in (a row that opens
|
|
191
|
+
// its record, a card), so following it doesn't also open the row.
|
|
192
|
+
function InlineLink(props) {
|
|
193
|
+
const { href, children, ...rest } = omitNode(props);
|
|
194
|
+
if (!href)
|
|
195
|
+
return _jsx(_Fragment, { children: children });
|
|
196
|
+
return (_jsxs("a", { ...rest, href: href, target: "_blank", rel: "noreferrer", className: PROSE.link, onClick: (event) => event.stopPropagation(), onKeyDown: (event) => {
|
|
197
|
+
if (event.key === 'Enter' || event.key === ' ')
|
|
198
|
+
event.stopPropagation();
|
|
199
|
+
}, children: [children, _jsx(ExternalLinkIcon, { "aria-hidden": "true", className: "ml-0.5 inline size-3 align-baseline" }), _jsx("span", { className: "sr-only", children: " (opens in a new tab)" })] }));
|
|
200
|
+
}
|
|
201
|
+
// `inline`: only what `rehypeInline` keeps, in the text's own font and colour.
|
|
202
|
+
// Code is the mono face alone, no wash: in the cell's own colour a wash
|
|
203
|
+
// would fail contrast (muted text on --muted is 4.34:1), and a row's own
|
|
204
|
+
// fill (the stripe, a hover, a pick) is already behind it. The face has
|
|
205
|
+
// taller metrics than the text's, so it adds no height to the line
|
|
206
|
+
// (`leading-[0]`).
|
|
207
|
+
const INLINE_COMPONENTS = {
|
|
208
|
+
a: InlineLink,
|
|
209
|
+
code: (props) => _jsx("code", { ...omitNode(props), className: "font-mono text-[0.9em] leading-[0]" }),
|
|
210
|
+
};
|
|
211
|
+
const INLINE_REHYPE = [rehypeInline];
|
|
180
212
|
// Folds a section by its heading's id: given only with `foldKey`.
|
|
181
213
|
const FoldContext = createContext(null);
|
|
182
214
|
// A heading by its Markdown level: the element the page's outline gives
|
|
@@ -273,7 +305,17 @@ function componentsFor(top, textTop) {
|
|
|
273
305
|
}
|
|
274
306
|
return components;
|
|
275
307
|
}
|
|
276
|
-
|
|
308
|
+
const BLOCK_ONLY = ['headingLevel', 'headingFrom', 'foldKey', 'foldable', 'onTasksChange', 'tableLook', 'pageLink'];
|
|
309
|
+
export function Markdown({ inline = false, ...props }) {
|
|
310
|
+
if (!inline)
|
|
311
|
+
return _jsx(BlockMarkdown, { ...props });
|
|
312
|
+
const { children, className, ...rest } = props;
|
|
313
|
+
// The block text's own props mean nothing on one line: none reach the span.
|
|
314
|
+
for (const key of BLOCK_ONLY)
|
|
315
|
+
delete rest[key];
|
|
316
|
+
return (_jsx("span", { "data-slot": "markdown", "data-inline": "", ...rest, className: cn('min-w-0 break-words', className), children: _jsx(ReactMarkdown, { remarkPlugins: REMARK_PLUGINS, rehypePlugins: INLINE_REHYPE, components: INLINE_COMPONENTS, children: children }) }));
|
|
317
|
+
}
|
|
318
|
+
function BlockMarkdown({ children, headingLevel = DEFAULT_HEADING_LEVEL, headingFrom = 'hash', foldKey: foldKeyProp, foldable = true, onTasksChange: onTasksChangeProp, tableLook = 'compact', pageLink, className, ...rest }) {
|
|
277
319
|
// On paper (EntityView's Print notes): every heading plain and open,
|
|
278
320
|
// every task box a picture.
|
|
279
321
|
const printing = usePrinting();
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare function Table({ className, containerRef, containerClassName, ...props }: React.ComponentProps<"table"> & {
|
|
2
|
+
declare function Table({ className, containerRef, containerClassName, containerStyle, ...props }: React.ComponentProps<"table"> & {
|
|
3
3
|
containerRef?: React.Ref<HTMLDivElement>;
|
|
4
4
|
containerClassName?: string;
|
|
5
|
+
containerStyle?: React.CSSProperties;
|
|
5
6
|
}): React.JSX.Element;
|
|
6
7
|
declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): React.JSX.Element;
|
|
7
8
|
declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { cn } from "cn";
|
|
4
|
-
// `containerRef`/`containerClassName` are this repo's patch to the upstream
|
|
4
|
+
// `containerRef`/`containerClassName`/`containerStyle` are this repo's patch to the upstream
|
|
5
5
|
// primitive. Upstream wraps the <table> in a scroll container that nothing
|
|
6
6
|
// outside can reach, so anything keyed to the scroll viewport — a sticky
|
|
7
7
|
// scrollbar, a pinned column, an IntersectionObserver — had to find that
|
|
@@ -11,8 +11,8 @@ import { cn } from "cn";
|
|
|
11
11
|
//
|
|
12
12
|
// A local patch to a shadcn primitive: re-running `shadcn add table` here
|
|
13
13
|
// would overwrite it. Diff against upstream before taking a new version.
|
|
14
|
-
function Table({ className, containerRef, containerClassName, ...props }) {
|
|
15
|
-
return (_jsx("div", { ref: containerRef, "data-slot": "table-container", className: cn("relative w-full overflow-x-auto", containerClassName), children: _jsx("table", { "data-slot": "table", className: cn("w-full caption-bottom text-sm", className), ...props }) }));
|
|
14
|
+
function Table({ className, containerRef, containerClassName, containerStyle, ...props }) {
|
|
15
|
+
return (_jsx("div", { ref: containerRef, "data-slot": "table-container", className: cn("relative w-full overflow-x-auto", containerClassName), style: containerStyle, children: _jsx("table", { "data-slot": "table", className: cn("w-full caption-bottom text-sm", className), ...props }) }));
|
|
16
16
|
}
|
|
17
17
|
function TableHeader({ className, ...props }) {
|
|
18
18
|
return (_jsx("thead", { "data-slot": "table-header", className: cn("[&_tr]:border-b", className), ...props }));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare function Tabs({ className, orientation, ...props }: TabsPrimitive.Root.Props): import("react").JSX.Element;
|
|
4
|
+
declare const tabsListVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "line" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function TabsList({ className, variant, ...props }: TabsPrimitive.List.Props & VariantProps<typeof tabsListVariants>): import("react").JSX.Element;
|
|
8
|
+
declare function TabsTrigger({ className, ...props }: TabsPrimitive.Tab.Props): import("react").JSX.Element;
|
|
9
|
+
declare function TabsContent({ className, ...props }: TabsPrimitive.Panel.Props): import("react").JSX.Element;
|
|
10
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
function Tabs({ className, orientation = "horizontal", ...props }) {
|
|
6
|
+
return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", "data-orientation": orientation, className: cn("group/tabs flex gap-2 data-horizontal:flex-col", className), ...props }));
|
|
7
|
+
}
|
|
8
|
+
const tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none", {
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-muted",
|
|
12
|
+
line: "gap-1 bg-transparent",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
variant: "default",
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
function TabsList({ className, variant = "default", ...props }) {
|
|
20
|
+
return (_jsx(TabsPrimitive.List, { "data-slot": "tabs-list", "data-variant": variant, className: cn(tabsListVariants({ variant }), className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function TabsTrigger({ className, ...props }) {
|
|
23
|
+
return (_jsx(TabsPrimitive.Tab, { "data-slot": "tabs-trigger", className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent", "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100", className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
function TabsContent({ className, ...props }) {
|
|
26
|
+
return (_jsx(TabsPrimitive.Panel, { "data-slot": "tabs-content", className: cn("flex-1 text-sm outline-none", className), ...props }));
|
|
27
|
+
}
|
|
28
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,8 @@ export { type RowGroup } from './components/app/table-groups.js';
|
|
|
14
14
|
export { byDay, type ByDayOptions } from './lib/group-by-day.js';
|
|
15
15
|
export { EntityForm, type EntityFormProps } from './components/app/entity-form.js';
|
|
16
16
|
export { KeyStats, type KeyStat, type KeyStatsProps } from './components/app/key-stats.js';
|
|
17
|
-
export { EntityView, type EntityViewField, type EntityViewLayout, type EntityViewMobileOrder, type EntityViewPlacement, type EntityViewProps, type EntityViewSection, } from './components/app/entity-view.js';
|
|
17
|
+
export { EntityView, type EntityViewField, type EntityViewLayout, type EntityViewMobileOrder, type EntityViewPlacement, type EntityViewProps, type EntityViewRailFields, type EntityViewSection, } from './components/app/entity-view.js';
|
|
18
|
+
export { entityViewTabSlug } from './lib/entity-view-tab.js';
|
|
18
19
|
export { usePrinting } from './components/app/print-context.js';
|
|
19
20
|
export { RecordDialogRoute, RecordLink, type RecordDialogRouteProps, type RecordLinkProps, } from './components/app/record-dialog.js';
|
|
20
21
|
export { recordDialogState, useOpenRecord, useRecordDialog, type RecordDialogBackground, type RecordDialogContextValue, type RecordDialogState, } from './components/app/record-dialog-context.js';
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export { byDay } from './lib/group-by-day.js';
|
|
|
19
19
|
export { EntityForm } from './components/app/entity-form.js';
|
|
20
20
|
export { KeyStats } from './components/app/key-stats.js';
|
|
21
21
|
export { EntityView, } from './components/app/entity-view.js';
|
|
22
|
+
export { entityViewTabSlug } from './lib/entity-view-tab.js';
|
|
22
23
|
export { usePrinting } from './components/app/print-context.js';
|
|
23
24
|
export { RecordDialogRoute, RecordLink, } from './components/app/record-dialog.js';
|
|
24
25
|
export { recordDialogState, useOpenRecord, useRecordDialog, } from './components/app/record-dialog-context.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// EntityView's tabs (4.76, #303): the selected tab is `?tab=<slug>`, so a
|
|
2
|
+
// screen can link straight to one (`/things/3?tab=${entityViewTabSlug('Used in')}`).
|
|
3
|
+
/** A tab's name as it reads in the address: "Used in" is `used-in`. */
|
|
4
|
+
export function entityViewTabSlug(name) {
|
|
5
|
+
return (name
|
|
6
|
+
.normalize('NFKD')
|
|
7
|
+
.replace(/[\u0300-\u036f]/g, '')
|
|
8
|
+
.toLowerCase()
|
|
9
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
10
|
+
.replace(/^-+|-+$/g, '') || 'tab');
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type Node = {
|
|
2
|
+
type: string;
|
|
3
|
+
tagName?: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
properties?: Record<string, unknown>;
|
|
6
|
+
children?: Node[];
|
|
7
|
+
};
|
|
8
|
+
/** Flattens the whole text to one line of inline content (see above). */
|
|
9
|
+
export declare function rehypeInline(): (tree: Node) => void;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
// <Markdown inline>: a one-line value's Markdown (a table cell, a card's
|
|
2
|
+
// line, a summary) as one run of words, so it sits in a row without
|
|
3
|
+
// making it taller. Bold, italic, code and links keep their marks; every
|
|
4
|
+
// other mark is its words. Blocks have nowhere to go on one line, so each
|
|
5
|
+
// becomes its words, in order, joined so they still read:
|
|
6
|
+
//
|
|
7
|
+
// - paragraphs (and lines): a space
|
|
8
|
+
// - headings, quotes, rules and any other block: " · "
|
|
9
|
+
// - a list: its items, " · " between them; numbered with their numbers
|
|
10
|
+
// (`1. a · 2. b`); a task item done starts "✓ ", one to do "☐ "
|
|
11
|
+
// - a table: each row as `Header: value` pairs, ", " between them and
|
|
12
|
+
// " · " between rows (the header row itself isn't repeated); cells
|
|
13
|
+
// with no header, or no words, are left out
|
|
14
|
+
// - a code block: inline code
|
|
15
|
+
// - an image: its alt text, if any
|
|
16
|
+
// - a callout: its kind first ("Note: …")
|
|
17
|
+
//
|
|
18
|
+
// The text itself is never changed: this is how it's drawn on one line.
|
|
19
|
+
// A rehype plugin, on the HTML tree after remark-gfm and the package's
|
|
20
|
+
// own remark plugins, so what it flattens is what <Markdown> would draw.
|
|
21
|
+
const KEEP = new Set(['strong', 'em', 'code', 'a']);
|
|
22
|
+
const SEPARATOR = ' · ';
|
|
23
|
+
const text = (value) => ({ type: 'text', value });
|
|
24
|
+
// A node's words alone, marks dropped (a table cell's header, an alt).
|
|
25
|
+
function plain(node) {
|
|
26
|
+
if (node.type === 'text' || node.type === 'raw')
|
|
27
|
+
return node.value ?? '';
|
|
28
|
+
if (node.tagName === 'img')
|
|
29
|
+
return typeof node.properties?.alt === 'string' ? node.properties.alt : '';
|
|
30
|
+
return (node.children ?? []).map(plain).join('');
|
|
31
|
+
}
|
|
32
|
+
const hasWords = (nodes) => nodes.some((node) => plain(node).trim() !== '');
|
|
33
|
+
// Parts joined with a separator, leaving out the empty ones.
|
|
34
|
+
function join(parts, separator) {
|
|
35
|
+
const out = [];
|
|
36
|
+
for (const part of parts.filter(hasWords)) {
|
|
37
|
+
if (out.length > 0)
|
|
38
|
+
out.push(text(separator));
|
|
39
|
+
out.push(...part);
|
|
40
|
+
}
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
const capitalise = (word) => word.charAt(0).toUpperCase() + word.slice(1);
|
|
44
|
+
function rows(table) {
|
|
45
|
+
const out = [];
|
|
46
|
+
const walk = (node) => {
|
|
47
|
+
for (const child of node.children ?? []) {
|
|
48
|
+
if (child.tagName === 'tr')
|
|
49
|
+
out.push((child.children ?? []).filter((cell) => cell.tagName === 'td' || cell.tagName === 'th'));
|
|
50
|
+
else
|
|
51
|
+
walk(child);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
walk(table);
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
function flattenTable(table) {
|
|
58
|
+
const head = table.children?.find((child) => child.tagName === 'thead');
|
|
59
|
+
const all = rows(table);
|
|
60
|
+
const headers = head ? rows(head)[0]?.map((cell) => plain(cell).trim()) ?? [] : [];
|
|
61
|
+
const body = head ? all.slice(1) : all;
|
|
62
|
+
return join(body.map((cells) => join(cells.map((cell, index) => {
|
|
63
|
+
const words = inline(cell.children ?? []);
|
|
64
|
+
if (!hasWords(words))
|
|
65
|
+
return [];
|
|
66
|
+
return headers[index] ? [text(`${headers[index]}: `), ...words] : words;
|
|
67
|
+
}), ', ')), SEPARATOR);
|
|
68
|
+
}
|
|
69
|
+
function flattenList(list) {
|
|
70
|
+
const start = Number(list.properties?.start ?? 1) || 1;
|
|
71
|
+
const items = (list.children ?? []).filter((child) => child.tagName === 'li');
|
|
72
|
+
return join(items.map((item, index) => {
|
|
73
|
+
const box = findBox(item);
|
|
74
|
+
const lead = box ? (box.properties?.checked ? '✓ ' : '☐ ') : list.tagName === 'ol' ? `${start + index}. ` : '';
|
|
75
|
+
const words = blocks(item.children ?? []);
|
|
76
|
+
return hasWords(words) ? [text(lead), ...words] : [];
|
|
77
|
+
}), SEPARATOR);
|
|
78
|
+
}
|
|
79
|
+
// A task item's box: GFM puts it first in the item, or in its first paragraph.
|
|
80
|
+
function findBox(item) {
|
|
81
|
+
const first = item.children?.find((child) => child.type === 'element');
|
|
82
|
+
if (first?.tagName === 'input')
|
|
83
|
+
return first;
|
|
84
|
+
if (first?.tagName === 'p')
|
|
85
|
+
return first.children?.find((child) => child.tagName === 'input');
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
// Inline content: the four kept marks stay (their own content flattened),
|
|
89
|
+
// anything else is its words.
|
|
90
|
+
function inline(nodes) {
|
|
91
|
+
const out = [];
|
|
92
|
+
for (const node of nodes) {
|
|
93
|
+
// Raw HTML stays its characters, as <Markdown> shows it everywhere.
|
|
94
|
+
if (node.type === 'text' || node.type === 'raw')
|
|
95
|
+
out.push(text((node.value ?? '').replace(/\s*\n\s*/g, ' ')));
|
|
96
|
+
else if (node.type !== 'element')
|
|
97
|
+
continue;
|
|
98
|
+
else if (node.tagName === 'br')
|
|
99
|
+
out.push(text(' '));
|
|
100
|
+
else if (node.tagName === 'input')
|
|
101
|
+
continue;
|
|
102
|
+
else if (node.tagName === 'img') {
|
|
103
|
+
const alt = plain(node);
|
|
104
|
+
if (alt)
|
|
105
|
+
out.push(text(alt));
|
|
106
|
+
}
|
|
107
|
+
else if (KEEP.has(node.tagName ?? ''))
|
|
108
|
+
out.push({ ...node, children: node.tagName === 'code' ? [text(plain(node))] : inline(node.children ?? []) });
|
|
109
|
+
else if (isBlock(node))
|
|
110
|
+
out.push(...blocks([node]));
|
|
111
|
+
else
|
|
112
|
+
out.push(...inline(node.children ?? []));
|
|
113
|
+
}
|
|
114
|
+
return out;
|
|
115
|
+
}
|
|
116
|
+
const BLOCKS = new Set(['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'li', 'table', 'blockquote', 'pre', 'hr', 'div', 'section']);
|
|
117
|
+
const isBlock = (node) => node.type === 'element' && BLOCKS.has(node.tagName ?? '');
|
|
118
|
+
// One block's words.
|
|
119
|
+
function block(node) {
|
|
120
|
+
switch (node.tagName) {
|
|
121
|
+
case 'ul':
|
|
122
|
+
case 'ol':
|
|
123
|
+
return flattenList(node);
|
|
124
|
+
case 'table':
|
|
125
|
+
return flattenTable(node);
|
|
126
|
+
case 'hr':
|
|
127
|
+
return [];
|
|
128
|
+
case 'pre': {
|
|
129
|
+
const code = node.children?.find((child) => child.tagName === 'code');
|
|
130
|
+
const words = plain(code ?? node).trim().replace(/\s*\n\s*/g, ' ');
|
|
131
|
+
return words ? [{ type: 'element', tagName: 'code', properties: {}, children: [text(words)] }] : [];
|
|
132
|
+
}
|
|
133
|
+
case 'div': {
|
|
134
|
+
const kind = node.properties?.dataCallout;
|
|
135
|
+
const words = blocks(node.children ?? []);
|
|
136
|
+
return typeof kind === 'string' && hasWords(words) ? [text(`${capitalise(kind)}: `), ...words] : words;
|
|
137
|
+
}
|
|
138
|
+
case 'p':
|
|
139
|
+
case 'h1':
|
|
140
|
+
case 'h2':
|
|
141
|
+
case 'h3':
|
|
142
|
+
case 'h4':
|
|
143
|
+
case 'h5':
|
|
144
|
+
case 'h6':
|
|
145
|
+
return inline(node.children ?? []);
|
|
146
|
+
default:
|
|
147
|
+
return blocks(node.children ?? []);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
// A run of siblings, some blocks and some inline: inline stretches stay
|
|
151
|
+
// as they are, blocks join with a space after a paragraph into another,
|
|
152
|
+
// else " · ".
|
|
153
|
+
function blocks(nodes) {
|
|
154
|
+
const out = [];
|
|
155
|
+
let previous = null;
|
|
156
|
+
let run = [];
|
|
157
|
+
const flush = () => {
|
|
158
|
+
if (!hasWords(run))
|
|
159
|
+
return (run = []);
|
|
160
|
+
if (previous !== null)
|
|
161
|
+
out.push(text(SEPARATOR));
|
|
162
|
+
out.push(...trim(run));
|
|
163
|
+
previous = 'inline';
|
|
164
|
+
run = [];
|
|
165
|
+
};
|
|
166
|
+
for (const node of nodes) {
|
|
167
|
+
if (!isBlock(node)) {
|
|
168
|
+
if (node.type === 'text' && !(node.value ?? '').trim() && run.length === 0)
|
|
169
|
+
continue;
|
|
170
|
+
run.push(...inline([node]));
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
flush();
|
|
174
|
+
const words = block(node);
|
|
175
|
+
// A rule has no words, but the blocks either side of it are apart.
|
|
176
|
+
if (!hasWords(words)) {
|
|
177
|
+
if (previous !== null)
|
|
178
|
+
previous = node.tagName ?? 'block';
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
if (previous !== null)
|
|
182
|
+
out.push(text(previous === 'p' && node.tagName === 'p' ? ' ' : SEPARATOR));
|
|
183
|
+
out.push(...words);
|
|
184
|
+
previous = node.tagName ?? 'block';
|
|
185
|
+
}
|
|
186
|
+
flush();
|
|
187
|
+
return trim(out);
|
|
188
|
+
}
|
|
189
|
+
// No space at either end of the line.
|
|
190
|
+
function trim(nodes) {
|
|
191
|
+
const out = [...nodes];
|
|
192
|
+
if (out[0]?.type === 'text')
|
|
193
|
+
out[0] = text((out[0].value ?? '').trimStart());
|
|
194
|
+
const last = out.length - 1;
|
|
195
|
+
if (out[last]?.type === 'text')
|
|
196
|
+
out[last] = text((out[last].value ?? '').trimEnd());
|
|
197
|
+
return out;
|
|
198
|
+
}
|
|
199
|
+
/** Flattens the whole text to one line of inline content (see above). */
|
|
200
|
+
export function rehypeInline() {
|
|
201
|
+
return (tree) => {
|
|
202
|
+
tree.children = blocks(tree.children ?? []);
|
|
203
|
+
};
|
|
204
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tristan2828/ui-foundation",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.77.0",
|
|
4
4
|
"description": "Shared UI foundation for contract-first, database-backed React apps: shadcn primitives, DataTable/EntityForm composites, auth, the gateway error seam, design tokens, lint rules and the AI playbook.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|