@ai-matrx/associations 0.13.13 → 0.13.16

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.
@@ -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-BoL8r7ZL.cjs';
4
- export { B as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, D as AssociationCard, F as AssociationCardGrid, b as AssociationCardGridProps, a as AssociationCardProps, G as AssociationEntitySelect, H as AssociationEntitySelectAdapter, I as AssociationEntitySelectItem, c as AssociationEntitySelectProps, J as AssociationList, d as AssociationListProps, K as AssociationWindow, f as AssociationWindowProps, L as AssociationWriteResult, M as AttachedItemsSheet, g as AttachedItemsSheetProps, N as CaptureAttach, O as CaptureAttachResult, Q as CaptureToolbarAction, R as CategorySelect, C as CategorySelectProps, S as CategoryTagPicker, h as CategoryTagPickerProps, T as CommentComposer, V as CommentComposerProps, X as CommentThread, i as CommentThreadProps, Y as ContainerLink, Z as ContainerResourceRow, _ as ContainerResourcesAdapter, $ as DefaultEntityIcon, a0 as PrimaryContainerEntity, a1 as PrimaryEntity, a2 as PrimaryEntityProvider, a3 as PrimaryFiledEntity, a4 as TagPickerIcon, a5 as UniversalAssociationPicker, U as UniversalAssociationPickerProps, a6 as UseAssociationEntitySelectAdapterArgs, a7 as UseAssociationsArgs, a8 as UseAssociationsReturn, a9 as UseContainerLinksArgs, aa as UseContainerLinksReturn, ab as attachedKey, ac as buildCommentTree, ad as containerLinksArgs, ae as linkDirection, af as useAssociationEntitySelectAdapter, ag as useAssociations, ah as useContainerLinks, ai as useContainerLinksAdapter, aj as useEntityRelationships, ak as usePrimaryEntity } from '../CommentThread-BoL8r7ZL.cjs';
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-CODjsBow.cjs';
4
+ export { B as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, D as AssociationCard, F as AssociationCardGrid, b as AssociationCardGridProps, a as AssociationCardProps, G as AssociationEntitySelect, H as AssociationEntitySelectAdapter, I as AssociationEntitySelectItem, c as AssociationEntitySelectProps, J as AssociationList, d as AssociationListProps, K as AssociationWindow, f as AssociationWindowProps, L as AssociationWriteResult, M as AttachedItemsSheet, g as AttachedItemsSheetProps, N as CaptureAttach, O as CaptureAttachResult, Q as CaptureToolbarAction, R as CategorySelect, C as CategorySelectProps, S as CategoryTagPicker, h as CategoryTagPickerProps, T as CommentComposer, V as CommentComposerProps, X as CommentThread, i as CommentThreadProps, Y as ContainerLink, Z as ContainerResourceRow, _ as ContainerResourcesAdapter, $ as DefaultEntityIcon, a0 as PrimaryContainerEntity, a1 as PrimaryEntity, a2 as PrimaryEntityProvider, a3 as PrimaryFiledEntity, a4 as TagPickerIcon, a5 as UniversalAssociationPicker, U as UniversalAssociationPickerProps, a6 as UseAssociationEntitySelectAdapterArgs, a7 as UseAssociationsArgs, a8 as UseAssociationsReturn, a9 as UseContainerLinksArgs, aa as UseContainerLinksReturn, ab as attachedKey, ac as buildCommentTree, ad as containerLinksArgs, ae as linkDirection, af as useAssociationEntitySelectAdapter, ag as useAssociations, ah as useContainerLinks, ai as useContainerLinksAdapter, aj as useEntityRelationships, ak as usePrimaryEntity } from '../CommentThread-CODjsBow.cjs';
5
5
 
6
6
  interface AssociationsUiPorts {
7
7
  notifier?: AssociationsNotifier;
@@ -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-BoL8r7ZL.js';
4
- export { B as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, D as AssociationCard, F as AssociationCardGrid, b as AssociationCardGridProps, a as AssociationCardProps, G as AssociationEntitySelect, H as AssociationEntitySelectAdapter, I as AssociationEntitySelectItem, c as AssociationEntitySelectProps, J as AssociationList, d as AssociationListProps, K as AssociationWindow, f as AssociationWindowProps, L as AssociationWriteResult, M as AttachedItemsSheet, g as AttachedItemsSheetProps, N as CaptureAttach, O as CaptureAttachResult, Q as CaptureToolbarAction, R as CategorySelect, C as CategorySelectProps, S as CategoryTagPicker, h as CategoryTagPickerProps, T as CommentComposer, V as CommentComposerProps, X as CommentThread, i as CommentThreadProps, Y as ContainerLink, Z as ContainerResourceRow, _ as ContainerResourcesAdapter, $ as DefaultEntityIcon, a0 as PrimaryContainerEntity, a1 as PrimaryEntity, a2 as PrimaryEntityProvider, a3 as PrimaryFiledEntity, a4 as TagPickerIcon, a5 as UniversalAssociationPicker, U as UniversalAssociationPickerProps, a6 as UseAssociationEntitySelectAdapterArgs, a7 as UseAssociationsArgs, a8 as UseAssociationsReturn, a9 as UseContainerLinksArgs, aa as UseContainerLinksReturn, ab as attachedKey, ac as buildCommentTree, ad as containerLinksArgs, ae as linkDirection, af as useAssociationEntitySelectAdapter, ag as useAssociations, ah as useContainerLinks, ai as useContainerLinksAdapter, aj as useEntityRelationships, ak as usePrimaryEntity } from '../CommentThread-BoL8r7ZL.js';
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-CODjsBow.js';
4
+ export { B as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, D as AssociationCard, F as AssociationCardGrid, b as AssociationCardGridProps, a as AssociationCardProps, G as AssociationEntitySelect, H as AssociationEntitySelectAdapter, I as AssociationEntitySelectItem, c as AssociationEntitySelectProps, J as AssociationList, d as AssociationListProps, K as AssociationWindow, f as AssociationWindowProps, L as AssociationWriteResult, M as AttachedItemsSheet, g as AttachedItemsSheetProps, N as CaptureAttach, O as CaptureAttachResult, Q as CaptureToolbarAction, R as CategorySelect, C as CategorySelectProps, S as CategoryTagPicker, h as CategoryTagPickerProps, T as CommentComposer, V as CommentComposerProps, X as CommentThread, i as CommentThreadProps, Y as ContainerLink, Z as ContainerResourceRow, _ as ContainerResourcesAdapter, $ as DefaultEntityIcon, a0 as PrimaryContainerEntity, a1 as PrimaryEntity, a2 as PrimaryEntityProvider, a3 as PrimaryFiledEntity, a4 as TagPickerIcon, a5 as UniversalAssociationPicker, U as UniversalAssociationPickerProps, a6 as UseAssociationEntitySelectAdapterArgs, a7 as UseAssociationsArgs, a8 as UseAssociationsReturn, a9 as UseContainerLinksArgs, aa as UseContainerLinksReturn, ab as attachedKey, ac as buildCommentTree, ad as containerLinksArgs, ae as linkDirection, af as useAssociationEntitySelectAdapter, ag as useAssociations, ah as useContainerLinks, ai as useContainerLinksAdapter, aj as useEntityRelationships, ak as usePrimaryEntity } from '../CommentThread-CODjsBow.js';
5
5
 
6
6
  interface AssociationsUiPorts {
7
7
  notifier?: AssociationsNotifier;
@@ -177,6 +177,7 @@ var ENTITY_TYPE_TOKENS = [
177
177
  "billing_plan_limit",
178
178
  "billing_price",
179
179
  "billing_product",
180
+ "billing_spend_approval",
180
181
  "billing_spend_guardrail",
181
182
  "billing_stripe_event",
182
183
  "billing_subscription",
@@ -2551,12 +2552,6 @@ function ExternalLinkIcon(props) {
2551
2552
  function ChevronDownIcon(props) {
2552
2553
  return /* @__PURE__ */ jsx4("svg", { ...base(props), children: /* @__PURE__ */ jsx4("path", { d: "m6 9 6 6 6-6" }) });
2553
2554
  }
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
2555
  function CornerDownRightIcon(props) {
2561
2556
  return /* @__PURE__ */ jsxs2("svg", { ...base(props), children: [
2562
2557
  /* @__PURE__ */ jsx4("polyline", { points: "15 10 20 15 15 20" }),
@@ -3784,6 +3779,7 @@ function AttachedItemsBody({
3784
3779
  // src/react/components/AssociationCard.tsx
3785
3780
  import { useState as useState10 } from "react";
3786
3781
  import { cn as cn7 } from "@ai-matrx/design-system";
3782
+ import { TapTargetButton } from "@ai-matrx/design-system/tap-target";
3787
3783
  import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
3788
3784
  function AssociationCard({
3789
3785
  token,
@@ -3819,12 +3815,14 @@ function AssociationCard({
3819
3815
  const filing = container.direction === "outgoing";
3820
3816
  const canAttach = info.canListCandidates && (!filing || isAssociationTargetType(token));
3821
3817
  const canDrillIn = count > 0;
3818
+ const countWord = filing ? "filed under" : "attached";
3822
3819
  return /* @__PURE__ */ jsxs9(Fragment3, { children: [
3823
3820
  /* @__PURE__ */ jsxs9(
3824
3821
  "div",
3825
3822
  {
3823
+ "data-association-card": token,
3826
3824
  className: cn7(
3827
- "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",
3825
+ "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
3826
  className
3829
3827
  ),
3830
3828
  children: [
@@ -3835,31 +3833,26 @@ function AssociationCard({
3835
3833
  disabled: !canDrillIn,
3836
3834
  onClick: () => setListOpen(true),
3837
3835
  title: canDrillIn ? `View the ${info.labelPlural.toLowerCase()} attached to ${container.label ?? "this"}` : void 0,
3836
+ "aria-label": loading ? info.labelPlural : `${info.labelPlural}: ${count} ${countWord}`,
3838
3837
  className: cn7(
3839
- "flex min-w-0 flex-1 items-center gap-3 px-3 py-2.5 text-left",
3840
- canDrillIn ? "cursor-pointer" : "cursor-default"
3838
+ "flex min-h-8 min-w-0 flex-1 items-center gap-x-1.5 text-left",
3839
+ canDrillIn ? "cursor-pointer hover:text-foreground" : "cursor-default"
3841
3840
  ),
3842
3841
  children: [
3843
- /* @__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" }) }),
3844
- /* @__PURE__ */ jsxs9("span", { className: "min-w-0 flex-1", children: [
3845
- /* @__PURE__ */ jsx11("span", { className: "block truncate text-sm font-medium text-foreground", children: info.labelPlural }),
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
- ] })
3842
+ /* @__PURE__ */ jsx11(Icon, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
3843
+ /* @__PURE__ */ jsx11("span", { className: "min-w-0 truncate text-xs font-semibold uppercase tracking-wider text-foreground", children: info.labelPlural }),
3844
+ 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
3845
  ]
3852
3846
  }
3853
3847
  ),
3854
3848
  canAttach && /* @__PURE__ */ jsx11(
3855
- "button",
3849
+ TapTargetButton,
3856
3850
  {
3857
- type: "button",
3851
+ ariaLabel: `Attach ${info.labelPlural.toLowerCase()}`,
3852
+ tooltip: false,
3858
3853
  onClick: () => setOpen(true),
3859
- "aria-label": `Attach ${info.labelPlural.toLowerCase()}`,
3860
- title: `Attach ${info.labelPlural.toLowerCase()}`,
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" })
3854
+ className: "ml-auto shrink-0",
3855
+ icon: /* @__PURE__ */ jsx11(PlusIcon, { className: "h-4 w-4" })
3863
3856
  }
3864
3857
  )
3865
3858
  ]
@@ -3953,6 +3946,8 @@ function getContentRoleMeta(role) {
3953
3946
 
3954
3947
  // src/react/components/AssociationCardGrid.tsx
3955
3948
  import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
3949
+ var GROUP_LABEL = "mb-1 text-xs font-medium uppercase tracking-wider text-muted-foreground";
3950
+ var TILE_ROW = "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1";
3956
3951
  function AssociationCardGrid({
3957
3952
  tokens,
3958
3953
  excludeTokens,
@@ -3978,20 +3973,20 @@ function AssociationCardGrid({
3978
3973
  const role = store.registry.getEntityInfo(token).contentRole;
3979
3974
  return !role || !roleIds.has(role);
3980
3975
  }) : [];
3981
- return /* @__PURE__ */ jsxs10("div", { className: cn8("@container space-y-5", className), children: [
3976
+ return /* @__PURE__ */ jsxs10("div", { className: cn8("@container space-y-3", className), children: [
3982
3977
  CONTENT_ROLES.map((role) => {
3983
3978
  const inRole = list.filter(
3984
3979
  (token) => store.registry.getEntityInfo(token).contentRole === role.id
3985
3980
  );
3986
3981
  if (inRole.length === 0) return null;
3987
3982
  return /* @__PURE__ */ jsxs10("section", { children: [
3988
- /* @__PURE__ */ jsx12("h3", { className: "mb-2 text-sm font-semibold text-foreground", children: role.title }),
3989
- /* @__PURE__ */ jsx12("div", { className: "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1", children: inRole.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token }, token)) })
3983
+ /* @__PURE__ */ jsx12("h3", { className: GROUP_LABEL, children: role.title }),
3984
+ /* @__PURE__ */ jsx12("div", { className: TILE_ROW, children: inRole.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token }, token)) })
3990
3985
  ] }, role.id);
3991
3986
  }),
3992
3987
  roleless.length > 0 && /* @__PURE__ */ jsxs10("section", { children: [
3993
- /* @__PURE__ */ jsx12("h3", { className: "mb-2 text-sm font-semibold text-foreground", children: "Filed under" }),
3994
- /* @__PURE__ */ jsx12("div", { className: "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1", children: roleless.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token }, token)) })
3988
+ /* @__PURE__ */ jsx12("h3", { className: GROUP_LABEL, children: "Filed under" }),
3989
+ /* @__PURE__ */ jsx12("div", { className: TILE_ROW, children: roleless.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token }, token)) })
3995
3990
  ] })
3996
3991
  ] });
3997
3992
  }
@@ -5383,7 +5378,8 @@ import {
5383
5378
  SelectContent as SelectContent2,
5384
5379
  SelectItem as SelectItem2,
5385
5380
  SelectTrigger as SelectTrigger2,
5386
- SelectValue as SelectValue2
5381
+ SelectValue as SelectValue2,
5382
+ SelectChevron
5387
5383
  } from "@ai-matrx/design-system";
5388
5384
  import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
5389
5385
  var ROOT_PARENT2 = "__root__";
@@ -5541,7 +5537,7 @@ function CategoryTagPicker({
5541
5537
  children: [
5542
5538
  /* @__PURE__ */ jsx18(Icon, { className: "h-3.5 w-3.5" }),
5543
5539
  selected.length === 0 ? addLabel : "Edit",
5544
- /* @__PURE__ */ jsx18(ChevronsUpDownIcon, { className: "h-3 w-3 opacity-50" })
5540
+ /* @__PURE__ */ jsx18(SelectChevron, { size: "sm" })
5545
5541
  ]
5546
5542
  }
5547
5543
  ) }),