@ai-matrx/associations 0.13.22 → 0.13.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/{CommentThread-DIGM3P6_.d.cts → CommentThread-CRR3jLBl.d.cts} +19 -4
- package/dist/{CommentThread-DIGM3P6_.d.ts → CommentThread-CRR3jLBl.d.ts} +19 -4
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/{ports-D2Im-Tjl.d.cts → ports-vvtD75Sp.d.cts} +1 -1
- package/dist/{ports-D2Im-Tjl.d.ts → ports-vvtD75Sp.d.ts} +1 -1
- package/dist/react/index.cjs +217 -84
- 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 +217 -84
- 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 -2
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-CRR3jLBl.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-CRR3jLBl.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-CRR3jLBl.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-CRR3jLBl.js';
|
|
5
5
|
|
|
6
6
|
interface AssociationsUiPorts {
|
|
7
7
|
notifier?: AssociationsNotifier;
|
package/dist/react/index.js
CHANGED
|
@@ -1690,6 +1690,8 @@ var ASSOCIATION_TARGET_TYPES = [
|
|
|
1690
1690
|
// a note — the origin a converted study artifact links back to (artifact→note 'source' lineage, P4)
|
|
1691
1691
|
"file",
|
|
1692
1692
|
// a file (card→file media + source lineage)
|
|
1693
|
+
"processed_document",
|
|
1694
|
+
// a processed source document (study-aid source lineage and kit membership)
|
|
1693
1695
|
"quiz_session",
|
|
1694
1696
|
// a quiz a card is used in
|
|
1695
1697
|
"agent",
|
|
@@ -3808,11 +3810,61 @@ function AttachedItemsBody({
|
|
|
3808
3810
|
// src/react/components/AssociationCard.tsx
|
|
3809
3811
|
import { useState as useState10 } from "react";
|
|
3810
3812
|
import { cn as cn7 } from "@ai-matrx/design-system";
|
|
3811
|
-
import {
|
|
3813
|
+
import { PlusTapButton } from "@ai-matrx/tap-target/buttons";
|
|
3814
|
+
|
|
3815
|
+
// src/react/contentRoles.ts
|
|
3816
|
+
var CONTENT_ROLES = [
|
|
3817
|
+
{
|
|
3818
|
+
id: "utility",
|
|
3819
|
+
title: "Utilities",
|
|
3820
|
+
tagline: "The agents and tools that act on your knowledge.",
|
|
3821
|
+
accentText: "text-violet-600 dark:text-violet-400",
|
|
3822
|
+
accentBg: "bg-violet-500/10",
|
|
3823
|
+
accentBar: "bg-violet-500"
|
|
3824
|
+
},
|
|
3825
|
+
{
|
|
3826
|
+
id: "source",
|
|
3827
|
+
title: "Sources",
|
|
3828
|
+
tagline: "Incoming sources of truth (Knowledge In).",
|
|
3829
|
+
accentText: "text-sky-600 dark:text-sky-400",
|
|
3830
|
+
accentBg: "bg-sky-500/10",
|
|
3831
|
+
accentBar: "bg-sky-500"
|
|
3832
|
+
},
|
|
3833
|
+
{
|
|
3834
|
+
id: "destination",
|
|
3835
|
+
title: "Outputs",
|
|
3836
|
+
tagline: "Knowledge your team produces.",
|
|
3837
|
+
accentText: "text-emerald-600 dark:text-emerald-400",
|
|
3838
|
+
accentBg: "bg-emerald-500/10",
|
|
3839
|
+
accentBar: "bg-emerald-500"
|
|
3840
|
+
},
|
|
3841
|
+
{
|
|
3842
|
+
id: "hybrid",
|
|
3843
|
+
title: "Sources & Outputs",
|
|
3844
|
+
tagline: "Read from and written to.",
|
|
3845
|
+
accentText: "text-teal-600 dark:text-teal-400",
|
|
3846
|
+
accentBg: "bg-teal-500/10",
|
|
3847
|
+
accentBar: "bg-gradient-to-r from-sky-500 to-emerald-500"
|
|
3848
|
+
},
|
|
3849
|
+
{
|
|
3850
|
+
id: "container",
|
|
3851
|
+
title: "Workspaces",
|
|
3852
|
+
tagline: "How work is organized.",
|
|
3853
|
+
accentText: "text-amber-600 dark:text-amber-400",
|
|
3854
|
+
accentBg: "bg-amber-500/10",
|
|
3855
|
+
accentBar: "bg-amber-500"
|
|
3856
|
+
}
|
|
3857
|
+
];
|
|
3858
|
+
function getContentRoleMeta(role) {
|
|
3859
|
+
return CONTENT_ROLES.find((r) => r.id === role) ?? CONTENT_ROLES[2];
|
|
3860
|
+
}
|
|
3861
|
+
|
|
3862
|
+
// src/react/components/AssociationCard.tsx
|
|
3812
3863
|
import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3813
3864
|
function AssociationCard({
|
|
3814
3865
|
token,
|
|
3815
3866
|
container: containerProp,
|
|
3867
|
+
look = "tiles",
|
|
3816
3868
|
className
|
|
3817
3869
|
}) {
|
|
3818
3870
|
const store = useAssociationsStore();
|
|
@@ -3820,6 +3872,7 @@ function AssociationCard({
|
|
|
3820
3872
|
const container = containerProp ?? fromCtx;
|
|
3821
3873
|
const [open, setOpen] = useState10(false);
|
|
3822
3874
|
const info = store.registry.getEntityInfo(token);
|
|
3875
|
+
const role = getContentRoleMeta(info.contentRole);
|
|
3823
3876
|
const Icon = info.Icon ?? DefaultEntityIcon;
|
|
3824
3877
|
const [listOpen, setListOpen] = useState10(false);
|
|
3825
3878
|
const {
|
|
@@ -3845,43 +3898,132 @@ function AssociationCard({
|
|
|
3845
3898
|
const canAttach = info.canListCandidates && (!filing || isAssociationTargetType(token));
|
|
3846
3899
|
const canDrillIn = count > 0;
|
|
3847
3900
|
const countWord = filing ? "filed under" : "attached";
|
|
3901
|
+
const drillTitle = canDrillIn ? `View the ${info.labelPlural.toLowerCase()} attached to ${container.label ?? "this"}` : void 0;
|
|
3848
3902
|
return /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
3849
|
-
|
|
3903
|
+
look !== "tiles" ? (
|
|
3904
|
+
// ONE-LINE LOOKS (opt-in, off by default): small icon, UPPERCASE name,
|
|
3905
|
+
// count, then the "+".
|
|
3906
|
+
// - "simplified": the classic square "+" (the same button the tiles
|
|
3907
|
+
// use), 6px from the card edge on every side at every width.
|
|
3908
|
+
// - "compact": the real PlusTapButton in its OUTLINE variant (never
|
|
3909
|
+
// glass — glass only reads over a see-through surface). Nothing
|
|
3910
|
+
// around it: no card padding on its side and no vertical padding,
|
|
3911
|
+
// so the tap target's own 44px box centers the 28px circle with
|
|
3912
|
+
// 8px on every side. Never pass a layout class to a tap button —
|
|
3913
|
+
// its className lands on the ICON (the 2026-09-27 crooked "+").
|
|
3914
|
+
/* @__PURE__ */ jsxs9(
|
|
3915
|
+
"div",
|
|
3916
|
+
{
|
|
3917
|
+
"data-association-card": token,
|
|
3918
|
+
"data-association-card-look": look,
|
|
3919
|
+
className: cn7(
|
|
3920
|
+
"flex items-center gap-x-1.5 rounded-md border border-border bg-card pl-2.5",
|
|
3921
|
+
look === "simplified" ? "py-1.5 pr-1.5" : "py-0 pr-0",
|
|
3922
|
+
className
|
|
3923
|
+
),
|
|
3924
|
+
children: [
|
|
3925
|
+
/* @__PURE__ */ jsxs9(
|
|
3926
|
+
"button",
|
|
3927
|
+
{
|
|
3928
|
+
type: "button",
|
|
3929
|
+
disabled: !canDrillIn,
|
|
3930
|
+
onClick: () => setListOpen(true),
|
|
3931
|
+
title: drillTitle,
|
|
3932
|
+
"aria-label": loading ? info.labelPlural : `${info.labelPlural}: ${count} ${countWord}`,
|
|
3933
|
+
className: cn7(
|
|
3934
|
+
"flex min-h-7 min-w-0 flex-1 items-center gap-x-1.5 text-left",
|
|
3935
|
+
canDrillIn ? "cursor-pointer hover:text-foreground" : "cursor-default"
|
|
3936
|
+
),
|
|
3937
|
+
children: [
|
|
3938
|
+
/* @__PURE__ */ jsx11(Icon, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
3939
|
+
/* @__PURE__ */ jsx11("span", { className: "min-w-0 truncate text-xs font-semibold uppercase tracking-wider text-foreground", children: info.labelPlural }),
|
|
3940
|
+
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 })
|
|
3941
|
+
]
|
|
3942
|
+
}
|
|
3943
|
+
),
|
|
3944
|
+
canAttach && (look === "compact" ? /* @__PURE__ */ jsx11(
|
|
3945
|
+
PlusTapButton,
|
|
3946
|
+
{
|
|
3947
|
+
variant: "outline",
|
|
3948
|
+
ariaLabel: `Attach ${info.labelPlural.toLowerCase()}`,
|
|
3949
|
+
tooltip: false,
|
|
3950
|
+
onClick: () => setOpen(true)
|
|
3951
|
+
}
|
|
3952
|
+
) : /* @__PURE__ */ jsx11(
|
|
3953
|
+
"button",
|
|
3954
|
+
{
|
|
3955
|
+
type: "button",
|
|
3956
|
+
onClick: () => setOpen(true),
|
|
3957
|
+
"aria-label": `Attach ${info.labelPlural.toLowerCase()}`,
|
|
3958
|
+
title: `Attach ${info.labelPlural.toLowerCase()}`,
|
|
3959
|
+
className: "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:h-7 lg:w-7",
|
|
3960
|
+
children: /* @__PURE__ */ jsx11(PlusIcon, { className: "h-4 w-4" })
|
|
3961
|
+
}
|
|
3962
|
+
))
|
|
3963
|
+
]
|
|
3964
|
+
}
|
|
3965
|
+
)
|
|
3966
|
+
) : /* @__PURE__ */ jsxs9(
|
|
3850
3967
|
"div",
|
|
3851
3968
|
{
|
|
3852
3969
|
"data-association-card": token,
|
|
3970
|
+
"data-association-card-look": "tiles",
|
|
3853
3971
|
className: cn7(
|
|
3854
|
-
"flex
|
|
3972
|
+
"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
3973
|
className
|
|
3856
3974
|
),
|
|
3857
3975
|
children: [
|
|
3976
|
+
/* @__PURE__ */ jsx11(
|
|
3977
|
+
"span",
|
|
3978
|
+
{
|
|
3979
|
+
className: cn7(
|
|
3980
|
+
"absolute inset-x-0 top-0 h-0.5 opacity-60",
|
|
3981
|
+
role.accentBar
|
|
3982
|
+
)
|
|
3983
|
+
}
|
|
3984
|
+
),
|
|
3858
3985
|
/* @__PURE__ */ jsxs9(
|
|
3859
3986
|
"button",
|
|
3860
3987
|
{
|
|
3861
3988
|
type: "button",
|
|
3862
3989
|
disabled: !canDrillIn,
|
|
3863
3990
|
onClick: () => setListOpen(true),
|
|
3864
|
-
title:
|
|
3865
|
-
"aria-label": loading ? info.labelPlural : `${info.labelPlural}: ${count} ${countWord}`,
|
|
3991
|
+
title: drillTitle,
|
|
3866
3992
|
className: cn7(
|
|
3867
|
-
"flex min-
|
|
3868
|
-
canDrillIn ? "cursor-pointer
|
|
3993
|
+
"flex min-w-0 flex-1 items-center gap-3 px-3 py-2.5 text-left",
|
|
3994
|
+
canDrillIn ? "cursor-pointer" : "cursor-default"
|
|
3869
3995
|
),
|
|
3870
3996
|
children: [
|
|
3871
|
-
/* @__PURE__ */ jsx11(
|
|
3872
|
-
|
|
3873
|
-
|
|
3997
|
+
/* @__PURE__ */ jsx11(
|
|
3998
|
+
"span",
|
|
3999
|
+
{
|
|
4000
|
+
className: cn7(
|
|
4001
|
+
"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg",
|
|
4002
|
+
role.accentBg,
|
|
4003
|
+
role.accentText
|
|
4004
|
+
),
|
|
4005
|
+
children: /* @__PURE__ */ jsx11(Icon, { className: "h-4 w-4" })
|
|
4006
|
+
}
|
|
4007
|
+
),
|
|
4008
|
+
/* @__PURE__ */ jsxs9("span", { className: "min-w-0 flex-1", children: [
|
|
4009
|
+
/* @__PURE__ */ jsx11("span", { className: "block truncate text-sm font-medium text-foreground", children: info.labelPlural }),
|
|
4010
|
+
/* @__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: [
|
|
4011
|
+
/* @__PURE__ */ jsx11(SpinnerIcon, { className: "h-3 w-3 animate-spin" }),
|
|
4012
|
+
"Loading\u2026"
|
|
4013
|
+
] }) : `${count} ${countWord}` })
|
|
4014
|
+
] })
|
|
3874
4015
|
]
|
|
3875
4016
|
}
|
|
3876
4017
|
),
|
|
3877
4018
|
canAttach && /* @__PURE__ */ jsx11(
|
|
3878
|
-
|
|
4019
|
+
"button",
|
|
3879
4020
|
{
|
|
3880
|
-
|
|
3881
|
-
tooltip: false,
|
|
4021
|
+
type: "button",
|
|
3882
4022
|
onClick: () => setOpen(true),
|
|
3883
|
-
|
|
3884
|
-
|
|
4023
|
+
"aria-label": `Attach ${info.labelPlural.toLowerCase()}`,
|
|
4024
|
+
title: `Attach ${info.labelPlural.toLowerCase()}`,
|
|
4025
|
+
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",
|
|
4026
|
+
children: /* @__PURE__ */ jsx11(PlusIcon, { className: "h-4 w-4" })
|
|
3885
4027
|
}
|
|
3886
4028
|
)
|
|
3887
4029
|
]
|
|
@@ -3902,8 +4044,8 @@ function AssociationCard({
|
|
|
3902
4044
|
setOpen(true);
|
|
3903
4045
|
}
|
|
3904
4046
|
} : {},
|
|
3905
|
-
onDetach: (resourceId,
|
|
3906
|
-
onSetPinned: (resourceId, pinned,
|
|
4047
|
+
onDetach: (resourceId, role2) => detach(token, resourceId, role2 ?? void 0),
|
|
4048
|
+
onSetPinned: (resourceId, pinned, role2) => setPinned(token, resourceId, pinned, role2 ?? void 0)
|
|
3907
4049
|
}
|
|
3908
4050
|
),
|
|
3909
4051
|
canAttach && /* @__PURE__ */ jsx11(
|
|
@@ -3925,61 +4067,29 @@ function AssociationCard({
|
|
|
3925
4067
|
|
|
3926
4068
|
// src/react/components/AssociationCardGrid.tsx
|
|
3927
4069
|
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
4070
|
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3978
|
-
var
|
|
3979
|
-
var
|
|
4071
|
+
var SIMPLE_GROUP_LABEL = "mb-1 text-xs font-medium uppercase tracking-wider text-muted-foreground";
|
|
4072
|
+
var SIMPLE_TILE_ROW = "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1";
|
|
4073
|
+
var TILE_GRID = "grid grid-cols-1 gap-2 @md:grid-cols-2 @3xl:grid-cols-3";
|
|
4074
|
+
function GroupHeader({
|
|
4075
|
+
look,
|
|
4076
|
+
title,
|
|
4077
|
+
tagline,
|
|
4078
|
+
dotClassName
|
|
4079
|
+
}) {
|
|
4080
|
+
if (look !== "tiles") return /* @__PURE__ */ jsx12("h3", { className: SIMPLE_GROUP_LABEL, children: title });
|
|
4081
|
+
return /* @__PURE__ */ jsxs10("div", { className: "mb-2.5 flex items-baseline gap-3 pl-1.5", children: [
|
|
4082
|
+
dotClassName ? /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
|
|
4083
|
+
/* @__PURE__ */ jsx12("span", { className: cn8("h-2.5 w-2.5 rounded-full", dotClassName) }),
|
|
4084
|
+
/* @__PURE__ */ jsx12("h3", { className: "text-sm font-semibold text-foreground", children: title })
|
|
4085
|
+
] }) : /* @__PURE__ */ jsx12("h3", { className: "text-sm font-semibold text-foreground", children: title }),
|
|
4086
|
+
/* @__PURE__ */ jsx12("p", { className: "hidden text-xs text-muted-foreground sm:block", children: tagline })
|
|
4087
|
+
] });
|
|
4088
|
+
}
|
|
3980
4089
|
function AssociationCardGrid({
|
|
3981
4090
|
tokens,
|
|
3982
4091
|
excludeTokens,
|
|
4092
|
+
look = "tiles",
|
|
3983
4093
|
className
|
|
3984
4094
|
}) {
|
|
3985
4095
|
const store = useAssociationsStore();
|
|
@@ -4002,22 +4112,45 @@ function AssociationCardGrid({
|
|
|
4002
4112
|
const role = store.registry.getEntityInfo(token).contentRole;
|
|
4003
4113
|
return !role || !roleIds.has(role);
|
|
4004
4114
|
}) : [];
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4115
|
+
const rowClass = look !== "tiles" ? SIMPLE_TILE_ROW : TILE_GRID;
|
|
4116
|
+
return /* @__PURE__ */ jsxs10(
|
|
4117
|
+
"div",
|
|
4118
|
+
{
|
|
4119
|
+
"data-association-grid-look": look,
|
|
4120
|
+
className: cn8("@container", look !== "tiles" ? "space-y-3" : "space-y-5", className),
|
|
4121
|
+
children: [
|
|
4122
|
+
CONTENT_ROLES.map((role) => {
|
|
4123
|
+
const inRole = list.filter(
|
|
4124
|
+
(token) => store.registry.getEntityInfo(token).contentRole === role.id
|
|
4125
|
+
);
|
|
4126
|
+
if (inRole.length === 0) return null;
|
|
4127
|
+
return /* @__PURE__ */ jsxs10("section", { children: [
|
|
4128
|
+
/* @__PURE__ */ jsx12(
|
|
4129
|
+
GroupHeader,
|
|
4130
|
+
{
|
|
4131
|
+
look,
|
|
4132
|
+
title: role.title,
|
|
4133
|
+
tagline: role.tagline,
|
|
4134
|
+
dotClassName: role.accentBar
|
|
4135
|
+
}
|
|
4136
|
+
),
|
|
4137
|
+
/* @__PURE__ */ jsx12("div", { className: rowClass, children: inRole.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token, look }, token)) })
|
|
4138
|
+
] }, role.id);
|
|
4139
|
+
}),
|
|
4140
|
+
roleless.length > 0 && /* @__PURE__ */ jsxs10("section", { children: [
|
|
4141
|
+
/* @__PURE__ */ jsx12(
|
|
4142
|
+
GroupHeader,
|
|
4143
|
+
{
|
|
4144
|
+
look,
|
|
4145
|
+
title: "Filed under",
|
|
4146
|
+
tagline: "Libraries, topics and other places this is kept."
|
|
4147
|
+
}
|
|
4148
|
+
),
|
|
4149
|
+
/* @__PURE__ */ jsx12("div", { className: rowClass, children: roleless.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token, look }, token)) })
|
|
4150
|
+
] })
|
|
4151
|
+
]
|
|
4152
|
+
}
|
|
4153
|
+
);
|
|
4021
4154
|
}
|
|
4022
4155
|
|
|
4023
4156
|
// src/react/components/AssociationList.tsx
|