@asteby/metacore-runtime-react 20.1.1 → 20.1.3
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/CHANGELOG.md +27 -0
- package/dist/dynamic-kanban.js +2 -2
- package/dist/dynamic-table.d.ts.map +1 -1
- package/dist/dynamic-table.js +14 -0
- package/package.json +3 -3
- package/src/dynamic-kanban.tsx +4 -4
- package/src/dynamic-table.tsx +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @asteby/metacore-runtime-react
|
|
2
2
|
|
|
3
|
+
## 20.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8c6635c: fix(dynamic-table): preserve `view`/`group_by` in the URL when the table syncs its state
|
|
8
|
+
|
|
9
|
+
The table's url-sync rebuilt the query string from scratch (only its own
|
|
10
|
+
page/sort/filter keys) and `replaceState`d it, wiping the route-owned
|
|
11
|
+
`view`/`group_by` params. On a same-model board↔list pair (e.g. github's Board
|
|
12
|
+
`?view=kanban` vs Issues `?view=table`) this stripped `?view` on mount, so the
|
|
13
|
+
URL went bare and the sidebar active-state fell back to the model default —
|
|
14
|
+
highlighting the wrong sibling until you clicked again. The sync now carries
|
|
15
|
+
`view`/`group_by` through so the open entry stays highlighted on a single click
|
|
16
|
+
and `?view` deep-links survive table interaction.
|
|
17
|
+
|
|
18
|
+
## 20.1.2
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 3d0a624: fix(kanban): wrap long card field values to 2 lines + ellipsis instead of a 1-line hard cut
|
|
23
|
+
|
|
24
|
+
Kanban card fields rendered each value on a single `truncate` line, so a long
|
|
25
|
+
text field — e.g. a github Issue whose title lands in a _field_ because the first
|
|
26
|
+
text column (`repo`) is picked as the card title — was hard-cut mid-line and lost
|
|
27
|
+
most of its content. Field values now `line-clamp-2 break-words`, so they grow to
|
|
28
|
+
two lines and then ellipsis cleanly, matching the title's treatment.
|
|
29
|
+
|
|
3
30
|
## 20.1.1
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/dist/dynamic-kanban.js
CHANGED
|
@@ -338,9 +338,9 @@ function KanbanCard({ card, titleCol, fieldCols, actions, locale, timeZone, curr
|
|
|
338
338
|
onPointerDown: (e) => e.stopPropagation(), onClick: (e) => e.stopPropagation(), children: _jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }), _jsx(DropdownMenuContent, { align: "end", onClick: (e) => e.stopPropagation(), children: visibleActions.map((a) => (_jsxs(DropdownMenuItem, { onClick: (e) => {
|
|
339
339
|
e.stopPropagation();
|
|
340
340
|
onAction(a, card);
|
|
341
|
-
}, children: [_jsx(DynamicIcon, { name: a.icon || 'Zap', className: "mr-2 h-4 w-4" }), a.label] }, a.key))) })] }))] }), fieldCols.map((col) => (_jsxs("div", { className: "flex min-w-0 items-
|
|
341
|
+
}, children: [_jsx(DynamicIcon, { name: a.icon || 'Zap', className: "mr-2 h-4 w-4" }), a.label] }, a.key))) })] }))] }), fieldCols.map((col) => (_jsxs("div", { className: "flex min-w-0 items-start gap-1.5 text-xs text-muted-foreground", children: [_jsxs("span", { className: "shrink-0 opacity-70", children: [col.label, ":"] }), _jsx("span", { className: "line-clamp-2 min-w-0 break-words", children: _jsx(ActivityValueRenderer, { value: card[col.key], col: col, locale: locale, timeZone: timeZone, currency: currency }) })] }, col.key)))] }) }));
|
|
342
342
|
}
|
|
343
343
|
// Static preview rendered inside the DragOverlay (no dnd hooks, no menu).
|
|
344
344
|
function CardPreview({ card, titleCol, fieldCols, locale, timeZone, currency, }) {
|
|
345
|
-
return (_jsx(Card, { className: "w-72 cursor-grabbing border-primary/40 shadow-lg", children: _jsxs(CardContent, { className: "space-y-1.5 p-3", children: [_jsx("div", { className: "line-clamp-2 break-words text-sm font-medium leading-snug", children: titleCol ? (_jsx(ActivityValueRenderer, { value: card[titleCol.key], col: titleCol, locale: locale, timeZone: timeZone, currency: currency })) : (String(card.id)) }), fieldCols.map((col) => (_jsxs("div", { className: "flex min-w-0 items-
|
|
345
|
+
return (_jsx(Card, { className: "w-72 cursor-grabbing border-primary/40 shadow-lg", children: _jsxs(CardContent, { className: "space-y-1.5 p-3", children: [_jsx("div", { className: "line-clamp-2 break-words text-sm font-medium leading-snug", children: titleCol ? (_jsx(ActivityValueRenderer, { value: card[titleCol.key], col: titleCol, locale: locale, timeZone: timeZone, currency: currency })) : (String(card.id)) }), fieldCols.map((col) => (_jsxs("div", { className: "flex min-w-0 items-start gap-1.5 text-xs text-muted-foreground", children: [_jsxs("span", { className: "shrink-0 opacity-70", children: [col.label, ":"] }), _jsx("span", { className: "line-clamp-2 min-w-0 break-words", children: _jsx(ActivityValueRenderer, { value: card[col.key], col: col, locale: locale, timeZone: timeZone, currency: currency }) })] }, col.key)))] }) }));
|
|
346
346
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-table.d.ts","sourceRoot":"","sources":["../src/dynamic-table.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAKH,KAAK,SAAS,EAajB,MAAM,uBAAuB,CAAA;AAgC9B,OAAO,KAAK,EAAsB,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAWnF,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;IAC7C;;;;;OAKG;IACH,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;IAC/B,cAAc,CAAC,EAAE,GAAG,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpC,YAAY,CA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AAA;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,wBAAgB,YAAY,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,aAAoB,EACpB,aAAkB,EAClB,QAAQ,EACR,UAAU,EACV,cAAc,EACd,cAAc,EACd,YAAiB,EACjB,iBAA4C,EAC5C,QAAQ,EACR,QAAQ,GACX,EAAE,iBAAiB,+BAw5BnB"}
|
package/dist/dynamic-table.js
CHANGED
|
@@ -147,6 +147,20 @@ export function DynamicTable({ model, endpoint, enableUrlSync = true, hiddenColu
|
|
|
147
147
|
if (!enableUrlSync || !initializedFromUrl.current)
|
|
148
148
|
return;
|
|
149
149
|
const params = new URLSearchParams();
|
|
150
|
+
// Preserve the route-owned view params. The table rebuilds the query
|
|
151
|
+
// string from scratch (it only knows its own page/sort/filter keys), but
|
|
152
|
+
// `view`/`group_by` belong to the renderer choice + the sidebar's
|
|
153
|
+
// active-state matcher. Carrying them over keeps `?view=table` (vs
|
|
154
|
+
// `?view=kanban`) in the URL so the open sibling stays highlighted and a
|
|
155
|
+
// deep-link survives — without this the table wipes `?view` on mount,
|
|
156
|
+
// the URL goes bare, and the sidebar falls back to the model default
|
|
157
|
+
// (the "click twice to move the active to the right entry" bug).
|
|
158
|
+
const current = new URLSearchParams(window.location.search);
|
|
159
|
+
for (const key of ['view', 'group_by']) {
|
|
160
|
+
const v = current.get(key);
|
|
161
|
+
if (v)
|
|
162
|
+
params.set(key, v);
|
|
163
|
+
}
|
|
150
164
|
if (pagination.pageIndex > 0)
|
|
151
165
|
params.set('page', String(pagination.pageIndex + 1));
|
|
152
166
|
if (pagination.pageSize !== 10)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asteby/metacore-runtime-react",
|
|
3
|
-
"version": "20.1.
|
|
3
|
+
"version": "20.1.3",
|
|
4
4
|
"description": "React runtime for metacore hosts — renders addon contributions dynamically",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"sonner": ">=1.7",
|
|
39
39
|
"zustand": ">=5",
|
|
40
40
|
"@asteby/metacore-sdk": "^3.2.0",
|
|
41
|
-
"@asteby/metacore-ui": "^2.6.
|
|
41
|
+
"@asteby/metacore-ui": "^2.6.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"@tanstack/react-router": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"vitest": "^4.0.0",
|
|
69
69
|
"zustand": "^5.0.0",
|
|
70
70
|
"@asteby/metacore-sdk": "3.2.0",
|
|
71
|
-
"@asteby/metacore-ui": "2.6.
|
|
71
|
+
"@asteby/metacore-ui": "2.6.2"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|
|
74
74
|
"build": "tsc -p tsconfig.json",
|
package/src/dynamic-kanban.tsx
CHANGED
|
@@ -705,10 +705,10 @@ function KanbanCard({
|
|
|
705
705
|
{fieldCols.map((col) => (
|
|
706
706
|
<div
|
|
707
707
|
key={col.key}
|
|
708
|
-
className="flex min-w-0 items-
|
|
708
|
+
className="flex min-w-0 items-start gap-1.5 text-xs text-muted-foreground"
|
|
709
709
|
>
|
|
710
710
|
<span className="shrink-0 opacity-70">{col.label}:</span>
|
|
711
|
-
<span className="min-w-0
|
|
711
|
+
<span className="line-clamp-2 min-w-0 break-words">
|
|
712
712
|
<ActivityValueRenderer
|
|
713
713
|
value={card[col.key]}
|
|
714
714
|
col={col}
|
|
@@ -752,10 +752,10 @@ function CardPreview({
|
|
|
752
752
|
{fieldCols.map((col) => (
|
|
753
753
|
<div
|
|
754
754
|
key={col.key}
|
|
755
|
-
className="flex min-w-0 items-
|
|
755
|
+
className="flex min-w-0 items-start gap-1.5 text-xs text-muted-foreground"
|
|
756
756
|
>
|
|
757
757
|
<span className="shrink-0 opacity-70">{col.label}:</span>
|
|
758
|
-
<span className="min-w-0
|
|
758
|
+
<span className="line-clamp-2 min-w-0 break-words">
|
|
759
759
|
<ActivityValueRenderer
|
|
760
760
|
value={card[col.key]}
|
|
761
761
|
col={col}
|
package/src/dynamic-table.tsx
CHANGED
|
@@ -257,6 +257,19 @@ export function DynamicTable({
|
|
|
257
257
|
useEffect(() => {
|
|
258
258
|
if (!enableUrlSync || !initializedFromUrl.current) return
|
|
259
259
|
const params = new URLSearchParams()
|
|
260
|
+
// Preserve the route-owned view params. The table rebuilds the query
|
|
261
|
+
// string from scratch (it only knows its own page/sort/filter keys), but
|
|
262
|
+
// `view`/`group_by` belong to the renderer choice + the sidebar's
|
|
263
|
+
// active-state matcher. Carrying them over keeps `?view=table` (vs
|
|
264
|
+
// `?view=kanban`) in the URL so the open sibling stays highlighted and a
|
|
265
|
+
// deep-link survives — without this the table wipes `?view` on mount,
|
|
266
|
+
// the URL goes bare, and the sidebar falls back to the model default
|
|
267
|
+
// (the "click twice to move the active to the right entry" bug).
|
|
268
|
+
const current = new URLSearchParams(window.location.search)
|
|
269
|
+
for (const key of ['view', 'group_by']) {
|
|
270
|
+
const v = current.get(key)
|
|
271
|
+
if (v) params.set(key, v)
|
|
272
|
+
}
|
|
260
273
|
if (pagination.pageIndex > 0) params.set('page', String(pagination.pageIndex + 1))
|
|
261
274
|
if (pagination.pageSize !== 10) params.set('per_page', String(pagination.pageSize))
|
|
262
275
|
if (sorting.length > 0) {
|