@burojs/ui-shadcn 0.4.0 → 0.5.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/README.md +22 -5
- package/dist/bulk-summary-CwSd6Yjb.cjs +108 -0
- package/dist/bulk-summary-CwSd6Yjb.cjs.map +1 -0
- package/dist/bulk-summary-GxMDP4bw.js +108 -0
- package/dist/bulk-summary-GxMDP4bw.js.map +1 -0
- package/dist/button-BxnnE28H.cjs +55 -0
- package/dist/button-BxnnE28H.cjs.map +1 -0
- package/dist/button-MWVeZaqj.js +44 -0
- package/dist/button-MWVeZaqj.js.map +1 -0
- package/dist/candidates-gate-CX2PBu6l.js +63 -0
- package/dist/candidates-gate-CX2PBu6l.js.map +1 -0
- package/dist/candidates-gate-DiFI52r7.cjs +70 -0
- package/dist/candidates-gate-DiFI52r7.cjs.map +1 -0
- package/dist/candidates-relation-picker-CBsVcnPR.js +82 -0
- package/dist/candidates-relation-picker-CBsVcnPR.js.map +1 -0
- package/dist/candidates-relation-picker-Dd_GVLlu.cjs +84 -0
- package/dist/candidates-relation-picker-Dd_GVLlu.cjs.map +1 -0
- package/dist/check-confirm-dialog-BRByTFpg.cjs +1534 -0
- package/dist/check-confirm-dialog-BRByTFpg.cjs.map +1 -0
- package/dist/check-confirm-dialog-CkaVTPT9.js +1232 -0
- package/dist/check-confirm-dialog-CkaVTPT9.js.map +1 -0
- package/dist/dialog-B_rt9S1c.js +63 -0
- package/dist/dialog-B_rt9S1c.js.map +1 -0
- package/dist/dialog-DRNUq9EA.cjs +112 -0
- package/dist/dialog-DRNUq9EA.cjs.map +1 -0
- package/dist/filter-builder-B3mZFL-K.cjs +1761 -0
- package/dist/filter-builder-B3mZFL-K.cjs.map +1 -0
- package/dist/filter-builder-DOnaXNfP.js +1605 -0
- package/dist/filter-builder-DOnaXNfP.js.map +1 -0
- package/dist/flow-runtime-B6zOHYqI.cjs +255 -0
- package/dist/flow-runtime-B6zOHYqI.cjs.map +1 -0
- package/dist/flow-runtime-D8h99FSg.js +252 -0
- package/dist/flow-runtime-D8h99FSg.js.map +1 -0
- package/dist/flow-screen-CX05b3G9.cjs +705 -0
- package/dist/flow-screen-CX05b3G9.cjs.map +1 -0
- package/dist/flow-screen-CmbARSqg.js +701 -0
- package/dist/flow-screen-CmbARSqg.js.map +1 -0
- package/dist/index.cjs +2825 -11912
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1612 -1862
- package/dist/index.d.ts +1700 -1950
- package/dist/index.js +2498 -11605
- package/dist/index.js.map +1 -1
- package/dist/inline-flow-host-B7U1OJUe.cjs +112 -0
- package/dist/inline-flow-host-B7U1OJUe.cjs.map +1 -0
- package/dist/inline-flow-host-C3H2UpSA.js +112 -0
- package/dist/inline-flow-host-C3H2UpSA.js.map +1 -0
- package/dist/input-BI0czGyI.cjs +23 -0
- package/dist/input-BI0czGyI.cjs.map +1 -0
- package/dist/input-CUPStzZO.js +17 -0
- package/dist/input-CUPStzZO.js.map +1 -0
- package/dist/label-66W1qbke.js +29 -0
- package/dist/label-66W1qbke.js.map +1 -0
- package/dist/label-w6JYf2cF.cjs +36 -0
- package/dist/label-w6JYf2cF.cjs.map +1 -0
- package/dist/lazy-relation-picker-dialog-2oxnA6IR.js +14 -0
- package/dist/lazy-relation-picker-dialog-2oxnA6IR.js.map +1 -0
- package/dist/lazy-relation-picker-dialog-BfAGKzUG.cjs +19 -0
- package/dist/lazy-relation-picker-dialog-BfAGKzUG.cjs.map +1 -0
- package/dist/markdown/index.cjs +1 -1
- package/dist/markdown/index.js +1 -1
- package/dist/page-flow-route-CQ7HsbBm.cjs +277 -0
- package/dist/page-flow-route-CQ7HsbBm.cjs.map +1 -0
- package/dist/page-flow-route-CyXSvXSE.js +277 -0
- package/dist/page-flow-route-CyXSvXSE.js.map +1 -0
- package/dist/peek-filter-CnqHwTMU.cjs +51 -0
- package/dist/peek-filter-CnqHwTMU.cjs.map +1 -0
- package/dist/peek-filter-ErLfO153.js +28 -0
- package/dist/peek-filter-ErLfO153.js.map +1 -0
- package/dist/place-node--GdsP688.js +7315 -0
- package/dist/place-node--GdsP688.js.map +1 -0
- package/dist/place-node-SIp4XYQH.cjs +7833 -0
- package/dist/place-node-SIp4XYQH.cjs.map +1 -0
- package/dist/related-list-cards-B6x9HQQp.js +42 -0
- package/dist/related-list-cards-B6x9HQQp.js.map +1 -0
- package/dist/related-list-cards-nxuODlIA.cjs +42 -0
- package/dist/related-list-cards-nxuODlIA.cjs.map +1 -0
- package/dist/related-list-timeline-BYJKEbmA.cjs +142 -0
- package/dist/related-list-timeline-BYJKEbmA.cjs.map +1 -0
- package/dist/related-list-timeline-DEdfd-rr.js +142 -0
- package/dist/related-list-timeline-DEdfd-rr.js.map +1 -0
- package/dist/related-rows-B4levHcR.js +186 -0
- package/dist/related-rows-B4levHcR.js.map +1 -0
- package/dist/related-rows-zh5f_4QR.cjs +209 -0
- package/dist/related-rows-zh5f_4QR.cjs.map +1 -0
- package/dist/relation-create-BOaUe12G.cjs +362 -0
- package/dist/relation-create-BOaUe12G.cjs.map +1 -0
- package/dist/relation-create-Bg-eEJLs.js +337 -0
- package/dist/relation-create-Bg-eEJLs.js.map +1 -0
- package/dist/relation-many-picker-B-NCEUgX.cjs +465 -0
- package/dist/relation-many-picker-B-NCEUgX.cjs.map +1 -0
- package/dist/relation-many-picker-gdAOD-qK.js +464 -0
- package/dist/relation-many-picker-gdAOD-qK.js.map +1 -0
- package/dist/relation-picker-BAY77ivO.js +462 -0
- package/dist/relation-picker-BAY77ivO.js.map +1 -0
- package/dist/relation-picker-Da_uhFvA.cjs +479 -0
- package/dist/relation-picker-Da_uhFvA.cjs.map +1 -0
- package/dist/relation-picker-dialog-M0pQaWlp.cjs +300 -0
- package/dist/relation-picker-dialog-M0pQaWlp.cjs.map +1 -0
- package/dist/relation-picker-dialog-hA9rYrZB.js +299 -0
- package/dist/relation-picker-dialog-hA9rYrZB.js.map +1 -0
- package/dist/resource-page-router-OSQyRA5b.cjs +1779 -0
- package/dist/resource-page-router-OSQyRA5b.cjs.map +1 -0
- package/dist/resource-page-router-T4vS5gbJ.js +1582 -0
- package/dist/resource-page-router-T4vS5gbJ.js.map +1 -0
- package/dist/{rich-text-IDFvyvRE.js → rich-text-DFerywgz.js} +7 -4
- package/dist/{rich-text-IDFvyvRE.js.map → rich-text-DFerywgz.js.map} +1 -1
- package/dist/{rich-text-lndbYqzR.cjs → rich-text-vTyVjDoa.cjs} +25 -22
- package/dist/{rich-text-lndbYqzR.cjs.map → rich-text-vTyVjDoa.cjs.map} +1 -1
- package/dist/search-access-B7G5oR8n.cjs +812 -0
- package/dist/search-access-B7G5oR8n.cjs.map +1 -0
- package/dist/search-access-CURsWn-U.js +669 -0
- package/dist/search-access-CURsWn-U.js.map +1 -0
- package/dist/shell-BPlk8hEa.js +205 -0
- package/dist/shell-BPlk8hEa.js.map +1 -0
- package/dist/shell-DxhlsPwm.cjs +271 -0
- package/dist/shell-DxhlsPwm.cjs.map +1 -0
- package/dist/skeleton-U2noefj5.js +13 -0
- package/dist/skeleton-U2noefj5.js.map +1 -0
- package/dist/skeleton-_1gP7wan.cjs +18 -0
- package/dist/skeleton-_1gP7wan.cjs.map +1 -0
- package/dist/styles.css +241 -9
- package/dist/toaster-C7CiYA4Z.cjs +248 -0
- package/dist/toaster-C7CiYA4Z.cjs.map +1 -0
- package/dist/toaster-CfCRLgR-.js +164 -0
- package/dist/toaster-CfCRLgR-.js.map +1 -0
- package/dist/use-dialog-filter-state-BBCC0OEK.cjs +92 -0
- package/dist/use-dialog-filter-state-BBCC0OEK.cjs.map +1 -0
- package/dist/use-dialog-filter-state-BDcgS5Oz.js +87 -0
- package/dist/use-dialog-filter-state-BDcgS5Oz.js.map +1 -0
- package/dist/{use-theme-BwPWinB2.cjs → use-theme-DFlpXils.cjs} +12 -1
- package/dist/use-theme-DFlpXils.cjs.map +1 -0
- package/dist/{use-theme-IHmtrhEt.js → use-theme-dnE3Od3I.js} +7 -2
- package/dist/use-theme-dnE3Od3I.js.map +1 -0
- package/package.json +16 -14
- package/dist/use-theme-BwPWinB2.cjs.map +0 -1
- package/dist/use-theme-IHmtrhEt.js.map +0 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { at as RELATED_GRID_CLASS } from "./place-node--GdsP688.js";
|
|
2
|
+
import { i as useProjectedRows, n as RowContent, r as RowOpener, t as ITEM_LAYER_CLASS } from "./related-rows-B4levHcR.js";
|
|
3
|
+
import { useTestIds } from "@burojs/react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/blocks/related-list-cards.tsx
|
|
6
|
+
const GRID_CLASS = RELATED_GRID_CLASS;
|
|
7
|
+
function RelatedCards({ resource, placementKey, rows, item, columns, rowQuick, rowHref }) {
|
|
8
|
+
const ids = useTestIds();
|
|
9
|
+
const { project, drawn, title } = useProjectedRows(resource, rows, item);
|
|
10
|
+
return jsx("div", {
|
|
11
|
+
className: "@container",
|
|
12
|
+
children: jsx("ul", {
|
|
13
|
+
className: GRID_CLASS,
|
|
14
|
+
children: rows.map((row) => jsx("li", {
|
|
15
|
+
className: "min-w-0",
|
|
16
|
+
children: jsxs("article", {
|
|
17
|
+
"data-testid": ids.relatedCard(placementKey, String(row.id)),
|
|
18
|
+
className: "relative h-full rounded-lg border bg-card p-3 text-card-foreground",
|
|
19
|
+
children: [jsx(RowOpener, {
|
|
20
|
+
title: title(row),
|
|
21
|
+
href: rowHref?.(row),
|
|
22
|
+
quick: rowQuick?.(row) ?? null
|
|
23
|
+
}), jsx("div", {
|
|
24
|
+
className: ITEM_LAYER_CLASS,
|
|
25
|
+
children: jsx(RowContent, {
|
|
26
|
+
resource,
|
|
27
|
+
raw: row,
|
|
28
|
+
row: project(row),
|
|
29
|
+
item,
|
|
30
|
+
drawn,
|
|
31
|
+
columns
|
|
32
|
+
})
|
|
33
|
+
})]
|
|
34
|
+
})
|
|
35
|
+
}, row.id))
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { RelatedCards };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=related-list-cards-B6x9HQQp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"related-list-cards-B6x9HQQp.js","names":[],"sources":["../src/blocks/related-list-cards.tsx"],"sourcesContent":["'use client';\nimport { useTestIds } from '@burojs/react';\nimport type { ReactElement } from 'react';\nimport {\n ITEM_LAYER_CLASS,\n type RelatedRowsProps,\n RowContent,\n RowOpener,\n useProjectedRows,\n} from './related-rows.js';\nimport { RELATED_GRID_CLASS } from './related-skeletons.js';\n\n/** The grid the cards sit in; `RelatedCardsSkeleton` shares it. */\nconst GRID_CLASS = RELATED_GRID_CLASS;\n\n/** A related list as cards (`view: 'cards'`, P6 3.13): one `<article>` per row. */\nexport function RelatedCards({\n resource,\n placementKey,\n rows,\n item,\n columns,\n rowQuick,\n rowHref,\n}: RelatedRowsProps): ReactElement {\n const ids = useTestIds();\n const { project, drawn, title } = useProjectedRows(resource, rows, item);\n return (\n <div className=\"@container\">\n <ul className={GRID_CLASS}>\n {rows.map((row) => (\n <li key={row.id} className=\"min-w-0\">\n <article\n data-testid={ids.relatedCard(placementKey, String(row.id))}\n className=\"relative h-full rounded-lg border bg-card p-3 text-card-foreground\"\n >\n <RowOpener title={title(row)} href={rowHref?.(row)} quick={rowQuick?.(row) ?? null} />\n <div className={ITEM_LAYER_CLASS}>\n <RowContent\n resource={resource}\n raw={row}\n row={project(row)}\n item={item}\n drawn={drawn}\n columns={columns}\n />\n </div>\n </article>\n </li>\n ))}\n </ul>\n </div>\n );\n}\n"],"mappings":";;;;;AAaA,MAAM,aAAa;AAGnB,SAAgB,aAAa,EAC3B,UACA,cACA,MACA,MACA,SACA,UACA,WACiC;CACjC,MAAM,MAAM,WAAW;CACvB,MAAM,EAAE,SAAS,OAAO,UAAU,iBAAiB,UAAU,MAAM,IAAI;CACvE,OACE,IAAC,OAAD;EAAK,WAAU;EACb,UAAA,IAAC,MAAD;GAAI,WAAW;GACZ,UAAA,KAAK,KAAK,QACT,IAAC,MAAD;IAAiB,WAAU;IACzB,UAAA,KAAC,WAAD;KACE,eAAa,IAAI,YAAY,cAAc,OAAO,IAAI,EAAE,CAAC;KACzD,WAAU;KAFZ,UAAA,CAIE,IAAC,WAAD;MAAW,OAAO,MAAM,GAAG;MAAG,MAAM,UAAU,GAAG;MAAG,OAAO,WAAW,GAAG,KAAK;KAAO,CAAA,GACrF,IAAC,OAAD;MAAK,WAAW;MACd,UAAA,IAAC,YAAD;OACY;OACV,KAAK;OACL,KAAK,QAAQ,GAAG;OACV;OACC;OACE;MACV,CAAA;KACE,CAAA,CACE;;GACP,GAjBK,IAAI,EAiBT,CACL;EACC,CAAA;CACD,CAAA;AAET"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const require_place_node = require("./place-node-SIp4XYQH.cjs");
|
|
2
|
+
const require_related_rows = require("./related-rows-zh5f_4QR.cjs");
|
|
3
|
+
let _burojs_react = require("@burojs/react");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
//#region src/blocks/related-list-cards.tsx
|
|
6
|
+
const GRID_CLASS = require_place_node.RELATED_GRID_CLASS;
|
|
7
|
+
function RelatedCards({ resource, placementKey, rows, item, columns, rowQuick, rowHref }) {
|
|
8
|
+
const ids = (0, _burojs_react.useTestIds)();
|
|
9
|
+
const { project, drawn, title } = require_related_rows.useProjectedRows(resource, rows, item);
|
|
10
|
+
return (0, react_jsx_runtime.jsx)("div", {
|
|
11
|
+
className: "@container",
|
|
12
|
+
children: (0, react_jsx_runtime.jsx)("ul", {
|
|
13
|
+
className: GRID_CLASS,
|
|
14
|
+
children: rows.map((row) => (0, react_jsx_runtime.jsx)("li", {
|
|
15
|
+
className: "min-w-0",
|
|
16
|
+
children: (0, react_jsx_runtime.jsxs)("article", {
|
|
17
|
+
"data-testid": ids.relatedCard(placementKey, String(row.id)),
|
|
18
|
+
className: "relative h-full rounded-lg border bg-card p-3 text-card-foreground",
|
|
19
|
+
children: [(0, react_jsx_runtime.jsx)(require_related_rows.RowOpener, {
|
|
20
|
+
title: title(row),
|
|
21
|
+
href: rowHref?.(row),
|
|
22
|
+
quick: rowQuick?.(row) ?? null
|
|
23
|
+
}), (0, react_jsx_runtime.jsx)("div", {
|
|
24
|
+
className: require_related_rows.ITEM_LAYER_CLASS,
|
|
25
|
+
children: (0, react_jsx_runtime.jsx)(require_related_rows.RowContent, {
|
|
26
|
+
resource,
|
|
27
|
+
raw: row,
|
|
28
|
+
row: project(row),
|
|
29
|
+
item,
|
|
30
|
+
drawn,
|
|
31
|
+
columns
|
|
32
|
+
})
|
|
33
|
+
})]
|
|
34
|
+
})
|
|
35
|
+
}, row.id))
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
exports.RelatedCards = RelatedCards;
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=related-list-cards-nxuODlIA.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"related-list-cards-nxuODlIA.cjs","names":["RELATED_GRID_CLASS","useTestIds","useProjectedRows","RowOpener","ITEM_LAYER_CLASS","RowContent"],"sources":["../src/blocks/related-list-cards.tsx"],"sourcesContent":["'use client';\nimport { useTestIds } from '@burojs/react';\nimport type { ReactElement } from 'react';\nimport {\n ITEM_LAYER_CLASS,\n type RelatedRowsProps,\n RowContent,\n RowOpener,\n useProjectedRows,\n} from './related-rows.js';\nimport { RELATED_GRID_CLASS } from './related-skeletons.js';\n\n/** The grid the cards sit in; `RelatedCardsSkeleton` shares it. */\nconst GRID_CLASS = RELATED_GRID_CLASS;\n\n/** A related list as cards (`view: 'cards'`, P6 3.13): one `<article>` per row. */\nexport function RelatedCards({\n resource,\n placementKey,\n rows,\n item,\n columns,\n rowQuick,\n rowHref,\n}: RelatedRowsProps): ReactElement {\n const ids = useTestIds();\n const { project, drawn, title } = useProjectedRows(resource, rows, item);\n return (\n <div className=\"@container\">\n <ul className={GRID_CLASS}>\n {rows.map((row) => (\n <li key={row.id} className=\"min-w-0\">\n <article\n data-testid={ids.relatedCard(placementKey, String(row.id))}\n className=\"relative h-full rounded-lg border bg-card p-3 text-card-foreground\"\n >\n <RowOpener title={title(row)} href={rowHref?.(row)} quick={rowQuick?.(row) ?? null} />\n <div className={ITEM_LAYER_CLASS}>\n <RowContent\n resource={resource}\n raw={row}\n row={project(row)}\n item={item}\n drawn={drawn}\n columns={columns}\n />\n </div>\n </article>\n </li>\n ))}\n </ul>\n </div>\n );\n}\n"],"mappings":";;;;;AAaA,MAAM,aAAaA,mBAAAA;AAGnB,SAAgB,aAAa,EAC3B,UACA,cACA,MACA,MACA,SACA,UACA,WACiC;CACjC,MAAM,OAAA,GAAMC,cAAAA,WAAAA,CAAW;CACvB,MAAM,EAAE,SAAS,OAAO,UAAUC,qBAAAA,iBAAiB,UAAU,MAAM,IAAI;CACvE,QACE,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EACb,WAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;GAAI,WAAW;GACZ,UAAA,KAAK,KAAK,SACT,GAAA,kBAAA,IAAA,CAAC,MAAD;IAAiB,WAAU;IACzB,WAAA,GAAA,kBAAA,KAAA,CAAC,WAAD;KACE,eAAa,IAAI,YAAY,cAAc,OAAO,IAAI,EAAE,CAAC;KACzD,WAAU;KAFZ,UAAA,EAIE,GAAA,kBAAA,IAAA,CAACC,qBAAAA,WAAD;MAAW,OAAO,MAAM,GAAG;MAAG,MAAM,UAAU,GAAG;MAAG,OAAO,WAAW,GAAG,KAAK;KAAO,CAAA,IACrF,GAAA,kBAAA,IAAA,CAAC,OAAD;MAAK,WAAWC,qBAAAA;MACd,WAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,YAAD;OACY;OACV,KAAK;OACL,KAAK,QAAQ,GAAG;OACV;OACC;OACE;MACV,CAAA;KACE,CAAA,CACE;;GACP,GAjBK,IAAI,EAiBT,CACL;EACC,CAAA;CACD,CAAA;AAET"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
const require_related_rows = require("./related-rows-zh5f_4QR.cjs");
|
|
2
|
+
let _burojs_react = require("@burojs/react");
|
|
3
|
+
let react = require("react");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
//#region src/blocks/related-list-timeline.tsx
|
|
6
|
+
function dayOf(value) {
|
|
7
|
+
if (typeof value === "string") {
|
|
8
|
+
const only = /^(\d{4})-(\d{2})-(\d{2})$/u.exec(value);
|
|
9
|
+
if (only !== null) return {
|
|
10
|
+
date: new Date(Number(only[1]), Number(only[2]) - 1, Number(only[3])),
|
|
11
|
+
timed: false
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
if (typeof value !== "string" && typeof value !== "number" && !(value instanceof Date)) return void 0;
|
|
15
|
+
const date = new Date(value);
|
|
16
|
+
return Number.isNaN(date.getTime()) ? void 0 : {
|
|
17
|
+
date,
|
|
18
|
+
timed: true
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const dayKey = (date) => `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
|
|
22
|
+
function RelatedTimeline({ resource, placementKey, rows, item, columns, rowQuick, rowHref }) {
|
|
23
|
+
const ids = (0, _burojs_react.useTestIds)();
|
|
24
|
+
const app = (0, _burojs_react.useApp)();
|
|
25
|
+
const t = (0, _burojs_react.useOptionalT)();
|
|
26
|
+
const locale = (0, _burojs_react.useOptionalLocale)();
|
|
27
|
+
const { project, drawn, title } = require_related_rows.useProjectedRows(resource, rows, item);
|
|
28
|
+
const axis = app.registry.get(resource)?.views?.list?.defaultSort?.[0]?.field;
|
|
29
|
+
const formats = (0, react.useMemo)(() => {
|
|
30
|
+
try {
|
|
31
|
+
return {
|
|
32
|
+
day: new Intl.DateTimeFormat(locale, { dateStyle: "full" }),
|
|
33
|
+
time: new Intl.DateTimeFormat(locale, { timeStyle: "short" })
|
|
34
|
+
};
|
|
35
|
+
} catch {
|
|
36
|
+
return {
|
|
37
|
+
day: new Intl.DateTimeFormat(void 0, { dateStyle: "full" }),
|
|
38
|
+
time: new Intl.DateTimeFormat(void 0, { timeStyle: "short" })
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}, [locale]);
|
|
42
|
+
const groups = (0, react.useMemo)(() => {
|
|
43
|
+
const out = [];
|
|
44
|
+
if (axis === void 0) return out;
|
|
45
|
+
const undated = [];
|
|
46
|
+
for (const row of rows) {
|
|
47
|
+
const day = dayOf(project(row)[axis]);
|
|
48
|
+
if (day === void 0) {
|
|
49
|
+
undated.push({
|
|
50
|
+
row,
|
|
51
|
+
at: void 0,
|
|
52
|
+
timed: false
|
|
53
|
+
});
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
const key = dayKey(day.date);
|
|
57
|
+
let group = out.find((entry) => entry.key === key);
|
|
58
|
+
if (group === void 0) {
|
|
59
|
+
group = {
|
|
60
|
+
key,
|
|
61
|
+
heading: day.date,
|
|
62
|
+
entries: []
|
|
63
|
+
};
|
|
64
|
+
out.push(group);
|
|
65
|
+
}
|
|
66
|
+
group.entries.push({
|
|
67
|
+
row,
|
|
68
|
+
at: day.date,
|
|
69
|
+
timed: day.timed
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if (undated.length > 0) out.push({
|
|
73
|
+
key: "undated",
|
|
74
|
+
heading: void 0,
|
|
75
|
+
entries: undated
|
|
76
|
+
});
|
|
77
|
+
return out;
|
|
78
|
+
}, [
|
|
79
|
+
rows,
|
|
80
|
+
axis,
|
|
81
|
+
project
|
|
82
|
+
]);
|
|
83
|
+
const headingOf = (group) => group.heading === void 0 ? t("timeline.undated", { defaultValue: "Undated" }) : formats.day.format(group.heading);
|
|
84
|
+
if (groups.length === 0) return (0, react_jsx_runtime.jsx)("p", {
|
|
85
|
+
className: "text-sm text-muted-foreground",
|
|
86
|
+
children: t("timeline.empty", { defaultValue: "No entries" })
|
|
87
|
+
});
|
|
88
|
+
return (0, react_jsx_runtime.jsxs)("div", {
|
|
89
|
+
className: "relative flex flex-col gap-4 pl-5",
|
|
90
|
+
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
91
|
+
"data-buro-timeline-rail": "",
|
|
92
|
+
"aria-hidden": "true",
|
|
93
|
+
className: "absolute top-1 bottom-1 left-2 w-px bg-border"
|
|
94
|
+
}), groups.map((group) => (0, react_jsx_runtime.jsxs)("section", {
|
|
95
|
+
"aria-label": headingOf(group),
|
|
96
|
+
className: "flex flex-col gap-1",
|
|
97
|
+
children: [(0, react_jsx_runtime.jsx)("h3", {
|
|
98
|
+
className: "text-xs text-muted-foreground",
|
|
99
|
+
children: headingOf(group)
|
|
100
|
+
}), (0, react_jsx_runtime.jsx)("ol", {
|
|
101
|
+
className: "flex flex-col",
|
|
102
|
+
children: group.entries.map(({ row, at, timed }) => (0, react_jsx_runtime.jsxs)("li", {
|
|
103
|
+
"data-testid": ids.timelineEntry(placementKey, String(row.id)),
|
|
104
|
+
className: "relative flex min-w-0 items-baseline gap-3 rounded-md py-1.5 pr-2",
|
|
105
|
+
children: [
|
|
106
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
107
|
+
"data-buro-timeline-dot": "",
|
|
108
|
+
"aria-hidden": "true",
|
|
109
|
+
className: "absolute top-2.5 -left-[1.1rem] size-3 rounded-full border-2 border-background bg-muted-foreground"
|
|
110
|
+
}),
|
|
111
|
+
(0, react_jsx_runtime.jsx)(require_related_rows.RowOpener, {
|
|
112
|
+
title: title(row),
|
|
113
|
+
href: rowHref?.(row),
|
|
114
|
+
quick: rowQuick?.(row) ?? null
|
|
115
|
+
}),
|
|
116
|
+
timed && at !== void 0 ? (0, react_jsx_runtime.jsx)("time", {
|
|
117
|
+
dateTime: at.toISOString(),
|
|
118
|
+
className: "w-16 shrink-0 whitespace-nowrap text-xs tabular-nums text-muted-foreground",
|
|
119
|
+
children: formats.time.format(at)
|
|
120
|
+
}) : null,
|
|
121
|
+
(0, react_jsx_runtime.jsx)("div", {
|
|
122
|
+
className: `${require_related_rows.ITEM_LAYER_CLASS} min-w-0 flex-1`,
|
|
123
|
+
children: (0, react_jsx_runtime.jsx)(require_related_rows.RowContent, {
|
|
124
|
+
resource,
|
|
125
|
+
raw: row,
|
|
126
|
+
row: project(row),
|
|
127
|
+
item,
|
|
128
|
+
drawn,
|
|
129
|
+
columns,
|
|
130
|
+
variant: "entry"
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
]
|
|
134
|
+
}, row.id))
|
|
135
|
+
})]
|
|
136
|
+
}, group.key))]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
//#endregion
|
|
140
|
+
exports.RelatedTimeline = RelatedTimeline;
|
|
141
|
+
|
|
142
|
+
//# sourceMappingURL=related-list-timeline-BYJKEbmA.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"related-list-timeline-BYJKEbmA.cjs","names":["useTestIds","useApp","useOptionalT","useOptionalLocale","useProjectedRows","useMemo","RowOpener","ITEM_LAYER_CLASS","RowContent"],"sources":["../src/blocks/related-list-timeline.tsx"],"sourcesContent":["'use client';\nimport { useApp, useOptionalLocale, useOptionalT, useTestIds } from '@burojs/react';\nimport { type ReactElement, useMemo } from 'react';\nimport {\n ITEM_LAYER_CLASS,\n type ListRow,\n type RelatedRowsProps,\n RowContent,\n RowOpener,\n useProjectedRows,\n} from './related-rows.js';\n\n/** The date of a row's axis value, else undefined. A date-only value is the local day it names. */\nfunction dayOf(value: unknown): { readonly date: Date; readonly timed: boolean } | undefined {\n if (typeof value === 'string') {\n const only = /^(\\d{4})-(\\d{2})-(\\d{2})$/u.exec(value);\n if (only !== null)\n return {\n date: new Date(Number(only[1]), Number(only[2]) - 1, Number(only[3])),\n timed: false,\n };\n }\n if (typeof value !== 'string' && typeof value !== 'number' && !(value instanceof Date))\n return undefined;\n const date = new Date(value);\n return Number.isNaN(date.getTime()) ? undefined : { date, timed: true };\n}\n\nconst dayKey = (date: Date) => `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;\n\ninterface Group {\n readonly key: string;\n /** The day the group names; undefined for the undated group. */\n readonly heading: Date | undefined;\n readonly entries: {\n readonly row: ListRow;\n readonly at: Date | undefined;\n readonly timed: boolean;\n }[];\n}\n\n/**\n * A related list as a timeline (`view: 'timeline'`, P6 3.13): one column grouped by the local\n * day of the target's `views.list.defaultSort[0].field`, headings formatted by the active locale,\n * entries in the list's own (declared) order, each the time and then the item. There is no sort\n * control: the axis is the declared sort.\n *\n * The axis is read from the projected row, as every other field is: a viewer who may not see it\n * gets no day and no time. A row whose axis reads nothing (hidden, empty or unparseable) is kept\n * in one trailing \"Undated\" group, so the entries drawn are the rows the list counts.\n */\nexport function RelatedTimeline({\n resource,\n placementKey,\n rows,\n item,\n columns,\n rowQuick,\n rowHref,\n}: RelatedRowsProps): ReactElement {\n const ids = useTestIds();\n const app = useApp();\n const t = useOptionalT();\n const locale = useOptionalLocale();\n const { project, drawn, title } = useProjectedRows(resource, rows, item);\n const axis = (\n app.registry.get(resource) as\n | {\n readonly views?: {\n readonly list?: { readonly defaultSort?: readonly { readonly field: string }[] };\n };\n }\n | undefined\n )?.views?.list?.defaultSort?.[0]?.field;\n const formats = useMemo(() => {\n try {\n return {\n day: new Intl.DateTimeFormat(locale, { dateStyle: 'full' }),\n time: new Intl.DateTimeFormat(locale, { timeStyle: 'short' }),\n };\n } catch {\n return {\n day: new Intl.DateTimeFormat(undefined, { dateStyle: 'full' }),\n time: new Intl.DateTimeFormat(undefined, { timeStyle: 'short' }),\n };\n }\n }, [locale]);\n const groups = useMemo(() => {\n const out: Group[] = [];\n if (axis === undefined) return out;\n const undated: Group['entries'] = [];\n for (const row of rows) {\n const day = dayOf(project(row)[axis]);\n if (day === undefined) {\n undated.push({ row, at: undefined, timed: false });\n continue;\n }\n const key = dayKey(day.date);\n let group = out.find((entry) => entry.key === key);\n if (group === undefined) {\n group = { key, heading: day.date, entries: [] };\n out.push(group);\n }\n group.entries.push({ row, at: day.date, timed: day.timed });\n }\n if (undated.length > 0) out.push({ key: 'undated', heading: undefined, entries: undated });\n return out;\n }, [rows, axis, project]);\n const headingOf = (group: Group): string =>\n group.heading === undefined\n ? t('timeline.undated', { defaultValue: 'Undated' })\n : formats.day.format(group.heading);\n if (groups.length === 0)\n return (\n <p className=\"text-sm text-muted-foreground\">\n {t('timeline.empty', { defaultValue: 'No entries' })}\n </p>\n );\n // One rail down the whole list (a border per day broke at every heading), a dot per entry on it;\n // the day headings are the axis' labels, small and muted, and the entries carry the weight.\n return (\n <div className=\"relative flex flex-col gap-4 pl-5\">\n <span\n data-buro-timeline-rail=\"\"\n aria-hidden=\"true\"\n className=\"absolute top-1 bottom-1 left-2 w-px bg-border\"\n />\n {groups.map((group) => (\n <section key={group.key} aria-label={headingOf(group)} className=\"flex flex-col gap-1\">\n <h3 className=\"text-xs text-muted-foreground\">{headingOf(group)}</h3>\n <ol className=\"flex flex-col\">\n {group.entries.map(({ row, at, timed }) => (\n <li\n key={row.id}\n data-testid={ids.timelineEntry(placementKey, String(row.id))}\n className=\"relative flex min-w-0 items-baseline gap-3 rounded-md py-1.5 pr-2\"\n >\n <span\n data-buro-timeline-dot=\"\"\n aria-hidden=\"true\"\n className=\"absolute top-2.5 -left-[1.1rem] size-3 rounded-full border-2 border-background bg-muted-foreground\"\n />\n <RowOpener\n title={title(row)}\n href={rowHref?.(row)}\n quick={rowQuick?.(row) ?? null}\n />\n {timed && at !== undefined ? (\n <time\n dateTime={at.toISOString()}\n className=\"w-16 shrink-0 whitespace-nowrap text-xs tabular-nums text-muted-foreground\"\n >\n {formats.time.format(at)}\n </time>\n ) : null}\n <div className={`${ITEM_LAYER_CLASS} min-w-0 flex-1`}>\n <RowContent\n resource={resource}\n raw={row}\n row={project(row)}\n item={item}\n drawn={drawn}\n columns={columns}\n variant=\"entry\"\n />\n </div>\n </li>\n ))}\n </ol>\n </section>\n ))}\n </div>\n );\n}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, n as RowContent, r as RowOpener, t as ITEM_LAYER_CLASS } from "./related-rows-B4levHcR.js";
|
|
2
|
+
import { useApp, useOptionalLocale, useOptionalT, useTestIds } from "@burojs/react";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/blocks/related-list-timeline.tsx
|
|
6
|
+
function dayOf(value) {
|
|
7
|
+
if (typeof value === "string") {
|
|
8
|
+
const only = /^(\d{4})-(\d{2})-(\d{2})$/u.exec(value);
|
|
9
|
+
if (only !== null) return {
|
|
10
|
+
date: new Date(Number(only[1]), Number(only[2]) - 1, Number(only[3])),
|
|
11
|
+
timed: false
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
if (typeof value !== "string" && typeof value !== "number" && !(value instanceof Date)) return void 0;
|
|
15
|
+
const date = new Date(value);
|
|
16
|
+
return Number.isNaN(date.getTime()) ? void 0 : {
|
|
17
|
+
date,
|
|
18
|
+
timed: true
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const dayKey = (date) => `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
|
|
22
|
+
function RelatedTimeline({ resource, placementKey, rows, item, columns, rowQuick, rowHref }) {
|
|
23
|
+
const ids = useTestIds();
|
|
24
|
+
const app = useApp();
|
|
25
|
+
const t = useOptionalT();
|
|
26
|
+
const locale = useOptionalLocale();
|
|
27
|
+
const { project, drawn, title } = useProjectedRows(resource, rows, item);
|
|
28
|
+
const axis = app.registry.get(resource)?.views?.list?.defaultSort?.[0]?.field;
|
|
29
|
+
const formats = useMemo(() => {
|
|
30
|
+
try {
|
|
31
|
+
return {
|
|
32
|
+
day: new Intl.DateTimeFormat(locale, { dateStyle: "full" }),
|
|
33
|
+
time: new Intl.DateTimeFormat(locale, { timeStyle: "short" })
|
|
34
|
+
};
|
|
35
|
+
} catch {
|
|
36
|
+
return {
|
|
37
|
+
day: new Intl.DateTimeFormat(void 0, { dateStyle: "full" }),
|
|
38
|
+
time: new Intl.DateTimeFormat(void 0, { timeStyle: "short" })
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}, [locale]);
|
|
42
|
+
const groups = useMemo(() => {
|
|
43
|
+
const out = [];
|
|
44
|
+
if (axis === void 0) return out;
|
|
45
|
+
const undated = [];
|
|
46
|
+
for (const row of rows) {
|
|
47
|
+
const day = dayOf(project(row)[axis]);
|
|
48
|
+
if (day === void 0) {
|
|
49
|
+
undated.push({
|
|
50
|
+
row,
|
|
51
|
+
at: void 0,
|
|
52
|
+
timed: false
|
|
53
|
+
});
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
const key = dayKey(day.date);
|
|
57
|
+
let group = out.find((entry) => entry.key === key);
|
|
58
|
+
if (group === void 0) {
|
|
59
|
+
group = {
|
|
60
|
+
key,
|
|
61
|
+
heading: day.date,
|
|
62
|
+
entries: []
|
|
63
|
+
};
|
|
64
|
+
out.push(group);
|
|
65
|
+
}
|
|
66
|
+
group.entries.push({
|
|
67
|
+
row,
|
|
68
|
+
at: day.date,
|
|
69
|
+
timed: day.timed
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if (undated.length > 0) out.push({
|
|
73
|
+
key: "undated",
|
|
74
|
+
heading: void 0,
|
|
75
|
+
entries: undated
|
|
76
|
+
});
|
|
77
|
+
return out;
|
|
78
|
+
}, [
|
|
79
|
+
rows,
|
|
80
|
+
axis,
|
|
81
|
+
project
|
|
82
|
+
]);
|
|
83
|
+
const headingOf = (group) => group.heading === void 0 ? t("timeline.undated", { defaultValue: "Undated" }) : formats.day.format(group.heading);
|
|
84
|
+
if (groups.length === 0) return jsx("p", {
|
|
85
|
+
className: "text-sm text-muted-foreground",
|
|
86
|
+
children: t("timeline.empty", { defaultValue: "No entries" })
|
|
87
|
+
});
|
|
88
|
+
return jsxs("div", {
|
|
89
|
+
className: "relative flex flex-col gap-4 pl-5",
|
|
90
|
+
children: [jsx("span", {
|
|
91
|
+
"data-buro-timeline-rail": "",
|
|
92
|
+
"aria-hidden": "true",
|
|
93
|
+
className: "absolute top-1 bottom-1 left-2 w-px bg-border"
|
|
94
|
+
}), groups.map((group) => jsxs("section", {
|
|
95
|
+
"aria-label": headingOf(group),
|
|
96
|
+
className: "flex flex-col gap-1",
|
|
97
|
+
children: [jsx("h3", {
|
|
98
|
+
className: "text-xs text-muted-foreground",
|
|
99
|
+
children: headingOf(group)
|
|
100
|
+
}), jsx("ol", {
|
|
101
|
+
className: "flex flex-col",
|
|
102
|
+
children: group.entries.map(({ row, at, timed }) => jsxs("li", {
|
|
103
|
+
"data-testid": ids.timelineEntry(placementKey, String(row.id)),
|
|
104
|
+
className: "relative flex min-w-0 items-baseline gap-3 rounded-md py-1.5 pr-2",
|
|
105
|
+
children: [
|
|
106
|
+
jsx("span", {
|
|
107
|
+
"data-buro-timeline-dot": "",
|
|
108
|
+
"aria-hidden": "true",
|
|
109
|
+
className: "absolute top-2.5 -left-[1.1rem] size-3 rounded-full border-2 border-background bg-muted-foreground"
|
|
110
|
+
}),
|
|
111
|
+
jsx(RowOpener, {
|
|
112
|
+
title: title(row),
|
|
113
|
+
href: rowHref?.(row),
|
|
114
|
+
quick: rowQuick?.(row) ?? null
|
|
115
|
+
}),
|
|
116
|
+
timed && at !== void 0 ? jsx("time", {
|
|
117
|
+
dateTime: at.toISOString(),
|
|
118
|
+
className: "w-16 shrink-0 whitespace-nowrap text-xs tabular-nums text-muted-foreground",
|
|
119
|
+
children: formats.time.format(at)
|
|
120
|
+
}) : null,
|
|
121
|
+
jsx("div", {
|
|
122
|
+
className: `${ITEM_LAYER_CLASS} min-w-0 flex-1`,
|
|
123
|
+
children: jsx(RowContent, {
|
|
124
|
+
resource,
|
|
125
|
+
raw: row,
|
|
126
|
+
row: project(row),
|
|
127
|
+
item,
|
|
128
|
+
drawn,
|
|
129
|
+
columns,
|
|
130
|
+
variant: "entry"
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
]
|
|
134
|
+
}, row.id))
|
|
135
|
+
})]
|
|
136
|
+
}, group.key))]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
//#endregion
|
|
140
|
+
export { RelatedTimeline };
|
|
141
|
+
|
|
142
|
+
//# sourceMappingURL=related-list-timeline-DEdfd-rr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"related-list-timeline-DEdfd-rr.js","names":[],"sources":["../src/blocks/related-list-timeline.tsx"],"sourcesContent":["'use client';\nimport { useApp, useOptionalLocale, useOptionalT, useTestIds } from '@burojs/react';\nimport { type ReactElement, useMemo } from 'react';\nimport {\n ITEM_LAYER_CLASS,\n type ListRow,\n type RelatedRowsProps,\n RowContent,\n RowOpener,\n useProjectedRows,\n} from './related-rows.js';\n\n/** The date of a row's axis value, else undefined. A date-only value is the local day it names. */\nfunction dayOf(value: unknown): { readonly date: Date; readonly timed: boolean } | undefined {\n if (typeof value === 'string') {\n const only = /^(\\d{4})-(\\d{2})-(\\d{2})$/u.exec(value);\n if (only !== null)\n return {\n date: new Date(Number(only[1]), Number(only[2]) - 1, Number(only[3])),\n timed: false,\n };\n }\n if (typeof value !== 'string' && typeof value !== 'number' && !(value instanceof Date))\n return undefined;\n const date = new Date(value);\n return Number.isNaN(date.getTime()) ? undefined : { date, timed: true };\n}\n\nconst dayKey = (date: Date) => `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;\n\ninterface Group {\n readonly key: string;\n /** The day the group names; undefined for the undated group. */\n readonly heading: Date | undefined;\n readonly entries: {\n readonly row: ListRow;\n readonly at: Date | undefined;\n readonly timed: boolean;\n }[];\n}\n\n/**\n * A related list as a timeline (`view: 'timeline'`, P6 3.13): one column grouped by the local\n * day of the target's `views.list.defaultSort[0].field`, headings formatted by the active locale,\n * entries in the list's own (declared) order, each the time and then the item. There is no sort\n * control: the axis is the declared sort.\n *\n * The axis is read from the projected row, as every other field is: a viewer who may not see it\n * gets no day and no time. A row whose axis reads nothing (hidden, empty or unparseable) is kept\n * in one trailing \"Undated\" group, so the entries drawn are the rows the list counts.\n */\nexport function RelatedTimeline({\n resource,\n placementKey,\n rows,\n item,\n columns,\n rowQuick,\n rowHref,\n}: RelatedRowsProps): ReactElement {\n const ids = useTestIds();\n const app = useApp();\n const t = useOptionalT();\n const locale = useOptionalLocale();\n const { project, drawn, title } = useProjectedRows(resource, rows, item);\n const axis = (\n app.registry.get(resource) as\n | {\n readonly views?: {\n readonly list?: { readonly defaultSort?: readonly { readonly field: string }[] };\n };\n }\n | undefined\n )?.views?.list?.defaultSort?.[0]?.field;\n const formats = useMemo(() => {\n try {\n return {\n day: new Intl.DateTimeFormat(locale, { dateStyle: 'full' }),\n time: new Intl.DateTimeFormat(locale, { timeStyle: 'short' }),\n };\n } catch {\n return {\n day: new Intl.DateTimeFormat(undefined, { dateStyle: 'full' }),\n time: new Intl.DateTimeFormat(undefined, { timeStyle: 'short' }),\n };\n }\n }, [locale]);\n const groups = useMemo(() => {\n const out: Group[] = [];\n if (axis === undefined) return out;\n const undated: Group['entries'] = [];\n for (const row of rows) {\n const day = dayOf(project(row)[axis]);\n if (day === undefined) {\n undated.push({ row, at: undefined, timed: false });\n continue;\n }\n const key = dayKey(day.date);\n let group = out.find((entry) => entry.key === key);\n if (group === undefined) {\n group = { key, heading: day.date, entries: [] };\n out.push(group);\n }\n group.entries.push({ row, at: day.date, timed: day.timed });\n }\n if (undated.length > 0) out.push({ key: 'undated', heading: undefined, entries: undated });\n return out;\n }, [rows, axis, project]);\n const headingOf = (group: Group): string =>\n group.heading === undefined\n ? t('timeline.undated', { defaultValue: 'Undated' })\n : formats.day.format(group.heading);\n if (groups.length === 0)\n return (\n <p className=\"text-sm text-muted-foreground\">\n {t('timeline.empty', { defaultValue: 'No entries' })}\n </p>\n );\n // One rail down the whole list (a border per day broke at every heading), a dot per entry on it;\n // the day headings are the axis' labels, small and muted, and the entries carry the weight.\n return (\n <div className=\"relative flex flex-col gap-4 pl-5\">\n <span\n data-buro-timeline-rail=\"\"\n aria-hidden=\"true\"\n className=\"absolute top-1 bottom-1 left-2 w-px bg-border\"\n />\n {groups.map((group) => (\n <section key={group.key} aria-label={headingOf(group)} className=\"flex flex-col gap-1\">\n <h3 className=\"text-xs text-muted-foreground\">{headingOf(group)}</h3>\n <ol className=\"flex flex-col\">\n {group.entries.map(({ row, at, timed }) => (\n <li\n key={row.id}\n data-testid={ids.timelineEntry(placementKey, String(row.id))}\n className=\"relative flex min-w-0 items-baseline gap-3 rounded-md py-1.5 pr-2\"\n >\n <span\n data-buro-timeline-dot=\"\"\n aria-hidden=\"true\"\n className=\"absolute top-2.5 -left-[1.1rem] size-3 rounded-full border-2 border-background bg-muted-foreground\"\n />\n <RowOpener\n title={title(row)}\n href={rowHref?.(row)}\n quick={rowQuick?.(row) ?? null}\n />\n {timed && at !== undefined ? (\n <time\n dateTime={at.toISOString()}\n className=\"w-16 shrink-0 whitespace-nowrap text-xs tabular-nums text-muted-foreground\"\n >\n {formats.time.format(at)}\n </time>\n ) : null}\n <div className={`${ITEM_LAYER_CLASS} min-w-0 flex-1`}>\n <RowContent\n resource={resource}\n raw={row}\n row={project(row)}\n item={item}\n drawn={drawn}\n columns={columns}\n variant=\"entry\"\n />\n </div>\n </li>\n ))}\n </ol>\n </section>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;AAaA,SAAS,MAAM,OAA8E;CAC3F,IAAI,OAAO,UAAU,UAAU;EAC7B,MAAM,OAAO,6BAA6B,KAAK,KAAK;EACpD,IAAI,SAAS,MACX,OAAO;GACL,MAAM,IAAI,KAAK,OAAO,KAAK,EAAE,GAAG,OAAO,KAAK,EAAE,IAAI,GAAG,OAAO,KAAK,EAAE,CAAC;GACpE,OAAO;EACT;CACJ;CACA,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,YAAY,EAAE,iBAAiB,OAC/E,OAAO,KAAA;CACT,MAAM,OAAO,IAAI,KAAK,KAAK;CAC3B,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,IAAI,KAAA,IAAY;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OACE,UAAU,GAAG,YAAY;OACzB,WAAU;OAET,UAAA,QAAQ,KAAK,OAAO,EAAE;MACnB,CAAA,IACJ;MACJ,IAAC,OAAD;OAAK,WAAW,GAAG,iBAAiB;OAClC,UAAA,IAAC,YAAD;QACY;QACV,KAAK;QACL,KAAK,QAAQ,GAAG;QACV;QACC;QACE;QACT,SAAQ;OACT,CAAA;MACE,CAAA;KACH;IAjCG,GAAA,IAAI,EAiCP,CACL;GACC,CAAA,CACG;EAzCK,GAAA,MAAM,GAyCX,CACV,CACE;;AAET"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { d as useLinkComponent } from "./toaster-CfCRLgR-.js";
|
|
2
|
+
import { h as isPlainLeftClick, m as ClaimedQuickLink, p as recordDisplayName } from "./search-access-CURsWn-U.js";
|
|
3
|
+
import { Dt as ResolvedFieldDisplay, it as useItemDrawn, kt as toDisplayText, rt as RelatedItem } from "./place-node--GdsP688.js";
|
|
4
|
+
import { i as peekRow, n as peekLeafAllowed, t as peekFieldDefinition } from "./peek-filter-ErLfO153.js";
|
|
5
|
+
import { RECORD_PROBE, resolveCapability, resolveFieldLabel, ruleContextFor } from "@burojs/core";
|
|
6
|
+
import { QUICK_ANCHOR_ATTRIBUTE, useApp, useCtx, useFieldAccess, useI18nCaps, useViewRow } from "@burojs/react";
|
|
7
|
+
import { Fragment, useCallback, useMemo } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/blocks/default-item.tsx
|
|
10
|
+
const isNumeric = (field) => field?.kind === "number";
|
|
11
|
+
function DefaultItem({ resource, row, raw, columns, variant = "card" }) {
|
|
12
|
+
const def = useApp().registry.get(resource);
|
|
13
|
+
const caps = useI18nCaps(resource);
|
|
14
|
+
const access = useRowAccess(resource)(raw);
|
|
15
|
+
const viewVisible = useViewVisible(resource);
|
|
16
|
+
const fields = def === void 0 ? [] : (columns ?? def.views?.list?.columns ?? Object.keys(def.fields)).filter((name, index, names) => name !== def.displayField && names.indexOf(name) === index && peekLeafAllowed(def, name, access, viewVisible));
|
|
17
|
+
const ref = def?.ref ?? {
|
|
18
|
+
namespace: "default",
|
|
19
|
+
id: resource
|
|
20
|
+
};
|
|
21
|
+
const definition = (name) => peekFieldDefinition(def, name);
|
|
22
|
+
const value = (name) => jsx(ResolvedFieldDisplay, {
|
|
23
|
+
resource: ref,
|
|
24
|
+
name,
|
|
25
|
+
field: definition(name),
|
|
26
|
+
value: row[name],
|
|
27
|
+
record: row,
|
|
28
|
+
fallback: toDisplayText(row[name]).text
|
|
29
|
+
});
|
|
30
|
+
const title = jsx("p", {
|
|
31
|
+
className: "truncate text-sm font-medium",
|
|
32
|
+
children: recordDisplayName(row, def?.displayField)
|
|
33
|
+
});
|
|
34
|
+
if (variant === "entry") {
|
|
35
|
+
const shown = fields.filter((name) => row[name] != null && row[name] !== "");
|
|
36
|
+
return jsxs("div", {
|
|
37
|
+
className: "flex min-w-0 flex-col gap-0.5",
|
|
38
|
+
"data-buro-default-item": "",
|
|
39
|
+
children: [title, shown.length === 0 ? null : jsx("div", {
|
|
40
|
+
"data-buro-item-meta": "",
|
|
41
|
+
className: "truncate text-xs text-muted-foreground",
|
|
42
|
+
children: shown.map((name, index) => jsxs(Fragment, { children: [index > 0 ? " · " : null, value(name)] }, name))
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const numbers = fields.filter((name) => isNumeric(definition(name)));
|
|
47
|
+
const pairs = fields.filter((name) => !isNumeric(definition(name)));
|
|
48
|
+
return jsxs("div", {
|
|
49
|
+
className: "flex min-w-0 items-start gap-3",
|
|
50
|
+
"data-buro-default-item": "",
|
|
51
|
+
children: [jsxs("div", {
|
|
52
|
+
className: "flex min-w-0 flex-1 flex-col gap-2",
|
|
53
|
+
children: [title, pairs.length === 0 ? null : jsx("dl", {
|
|
54
|
+
className: "grid gap-1.5",
|
|
55
|
+
children: pairs.map((name) => jsxs("div", {
|
|
56
|
+
className: "flex min-w-0 items-baseline gap-2 text-sm",
|
|
57
|
+
children: [jsx("dt", {
|
|
58
|
+
className: "w-24 shrink-0 truncate text-xs text-muted-foreground",
|
|
59
|
+
children: resolveFieldLabel(caps, name, definition(name)?.label)
|
|
60
|
+
}), jsx("dd", {
|
|
61
|
+
className: "min-w-0 break-words",
|
|
62
|
+
children: value(name)
|
|
63
|
+
})]
|
|
64
|
+
}, name))
|
|
65
|
+
})]
|
|
66
|
+
}), numbers.length === 0 ? null : jsx("div", {
|
|
67
|
+
"data-buro-item-trailing": "",
|
|
68
|
+
className: "flex shrink-0 flex-col items-end gap-1 border-l pl-3 text-sm tabular-nums",
|
|
69
|
+
children: numbers.map((name) => jsx("span", {
|
|
70
|
+
title: resolveFieldLabel(caps, name, definition(name)?.label),
|
|
71
|
+
children: value(name)
|
|
72
|
+
}, name))
|
|
73
|
+
})]
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/blocks/related-rows.tsx
|
|
78
|
+
function useRowAccess(resource) {
|
|
79
|
+
const app = useApp();
|
|
80
|
+
const scope = useCtx((c) => c.scope);
|
|
81
|
+
const user = useCtx((c) => c.user);
|
|
82
|
+
const permissions = useCtx((c) => c.permissions);
|
|
83
|
+
return useCallback((row) => (capability, target, defaultAllowed = true) => {
|
|
84
|
+
const rules = app.ruleSource.rules(resource);
|
|
85
|
+
if (rules.length === 0) return { allowed: defaultAllowed };
|
|
86
|
+
const ctx = ruleContextFor({
|
|
87
|
+
user,
|
|
88
|
+
scope,
|
|
89
|
+
permissions,
|
|
90
|
+
record: row,
|
|
91
|
+
mode: "show",
|
|
92
|
+
resource
|
|
93
|
+
});
|
|
94
|
+
return resolveCapability(rules, capability, target, ctx, defaultAllowed);
|
|
95
|
+
}, [
|
|
96
|
+
app.ruleSource,
|
|
97
|
+
resource,
|
|
98
|
+
scope,
|
|
99
|
+
user,
|
|
100
|
+
permissions
|
|
101
|
+
]);
|
|
102
|
+
}
|
|
103
|
+
function useViewVisible(resource) {
|
|
104
|
+
const access = useFieldAccess(resource, "every");
|
|
105
|
+
return useCallback((field) => {
|
|
106
|
+
const decision = access[field];
|
|
107
|
+
return decision === void 0 || decision.view === "visible";
|
|
108
|
+
}, [access]);
|
|
109
|
+
}
|
|
110
|
+
function useProjectedRows(resource, rows, item) {
|
|
111
|
+
const def = useApp().registry.get(resource);
|
|
112
|
+
const accessOf = useRowAccess(resource);
|
|
113
|
+
const viewRow = useViewRow(resource);
|
|
114
|
+
const viewVisible = useViewVisible(resource);
|
|
115
|
+
const idField = (def?.data)?.idField ?? "id";
|
|
116
|
+
const project = useCallback((row) => def === void 0 ? viewRow(row) : peekRow(def, viewRow(row), idField, accessOf(row), viewVisible), [
|
|
117
|
+
def,
|
|
118
|
+
idField,
|
|
119
|
+
accessOf,
|
|
120
|
+
viewRow,
|
|
121
|
+
viewVisible
|
|
122
|
+
]);
|
|
123
|
+
const hidden = useCallback((field) => field !== idField && (def === void 0 || !peekLeafAllowed(def, field, accessOf(RECORD_PROBE), viewVisible)), [
|
|
124
|
+
def,
|
|
125
|
+
idField,
|
|
126
|
+
accessOf,
|
|
127
|
+
viewVisible
|
|
128
|
+
]);
|
|
129
|
+
const probe = useMemo(() => rows[0] === void 0 ? void 0 : project(rows[0]), [rows, project]);
|
|
130
|
+
return {
|
|
131
|
+
def,
|
|
132
|
+
project,
|
|
133
|
+
drawn: useItemDrawn(item, hidden, probe),
|
|
134
|
+
title: useCallback((row) => recordDisplayName(project(row), def?.displayField), [project, def])
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function RowContent({ resource, raw, row, item, drawn, columns, variant }) {
|
|
138
|
+
const fallback = jsx(DefaultItem, {
|
|
139
|
+
resource,
|
|
140
|
+
row,
|
|
141
|
+
raw,
|
|
142
|
+
columns,
|
|
143
|
+
...variant === void 0 ? {} : { variant }
|
|
144
|
+
});
|
|
145
|
+
if (item === void 0 || !drawn) return fallback;
|
|
146
|
+
return jsx(RelatedItem, {
|
|
147
|
+
handle: item,
|
|
148
|
+
row,
|
|
149
|
+
fallback
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function RowOpener({ title, href, quick }) {
|
|
153
|
+
const RouterLink = useLinkComponent();
|
|
154
|
+
const className = "outline-none after:absolute after:inset-0 after:rounded-[inherit] focus-visible:after:ring-2 focus-visible:after:ring-ring";
|
|
155
|
+
const name = jsx("span", {
|
|
156
|
+
className: "sr-only",
|
|
157
|
+
children: title
|
|
158
|
+
});
|
|
159
|
+
if (quick !== null) return href ? jsx(ClaimedQuickLink, {
|
|
160
|
+
href,
|
|
161
|
+
className,
|
|
162
|
+
onOpen: quick,
|
|
163
|
+
children: name
|
|
164
|
+
}) : jsx("button", {
|
|
165
|
+
type: "button",
|
|
166
|
+
role: "link",
|
|
167
|
+
[QUICK_ANCHOR_ATTRIBUTE]: "",
|
|
168
|
+
className: `${className} block size-0 p-0`,
|
|
169
|
+
onClick: (event) => {
|
|
170
|
+
if (!isPlainLeftClick(event)) return;
|
|
171
|
+
quick();
|
|
172
|
+
},
|
|
173
|
+
children: name
|
|
174
|
+
});
|
|
175
|
+
if (href) return jsx(RouterLink, {
|
|
176
|
+
href,
|
|
177
|
+
className,
|
|
178
|
+
children: name
|
|
179
|
+
});
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
const ITEM_LAYER_CLASS = "relative z-[1] pointer-events-none [&_a]:pointer-events-auto [&_button]:pointer-events-auto [&_input]:pointer-events-auto [&_select]:pointer-events-auto [&_textarea]:pointer-events-auto [&_summary]:pointer-events-auto [&_[role=button]]:pointer-events-auto [&_[role=link]]:pointer-events-auto [&_[role=checkbox]]:pointer-events-auto [&_[role=switch]]:pointer-events-auto";
|
|
183
|
+
//#endregion
|
|
184
|
+
export { useProjectedRows as i, RowContent as n, RowOpener as r, ITEM_LAYER_CLASS as t };
|
|
185
|
+
|
|
186
|
+
//# sourceMappingURL=related-rows-B4levHcR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"related-rows-B4levHcR.js","names":[],"sources":["../src/blocks/default-item.tsx","../src/blocks/related-rows.tsx"],"sourcesContent":["'use client';\nimport { type EntityRef, resolveFieldLabel } from '@burojs/core';\nimport { useApp, useI18nCaps } from '@burojs/react';\nimport { Fragment, type ReactElement } from 'react';\nimport { toDisplayText } from '../fields/display-value.js';\nimport { ResolvedFieldDisplay } from '../fields/resolved-field.js';\nimport {\n type PeekFieldSource,\n peekFieldDefinition,\n peekLeafAllowed,\n} from '../quick/peek-filter.js';\nimport { recordDisplayName } from '../resource/record-display-name.js';\nimport { type ListRow, useRowAccess, useViewVisible } from './related-rows.js';\n\n/** What a default item reads of the target's definition. */\ninterface TargetDefinition extends PeekFieldSource {\n readonly views?: { readonly list?: { readonly columns?: readonly string[] } };\n readonly ref?: EntityRef;\n}\n\n/** A field the default item puts in its trailing part: a number reads best right-aligned. */\nconst isNumeric = (field: { readonly kind?: unknown } | undefined) => field?.kind === 'number';\n\n/**\n * The item of a related list that names none (P6 3.13). As a card: the row's title (weight 500),\n * its other fields as muted label / value pairs, and its numbers in a trailing part set off by a\n * rule. As a timeline entry (`variant: 'entry'`): the title and the field values on one muted\n * meta line. `row` is the projected row, so a field the viewer may not see is already `null` and\n * is not listed.\n */\nexport function DefaultItem({\n resource,\n row,\n raw,\n columns,\n variant = 'card',\n}: {\n readonly resource: string;\n readonly row: Readonly<Record<string, unknown>>;\n /** The row as the list read it: column rules resolve over it. */\n readonly raw: ListRow;\n readonly columns?: readonly string[] | undefined;\n readonly variant?: 'card' | 'entry';\n}): ReactElement {\n const app = useApp();\n const def = app.registry.get(resource) as TargetDefinition | undefined;\n const caps = useI18nCaps(resource);\n const access = useRowAccess(resource)(raw);\n const viewVisible = useViewVisible(resource);\n const fields =\n def === undefined\n ? []\n : (columns ?? def.views?.list?.columns ?? Object.keys(def.fields)).filter(\n (name, index, names) =>\n name !== def.displayField &&\n names.indexOf(name) === index &&\n peekLeafAllowed(def, name, access, viewVisible),\n );\n const ref = def?.ref ?? { namespace: 'default', id: resource };\n const definition = (name: string) =>\n peekFieldDefinition(def!, name) as { readonly label?: string; readonly kind?: unknown };\n const value = (name: string) => (\n <ResolvedFieldDisplay\n resource={ref}\n name={name}\n field={definition(name) as never}\n value={row[name]}\n record={row}\n fallback={toDisplayText(row[name]).text}\n />\n );\n const title = (\n <p className=\"truncate text-sm font-medium\">{recordDisplayName(row, def?.displayField)}</p>\n );\n if (variant === 'entry') {\n const shown = fields.filter((name) => row[name] != null && row[name] !== '');\n return (\n <div className=\"flex min-w-0 flex-col gap-0.5\" data-buro-default-item=\"\">\n {title}\n {shown.length === 0 ? null : (\n <div data-buro-item-meta=\"\" className=\"truncate text-xs text-muted-foreground\">\n {shown.map((name, index) => (\n <Fragment key={name}>\n {index > 0 ? ' · ' : null}\n {value(name)}\n </Fragment>\n ))}\n </div>\n )}\n </div>\n );\n }\n const numbers = fields.filter((name) => isNumeric(definition(name)));\n const pairs = fields.filter((name) => !isNumeric(definition(name)));\n return (\n <div className=\"flex min-w-0 items-start gap-3\" data-buro-default-item=\"\">\n <div className=\"flex min-w-0 flex-1 flex-col gap-2\">\n {title}\n {pairs.length === 0 ? null : (\n <dl className=\"grid gap-1.5\">\n {pairs.map((name) => (\n <div key={name} className=\"flex min-w-0 items-baseline gap-2 text-sm\">\n <dt className=\"w-24 shrink-0 truncate text-xs text-muted-foreground\">\n {resolveFieldLabel(caps, name, definition(name)?.label)}\n </dt>\n <dd className=\"min-w-0 break-words\">{value(name)}</dd>\n </div>\n ))}\n </dl>\n )}\n </div>\n {numbers.length === 0 ? null : (\n <div\n data-buro-item-trailing=\"\"\n className=\"flex shrink-0 flex-col items-end gap-1 border-l pl-3 text-sm tabular-nums\"\n >\n {numbers.map((name) => (\n <span key={name} title={resolveFieldLabel(caps, name, definition(name)?.label)}>\n {value(name)}\n </span>\n ))}\n </div>\n )}\n </div>\n );\n}\n","'use client';\nimport { type AppContext, RECORD_PROBE, resolveCapability, ruleContextFor } from '@burojs/core';\nimport { type CapabilityResolver, useApp, useCtx, useFieldAccess, useViewRow } from '@burojs/react';\nimport { type ReactElement, type ReactNode, useCallback, useMemo } from 'react';\nimport { QUICK_ANCHOR_ATTRIBUTE } from '@burojs/react';\nimport { ClaimedQuickLink, isPlainLeftClick } from '../fields/claimed-quick-link.js';\nimport { useLinkComponent } from '../layout/link-component.js';\nimport { type PeekFieldSource, peekLeafAllowed, peekRow } from '../quick/peek-filter.js';\nimport { recordDisplayName } from '../resource/record-display-name.js';\nimport { DefaultItem } from './default-item.js';\nimport { type ItemHandle, RelatedItem, useItemDrawn } from './related-item.js';\n\nexport type ListRow = { readonly id: string } & Readonly<Record<string, unknown>>;\n\n/** What `related-list` hands a rows view: the list's rows and how a row opens. */\nexport interface RelatedRowsProps {\n /** The target resource. */\n readonly resource: string;\n /** The placement's key (test ids). */\n readonly placementKey: string;\n readonly rows: readonly ListRow[];\n readonly item?: ItemHandle | undefined;\n /** The placement's `columns`, for the default item. */\n readonly columns?: readonly string[] | undefined;\n readonly rowQuick?: ((row: ListRow) => (() => void) | null) | undefined;\n readonly rowHref?: ((row: ListRow) => string | undefined) | undefined;\n}\n\n/**\n * A capability resolver per row: column rules resolve over the row they hide a field of, as the\n * peek's do (P6-B review), so a rule reading the record sees this row.\n */\nexport function useRowAccess(resource: string): (row: ListRow) => CapabilityResolver {\n const app = useApp();\n const scope = useCtx((c: AppContext) => c.scope);\n const user = useCtx((c: AppContext) => c.user);\n const permissions = useCtx((c: AppContext) => c.permissions);\n return useCallback(\n (row) =>\n (capability, target, defaultAllowed = true) => {\n const rules = app.ruleSource.rules(resource);\n if (rules.length === 0) return { allowed: defaultAllowed };\n const ctx = ruleContextFor({\n user,\n scope,\n permissions,\n record: row,\n mode: 'show',\n resource,\n });\n return resolveCapability(rules, capability, target, ctx, defaultAllowed);\n },\n [app.ruleSource, resource, scope, user, permissions],\n );\n}\n\n/**\n * Whether a field may be drawn on every row by its P5 view (P5 spec 3.6.6): a decision that is\n * not `visible` (`hidden`, `restricted`, `failed` and `pending` alike, so nothing is drawn while\n * the permission map loads) withholds it. A field the map does not decide is not withheld here. The decision\n * is the any-record one ({@link RECORD_PROBE}), so a rule reading the record counts as hiding.\n */\nexport function useViewVisible(resource: string): (field: string) => boolean {\n const access = useFieldAccess(resource, 'every');\n return useCallback(\n (field) => {\n const decision = access[field];\n return decision === undefined || decision.view === 'visible';\n },\n [access],\n );\n}\n\ninterface ProjectedRows {\n readonly def:\n | (PeekFieldSource & { readonly displayField?: string; readonly data?: unknown })\n | undefined;\n /** The row a card or an entry sees: the id and what the viewer may see; the rest read `null`. */\n readonly project: (row: ListRow) => ListRow;\n /** Whether the item block is drawn (decided once for the list), else the default item. */\n readonly drawn: boolean;\n readonly title: (row: ListRow) => string;\n}\n\n/**\n * The rows of a cards or timeline view, projected once and the item decided once per list.\n *\n * The rows arrive as the list read them (policy). A row is first projected by P5's field view\n * (`viewRow`: a field its user may not view for every row is left out) and then by the peek's\n * rule ({@link peekRow}): the id field and every field that is not `sensitive`, not withheld by\n * a field `requires.view` and not hidden by a `column` rule keep their values; every other\n * field reads `null`. It is the one place a row's fields are filtered before an item block or\n * the default item sees them (P6-66), and the timeline's axis reads the same row.\n */\nexport function useProjectedRows(\n resource: string,\n rows: readonly ListRow[],\n item: ItemHandle | undefined,\n): ProjectedRows {\n const app = useApp();\n const def = app.registry.get(resource) as ProjectedRows['def'];\n const accessOf = useRowAccess(resource);\n const viewRow = useViewRow(resource);\n const viewVisible = useViewVisible(resource);\n const idField = (def?.data as { readonly idField?: string } | undefined)?.idField ?? 'id';\n const project = useCallback(\n (row: ListRow): ListRow =>\n (def === undefined\n ? viewRow(row)\n : peekRow(def, viewRow(row), idField, accessOf(row), viewVisible)) as ListRow,\n [def, idField, accessOf, viewRow, viewVisible],\n );\n const hidden = useCallback(\n (field: string) =>\n field !== idField &&\n (def === undefined ||\n !peekLeafAllowed(def, field, accessOf(RECORD_PROBE as ListRow), viewVisible)),\n [def, idField, accessOf, viewVisible],\n );\n const probe = useMemo(\n () => (rows[0] === undefined ? undefined : project(rows[0])),\n [rows, project],\n );\n const drawn = useItemDrawn(item, hidden, probe);\n const title = useCallback(\n (row: ListRow) => recordDisplayName(project(row), def?.displayField),\n [project, def],\n );\n return { def, project, drawn, title };\n}\n\n/** The item block (or the default item) of one row. */\nexport function RowContent({\n resource,\n raw,\n row,\n item,\n drawn,\n columns,\n variant,\n}: {\n readonly resource: string;\n /** The row as the list read it (column rules resolve over it). */\n readonly raw: ListRow;\n /** The projected row. */\n readonly row: ListRow;\n readonly item: ItemHandle | undefined;\n readonly drawn: boolean;\n readonly columns?: readonly string[] | undefined;\n /** How the default item lays the row out: a card's, or a timeline entry's. */\n readonly variant?: 'card' | 'entry';\n}): ReactElement {\n const fallback = (\n <DefaultItem\n resource={resource}\n row={row}\n raw={raw}\n columns={columns}\n {...(variant === undefined ? {} : { variant })}\n />\n );\n if (item === undefined || !drawn) return fallback;\n return <RelatedItem handle={item} row={row} fallback={fallback} />;\n}\n\n/**\n * A card's or an entry's one opener (P6-74): the row's title as the accessible name of a single\n * anchor whose `::after` covers the positioned parent. A quick row is the page anchor claimed\n * for the opener (a modified click follows the `href`), or a link-role button without a page.\n * `open: 'none'` draws nothing.\n */\nexport function RowOpener({\n title,\n href,\n quick,\n}: {\n readonly title: string;\n readonly href: string | undefined;\n readonly quick: (() => void) | null;\n}): ReactElement | null {\n const RouterLink = useLinkComponent();\n const className =\n 'outline-none after:absolute after:inset-0 after:rounded-[inherit] focus-visible:after:ring-2 focus-visible:after:ring-ring';\n const name: ReactNode = <span className=\"sr-only\">{title}</span>;\n if (quick !== null)\n return href ? (\n <ClaimedQuickLink href={href} className={className} onOpen={quick}>\n {name}\n </ClaimedQuickLink>\n ) : (\n <button\n type=\"button\"\n role=\"link\"\n {...{ [QUICK_ANCHOR_ATTRIBUTE]: '' }}\n // A button is inline-block, so even with only an `sr-only` name it took a line of the\n // card and pushed the content down (REF-40). Zero-size and unpositioned, its `::after`\n // still covers the card.\n className={`${className} block size-0 p-0`}\n onClick={(event) => {\n if (!isPlainLeftClick(event)) return;\n quick();\n }}\n >\n {name}\n </button>\n );\n if (href)\n return (\n <RouterLink href={href} className={className}>\n {name}\n </RouterLink>\n );\n return null;\n}\n\n/**\n * The wrapper that raises an item's interactive descendants above the opener's cover (P6-74):\n * the wrapper itself lets clicks through to the opener, its controls take them.\n */\nexport const ITEM_LAYER_CLASS =\n 'relative z-[1] pointer-events-none [&_a]:pointer-events-auto [&_button]:pointer-events-auto [&_input]:pointer-events-auto [&_select]:pointer-events-auto [&_textarea]:pointer-events-auto [&_summary]:pointer-events-auto [&_[role=button]]:pointer-events-auto [&_[role=link]]:pointer-events-auto [&_[role=checkbox]]:pointer-events-auto [&_[role=switch]]:pointer-events-auto';\n"],"mappings":";;;;;;;;;AAqBA,MAAM,aAAa,UAAmD,OAAO,SAAS;AAStF,SAAgB,YAAY,EAC1B,UACA,KACA,KACA,SACA,UAAU,UAQK;CAEf,MAAM,MADM,OACE,CAAC,CAAC,SAAS,IAAI,QAAQ;CACrC,MAAM,OAAO,YAAY,QAAQ;CACjC,MAAM,SAAS,aAAa,QAAQ,CAAC,CAAC,GAAG;CACzC,MAAM,cAAc,eAAe,QAAQ;CAC3C,MAAM,SACJ,QAAQ,KAAA,IACJ,CAAC,KACA,WAAW,IAAI,OAAO,MAAM,WAAW,OAAO,KAAK,IAAI,MAAM,EAAA,CAAG,QAC9D,MAAM,OAAO,UACZ,SAAS,IAAI,gBACb,MAAM,QAAQ,IAAI,MAAM,SACxB,gBAAgB,KAAK,MAAM,QAAQ,WAAW,CAClD;CACN,MAAM,MAAM,KAAK,OAAO;EAAE,WAAW;EAAW,IAAI;CAAS;CAC7D,MAAM,cAAc,SAClB,oBAAoB,KAAM,IAAI;CAChC,MAAM,SAAS,SACb,IAAC,sBAAD;EACE,UAAU;EACJ;EACN,OAAO,WAAW,IAAI;EACtB,OAAO,IAAI;EACX,QAAQ;EACR,UAAU,cAAc,IAAI,KAAK,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