@ai-matrx/associations 0.13.13 → 0.13.15
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 +15 -0
- package/dist/react/index.cjs +23 -29
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +25 -30
- package/dist/react/index.js.map +1 -1
- package/package.json +2 -2
package/dist/react/index.js
CHANGED
|
@@ -2551,12 +2551,6 @@ function ExternalLinkIcon(props) {
|
|
|
2551
2551
|
function ChevronDownIcon(props) {
|
|
2552
2552
|
return /* @__PURE__ */ jsx4("svg", { ...base(props), children: /* @__PURE__ */ jsx4("path", { d: "m6 9 6 6 6-6" }) });
|
|
2553
2553
|
}
|
|
2554
|
-
function ChevronsUpDownIcon(props) {
|
|
2555
|
-
return /* @__PURE__ */ jsxs2("svg", { ...base(props), children: [
|
|
2556
|
-
/* @__PURE__ */ jsx4("path", { d: "m7 15 5 5 5-5" }),
|
|
2557
|
-
/* @__PURE__ */ jsx4("path", { d: "m7 9 5-5 5 5" })
|
|
2558
|
-
] });
|
|
2559
|
-
}
|
|
2560
2554
|
function CornerDownRightIcon(props) {
|
|
2561
2555
|
return /* @__PURE__ */ jsxs2("svg", { ...base(props), children: [
|
|
2562
2556
|
/* @__PURE__ */ jsx4("polyline", { points: "15 10 20 15 15 20" }),
|
|
@@ -3784,6 +3778,7 @@ function AttachedItemsBody({
|
|
|
3784
3778
|
// src/react/components/AssociationCard.tsx
|
|
3785
3779
|
import { useState as useState10 } from "react";
|
|
3786
3780
|
import { cn as cn7 } from "@ai-matrx/design-system";
|
|
3781
|
+
import { TapTargetButton } from "@ai-matrx/design-system/tap-target";
|
|
3787
3782
|
import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3788
3783
|
function AssociationCard({
|
|
3789
3784
|
token,
|
|
@@ -3819,12 +3814,14 @@ function AssociationCard({
|
|
|
3819
3814
|
const filing = container.direction === "outgoing";
|
|
3820
3815
|
const canAttach = info.canListCandidates && (!filing || isAssociationTargetType(token));
|
|
3821
3816
|
const canDrillIn = count > 0;
|
|
3817
|
+
const countWord = filing ? "filed under" : "attached";
|
|
3822
3818
|
return /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
3823
3819
|
/* @__PURE__ */ jsxs9(
|
|
3824
3820
|
"div",
|
|
3825
3821
|
{
|
|
3822
|
+
"data-association-card": token,
|
|
3826
3823
|
className: cn7(
|
|
3827
|
-
"
|
|
3824
|
+
"flex min-h-8 items-center gap-x-1.5 rounded-md border border-border bg-card px-2.5 py-1 lg:pointer-fine:[--matrx-tap-target-size:1.75rem]",
|
|
3828
3825
|
className
|
|
3829
3826
|
),
|
|
3830
3827
|
children: [
|
|
@@ -3835,31 +3832,26 @@ function AssociationCard({
|
|
|
3835
3832
|
disabled: !canDrillIn,
|
|
3836
3833
|
onClick: () => setListOpen(true),
|
|
3837
3834
|
title: canDrillIn ? `View the ${info.labelPlural.toLowerCase()} attached to ${container.label ?? "this"}` : void 0,
|
|
3835
|
+
"aria-label": loading ? info.labelPlural : `${info.labelPlural}: ${count} ${countWord}`,
|
|
3838
3836
|
className: cn7(
|
|
3839
|
-
"flex min-w-0 flex-1 items-center gap-
|
|
3840
|
-
canDrillIn ? "cursor-pointer" : "cursor-default"
|
|
3837
|
+
"flex min-h-8 min-w-0 flex-1 items-center gap-x-1.5 text-left",
|
|
3838
|
+
canDrillIn ? "cursor-pointer hover:text-foreground" : "cursor-default"
|
|
3841
3839
|
),
|
|
3842
3840
|
children: [
|
|
3843
|
-
/* @__PURE__ */ jsx11(
|
|
3844
|
-
/* @__PURE__ */
|
|
3845
|
-
|
|
3846
|
-
/* @__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: [
|
|
3847
|
-
/* @__PURE__ */ jsx11(SpinnerIcon, { className: "h-3 w-3 animate-spin" }),
|
|
3848
|
-
"Loading\u2026"
|
|
3849
|
-
] }) : `${count} ${container.direction === "outgoing" ? "filed under" : "attached"}` })
|
|
3850
|
-
] })
|
|
3841
|
+
/* @__PURE__ */ jsx11(Icon, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
3842
|
+
/* @__PURE__ */ jsx11("span", { className: "min-w-0 truncate text-xs font-semibold uppercase tracking-wider text-foreground", children: info.labelPlural }),
|
|
3843
|
+
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 })
|
|
3851
3844
|
]
|
|
3852
3845
|
}
|
|
3853
3846
|
),
|
|
3854
3847
|
canAttach && /* @__PURE__ */ jsx11(
|
|
3855
|
-
|
|
3848
|
+
TapTargetButton,
|
|
3856
3849
|
{
|
|
3857
|
-
|
|
3850
|
+
ariaLabel: `Attach ${info.labelPlural.toLowerCase()}`,
|
|
3851
|
+
tooltip: false,
|
|
3858
3852
|
onClick: () => setOpen(true),
|
|
3859
|
-
"
|
|
3860
|
-
|
|
3861
|
-
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",
|
|
3862
|
-
children: /* @__PURE__ */ jsx11(PlusIcon, { className: "h-4 w-4" })
|
|
3853
|
+
className: "ml-auto shrink-0",
|
|
3854
|
+
icon: /* @__PURE__ */ jsx11(PlusIcon, { className: "h-4 w-4" })
|
|
3863
3855
|
}
|
|
3864
3856
|
)
|
|
3865
3857
|
]
|
|
@@ -3953,6 +3945,8 @@ function getContentRoleMeta(role) {
|
|
|
3953
3945
|
|
|
3954
3946
|
// src/react/components/AssociationCardGrid.tsx
|
|
3955
3947
|
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3948
|
+
var GROUP_LABEL = "mb-1 text-xs font-medium uppercase tracking-wider text-muted-foreground";
|
|
3949
|
+
var TILE_ROW = "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1";
|
|
3956
3950
|
function AssociationCardGrid({
|
|
3957
3951
|
tokens,
|
|
3958
3952
|
excludeTokens,
|
|
@@ -3978,20 +3972,20 @@ function AssociationCardGrid({
|
|
|
3978
3972
|
const role = store.registry.getEntityInfo(token).contentRole;
|
|
3979
3973
|
return !role || !roleIds.has(role);
|
|
3980
3974
|
}) : [];
|
|
3981
|
-
return /* @__PURE__ */ jsxs10("div", { className: cn8("@container space-y-
|
|
3975
|
+
return /* @__PURE__ */ jsxs10("div", { className: cn8("@container space-y-3", className), children: [
|
|
3982
3976
|
CONTENT_ROLES.map((role) => {
|
|
3983
3977
|
const inRole = list.filter(
|
|
3984
3978
|
(token) => store.registry.getEntityInfo(token).contentRole === role.id
|
|
3985
3979
|
);
|
|
3986
3980
|
if (inRole.length === 0) return null;
|
|
3987
3981
|
return /* @__PURE__ */ jsxs10("section", { children: [
|
|
3988
|
-
/* @__PURE__ */ jsx12("h3", { className:
|
|
3989
|
-
/* @__PURE__ */ jsx12("div", { className:
|
|
3982
|
+
/* @__PURE__ */ jsx12("h3", { className: GROUP_LABEL, children: role.title }),
|
|
3983
|
+
/* @__PURE__ */ jsx12("div", { className: TILE_ROW, children: inRole.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token }, token)) })
|
|
3990
3984
|
] }, role.id);
|
|
3991
3985
|
}),
|
|
3992
3986
|
roleless.length > 0 && /* @__PURE__ */ jsxs10("section", { children: [
|
|
3993
|
-
/* @__PURE__ */ jsx12("h3", { className:
|
|
3994
|
-
/* @__PURE__ */ jsx12("div", { className:
|
|
3987
|
+
/* @__PURE__ */ jsx12("h3", { className: GROUP_LABEL, children: "Filed under" }),
|
|
3988
|
+
/* @__PURE__ */ jsx12("div", { className: TILE_ROW, children: roleless.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token }, token)) })
|
|
3995
3989
|
] })
|
|
3996
3990
|
] });
|
|
3997
3991
|
}
|
|
@@ -5383,7 +5377,8 @@ import {
|
|
|
5383
5377
|
SelectContent as SelectContent2,
|
|
5384
5378
|
SelectItem as SelectItem2,
|
|
5385
5379
|
SelectTrigger as SelectTrigger2,
|
|
5386
|
-
SelectValue as SelectValue2
|
|
5380
|
+
SelectValue as SelectValue2,
|
|
5381
|
+
SelectChevron
|
|
5387
5382
|
} from "@ai-matrx/design-system";
|
|
5388
5383
|
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
5389
5384
|
var ROOT_PARENT2 = "__root__";
|
|
@@ -5541,7 +5536,7 @@ function CategoryTagPicker({
|
|
|
5541
5536
|
children: [
|
|
5542
5537
|
/* @__PURE__ */ jsx18(Icon, { className: "h-3.5 w-3.5" }),
|
|
5543
5538
|
selected.length === 0 ? addLabel : "Edit",
|
|
5544
|
-
/* @__PURE__ */ jsx18(
|
|
5539
|
+
/* @__PURE__ */ jsx18(SelectChevron, { size: "sm" })
|
|
5545
5540
|
]
|
|
5546
5541
|
}
|
|
5547
5542
|
) }),
|