@carlonicora/nextjs-jsonapi 3.20.1 → 3.21.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.
@@ -62,7 +62,7 @@ import {
62
62
  useCurrentUserContext,
63
63
  useDataListRetriever,
64
64
  usePageUrlGenerator
65
- } from "../chunk-HP3SPOPP.mjs";
65
+ } from "../chunk-HSVAW3DQ.mjs";
66
66
  import {
67
67
  getRoleId,
68
68
  getStripePublishableKey,
@@ -531,6 +531,8 @@ var badgeVariants = cva3(
531
531
  softGray: "bg-gray-500/10 text-gray-700 dark:bg-gray-500/15 dark:text-gray-400",
532
532
  softOrange: "bg-orange-500/10 text-orange-700 dark:bg-orange-500/15 dark:text-orange-400",
533
533
  softAmber: "bg-amber-500/10 text-amber-700 dark:bg-amber-500/15 dark:text-amber-400",
534
+ softEmerald: "bg-emerald-500/10 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-400",
535
+ softPurple: "bg-purple-500/10 text-purple-700 dark:bg-purple-500/15 dark:text-purple-400",
534
536
  blue: "bg-sky-500 text-primary-foreground [a]:hover:bg-sky-500/80",
535
537
  green: "bg-emerald-500 text-primary-foreground [a]:hover:bg-emerald-500/80",
536
538
  red: "bg-red-500 text-primary-foreground [a]:hover:bg-red-500/80",
@@ -10393,7 +10395,7 @@ import { useRef as useRef17 } from "react";
10393
10395
  import dynamic from "next/dynamic";
10394
10396
  import React18 from "react";
10395
10397
  import { jsx as jsx90 } from "react/jsx-runtime";
10396
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-FKYWM4NJ.mjs"), {
10398
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-CSLA3M32.mjs"), {
10397
10399
  ssr: false
10398
10400
  });
10399
10401
  var BlockNoteEditorContainer = React18.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -17705,6 +17707,14 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
17705
17707
  data: tableData,
17706
17708
  columns: tableColumns,
17707
17709
  getCoreRowModel: getCoreRowModel(),
17710
+ ...props.renderExpandedRow && {
17711
+ getExpandedRowModel: getExpandedRowModel(),
17712
+ // Key rows by record id so an expansion stays with its record when a search or filter reorders the rows.
17713
+ getRowId: /* @__PURE__ */ __name((row, index) => row.jsonApiData?.id ?? String(index), "getRowId"),
17714
+ getRowCanExpand: /* @__PURE__ */ __name(() => true, "getRowCanExpand"),
17715
+ onExpandedChange: setExpanded,
17716
+ state: { expanded }
17717
+ },
17708
17718
  ...props.expandable && {
17709
17719
  getExpandedRowModel: getExpandedRowModel(),
17710
17720
  getSubRows: props.getSubRows,
@@ -17791,7 +17801,22 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
17791
17801
  ] }),
17792
17802
  /* @__PURE__ */ jsx191(TableBody, { children: rowModel && rowModel.rows?.length ? groupedRows ? groupedRows.map((group) => /* @__PURE__ */ jsxs103(React31.Fragment, { children: [
17793
17803
  /* @__PURE__ */ jsx191(TableRow, { children: /* @__PURE__ */ jsx191(TableCell, { colSpan: tableColumns.length, className: "bg-muted px-4 py-2", children: /* @__PURE__ */ jsx191(MicroLabel, { children: props.groupLabel?.(group.groupKey) ?? group.groupKey }) }) }),
17794
- group.rows.map((row) => /* @__PURE__ */ jsx191(
17804
+ group.rows.map((row) => /* @__PURE__ */ jsxs103(React31.Fragment, { children: [
17805
+ /* @__PURE__ */ jsx191(
17806
+ TableRow,
17807
+ {
17808
+ onClick: () => onRowClick?.(row.original.jsonApiData),
17809
+ className: `group ${onRowClick ? "hover:bg-muted/50 cursor-pointer" : ""}`,
17810
+ children: row.getVisibleCells().map((cell) => {
17811
+ const meta = cell.column.columnDef.meta;
17812
+ return /* @__PURE__ */ jsx191(TableCell, { className: meta?.className, children: renderCell(cell.column.columnDef.cell, cell.getContext()) }, cell.id);
17813
+ })
17814
+ }
17815
+ ),
17816
+ props.renderExpandedRow && row.getIsExpanded() && /* @__PURE__ */ jsx191(TableRow, { "data-testid": "content-list-table-expanded-row", children: /* @__PURE__ */ jsx191(TableCell, { colSpan: tableColumns.length, className: "bg-muted/30 px-4 py-3", children: props.renderExpandedRow(row.original.jsonApiData) }) })
17817
+ ] }, row.id))
17818
+ ] }, group.groupKey)) : rowModel.rows.map((row) => /* @__PURE__ */ jsxs103(React31.Fragment, { children: [
17819
+ /* @__PURE__ */ jsx191(
17795
17820
  TableRow,
17796
17821
  {
17797
17822
  onClick: () => onRowClick?.(row.original.jsonApiData),
@@ -17800,21 +17825,10 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
17800
17825
  const meta = cell.column.columnDef.meta;
17801
17826
  return /* @__PURE__ */ jsx191(TableCell, { className: meta?.className, children: renderCell(cell.column.columnDef.cell, cell.getContext()) }, cell.id);
17802
17827
  })
17803
- },
17804
- row.id
17805
- ))
17806
- ] }, group.groupKey)) : rowModel.rows.map((row) => /* @__PURE__ */ jsx191(
17807
- TableRow,
17808
- {
17809
- onClick: () => onRowClick?.(row.original.jsonApiData),
17810
- className: `group ${onRowClick ? "hover:bg-muted/50 cursor-pointer" : ""}`,
17811
- children: row.getVisibleCells().map((cell) => {
17812
- const meta = cell.column.columnDef.meta;
17813
- return /* @__PURE__ */ jsx191(TableCell, { className: meta?.className, children: renderCell(cell.column.columnDef.cell, cell.getContext()) }, cell.id);
17814
- })
17815
- },
17816
- row.id
17817
- )) : /* @__PURE__ */ jsx191(TableRow, { children: /* @__PURE__ */ jsx191(TableCell, { colSpan: tableColumns.length, className: "h-24 text-center", children: props.emptyState ?? (t.has("ui.empty_states.no_results") ? t("ui.empty_states.no_results") : "No results.") }) }) }),
17828
+ }
17829
+ ),
17830
+ props.renderExpandedRow && row.getIsExpanded() && /* @__PURE__ */ jsx191(TableRow, { "data-testid": "content-list-table-expanded-row", children: /* @__PURE__ */ jsx191(TableCell, { colSpan: tableColumns.length, className: "bg-muted/30 px-4 py-3", children: props.renderExpandedRow(row.original.jsonApiData) }) })
17831
+ ] }, row.id)) : /* @__PURE__ */ jsx191(TableRow, { children: /* @__PURE__ */ jsx191(TableCell, { colSpan: tableColumns.length, className: "h-24 text-center", children: props.emptyState ?? (t.has("ui.empty_states.no_results") ? t("ui.empty_states.no_results") : "No results.") }) }) }),
17818
17832
  showFooter && /* @__PURE__ */ jsx191(TableFooter, { children: /* @__PURE__ */ jsx191(TableRow, { children: /* @__PURE__ */ jsx191(TableCell, { colSpan: tableColumns.length, className: "bg-card py-4 text-end", children: /* @__PURE__ */ jsxs103("div", { className: "flex items-center justify-end space-x-2", children: [
17819
17833
  /* @__PURE__ */ jsx191(
17820
17834
  Button,
@@ -27259,4 +27273,4 @@ export {
27259
27273
  useOAuthClients,
27260
27274
  useOAuthClient
27261
27275
  };
27262
- //# sourceMappingURL=chunk-HP3SPOPP.mjs.map
27276
+ //# sourceMappingURL=chunk-HSVAW3DQ.mjs.map