@ai-matrx/associations 0.13.7 → 0.13.8
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 +10 -0
- package/dist/react/index.cjs +56 -90
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +56 -90
- package/dist/react/index.js.map +1 -1
- package/package.json +3 -3
package/dist/react/index.js
CHANGED
|
@@ -3336,55 +3336,6 @@ function AttachedItemsBody({
|
|
|
3336
3336
|
// src/react/components/AssociationCard.tsx
|
|
3337
3337
|
import { useState as useState10 } from "react";
|
|
3338
3338
|
import { cn as cn7 } from "@ai-matrx/design-system";
|
|
3339
|
-
|
|
3340
|
-
// src/react/contentRoles.ts
|
|
3341
|
-
var CONTENT_ROLES = [
|
|
3342
|
-
{
|
|
3343
|
-
id: "utility",
|
|
3344
|
-
title: "Utilities",
|
|
3345
|
-
tagline: "The agents and tools that act on your knowledge.",
|
|
3346
|
-
accentText: "text-violet-600 dark:text-violet-400",
|
|
3347
|
-
accentBg: "bg-violet-500/10",
|
|
3348
|
-
accentBar: "bg-violet-500"
|
|
3349
|
-
},
|
|
3350
|
-
{
|
|
3351
|
-
id: "source",
|
|
3352
|
-
title: "Sources",
|
|
3353
|
-
tagline: "Incoming sources of truth (Knowledge In).",
|
|
3354
|
-
accentText: "text-sky-600 dark:text-sky-400",
|
|
3355
|
-
accentBg: "bg-sky-500/10",
|
|
3356
|
-
accentBar: "bg-sky-500"
|
|
3357
|
-
},
|
|
3358
|
-
{
|
|
3359
|
-
id: "destination",
|
|
3360
|
-
title: "Outputs",
|
|
3361
|
-
tagline: "Knowledge your team produces.",
|
|
3362
|
-
accentText: "text-emerald-600 dark:text-emerald-400",
|
|
3363
|
-
accentBg: "bg-emerald-500/10",
|
|
3364
|
-
accentBar: "bg-emerald-500"
|
|
3365
|
-
},
|
|
3366
|
-
{
|
|
3367
|
-
id: "hybrid",
|
|
3368
|
-
title: "Sources & Outputs",
|
|
3369
|
-
tagline: "Read from and written to.",
|
|
3370
|
-
accentText: "text-teal-600 dark:text-teal-400",
|
|
3371
|
-
accentBg: "bg-teal-500/10",
|
|
3372
|
-
accentBar: "bg-gradient-to-r from-sky-500 to-emerald-500"
|
|
3373
|
-
},
|
|
3374
|
-
{
|
|
3375
|
-
id: "container",
|
|
3376
|
-
title: "Workspaces",
|
|
3377
|
-
tagline: "How work is organized.",
|
|
3378
|
-
accentText: "text-amber-600 dark:text-amber-400",
|
|
3379
|
-
accentBg: "bg-amber-500/10",
|
|
3380
|
-
accentBar: "bg-amber-500"
|
|
3381
|
-
}
|
|
3382
|
-
];
|
|
3383
|
-
function getContentRoleMeta(role) {
|
|
3384
|
-
return CONTENT_ROLES.find((r) => r.id === role) ?? CONTENT_ROLES[2];
|
|
3385
|
-
}
|
|
3386
|
-
|
|
3387
|
-
// src/react/components/AssociationCard.tsx
|
|
3388
3339
|
import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3389
3340
|
function AssociationCard({
|
|
3390
3341
|
token,
|
|
@@ -3396,7 +3347,6 @@ function AssociationCard({
|
|
|
3396
3347
|
const container = containerProp ?? fromCtx;
|
|
3397
3348
|
const [open, setOpen] = useState10(false);
|
|
3398
3349
|
const info = store.registry.getEntityInfo(token);
|
|
3399
|
-
const role = getContentRoleMeta(info.contentRole);
|
|
3400
3350
|
const Icon = info.Icon ?? DefaultEntityIcon;
|
|
3401
3351
|
const [listOpen, setListOpen] = useState10(false);
|
|
3402
3352
|
const {
|
|
@@ -3430,15 +3380,6 @@ function AssociationCard({
|
|
|
3430
3380
|
className
|
|
3431
3381
|
),
|
|
3432
3382
|
children: [
|
|
3433
|
-
/* @__PURE__ */ jsx11(
|
|
3434
|
-
"span",
|
|
3435
|
-
{
|
|
3436
|
-
className: cn7(
|
|
3437
|
-
"absolute inset-x-0 top-0 h-0.5 opacity-60",
|
|
3438
|
-
role.accentBar
|
|
3439
|
-
)
|
|
3440
|
-
}
|
|
3441
|
-
),
|
|
3442
3383
|
/* @__PURE__ */ jsxs9(
|
|
3443
3384
|
"button",
|
|
3444
3385
|
{
|
|
@@ -3451,17 +3392,7 @@ function AssociationCard({
|
|
|
3451
3392
|
canDrillIn ? "cursor-pointer" : "cursor-default"
|
|
3452
3393
|
),
|
|
3453
3394
|
children: [
|
|
3454
|
-
/* @__PURE__ */ jsx11(
|
|
3455
|
-
"span",
|
|
3456
|
-
{
|
|
3457
|
-
className: cn7(
|
|
3458
|
-
"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg",
|
|
3459
|
-
role.accentBg,
|
|
3460
|
-
role.accentText
|
|
3461
|
-
),
|
|
3462
|
-
children: /* @__PURE__ */ jsx11(Icon, { className: "h-4 w-4" })
|
|
3463
|
-
}
|
|
3464
|
-
),
|
|
3395
|
+
/* @__PURE__ */ jsx11("span", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx11(Icon, { className: "h-4 w-4" }) }),
|
|
3465
3396
|
/* @__PURE__ */ jsxs9("span", { className: "min-w-0 flex-1", children: [
|
|
3466
3397
|
/* @__PURE__ */ jsx11("span", { className: "block truncate text-sm font-medium text-foreground", children: info.labelPlural }),
|
|
3467
3398
|
/* @__PURE__ */ jsx11("span", { className: "block text-[11px] text-muted-foreground tabular-nums", children: loading ? /* @__PURE__ */ jsxs9("span", { className: "inline-flex items-center gap-1", children: [
|
|
@@ -3501,8 +3432,8 @@ function AssociationCard({
|
|
|
3501
3432
|
setOpen(true);
|
|
3502
3433
|
}
|
|
3503
3434
|
} : {},
|
|
3504
|
-
onDetach: (resourceId,
|
|
3505
|
-
onSetPinned: (resourceId, pinned,
|
|
3435
|
+
onDetach: (resourceId, role) => detach(token, resourceId, role ?? void 0),
|
|
3436
|
+
onSetPinned: (resourceId, pinned, role) => setPinned(token, resourceId, pinned, role ?? void 0)
|
|
3506
3437
|
}
|
|
3507
3438
|
),
|
|
3508
3439
|
canAttach && /* @__PURE__ */ jsx11(
|
|
@@ -3524,6 +3455,55 @@ function AssociationCard({
|
|
|
3524
3455
|
|
|
3525
3456
|
// src/react/components/AssociationCardGrid.tsx
|
|
3526
3457
|
import { cn as cn8 } from "@ai-matrx/design-system";
|
|
3458
|
+
|
|
3459
|
+
// src/react/contentRoles.ts
|
|
3460
|
+
var CONTENT_ROLES = [
|
|
3461
|
+
{
|
|
3462
|
+
id: "utility",
|
|
3463
|
+
title: "Utilities",
|
|
3464
|
+
tagline: "The agents and tools that act on your knowledge.",
|
|
3465
|
+
accentText: "text-violet-600 dark:text-violet-400",
|
|
3466
|
+
accentBg: "bg-violet-500/10",
|
|
3467
|
+
accentBar: "bg-violet-500"
|
|
3468
|
+
},
|
|
3469
|
+
{
|
|
3470
|
+
id: "source",
|
|
3471
|
+
title: "Sources",
|
|
3472
|
+
tagline: "Incoming sources of truth (Knowledge In).",
|
|
3473
|
+
accentText: "text-sky-600 dark:text-sky-400",
|
|
3474
|
+
accentBg: "bg-sky-500/10",
|
|
3475
|
+
accentBar: "bg-sky-500"
|
|
3476
|
+
},
|
|
3477
|
+
{
|
|
3478
|
+
id: "destination",
|
|
3479
|
+
title: "Outputs",
|
|
3480
|
+
tagline: "Knowledge your team produces.",
|
|
3481
|
+
accentText: "text-emerald-600 dark:text-emerald-400",
|
|
3482
|
+
accentBg: "bg-emerald-500/10",
|
|
3483
|
+
accentBar: "bg-emerald-500"
|
|
3484
|
+
},
|
|
3485
|
+
{
|
|
3486
|
+
id: "hybrid",
|
|
3487
|
+
title: "Sources & Outputs",
|
|
3488
|
+
tagline: "Read from and written to.",
|
|
3489
|
+
accentText: "text-teal-600 dark:text-teal-400",
|
|
3490
|
+
accentBg: "bg-teal-500/10",
|
|
3491
|
+
accentBar: "bg-gradient-to-r from-sky-500 to-emerald-500"
|
|
3492
|
+
},
|
|
3493
|
+
{
|
|
3494
|
+
id: "container",
|
|
3495
|
+
title: "Workspaces",
|
|
3496
|
+
tagline: "How work is organized.",
|
|
3497
|
+
accentText: "text-amber-600 dark:text-amber-400",
|
|
3498
|
+
accentBg: "bg-amber-500/10",
|
|
3499
|
+
accentBar: "bg-amber-500"
|
|
3500
|
+
}
|
|
3501
|
+
];
|
|
3502
|
+
function getContentRoleMeta(role) {
|
|
3503
|
+
return CONTENT_ROLES.find((r) => r.id === role) ?? CONTENT_ROLES[2];
|
|
3504
|
+
}
|
|
3505
|
+
|
|
3506
|
+
// src/react/components/AssociationCardGrid.tsx
|
|
3527
3507
|
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3528
3508
|
function AssociationCardGrid({
|
|
3529
3509
|
tokens,
|
|
@@ -3557,27 +3537,13 @@ function AssociationCardGrid({
|
|
|
3557
3537
|
);
|
|
3558
3538
|
if (inRole.length === 0) return null;
|
|
3559
3539
|
return /* @__PURE__ */ jsxs10("section", { children: [
|
|
3560
|
-
/* @__PURE__ */
|
|
3561
|
-
|
|
3562
|
-
/* @__PURE__ */ jsx12(
|
|
3563
|
-
"span",
|
|
3564
|
-
{
|
|
3565
|
-
className: cn8("h-2.5 w-2.5 rounded-full", role.accentBar)
|
|
3566
|
-
}
|
|
3567
|
-
),
|
|
3568
|
-
/* @__PURE__ */ jsx12("h3", { className: "text-sm font-semibold text-foreground", children: role.title })
|
|
3569
|
-
] }),
|
|
3570
|
-
/* @__PURE__ */ jsx12("p", { className: "hidden text-xs text-muted-foreground sm:block", children: role.tagline })
|
|
3571
|
-
] }),
|
|
3572
|
-
/* @__PURE__ */ jsx12("div", { className: "grid grid-cols-1 gap-2 @md:grid-cols-2 @3xl:grid-cols-3", children: inRole.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token }, token)) })
|
|
3540
|
+
/* @__PURE__ */ jsx12("h3", { className: "mb-2 text-sm font-semibold text-foreground", children: role.title }),
|
|
3541
|
+
/* @__PURE__ */ jsx12("div", { className: "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1", children: inRole.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token }, token)) })
|
|
3573
3542
|
] }, role.id);
|
|
3574
3543
|
}),
|
|
3575
3544
|
roleless.length > 0 && /* @__PURE__ */ jsxs10("section", { children: [
|
|
3576
|
-
/* @__PURE__ */
|
|
3577
|
-
|
|
3578
|
-
/* @__PURE__ */ jsx12("p", { className: "hidden text-xs text-muted-foreground sm:block", children: "Libraries, topics and other places this is kept." })
|
|
3579
|
-
] }),
|
|
3580
|
-
/* @__PURE__ */ jsx12("div", { className: "grid grid-cols-1 gap-2 @md:grid-cols-2 @3xl:grid-cols-3", children: roleless.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token }, token)) })
|
|
3545
|
+
/* @__PURE__ */ jsx12("h3", { className: "mb-2 text-sm font-semibold text-foreground", children: "Filed under" }),
|
|
3546
|
+
/* @__PURE__ */ jsx12("div", { className: "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1", children: roleless.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token }, token)) })
|
|
3581
3547
|
] })
|
|
3582
3548
|
] });
|
|
3583
3549
|
}
|