@tangle-network/sandbox-ui 0.10.1 → 0.10.2
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/dist/{chunk-A5ALUT2B.js → chunk-HEXQVHXJ.js} +41 -34
- package/dist/globals.css +0 -3
- package/dist/index.js +1 -1
- package/dist/styles.css +0 -3
- package/dist/workspace.d.ts +22 -18
- package/dist/workspace.js +1 -1
- package/package.json +1 -1
|
@@ -1658,7 +1658,7 @@ function CheckRow({ check }) {
|
|
|
1658
1658
|
|
|
1659
1659
|
// src/workspace/task-board.tsx
|
|
1660
1660
|
import { useMemo as useMemo5 } from "react";
|
|
1661
|
-
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1661
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1662
1662
|
function TaskBoard({
|
|
1663
1663
|
items,
|
|
1664
1664
|
columns,
|
|
@@ -1669,7 +1669,9 @@ function TaskBoard({
|
|
|
1669
1669
|
renderColumnAction,
|
|
1670
1670
|
renderBadge,
|
|
1671
1671
|
columnEmptyState,
|
|
1672
|
-
header
|
|
1672
|
+
header,
|
|
1673
|
+
renderColumnBody,
|
|
1674
|
+
renderItemWrapper
|
|
1673
1675
|
}) {
|
|
1674
1676
|
const grouped = useMemo5(() => {
|
|
1675
1677
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -1685,6 +1687,40 @@ function TaskBoard({
|
|
|
1685
1687
|
header,
|
|
1686
1688
|
/* @__PURE__ */ jsx11("div", { className: "flex flex-1 gap-3 overflow-x-auto p-4", children: columns.map((col) => {
|
|
1687
1689
|
const colItems = grouped.get(col.id) ?? [];
|
|
1690
|
+
const itemCards = /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
1691
|
+
colItems.length === 0 && columnEmptyState,
|
|
1692
|
+
colItems.map((item, index) => {
|
|
1693
|
+
const card = /* @__PURE__ */ jsxs11(
|
|
1694
|
+
"button",
|
|
1695
|
+
{
|
|
1696
|
+
type: "button",
|
|
1697
|
+
onClick: () => onClickItem?.(item),
|
|
1698
|
+
className: "group w-full rounded-lg border border-border bg-card p-3 text-left transition-colors hover:border-accent/50",
|
|
1699
|
+
children: [
|
|
1700
|
+
/* @__PURE__ */ jsx11("p", { className: "text-sm font-medium text-foreground", children: item.title }),
|
|
1701
|
+
item.description && /* @__PURE__ */ jsx11("p", { className: "mt-1 text-xs text-muted-foreground line-clamp-2", children: item.description }),
|
|
1702
|
+
(item.priority || item.tags?.length) && /* @__PURE__ */ jsxs11("div", { className: "mt-2 flex flex-wrap gap-1.5", children: [
|
|
1703
|
+
item.priority && (renderBadge ? renderBadge(item.priority, "priority") : /* @__PURE__ */ jsx11("span", { className: "rounded-full border border-border px-2 py-0.5 text-[10px] font-medium text-muted-foreground", children: item.priority })),
|
|
1704
|
+
item.tags?.map(
|
|
1705
|
+
(tag) => renderBadge ? /* @__PURE__ */ jsx11("span", { children: renderBadge(tag, "tag") }, tag) : /* @__PURE__ */ jsx11(
|
|
1706
|
+
"span",
|
|
1707
|
+
{
|
|
1708
|
+
className: "rounded-full border border-border px-2 py-0.5 text-[10px] text-muted-foreground",
|
|
1709
|
+
children: tag
|
|
1710
|
+
},
|
|
1711
|
+
tag
|
|
1712
|
+
)
|
|
1713
|
+
)
|
|
1714
|
+
] }),
|
|
1715
|
+
renderItemMeta?.(item)
|
|
1716
|
+
]
|
|
1717
|
+
},
|
|
1718
|
+
item.id
|
|
1719
|
+
);
|
|
1720
|
+
return renderItemWrapper ? /* @__PURE__ */ jsx11("span", { children: renderItemWrapper(item, index, card) }, item.id) : card;
|
|
1721
|
+
})
|
|
1722
|
+
] });
|
|
1723
|
+
const columnBody = /* @__PURE__ */ jsx11("div", { className: "flex flex-1 flex-col gap-2 overflow-y-auto px-2 pb-2 min-h-[80px]", children: renderColumnBody ? renderColumnBody(col.id, itemCards, colItems) : itemCards });
|
|
1688
1724
|
return /* @__PURE__ */ jsxs11(
|
|
1689
1725
|
"div",
|
|
1690
1726
|
{
|
|
@@ -1700,36 +1736,7 @@ function TaskBoard({
|
|
|
1700
1736
|
] }),
|
|
1701
1737
|
renderColumnAction?.(col)
|
|
1702
1738
|
] }),
|
|
1703
|
-
|
|
1704
|
-
colItems.length === 0 && columnEmptyState,
|
|
1705
|
-
colItems.map((item) => /* @__PURE__ */ jsxs11(
|
|
1706
|
-
"button",
|
|
1707
|
-
{
|
|
1708
|
-
type: "button",
|
|
1709
|
-
onClick: () => onClickItem?.(item),
|
|
1710
|
-
className: "group w-full rounded-lg border border-border bg-card p-3 text-left transition-colors hover:border-accent/50",
|
|
1711
|
-
children: [
|
|
1712
|
-
/* @__PURE__ */ jsx11("p", { className: "text-sm font-medium text-foreground", children: item.title }),
|
|
1713
|
-
item.description && /* @__PURE__ */ jsx11("p", { className: "mt-1 text-xs text-muted-foreground line-clamp-2", children: item.description }),
|
|
1714
|
-
(item.priority || item.tags?.length) && /* @__PURE__ */ jsxs11("div", { className: "mt-2 flex flex-wrap gap-1.5", children: [
|
|
1715
|
-
item.priority && (renderBadge ? renderBadge(item.priority, "priority") : /* @__PURE__ */ jsx11("span", { className: "rounded-full border border-border px-2 py-0.5 text-[10px] font-medium text-muted-foreground", children: item.priority })),
|
|
1716
|
-
item.tags?.map(
|
|
1717
|
-
(tag) => renderBadge ? /* @__PURE__ */ jsx11("span", { children: renderBadge(tag, "tag") }, tag) : /* @__PURE__ */ jsx11(
|
|
1718
|
-
"span",
|
|
1719
|
-
{
|
|
1720
|
-
className: "rounded-full border border-border px-2 py-0.5 text-[10px] text-muted-foreground",
|
|
1721
|
-
children: tag
|
|
1722
|
-
},
|
|
1723
|
-
tag
|
|
1724
|
-
)
|
|
1725
|
-
)
|
|
1726
|
-
] }),
|
|
1727
|
-
renderItemMeta?.(item)
|
|
1728
|
-
]
|
|
1729
|
-
},
|
|
1730
|
-
item.id
|
|
1731
|
-
))
|
|
1732
|
-
] })
|
|
1739
|
+
columnBody
|
|
1733
1740
|
]
|
|
1734
1741
|
},
|
|
1735
1742
|
col.id
|
|
@@ -1740,7 +1747,7 @@ function TaskBoard({
|
|
|
1740
1747
|
|
|
1741
1748
|
// src/workspace/calendar-view.tsx
|
|
1742
1749
|
import { useState as useState6, useMemo as useMemo6 } from "react";
|
|
1743
|
-
import { Fragment as
|
|
1750
|
+
import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1744
1751
|
function toDateKey(d) {
|
|
1745
1752
|
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
|
|
1746
1753
|
}
|
|
@@ -1929,7 +1936,7 @@ function CalendarView({
|
|
|
1929
1936
|
);
|
|
1930
1937
|
}) })
|
|
1931
1938
|
] }),
|
|
1932
|
-
showDayPanel && /* @__PURE__ */ jsx12("div", { className: "w-80 shrink-0 flex flex-col overflow-hidden", children: renderDayDetail ? renderDayDetail(selectedDay ?? todayKey, selectedDayEvents) : /* @__PURE__ */ jsxs12(
|
|
1939
|
+
showDayPanel && /* @__PURE__ */ jsx12("div", { className: "w-80 shrink-0 flex flex-col overflow-hidden", children: renderDayDetail ? renderDayDetail(selectedDay ?? todayKey, selectedDayEvents) : /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
1933
1940
|
/* @__PURE__ */ jsxs12("div", { className: "px-4 py-3 border-b border-border shrink-0", children: [
|
|
1934
1941
|
/* @__PURE__ */ jsx12("h3", { className: "text-sm font-semibold text-foreground", children: selectedDay === todayKey ? "Today" : selectedDay ? (/* @__PURE__ */ new Date(selectedDay + "T00:00:00")).toLocaleDateString(
|
|
1935
1942
|
"en-US",
|
package/dist/globals.css
CHANGED
|
@@ -2116,9 +2116,6 @@
|
|
|
2116
2116
|
border-color: color-mix(in oklab, var(--color-yellow-500) 30%, transparent);
|
|
2117
2117
|
}
|
|
2118
2118
|
}
|
|
2119
|
-
.border-t-blue-500 {
|
|
2120
|
-
border-top-color: var(--color-blue-500);
|
|
2121
|
-
}
|
|
2122
2119
|
.border-t-transparent {
|
|
2123
2120
|
border-top-color: transparent;
|
|
2124
2121
|
}
|
package/dist/index.js
CHANGED
package/dist/styles.css
CHANGED
|
@@ -2116,9 +2116,6 @@
|
|
|
2116
2116
|
border-color: color-mix(in oklab, var(--color-yellow-500) 30%, transparent);
|
|
2117
2117
|
}
|
|
2118
2118
|
}
|
|
2119
|
-
.border-t-blue-500 {
|
|
2120
|
-
border-top-color: var(--color-blue-500);
|
|
2121
|
-
}
|
|
2122
2119
|
.border-t-transparent {
|
|
2123
2120
|
border-top-color: transparent;
|
|
2124
2121
|
}
|
package/dist/workspace.d.ts
CHANGED
|
@@ -348,13 +348,11 @@ interface TaskBoardItem {
|
|
|
348
348
|
tags?: string[];
|
|
349
349
|
dueDate?: Date | null;
|
|
350
350
|
assigneeId?: string | null;
|
|
351
|
-
/** Arbitrary metadata rendered by renderItemMeta */
|
|
352
351
|
meta?: Record<string, unknown>;
|
|
353
352
|
}
|
|
354
353
|
interface TaskBoardColumn {
|
|
355
354
|
id: string;
|
|
356
355
|
label: string;
|
|
357
|
-
/** Tailwind border-top color class, e.g. "border-t-blue-500" */
|
|
358
356
|
accent?: string;
|
|
359
357
|
}
|
|
360
358
|
interface TaskBoardProps {
|
|
@@ -363,27 +361,33 @@ interface TaskBoardProps {
|
|
|
363
361
|
className?: string;
|
|
364
362
|
onMoveItem?: (itemId: string, toColumnId: string) => void;
|
|
365
363
|
onClickItem?: (item: TaskBoardItem) => void;
|
|
366
|
-
/** Render custom content inside each card below the title/description */
|
|
367
364
|
renderItemMeta?: (item: TaskBoardItem) => ReactNode;
|
|
368
|
-
/** Render actions in the column header (e.g. "+" button) */
|
|
369
365
|
renderColumnAction?: (column: TaskBoardColumn) => ReactNode;
|
|
370
|
-
/** Badge renderer for priority/tags — receives the raw value */
|
|
371
366
|
renderBadge?: (value: string, type: "priority" | "tag") => ReactNode;
|
|
372
|
-
/** Empty state shown when a column has no items */
|
|
373
367
|
columnEmptyState?: ReactNode;
|
|
374
|
-
/** Header slot above the board */
|
|
375
368
|
header?: ReactNode;
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
369
|
+
/**
|
|
370
|
+
* Wrap each column's item list container. Use this to inject a DnD
|
|
371
|
+
* droppable zone (e.g. Droppable from @hello-pangea/dnd).
|
|
372
|
+
*
|
|
373
|
+
* Receives the column ID, the default item list element, and the column's items.
|
|
374
|
+
* Return a ReactNode that wraps/replaces the default element.
|
|
375
|
+
*
|
|
376
|
+
* If not provided, the default unstyled div is rendered.
|
|
377
|
+
*/
|
|
378
|
+
renderColumnBody?: (columnId: string, defaultChildren: ReactNode, items: TaskBoardItem[]) => ReactNode;
|
|
379
|
+
/**
|
|
380
|
+
* Wrap each item card. Use this to inject a DnD draggable
|
|
381
|
+
* (e.g. Draggable from @hello-pangea/dnd).
|
|
382
|
+
*
|
|
383
|
+
* Receives the item, its index, and the default card element.
|
|
384
|
+
* Return a ReactNode that wraps/replaces the default element.
|
|
385
|
+
*
|
|
386
|
+
* If not provided, the default button card is rendered.
|
|
387
|
+
*/
|
|
388
|
+
renderItemWrapper?: (item: TaskBoardItem, index: number, defaultCard: ReactNode) => ReactNode;
|
|
389
|
+
}
|
|
390
|
+
declare function TaskBoard({ items, columns, className, onMoveItem, onClickItem, renderItemMeta, renderColumnAction, renderBadge, columnEmptyState, header, renderColumnBody, renderItemWrapper, }: TaskBoardProps): react_jsx_runtime.JSX.Element;
|
|
387
391
|
|
|
388
392
|
interface CalendarEvent {
|
|
389
393
|
id: string;
|
package/dist/workspace.js
CHANGED
package/package.json
CHANGED