@ai-matrx/associations 0.14.84 → 0.14.85
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 +4 -0
- package/dist/{CommentThread-CFL2rITA.d.cts → CommentThread-D_HUjOqD.d.cts} +7 -5
- package/dist/{CommentThread-CFL2rITA.d.ts → CommentThread-D_HUjOqD.d.ts} +7 -5
- package/dist/react/index.cjs +400 -473
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +3 -2
- package/dist/react/index.d.ts +3 -2
- package/dist/react/index.js +397 -457
- package/dist/react/index.js.map +1 -1
- package/dist/react/lazy/index.d.cts +2 -1
- package/dist/react/lazy/index.d.ts +2 -1
- package/package.json +2 -2
package/dist/react/index.js
CHANGED
|
@@ -3881,96 +3881,36 @@ import {
|
|
|
3881
3881
|
} from "@ai-matrx/design-system";
|
|
3882
3882
|
|
|
3883
3883
|
// src/react/icons.tsx
|
|
3884
|
-
import {
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
function RefreshIcon(props) {
|
|
3911
|
-
return /* @__PURE__ */ jsxs2("svg", { ...base(props), children: [
|
|
3912
|
-
/* @__PURE__ */ jsx4("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
|
|
3913
|
-
/* @__PURE__ */ jsx4("path", { d: "M21 3v5h-5" }),
|
|
3914
|
-
/* @__PURE__ */ jsx4("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
|
|
3915
|
-
/* @__PURE__ */ jsx4("path", { d: "M8 16H3v5" })
|
|
3916
|
-
] });
|
|
3917
|
-
}
|
|
3918
|
-
function UploadIcon(props) {
|
|
3919
|
-
return /* @__PURE__ */ jsxs2("svg", { ...base(props), children: [
|
|
3920
|
-
/* @__PURE__ */ jsx4("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
3921
|
-
/* @__PURE__ */ jsx4("polyline", { points: "17 8 12 3 7 8" }),
|
|
3922
|
-
/* @__PURE__ */ jsx4("line", { x1: "12", x2: "12", y1: "3", y2: "15" })
|
|
3923
|
-
] });
|
|
3924
|
-
}
|
|
3925
|
-
function FolderOpenIcon(props) {
|
|
3926
|
-
return /* @__PURE__ */ jsx4("svg", { ...base(props), children: /* @__PURE__ */ jsx4("path", { d: "m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" }) });
|
|
3927
|
-
}
|
|
3928
|
-
function CornerDownRightIcon(props) {
|
|
3929
|
-
return /* @__PURE__ */ jsxs2("svg", { ...base(props), children: [
|
|
3930
|
-
/* @__PURE__ */ jsx4("polyline", { points: "15 10 20 15 15 20" }),
|
|
3931
|
-
/* @__PURE__ */ jsx4("path", { d: "M4 4v7a4 4 0 0 0 4 4h12" })
|
|
3932
|
-
] });
|
|
3933
|
-
}
|
|
3934
|
-
function TagIcon(props) {
|
|
3935
|
-
return /* @__PURE__ */ jsxs2("svg", { ...base(props), children: [
|
|
3936
|
-
/* @__PURE__ */ jsx4("path", { d: "M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z" }),
|
|
3937
|
-
/* @__PURE__ */ jsx4("circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor" })
|
|
3938
|
-
] });
|
|
3939
|
-
}
|
|
3940
|
-
function DefaultEntityIcon(props) {
|
|
3941
|
-
return /* @__PURE__ */ jsxs2("svg", { ...base(props), children: [
|
|
3942
|
-
/* @__PURE__ */ jsx4("path", { d: "M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z" }),
|
|
3943
|
-
/* @__PURE__ */ jsx4("path", { d: "m7 16.5-4.74-2.85" }),
|
|
3944
|
-
/* @__PURE__ */ jsx4("path", { d: "m7 16.5 5-3" }),
|
|
3945
|
-
/* @__PURE__ */ jsx4("path", { d: "M7 16.5v5.17" }),
|
|
3946
|
-
/* @__PURE__ */ jsx4("path", { d: "M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z" }),
|
|
3947
|
-
/* @__PURE__ */ jsx4("path", { d: "m17 16.5-5-3" }),
|
|
3948
|
-
/* @__PURE__ */ jsx4("path", { d: "m17 16.5 4.74-2.85" }),
|
|
3949
|
-
/* @__PURE__ */ jsx4("path", { d: "M17 16.5v5.17" }),
|
|
3950
|
-
/* @__PURE__ */ jsx4("path", { d: "M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z" }),
|
|
3951
|
-
/* @__PURE__ */ jsx4("path", { d: "M12 8 7.26 5.15" }),
|
|
3952
|
-
/* @__PURE__ */ jsx4("path", { d: "m12 8 4.74-2.85" }),
|
|
3953
|
-
/* @__PURE__ */ jsx4("path", { d: "M12 13.5V8" })
|
|
3954
|
-
] });
|
|
3955
|
-
}
|
|
3956
|
-
function RestoreIcon(props) {
|
|
3957
|
-
return /* @__PURE__ */ jsxs2("svg", { ...base(props), children: [
|
|
3958
|
-
/* @__PURE__ */ jsx4("path", { d: "M4 14h6v6" }),
|
|
3959
|
-
/* @__PURE__ */ jsx4("path", { d: "M20 10h-6V4" }),
|
|
3960
|
-
/* @__PURE__ */ jsx4("path", { d: "M14 10l7-7" }),
|
|
3961
|
-
/* @__PURE__ */ jsx4("path", { d: "M3 21l7-7" })
|
|
3962
|
-
] });
|
|
3963
|
-
}
|
|
3964
|
-
function GripResizeIcon(props) {
|
|
3965
|
-
return /* @__PURE__ */ jsxs2("svg", { ...base(props), children: [
|
|
3966
|
-
/* @__PURE__ */ jsx4("path", { d: "M21 15 15 21" }),
|
|
3967
|
-
/* @__PURE__ */ jsx4("path", { d: "M21 20 20 21" })
|
|
3968
|
-
] });
|
|
3969
|
-
}
|
|
3884
|
+
import {
|
|
3885
|
+
BoxesIcon as GBoxesIcon,
|
|
3886
|
+
CornerDownRightIcon as GCornerDownRightIcon,
|
|
3887
|
+
FileTextIcon as GFileTextIcon,
|
|
3888
|
+
FolderOpenIcon as GFolderOpenIcon,
|
|
3889
|
+
GripResizeIcon as GGripResizeIcon,
|
|
3890
|
+
Link2Icon as GLink2Icon,
|
|
3891
|
+
Loader2Icon as GLoader2Icon,
|
|
3892
|
+
RefreshCwIcon as GRefreshCwIcon,
|
|
3893
|
+
RestoreIcon as GRestoreIcon,
|
|
3894
|
+
TagIcon as GTagIcon,
|
|
3895
|
+
UploadIcon as GUploadIcon,
|
|
3896
|
+
withGlyphDefaults
|
|
3897
|
+
} from "@ai-matrx/design-system/icons";
|
|
3898
|
+
var sized = (Glyph) => withGlyphDefaults(Glyph, { width: 24, height: 24 });
|
|
3899
|
+
var SpinnerIcon = sized(GLoader2Icon);
|
|
3900
|
+
var Link2Icon = sized(GLink2Icon);
|
|
3901
|
+
var RefreshIcon = sized(GRefreshCwIcon);
|
|
3902
|
+
var UploadIcon = sized(GUploadIcon);
|
|
3903
|
+
var FolderOpenIcon = sized(GFolderOpenIcon);
|
|
3904
|
+
var FileTextIcon = sized(GFileTextIcon);
|
|
3905
|
+
var CornerDownRightIcon = sized(GCornerDownRightIcon);
|
|
3906
|
+
var TagIcon = sized(GTagIcon);
|
|
3907
|
+
var DefaultEntityIcon = sized(GBoxesIcon);
|
|
3908
|
+
var RestoreIcon = sized(GRestoreIcon);
|
|
3909
|
+
var GripResizeIcon = sized(GGripResizeIcon);
|
|
3970
3910
|
|
|
3971
3911
|
// src/react/components/DefaultWindowShell.tsx
|
|
3972
3912
|
import { Maximize2Icon, XIcon } from "@ai-matrx/design-system/icons";
|
|
3973
|
-
import { jsx as
|
|
3913
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
3974
3914
|
var DEFAULT_WIDTH = 440;
|
|
3975
3915
|
var DEFAULT_HEIGHT = 580;
|
|
3976
3916
|
var MIN_WIDTH = 330;
|
|
@@ -4054,7 +3994,7 @@ function DefaultWindowShell({
|
|
|
4054
3994
|
height: rect.height
|
|
4055
3995
|
};
|
|
4056
3996
|
return createPortal(
|
|
4057
|
-
/* @__PURE__ */
|
|
3997
|
+
/* @__PURE__ */ jsx4(FloatingLayer, { children: /* @__PURE__ */ jsxs2(
|
|
4058
3998
|
"div",
|
|
4059
3999
|
{
|
|
4060
4000
|
ref: setPanelRef,
|
|
@@ -4071,7 +4011,7 @@ function DefaultWindowShell({
|
|
|
4071
4011
|
className
|
|
4072
4012
|
),
|
|
4073
4013
|
children: [
|
|
4074
|
-
/* @__PURE__ */
|
|
4014
|
+
/* @__PURE__ */ jsxs2(
|
|
4075
4015
|
"header",
|
|
4076
4016
|
{
|
|
4077
4017
|
onPointerDown: drag.onPointerDown,
|
|
@@ -4083,51 +4023,51 @@ function DefaultWindowShell({
|
|
|
4083
4023
|
isMobile ? "" : "cursor-move touch-none"
|
|
4084
4024
|
),
|
|
4085
4025
|
children: [
|
|
4086
|
-
/* @__PURE__ */
|
|
4026
|
+
/* @__PURE__ */ jsxs2(
|
|
4087
4027
|
"span",
|
|
4088
4028
|
{
|
|
4089
4029
|
id: labelId,
|
|
4090
4030
|
className: "flex min-w-0 items-center gap-1.5 text-sm font-medium text-foreground",
|
|
4091
4031
|
children: [
|
|
4092
4032
|
icon,
|
|
4093
|
-
/* @__PURE__ */
|
|
4033
|
+
/* @__PURE__ */ jsx4("span", { className: "truncate", children: title })
|
|
4094
4034
|
]
|
|
4095
4035
|
}
|
|
4096
4036
|
),
|
|
4097
|
-
/* @__PURE__ */
|
|
4098
|
-
isMobile ? null : /* @__PURE__ */
|
|
4037
|
+
/* @__PURE__ */ jsxs2("span", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
4038
|
+
isMobile ? null : /* @__PURE__ */ jsx4(
|
|
4099
4039
|
"button",
|
|
4100
4040
|
{
|
|
4101
4041
|
type: "button",
|
|
4102
4042
|
onClick: () => setMaximized((v) => !v),
|
|
4103
4043
|
"aria-label": maximized ? "Restore window" : "Maximize window",
|
|
4104
4044
|
className: "flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
4105
|
-
children: maximized ? /* @__PURE__ */
|
|
4045
|
+
children: maximized ? /* @__PURE__ */ jsx4(RestoreIcon, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx4(Maximize2Icon, { className: "h-3.5 w-3.5" })
|
|
4106
4046
|
}
|
|
4107
4047
|
),
|
|
4108
|
-
/* @__PURE__ */
|
|
4048
|
+
/* @__PURE__ */ jsx4(
|
|
4109
4049
|
"button",
|
|
4110
4050
|
{
|
|
4111
4051
|
type: "button",
|
|
4112
4052
|
onClick: onClose,
|
|
4113
4053
|
"aria-label": "Close",
|
|
4114
4054
|
className: "flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
4115
|
-
children: /* @__PURE__ */
|
|
4055
|
+
children: /* @__PURE__ */ jsx4(XIcon, { className: "h-3.5 w-3.5" })
|
|
4116
4056
|
}
|
|
4117
4057
|
)
|
|
4118
4058
|
] })
|
|
4119
4059
|
]
|
|
4120
4060
|
}
|
|
4121
4061
|
),
|
|
4122
|
-
/* @__PURE__ */
|
|
4123
|
-
isMobile || maximized ? null : /* @__PURE__ */
|
|
4062
|
+
/* @__PURE__ */ jsx4("div", { className: "min-h-0 flex-1 overflow-hidden", children }),
|
|
4063
|
+
isMobile || maximized ? null : /* @__PURE__ */ jsx4(
|
|
4124
4064
|
"button",
|
|
4125
4065
|
{
|
|
4126
4066
|
type: "button",
|
|
4127
4067
|
"aria-label": "Resize window",
|
|
4128
4068
|
onPointerDown: drag.resizeHandle("se"),
|
|
4129
4069
|
className: "absolute bottom-0 right-0 flex h-4 w-4 cursor-nwse-resize touch-none items-center justify-center text-muted-foreground/60 hover:text-foreground",
|
|
4130
|
-
children: /* @__PURE__ */
|
|
4070
|
+
children: /* @__PURE__ */ jsx4(GripResizeIcon, { className: "h-3 w-3" })
|
|
4131
4071
|
}
|
|
4132
4072
|
)
|
|
4133
4073
|
]
|
|
@@ -4138,7 +4078,7 @@ function DefaultWindowShell({
|
|
|
4138
4078
|
}
|
|
4139
4079
|
|
|
4140
4080
|
// src/react/components/AssociationWindow.tsx
|
|
4141
|
-
import { jsx as
|
|
4081
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
4142
4082
|
function AssociationWindow({
|
|
4143
4083
|
open,
|
|
4144
4084
|
onClose,
|
|
@@ -4151,16 +4091,16 @@ function AssociationWindow({
|
|
|
4151
4091
|
const instanceId = useId();
|
|
4152
4092
|
const { windowShell } = useAssociationsUiPorts();
|
|
4153
4093
|
if (!open) return null;
|
|
4154
|
-
const body = /* @__PURE__ */
|
|
4155
|
-
subtitle ? /* @__PURE__ */
|
|
4094
|
+
const body = /* @__PURE__ */ jsxs3("div", { className: "flex h-full min-h-0 flex-col gap-2 p-3", children: [
|
|
4095
|
+
subtitle ? /* @__PURE__ */ jsx5("div", { className: "shrink-0 text-xs text-muted-foreground", children: subtitle }) : null,
|
|
4156
4096
|
children
|
|
4157
4097
|
] });
|
|
4158
4098
|
const windowId = `association:${scopeId}:${instanceId}`;
|
|
4159
4099
|
if (windowShell) {
|
|
4160
4100
|
const HostWindow = windowShell.Window;
|
|
4161
|
-
return /* @__PURE__ */
|
|
4101
|
+
return /* @__PURE__ */ jsx5(HostWindow, { id: windowId, title, onClose, children: body });
|
|
4162
4102
|
}
|
|
4163
|
-
return /* @__PURE__ */
|
|
4103
|
+
return /* @__PURE__ */ jsx5(
|
|
4164
4104
|
DefaultWindowShell,
|
|
4165
4105
|
{
|
|
4166
4106
|
id: windowId,
|
|
@@ -4176,27 +4116,27 @@ function AssociationWindow({
|
|
|
4176
4116
|
import { useState as useState6 } from "react";
|
|
4177
4117
|
import { cn as cn3, Input } from "@ai-matrx/design-system";
|
|
4178
4118
|
import { CheckIcon, PlusIcon, SearchIcon, XIcon as XIcon2 } from "@ai-matrx/design-system/icons";
|
|
4179
|
-
import { Fragment, jsx as
|
|
4119
|
+
import { Fragment, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
4180
4120
|
function AssociationPicker(props) {
|
|
4181
4121
|
const store = useAssociationsStore();
|
|
4182
4122
|
const { pickerOverrides } = useAssociationsUiPorts();
|
|
4183
4123
|
const info = store.registry.getEntityInfo(props.token);
|
|
4184
4124
|
const Icon = info.Icon ?? DefaultEntityIcon;
|
|
4185
4125
|
const Override = pickerOverrides?.[props.token];
|
|
4186
|
-
if (Override) return /* @__PURE__ */
|
|
4126
|
+
if (Override) return /* @__PURE__ */ jsx6(Override, { ...props });
|
|
4187
4127
|
const title = `Add ${info.labelPlural}`;
|
|
4188
4128
|
const subtitle = props.filing ? `File ${props.containerLabel ?? "this"} under a ${info.label.toLowerCase()}` : props.containerLabel ? `Attach to ${props.containerLabel}` : "Click an item to attach or detach it";
|
|
4189
4129
|
if (!props.open) return null;
|
|
4190
|
-
return /* @__PURE__ */
|
|
4130
|
+
return /* @__PURE__ */ jsx6(
|
|
4191
4131
|
AssociationWindow,
|
|
4192
4132
|
{
|
|
4193
4133
|
open: props.open,
|
|
4194
4134
|
onClose: () => props.onOpenChange(false),
|
|
4195
4135
|
scopeId: `picker:${props.token}`,
|
|
4196
4136
|
title,
|
|
4197
|
-
icon: /* @__PURE__ */
|
|
4137
|
+
icon: /* @__PURE__ */ jsx6(Icon, { className: "size-3.5 text-primary" }),
|
|
4198
4138
|
subtitle,
|
|
4199
|
-
children: /* @__PURE__ */
|
|
4139
|
+
children: /* @__PURE__ */ jsx6(
|
|
4200
4140
|
AssociationCandidateBody,
|
|
4201
4141
|
{
|
|
4202
4142
|
token: props.token,
|
|
@@ -4221,7 +4161,7 @@ function AssociationCandidateBody({
|
|
|
4221
4161
|
onClose
|
|
4222
4162
|
}) {
|
|
4223
4163
|
void onClose;
|
|
4224
|
-
return /* @__PURE__ */
|
|
4164
|
+
return /* @__PURE__ */ jsx6(
|
|
4225
4165
|
EntityCandidateList,
|
|
4226
4166
|
{
|
|
4227
4167
|
token,
|
|
@@ -4281,10 +4221,10 @@ function EntityCandidateList({
|
|
|
4281
4221
|
setBusyId(null);
|
|
4282
4222
|
}
|
|
4283
4223
|
};
|
|
4284
|
-
return /* @__PURE__ */
|
|
4285
|
-
/* @__PURE__ */
|
|
4286
|
-
/* @__PURE__ */
|
|
4287
|
-
/* @__PURE__ */
|
|
4224
|
+
return /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
4225
|
+
/* @__PURE__ */ jsxs4("div", { className: "relative mb-2", children: [
|
|
4226
|
+
/* @__PURE__ */ jsx6(SearchIcon, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }),
|
|
4227
|
+
/* @__PURE__ */ jsx6(
|
|
4288
4228
|
Input,
|
|
4289
4229
|
{
|
|
4290
4230
|
autoFocus: true,
|
|
@@ -4296,8 +4236,8 @@ function EntityCandidateList({
|
|
|
4296
4236
|
}
|
|
4297
4237
|
)
|
|
4298
4238
|
] }),
|
|
4299
|
-
/* @__PURE__ */
|
|
4300
|
-
!search.trim() && !error && /* @__PURE__ */
|
|
4239
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex-1 min-h-0 overflow-y-auto -mx-1 px-1", children: [
|
|
4240
|
+
!search.trim() && !error && /* @__PURE__ */ jsx6(
|
|
4301
4241
|
SearchFailureNotice,
|
|
4302
4242
|
{
|
|
4303
4243
|
error: null,
|
|
@@ -4307,13 +4247,13 @@ function EntityCandidateList({
|
|
|
4307
4247
|
className: "mb-1"
|
|
4308
4248
|
}
|
|
4309
4249
|
),
|
|
4310
|
-
(loading || recentsLoading) && visibleCount === 0 ? /* @__PURE__ */
|
|
4311
|
-
/* @__PURE__ */
|
|
4250
|
+
(loading || recentsLoading) && visibleCount === 0 ? /* @__PURE__ */ jsxs4(ListMessage, { children: [
|
|
4251
|
+
/* @__PURE__ */ jsx6(SpinnerIcon, { className: "h-4 w-4 animate-spin" }),
|
|
4312
4252
|
"Loading\u2026"
|
|
4313
|
-
] }) : error ? /* @__PURE__ */
|
|
4314
|
-
/* @__PURE__ */
|
|
4315
|
-
/* @__PURE__ */
|
|
4316
|
-
/* @__PURE__ */
|
|
4253
|
+
] }) : error ? /* @__PURE__ */ jsxs4("div", { className: "rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: [
|
|
4254
|
+
/* @__PURE__ */ jsx6("p", { className: "font-medium", children: "Couldn\u2019t load items" }),
|
|
4255
|
+
/* @__PURE__ */ jsx6("p", { className: "opacity-80", children: error }),
|
|
4256
|
+
/* @__PURE__ */ jsx6(
|
|
4317
4257
|
"button",
|
|
4318
4258
|
{
|
|
4319
4259
|
type: "button",
|
|
@@ -4322,32 +4262,32 @@ function EntityCandidateList({
|
|
|
4322
4262
|
children: "Retry"
|
|
4323
4263
|
}
|
|
4324
4264
|
)
|
|
4325
|
-
] }) : visibleCount === 0 ? /* @__PURE__ */
|
|
4326
|
-
visibleRecents.length > 0 && /* @__PURE__ */
|
|
4265
|
+
] }) : visibleCount === 0 ? /* @__PURE__ */ jsx6(ListMessage, { children: canCreate ? `Nothing to attach yet \u2014 create a new ${info.label.toLowerCase()} below.` : "Nothing to attach." }) : /* @__PURE__ */ jsxs4("div", { className: "space-y-2", children: [
|
|
4266
|
+
visibleRecents.length > 0 && /* @__PURE__ */ jsx6(
|
|
4327
4267
|
CandidateSection,
|
|
4328
4268
|
{
|
|
4329
4269
|
label: "Recent",
|
|
4330
4270
|
candidates: visibleRecents,
|
|
4331
4271
|
attachedIds,
|
|
4332
4272
|
busyId,
|
|
4333
|
-
icon: /* @__PURE__ */
|
|
4273
|
+
icon: /* @__PURE__ */ jsx6(Icon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
4334
4274
|
onToggle: toggle
|
|
4335
4275
|
}
|
|
4336
4276
|
),
|
|
4337
|
-
ordinaryCandidates.length > 0 && /* @__PURE__ */
|
|
4277
|
+
ordinaryCandidates.length > 0 && /* @__PURE__ */ jsx6(
|
|
4338
4278
|
CandidateSection,
|
|
4339
4279
|
{
|
|
4340
4280
|
label: visibleRecents.length > 0 ? `All ${info.labelPlural}` : null,
|
|
4341
4281
|
candidates: ordinaryCandidates,
|
|
4342
4282
|
attachedIds,
|
|
4343
4283
|
busyId,
|
|
4344
|
-
icon: /* @__PURE__ */
|
|
4284
|
+
icon: /* @__PURE__ */ jsx6(Icon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
4345
4285
|
onToggle: toggle
|
|
4346
4286
|
}
|
|
4347
4287
|
)
|
|
4348
4288
|
] })
|
|
4349
4289
|
] }),
|
|
4350
|
-
canCreate && /* @__PURE__ */
|
|
4290
|
+
canCreate && /* @__PURE__ */ jsx6(
|
|
4351
4291
|
CreateAndAttachFooter,
|
|
4352
4292
|
{
|
|
4353
4293
|
token,
|
|
@@ -4367,12 +4307,12 @@ function CandidateSection({
|
|
|
4367
4307
|
icon,
|
|
4368
4308
|
onToggle
|
|
4369
4309
|
}) {
|
|
4370
|
-
return /* @__PURE__ */
|
|
4371
|
-
label && /* @__PURE__ */
|
|
4372
|
-
/* @__PURE__ */
|
|
4310
|
+
return /* @__PURE__ */ jsxs4("section", { className: "space-y-0.5", children: [
|
|
4311
|
+
label && /* @__PURE__ */ jsx6("p", { className: "px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/60", children: label }),
|
|
4312
|
+
/* @__PURE__ */ jsx6("ul", { className: "space-y-0.5", children: candidates.map((candidate) => {
|
|
4373
4313
|
const attached = attachedIds.has(candidate.id);
|
|
4374
4314
|
const busy = busyId === candidate.id;
|
|
4375
|
-
return /* @__PURE__ */
|
|
4315
|
+
return /* @__PURE__ */ jsx6("li", { children: /* @__PURE__ */ jsxs4(
|
|
4376
4316
|
"button",
|
|
4377
4317
|
{
|
|
4378
4318
|
type: "button",
|
|
@@ -4385,15 +4325,15 @@ function CandidateSection({
|
|
|
4385
4325
|
),
|
|
4386
4326
|
children: [
|
|
4387
4327
|
icon,
|
|
4388
|
-
/* @__PURE__ */
|
|
4389
|
-
/* @__PURE__ */
|
|
4328
|
+
/* @__PURE__ */ jsx6("span", { className: "flex-1 min-w-0 truncate text-foreground", children: candidate.title }),
|
|
4329
|
+
/* @__PURE__ */ jsx6(
|
|
4390
4330
|
"span",
|
|
4391
4331
|
{
|
|
4392
4332
|
className: cn3(
|
|
4393
4333
|
"flex h-5 w-5 items-center justify-center rounded-full shrink-0",
|
|
4394
4334
|
attached ? "bg-primary text-primary-foreground" : "border border-border text-muted-foreground group-hover:border-primary/60"
|
|
4395
4335
|
),
|
|
4396
|
-
children: busy ? /* @__PURE__ */
|
|
4336
|
+
children: busy ? /* @__PURE__ */ jsx6(SpinnerIcon, { className: "h-3 w-3 animate-spin" }) : attached ? /* @__PURE__ */ jsx6(CheckIcon, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx6(PlusIcon, { className: "h-3 w-3" })
|
|
4397
4337
|
}
|
|
4398
4338
|
)
|
|
4399
4339
|
]
|
|
@@ -4449,7 +4389,7 @@ function CreateAndAttachFooter({
|
|
|
4449
4389
|
}
|
|
4450
4390
|
};
|
|
4451
4391
|
if (!editing) {
|
|
4452
|
-
return /* @__PURE__ */
|
|
4392
|
+
return /* @__PURE__ */ jsxs4(
|
|
4453
4393
|
"button",
|
|
4454
4394
|
{
|
|
4455
4395
|
type: "button",
|
|
@@ -4459,10 +4399,10 @@ function CreateAndAttachFooter({
|
|
|
4459
4399
|
},
|
|
4460
4400
|
className: "mt-2 flex min-h-11 w-full shrink-0 items-center justify-center gap-1.5 rounded-md border border-dashed border-border px-3 py-2 text-sm text-muted-foreground transition-colors hover:border-primary/60 hover:text-foreground md:min-h-0",
|
|
4461
4401
|
children: [
|
|
4462
|
-
/* @__PURE__ */
|
|
4402
|
+
/* @__PURE__ */ jsx6(PlusIcon, { className: "h-4 w-4" }),
|
|
4463
4403
|
"New ",
|
|
4464
4404
|
info.label,
|
|
4465
|
-
seed ? /* @__PURE__ */
|
|
4405
|
+
seed ? /* @__PURE__ */ jsxs4("span", { className: "max-w-40 truncate text-muted-foreground/70", children: [
|
|
4466
4406
|
"\u201C",
|
|
4467
4407
|
seed,
|
|
4468
4408
|
"\u201D"
|
|
@@ -4471,8 +4411,8 @@ function CreateAndAttachFooter({
|
|
|
4471
4411
|
}
|
|
4472
4412
|
);
|
|
4473
4413
|
}
|
|
4474
|
-
return /* @__PURE__ */
|
|
4475
|
-
/* @__PURE__ */
|
|
4414
|
+
return /* @__PURE__ */ jsxs4("div", { className: "mt-2 flex shrink-0 items-center gap-1.5", children: [
|
|
4415
|
+
/* @__PURE__ */ jsx6(
|
|
4476
4416
|
Input,
|
|
4477
4417
|
{
|
|
4478
4418
|
autoFocus: true,
|
|
@@ -4491,17 +4431,17 @@ function CreateAndAttachFooter({
|
|
|
4491
4431
|
style: { fontSize: 16 }
|
|
4492
4432
|
}
|
|
4493
4433
|
),
|
|
4494
|
-
/* @__PURE__ */
|
|
4434
|
+
/* @__PURE__ */ jsx6(
|
|
4495
4435
|
"button",
|
|
4496
4436
|
{
|
|
4497
4437
|
type: "button",
|
|
4498
4438
|
disabled: busy || !name.trim(),
|
|
4499
4439
|
onClick: () => void submit(),
|
|
4500
4440
|
className: "flex h-11 items-center gap-1 rounded-md bg-primary px-2.5 text-sm font-medium text-primary-foreground transition-opacity disabled:opacity-50 md:h-8",
|
|
4501
|
-
children: busy ? /* @__PURE__ */
|
|
4441
|
+
children: busy ? /* @__PURE__ */ jsx6(SpinnerIcon, { className: "h-3.5 w-3.5 animate-spin" }) : "Create"
|
|
4502
4442
|
}
|
|
4503
4443
|
),
|
|
4504
|
-
/* @__PURE__ */
|
|
4444
|
+
/* @__PURE__ */ jsx6(
|
|
4505
4445
|
"button",
|
|
4506
4446
|
{
|
|
4507
4447
|
type: "button",
|
|
@@ -4512,13 +4452,13 @@ function CreateAndAttachFooter({
|
|
|
4512
4452
|
},
|
|
4513
4453
|
title: "Cancel",
|
|
4514
4454
|
className: "flex h-11 w-11 items-center justify-center rounded-md border border-border text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50 md:h-8 md:w-8",
|
|
4515
|
-
children: /* @__PURE__ */
|
|
4455
|
+
children: /* @__PURE__ */ jsx6(XIcon2, { className: "h-4 w-4" })
|
|
4516
4456
|
}
|
|
4517
4457
|
)
|
|
4518
4458
|
] });
|
|
4519
4459
|
}
|
|
4520
4460
|
function ListMessage({ children }) {
|
|
4521
|
-
return /* @__PURE__ */
|
|
4461
|
+
return /* @__PURE__ */ jsx6("div", { className: "flex items-center justify-center gap-2 py-8 text-[13px] text-muted-foreground", children });
|
|
4522
4462
|
}
|
|
4523
4463
|
|
|
4524
4464
|
// src/react/components/UniversalAssociationPicker.tsx
|
|
@@ -4530,17 +4470,17 @@ import { CheckIcon as CheckIcon2, Maximize2Icon as Maximize2Icon2, PlusIcon as P
|
|
|
4530
4470
|
import { cn as cn4 } from "@ai-matrx/design-system";
|
|
4531
4471
|
import { ExternalLinkIcon } from "@ai-matrx/design-system/icons";
|
|
4532
4472
|
import { OutboundLink } from "@ai-matrx/kit/outbound-react";
|
|
4533
|
-
import { jsx as
|
|
4473
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
4534
4474
|
function DoorRef(props) {
|
|
4535
4475
|
const { onOpen, ...refProps } = props;
|
|
4536
4476
|
const { entityDoors } = useAssociationsUiPorts();
|
|
4537
4477
|
const store = useAssociationsStore();
|
|
4538
4478
|
const HostRef = entityDoors?.EntityRef;
|
|
4539
|
-
if (HostRef) return /* @__PURE__ */
|
|
4479
|
+
if (HostRef) return /* @__PURE__ */ jsx7(HostRef, { ...refProps });
|
|
4540
4480
|
const name = refProps.name ?? null;
|
|
4541
4481
|
const href = store.registry.tryGetEntityInfo(refProps.token)?.hrefFor?.(refProps.id) ?? null;
|
|
4542
4482
|
if (onOpen) {
|
|
4543
|
-
return /* @__PURE__ */
|
|
4483
|
+
return /* @__PURE__ */ jsx7(
|
|
4544
4484
|
"button",
|
|
4545
4485
|
{
|
|
4546
4486
|
type: "button",
|
|
@@ -4554,7 +4494,7 @@ function DoorRef(props) {
|
|
|
4554
4494
|
);
|
|
4555
4495
|
}
|
|
4556
4496
|
if (href) {
|
|
4557
|
-
return /* @__PURE__ */
|
|
4497
|
+
return /* @__PURE__ */ jsxs5(
|
|
4558
4498
|
"a",
|
|
4559
4499
|
{
|
|
4560
4500
|
href,
|
|
@@ -4565,19 +4505,19 @@ function DoorRef(props) {
|
|
|
4565
4505
|
refProps.className
|
|
4566
4506
|
),
|
|
4567
4507
|
children: [
|
|
4568
|
-
/* @__PURE__ */
|
|
4569
|
-
/* @__PURE__ */
|
|
4508
|
+
/* @__PURE__ */ jsx7("span", { className: "min-w-0 truncate", children: name }),
|
|
4509
|
+
/* @__PURE__ */ jsx7(ExternalLinkIcon, { className: "h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-60" })
|
|
4570
4510
|
]
|
|
4571
4511
|
}
|
|
4572
4512
|
);
|
|
4573
4513
|
}
|
|
4574
|
-
return /* @__PURE__ */
|
|
4514
|
+
return /* @__PURE__ */ jsx7("span", { className: cn4("min-w-0 truncate", refProps.className), children: name });
|
|
4575
4515
|
}
|
|
4576
4516
|
function UnresolvedRef({ token, id }) {
|
|
4577
4517
|
const { entityDoors } = useAssociationsUiPorts();
|
|
4578
4518
|
const HostUnresolved = entityDoors?.UnresolvedRef;
|
|
4579
|
-
if (HostUnresolved) return /* @__PURE__ */
|
|
4580
|
-
return /* @__PURE__ */
|
|
4519
|
+
if (HostUnresolved) return /* @__PURE__ */ jsx7(HostUnresolved, { token, id });
|
|
4520
|
+
return /* @__PURE__ */ jsx7(
|
|
4581
4521
|
"span",
|
|
4582
4522
|
{
|
|
4583
4523
|
className: "inline-flex items-center rounded border border-border/60 bg-muted/40 px-1.5 py-0.5 text-[11px] text-muted-foreground",
|
|
@@ -4590,11 +4530,11 @@ function DoorControlsSlot(props) {
|
|
|
4590
4530
|
const { entityDoors } = useAssociationsUiPorts();
|
|
4591
4531
|
const store = useAssociationsStore();
|
|
4592
4532
|
const HostControls = entityDoors?.DoorControls;
|
|
4593
|
-
if (HostControls) return /* @__PURE__ */
|
|
4533
|
+
if (HostControls) return /* @__PURE__ */ jsx7(HostControls, { ...props });
|
|
4594
4534
|
const href = store.registry.tryGetEntityInfo(props.token)?.hrefFor?.(props.id) ?? null;
|
|
4595
4535
|
if (!href) return null;
|
|
4596
4536
|
const label = props.name ? `Open ${props.name}` : `Open this ${props.token}`;
|
|
4597
|
-
return /* @__PURE__ */
|
|
4537
|
+
return /* @__PURE__ */ jsx7(
|
|
4598
4538
|
OutboundLink,
|
|
4599
4539
|
{
|
|
4600
4540
|
href,
|
|
@@ -4604,13 +4544,13 @@ function DoorControlsSlot(props) {
|
|
|
4604
4544
|
"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
4605
4545
|
props.className
|
|
4606
4546
|
),
|
|
4607
|
-
children: /* @__PURE__ */
|
|
4547
|
+
children: /* @__PURE__ */ jsx7(ExternalLinkIcon, { className: "h-3 w-3" })
|
|
4608
4548
|
}
|
|
4609
4549
|
);
|
|
4610
4550
|
}
|
|
4611
4551
|
|
|
4612
4552
|
// src/react/components/UniversalAssociationPicker.tsx
|
|
4613
|
-
import { jsx as
|
|
4553
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
4614
4554
|
function attachedKey(token, id) {
|
|
4615
4555
|
return `${token}:${id}`;
|
|
4616
4556
|
}
|
|
@@ -4665,10 +4605,10 @@ function UniversalAssociationPicker(props) {
|
|
|
4665
4605
|
groups.set(r.token, list);
|
|
4666
4606
|
}
|
|
4667
4607
|
const BrowseOverride = browseToken ? pickerOverrides?.[browseToken] : void 0;
|
|
4668
|
-
return /* @__PURE__ */
|
|
4669
|
-
/* @__PURE__ */
|
|
4670
|
-
/* @__PURE__ */
|
|
4671
|
-
/* @__PURE__ */
|
|
4608
|
+
return /* @__PURE__ */ jsxs6("div", { className: cn5("flex min-h-0 flex-1 flex-col gap-2", className), children: [
|
|
4609
|
+
/* @__PURE__ */ jsxs6("div", { className: "relative", children: [
|
|
4610
|
+
/* @__PURE__ */ jsx8(SearchIcon2, { className: "absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
4611
|
+
/* @__PURE__ */ jsx8(
|
|
4672
4612
|
Input2,
|
|
4673
4613
|
{
|
|
4674
4614
|
autoFocus: true,
|
|
@@ -4682,9 +4622,9 @@ function UniversalAssociationPicker(props) {
|
|
|
4682
4622
|
style: { fontSize: 16 }
|
|
4683
4623
|
}
|
|
4684
4624
|
),
|
|
4685
|
-
loading && browseToken === null && /* @__PURE__ */
|
|
4625
|
+
loading && browseToken === null && /* @__PURE__ */ jsx8(SpinnerIcon, { className: "absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 animate-spin text-muted-foreground" })
|
|
4686
4626
|
] }),
|
|
4687
|
-
/* @__PURE__ */
|
|
4627
|
+
/* @__PURE__ */ jsx8(
|
|
4688
4628
|
"div",
|
|
4689
4629
|
{
|
|
4690
4630
|
role: "group",
|
|
@@ -4694,7 +4634,7 @@ function UniversalAssociationPicker(props) {
|
|
|
4694
4634
|
const info = store.registry.getEntityInfo(t);
|
|
4695
4635
|
const ChipIcon = info.Icon ?? DefaultEntityIcon;
|
|
4696
4636
|
const active = browseToken === t;
|
|
4697
|
-
return /* @__PURE__ */
|
|
4637
|
+
return /* @__PURE__ */ jsxs6(
|
|
4698
4638
|
"button",
|
|
4699
4639
|
{
|
|
4700
4640
|
type: "button",
|
|
@@ -4705,7 +4645,7 @@ function UniversalAssociationPicker(props) {
|
|
|
4705
4645
|
active ? "border-primary/50 bg-primary/10 text-foreground" : "border-border text-muted-foreground hover:text-foreground hover:bg-accent"
|
|
4706
4646
|
),
|
|
4707
4647
|
children: [
|
|
4708
|
-
/* @__PURE__ */
|
|
4648
|
+
/* @__PURE__ */ jsx8(ChipIcon, { className: "h-3 w-3" }),
|
|
4709
4649
|
info.labelPlural
|
|
4710
4650
|
]
|
|
4711
4651
|
},
|
|
@@ -4718,17 +4658,17 @@ function UniversalAssociationPicker(props) {
|
|
|
4718
4658
|
// The token's canonical host picker (e.g. the stored-files browser)
|
|
4719
4659
|
// owns per-token browsing when registered — never a plain list twin.
|
|
4720
4660
|
// It opens in its own window; this body says where it went.
|
|
4721
|
-
/* @__PURE__ */
|
|
4661
|
+
/* @__PURE__ */ jsxs6(
|
|
4722
4662
|
"div",
|
|
4723
4663
|
{
|
|
4724
4664
|
role: "region",
|
|
4725
4665
|
"aria-label": `${store.registry.getEntityInfo(browseToken).labelPlural} window`,
|
|
4726
4666
|
className: "flex flex-1 flex-col items-center justify-center gap-3 px-4 py-8 text-center",
|
|
4727
4667
|
children: [
|
|
4728
|
-
/* @__PURE__ */
|
|
4729
|
-
/* @__PURE__ */
|
|
4730
|
-
/* @__PURE__ */
|
|
4731
|
-
/* @__PURE__ */
|
|
4668
|
+
/* @__PURE__ */ jsx8("p", { className: "text-sm text-foreground", children: overrideOpen ? `The ${store.registry.getEntityInfo(browseToken).labelPlural.toLowerCase()} window is open.` : `The ${store.registry.getEntityInfo(browseToken).labelPlural.toLowerCase()} window is closed.` }),
|
|
4669
|
+
/* @__PURE__ */ jsx8("p", { className: "max-w-xs text-[12px] text-muted-foreground", children: overrideOpen ? "Check items there to attach them; uncheck to detach. Changes save as you go." : "Reopen it to pick more, or go back to search everything." }),
|
|
4670
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap items-center justify-center gap-2", children: [
|
|
4671
|
+
/* @__PURE__ */ jsxs6(
|
|
4732
4672
|
Button,
|
|
4733
4673
|
{
|
|
4734
4674
|
type: "button",
|
|
@@ -4739,12 +4679,12 @@ function UniversalAssociationPicker(props) {
|
|
|
4739
4679
|
setOverrideMount((n) => n + 1);
|
|
4740
4680
|
},
|
|
4741
4681
|
children: [
|
|
4742
|
-
/* @__PURE__ */
|
|
4682
|
+
/* @__PURE__ */ jsx8(Maximize2Icon2, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
4743
4683
|
overrideOpen ? "Bring window to front" : "Reopen window"
|
|
4744
4684
|
]
|
|
4745
4685
|
}
|
|
4746
4686
|
),
|
|
4747
|
-
/* @__PURE__ */
|
|
4687
|
+
/* @__PURE__ */ jsx8(
|
|
4748
4688
|
Button,
|
|
4749
4689
|
{
|
|
4750
4690
|
type: "button",
|
|
@@ -4755,7 +4695,7 @@ function UniversalAssociationPicker(props) {
|
|
|
4755
4695
|
}
|
|
4756
4696
|
)
|
|
4757
4697
|
] }),
|
|
4758
|
-
overrideOpen && /* @__PURE__ */
|
|
4698
|
+
overrideOpen && /* @__PURE__ */ jsx8(
|
|
4759
4699
|
BrowseOverride,
|
|
4760
4700
|
{
|
|
4761
4701
|
open: true,
|
|
@@ -4775,7 +4715,7 @@ function UniversalAssociationPicker(props) {
|
|
|
4775
4715
|
]
|
|
4776
4716
|
}
|
|
4777
4717
|
)
|
|
4778
|
-
) : browseToken ? /* @__PURE__ */
|
|
4718
|
+
) : browseToken ? /* @__PURE__ */ jsx8("div", { className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ jsx8(
|
|
4779
4719
|
AssociationCandidateBody,
|
|
4780
4720
|
{
|
|
4781
4721
|
token: browseToken,
|
|
@@ -4788,13 +4728,13 @@ function UniversalAssociationPicker(props) {
|
|
|
4788
4728
|
onAttach: (id, title) => onAttach(browseToken, id, title),
|
|
4789
4729
|
onDetach: (id) => onDetach(browseToken, id)
|
|
4790
4730
|
}
|
|
4791
|
-
) }) : /* @__PURE__ */
|
|
4731
|
+
) }) : /* @__PURE__ */ jsx8(
|
|
4792
4732
|
"div",
|
|
4793
4733
|
{
|
|
4794
4734
|
role: "region",
|
|
4795
4735
|
"aria-label": "Association search results",
|
|
4796
4736
|
className: "-mx-1 min-h-24 flex-1 overflow-y-auto overscroll-contain px-1",
|
|
4797
|
-
children: error ? /* @__PURE__ */
|
|
4737
|
+
children: error ? /* @__PURE__ */ jsx8(
|
|
4798
4738
|
SearchFailureNotice,
|
|
4799
4739
|
{
|
|
4800
4740
|
error,
|
|
@@ -4802,8 +4742,8 @@ function UniversalAssociationPicker(props) {
|
|
|
4802
4742
|
operation: "Search to attach",
|
|
4803
4743
|
origin: "associations/UniversalAssociationPicker"
|
|
4804
4744
|
}
|
|
4805
|
-
) : results.length === 0 && failures.length === 0 ? /* @__PURE__ */
|
|
4806
|
-
/* @__PURE__ */
|
|
4745
|
+
) : results.length === 0 && failures.length === 0 ? /* @__PURE__ */ jsx8("p", { className: "py-6 text-center text-[12px] text-muted-foreground", children: loading ? "Searching\u2026" : query.trim() ? "No matches \u2014 narrow with a type chip to browse." : "Nothing to attach yet. Type to search, or pick a type to browse." }) : /* @__PURE__ */ jsxs6("div", { className: "space-y-2", children: [
|
|
4746
|
+
/* @__PURE__ */ jsx8(
|
|
4807
4747
|
SearchFailureNotice,
|
|
4808
4748
|
{
|
|
4809
4749
|
error: null,
|
|
@@ -4812,20 +4752,20 @@ function UniversalAssociationPicker(props) {
|
|
|
4812
4752
|
origin: "associations/UniversalAssociationPicker"
|
|
4813
4753
|
}
|
|
4814
4754
|
),
|
|
4815
|
-
source !== "search" && results.length > 0 && /* @__PURE__ */
|
|
4755
|
+
source !== "search" && results.length > 0 && /* @__PURE__ */ jsx8("p", { className: "px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/60", children: source === "recents" ? "Recent" : "Browse" }),
|
|
4816
4756
|
[...groups.entries()].map(([token, items]) => {
|
|
4817
4757
|
const info = store.registry.getEntityInfo(token);
|
|
4818
4758
|
const GroupIcon = info.Icon ?? DefaultEntityIcon;
|
|
4819
|
-
return /* @__PURE__ */
|
|
4820
|
-
/* @__PURE__ */
|
|
4821
|
-
/* @__PURE__ */
|
|
4759
|
+
return /* @__PURE__ */ jsxs6("div", { className: "space-y-0.5", children: [
|
|
4760
|
+
/* @__PURE__ */ jsxs6("p", { className: "flex items-center gap-1 px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/70", children: [
|
|
4761
|
+
/* @__PURE__ */ jsx8(GroupIcon, { className: "h-3 w-3" }),
|
|
4822
4762
|
info.labelPlural
|
|
4823
4763
|
] }),
|
|
4824
|
-
/* @__PURE__ */
|
|
4764
|
+
/* @__PURE__ */ jsx8("ul", { className: "space-y-0.5", children: items.map((c) => {
|
|
4825
4765
|
const key = attachedKey(c.token, c.id);
|
|
4826
4766
|
const attached = attachedKeys.has(key);
|
|
4827
4767
|
const busy = busyKey === key;
|
|
4828
|
-
return /* @__PURE__ */
|
|
4768
|
+
return /* @__PURE__ */ jsxs6(
|
|
4829
4769
|
"li",
|
|
4830
4770
|
{
|
|
4831
4771
|
className: cn5(
|
|
@@ -4834,7 +4774,7 @@ function UniversalAssociationPicker(props) {
|
|
|
4834
4774
|
attached && "bg-accent/40"
|
|
4835
4775
|
),
|
|
4836
4776
|
children: [
|
|
4837
|
-
/* @__PURE__ */
|
|
4777
|
+
/* @__PURE__ */ jsxs6(
|
|
4838
4778
|
"button",
|
|
4839
4779
|
{
|
|
4840
4780
|
type: "button",
|
|
@@ -4846,21 +4786,21 @@ function UniversalAssociationPicker(props) {
|
|
|
4846
4786
|
"disabled:opacity-50"
|
|
4847
4787
|
),
|
|
4848
4788
|
children: [
|
|
4849
|
-
/* @__PURE__ */
|
|
4850
|
-
/* @__PURE__ */
|
|
4789
|
+
/* @__PURE__ */ jsx8("span", { className: "min-w-0 flex-1 truncate text-foreground", children: c.title }),
|
|
4790
|
+
/* @__PURE__ */ jsx8(
|
|
4851
4791
|
"span",
|
|
4852
4792
|
{
|
|
4853
4793
|
className: cn5(
|
|
4854
4794
|
"flex h-5 w-5 shrink-0 items-center justify-center rounded-full",
|
|
4855
4795
|
attached ? "bg-primary text-primary-foreground" : "border border-border text-muted-foreground group-hover:border-primary/60"
|
|
4856
4796
|
),
|
|
4857
|
-
children: busy ? /* @__PURE__ */
|
|
4797
|
+
children: busy ? /* @__PURE__ */ jsx8(SpinnerIcon, { className: "h-3 w-3 animate-spin" }) : attached ? /* @__PURE__ */ jsx8(CheckIcon2, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx8(PlusIcon2, { className: "h-3 w-3" })
|
|
4858
4798
|
}
|
|
4859
4799
|
)
|
|
4860
4800
|
]
|
|
4861
4801
|
}
|
|
4862
4802
|
),
|
|
4863
|
-
/* @__PURE__ */
|
|
4803
|
+
/* @__PURE__ */ jsx8(
|
|
4864
4804
|
DoorControlsSlot,
|
|
4865
4805
|
{
|
|
4866
4806
|
token: c.token,
|
|
@@ -4885,7 +4825,7 @@ function UniversalAssociationPicker(props) {
|
|
|
4885
4825
|
import { useEffect as useEffect9, useState as useState8 } from "react";
|
|
4886
4826
|
import { cn as cn6 } from "@ai-matrx/design-system";
|
|
4887
4827
|
import { PinIcon, PlusIcon as PlusIcon3, XIcon as XIcon3 } from "@ai-matrx/design-system/icons";
|
|
4888
|
-
import { Fragment as Fragment2, jsx as
|
|
4828
|
+
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
4889
4829
|
function metadataIsPinned(metadata) {
|
|
4890
4830
|
return metadata !== null && typeof metadata === "object" && !Array.isArray(metadata) && Reflect.get(metadata, "pinned") === true;
|
|
4891
4831
|
}
|
|
@@ -4896,9 +4836,9 @@ function AttachedItemsSheet(props) {
|
|
|
4896
4836
|
const title = info.labelPlural;
|
|
4897
4837
|
const containerName = props.container?.label ?? props.containerLabel;
|
|
4898
4838
|
const filing = props.container?.direction === "outgoing";
|
|
4899
|
-
const subtitle = props.container ? /* @__PURE__ */
|
|
4839
|
+
const subtitle = props.container ? /* @__PURE__ */ jsxs7("span", { className: "inline-flex min-w-0 max-w-full items-center gap-1", children: [
|
|
4900
4840
|
filing ? "What this is filed under:" : "Attached to",
|
|
4901
|
-
/* @__PURE__ */
|
|
4841
|
+
/* @__PURE__ */ jsx9(
|
|
4902
4842
|
DoorRef,
|
|
4903
4843
|
{
|
|
4904
4844
|
token: props.container.type,
|
|
@@ -4909,16 +4849,16 @@ function AttachedItemsSheet(props) {
|
|
|
4909
4849
|
)
|
|
4910
4850
|
] }) : props.containerLabel ? `Attached to ${props.containerLabel}` : "Attached items";
|
|
4911
4851
|
if (!props.open) return null;
|
|
4912
|
-
return /* @__PURE__ */
|
|
4852
|
+
return /* @__PURE__ */ jsx9(
|
|
4913
4853
|
AssociationWindow,
|
|
4914
4854
|
{
|
|
4915
4855
|
open: props.open,
|
|
4916
4856
|
onClose: () => props.onOpenChange(false),
|
|
4917
4857
|
scopeId: `attached:${props.token}`,
|
|
4918
4858
|
title,
|
|
4919
|
-
icon: /* @__PURE__ */
|
|
4859
|
+
icon: /* @__PURE__ */ jsx9(Icon, { className: "size-3.5 text-primary" }),
|
|
4920
4860
|
subtitle,
|
|
4921
|
-
children: /* @__PURE__ */
|
|
4861
|
+
children: /* @__PURE__ */ jsx9(
|
|
4922
4862
|
AttachedItemsBody,
|
|
4923
4863
|
{
|
|
4924
4864
|
token: props.token,
|
|
@@ -5007,31 +4947,31 @@ function AttachedItemsBody({
|
|
|
5007
4947
|
setBusyId(null);
|
|
5008
4948
|
}
|
|
5009
4949
|
};
|
|
5010
|
-
return /* @__PURE__ */
|
|
5011
|
-
titleError ? /* @__PURE__ */
|
|
4950
|
+
return /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
4951
|
+
titleError ? /* @__PURE__ */ jsxs7("div", { className: "mb-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: [
|
|
5012
4952
|
"Showing names recorded at attach time \u2014 they may be out of date.",
|
|
5013
4953
|
" ",
|
|
5014
4954
|
titleError
|
|
5015
4955
|
] }) : null,
|
|
5016
|
-
/* @__PURE__ */
|
|
5017
|
-
/* @__PURE__ */
|
|
4956
|
+
/* @__PURE__ */ jsx9("div", { className: "flex-1 min-h-0 overflow-y-auto -mx-1 px-1", children: links.length === 0 ? /* @__PURE__ */ jsx9("div", { className: "flex items-center justify-center py-8 text-[13px] text-muted-foreground", children: "Nothing attached yet." }) : titles === null ? /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-center gap-2 py-8 text-[13px] text-muted-foreground", children: [
|
|
4957
|
+
/* @__PURE__ */ jsx9(SpinnerIcon, { className: "h-4 w-4 animate-spin" }),
|
|
5018
4958
|
"Loading\u2026"
|
|
5019
|
-
] }) : /* @__PURE__ */
|
|
4959
|
+
] }) : /* @__PURE__ */ jsx9("ul", { className: "space-y-0.5", children: links.map((link) => {
|
|
5020
4960
|
const resolved = titles.get(link.resourceId);
|
|
5021
4961
|
const missing = !titles.has(link.resourceId);
|
|
5022
4962
|
const name = resolved ?? link.label ?? (missing ? null : "Untitled");
|
|
5023
4963
|
const busy = busyId === link.resourceId;
|
|
5024
4964
|
const pinned = metadataIsPinned(link.metadata);
|
|
5025
|
-
return /* @__PURE__ */
|
|
4965
|
+
return /* @__PURE__ */ jsxs7(
|
|
5026
4966
|
"li",
|
|
5027
4967
|
{
|
|
5028
4968
|
className: "group/entity-ref group flex items-center gap-2 rounded-md px-2.5 py-2 text-sm transition-colors hover:bg-accent",
|
|
5029
4969
|
children: [
|
|
5030
|
-
/* @__PURE__ */
|
|
5031
|
-
/* @__PURE__ */
|
|
4970
|
+
/* @__PURE__ */ jsx9(Icon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
4971
|
+
/* @__PURE__ */ jsx9("span", { className: "flex-1 min-w-0 truncate", children: name === null ? (
|
|
5032
4972
|
// The X beside the row stays the one-click detach.
|
|
5033
|
-
/* @__PURE__ */
|
|
5034
|
-
) : /* @__PURE__ */
|
|
4973
|
+
/* @__PURE__ */ jsx9(UnresolvedRef, { token, id: link.resourceId })
|
|
4974
|
+
) : /* @__PURE__ */ jsx9(
|
|
5035
4975
|
DoorRef,
|
|
5036
4976
|
{
|
|
5037
4977
|
token,
|
|
@@ -5041,7 +4981,7 @@ function AttachedItemsBody({
|
|
|
5041
4981
|
className: "text-foreground"
|
|
5042
4982
|
}
|
|
5043
4983
|
) }),
|
|
5044
|
-
onSetPinned ? /* @__PURE__ */
|
|
4984
|
+
onSetPinned ? /* @__PURE__ */ jsx9(
|
|
5045
4985
|
"button",
|
|
5046
4986
|
{
|
|
5047
4987
|
type: "button",
|
|
@@ -5053,7 +4993,7 @@ function AttachedItemsBody({
|
|
|
5053
4993
|
"flex h-6 w-6 shrink-0 items-center justify-center rounded-md transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50",
|
|
5054
4994
|
pinned ? "text-primary" : "text-muted-foreground"
|
|
5055
4995
|
),
|
|
5056
|
-
children: /* @__PURE__ */
|
|
4996
|
+
children: /* @__PURE__ */ jsx9(
|
|
5057
4997
|
PinIcon,
|
|
5058
4998
|
{
|
|
5059
4999
|
className: cn6(
|
|
@@ -5064,7 +5004,7 @@ function AttachedItemsBody({
|
|
|
5064
5004
|
)
|
|
5065
5005
|
}
|
|
5066
5006
|
) : null,
|
|
5067
|
-
/* @__PURE__ */
|
|
5007
|
+
/* @__PURE__ */ jsx9(
|
|
5068
5008
|
"button",
|
|
5069
5009
|
{
|
|
5070
5010
|
type: "button",
|
|
@@ -5075,7 +5015,7 @@ function AttachedItemsBody({
|
|
|
5075
5015
|
"flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors",
|
|
5076
5016
|
"hover:bg-destructive/10 hover:text-destructive disabled:opacity-50"
|
|
5077
5017
|
),
|
|
5078
|
-
children: busy ? /* @__PURE__ */
|
|
5018
|
+
children: busy ? /* @__PURE__ */ jsx9(SpinnerIcon, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx9(XIcon3, { className: "h-3.5 w-3.5" })
|
|
5079
5019
|
}
|
|
5080
5020
|
)
|
|
5081
5021
|
]
|
|
@@ -5083,14 +5023,14 @@ function AttachedItemsBody({
|
|
|
5083
5023
|
link.edgeId
|
|
5084
5024
|
);
|
|
5085
5025
|
}) }) }),
|
|
5086
|
-
onAdd ? /* @__PURE__ */
|
|
5026
|
+
onAdd ? /* @__PURE__ */ jsxs7(
|
|
5087
5027
|
"button",
|
|
5088
5028
|
{
|
|
5089
5029
|
type: "button",
|
|
5090
5030
|
onClick: onAdd,
|
|
5091
5031
|
className: "mt-2 flex w-full items-center justify-center gap-1.5 rounded-md border border-border px-3 py-2 text-sm text-muted-foreground transition-colors hover:border-primary/60 hover:text-foreground",
|
|
5092
5032
|
children: [
|
|
5093
|
-
/* @__PURE__ */
|
|
5033
|
+
/* @__PURE__ */ jsx9(PlusIcon3, { className: "h-4 w-4" }),
|
|
5094
5034
|
"Attach ",
|
|
5095
5035
|
info.labelPlural.toLowerCase()
|
|
5096
5036
|
]
|
|
@@ -5153,7 +5093,7 @@ function getContentRoleMeta(role) {
|
|
|
5153
5093
|
|
|
5154
5094
|
// src/react/components/AssociationCard.tsx
|
|
5155
5095
|
import { PlusIcon as PlusIcon4 } from "@ai-matrx/design-system/icons";
|
|
5156
|
-
import { Fragment as Fragment3, jsx as
|
|
5096
|
+
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
5157
5097
|
function AssociationCard({
|
|
5158
5098
|
token,
|
|
5159
5099
|
container: containerProp,
|
|
@@ -5192,7 +5132,7 @@ function AssociationCard({
|
|
|
5192
5132
|
const canDrillIn = count > 0;
|
|
5193
5133
|
const countWord = filing ? "filed under" : "attached";
|
|
5194
5134
|
const drillTitle = canDrillIn ? `View the ${info.labelPlural.toLowerCase()} attached to ${container.label ?? "this"}` : void 0;
|
|
5195
|
-
return /* @__PURE__ */
|
|
5135
|
+
return /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5196
5136
|
look !== "tiles" ? (
|
|
5197
5137
|
// ONE-LINE LOOKS (opt-in, off by default): small icon, UPPERCASE name,
|
|
5198
5138
|
// count, then the "+".
|
|
@@ -5204,7 +5144,7 @@ function AssociationCard({
|
|
|
5204
5144
|
// so the tap target's own 44px box centers the 28px circle with
|
|
5205
5145
|
// 8px on every side. Never pass a layout class to a tap button —
|
|
5206
5146
|
// its className lands on the ICON (the 2026-09-27 crooked "+").
|
|
5207
|
-
/* @__PURE__ */
|
|
5147
|
+
/* @__PURE__ */ jsxs8(
|
|
5208
5148
|
"div",
|
|
5209
5149
|
{
|
|
5210
5150
|
"data-association-card": token,
|
|
@@ -5215,7 +5155,7 @@ function AssociationCard({
|
|
|
5215
5155
|
className
|
|
5216
5156
|
),
|
|
5217
5157
|
children: [
|
|
5218
|
-
/* @__PURE__ */
|
|
5158
|
+
/* @__PURE__ */ jsxs8(
|
|
5219
5159
|
"button",
|
|
5220
5160
|
{
|
|
5221
5161
|
type: "button",
|
|
@@ -5228,13 +5168,13 @@ function AssociationCard({
|
|
|
5228
5168
|
canDrillIn ? "cursor-pointer hover:text-foreground" : "cursor-default"
|
|
5229
5169
|
),
|
|
5230
5170
|
children: [
|
|
5231
|
-
/* @__PURE__ */
|
|
5232
|
-
/* @__PURE__ */
|
|
5233
|
-
loading ? /* @__PURE__ */
|
|
5171
|
+
/* @__PURE__ */ jsx10(Icon, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
5172
|
+
/* @__PURE__ */ jsx10("span", { className: "min-w-0 truncate text-xs font-semibold uppercase tracking-wider text-foreground", children: info.labelPlural }),
|
|
5173
|
+
loading ? /* @__PURE__ */ jsx10(SpinnerIcon, { className: "h-3 w-3 animate-spin text-muted-foreground" }) : /* @__PURE__ */ jsx10("span", { className: "text-xs tabular-nums text-muted-foreground", children: count })
|
|
5234
5174
|
]
|
|
5235
5175
|
}
|
|
5236
5176
|
),
|
|
5237
|
-
canAttach && (look === "compact" ? /* @__PURE__ */
|
|
5177
|
+
canAttach && (look === "compact" ? /* @__PURE__ */ jsx10(
|
|
5238
5178
|
PlusTapButton,
|
|
5239
5179
|
{
|
|
5240
5180
|
variant: "outline",
|
|
@@ -5242,7 +5182,7 @@ function AssociationCard({
|
|
|
5242
5182
|
tooltip: false,
|
|
5243
5183
|
onClick: () => setOpen(true)
|
|
5244
5184
|
}
|
|
5245
|
-
) : /* @__PURE__ */
|
|
5185
|
+
) : /* @__PURE__ */ jsx10(
|
|
5246
5186
|
"button",
|
|
5247
5187
|
{
|
|
5248
5188
|
type: "button",
|
|
@@ -5250,13 +5190,13 @@ function AssociationCard({
|
|
|
5250
5190
|
"aria-label": `Attach ${info.labelPlural.toLowerCase()}`,
|
|
5251
5191
|
title: `Attach ${info.labelPlural.toLowerCase()}`,
|
|
5252
5192
|
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",
|
|
5253
|
-
children: /* @__PURE__ */
|
|
5193
|
+
children: /* @__PURE__ */ jsx10(PlusIcon4, { className: "h-4 w-4" })
|
|
5254
5194
|
}
|
|
5255
5195
|
))
|
|
5256
5196
|
]
|
|
5257
5197
|
}
|
|
5258
5198
|
)
|
|
5259
|
-
) : /* @__PURE__ */
|
|
5199
|
+
) : /* @__PURE__ */ jsxs8(
|
|
5260
5200
|
"div",
|
|
5261
5201
|
{
|
|
5262
5202
|
"data-association-card": token,
|
|
@@ -5266,7 +5206,7 @@ function AssociationCard({
|
|
|
5266
5206
|
className
|
|
5267
5207
|
),
|
|
5268
5208
|
children: [
|
|
5269
|
-
/* @__PURE__ */
|
|
5209
|
+
/* @__PURE__ */ jsx10(
|
|
5270
5210
|
"span",
|
|
5271
5211
|
{
|
|
5272
5212
|
className: cn7(
|
|
@@ -5275,7 +5215,7 @@ function AssociationCard({
|
|
|
5275
5215
|
)
|
|
5276
5216
|
}
|
|
5277
5217
|
),
|
|
5278
|
-
/* @__PURE__ */
|
|
5218
|
+
/* @__PURE__ */ jsxs8(
|
|
5279
5219
|
"button",
|
|
5280
5220
|
{
|
|
5281
5221
|
type: "button",
|
|
@@ -5287,7 +5227,7 @@ function AssociationCard({
|
|
|
5287
5227
|
canDrillIn ? "cursor-pointer" : "cursor-default"
|
|
5288
5228
|
),
|
|
5289
5229
|
children: [
|
|
5290
|
-
/* @__PURE__ */
|
|
5230
|
+
/* @__PURE__ */ jsx10(
|
|
5291
5231
|
"span",
|
|
5292
5232
|
{
|
|
5293
5233
|
className: cn7(
|
|
@@ -5295,20 +5235,20 @@ function AssociationCard({
|
|
|
5295
5235
|
role.accentBg,
|
|
5296
5236
|
role.accentText
|
|
5297
5237
|
),
|
|
5298
|
-
children: /* @__PURE__ */
|
|
5238
|
+
children: /* @__PURE__ */ jsx10(Icon, { className: "h-4 w-4" })
|
|
5299
5239
|
}
|
|
5300
5240
|
),
|
|
5301
|
-
/* @__PURE__ */
|
|
5302
|
-
/* @__PURE__ */
|
|
5303
|
-
/* @__PURE__ */
|
|
5304
|
-
/* @__PURE__ */
|
|
5241
|
+
/* @__PURE__ */ jsxs8("span", { className: "min-w-0 flex-1", children: [
|
|
5242
|
+
/* @__PURE__ */ jsx10("span", { className: "block truncate text-sm font-medium text-foreground", children: info.labelPlural }),
|
|
5243
|
+
/* @__PURE__ */ jsx10("span", { className: "block text-xs text-muted-foreground tabular-nums", children: loading ? /* @__PURE__ */ jsxs8("span", { className: "inline-flex items-center gap-1", children: [
|
|
5244
|
+
/* @__PURE__ */ jsx10(SpinnerIcon, { className: "h-3 w-3 animate-spin" }),
|
|
5305
5245
|
"Loading\u2026"
|
|
5306
5246
|
] }) : `${count} ${countWord}` })
|
|
5307
5247
|
] })
|
|
5308
5248
|
]
|
|
5309
5249
|
}
|
|
5310
5250
|
),
|
|
5311
|
-
canAttach && /* @__PURE__ */
|
|
5251
|
+
canAttach && /* @__PURE__ */ jsx10(
|
|
5312
5252
|
"button",
|
|
5313
5253
|
{
|
|
5314
5254
|
type: "button",
|
|
@@ -5316,13 +5256,13 @@ function AssociationCard({
|
|
|
5316
5256
|
"aria-label": `Attach ${info.labelPlural.toLowerCase()}`,
|
|
5317
5257
|
title: `Attach ${info.labelPlural.toLowerCase()}`,
|
|
5318
5258
|
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",
|
|
5319
|
-
children: /* @__PURE__ */
|
|
5259
|
+
children: /* @__PURE__ */ jsx10(PlusIcon4, { className: "h-4 w-4" })
|
|
5320
5260
|
}
|
|
5321
5261
|
)
|
|
5322
5262
|
]
|
|
5323
5263
|
}
|
|
5324
5264
|
),
|
|
5325
|
-
listOpen && /* @__PURE__ */
|
|
5265
|
+
listOpen && /* @__PURE__ */ jsx10(
|
|
5326
5266
|
AttachedItemsSheet,
|
|
5327
5267
|
{
|
|
5328
5268
|
open: listOpen,
|
|
@@ -5341,7 +5281,7 @@ function AssociationCard({
|
|
|
5341
5281
|
onSetPinned: (resourceId, pinned, role2) => setPinned(token, resourceId, pinned, role2 ?? void 0)
|
|
5342
5282
|
}
|
|
5343
5283
|
),
|
|
5344
|
-
canAttach && /* @__PURE__ */
|
|
5284
|
+
canAttach && /* @__PURE__ */ jsx10(
|
|
5345
5285
|
AssociationPicker,
|
|
5346
5286
|
{
|
|
5347
5287
|
open,
|
|
@@ -5360,7 +5300,7 @@ function AssociationCard({
|
|
|
5360
5300
|
|
|
5361
5301
|
// src/react/components/AssociationCardGrid.tsx
|
|
5362
5302
|
import { cn as cn8 } from "@ai-matrx/design-system";
|
|
5363
|
-
import { jsx as
|
|
5303
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
5364
5304
|
var SIMPLE_GROUP_LABEL = "mb-1 text-xs font-medium uppercase tracking-wider text-muted-foreground";
|
|
5365
5305
|
var SIMPLE_TILE_ROW = "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1";
|
|
5366
5306
|
var TILE_GRID = "grid grid-cols-1 gap-2 @md:grid-cols-2 @3xl:grid-cols-3";
|
|
@@ -5369,11 +5309,11 @@ function GroupHeader({
|
|
|
5369
5309
|
title,
|
|
5370
5310
|
dotClassName
|
|
5371
5311
|
}) {
|
|
5372
|
-
if (look !== "tiles") return /* @__PURE__ */
|
|
5373
|
-
return /* @__PURE__ */
|
|
5374
|
-
/* @__PURE__ */
|
|
5375
|
-
/* @__PURE__ */
|
|
5376
|
-
] }) : /* @__PURE__ */
|
|
5312
|
+
if (look !== "tiles") return /* @__PURE__ */ jsx11("h3", { className: SIMPLE_GROUP_LABEL, children: title });
|
|
5313
|
+
return /* @__PURE__ */ jsx11("div", { className: "mb-2.5 flex items-baseline gap-3 pl-1.5", children: dotClassName ? /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
|
|
5314
|
+
/* @__PURE__ */ jsx11("span", { className: cn8("h-2.5 w-2.5 rounded-full", dotClassName) }),
|
|
5315
|
+
/* @__PURE__ */ jsx11("h3", { className: "text-sm font-semibold text-foreground", children: title })
|
|
5316
|
+
] }) : /* @__PURE__ */ jsx11("h3", { className: "text-sm font-semibold text-foreground", children: title }) });
|
|
5377
5317
|
}
|
|
5378
5318
|
function AssociationCardGrid({
|
|
5379
5319
|
tokens,
|
|
@@ -5386,13 +5326,13 @@ function AssociationCardGrid({
|
|
|
5386
5326
|
const excluded = new Set(excludeTokens ?? []);
|
|
5387
5327
|
const filing = primary?.direction === "outgoing";
|
|
5388
5328
|
const links = useContainerLinks(containerLinksArgs(primary));
|
|
5389
|
-
const
|
|
5329
|
+
const base = tokens ?? store.registry.curatedTokens();
|
|
5390
5330
|
const withPresent = filing ? [
|
|
5391
|
-
...
|
|
5331
|
+
...base,
|
|
5392
5332
|
...links.presentTokens.filter(
|
|
5393
|
-
(t) => isEntityTypeToken(t) && !
|
|
5333
|
+
(t) => isEntityTypeToken(t) && !base.includes(t)
|
|
5394
5334
|
)
|
|
5395
|
-
] :
|
|
5335
|
+
] : base;
|
|
5396
5336
|
const list = withPresent.filter(
|
|
5397
5337
|
(token) => !excluded.has(token) && (!filing || isAssociationTargetType(token))
|
|
5398
5338
|
);
|
|
@@ -5402,7 +5342,7 @@ function AssociationCardGrid({
|
|
|
5402
5342
|
return !role || !roleIds.has(role);
|
|
5403
5343
|
}) : [];
|
|
5404
5344
|
const rowClass = look !== "tiles" ? SIMPLE_TILE_ROW : TILE_GRID;
|
|
5405
|
-
return /* @__PURE__ */
|
|
5345
|
+
return /* @__PURE__ */ jsxs9(
|
|
5406
5346
|
"div",
|
|
5407
5347
|
{
|
|
5408
5348
|
"data-association-grid-look": look,
|
|
@@ -5413,8 +5353,8 @@ function AssociationCardGrid({
|
|
|
5413
5353
|
(token) => store.registry.getEntityInfo(token).contentRole === role.id
|
|
5414
5354
|
);
|
|
5415
5355
|
if (inRole.length === 0) return null;
|
|
5416
|
-
return /* @__PURE__ */
|
|
5417
|
-
/* @__PURE__ */
|
|
5356
|
+
return /* @__PURE__ */ jsxs9("section", { children: [
|
|
5357
|
+
/* @__PURE__ */ jsx11(
|
|
5418
5358
|
GroupHeader,
|
|
5419
5359
|
{
|
|
5420
5360
|
look,
|
|
@@ -5422,18 +5362,18 @@ function AssociationCardGrid({
|
|
|
5422
5362
|
dotClassName: role.accentBar
|
|
5423
5363
|
}
|
|
5424
5364
|
),
|
|
5425
|
-
/* @__PURE__ */
|
|
5365
|
+
/* @__PURE__ */ jsx11("div", { className: rowClass, children: inRole.map((token) => /* @__PURE__ */ jsx11(AssociationCard, { token, look }, token)) })
|
|
5426
5366
|
] }, role.id);
|
|
5427
5367
|
}),
|
|
5428
|
-
roleless.length > 0 && /* @__PURE__ */
|
|
5429
|
-
/* @__PURE__ */
|
|
5368
|
+
roleless.length > 0 && /* @__PURE__ */ jsxs9("section", { children: [
|
|
5369
|
+
/* @__PURE__ */ jsx11(
|
|
5430
5370
|
GroupHeader,
|
|
5431
5371
|
{
|
|
5432
5372
|
look,
|
|
5433
5373
|
title: "Filed under"
|
|
5434
5374
|
}
|
|
5435
5375
|
),
|
|
5436
|
-
/* @__PURE__ */
|
|
5376
|
+
/* @__PURE__ */ jsx11("div", { className: rowClass, children: roleless.map((token) => /* @__PURE__ */ jsx11(AssociationCard, { token, look }, token)) })
|
|
5437
5377
|
] })
|
|
5438
5378
|
]
|
|
5439
5379
|
}
|
|
@@ -5445,7 +5385,7 @@ import { useState as useState10 } from "react";
|
|
|
5445
5385
|
import { cn as cn9, Skeleton } from "@ai-matrx/design-system";
|
|
5446
5386
|
import { PinIcon as PinIcon2, PlusIcon as PlusIcon5, XIcon as XIcon4 } from "@ai-matrx/design-system/icons";
|
|
5447
5387
|
import { openOutbound } from "@ai-matrx/kit/outbound";
|
|
5448
|
-
import { jsx as
|
|
5388
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
5449
5389
|
function metadataIsPinned2(metadata) {
|
|
5450
5390
|
return metadata !== null && typeof metadata === "object" && !Array.isArray(metadata) && Reflect.get(metadata, "pinned") === true;
|
|
5451
5391
|
}
|
|
@@ -5556,15 +5496,15 @@ function AssociationList(props) {
|
|
|
5556
5496
|
const grouped = groupRows(store, visibleRows);
|
|
5557
5497
|
const isLoading = adapter.status === "loading" || adapter.status === "idle";
|
|
5558
5498
|
const attachableTokens = tokenFilter ?? store.registry.listableTokens();
|
|
5559
|
-
return /* @__PURE__ */
|
|
5560
|
-
/* @__PURE__ */
|
|
5561
|
-
props.title === null ? null : /* @__PURE__ */
|
|
5562
|
-
/* @__PURE__ */
|
|
5499
|
+
return /* @__PURE__ */ jsxs10("div", { className: cn9("flex flex-col gap-2 text-foreground", props.className), children: [
|
|
5500
|
+
/* @__PURE__ */ jsxs10("div", { className: cn9("flex items-center gap-2 px-1", props.title === null ? "justify-end" : "justify-between"), children: [
|
|
5501
|
+
props.title === null ? null : /* @__PURE__ */ jsxs10("h3", { className: "flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: [
|
|
5502
|
+
/* @__PURE__ */ jsx12(Link2Icon, { className: "h-3.5 w-3.5" }),
|
|
5563
5503
|
props.title ?? "Resources",
|
|
5564
|
-
visibleRows.length > 0 && /* @__PURE__ */
|
|
5504
|
+
visibleRows.length > 0 && /* @__PURE__ */ jsx12("span", { className: "rounded bg-muted px-1 text-[10px] font-medium text-muted-foreground", children: visibleRows.length })
|
|
5565
5505
|
] }),
|
|
5566
|
-
/* @__PURE__ */
|
|
5567
|
-
/* @__PURE__ */
|
|
5506
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1.5", children: [
|
|
5507
|
+
/* @__PURE__ */ jsxs10(
|
|
5568
5508
|
"button",
|
|
5569
5509
|
{
|
|
5570
5510
|
type: "button",
|
|
@@ -5574,19 +5514,19 @@ function AssociationList(props) {
|
|
|
5574
5514
|
showUniversal ? "bg-accent text-foreground" : "text-muted-foreground hover:bg-accent hover:text-foreground"
|
|
5575
5515
|
),
|
|
5576
5516
|
children: [
|
|
5577
|
-
/* @__PURE__ */
|
|
5517
|
+
/* @__PURE__ */ jsx12(PlusIcon5, { className: "h-3 w-3" }),
|
|
5578
5518
|
"Add"
|
|
5579
5519
|
]
|
|
5580
5520
|
}
|
|
5581
5521
|
),
|
|
5582
|
-
/* @__PURE__ */
|
|
5522
|
+
/* @__PURE__ */ jsx12(
|
|
5583
5523
|
"button",
|
|
5584
5524
|
{
|
|
5585
5525
|
type: "button",
|
|
5586
5526
|
onClick: () => void adapter.reload(),
|
|
5587
5527
|
title: "Refresh",
|
|
5588
5528
|
className: "text-muted-foreground/60 transition-colors hover:text-foreground",
|
|
5589
|
-
children: /* @__PURE__ */
|
|
5529
|
+
children: /* @__PURE__ */ jsx12(
|
|
5590
5530
|
RefreshIcon,
|
|
5591
5531
|
{
|
|
5592
5532
|
className: cn9(
|
|
@@ -5599,7 +5539,7 @@ function AssociationList(props) {
|
|
|
5599
5539
|
)
|
|
5600
5540
|
] })
|
|
5601
5541
|
] }),
|
|
5602
|
-
showUniversal && /* @__PURE__ */
|
|
5542
|
+
showUniversal && /* @__PURE__ */ jsx12("div", { className: "rounded-md border border-border/60 bg-muted/30 p-2 max-h-80 flex flex-col", children: /* @__PURE__ */ jsx12(
|
|
5603
5543
|
UniversalAssociationPicker,
|
|
5604
5544
|
{
|
|
5605
5545
|
tokens: attachableTokens,
|
|
@@ -5609,9 +5549,9 @@ function AssociationList(props) {
|
|
|
5609
5549
|
onDetach: (token, id) => adapter.detach(token, id)
|
|
5610
5550
|
}
|
|
5611
5551
|
) }),
|
|
5612
|
-
adapter.status === "error" && /* @__PURE__ */
|
|
5613
|
-
/* @__PURE__ */
|
|
5614
|
-
/* @__PURE__ */
|
|
5552
|
+
adapter.status === "error" && /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-2.5 py-2", children: [
|
|
5553
|
+
/* @__PURE__ */ jsx12("span", { className: "truncate text-[11px] text-destructive", children: adapter.error || "Failed to load resources" }),
|
|
5554
|
+
/* @__PURE__ */ jsx12(
|
|
5615
5555
|
"button",
|
|
5616
5556
|
{
|
|
5617
5557
|
type: "button",
|
|
@@ -5621,17 +5561,17 @@ function AssociationList(props) {
|
|
|
5621
5561
|
}
|
|
5622
5562
|
)
|
|
5623
5563
|
] }),
|
|
5624
|
-
adapter.status !== "error" && isLoading && visibleRows.length === 0 && /* @__PURE__ */
|
|
5625
|
-
/* @__PURE__ */
|
|
5626
|
-
/* @__PURE__ */
|
|
5627
|
-
/* @__PURE__ */
|
|
5564
|
+
adapter.status !== "error" && isLoading && visibleRows.length === 0 && /* @__PURE__ */ jsxs10("div", { className: "space-y-1.5 px-1", children: [
|
|
5565
|
+
/* @__PURE__ */ jsx12(Skeleton, { className: "h-3 w-20" }),
|
|
5566
|
+
/* @__PURE__ */ jsx12(Skeleton, { className: "h-7 w-full rounded-md" }),
|
|
5567
|
+
/* @__PURE__ */ jsx12(Skeleton, { className: "h-7 w-3/4 rounded-md" })
|
|
5628
5568
|
] }),
|
|
5629
|
-
adapter.status === "ready" && visibleRows.length === 0 && /* @__PURE__ */
|
|
5630
|
-
visibleRows.length > 0 && /* @__PURE__ */
|
|
5569
|
+
adapter.status === "ready" && visibleRows.length === 0 && /* @__PURE__ */ jsx12("p", { className: "px-1 py-1 text-[11px] text-muted-foreground", children: "Nothing attached yet \u2014 use Add to link anything." }),
|
|
5570
|
+
visibleRows.length > 0 && /* @__PURE__ */ jsx12("div", { className: "space-y-2.5", children: grouped.map(({ role, tokens: tokenGroups }) => {
|
|
5631
5571
|
const roleMeta = getContentRoleMeta(role);
|
|
5632
|
-
return /* @__PURE__ */
|
|
5633
|
-
variant === "full" && /* @__PURE__ */
|
|
5634
|
-
/* @__PURE__ */
|
|
5572
|
+
return /* @__PURE__ */ jsxs10("div", { className: "space-y-1.5", children: [
|
|
5573
|
+
variant === "full" && /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1.5 px-1", children: [
|
|
5574
|
+
/* @__PURE__ */ jsx12(
|
|
5635
5575
|
"span",
|
|
5636
5576
|
{
|
|
5637
5577
|
className: cn9(
|
|
@@ -5640,7 +5580,7 @@ function AssociationList(props) {
|
|
|
5640
5580
|
)
|
|
5641
5581
|
}
|
|
5642
5582
|
),
|
|
5643
|
-
/* @__PURE__ */
|
|
5583
|
+
/* @__PURE__ */ jsx12(
|
|
5644
5584
|
"p",
|
|
5645
5585
|
{
|
|
5646
5586
|
className: cn9(
|
|
@@ -5653,28 +5593,28 @@ function AssociationList(props) {
|
|
|
5653
5593
|
] }),
|
|
5654
5594
|
tokenGroups.map(({ info, token, rows: tokenRows }) => {
|
|
5655
5595
|
const TokenIcon = info?.Icon ?? null;
|
|
5656
|
-
return /* @__PURE__ */
|
|
5657
|
-
/* @__PURE__ */
|
|
5658
|
-
/* @__PURE__ */
|
|
5659
|
-
TokenIcon ? /* @__PURE__ */
|
|
5596
|
+
return /* @__PURE__ */ jsxs10("div", { className: "space-y-0.5", children: [
|
|
5597
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between gap-1 px-1", children: [
|
|
5598
|
+
/* @__PURE__ */ jsxs10("p", { className: "flex items-center gap-1 text-[10px] font-medium text-muted-foreground/80", children: [
|
|
5599
|
+
TokenIcon ? /* @__PURE__ */ jsx12(TokenIcon, { className: "h-3 w-3" }) : null,
|
|
5660
5600
|
info?.labelPlural ?? titleize(token),
|
|
5661
|
-
/* @__PURE__ */
|
|
5601
|
+
/* @__PURE__ */ jsx12("span", { className: "text-muted-foreground/50", children: tokenRows.length })
|
|
5662
5602
|
] }),
|
|
5663
|
-
/* @__PURE__ */
|
|
5603
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1", children: [
|
|
5664
5604
|
props.renderSectionActions && info ? props.renderSectionActions(info.token) : null,
|
|
5665
|
-
info?.canListCandidates && /* @__PURE__ */
|
|
5605
|
+
info?.canListCandidates && /* @__PURE__ */ jsx12(
|
|
5666
5606
|
"button",
|
|
5667
5607
|
{
|
|
5668
5608
|
type: "button",
|
|
5669
5609
|
onClick: () => setPickerToken(info.token),
|
|
5670
5610
|
title: `Add ${info.labelPlural}`,
|
|
5671
5611
|
className: "rounded p-0.5 text-muted-foreground/60 transition-colors hover:bg-accent hover:text-foreground",
|
|
5672
|
-
children: /* @__PURE__ */
|
|
5612
|
+
children: /* @__PURE__ */ jsx12(PlusIcon5, { className: "h-3 w-3" })
|
|
5673
5613
|
}
|
|
5674
5614
|
)
|
|
5675
5615
|
] })
|
|
5676
5616
|
] }),
|
|
5677
|
-
/* @__PURE__ */
|
|
5617
|
+
/* @__PURE__ */ jsx12("ul", { className: "space-y-0.5", children: tokenRows.map((row) => {
|
|
5678
5618
|
const busy = removingKeys.has(row.key);
|
|
5679
5619
|
const custom = props.renderRow?.(row, {
|
|
5680
5620
|
title: titleFor({
|
|
@@ -5687,9 +5627,9 @@ function AssociationList(props) {
|
|
|
5687
5627
|
onOpen: () => openRow(row)
|
|
5688
5628
|
});
|
|
5689
5629
|
if (custom != null) {
|
|
5690
|
-
return /* @__PURE__ */
|
|
5630
|
+
return /* @__PURE__ */ jsx12("li", { children: custom }, row.key);
|
|
5691
5631
|
}
|
|
5692
|
-
return /* @__PURE__ */
|
|
5632
|
+
return /* @__PURE__ */ jsx12("li", { children: /* @__PURE__ */ jsxs10(
|
|
5693
5633
|
"div",
|
|
5694
5634
|
{
|
|
5695
5635
|
className: cn9(
|
|
@@ -5701,7 +5641,7 @@ function AssociationList(props) {
|
|
|
5701
5641
|
token: row.token,
|
|
5702
5642
|
id: row.resourceId,
|
|
5703
5643
|
label: row.label
|
|
5704
|
-
}) ? /* @__PURE__ */
|
|
5644
|
+
}) ? /* @__PURE__ */ jsx12("span", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx12(UnresolvedRef, { token: row.token, id: row.resourceId }) }) : /* @__PURE__ */ jsx12(
|
|
5705
5645
|
DoorRef,
|
|
5706
5646
|
{
|
|
5707
5647
|
token: row.token,
|
|
@@ -5717,9 +5657,9 @@ function AssociationList(props) {
|
|
|
5717
5657
|
className: "min-w-0 flex-1 text-foreground"
|
|
5718
5658
|
}
|
|
5719
5659
|
),
|
|
5720
|
-
row.originRefs && row.originRefs.length > 0 ? /* @__PURE__ */
|
|
5660
|
+
row.originRefs && row.originRefs.length > 0 ? /* @__PURE__ */ jsxs10("span", { className: "flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground/60", children: [
|
|
5721
5661
|
"via",
|
|
5722
|
-
row.originRefs.map((origin) => /* @__PURE__ */
|
|
5662
|
+
row.originRefs.map((origin) => /* @__PURE__ */ jsx12(
|
|
5723
5663
|
DoorRef,
|
|
5724
5664
|
{
|
|
5725
5665
|
token: origin.token,
|
|
@@ -5731,8 +5671,8 @@ function AssociationList(props) {
|
|
|
5731
5671
|
},
|
|
5732
5672
|
`${origin.token}:${origin.id}`
|
|
5733
5673
|
))
|
|
5734
|
-
] }) : row.originNote ? /* @__PURE__ */
|
|
5735
|
-
adapter.setPinned && info && row.removable && /* @__PURE__ */
|
|
5674
|
+
] }) : row.originNote ? /* @__PURE__ */ jsx12("span", { className: "shrink-0 text-[10px] text-muted-foreground/60", children: row.originNote }) : null,
|
|
5675
|
+
adapter.setPinned && info && row.removable && /* @__PURE__ */ jsx12(
|
|
5736
5676
|
"button",
|
|
5737
5677
|
{
|
|
5738
5678
|
type: "button",
|
|
@@ -5744,7 +5684,7 @@ function AssociationList(props) {
|
|
|
5744
5684
|
"shrink-0 rounded p-0.5 transition-colors hover:!text-foreground",
|
|
5745
5685
|
row.pinned ? "text-primary" : "text-muted-foreground/0 group-hover:text-muted-foreground"
|
|
5746
5686
|
),
|
|
5747
|
-
children: pinningKeys.has(row.key) ? /* @__PURE__ */
|
|
5687
|
+
children: pinningKeys.has(row.key) ? /* @__PURE__ */ jsx12(SpinnerIcon, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ jsx12(
|
|
5748
5688
|
PinIcon2,
|
|
5749
5689
|
{
|
|
5750
5690
|
className: cn9(
|
|
@@ -5755,7 +5695,7 @@ function AssociationList(props) {
|
|
|
5755
5695
|
)
|
|
5756
5696
|
}
|
|
5757
5697
|
),
|
|
5758
|
-
row.removable && /* @__PURE__ */
|
|
5698
|
+
row.removable && /* @__PURE__ */ jsx12(
|
|
5759
5699
|
"button",
|
|
5760
5700
|
{
|
|
5761
5701
|
type: "button",
|
|
@@ -5764,7 +5704,7 @@ function AssociationList(props) {
|
|
|
5764
5704
|
title: "Detach",
|
|
5765
5705
|
"aria-label": "Detach",
|
|
5766
5706
|
className: "shrink-0 rounded p-0.5 text-muted-foreground/0 transition-colors group-hover:text-muted-foreground hover:!text-destructive disabled:opacity-50",
|
|
5767
|
-
children: busy ? /* @__PURE__ */
|
|
5707
|
+
children: busy ? /* @__PURE__ */ jsx12(SpinnerIcon, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ jsx12(XIcon4, { className: "h-3 w-3" })
|
|
5768
5708
|
}
|
|
5769
5709
|
)
|
|
5770
5710
|
]
|
|
@@ -5775,7 +5715,7 @@ function AssociationList(props) {
|
|
|
5775
5715
|
})
|
|
5776
5716
|
] }, role);
|
|
5777
5717
|
}) }),
|
|
5778
|
-
pickerToken && /* @__PURE__ */
|
|
5718
|
+
pickerToken && /* @__PURE__ */ jsx12(
|
|
5779
5719
|
AssociationPicker,
|
|
5780
5720
|
{
|
|
5781
5721
|
open: true,
|
|
@@ -5835,7 +5775,7 @@ import { useRef as useRef8, useState as useState11 } from "react";
|
|
|
5835
5775
|
import { Button as Button2, cn as cn10, Input as Input3 } from "@ai-matrx/design-system";
|
|
5836
5776
|
import { PlusIcon as PlusIcon6 } from "@ai-matrx/design-system/icons";
|
|
5837
5777
|
import { openOutbound as openOutbound2 } from "@ai-matrx/kit/outbound";
|
|
5838
|
-
import { Fragment as Fragment4, jsx as
|
|
5778
|
+
import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
5839
5779
|
function AssociationCaptureToolbar({
|
|
5840
5780
|
attach,
|
|
5841
5781
|
uploadFolderPath,
|
|
@@ -6068,7 +6008,7 @@ function AssociationCaptureToolbar({
|
|
|
6068
6008
|
}
|
|
6069
6009
|
};
|
|
6070
6010
|
const anyBuiltIn = actions.upload || actions.addFile || actions.newDocument;
|
|
6071
|
-
return /* @__PURE__ */
|
|
6011
|
+
return /* @__PURE__ */ jsxs11(
|
|
6072
6012
|
"div",
|
|
6073
6013
|
{
|
|
6074
6014
|
className: cn10(
|
|
@@ -6089,11 +6029,11 @@ function AssociationCaptureToolbar({
|
|
|
6089
6029
|
},
|
|
6090
6030
|
onDrop: handleDrop,
|
|
6091
6031
|
children: [
|
|
6092
|
-
isDragOver ? /* @__PURE__ */
|
|
6093
|
-
/* @__PURE__ */
|
|
6032
|
+
isDragOver ? /* @__PURE__ */ jsx13("div", { className: "pointer-events-none absolute inset-0 z-10 grid place-items-center bg-background/70", children: /* @__PURE__ */ jsxs11("span", { className: "flex items-center gap-2 rounded-md border border-primary/40 bg-card px-3 py-1.5 text-xs font-medium text-foreground", children: [
|
|
6033
|
+
/* @__PURE__ */ jsx13(UploadIcon, { className: "size-3.5 text-primary" }),
|
|
6094
6034
|
"Drop to upload & attach"
|
|
6095
6035
|
] }) }) : null,
|
|
6096
|
-
/* @__PURE__ */
|
|
6036
|
+
/* @__PURE__ */ jsx13(
|
|
6097
6037
|
"input",
|
|
6098
6038
|
{
|
|
6099
6039
|
ref: fileInputRef,
|
|
@@ -6103,8 +6043,8 @@ function AssociationCaptureToolbar({
|
|
|
6103
6043
|
onChange: handleFilesSelected
|
|
6104
6044
|
}
|
|
6105
6045
|
),
|
|
6106
|
-
showToolbar && (anyBuiltIn || extraActions) ? /* @__PURE__ */
|
|
6107
|
-
/* @__PURE__ */
|
|
6046
|
+
showToolbar && (anyBuiltIn || extraActions) ? /* @__PURE__ */ jsx13("div", { className: "flex flex-wrap items-center gap-0.5 border-b border-border/60 px-1.5 py-1", children: namingDoc ? /* @__PURE__ */ jsxs11("div", { className: "flex flex-1 items-center gap-1.5 py-0.5", children: [
|
|
6047
|
+
/* @__PURE__ */ jsx13(
|
|
6108
6048
|
Input3,
|
|
6109
6049
|
{
|
|
6110
6050
|
autoFocus: true,
|
|
@@ -6123,17 +6063,17 @@ function AssociationCaptureToolbar({
|
|
|
6123
6063
|
style: { fontSize: 16 }
|
|
6124
6064
|
}
|
|
6125
6065
|
),
|
|
6126
|
-
/* @__PURE__ */
|
|
6066
|
+
/* @__PURE__ */ jsx13(
|
|
6127
6067
|
"button",
|
|
6128
6068
|
{
|
|
6129
6069
|
type: "button",
|
|
6130
6070
|
disabled: creatingDoc || !docName.trim(),
|
|
6131
6071
|
onClick: () => void handleCreateDoc(),
|
|
6132
6072
|
className: "flex h-7 items-center rounded-md bg-primary px-2 text-[11px] font-medium text-primary-foreground disabled:opacity-50",
|
|
6133
|
-
children: creatingDoc ? /* @__PURE__ */
|
|
6073
|
+
children: creatingDoc ? /* @__PURE__ */ jsx13(SpinnerIcon, { className: "size-3.5 animate-spin" }) : "Create"
|
|
6134
6074
|
}
|
|
6135
6075
|
),
|
|
6136
|
-
/* @__PURE__ */
|
|
6076
|
+
/* @__PURE__ */ jsx13(
|
|
6137
6077
|
"button",
|
|
6138
6078
|
{
|
|
6139
6079
|
type: "button",
|
|
@@ -6146,8 +6086,8 @@ function AssociationCaptureToolbar({
|
|
|
6146
6086
|
children: "Cancel"
|
|
6147
6087
|
}
|
|
6148
6088
|
)
|
|
6149
|
-
] }) : /* @__PURE__ */
|
|
6150
|
-
actions.upload ? /* @__PURE__ */
|
|
6089
|
+
] }) : /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
6090
|
+
actions.upload ? /* @__PURE__ */ jsx13(
|
|
6151
6091
|
CaptureToolbarAction,
|
|
6152
6092
|
{
|
|
6153
6093
|
icon: isUploading ? SpinnerIcon : UploadIcon,
|
|
@@ -6157,7 +6097,7 @@ function AssociationCaptureToolbar({
|
|
|
6157
6097
|
disabled: isPicking || isUploading
|
|
6158
6098
|
}
|
|
6159
6099
|
) : null,
|
|
6160
|
-
actions.addFile ? /* @__PURE__ */
|
|
6100
|
+
actions.addFile ? /* @__PURE__ */ jsx13(
|
|
6161
6101
|
CaptureToolbarAction,
|
|
6162
6102
|
{
|
|
6163
6103
|
icon: isPicking ? SpinnerIcon : FolderOpenIcon,
|
|
@@ -6167,8 +6107,8 @@ function AssociationCaptureToolbar({
|
|
|
6167
6107
|
disabled: isPicking || isUploading
|
|
6168
6108
|
}
|
|
6169
6109
|
) : null,
|
|
6170
|
-
(actions.upload || actions.addFile) && actions.newDocument ? /* @__PURE__ */
|
|
6171
|
-
actions.newDocument ? /* @__PURE__ */
|
|
6110
|
+
(actions.upload || actions.addFile) && actions.newDocument ? /* @__PURE__ */ jsx13("span", { className: "mx-1 h-4 w-px bg-border" }) : null,
|
|
6111
|
+
actions.newDocument ? /* @__PURE__ */ jsx13(
|
|
6172
6112
|
CaptureToolbarAction,
|
|
6173
6113
|
{
|
|
6174
6114
|
icon: creatingDoc ? SpinnerIcon : PlusIcon6,
|
|
@@ -6192,7 +6132,7 @@ function CaptureToolbarAction({
|
|
|
6192
6132
|
disabled,
|
|
6193
6133
|
spinning
|
|
6194
6134
|
}) {
|
|
6195
|
-
return /* @__PURE__ */
|
|
6135
|
+
return /* @__PURE__ */ jsxs11(
|
|
6196
6136
|
Button2,
|
|
6197
6137
|
{
|
|
6198
6138
|
type: "button",
|
|
@@ -6202,7 +6142,7 @@ function CaptureToolbarAction({
|
|
|
6202
6142
|
disabled,
|
|
6203
6143
|
className: "h-7 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground",
|
|
6204
6144
|
children: [
|
|
6205
|
-
/* @__PURE__ */
|
|
6145
|
+
/* @__PURE__ */ jsx13(Icon, { className: cn10("size-3.5", spinning && "animate-spin") }),
|
|
6206
6146
|
label
|
|
6207
6147
|
]
|
|
6208
6148
|
}
|
|
@@ -6211,7 +6151,7 @@ function CaptureToolbarAction({
|
|
|
6211
6151
|
|
|
6212
6152
|
// src/react/lazyPorts.tsx
|
|
6213
6153
|
import { Suspense, lazy } from "react";
|
|
6214
|
-
import { jsx as
|
|
6154
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
6215
6155
|
function lazyComponent(load) {
|
|
6216
6156
|
return lazy(async () => {
|
|
6217
6157
|
const loaded = await load();
|
|
@@ -6221,14 +6161,14 @@ function lazyComponent(load) {
|
|
|
6221
6161
|
function lazyWindowShell(load) {
|
|
6222
6162
|
const Loaded = lazyComponent(load);
|
|
6223
6163
|
return function LazyWindowShell(props) {
|
|
6224
|
-
return /* @__PURE__ */
|
|
6164
|
+
return /* @__PURE__ */ jsx14(Suspense, { fallback: null, children: /* @__PURE__ */ jsx14(Loaded, { ...props }) });
|
|
6225
6165
|
};
|
|
6226
6166
|
}
|
|
6227
6167
|
function lazyPickerOverride(load) {
|
|
6228
6168
|
const Loaded = lazyComponent(load);
|
|
6229
6169
|
return function LazyPickerOverride(props) {
|
|
6230
6170
|
if (!props.open) return null;
|
|
6231
|
-
return /* @__PURE__ */
|
|
6171
|
+
return /* @__PURE__ */ jsx14(Suspense, { fallback: null, children: /* @__PURE__ */ jsx14(Loaded, { ...props }) });
|
|
6232
6172
|
};
|
|
6233
6173
|
}
|
|
6234
6174
|
|
|
@@ -6355,7 +6295,7 @@ import {
|
|
|
6355
6295
|
PopoverTrigger
|
|
6356
6296
|
} from "@ai-matrx/design-system";
|
|
6357
6297
|
import { CheckIcon as CheckIcon3, ChevronDownIcon, PlusIcon as PlusIcon7, XIcon as XIcon5 } from "@ai-matrx/design-system/icons";
|
|
6358
|
-
import { jsx as
|
|
6298
|
+
import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
6359
6299
|
function AssociationEntitySelect({
|
|
6360
6300
|
token,
|
|
6361
6301
|
adapter,
|
|
@@ -6396,7 +6336,7 @@ function AssociationEntitySelect({
|
|
|
6396
6336
|
if (id) close();
|
|
6397
6337
|
else notifier.error(`Couldn't create the ${entityLabel}`);
|
|
6398
6338
|
};
|
|
6399
|
-
return /* @__PURE__ */
|
|
6339
|
+
return /* @__PURE__ */ jsxs12(
|
|
6400
6340
|
"div",
|
|
6401
6341
|
{
|
|
6402
6342
|
className: cn11(
|
|
@@ -6404,7 +6344,7 @@ function AssociationEntitySelect({
|
|
|
6404
6344
|
className
|
|
6405
6345
|
),
|
|
6406
6346
|
children: [
|
|
6407
|
-
showIcon ? /* @__PURE__ */
|
|
6347
|
+
showIcon ? /* @__PURE__ */ jsx15(
|
|
6408
6348
|
InfoIcon,
|
|
6409
6349
|
{
|
|
6410
6350
|
className: cn11(
|
|
@@ -6414,7 +6354,7 @@ function AssociationEntitySelect({
|
|
|
6414
6354
|
"aria-hidden": true
|
|
6415
6355
|
}
|
|
6416
6356
|
) : null,
|
|
6417
|
-
active ? /* @__PURE__ */
|
|
6357
|
+
active ? /* @__PURE__ */ jsx15(
|
|
6418
6358
|
EditableLabel,
|
|
6419
6359
|
{
|
|
6420
6360
|
value: active.title,
|
|
@@ -6433,8 +6373,8 @@ function AssociationEntitySelect({
|
|
|
6433
6373
|
inputClassName: "text-xs font-medium"
|
|
6434
6374
|
}
|
|
6435
6375
|
) : null,
|
|
6436
|
-
active ? /* @__PURE__ */
|
|
6437
|
-
!active ? /* @__PURE__ */
|
|
6376
|
+
active ? /* @__PURE__ */ jsx15(DoorControlsSlot, { token, id: active.id, name: active.title }) : null,
|
|
6377
|
+
!active ? /* @__PURE__ */ jsx15(
|
|
6438
6378
|
"span",
|
|
6439
6379
|
{
|
|
6440
6380
|
className: cn11(
|
|
@@ -6444,13 +6384,13 @@ function AssociationEntitySelect({
|
|
|
6444
6384
|
children: adapter.loading ? "\u2026" : emptyLabel ?? info.labelPlural
|
|
6445
6385
|
}
|
|
6446
6386
|
) : null,
|
|
6447
|
-
/* @__PURE__ */
|
|
6387
|
+
/* @__PURE__ */ jsxs12(
|
|
6448
6388
|
Popover,
|
|
6449
6389
|
{
|
|
6450
6390
|
open,
|
|
6451
6391
|
onOpenChange: (next) => next ? setOpen(true) : close(),
|
|
6452
6392
|
children: [
|
|
6453
|
-
/* @__PURE__ */
|
|
6393
|
+
/* @__PURE__ */ jsx15(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs12(
|
|
6454
6394
|
"button",
|
|
6455
6395
|
{
|
|
6456
6396
|
type: "button",
|
|
@@ -6458,17 +6398,17 @@ function AssociationEntitySelect({
|
|
|
6458
6398
|
title: `Switch or add ${info.labelPlural.toLowerCase()}`,
|
|
6459
6399
|
"aria-label": `Switch or add ${info.labelPlural.toLowerCase()}`,
|
|
6460
6400
|
children: [
|
|
6461
|
-
items.length > 1 ? /* @__PURE__ */
|
|
6401
|
+
items.length > 1 ? /* @__PURE__ */ jsxs12("span", { className: "tabular-nums", children: [
|
|
6462
6402
|
activeIndex >= 0 ? activeIndex + 1 : "\u2014",
|
|
6463
6403
|
"/",
|
|
6464
6404
|
items.length
|
|
6465
6405
|
] }) : null,
|
|
6466
|
-
/* @__PURE__ */
|
|
6406
|
+
/* @__PURE__ */ jsx15(ChevronDownIcon, { className: "size-3 opacity-60" })
|
|
6467
6407
|
]
|
|
6468
6408
|
}
|
|
6469
6409
|
) }),
|
|
6470
|
-
/* @__PURE__ */
|
|
6471
|
-
items.length > 5 ? /* @__PURE__ */
|
|
6410
|
+
/* @__PURE__ */ jsx15(PopoverContent, { sizing: "content", className: "p-0", align, children: /* @__PURE__ */ jsxs12(Command, { children: [
|
|
6411
|
+
items.length > 5 ? /* @__PURE__ */ jsx15(
|
|
6472
6412
|
CommandInput,
|
|
6473
6413
|
{
|
|
6474
6414
|
value: query,
|
|
@@ -6476,9 +6416,9 @@ function AssociationEntitySelect({
|
|
|
6476
6416
|
placeholder: `Search ${info.labelPlural.toLowerCase()}\u2026`
|
|
6477
6417
|
}
|
|
6478
6418
|
) : null,
|
|
6479
|
-
/* @__PURE__ */
|
|
6480
|
-
/* @__PURE__ */
|
|
6481
|
-
items.length > 0 ? /* @__PURE__ */
|
|
6419
|
+
/* @__PURE__ */ jsxs12(CommandList, { children: [
|
|
6420
|
+
/* @__PURE__ */ jsx15(CommandEmpty, { children: "No match." }),
|
|
6421
|
+
items.length > 0 ? /* @__PURE__ */ jsx15(CommandGroup, { children: items.map((item) => /* @__PURE__ */ jsxs12(
|
|
6482
6422
|
CommandItem,
|
|
6483
6423
|
{
|
|
6484
6424
|
value: `${item.title} ${item.id}`,
|
|
@@ -6489,7 +6429,7 @@ function AssociationEntitySelect({
|
|
|
6489
6429
|
},
|
|
6490
6430
|
className: "group/entity-ref group gap-2",
|
|
6491
6431
|
children: [
|
|
6492
|
-
/* @__PURE__ */
|
|
6432
|
+
/* @__PURE__ */ jsx15(
|
|
6493
6433
|
CheckIcon3,
|
|
6494
6434
|
{
|
|
6495
6435
|
className: cn11(
|
|
@@ -6498,8 +6438,8 @@ function AssociationEntitySelect({
|
|
|
6498
6438
|
)
|
|
6499
6439
|
}
|
|
6500
6440
|
),
|
|
6501
|
-
/* @__PURE__ */
|
|
6502
|
-
/* @__PURE__ */
|
|
6441
|
+
/* @__PURE__ */ jsx15("span", { className: "min-w-0 flex-1 truncate", children: item.title }),
|
|
6442
|
+
/* @__PURE__ */ jsx15(
|
|
6503
6443
|
"span",
|
|
6504
6444
|
{
|
|
6505
6445
|
className: "inline-flex shrink-0 items-center",
|
|
@@ -6507,7 +6447,7 @@ function AssociationEntitySelect({
|
|
|
6507
6447
|
e.preventDefault();
|
|
6508
6448
|
e.stopPropagation();
|
|
6509
6449
|
},
|
|
6510
|
-
children: /* @__PURE__ */
|
|
6450
|
+
children: /* @__PURE__ */ jsx15(
|
|
6511
6451
|
DoorControlsSlot,
|
|
6512
6452
|
{
|
|
6513
6453
|
token,
|
|
@@ -6517,7 +6457,7 @@ function AssociationEntitySelect({
|
|
|
6517
6457
|
)
|
|
6518
6458
|
}
|
|
6519
6459
|
),
|
|
6520
|
-
adapter.detach && item.id !== activeId ? /* @__PURE__ */
|
|
6460
|
+
adapter.detach && item.id !== activeId ? /* @__PURE__ */ jsx15(
|
|
6521
6461
|
"button",
|
|
6522
6462
|
{
|
|
6523
6463
|
type: "button",
|
|
@@ -6532,7 +6472,7 @@ function AssociationEntitySelect({
|
|
|
6532
6472
|
className: "grid size-5 shrink-0 place-items-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-destructive group-hover:opacity-100",
|
|
6533
6473
|
title: `Remove this ${entityLabel} from here (does not delete it)`,
|
|
6534
6474
|
"aria-label": `Remove ${item.title}`,
|
|
6535
|
-
children: /* @__PURE__ */
|
|
6475
|
+
children: /* @__PURE__ */ jsx15(XIcon5, { className: "size-3" })
|
|
6536
6476
|
}
|
|
6537
6477
|
) : null
|
|
6538
6478
|
]
|
|
@@ -6540,9 +6480,9 @@ function AssociationEntitySelect({
|
|
|
6540
6480
|
item.id
|
|
6541
6481
|
)) }) : null
|
|
6542
6482
|
] }),
|
|
6543
|
-
createSlot !== void 0 ? /* @__PURE__ */
|
|
6544
|
-
createSlot === void 0 && adapter.createAndAttach ? /* @__PURE__ */
|
|
6545
|
-
/* @__PURE__ */
|
|
6483
|
+
createSlot !== void 0 ? /* @__PURE__ */ jsx15("div", { className: "border-t border-border p-1", children: typeof createSlot === "function" ? createSlot(close) : createSlot }) : null,
|
|
6484
|
+
createSlot === void 0 && adapter.createAndAttach ? /* @__PURE__ */ jsx15("div", { className: "border-t border-border p-1", children: creating ? /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1 px-1 py-0.5", children: [
|
|
6485
|
+
/* @__PURE__ */ jsx15(
|
|
6546
6486
|
"input",
|
|
6547
6487
|
{
|
|
6548
6488
|
autoFocus: true,
|
|
@@ -6566,17 +6506,17 @@ function AssociationEntitySelect({
|
|
|
6566
6506
|
"aria-label": `New ${entityLabel} name`
|
|
6567
6507
|
}
|
|
6568
6508
|
),
|
|
6569
|
-
/* @__PURE__ */
|
|
6509
|
+
/* @__PURE__ */ jsx15(
|
|
6570
6510
|
"button",
|
|
6571
6511
|
{
|
|
6572
6512
|
type: "button",
|
|
6573
6513
|
disabled: busy || !draftName.trim(),
|
|
6574
6514
|
onClick: () => void create(draftName),
|
|
6575
6515
|
className: "inline-flex h-6 shrink-0 items-center rounded-md px-1.5 text-[10px] font-medium text-primary transition-colors hover:bg-accent disabled:opacity-50",
|
|
6576
|
-
children: busy ? /* @__PURE__ */
|
|
6516
|
+
children: busy ? /* @__PURE__ */ jsx15(SpinnerIcon, { className: "size-3 animate-spin" }) : "Create"
|
|
6577
6517
|
}
|
|
6578
6518
|
)
|
|
6579
|
-
] }) : /* @__PURE__ */
|
|
6519
|
+
] }) : /* @__PURE__ */ jsxs12(
|
|
6580
6520
|
"button",
|
|
6581
6521
|
{
|
|
6582
6522
|
type: "button",
|
|
@@ -6587,7 +6527,7 @@ function AssociationEntitySelect({
|
|
|
6587
6527
|
},
|
|
6588
6528
|
className: "flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
6589
6529
|
children: [
|
|
6590
|
-
busy ? /* @__PURE__ */
|
|
6530
|
+
busy ? /* @__PURE__ */ jsx15(SpinnerIcon, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ jsx15(PlusIcon7, { className: "size-3.5" }),
|
|
6591
6531
|
query.trim() ? `Create "${query.trim()}"` : `New ${info.label}`
|
|
6592
6532
|
]
|
|
6593
6533
|
}
|
|
@@ -6677,7 +6617,7 @@ function buildCategoryHierarchy(categories) {
|
|
|
6677
6617
|
}
|
|
6678
6618
|
|
|
6679
6619
|
// src/react/components/CategorySelect.tsx
|
|
6680
|
-
import { jsx as
|
|
6620
|
+
import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
6681
6621
|
var NONE = "__none__";
|
|
6682
6622
|
var ROOT_PARENT = "__root__";
|
|
6683
6623
|
function plural(noun) {
|
|
@@ -6713,9 +6653,9 @@ function CategorySelect({
|
|
|
6713
6653
|
// The type-ahead matches the parent's name too, so someone who knows
|
|
6714
6654
|
// the branch but not the leaf still finds it.
|
|
6715
6655
|
keywords: parent ? parent.name : "",
|
|
6716
|
-
render: depth === 0 ? /* @__PURE__ */
|
|
6717
|
-
/* @__PURE__ */
|
|
6718
|
-
/* @__PURE__ */
|
|
6656
|
+
render: depth === 0 ? /* @__PURE__ */ jsx16("span", { className: "font-medium", children: category.name }) : /* @__PURE__ */ jsxs13("span", { className: "flex items-center gap-1.5 pl-3 text-muted-foreground", children: [
|
|
6657
|
+
/* @__PURE__ */ jsx16(CornerDownRightIcon, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
6658
|
+
/* @__PURE__ */ jsx16("span", { className: "text-foreground", children: category.name })
|
|
6719
6659
|
] })
|
|
6720
6660
|
})) : categories.map((category) => ({
|
|
6721
6661
|
value: category.id,
|
|
@@ -6762,8 +6702,8 @@ function CategorySelect({
|
|
|
6762
6702
|
);
|
|
6763
6703
|
return result.id;
|
|
6764
6704
|
};
|
|
6765
|
-
return /* @__PURE__ */
|
|
6766
|
-
/* @__PURE__ */
|
|
6705
|
+
return /* @__PURE__ */ jsxs13("div", { children: [
|
|
6706
|
+
/* @__PURE__ */ jsx16(
|
|
6767
6707
|
CreatablePicker,
|
|
6768
6708
|
{
|
|
6769
6709
|
value: value ?? (allowNone ? NONE : null),
|
|
@@ -6779,18 +6719,18 @@ function CategorySelect({
|
|
|
6779
6719
|
emptyLabel: `No ${noun} matches that.`,
|
|
6780
6720
|
...allowCreate ? { onCreate: create } : {},
|
|
6781
6721
|
...allowCreate && hierarchy.hasHierarchy ? {
|
|
6782
|
-
createExtra: /* @__PURE__ */
|
|
6783
|
-
/* @__PURE__ */
|
|
6722
|
+
createExtra: /* @__PURE__ */ jsxs13(Select, { value: createParentId, onValueChange: setCreateParentId, children: [
|
|
6723
|
+
/* @__PURE__ */ jsx16(
|
|
6784
6724
|
SelectTrigger,
|
|
6785
6725
|
{
|
|
6786
6726
|
className: "h-7 text-xs",
|
|
6787
6727
|
"aria-label": `Put the new ${noun} under`,
|
|
6788
|
-
children: /* @__PURE__ */
|
|
6728
|
+
children: /* @__PURE__ */ jsx16(SelectValue, {})
|
|
6789
6729
|
}
|
|
6790
6730
|
),
|
|
6791
|
-
/* @__PURE__ */
|
|
6792
|
-
/* @__PURE__ */
|
|
6793
|
-
hierarchy.items.filter((item) => item.depth === 0).map((item) => /* @__PURE__ */
|
|
6731
|
+
/* @__PURE__ */ jsxs13(SelectContent, { children: [
|
|
6732
|
+
/* @__PURE__ */ jsx16(SelectItem, { value: ROOT_PARENT, className: "text-xs", children: "Top level" }),
|
|
6733
|
+
hierarchy.items.filter((item) => item.depth === 0).map((item) => /* @__PURE__ */ jsxs13(
|
|
6794
6734
|
SelectItem,
|
|
6795
6735
|
{
|
|
6796
6736
|
value: item.category.id,
|
|
@@ -6810,13 +6750,13 @@ function CategorySelect({
|
|
|
6810
6750
|
selected === null && value !== null ? (
|
|
6811
6751
|
// A stored id whose row this reader cannot see is not "nothing chosen":
|
|
6812
6752
|
// saying so beats a blank box that looks like an unsaved field.
|
|
6813
|
-
/* @__PURE__ */
|
|
6753
|
+
/* @__PURE__ */ jsxs13("p", { className: "mt-1 text-xs text-muted-foreground", children: [
|
|
6814
6754
|
"This ",
|
|
6815
6755
|
noun,
|
|
6816
6756
|
" is no longer available to you."
|
|
6817
6757
|
] })
|
|
6818
6758
|
) : null,
|
|
6819
|
-
error ? /* @__PURE__ */
|
|
6759
|
+
error ? /* @__PURE__ */ jsx16("p", { className: "mt-1 text-xs text-destructive", children: error }) : null
|
|
6820
6760
|
] });
|
|
6821
6761
|
}
|
|
6822
6762
|
|
|
@@ -6843,7 +6783,7 @@ import {
|
|
|
6843
6783
|
SelectChevron
|
|
6844
6784
|
} from "@ai-matrx/design-system";
|
|
6845
6785
|
import { CheckIcon as CheckIcon4, XIcon as XIcon6 } from "@ai-matrx/design-system/icons";
|
|
6846
|
-
import { jsx as
|
|
6786
|
+
import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
6847
6787
|
var ROOT_PARENT2 = "__root__";
|
|
6848
6788
|
function CategoryTagPicker({
|
|
6849
6789
|
entityType,
|
|
@@ -6967,44 +6907,44 @@ function CategoryTagPicker({
|
|
|
6967
6907
|
const exactMatch = categories.some(
|
|
6968
6908
|
(c) => c.name.toLowerCase() === search.trim().toLowerCase()
|
|
6969
6909
|
);
|
|
6970
|
-
return /* @__PURE__ */
|
|
6971
|
-
selected.map((c) => /* @__PURE__ */
|
|
6910
|
+
return /* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
6911
|
+
selected.map((c) => /* @__PURE__ */ jsxs14(
|
|
6972
6912
|
Badge,
|
|
6973
6913
|
{
|
|
6974
6914
|
variant: "secondary",
|
|
6975
6915
|
className: "gap-1 pr-1 text-xs font-medium",
|
|
6976
6916
|
children: [
|
|
6977
6917
|
showHierarchy ? hierarchyById.get(c.id)?.displayName ?? c.name : c.name,
|
|
6978
|
-
/* @__PURE__ */
|
|
6918
|
+
/* @__PURE__ */ jsx17(
|
|
6979
6919
|
"button",
|
|
6980
6920
|
{
|
|
6981
6921
|
type: "button",
|
|
6982
6922
|
onClick: () => void toggle(c.id),
|
|
6983
6923
|
className: "ml-0.5 rounded-full p-0.5 hover:bg-muted-foreground/20",
|
|
6984
6924
|
"aria-label": `Remove ${c.name}`,
|
|
6985
|
-
children: /* @__PURE__ */
|
|
6925
|
+
children: /* @__PURE__ */ jsx17(XIcon6, { className: "h-2.5 w-2.5" })
|
|
6986
6926
|
}
|
|
6987
6927
|
)
|
|
6988
6928
|
]
|
|
6989
6929
|
},
|
|
6990
6930
|
c.id
|
|
6991
6931
|
)),
|
|
6992
|
-
/* @__PURE__ */
|
|
6993
|
-
/* @__PURE__ */
|
|
6932
|
+
/* @__PURE__ */ jsxs14(Popover2, { open, onOpenChange: setOpen, children: [
|
|
6933
|
+
/* @__PURE__ */ jsx17(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs14(
|
|
6994
6934
|
Button3,
|
|
6995
6935
|
{
|
|
6996
6936
|
variant: "outline",
|
|
6997
6937
|
size: "sm",
|
|
6998
6938
|
className: "h-7 gap-1 px-2 text-xs",
|
|
6999
6939
|
children: [
|
|
7000
|
-
/* @__PURE__ */
|
|
6940
|
+
/* @__PURE__ */ jsx17(Icon, { className: "h-3.5 w-3.5" }),
|
|
7001
6941
|
selected.length === 0 ? addLabel : "Edit",
|
|
7002
|
-
/* @__PURE__ */
|
|
6942
|
+
/* @__PURE__ */ jsx17(SelectChevron, { size: "sm" })
|
|
7003
6943
|
]
|
|
7004
6944
|
}
|
|
7005
6945
|
) }),
|
|
7006
|
-
/* @__PURE__ */
|
|
7007
|
-
/* @__PURE__ */
|
|
6946
|
+
/* @__PURE__ */ jsx17(PopoverContent2, { sizing: "content", className: "p-0", align: "start", children: /* @__PURE__ */ jsxs14(Command2, { shouldFilter: false, children: [
|
|
6947
|
+
/* @__PURE__ */ jsx17(
|
|
7008
6948
|
CommandInput2,
|
|
7009
6949
|
{
|
|
7010
6950
|
placeholder: allowCreate ? "Search or create..." : "Search...",
|
|
@@ -7012,9 +6952,9 @@ function CategoryTagPicker({
|
|
|
7012
6952
|
onValueChange: setSearch
|
|
7013
6953
|
}
|
|
7014
6954
|
),
|
|
7015
|
-
/* @__PURE__ */
|
|
7016
|
-
/* @__PURE__ */
|
|
7017
|
-
/* @__PURE__ */
|
|
6955
|
+
/* @__PURE__ */ jsxs14(CommandList2, { children: [
|
|
6956
|
+
/* @__PURE__ */ jsx17(CommandEmpty2, { className: "px-2 py-3 text-xs text-muted-foreground", children: search.trim() ? "No match." : emptyText }),
|
|
6957
|
+
/* @__PURE__ */ jsx17(CommandGroup2, { children: showHierarchy ? filteredHierarchy.map(({ category, depth, parent }) => /* @__PURE__ */ jsxs14(
|
|
7018
6958
|
CommandItem2,
|
|
7019
6959
|
{
|
|
7020
6960
|
value: category.id,
|
|
@@ -7022,7 +6962,7 @@ function CategoryTagPicker({
|
|
|
7022
6962
|
onSelect: () => void toggle(category.id),
|
|
7023
6963
|
className: cn12("text-xs", depth === 1 && "pl-6"),
|
|
7024
6964
|
children: [
|
|
7025
|
-
/* @__PURE__ */
|
|
6965
|
+
/* @__PURE__ */ jsx17(
|
|
7026
6966
|
CheckIcon4,
|
|
7027
6967
|
{
|
|
7028
6968
|
className: cn12(
|
|
@@ -7031,19 +6971,19 @@ function CategoryTagPicker({
|
|
|
7031
6971
|
)
|
|
7032
6972
|
}
|
|
7033
6973
|
),
|
|
7034
|
-
depth === 1 ? /* @__PURE__ */
|
|
7035
|
-
/* @__PURE__ */
|
|
6974
|
+
depth === 1 ? /* @__PURE__ */ jsx17(CornerDownRightIcon, { className: "mr-1.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : null,
|
|
6975
|
+
/* @__PURE__ */ jsx17("span", { className: cn12(depth === 0 && "font-medium"), children: category.name })
|
|
7036
6976
|
]
|
|
7037
6977
|
},
|
|
7038
6978
|
category.id
|
|
7039
|
-
)) : filtered.map((c) => /* @__PURE__ */
|
|
6979
|
+
)) : filtered.map((c) => /* @__PURE__ */ jsxs14(
|
|
7040
6980
|
CommandItem2,
|
|
7041
6981
|
{
|
|
7042
6982
|
value: c.id,
|
|
7043
6983
|
onSelect: () => void toggle(c.id),
|
|
7044
6984
|
className: "text-xs",
|
|
7045
6985
|
children: [
|
|
7046
|
-
/* @__PURE__ */
|
|
6986
|
+
/* @__PURE__ */ jsx17(
|
|
7047
6987
|
CheckIcon4,
|
|
7048
6988
|
{
|
|
7049
6989
|
className: cn12(
|
|
@@ -7057,25 +6997,25 @@ function CategoryTagPicker({
|
|
|
7057
6997
|
},
|
|
7058
6998
|
c.id
|
|
7059
6999
|
)) }),
|
|
7060
|
-
allowCreate && search.trim() && !exactMatch ? /* @__PURE__ */
|
|
7061
|
-
showHierarchy ? /* @__PURE__ */
|
|
7062
|
-
/* @__PURE__ */
|
|
7063
|
-
/* @__PURE__ */
|
|
7000
|
+
allowCreate && search.trim() && !exactMatch ? /* @__PURE__ */ jsxs14(CommandGroup2, { children: [
|
|
7001
|
+
showHierarchy ? /* @__PURE__ */ jsxs14("div", { className: "space-y-1.5 px-2 pb-2", children: [
|
|
7002
|
+
/* @__PURE__ */ jsx17("p", { className: "text-[11px] font-medium text-muted-foreground", children: "Place in" }),
|
|
7003
|
+
/* @__PURE__ */ jsxs14(
|
|
7064
7004
|
Select2,
|
|
7065
7005
|
{
|
|
7066
7006
|
value: createParentId,
|
|
7067
7007
|
onValueChange: setCreateParentId,
|
|
7068
7008
|
children: [
|
|
7069
|
-
/* @__PURE__ */
|
|
7070
|
-
/* @__PURE__ */
|
|
7071
|
-
/* @__PURE__ */
|
|
7072
|
-
hierarchy.roots.map((root) => /* @__PURE__ */
|
|
7009
|
+
/* @__PURE__ */ jsx17(SelectTrigger2, { size: "sm", className: "bg-background", children: /* @__PURE__ */ jsx17(SelectValue2, {}) }),
|
|
7010
|
+
/* @__PURE__ */ jsxs14(SelectContent2, { children: [
|
|
7011
|
+
/* @__PURE__ */ jsx17(SelectItem2, { value: ROOT_PARENT2, children: "Top level" }),
|
|
7012
|
+
hierarchy.roots.map((root) => /* @__PURE__ */ jsx17(SelectItem2, { value: root.id, children: root.name }, root.id))
|
|
7073
7013
|
] })
|
|
7074
7014
|
]
|
|
7075
7015
|
}
|
|
7076
7016
|
)
|
|
7077
7017
|
] }) : null,
|
|
7078
|
-
/* @__PURE__ */
|
|
7018
|
+
/* @__PURE__ */ jsxs14(
|
|
7079
7019
|
CommandItem2,
|
|
7080
7020
|
{
|
|
7081
7021
|
value: `__create__${search}`,
|
|
@@ -7083,7 +7023,7 @@ function CategoryTagPicker({
|
|
|
7083
7023
|
disabled: creating,
|
|
7084
7024
|
className: "text-xs text-primary",
|
|
7085
7025
|
children: [
|
|
7086
|
-
creating ? /* @__PURE__ */
|
|
7026
|
+
creating ? /* @__PURE__ */ jsx17(SpinnerIcon, { className: "mr-2 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx17(Icon, { className: "mr-2 h-3.5 w-3.5" }),
|
|
7087
7027
|
"Create \u201C",
|
|
7088
7028
|
search.trim(),
|
|
7089
7029
|
"\u201D"
|
|
@@ -7110,20 +7050,20 @@ function partKeyOf(comment) {
|
|
|
7110
7050
|
// src/react/components/CommentBody.tsx
|
|
7111
7051
|
import { Fragment as Fragment5 } from "react";
|
|
7112
7052
|
import { cn as cn13 } from "@ai-matrx/design-system";
|
|
7113
|
-
import { jsx as
|
|
7053
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
7114
7054
|
var INLINE = /(\*\*[^*\n]+\*\*|`[^`\n]+`|\*[^*\n]+\*)/g;
|
|
7115
7055
|
function renderInline(text) {
|
|
7116
7056
|
return text.split(INLINE).map((part, i) => {
|
|
7117
7057
|
if (part.length > 4 && part.startsWith("**") && part.endsWith("**")) {
|
|
7118
|
-
return /* @__PURE__ */
|
|
7058
|
+
return /* @__PURE__ */ jsx18("strong", { children: part.slice(2, -2) }, i);
|
|
7119
7059
|
}
|
|
7120
7060
|
if (part.length > 2 && part.startsWith("`") && part.endsWith("`")) {
|
|
7121
|
-
return /* @__PURE__ */
|
|
7061
|
+
return /* @__PURE__ */ jsx18("code", { className: "rounded bg-muted px-1 text-[0.9em]", children: part.slice(1, -1) }, i);
|
|
7122
7062
|
}
|
|
7123
7063
|
if (part.length > 2 && part.startsWith("*") && part.endsWith("*")) {
|
|
7124
|
-
return /* @__PURE__ */
|
|
7064
|
+
return /* @__PURE__ */ jsx18("em", { children: part.slice(1, -1) }, i);
|
|
7125
7065
|
}
|
|
7126
|
-
return /* @__PURE__ */
|
|
7066
|
+
return /* @__PURE__ */ jsx18(Fragment5, { children: part }, i);
|
|
7127
7067
|
});
|
|
7128
7068
|
}
|
|
7129
7069
|
var BULLET = /^\s*[-*]\s+(.*)$/;
|
|
@@ -7134,14 +7074,14 @@ function renderBlocks(lines, keyPrefix) {
|
|
|
7134
7074
|
const flushBullets = () => {
|
|
7135
7075
|
if (!bullets.length) return;
|
|
7136
7076
|
out.push(
|
|
7137
|
-
/* @__PURE__ */
|
|
7077
|
+
/* @__PURE__ */ jsx18("ul", { className: "list-disc pl-5", children: bullets.map((b, i) => /* @__PURE__ */ jsx18("li", { children: renderInline(b) }, i)) }, `${keyPrefix}-u${out.length}`)
|
|
7138
7078
|
);
|
|
7139
7079
|
bullets = [];
|
|
7140
7080
|
};
|
|
7141
7081
|
const flushPara = () => {
|
|
7142
7082
|
if (!para.length) return;
|
|
7143
7083
|
out.push(
|
|
7144
|
-
/* @__PURE__ */
|
|
7084
|
+
/* @__PURE__ */ jsx18("p", { className: "whitespace-pre-wrap", children: renderInline(para.join("\n")) }, `${keyPrefix}-p${out.length}`)
|
|
7145
7085
|
);
|
|
7146
7086
|
para = [];
|
|
7147
7087
|
};
|
|
@@ -7175,20 +7115,20 @@ function renderCommentMarkdown(body) {
|
|
|
7175
7115
|
}
|
|
7176
7116
|
return runs.map((run, i) => {
|
|
7177
7117
|
const blocks = renderBlocks(run.lines, `r${i}`);
|
|
7178
|
-
return run.quoted ? /* @__PURE__ */
|
|
7118
|
+
return run.quoted ? /* @__PURE__ */ jsx18(
|
|
7179
7119
|
"blockquote",
|
|
7180
7120
|
{
|
|
7181
7121
|
className: "border-l-2 border-border pl-2 text-muted-foreground",
|
|
7182
7122
|
children: blocks
|
|
7183
7123
|
},
|
|
7184
7124
|
i
|
|
7185
|
-
) : /* @__PURE__ */
|
|
7125
|
+
) : /* @__PURE__ */ jsx18(Fragment5, { children: blocks }, i);
|
|
7186
7126
|
});
|
|
7187
7127
|
}
|
|
7188
7128
|
function CommentBody({ body, className }) {
|
|
7189
7129
|
const { commentBody: HostBody } = useAssociationsUiPorts();
|
|
7190
|
-
if (HostBody) return /* @__PURE__ */
|
|
7191
|
-
return /* @__PURE__ */
|
|
7130
|
+
if (HostBody) return /* @__PURE__ */ jsx18(HostBody, { body, className });
|
|
7131
|
+
return /* @__PURE__ */ jsx18(
|
|
7192
7132
|
"div",
|
|
7193
7133
|
{
|
|
7194
7134
|
"data-comment-body": true,
|
|
@@ -7200,7 +7140,7 @@ function CommentBody({ body, className }) {
|
|
|
7200
7140
|
|
|
7201
7141
|
// src/react/components/CommentThread.tsx
|
|
7202
7142
|
import { formatRelativeTime } from "@ai-matrx/kit/format";
|
|
7203
|
-
import { Fragment as Fragment6, jsx as
|
|
7143
|
+
import { Fragment as Fragment6, jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
7204
7144
|
var AUTHOR_DOOR_TOKEN = "user";
|
|
7205
7145
|
var SYSTEM_AUTHOR_NAME = "AI Matrx";
|
|
7206
7146
|
function resolveAuthor(comment, authorDisplay) {
|
|
@@ -7215,24 +7155,24 @@ function resolveAuthor(comment, authorDisplay) {
|
|
|
7215
7155
|
isAgent: true
|
|
7216
7156
|
};
|
|
7217
7157
|
}
|
|
7218
|
-
const
|
|
7158
|
+
const base = {
|
|
7219
7159
|
userId: comment.createdBy,
|
|
7220
7160
|
email: comment.author.email,
|
|
7221
7161
|
displayName: comment.author.displayName,
|
|
7222
7162
|
avatarUrl: comment.author.avatarUrl
|
|
7223
7163
|
};
|
|
7224
|
-
const enriched = authorDisplay ? authorDisplay(
|
|
7225
|
-
const name = enriched?.displayName ??
|
|
7164
|
+
const enriched = authorDisplay ? authorDisplay(base) : null;
|
|
7165
|
+
const name = enriched?.displayName ?? base.displayName ?? base.email ?? "Unknown user";
|
|
7226
7166
|
return {
|
|
7227
7167
|
name,
|
|
7228
|
-
avatarUrl: enriched?.avatarUrl !== void 0 && enriched?.avatarUrl !== null ? enriched.avatarUrl :
|
|
7168
|
+
avatarUrl: enriched?.avatarUrl !== void 0 && enriched?.avatarUrl !== null ? enriched.avatarUrl : base.avatarUrl,
|
|
7229
7169
|
userId: comment.createdBy,
|
|
7230
7170
|
isAgent: false
|
|
7231
7171
|
};
|
|
7232
7172
|
}
|
|
7233
7173
|
function AuthorAvatar({ author }) {
|
|
7234
7174
|
if (author.avatarUrl) {
|
|
7235
|
-
return /* @__PURE__ */
|
|
7175
|
+
return /* @__PURE__ */ jsx19(
|
|
7236
7176
|
"img",
|
|
7237
7177
|
{
|
|
7238
7178
|
src: author.avatarUrl,
|
|
@@ -7241,7 +7181,7 @@ function AuthorAvatar({ author }) {
|
|
|
7241
7181
|
}
|
|
7242
7182
|
);
|
|
7243
7183
|
}
|
|
7244
|
-
return /* @__PURE__ */
|
|
7184
|
+
return /* @__PURE__ */ jsx19(
|
|
7245
7185
|
"span",
|
|
7246
7186
|
{
|
|
7247
7187
|
"aria-hidden": true,
|
|
@@ -7256,7 +7196,7 @@ function AuthorName({
|
|
|
7256
7196
|
}) {
|
|
7257
7197
|
const DoorRef2 = entityDoors?.EntityRef;
|
|
7258
7198
|
if (DoorRef2 && author.userId) {
|
|
7259
|
-
return /* @__PURE__ */
|
|
7199
|
+
return /* @__PURE__ */ jsx19(
|
|
7260
7200
|
DoorRef2,
|
|
7261
7201
|
{
|
|
7262
7202
|
token: AUTHOR_DOOR_TOKEN,
|
|
@@ -7267,7 +7207,7 @@ function AuthorName({
|
|
|
7267
7207
|
}
|
|
7268
7208
|
);
|
|
7269
7209
|
}
|
|
7270
|
-
return /* @__PURE__ */
|
|
7210
|
+
return /* @__PURE__ */ jsx19("span", { className: "text-sm font-medium text-foreground", children: author.name });
|
|
7271
7211
|
}
|
|
7272
7212
|
function CommentComposer({
|
|
7273
7213
|
onSubmit,
|
|
@@ -7298,8 +7238,8 @@ function CommentComposer({
|
|
|
7298
7238
|
}
|
|
7299
7239
|
setBody("");
|
|
7300
7240
|
}
|
|
7301
|
-
return /* @__PURE__ */
|
|
7302
|
-
/* @__PURE__ */
|
|
7241
|
+
return /* @__PURE__ */ jsxs15("form", { onSubmit: submit, className: "flex flex-col gap-1.5", children: [
|
|
7242
|
+
/* @__PURE__ */ jsx19(
|
|
7303
7243
|
"textarea",
|
|
7304
7244
|
{
|
|
7305
7245
|
value: body,
|
|
@@ -7314,7 +7254,7 @@ function CommentComposer({
|
|
|
7314
7254
|
className: "w-full resize-y rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
7315
7255
|
}
|
|
7316
7256
|
),
|
|
7317
|
-
error && /* @__PURE__ */
|
|
7257
|
+
error && /* @__PURE__ */ jsx19(
|
|
7318
7258
|
ErrorBox2,
|
|
7319
7259
|
{
|
|
7320
7260
|
className: "text-xs text-destructive",
|
|
@@ -7324,10 +7264,10 @@ function CommentComposer({
|
|
|
7324
7264
|
origin: "associations/CommentThread"
|
|
7325
7265
|
}
|
|
7326
7266
|
),
|
|
7327
|
-
error && signIn && isSignedOutMessage(error) && /* @__PURE__ */
|
|
7328
|
-
/* @__PURE__ */
|
|
7329
|
-
/* @__PURE__ */
|
|
7330
|
-
submitting && /* @__PURE__ */
|
|
7267
|
+
error && signIn && isSignedOutMessage(error) && /* @__PURE__ */ jsx19(SignInAgain, { onClick: signIn }),
|
|
7268
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
|
|
7269
|
+
/* @__PURE__ */ jsxs15(Button4, { type: "submit", size: "sm", disabled: !body.trim() || submitting, children: [
|
|
7270
|
+
submitting && /* @__PURE__ */ jsx19(SpinnerIcon, { className: "mr-1 h-3 w-3 animate-spin" }),
|
|
7331
7271
|
submitLabel
|
|
7332
7272
|
] }),
|
|
7333
7273
|
trailing
|
|
@@ -7369,7 +7309,7 @@ function CommentItem({
|
|
|
7369
7309
|
notifier.error(res.error ?? "Could not delete the comment");
|
|
7370
7310
|
}
|
|
7371
7311
|
}
|
|
7372
|
-
return /* @__PURE__ */
|
|
7312
|
+
return /* @__PURE__ */ jsxs15(
|
|
7373
7313
|
"div",
|
|
7374
7314
|
{
|
|
7375
7315
|
"data-comment-id": comment.id,
|
|
@@ -7378,15 +7318,15 @@ function CommentItem({
|
|
|
7378
7318
|
depth > 0 && "border-l border-border pl-3"
|
|
7379
7319
|
),
|
|
7380
7320
|
children: [
|
|
7381
|
-
/* @__PURE__ */
|
|
7382
|
-
/* @__PURE__ */
|
|
7383
|
-
/* @__PURE__ */
|
|
7384
|
-
author.isAgent && /* @__PURE__ */
|
|
7385
|
-
showPart && partLabel && /* @__PURE__ */
|
|
7321
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
|
|
7322
|
+
/* @__PURE__ */ jsx19(AuthorAvatar, { author }),
|
|
7323
|
+
/* @__PURE__ */ jsx19(AuthorName, { author, entityDoors }),
|
|
7324
|
+
author.isAgent && /* @__PURE__ */ jsx19("span", { className: "rounded bg-muted px-1 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground", children: "Agent" }),
|
|
7325
|
+
showPart && partLabel && /* @__PURE__ */ jsxs15("span", { className: "truncate text-xs text-muted-foreground", title: partLabel, children: [
|
|
7386
7326
|
"on ",
|
|
7387
7327
|
partLabel
|
|
7388
7328
|
] }),
|
|
7389
|
-
/* @__PURE__ */
|
|
7329
|
+
/* @__PURE__ */ jsx19(
|
|
7390
7330
|
"span",
|
|
7391
7331
|
{
|
|
7392
7332
|
className: "text-xs text-muted-foreground",
|
|
@@ -7397,7 +7337,7 @@ function CommentItem({
|
|
|
7397
7337
|
})
|
|
7398
7338
|
}
|
|
7399
7339
|
),
|
|
7400
|
-
edited && /* @__PURE__ */
|
|
7340
|
+
edited && /* @__PURE__ */ jsx19(
|
|
7401
7341
|
"span",
|
|
7402
7342
|
{
|
|
7403
7343
|
className: "text-xs text-muted-foreground",
|
|
@@ -7406,7 +7346,7 @@ function CommentItem({
|
|
|
7406
7346
|
}
|
|
7407
7347
|
)
|
|
7408
7348
|
] }),
|
|
7409
|
-
editing ? /* @__PURE__ */
|
|
7349
|
+
editing ? /* @__PURE__ */ jsx19("div", { className: "pl-8", children: /* @__PURE__ */ jsx19(
|
|
7410
7350
|
CommentComposer,
|
|
7411
7351
|
{
|
|
7412
7352
|
initialValue: comment.body,
|
|
@@ -7418,7 +7358,7 @@ function CommentItem({
|
|
|
7418
7358
|
if (res.ok) setEditing(false);
|
|
7419
7359
|
return res;
|
|
7420
7360
|
},
|
|
7421
|
-
trailing: /* @__PURE__ */
|
|
7361
|
+
trailing: /* @__PURE__ */ jsx19(
|
|
7422
7362
|
Button4,
|
|
7423
7363
|
{
|
|
7424
7364
|
type: "button",
|
|
@@ -7429,10 +7369,10 @@ function CommentItem({
|
|
|
7429
7369
|
}
|
|
7430
7370
|
)
|
|
7431
7371
|
}
|
|
7432
|
-
) }) : /* @__PURE__ */
|
|
7433
|
-
!editing && /* @__PURE__ */
|
|
7434
|
-
/* @__PURE__ */
|
|
7435
|
-
/* @__PURE__ */
|
|
7372
|
+
) }) : /* @__PURE__ */ jsx19(CommentBody, { body: comment.body, className: "pl-8" }),
|
|
7373
|
+
!editing && /* @__PURE__ */ jsx19("div", { className: "flex items-center gap-1 pl-7", children: confirmingDelete ? /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
7374
|
+
/* @__PURE__ */ jsx19("span", { className: "text-xs text-destructive", children: "Deletes this comment for everyone." }),
|
|
7375
|
+
/* @__PURE__ */ jsxs15(
|
|
7436
7376
|
Button4,
|
|
7437
7377
|
{
|
|
7438
7378
|
type: "button",
|
|
@@ -7441,12 +7381,12 @@ function CommentItem({
|
|
|
7441
7381
|
disabled: deleting,
|
|
7442
7382
|
onClick: () => void confirmDelete(),
|
|
7443
7383
|
children: [
|
|
7444
|
-
deleting && /* @__PURE__ */
|
|
7384
|
+
deleting && /* @__PURE__ */ jsx19(SpinnerIcon, { className: "mr-1 h-3 w-3 animate-spin" }),
|
|
7445
7385
|
"Delete"
|
|
7446
7386
|
]
|
|
7447
7387
|
}
|
|
7448
7388
|
),
|
|
7449
|
-
/* @__PURE__ */
|
|
7389
|
+
/* @__PURE__ */ jsx19(
|
|
7450
7390
|
Button4,
|
|
7451
7391
|
{
|
|
7452
7392
|
type: "button",
|
|
@@ -7457,8 +7397,8 @@ function CommentItem({
|
|
|
7457
7397
|
children: "Cancel"
|
|
7458
7398
|
}
|
|
7459
7399
|
)
|
|
7460
|
-
] }) : /* @__PURE__ */
|
|
7461
|
-
/* @__PURE__ */
|
|
7400
|
+
] }) : /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
7401
|
+
/* @__PURE__ */ jsx19(
|
|
7462
7402
|
"button",
|
|
7463
7403
|
{
|
|
7464
7404
|
type: "button",
|
|
@@ -7467,8 +7407,8 @@ function CommentItem({
|
|
|
7467
7407
|
children: "Reply"
|
|
7468
7408
|
}
|
|
7469
7409
|
),
|
|
7470
|
-
isOwn && /* @__PURE__ */
|
|
7471
|
-
canEdit && /* @__PURE__ */
|
|
7410
|
+
isOwn && /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
7411
|
+
canEdit && /* @__PURE__ */ jsx19(
|
|
7472
7412
|
"button",
|
|
7473
7413
|
{
|
|
7474
7414
|
type: "button",
|
|
@@ -7477,7 +7417,7 @@ function CommentItem({
|
|
|
7477
7417
|
children: "Edit"
|
|
7478
7418
|
}
|
|
7479
7419
|
),
|
|
7480
|
-
/* @__PURE__ */
|
|
7420
|
+
/* @__PURE__ */ jsx19(
|
|
7481
7421
|
"button",
|
|
7482
7422
|
{
|
|
7483
7423
|
type: "button",
|
|
@@ -7488,9 +7428,9 @@ function CommentItem({
|
|
|
7488
7428
|
)
|
|
7489
7429
|
] })
|
|
7490
7430
|
] }) }),
|
|
7491
|
-
replying && /* @__PURE__ */
|
|
7492
|
-
/* @__PURE__ */
|
|
7493
|
-
/* @__PURE__ */
|
|
7431
|
+
replying && /* @__PURE__ */ jsxs15("div", { className: "flex items-start gap-2 pl-8 pt-1", children: [
|
|
7432
|
+
/* @__PURE__ */ jsx19(CornerDownRightIcon, { className: "mt-2 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
7433
|
+
/* @__PURE__ */ jsx19("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx19(
|
|
7494
7434
|
CommentComposer,
|
|
7495
7435
|
{
|
|
7496
7436
|
submitLabel: "Reply",
|
|
@@ -7507,7 +7447,7 @@ function CommentItem({
|
|
|
7507
7447
|
}
|
|
7508
7448
|
return res;
|
|
7509
7449
|
},
|
|
7510
|
-
trailing: /* @__PURE__ */
|
|
7450
|
+
trailing: /* @__PURE__ */ jsx19(
|
|
7511
7451
|
Button4,
|
|
7512
7452
|
{
|
|
7513
7453
|
type: "button",
|
|
@@ -7520,7 +7460,7 @@ function CommentItem({
|
|
|
7520
7460
|
}
|
|
7521
7461
|
) })
|
|
7522
7462
|
] }),
|
|
7523
|
-
replies.length > 0 && /* @__PURE__ */
|
|
7463
|
+
replies.length > 0 && /* @__PURE__ */ jsx19("div", { className: "flex flex-col gap-3 pl-8 pt-1", children: replies.map((reply) => /* @__PURE__ */ jsx19(
|
|
7524
7464
|
CommentItem,
|
|
7525
7465
|
{
|
|
7526
7466
|
comment: reply,
|
|
@@ -7576,11 +7516,11 @@ function CommentThread({
|
|
|
7576
7516
|
const roots = part ? tree.roots.filter((c) => partKeyOf(c) === part.key) : tree.roots;
|
|
7577
7517
|
const shownCount = part ? countThread(roots, childrenOf) : thread.comments.length;
|
|
7578
7518
|
const loading = (thread.status === "loading" || thread.status === "idle") && thread.comments.length === 0;
|
|
7579
|
-
return /* @__PURE__ */
|
|
7580
|
-
showHeader && /* @__PURE__ */
|
|
7581
|
-
/* @__PURE__ */
|
|
7582
|
-
/* @__PURE__ */
|
|
7583
|
-
/* @__PURE__ */
|
|
7519
|
+
return /* @__PURE__ */ jsxs15("section", { className: cn14("flex flex-col gap-3", className), children: [
|
|
7520
|
+
showHeader && /* @__PURE__ */ jsxs15("header", { className: "flex items-center gap-2", children: [
|
|
7521
|
+
/* @__PURE__ */ jsx19("h3", { className: "text-sm font-semibold text-foreground", children: "Comments" }),
|
|
7522
|
+
/* @__PURE__ */ jsx19("span", { className: "text-xs text-muted-foreground tabular-nums", children: shownCount }),
|
|
7523
|
+
/* @__PURE__ */ jsx19(
|
|
7584
7524
|
"button",
|
|
7585
7525
|
{
|
|
7586
7526
|
type: "button",
|
|
@@ -7588,11 +7528,11 @@ function CommentThread({
|
|
|
7588
7528
|
"aria-label": "Refresh comments",
|
|
7589
7529
|
title: "Refresh comments",
|
|
7590
7530
|
className: "ml-auto flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
7591
|
-
children: thread.status === "loading" ? /* @__PURE__ */
|
|
7531
|
+
children: thread.status === "loading" ? /* @__PURE__ */ jsx19(SpinnerIcon, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx19(RefreshIcon, { className: "h-3.5 w-3.5" })
|
|
7592
7532
|
}
|
|
7593
7533
|
)
|
|
7594
7534
|
] }),
|
|
7595
|
-
thread.error && /* @__PURE__ */
|
|
7535
|
+
thread.error && /* @__PURE__ */ jsxs15(
|
|
7596
7536
|
ErrorBox2,
|
|
7597
7537
|
{
|
|
7598
7538
|
as: "div",
|
|
@@ -7601,9 +7541,9 @@ function CommentThread({
|
|
|
7601
7541
|
operation: "Load comments",
|
|
7602
7542
|
origin: "associations/CommentThread",
|
|
7603
7543
|
children: [
|
|
7604
|
-
/* @__PURE__ */
|
|
7605
|
-
signInPort && isSignedOutMessage(thread.error) && /* @__PURE__ */
|
|
7606
|
-
/* @__PURE__ */
|
|
7544
|
+
/* @__PURE__ */ jsx19("span", { className: "min-w-0 flex-1", children: thread.error }),
|
|
7545
|
+
signInPort && isSignedOutMessage(thread.error) && /* @__PURE__ */ jsx19(SignInAgain, { onClick: signInPort }),
|
|
7546
|
+
/* @__PURE__ */ jsx19(
|
|
7607
7547
|
Button4,
|
|
7608
7548
|
{
|
|
7609
7549
|
type: "button",
|
|
@@ -7617,10 +7557,10 @@ function CommentThread({
|
|
|
7617
7557
|
]
|
|
7618
7558
|
}
|
|
7619
7559
|
),
|
|
7620
|
-
loading ? /* @__PURE__ */
|
|
7621
|
-
/* @__PURE__ */
|
|
7622
|
-
/* @__PURE__ */
|
|
7623
|
-
] }) : roots.length === 0 && !thread.error ? /* @__PURE__ */
|
|
7560
|
+
loading ? /* @__PURE__ */ jsxs15("div", { className: "flex flex-col gap-3", "aria-hidden": true, "data-testid": "comments-loading", children: [
|
|
7561
|
+
/* @__PURE__ */ jsx19(Skeleton2, { className: "h-12 w-full" }),
|
|
7562
|
+
/* @__PURE__ */ jsx19(Skeleton2, { className: "h-12 w-4/5" })
|
|
7563
|
+
] }) : roots.length === 0 && !thread.error ? /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: "No comments yet." }) : /* @__PURE__ */ jsx19("div", { className: "flex flex-col gap-4", children: roots.map((comment) => /* @__PURE__ */ jsx19(
|
|
7624
7564
|
CommentItem,
|
|
7625
7565
|
{
|
|
7626
7566
|
comment,
|
|
@@ -7633,7 +7573,7 @@ function CommentThread({
|
|
|
7633
7573
|
},
|
|
7634
7574
|
comment.id
|
|
7635
7575
|
)) }),
|
|
7636
|
-
/* @__PURE__ */
|
|
7576
|
+
/* @__PURE__ */ jsx19(
|
|
7637
7577
|
CommentComposer,
|
|
7638
7578
|
{
|
|
7639
7579
|
onSubmit: async (body) => {
|
|
@@ -7647,7 +7587,7 @@ function CommentThread({
|
|
|
7647
7587
|
] });
|
|
7648
7588
|
}
|
|
7649
7589
|
function SignInAgain({ onClick }) {
|
|
7650
|
-
return /* @__PURE__ */
|
|
7590
|
+
return /* @__PURE__ */ jsx19(Button4, { type: "button", size: "sm", variant: "outline", onClick, children: "Sign in" });
|
|
7651
7591
|
}
|
|
7652
7592
|
export {
|
|
7653
7593
|
AssociationCandidateBody,
|