@ai-matrx/associations 0.13.21 → 0.13.23
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 +22 -0
- package/dist/{CommentThread-DIGM3P6_.d.cts → CommentThread-oaeNU_5g.d.cts} +16 -3
- package/dist/{CommentThread-DIGM3P6_.d.ts → CommentThread-oaeNU_5g.d.ts} +16 -3
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/index.cjs +473 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -17573
- package/dist/index.d.ts +7 -17573
- package/dist/index.js +473 -1
- package/dist/index.js.map +1 -1
- package/dist/ports-D2Im-Tjl.d.cts +17575 -0
- package/dist/ports-D2Im-Tjl.d.ts +17575 -0
- package/dist/react/index.cjs +200 -83
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +2 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +200 -83
- package/dist/react/index.js.map +1 -1
- package/dist/react/lazy/index.d.cts +1 -1
- package/dist/react/lazy/index.d.ts +1 -1
- package/package.json +3 -3
package/dist/react/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { j as AssociationsNotifier, W as WindowShellPort, k as CapturePort, P as PickerOverrideMap, E as EntityDoorsPort, l as AuthorDisplayPort, m as AssociationsStore, n as CategoryMutationResult, o as CategoryDimension, p as PlatformCategory, q as CategoriesEntry, r as EntityTypeToken, s as UniversalCandidate, t as CandidateRecord, u as PlatformComment, v as CommentsEntry, w as CommentMutationResult, e as AssociationPickerProps, x as EntityDoorProps, y as EntityRefProps, z as ContentRole } from '../CommentThread-
|
|
4
|
-
export { B as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, D as AssociationCard, F as AssociationCardGrid, b as AssociationCardGridProps, a as AssociationCardProps,
|
|
3
|
+
import { j as AssociationsNotifier, W as WindowShellPort, k as CapturePort, P as PickerOverrideMap, E as EntityDoorsPort, l as AuthorDisplayPort, m as AssociationsStore, n as CategoryMutationResult, o as CategoryDimension, p as PlatformCategory, q as CategoriesEntry, r as EntityTypeToken, s as UniversalCandidate, t as CandidateRecord, u as PlatformComment, v as CommentsEntry, w as CommentMutationResult, e as AssociationPickerProps, x as EntityDoorProps, y as EntityRefProps, z as ContentRole } from '../CommentThread-oaeNU_5g.cjs';
|
|
4
|
+
export { B as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, D as AssociationCard, F as AssociationCardGrid, b as AssociationCardGridProps, G as AssociationCardLook, a as AssociationCardProps, H as AssociationEntitySelect, I as AssociationEntitySelectAdapter, J as AssociationEntitySelectItem, c as AssociationEntitySelectProps, K as AssociationList, d as AssociationListProps, L as AssociationWindow, f as AssociationWindowProps, M as AssociationWriteResult, N as AttachedItemsSheet, g as AttachedItemsSheetProps, O as CaptureAttach, Q as CaptureAttachResult, R as CaptureToolbarAction, S as CategorySelect, C as CategorySelectProps, T as CategoryTagPicker, h as CategoryTagPickerProps, V as CommentComposer, X as CommentComposerProps, Y as CommentThread, i as CommentThreadProps, Z as ContainerLink, _ as ContainerResourceRow, $ as ContainerResourcesAdapter, a0 as DefaultEntityIcon, a1 as PrimaryContainerEntity, a2 as PrimaryEntity, a3 as PrimaryEntityProvider, a4 as PrimaryFiledEntity, a5 as TagPickerIcon, a6 as UniversalAssociationPicker, U as UniversalAssociationPickerProps, a7 as UseAssociationEntitySelectAdapterArgs, a8 as UseAssociationsArgs, a9 as UseAssociationsReturn, aa as UseContainerLinksArgs, ab as UseContainerLinksReturn, ac as attachedKey, ad as buildCommentTree, ae as containerLinksArgs, af as linkDirection, ag as useAssociationEntitySelectAdapter, ah as useAssociations, ai as useContainerLinks, aj as useContainerLinksAdapter, ak as useEntityRelationships, al as usePrimaryEntity } from '../CommentThread-oaeNU_5g.cjs';
|
|
5
5
|
|
|
6
6
|
interface AssociationsUiPorts {
|
|
7
7
|
notifier?: AssociationsNotifier;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { j as AssociationsNotifier, W as WindowShellPort, k as CapturePort, P as PickerOverrideMap, E as EntityDoorsPort, l as AuthorDisplayPort, m as AssociationsStore, n as CategoryMutationResult, o as CategoryDimension, p as PlatformCategory, q as CategoriesEntry, r as EntityTypeToken, s as UniversalCandidate, t as CandidateRecord, u as PlatformComment, v as CommentsEntry, w as CommentMutationResult, e as AssociationPickerProps, x as EntityDoorProps, y as EntityRefProps, z as ContentRole } from '../CommentThread-
|
|
4
|
-
export { B as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, D as AssociationCard, F as AssociationCardGrid, b as AssociationCardGridProps, a as AssociationCardProps,
|
|
3
|
+
import { j as AssociationsNotifier, W as WindowShellPort, k as CapturePort, P as PickerOverrideMap, E as EntityDoorsPort, l as AuthorDisplayPort, m as AssociationsStore, n as CategoryMutationResult, o as CategoryDimension, p as PlatformCategory, q as CategoriesEntry, r as EntityTypeToken, s as UniversalCandidate, t as CandidateRecord, u as PlatformComment, v as CommentsEntry, w as CommentMutationResult, e as AssociationPickerProps, x as EntityDoorProps, y as EntityRefProps, z as ContentRole } from '../CommentThread-oaeNU_5g.js';
|
|
4
|
+
export { B as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, D as AssociationCard, F as AssociationCardGrid, b as AssociationCardGridProps, G as AssociationCardLook, a as AssociationCardProps, H as AssociationEntitySelect, I as AssociationEntitySelectAdapter, J as AssociationEntitySelectItem, c as AssociationEntitySelectProps, K as AssociationList, d as AssociationListProps, L as AssociationWindow, f as AssociationWindowProps, M as AssociationWriteResult, N as AttachedItemsSheet, g as AttachedItemsSheetProps, O as CaptureAttach, Q as CaptureAttachResult, R as CaptureToolbarAction, S as CategorySelect, C as CategorySelectProps, T as CategoryTagPicker, h as CategoryTagPickerProps, V as CommentComposer, X as CommentComposerProps, Y as CommentThread, i as CommentThreadProps, Z as ContainerLink, _ as ContainerResourceRow, $ as ContainerResourcesAdapter, a0 as DefaultEntityIcon, a1 as PrimaryContainerEntity, a2 as PrimaryEntity, a3 as PrimaryEntityProvider, a4 as PrimaryFiledEntity, a5 as TagPickerIcon, a6 as UniversalAssociationPicker, U as UniversalAssociationPickerProps, a7 as UseAssociationEntitySelectAdapterArgs, a8 as UseAssociationsArgs, a9 as UseAssociationsReturn, aa as UseContainerLinksArgs, ab as UseContainerLinksReturn, ac as attachedKey, ad as buildCommentTree, ae as containerLinksArgs, af as linkDirection, ag as useAssociationEntitySelectAdapter, ah as useAssociations, ai as useContainerLinks, aj as useContainerLinksAdapter, ak as useEntityRelationships, al as usePrimaryEntity } from '../CommentThread-oaeNU_5g.js';
|
|
5
5
|
|
|
6
6
|
interface AssociationsUiPorts {
|
|
7
7
|
notifier?: AssociationsNotifier;
|
package/dist/react/index.js
CHANGED
|
@@ -3809,10 +3809,60 @@ function AttachedItemsBody({
|
|
|
3809
3809
|
import { useState as useState10 } from "react";
|
|
3810
3810
|
import { cn as cn7 } from "@ai-matrx/design-system";
|
|
3811
3811
|
import { TapTargetButton } from "@ai-matrx/design-system/tap-target";
|
|
3812
|
+
|
|
3813
|
+
// src/react/contentRoles.ts
|
|
3814
|
+
var CONTENT_ROLES = [
|
|
3815
|
+
{
|
|
3816
|
+
id: "utility",
|
|
3817
|
+
title: "Utilities",
|
|
3818
|
+
tagline: "The agents and tools that act on your knowledge.",
|
|
3819
|
+
accentText: "text-violet-600 dark:text-violet-400",
|
|
3820
|
+
accentBg: "bg-violet-500/10",
|
|
3821
|
+
accentBar: "bg-violet-500"
|
|
3822
|
+
},
|
|
3823
|
+
{
|
|
3824
|
+
id: "source",
|
|
3825
|
+
title: "Sources",
|
|
3826
|
+
tagline: "Incoming sources of truth (Knowledge In).",
|
|
3827
|
+
accentText: "text-sky-600 dark:text-sky-400",
|
|
3828
|
+
accentBg: "bg-sky-500/10",
|
|
3829
|
+
accentBar: "bg-sky-500"
|
|
3830
|
+
},
|
|
3831
|
+
{
|
|
3832
|
+
id: "destination",
|
|
3833
|
+
title: "Outputs",
|
|
3834
|
+
tagline: "Knowledge your team produces.",
|
|
3835
|
+
accentText: "text-emerald-600 dark:text-emerald-400",
|
|
3836
|
+
accentBg: "bg-emerald-500/10",
|
|
3837
|
+
accentBar: "bg-emerald-500"
|
|
3838
|
+
},
|
|
3839
|
+
{
|
|
3840
|
+
id: "hybrid",
|
|
3841
|
+
title: "Sources & Outputs",
|
|
3842
|
+
tagline: "Read from and written to.",
|
|
3843
|
+
accentText: "text-teal-600 dark:text-teal-400",
|
|
3844
|
+
accentBg: "bg-teal-500/10",
|
|
3845
|
+
accentBar: "bg-gradient-to-r from-sky-500 to-emerald-500"
|
|
3846
|
+
},
|
|
3847
|
+
{
|
|
3848
|
+
id: "container",
|
|
3849
|
+
title: "Workspaces",
|
|
3850
|
+
tagline: "How work is organized.",
|
|
3851
|
+
accentText: "text-amber-600 dark:text-amber-400",
|
|
3852
|
+
accentBg: "bg-amber-500/10",
|
|
3853
|
+
accentBar: "bg-amber-500"
|
|
3854
|
+
}
|
|
3855
|
+
];
|
|
3856
|
+
function getContentRoleMeta(role) {
|
|
3857
|
+
return CONTENT_ROLES.find((r) => r.id === role) ?? CONTENT_ROLES[2];
|
|
3858
|
+
}
|
|
3859
|
+
|
|
3860
|
+
// src/react/components/AssociationCard.tsx
|
|
3812
3861
|
import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3813
3862
|
function AssociationCard({
|
|
3814
3863
|
token,
|
|
3815
3864
|
container: containerProp,
|
|
3865
|
+
look = "tiles",
|
|
3816
3866
|
className
|
|
3817
3867
|
}) {
|
|
3818
3868
|
const store = useAssociationsStore();
|
|
@@ -3820,6 +3870,7 @@ function AssociationCard({
|
|
|
3820
3870
|
const container = containerProp ?? fromCtx;
|
|
3821
3871
|
const [open, setOpen] = useState10(false);
|
|
3822
3872
|
const info = store.registry.getEntityInfo(token);
|
|
3873
|
+
const role = getContentRoleMeta(info.contentRole);
|
|
3823
3874
|
const Icon = info.Icon ?? DefaultEntityIcon;
|
|
3824
3875
|
const [listOpen, setListOpen] = useState10(false);
|
|
3825
3876
|
const {
|
|
@@ -3845,43 +3896,118 @@ function AssociationCard({
|
|
|
3845
3896
|
const canAttach = info.canListCandidates && (!filing || isAssociationTargetType(token));
|
|
3846
3897
|
const canDrillIn = count > 0;
|
|
3847
3898
|
const countWord = filing ? "filed under" : "attached";
|
|
3899
|
+
const drillTitle = canDrillIn ? `View the ${info.labelPlural.toLowerCase()} attached to ${container.label ?? "this"}` : void 0;
|
|
3848
3900
|
return /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
3849
|
-
|
|
3901
|
+
look === "simplified" ? (
|
|
3902
|
+
// SIMPLIFIED (opt-in, off by default): one header line — small icon,
|
|
3903
|
+
// UPPERCASE name, count, round ghost "+" — the same geometry as the
|
|
3904
|
+
// CRM record's SectionCard header, so the two sit flush together.
|
|
3905
|
+
// TapTargetButton puts `className` on its ICON, not the button: never
|
|
3906
|
+
// pass layout classes there (an `ml-auto` pushed the "+" glyph off
|
|
3907
|
+
// center inside its circle). The flex-1 drill button already puts the
|
|
3908
|
+
// "+" at the end of the row.
|
|
3909
|
+
/* @__PURE__ */ jsxs9(
|
|
3910
|
+
"div",
|
|
3911
|
+
{
|
|
3912
|
+
"data-association-card": token,
|
|
3913
|
+
"data-association-card-look": "simplified",
|
|
3914
|
+
className: cn7(
|
|
3915
|
+
"flex min-h-8 items-center gap-x-1.5 rounded-md border border-border bg-card px-2.5 py-1 sm:py-0 lg:pointer-fine:[--matrx-tap-target-size:1.75rem]",
|
|
3916
|
+
className
|
|
3917
|
+
),
|
|
3918
|
+
children: [
|
|
3919
|
+
/* @__PURE__ */ jsxs9(
|
|
3920
|
+
"button",
|
|
3921
|
+
{
|
|
3922
|
+
type: "button",
|
|
3923
|
+
disabled: !canDrillIn,
|
|
3924
|
+
onClick: () => setListOpen(true),
|
|
3925
|
+
title: drillTitle,
|
|
3926
|
+
"aria-label": loading ? info.labelPlural : `${info.labelPlural}: ${count} ${countWord}`,
|
|
3927
|
+
className: cn7(
|
|
3928
|
+
"flex min-h-8 min-w-0 flex-1 items-center gap-x-1.5 text-left",
|
|
3929
|
+
canDrillIn ? "cursor-pointer hover:text-foreground" : "cursor-default"
|
|
3930
|
+
),
|
|
3931
|
+
children: [
|
|
3932
|
+
/* @__PURE__ */ jsx11(Icon, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
3933
|
+
/* @__PURE__ */ jsx11("span", { className: "min-w-0 truncate text-xs font-semibold uppercase tracking-wider text-foreground", children: info.labelPlural }),
|
|
3934
|
+
loading ? /* @__PURE__ */ jsx11(SpinnerIcon, { className: "h-3 w-3 animate-spin text-muted-foreground" }) : /* @__PURE__ */ jsx11("span", { className: "text-xs tabular-nums text-muted-foreground", children: count })
|
|
3935
|
+
]
|
|
3936
|
+
}
|
|
3937
|
+
),
|
|
3938
|
+
canAttach && /* @__PURE__ */ jsx11(
|
|
3939
|
+
TapTargetButton,
|
|
3940
|
+
{
|
|
3941
|
+
ariaLabel: `Attach ${info.labelPlural.toLowerCase()}`,
|
|
3942
|
+
tooltip: false,
|
|
3943
|
+
onClick: () => setOpen(true),
|
|
3944
|
+
icon: /* @__PURE__ */ jsx11(PlusIcon, { className: "h-4 w-4" })
|
|
3945
|
+
}
|
|
3946
|
+
)
|
|
3947
|
+
]
|
|
3948
|
+
}
|
|
3949
|
+
)
|
|
3950
|
+
) : /* @__PURE__ */ jsxs9(
|
|
3850
3951
|
"div",
|
|
3851
3952
|
{
|
|
3852
3953
|
"data-association-card": token,
|
|
3954
|
+
"data-association-card-look": "tiles",
|
|
3853
3955
|
className: cn7(
|
|
3854
|
-
"flex
|
|
3956
|
+
"group relative flex items-center gap-3 overflow-hidden rounded-xl border border-border bg-card transition-all hover:border-primary/30 hover:bg-accent/40",
|
|
3855
3957
|
className
|
|
3856
3958
|
),
|
|
3857
3959
|
children: [
|
|
3960
|
+
/* @__PURE__ */ jsx11(
|
|
3961
|
+
"span",
|
|
3962
|
+
{
|
|
3963
|
+
className: cn7(
|
|
3964
|
+
"absolute inset-x-0 top-0 h-0.5 opacity-60",
|
|
3965
|
+
role.accentBar
|
|
3966
|
+
)
|
|
3967
|
+
}
|
|
3968
|
+
),
|
|
3858
3969
|
/* @__PURE__ */ jsxs9(
|
|
3859
3970
|
"button",
|
|
3860
3971
|
{
|
|
3861
3972
|
type: "button",
|
|
3862
3973
|
disabled: !canDrillIn,
|
|
3863
3974
|
onClick: () => setListOpen(true),
|
|
3864
|
-
title:
|
|
3865
|
-
"aria-label": loading ? info.labelPlural : `${info.labelPlural}: ${count} ${countWord}`,
|
|
3975
|
+
title: drillTitle,
|
|
3866
3976
|
className: cn7(
|
|
3867
|
-
"flex min-
|
|
3868
|
-
canDrillIn ? "cursor-pointer
|
|
3977
|
+
"flex min-w-0 flex-1 items-center gap-3 px-3 py-2.5 text-left",
|
|
3978
|
+
canDrillIn ? "cursor-pointer" : "cursor-default"
|
|
3869
3979
|
),
|
|
3870
3980
|
children: [
|
|
3871
|
-
/* @__PURE__ */ jsx11(
|
|
3872
|
-
|
|
3873
|
-
|
|
3981
|
+
/* @__PURE__ */ jsx11(
|
|
3982
|
+
"span",
|
|
3983
|
+
{
|
|
3984
|
+
className: cn7(
|
|
3985
|
+
"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg",
|
|
3986
|
+
role.accentBg,
|
|
3987
|
+
role.accentText
|
|
3988
|
+
),
|
|
3989
|
+
children: /* @__PURE__ */ jsx11(Icon, { className: "h-4 w-4" })
|
|
3990
|
+
}
|
|
3991
|
+
),
|
|
3992
|
+
/* @__PURE__ */ jsxs9("span", { className: "min-w-0 flex-1", children: [
|
|
3993
|
+
/* @__PURE__ */ jsx11("span", { className: "block truncate text-sm font-medium text-foreground", children: info.labelPlural }),
|
|
3994
|
+
/* @__PURE__ */ jsx11("span", { className: "block text-xs text-muted-foreground tabular-nums", children: loading ? /* @__PURE__ */ jsxs9("span", { className: "inline-flex items-center gap-1", children: [
|
|
3995
|
+
/* @__PURE__ */ jsx11(SpinnerIcon, { className: "h-3 w-3 animate-spin" }),
|
|
3996
|
+
"Loading\u2026"
|
|
3997
|
+
] }) : `${count} ${countWord}` })
|
|
3998
|
+
] })
|
|
3874
3999
|
]
|
|
3875
4000
|
}
|
|
3876
4001
|
),
|
|
3877
4002
|
canAttach && /* @__PURE__ */ jsx11(
|
|
3878
|
-
|
|
4003
|
+
"button",
|
|
3879
4004
|
{
|
|
3880
|
-
|
|
3881
|
-
tooltip: false,
|
|
4005
|
+
type: "button",
|
|
3882
4006
|
onClick: () => setOpen(true),
|
|
3883
|
-
|
|
3884
|
-
|
|
4007
|
+
"aria-label": `Attach ${info.labelPlural.toLowerCase()}`,
|
|
4008
|
+
title: `Attach ${info.labelPlural.toLowerCase()}`,
|
|
4009
|
+
className: "mr-2 flex h-11 w-11 shrink-0 items-center justify-center rounded-md border border-border text-muted-foreground transition-colors hover:border-primary/60 hover:text-foreground lg:mr-3 lg:h-7 lg:w-7",
|
|
4010
|
+
children: /* @__PURE__ */ jsx11(PlusIcon, { className: "h-4 w-4" })
|
|
3885
4011
|
}
|
|
3886
4012
|
)
|
|
3887
4013
|
]
|
|
@@ -3902,8 +4028,8 @@ function AssociationCard({
|
|
|
3902
4028
|
setOpen(true);
|
|
3903
4029
|
}
|
|
3904
4030
|
} : {},
|
|
3905
|
-
onDetach: (resourceId,
|
|
3906
|
-
onSetPinned: (resourceId, pinned,
|
|
4031
|
+
onDetach: (resourceId, role2) => detach(token, resourceId, role2 ?? void 0),
|
|
4032
|
+
onSetPinned: (resourceId, pinned, role2) => setPinned(token, resourceId, pinned, role2 ?? void 0)
|
|
3907
4033
|
}
|
|
3908
4034
|
),
|
|
3909
4035
|
canAttach && /* @__PURE__ */ jsx11(
|
|
@@ -3925,61 +4051,29 @@ function AssociationCard({
|
|
|
3925
4051
|
|
|
3926
4052
|
// src/react/components/AssociationCardGrid.tsx
|
|
3927
4053
|
import { cn as cn8 } from "@ai-matrx/design-system";
|
|
3928
|
-
|
|
3929
|
-
// src/react/contentRoles.ts
|
|
3930
|
-
var CONTENT_ROLES = [
|
|
3931
|
-
{
|
|
3932
|
-
id: "utility",
|
|
3933
|
-
title: "Utilities",
|
|
3934
|
-
tagline: "The agents and tools that act on your knowledge.",
|
|
3935
|
-
accentText: "text-violet-600 dark:text-violet-400",
|
|
3936
|
-
accentBg: "bg-violet-500/10",
|
|
3937
|
-
accentBar: "bg-violet-500"
|
|
3938
|
-
},
|
|
3939
|
-
{
|
|
3940
|
-
id: "source",
|
|
3941
|
-
title: "Sources",
|
|
3942
|
-
tagline: "Incoming sources of truth (Knowledge In).",
|
|
3943
|
-
accentText: "text-sky-600 dark:text-sky-400",
|
|
3944
|
-
accentBg: "bg-sky-500/10",
|
|
3945
|
-
accentBar: "bg-sky-500"
|
|
3946
|
-
},
|
|
3947
|
-
{
|
|
3948
|
-
id: "destination",
|
|
3949
|
-
title: "Outputs",
|
|
3950
|
-
tagline: "Knowledge your team produces.",
|
|
3951
|
-
accentText: "text-emerald-600 dark:text-emerald-400",
|
|
3952
|
-
accentBg: "bg-emerald-500/10",
|
|
3953
|
-
accentBar: "bg-emerald-500"
|
|
3954
|
-
},
|
|
3955
|
-
{
|
|
3956
|
-
id: "hybrid",
|
|
3957
|
-
title: "Sources & Outputs",
|
|
3958
|
-
tagline: "Read from and written to.",
|
|
3959
|
-
accentText: "text-teal-600 dark:text-teal-400",
|
|
3960
|
-
accentBg: "bg-teal-500/10",
|
|
3961
|
-
accentBar: "bg-gradient-to-r from-sky-500 to-emerald-500"
|
|
3962
|
-
},
|
|
3963
|
-
{
|
|
3964
|
-
id: "container",
|
|
3965
|
-
title: "Workspaces",
|
|
3966
|
-
tagline: "How work is organized.",
|
|
3967
|
-
accentText: "text-amber-600 dark:text-amber-400",
|
|
3968
|
-
accentBg: "bg-amber-500/10",
|
|
3969
|
-
accentBar: "bg-amber-500"
|
|
3970
|
-
}
|
|
3971
|
-
];
|
|
3972
|
-
function getContentRoleMeta(role) {
|
|
3973
|
-
return CONTENT_ROLES.find((r) => r.id === role) ?? CONTENT_ROLES[2];
|
|
3974
|
-
}
|
|
3975
|
-
|
|
3976
|
-
// src/react/components/AssociationCardGrid.tsx
|
|
3977
4054
|
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3978
|
-
var
|
|
3979
|
-
var
|
|
4055
|
+
var SIMPLE_GROUP_LABEL = "mb-1 text-xs font-medium uppercase tracking-wider text-muted-foreground";
|
|
4056
|
+
var SIMPLE_TILE_ROW = "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1";
|
|
4057
|
+
var TILE_GRID = "grid grid-cols-1 gap-2 @md:grid-cols-2 @3xl:grid-cols-3";
|
|
4058
|
+
function GroupHeader({
|
|
4059
|
+
look,
|
|
4060
|
+
title,
|
|
4061
|
+
tagline,
|
|
4062
|
+
dotClassName
|
|
4063
|
+
}) {
|
|
4064
|
+
if (look === "simplified") return /* @__PURE__ */ jsx12("h3", { className: SIMPLE_GROUP_LABEL, children: title });
|
|
4065
|
+
return /* @__PURE__ */ jsxs10("div", { className: "mb-2.5 flex items-baseline gap-3 pl-1.5", children: [
|
|
4066
|
+
dotClassName ? /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
|
|
4067
|
+
/* @__PURE__ */ jsx12("span", { className: cn8("h-2.5 w-2.5 rounded-full", dotClassName) }),
|
|
4068
|
+
/* @__PURE__ */ jsx12("h3", { className: "text-sm font-semibold text-foreground", children: title })
|
|
4069
|
+
] }) : /* @__PURE__ */ jsx12("h3", { className: "text-sm font-semibold text-foreground", children: title }),
|
|
4070
|
+
/* @__PURE__ */ jsx12("p", { className: "hidden text-xs text-muted-foreground sm:block", children: tagline })
|
|
4071
|
+
] });
|
|
4072
|
+
}
|
|
3980
4073
|
function AssociationCardGrid({
|
|
3981
4074
|
tokens,
|
|
3982
4075
|
excludeTokens,
|
|
4076
|
+
look = "tiles",
|
|
3983
4077
|
className
|
|
3984
4078
|
}) {
|
|
3985
4079
|
const store = useAssociationsStore();
|
|
@@ -4002,22 +4096,45 @@ function AssociationCardGrid({
|
|
|
4002
4096
|
const role = store.registry.getEntityInfo(token).contentRole;
|
|
4003
4097
|
return !role || !roleIds.has(role);
|
|
4004
4098
|
}) : [];
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4099
|
+
const rowClass = look === "simplified" ? SIMPLE_TILE_ROW : TILE_GRID;
|
|
4100
|
+
return /* @__PURE__ */ jsxs10(
|
|
4101
|
+
"div",
|
|
4102
|
+
{
|
|
4103
|
+
"data-association-grid-look": look,
|
|
4104
|
+
className: cn8("@container", look === "simplified" ? "space-y-3" : "space-y-5", className),
|
|
4105
|
+
children: [
|
|
4106
|
+
CONTENT_ROLES.map((role) => {
|
|
4107
|
+
const inRole = list.filter(
|
|
4108
|
+
(token) => store.registry.getEntityInfo(token).contentRole === role.id
|
|
4109
|
+
);
|
|
4110
|
+
if (inRole.length === 0) return null;
|
|
4111
|
+
return /* @__PURE__ */ jsxs10("section", { children: [
|
|
4112
|
+
/* @__PURE__ */ jsx12(
|
|
4113
|
+
GroupHeader,
|
|
4114
|
+
{
|
|
4115
|
+
look,
|
|
4116
|
+
title: role.title,
|
|
4117
|
+
tagline: role.tagline,
|
|
4118
|
+
dotClassName: role.accentBar
|
|
4119
|
+
}
|
|
4120
|
+
),
|
|
4121
|
+
/* @__PURE__ */ jsx12("div", { className: rowClass, children: inRole.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token, look }, token)) })
|
|
4122
|
+
] }, role.id);
|
|
4123
|
+
}),
|
|
4124
|
+
roleless.length > 0 && /* @__PURE__ */ jsxs10("section", { children: [
|
|
4125
|
+
/* @__PURE__ */ jsx12(
|
|
4126
|
+
GroupHeader,
|
|
4127
|
+
{
|
|
4128
|
+
look,
|
|
4129
|
+
title: "Filed under",
|
|
4130
|
+
tagline: "Libraries, topics and other places this is kept."
|
|
4131
|
+
}
|
|
4132
|
+
),
|
|
4133
|
+
/* @__PURE__ */ jsx12("div", { className: rowClass, children: roleless.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token, look }, token)) })
|
|
4134
|
+
] })
|
|
4135
|
+
]
|
|
4136
|
+
}
|
|
4137
|
+
);
|
|
4021
4138
|
}
|
|
4022
4139
|
|
|
4023
4140
|
// src/react/components/AssociationList.tsx
|