@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.cjs
CHANGED
|
@@ -3935,96 +3935,23 @@ var import_react_dom = require("react-dom");
|
|
|
3935
3935
|
var import_design_system2 = require("@ai-matrx/design-system");
|
|
3936
3936
|
|
|
3937
3937
|
// src/react/icons.tsx
|
|
3938
|
-
var
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
...props
|
|
3952
|
-
};
|
|
3953
|
-
}
|
|
3954
|
-
function SpinnerIcon(props) {
|
|
3955
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { ...base(props), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) });
|
|
3956
|
-
}
|
|
3957
|
-
function Link2Icon(props) {
|
|
3958
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
|
|
3959
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M9 17H7A5 5 0 0 1 7 7h2" }),
|
|
3960
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M15 7h2a5 5 0 1 1 0 10h-2" }),
|
|
3961
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "8", x2: "16", y1: "12", y2: "12" })
|
|
3962
|
-
] });
|
|
3963
|
-
}
|
|
3964
|
-
function RefreshIcon(props) {
|
|
3965
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
|
|
3966
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
|
|
3967
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 3v5h-5" }),
|
|
3968
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
|
|
3969
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8 16H3v5" })
|
|
3970
|
-
] });
|
|
3971
|
-
}
|
|
3972
|
-
function UploadIcon(props) {
|
|
3973
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
|
|
3974
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
3975
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("polyline", { points: "17 8 12 3 7 8" }),
|
|
3976
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "12", x2: "12", y1: "3", y2: "15" })
|
|
3977
|
-
] });
|
|
3978
|
-
}
|
|
3979
|
-
function FolderOpenIcon(props) {
|
|
3980
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { ...base(props), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("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" }) });
|
|
3981
|
-
}
|
|
3982
|
-
function CornerDownRightIcon(props) {
|
|
3983
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
|
|
3984
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("polyline", { points: "15 10 20 15 15 20" }),
|
|
3985
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M4 4v7a4 4 0 0 0 4 4h12" })
|
|
3986
|
-
] });
|
|
3987
|
-
}
|
|
3988
|
-
function TagIcon(props) {
|
|
3989
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
|
|
3990
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("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" }),
|
|
3991
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor" })
|
|
3992
|
-
] });
|
|
3993
|
-
}
|
|
3994
|
-
function DefaultEntityIcon(props) {
|
|
3995
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
|
|
3996
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("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" }),
|
|
3997
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m7 16.5-4.74-2.85" }),
|
|
3998
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m7 16.5 5-3" }),
|
|
3999
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M7 16.5v5.17" }),
|
|
4000
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("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" }),
|
|
4001
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m17 16.5-5-3" }),
|
|
4002
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m17 16.5 4.74-2.85" }),
|
|
4003
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M17 16.5v5.17" }),
|
|
4004
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("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" }),
|
|
4005
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 8 7.26 5.15" }),
|
|
4006
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m12 8 4.74-2.85" }),
|
|
4007
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 13.5V8" })
|
|
4008
|
-
] });
|
|
4009
|
-
}
|
|
4010
|
-
function RestoreIcon(props) {
|
|
4011
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
|
|
4012
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M4 14h6v6" }),
|
|
4013
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M20 10h-6V4" }),
|
|
4014
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M14 10l7-7" }),
|
|
4015
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M3 21l7-7" })
|
|
4016
|
-
] });
|
|
4017
|
-
}
|
|
4018
|
-
function GripResizeIcon(props) {
|
|
4019
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
|
|
4020
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 15 15 21" }),
|
|
4021
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 20 20 21" })
|
|
4022
|
-
] });
|
|
4023
|
-
}
|
|
3938
|
+
var import_icons = require("@ai-matrx/design-system/icons");
|
|
3939
|
+
var sized = (Glyph) => (0, import_icons.withGlyphDefaults)(Glyph, { width: 24, height: 24 });
|
|
3940
|
+
var SpinnerIcon = sized(import_icons.Loader2Icon);
|
|
3941
|
+
var Link2Icon = sized(import_icons.Link2Icon);
|
|
3942
|
+
var RefreshIcon = sized(import_icons.RefreshCwIcon);
|
|
3943
|
+
var UploadIcon = sized(import_icons.UploadIcon);
|
|
3944
|
+
var FolderOpenIcon = sized(import_icons.FolderOpenIcon);
|
|
3945
|
+
var FileTextIcon = sized(import_icons.FileTextIcon);
|
|
3946
|
+
var CornerDownRightIcon = sized(import_icons.CornerDownRightIcon);
|
|
3947
|
+
var TagIcon = sized(import_icons.TagIcon);
|
|
3948
|
+
var DefaultEntityIcon = sized(import_icons.BoxesIcon);
|
|
3949
|
+
var RestoreIcon = sized(import_icons.RestoreIcon);
|
|
3950
|
+
var GripResizeIcon = sized(import_icons.GripResizeIcon);
|
|
4024
3951
|
|
|
4025
3952
|
// src/react/components/DefaultWindowShell.tsx
|
|
4026
|
-
var
|
|
4027
|
-
var
|
|
3953
|
+
var import_icons3 = require("@ai-matrx/design-system/icons");
|
|
3954
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
4028
3955
|
var DEFAULT_WIDTH = 440;
|
|
4029
3956
|
var DEFAULT_HEIGHT = 580;
|
|
4030
3957
|
var MIN_WIDTH = 330;
|
|
@@ -4108,7 +4035,7 @@ function DefaultWindowShell({
|
|
|
4108
4035
|
height: rect.height
|
|
4109
4036
|
};
|
|
4110
4037
|
return (0, import_react_dom.createPortal)(
|
|
4111
|
-
/* @__PURE__ */ (0,
|
|
4038
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system2.FloatingLayer, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
4112
4039
|
"div",
|
|
4113
4040
|
{
|
|
4114
4041
|
ref: setPanelRef,
|
|
@@ -4125,7 +4052,7 @@ function DefaultWindowShell({
|
|
|
4125
4052
|
className
|
|
4126
4053
|
),
|
|
4127
4054
|
children: [
|
|
4128
|
-
/* @__PURE__ */ (0,
|
|
4055
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
4129
4056
|
"header",
|
|
4130
4057
|
{
|
|
4131
4058
|
onPointerDown: drag.onPointerDown,
|
|
@@ -4137,51 +4064,51 @@ function DefaultWindowShell({
|
|
|
4137
4064
|
isMobile ? "" : "cursor-move touch-none"
|
|
4138
4065
|
),
|
|
4139
4066
|
children: [
|
|
4140
|
-
/* @__PURE__ */ (0,
|
|
4067
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
4141
4068
|
"span",
|
|
4142
4069
|
{
|
|
4143
4070
|
id: labelId,
|
|
4144
4071
|
className: "flex min-w-0 items-center gap-1.5 text-sm font-medium text-foreground",
|
|
4145
4072
|
children: [
|
|
4146
4073
|
icon,
|
|
4147
|
-
/* @__PURE__ */ (0,
|
|
4074
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "truncate", children: title })
|
|
4148
4075
|
]
|
|
4149
4076
|
}
|
|
4150
4077
|
),
|
|
4151
|
-
/* @__PURE__ */ (0,
|
|
4152
|
-
isMobile ? null : /* @__PURE__ */ (0,
|
|
4078
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
4079
|
+
isMobile ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4153
4080
|
"button",
|
|
4154
4081
|
{
|
|
4155
4082
|
type: "button",
|
|
4156
4083
|
onClick: () => setMaximized((v) => !v),
|
|
4157
4084
|
"aria-label": maximized ? "Restore window" : "Maximize window",
|
|
4158
4085
|
className: "flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
4159
|
-
children: maximized ? /* @__PURE__ */ (0,
|
|
4086
|
+
children: maximized ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RestoreIcon, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons3.Maximize2Icon, { className: "h-3.5 w-3.5" })
|
|
4160
4087
|
}
|
|
4161
4088
|
),
|
|
4162
|
-
/* @__PURE__ */ (0,
|
|
4089
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4163
4090
|
"button",
|
|
4164
4091
|
{
|
|
4165
4092
|
type: "button",
|
|
4166
4093
|
onClick: onClose,
|
|
4167
4094
|
"aria-label": "Close",
|
|
4168
4095
|
className: "flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
4169
|
-
children: /* @__PURE__ */ (0,
|
|
4096
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons3.XIcon, { className: "h-3.5 w-3.5" })
|
|
4170
4097
|
}
|
|
4171
4098
|
)
|
|
4172
4099
|
] })
|
|
4173
4100
|
]
|
|
4174
4101
|
}
|
|
4175
4102
|
),
|
|
4176
|
-
/* @__PURE__ */ (0,
|
|
4177
|
-
isMobile || maximized ? null : /* @__PURE__ */ (0,
|
|
4103
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "min-h-0 flex-1 overflow-hidden", children }),
|
|
4104
|
+
isMobile || maximized ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4178
4105
|
"button",
|
|
4179
4106
|
{
|
|
4180
4107
|
type: "button",
|
|
4181
4108
|
"aria-label": "Resize window",
|
|
4182
4109
|
onPointerDown: drag.resizeHandle("se"),
|
|
4183
4110
|
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",
|
|
4184
|
-
children: /* @__PURE__ */ (0,
|
|
4111
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GripResizeIcon, { className: "h-3 w-3" })
|
|
4185
4112
|
}
|
|
4186
4113
|
)
|
|
4187
4114
|
]
|
|
@@ -4192,7 +4119,7 @@ function DefaultWindowShell({
|
|
|
4192
4119
|
}
|
|
4193
4120
|
|
|
4194
4121
|
// src/react/components/AssociationWindow.tsx
|
|
4195
|
-
var
|
|
4122
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
4196
4123
|
function AssociationWindow({
|
|
4197
4124
|
open,
|
|
4198
4125
|
onClose,
|
|
@@ -4205,16 +4132,16 @@ function AssociationWindow({
|
|
|
4205
4132
|
const instanceId = (0, import_react13.useId)();
|
|
4206
4133
|
const { windowShell } = useAssociationsUiPorts();
|
|
4207
4134
|
if (!open) return null;
|
|
4208
|
-
const body = /* @__PURE__ */ (0,
|
|
4209
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
4135
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex h-full min-h-0 flex-col gap-2 p-3", children: [
|
|
4136
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "shrink-0 text-xs text-muted-foreground", children: subtitle }) : null,
|
|
4210
4137
|
children
|
|
4211
4138
|
] });
|
|
4212
4139
|
const windowId = `association:${scopeId}:${instanceId}`;
|
|
4213
4140
|
if (windowShell) {
|
|
4214
4141
|
const HostWindow = windowShell.Window;
|
|
4215
|
-
return /* @__PURE__ */ (0,
|
|
4142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HostWindow, { id: windowId, title, onClose, children: body });
|
|
4216
4143
|
}
|
|
4217
|
-
return /* @__PURE__ */ (0,
|
|
4144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
4218
4145
|
DefaultWindowShell,
|
|
4219
4146
|
{
|
|
4220
4147
|
id: windowId,
|
|
@@ -4229,28 +4156,28 @@ function AssociationWindow({
|
|
|
4229
4156
|
// src/react/components/AssociationPicker.tsx
|
|
4230
4157
|
var import_react14 = require("react");
|
|
4231
4158
|
var import_design_system3 = require("@ai-matrx/design-system");
|
|
4232
|
-
var
|
|
4233
|
-
var
|
|
4159
|
+
var import_icons5 = require("@ai-matrx/design-system/icons");
|
|
4160
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
4234
4161
|
function AssociationPicker(props) {
|
|
4235
4162
|
const store = useAssociationsStore();
|
|
4236
4163
|
const { pickerOverrides } = useAssociationsUiPorts();
|
|
4237
4164
|
const info = store.registry.getEntityInfo(props.token);
|
|
4238
4165
|
const Icon = info.Icon ?? DefaultEntityIcon;
|
|
4239
4166
|
const Override = pickerOverrides?.[props.token];
|
|
4240
|
-
if (Override) return /* @__PURE__ */ (0,
|
|
4167
|
+
if (Override) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Override, { ...props });
|
|
4241
4168
|
const title = `Add ${info.labelPlural}`;
|
|
4242
4169
|
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";
|
|
4243
4170
|
if (!props.open) return null;
|
|
4244
|
-
return /* @__PURE__ */ (0,
|
|
4171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4245
4172
|
AssociationWindow,
|
|
4246
4173
|
{
|
|
4247
4174
|
open: props.open,
|
|
4248
4175
|
onClose: () => props.onOpenChange(false),
|
|
4249
4176
|
scopeId: `picker:${props.token}`,
|
|
4250
4177
|
title,
|
|
4251
|
-
icon: /* @__PURE__ */ (0,
|
|
4178
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { className: "size-3.5 text-primary" }),
|
|
4252
4179
|
subtitle,
|
|
4253
|
-
children: /* @__PURE__ */ (0,
|
|
4180
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4254
4181
|
AssociationCandidateBody,
|
|
4255
4182
|
{
|
|
4256
4183
|
token: props.token,
|
|
@@ -4275,7 +4202,7 @@ function AssociationCandidateBody({
|
|
|
4275
4202
|
onClose
|
|
4276
4203
|
}) {
|
|
4277
4204
|
void onClose;
|
|
4278
|
-
return /* @__PURE__ */ (0,
|
|
4205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4279
4206
|
EntityCandidateList,
|
|
4280
4207
|
{
|
|
4281
4208
|
token,
|
|
@@ -4335,10 +4262,10 @@ function EntityCandidateList({
|
|
|
4335
4262
|
setBusyId(null);
|
|
4336
4263
|
}
|
|
4337
4264
|
};
|
|
4338
|
-
return /* @__PURE__ */ (0,
|
|
4339
|
-
/* @__PURE__ */ (0,
|
|
4340
|
-
/* @__PURE__ */ (0,
|
|
4341
|
-
/* @__PURE__ */ (0,
|
|
4265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
4266
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "relative mb-2", children: [
|
|
4267
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons5.SearchIcon, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }),
|
|
4268
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4342
4269
|
import_design_system3.Input,
|
|
4343
4270
|
{
|
|
4344
4271
|
autoFocus: true,
|
|
@@ -4350,8 +4277,8 @@ function EntityCandidateList({
|
|
|
4350
4277
|
}
|
|
4351
4278
|
)
|
|
4352
4279
|
] }),
|
|
4353
|
-
/* @__PURE__ */ (0,
|
|
4354
|
-
!search.trim() && !error && /* @__PURE__ */ (0,
|
|
4280
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex-1 min-h-0 overflow-y-auto -mx-1 px-1", children: [
|
|
4281
|
+
!search.trim() && !error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4355
4282
|
SearchFailureNotice,
|
|
4356
4283
|
{
|
|
4357
4284
|
error: null,
|
|
@@ -4361,13 +4288,13 @@ function EntityCandidateList({
|
|
|
4361
4288
|
className: "mb-1"
|
|
4362
4289
|
}
|
|
4363
4290
|
),
|
|
4364
|
-
(loading || recentsLoading) && visibleCount === 0 ? /* @__PURE__ */ (0,
|
|
4365
|
-
/* @__PURE__ */ (0,
|
|
4291
|
+
(loading || recentsLoading) && visibleCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(ListMessage, { children: [
|
|
4292
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SpinnerIcon, { className: "h-4 w-4 animate-spin" }),
|
|
4366
4293
|
"Loading\u2026"
|
|
4367
|
-
] }) : error ? /* @__PURE__ */ (0,
|
|
4368
|
-
/* @__PURE__ */ (0,
|
|
4369
|
-
/* @__PURE__ */ (0,
|
|
4370
|
-
/* @__PURE__ */ (0,
|
|
4294
|
+
] }) : error ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: [
|
|
4295
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "font-medium", children: "Couldn\u2019t load items" }),
|
|
4296
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "opacity-80", children: error }),
|
|
4297
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4371
4298
|
"button",
|
|
4372
4299
|
{
|
|
4373
4300
|
type: "button",
|
|
@@ -4376,32 +4303,32 @@ function EntityCandidateList({
|
|
|
4376
4303
|
children: "Retry"
|
|
4377
4304
|
}
|
|
4378
4305
|
)
|
|
4379
|
-
] }) : visibleCount === 0 ? /* @__PURE__ */ (0,
|
|
4380
|
-
visibleRecents.length > 0 && /* @__PURE__ */ (0,
|
|
4306
|
+
] }) : visibleCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ListMessage, { children: canCreate ? `Nothing to attach yet \u2014 create a new ${info.label.toLowerCase()} below.` : "Nothing to attach." }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "space-y-2", children: [
|
|
4307
|
+
visibleRecents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4381
4308
|
CandidateSection,
|
|
4382
4309
|
{
|
|
4383
4310
|
label: "Recent",
|
|
4384
4311
|
candidates: visibleRecents,
|
|
4385
4312
|
attachedIds,
|
|
4386
4313
|
busyId,
|
|
4387
|
-
icon: /* @__PURE__ */ (0,
|
|
4314
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
4388
4315
|
onToggle: toggle
|
|
4389
4316
|
}
|
|
4390
4317
|
),
|
|
4391
|
-
ordinaryCandidates.length > 0 && /* @__PURE__ */ (0,
|
|
4318
|
+
ordinaryCandidates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4392
4319
|
CandidateSection,
|
|
4393
4320
|
{
|
|
4394
4321
|
label: visibleRecents.length > 0 ? `All ${info.labelPlural}` : null,
|
|
4395
4322
|
candidates: ordinaryCandidates,
|
|
4396
4323
|
attachedIds,
|
|
4397
4324
|
busyId,
|
|
4398
|
-
icon: /* @__PURE__ */ (0,
|
|
4325
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
4399
4326
|
onToggle: toggle
|
|
4400
4327
|
}
|
|
4401
4328
|
)
|
|
4402
4329
|
] })
|
|
4403
4330
|
] }),
|
|
4404
|
-
canCreate && /* @__PURE__ */ (0,
|
|
4331
|
+
canCreate && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4405
4332
|
CreateAndAttachFooter,
|
|
4406
4333
|
{
|
|
4407
4334
|
token,
|
|
@@ -4421,12 +4348,12 @@ function CandidateSection({
|
|
|
4421
4348
|
icon,
|
|
4422
4349
|
onToggle
|
|
4423
4350
|
}) {
|
|
4424
|
-
return /* @__PURE__ */ (0,
|
|
4425
|
-
label && /* @__PURE__ */ (0,
|
|
4426
|
-
/* @__PURE__ */ (0,
|
|
4351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "space-y-0.5", children: [
|
|
4352
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/60", children: label }),
|
|
4353
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { className: "space-y-0.5", children: candidates.map((candidate) => {
|
|
4427
4354
|
const attached = attachedIds.has(candidate.id);
|
|
4428
4355
|
const busy = busyId === candidate.id;
|
|
4429
|
-
return /* @__PURE__ */ (0,
|
|
4356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
4430
4357
|
"button",
|
|
4431
4358
|
{
|
|
4432
4359
|
type: "button",
|
|
@@ -4439,15 +4366,15 @@ function CandidateSection({
|
|
|
4439
4366
|
),
|
|
4440
4367
|
children: [
|
|
4441
4368
|
icon,
|
|
4442
|
-
/* @__PURE__ */ (0,
|
|
4443
|
-
/* @__PURE__ */ (0,
|
|
4369
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "flex-1 min-w-0 truncate text-foreground", children: candidate.title }),
|
|
4370
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4444
4371
|
"span",
|
|
4445
4372
|
{
|
|
4446
4373
|
className: (0, import_design_system3.cn)(
|
|
4447
4374
|
"flex h-5 w-5 items-center justify-center rounded-full shrink-0",
|
|
4448
4375
|
attached ? "bg-primary text-primary-foreground" : "border border-border text-muted-foreground group-hover:border-primary/60"
|
|
4449
4376
|
),
|
|
4450
|
-
children: busy ? /* @__PURE__ */ (0,
|
|
4377
|
+
children: busy ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }) : attached ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons5.CheckIcon, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons5.PlusIcon, { className: "h-3 w-3" })
|
|
4451
4378
|
}
|
|
4452
4379
|
)
|
|
4453
4380
|
]
|
|
@@ -4503,7 +4430,7 @@ function CreateAndAttachFooter({
|
|
|
4503
4430
|
}
|
|
4504
4431
|
};
|
|
4505
4432
|
if (!editing) {
|
|
4506
|
-
return /* @__PURE__ */ (0,
|
|
4433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
4507
4434
|
"button",
|
|
4508
4435
|
{
|
|
4509
4436
|
type: "button",
|
|
@@ -4513,10 +4440,10 @@ function CreateAndAttachFooter({
|
|
|
4513
4440
|
},
|
|
4514
4441
|
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",
|
|
4515
4442
|
children: [
|
|
4516
|
-
/* @__PURE__ */ (0,
|
|
4443
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons5.PlusIcon, { className: "h-4 w-4" }),
|
|
4517
4444
|
"New ",
|
|
4518
4445
|
info.label,
|
|
4519
|
-
seed ? /* @__PURE__ */ (0,
|
|
4446
|
+
seed ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "max-w-40 truncate text-muted-foreground/70", children: [
|
|
4520
4447
|
"\u201C",
|
|
4521
4448
|
seed,
|
|
4522
4449
|
"\u201D"
|
|
@@ -4525,8 +4452,8 @@ function CreateAndAttachFooter({
|
|
|
4525
4452
|
}
|
|
4526
4453
|
);
|
|
4527
4454
|
}
|
|
4528
|
-
return /* @__PURE__ */ (0,
|
|
4529
|
-
/* @__PURE__ */ (0,
|
|
4455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mt-2 flex shrink-0 items-center gap-1.5", children: [
|
|
4456
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4530
4457
|
import_design_system3.Input,
|
|
4531
4458
|
{
|
|
4532
4459
|
autoFocus: true,
|
|
@@ -4545,17 +4472,17 @@ function CreateAndAttachFooter({
|
|
|
4545
4472
|
style: { fontSize: 16 }
|
|
4546
4473
|
}
|
|
4547
4474
|
),
|
|
4548
|
-
/* @__PURE__ */ (0,
|
|
4475
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4549
4476
|
"button",
|
|
4550
4477
|
{
|
|
4551
4478
|
type: "button",
|
|
4552
4479
|
disabled: busy || !name.trim(),
|
|
4553
4480
|
onClick: () => void submit(),
|
|
4554
4481
|
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",
|
|
4555
|
-
children: busy ? /* @__PURE__ */ (0,
|
|
4482
|
+
children: busy ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SpinnerIcon, { className: "h-3.5 w-3.5 animate-spin" }) : "Create"
|
|
4556
4483
|
}
|
|
4557
4484
|
),
|
|
4558
|
-
/* @__PURE__ */ (0,
|
|
4485
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4559
4486
|
"button",
|
|
4560
4487
|
{
|
|
4561
4488
|
type: "button",
|
|
@@ -4566,35 +4493,35 @@ function CreateAndAttachFooter({
|
|
|
4566
4493
|
},
|
|
4567
4494
|
title: "Cancel",
|
|
4568
4495
|
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",
|
|
4569
|
-
children: /* @__PURE__ */ (0,
|
|
4496
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons5.XIcon, { className: "h-4 w-4" })
|
|
4570
4497
|
}
|
|
4571
4498
|
)
|
|
4572
4499
|
] });
|
|
4573
4500
|
}
|
|
4574
4501
|
function ListMessage({ children }) {
|
|
4575
|
-
return /* @__PURE__ */ (0,
|
|
4502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex items-center justify-center gap-2 py-8 text-[13px] text-muted-foreground", children });
|
|
4576
4503
|
}
|
|
4577
4504
|
|
|
4578
4505
|
// src/react/components/UniversalAssociationPicker.tsx
|
|
4579
4506
|
var import_react15 = require("react");
|
|
4580
4507
|
var import_design_system5 = require("@ai-matrx/design-system");
|
|
4581
|
-
var
|
|
4508
|
+
var import_icons8 = require("@ai-matrx/design-system/icons");
|
|
4582
4509
|
|
|
4583
4510
|
// src/react/components/entityDoors.tsx
|
|
4584
4511
|
var import_design_system4 = require("@ai-matrx/design-system");
|
|
4585
|
-
var
|
|
4512
|
+
var import_icons6 = require("@ai-matrx/design-system/icons");
|
|
4586
4513
|
var import_outbound_react = require("@ai-matrx/kit/outbound-react");
|
|
4587
|
-
var
|
|
4514
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
4588
4515
|
function DoorRef(props) {
|
|
4589
4516
|
const { onOpen, ...refProps } = props;
|
|
4590
4517
|
const { entityDoors } = useAssociationsUiPorts();
|
|
4591
4518
|
const store = useAssociationsStore();
|
|
4592
4519
|
const HostRef = entityDoors?.EntityRef;
|
|
4593
|
-
if (HostRef) return /* @__PURE__ */ (0,
|
|
4520
|
+
if (HostRef) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HostRef, { ...refProps });
|
|
4594
4521
|
const name = refProps.name ?? null;
|
|
4595
4522
|
const href = store.registry.tryGetEntityInfo(refProps.token)?.hrefFor?.(refProps.id) ?? null;
|
|
4596
4523
|
if (onOpen) {
|
|
4597
|
-
return /* @__PURE__ */ (0,
|
|
4524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
4598
4525
|
"button",
|
|
4599
4526
|
{
|
|
4600
4527
|
type: "button",
|
|
@@ -4608,7 +4535,7 @@ function DoorRef(props) {
|
|
|
4608
4535
|
);
|
|
4609
4536
|
}
|
|
4610
4537
|
if (href) {
|
|
4611
|
-
return /* @__PURE__ */ (0,
|
|
4538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
4612
4539
|
"a",
|
|
4613
4540
|
{
|
|
4614
4541
|
href,
|
|
@@ -4619,19 +4546,19 @@ function DoorRef(props) {
|
|
|
4619
4546
|
refProps.className
|
|
4620
4547
|
),
|
|
4621
4548
|
children: [
|
|
4622
|
-
/* @__PURE__ */ (0,
|
|
4623
|
-
/* @__PURE__ */ (0,
|
|
4549
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "min-w-0 truncate", children: name }),
|
|
4550
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons6.ExternalLinkIcon, { className: "h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-60" })
|
|
4624
4551
|
]
|
|
4625
4552
|
}
|
|
4626
4553
|
);
|
|
4627
4554
|
}
|
|
4628
|
-
return /* @__PURE__ */ (0,
|
|
4555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: (0, import_design_system4.cn)("min-w-0 truncate", refProps.className), children: name });
|
|
4629
4556
|
}
|
|
4630
4557
|
function UnresolvedRef({ token, id }) {
|
|
4631
4558
|
const { entityDoors } = useAssociationsUiPorts();
|
|
4632
4559
|
const HostUnresolved = entityDoors?.UnresolvedRef;
|
|
4633
|
-
if (HostUnresolved) return /* @__PURE__ */ (0,
|
|
4634
|
-
return /* @__PURE__ */ (0,
|
|
4560
|
+
if (HostUnresolved) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HostUnresolved, { token, id });
|
|
4561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
4635
4562
|
"span",
|
|
4636
4563
|
{
|
|
4637
4564
|
className: "inline-flex items-center rounded border border-border/60 bg-muted/40 px-1.5 py-0.5 text-[11px] text-muted-foreground",
|
|
@@ -4644,11 +4571,11 @@ function DoorControlsSlot(props) {
|
|
|
4644
4571
|
const { entityDoors } = useAssociationsUiPorts();
|
|
4645
4572
|
const store = useAssociationsStore();
|
|
4646
4573
|
const HostControls = entityDoors?.DoorControls;
|
|
4647
|
-
if (HostControls) return /* @__PURE__ */ (0,
|
|
4574
|
+
if (HostControls) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HostControls, { ...props });
|
|
4648
4575
|
const href = store.registry.tryGetEntityInfo(props.token)?.hrefFor?.(props.id) ?? null;
|
|
4649
4576
|
if (!href) return null;
|
|
4650
4577
|
const label = props.name ? `Open ${props.name}` : `Open this ${props.token}`;
|
|
4651
|
-
return /* @__PURE__ */ (0,
|
|
4578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
4652
4579
|
import_outbound_react.OutboundLink,
|
|
4653
4580
|
{
|
|
4654
4581
|
href,
|
|
@@ -4658,13 +4585,13 @@ function DoorControlsSlot(props) {
|
|
|
4658
4585
|
"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
4659
4586
|
props.className
|
|
4660
4587
|
),
|
|
4661
|
-
children: /* @__PURE__ */ (0,
|
|
4588
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons6.ExternalLinkIcon, { className: "h-3 w-3" })
|
|
4662
4589
|
}
|
|
4663
4590
|
);
|
|
4664
4591
|
}
|
|
4665
4592
|
|
|
4666
4593
|
// src/react/components/UniversalAssociationPicker.tsx
|
|
4667
|
-
var
|
|
4594
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
4668
4595
|
function attachedKey(token, id) {
|
|
4669
4596
|
return `${token}:${id}`;
|
|
4670
4597
|
}
|
|
@@ -4719,10 +4646,10 @@ function UniversalAssociationPicker(props) {
|
|
|
4719
4646
|
groups.set(r.token, list);
|
|
4720
4647
|
}
|
|
4721
4648
|
const BrowseOverride = browseToken ? pickerOverrides?.[browseToken] : void 0;
|
|
4722
|
-
return /* @__PURE__ */ (0,
|
|
4723
|
-
/* @__PURE__ */ (0,
|
|
4724
|
-
/* @__PURE__ */ (0,
|
|
4725
|
-
/* @__PURE__ */ (0,
|
|
4649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_design_system5.cn)("flex min-h-0 flex-1 flex-col gap-2", className), children: [
|
|
4650
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative", children: [
|
|
4651
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons8.SearchIcon, { className: "absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
4652
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
4726
4653
|
import_design_system5.Input,
|
|
4727
4654
|
{
|
|
4728
4655
|
autoFocus: true,
|
|
@@ -4736,9 +4663,9 @@ function UniversalAssociationPicker(props) {
|
|
|
4736
4663
|
style: { fontSize: 16 }
|
|
4737
4664
|
}
|
|
4738
4665
|
),
|
|
4739
|
-
loading && browseToken === null && /* @__PURE__ */ (0,
|
|
4666
|
+
loading && browseToken === null && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SpinnerIcon, { className: "absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 animate-spin text-muted-foreground" })
|
|
4740
4667
|
] }),
|
|
4741
|
-
/* @__PURE__ */ (0,
|
|
4668
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
4742
4669
|
"div",
|
|
4743
4670
|
{
|
|
4744
4671
|
role: "group",
|
|
@@ -4748,7 +4675,7 @@ function UniversalAssociationPicker(props) {
|
|
|
4748
4675
|
const info = store.registry.getEntityInfo(t);
|
|
4749
4676
|
const ChipIcon = info.Icon ?? DefaultEntityIcon;
|
|
4750
4677
|
const active = browseToken === t;
|
|
4751
|
-
return /* @__PURE__ */ (0,
|
|
4678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
4752
4679
|
"button",
|
|
4753
4680
|
{
|
|
4754
4681
|
type: "button",
|
|
@@ -4759,7 +4686,7 @@ function UniversalAssociationPicker(props) {
|
|
|
4759
4686
|
active ? "border-primary/50 bg-primary/10 text-foreground" : "border-border text-muted-foreground hover:text-foreground hover:bg-accent"
|
|
4760
4687
|
),
|
|
4761
4688
|
children: [
|
|
4762
|
-
/* @__PURE__ */ (0,
|
|
4689
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ChipIcon, { className: "h-3 w-3" }),
|
|
4763
4690
|
info.labelPlural
|
|
4764
4691
|
]
|
|
4765
4692
|
},
|
|
@@ -4772,17 +4699,17 @@ function UniversalAssociationPicker(props) {
|
|
|
4772
4699
|
// The token's canonical host picker (e.g. the stored-files browser)
|
|
4773
4700
|
// owns per-token browsing when registered — never a plain list twin.
|
|
4774
4701
|
// It opens in its own window; this body says where it went.
|
|
4775
|
-
/* @__PURE__ */ (0,
|
|
4702
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
4776
4703
|
"div",
|
|
4777
4704
|
{
|
|
4778
4705
|
role: "region",
|
|
4779
4706
|
"aria-label": `${store.registry.getEntityInfo(browseToken).labelPlural} window`,
|
|
4780
4707
|
className: "flex flex-1 flex-col items-center justify-center gap-3 px-4 py-8 text-center",
|
|
4781
4708
|
children: [
|
|
4782
|
-
/* @__PURE__ */ (0,
|
|
4783
|
-
/* @__PURE__ */ (0,
|
|
4784
|
-
/* @__PURE__ */ (0,
|
|
4785
|
-
/* @__PURE__ */ (0,
|
|
4709
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("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.` }),
|
|
4710
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("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." }),
|
|
4711
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-wrap items-center justify-center gap-2", children: [
|
|
4712
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
4786
4713
|
import_design_system5.Button,
|
|
4787
4714
|
{
|
|
4788
4715
|
type: "button",
|
|
@@ -4793,12 +4720,12 @@ function UniversalAssociationPicker(props) {
|
|
|
4793
4720
|
setOverrideMount((n) => n + 1);
|
|
4794
4721
|
},
|
|
4795
4722
|
children: [
|
|
4796
|
-
/* @__PURE__ */ (0,
|
|
4723
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons8.Maximize2Icon, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
4797
4724
|
overrideOpen ? "Bring window to front" : "Reopen window"
|
|
4798
4725
|
]
|
|
4799
4726
|
}
|
|
4800
4727
|
),
|
|
4801
|
-
/* @__PURE__ */ (0,
|
|
4728
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
4802
4729
|
import_design_system5.Button,
|
|
4803
4730
|
{
|
|
4804
4731
|
type: "button",
|
|
@@ -4809,7 +4736,7 @@ function UniversalAssociationPicker(props) {
|
|
|
4809
4736
|
}
|
|
4810
4737
|
)
|
|
4811
4738
|
] }),
|
|
4812
|
-
overrideOpen && /* @__PURE__ */ (0,
|
|
4739
|
+
overrideOpen && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
4813
4740
|
BrowseOverride,
|
|
4814
4741
|
{
|
|
4815
4742
|
open: true,
|
|
@@ -4829,7 +4756,7 @@ function UniversalAssociationPicker(props) {
|
|
|
4829
4756
|
]
|
|
4830
4757
|
}
|
|
4831
4758
|
)
|
|
4832
|
-
) : browseToken ? /* @__PURE__ */ (0,
|
|
4759
|
+
) : browseToken ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
4833
4760
|
AssociationCandidateBody,
|
|
4834
4761
|
{
|
|
4835
4762
|
token: browseToken,
|
|
@@ -4842,13 +4769,13 @@ function UniversalAssociationPicker(props) {
|
|
|
4842
4769
|
onAttach: (id, title) => onAttach(browseToken, id, title),
|
|
4843
4770
|
onDetach: (id) => onDetach(browseToken, id)
|
|
4844
4771
|
}
|
|
4845
|
-
) }) : /* @__PURE__ */ (0,
|
|
4772
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
4846
4773
|
"div",
|
|
4847
4774
|
{
|
|
4848
4775
|
role: "region",
|
|
4849
4776
|
"aria-label": "Association search results",
|
|
4850
4777
|
className: "-mx-1 min-h-24 flex-1 overflow-y-auto overscroll-contain px-1",
|
|
4851
|
-
children: error ? /* @__PURE__ */ (0,
|
|
4778
|
+
children: error ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
4852
4779
|
SearchFailureNotice,
|
|
4853
4780
|
{
|
|
4854
4781
|
error,
|
|
@@ -4856,8 +4783,8 @@ function UniversalAssociationPicker(props) {
|
|
|
4856
4783
|
operation: "Search to attach",
|
|
4857
4784
|
origin: "associations/UniversalAssociationPicker"
|
|
4858
4785
|
}
|
|
4859
|
-
) : results.length === 0 && failures.length === 0 ? /* @__PURE__ */ (0,
|
|
4860
|
-
/* @__PURE__ */ (0,
|
|
4786
|
+
) : results.length === 0 && failures.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("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__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "space-y-2", children: [
|
|
4787
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
4861
4788
|
SearchFailureNotice,
|
|
4862
4789
|
{
|
|
4863
4790
|
error: null,
|
|
@@ -4866,20 +4793,20 @@ function UniversalAssociationPicker(props) {
|
|
|
4866
4793
|
origin: "associations/UniversalAssociationPicker"
|
|
4867
4794
|
}
|
|
4868
4795
|
),
|
|
4869
|
-
source !== "search" && results.length > 0 && /* @__PURE__ */ (0,
|
|
4796
|
+
source !== "search" && results.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/60", children: source === "recents" ? "Recent" : "Browse" }),
|
|
4870
4797
|
[...groups.entries()].map(([token, items]) => {
|
|
4871
4798
|
const info = store.registry.getEntityInfo(token);
|
|
4872
4799
|
const GroupIcon = info.Icon ?? DefaultEntityIcon;
|
|
4873
|
-
return /* @__PURE__ */ (0,
|
|
4874
|
-
/* @__PURE__ */ (0,
|
|
4875
|
-
/* @__PURE__ */ (0,
|
|
4800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "space-y-0.5", children: [
|
|
4801
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("p", { className: "flex items-center gap-1 px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/70", children: [
|
|
4802
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GroupIcon, { className: "h-3 w-3" }),
|
|
4876
4803
|
info.labelPlural
|
|
4877
4804
|
] }),
|
|
4878
|
-
/* @__PURE__ */ (0,
|
|
4805
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { className: "space-y-0.5", children: items.map((c) => {
|
|
4879
4806
|
const key = attachedKey(c.token, c.id);
|
|
4880
4807
|
const attached = attachedKeys.has(key);
|
|
4881
4808
|
const busy = busyKey === key;
|
|
4882
|
-
return /* @__PURE__ */ (0,
|
|
4809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
4883
4810
|
"li",
|
|
4884
4811
|
{
|
|
4885
4812
|
className: (0, import_design_system5.cn)(
|
|
@@ -4888,7 +4815,7 @@ function UniversalAssociationPicker(props) {
|
|
|
4888
4815
|
attached && "bg-accent/40"
|
|
4889
4816
|
),
|
|
4890
4817
|
children: [
|
|
4891
|
-
/* @__PURE__ */ (0,
|
|
4818
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
4892
4819
|
"button",
|
|
4893
4820
|
{
|
|
4894
4821
|
type: "button",
|
|
@@ -4900,21 +4827,21 @@ function UniversalAssociationPicker(props) {
|
|
|
4900
4827
|
"disabled:opacity-50"
|
|
4901
4828
|
),
|
|
4902
4829
|
children: [
|
|
4903
|
-
/* @__PURE__ */ (0,
|
|
4904
|
-
/* @__PURE__ */ (0,
|
|
4830
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "min-w-0 flex-1 truncate text-foreground", children: c.title }),
|
|
4831
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
4905
4832
|
"span",
|
|
4906
4833
|
{
|
|
4907
4834
|
className: (0, import_design_system5.cn)(
|
|
4908
4835
|
"flex h-5 w-5 shrink-0 items-center justify-center rounded-full",
|
|
4909
4836
|
attached ? "bg-primary text-primary-foreground" : "border border-border text-muted-foreground group-hover:border-primary/60"
|
|
4910
4837
|
),
|
|
4911
|
-
children: busy ? /* @__PURE__ */ (0,
|
|
4838
|
+
children: busy ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }) : attached ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons8.CheckIcon, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons8.PlusIcon, { className: "h-3 w-3" })
|
|
4912
4839
|
}
|
|
4913
4840
|
)
|
|
4914
4841
|
]
|
|
4915
4842
|
}
|
|
4916
4843
|
),
|
|
4917
|
-
/* @__PURE__ */ (0,
|
|
4844
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
4918
4845
|
DoorControlsSlot,
|
|
4919
4846
|
{
|
|
4920
4847
|
token: c.token,
|
|
@@ -4938,8 +4865,8 @@ function UniversalAssociationPicker(props) {
|
|
|
4938
4865
|
// src/react/components/AttachedItemsSheet.tsx
|
|
4939
4866
|
var import_react16 = require("react");
|
|
4940
4867
|
var import_design_system6 = require("@ai-matrx/design-system");
|
|
4941
|
-
var
|
|
4942
|
-
var
|
|
4868
|
+
var import_icons10 = require("@ai-matrx/design-system/icons");
|
|
4869
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
4943
4870
|
function metadataIsPinned(metadata) {
|
|
4944
4871
|
return metadata !== null && typeof metadata === "object" && !Array.isArray(metadata) && Reflect.get(metadata, "pinned") === true;
|
|
4945
4872
|
}
|
|
@@ -4950,9 +4877,9 @@ function AttachedItemsSheet(props) {
|
|
|
4950
4877
|
const title = info.labelPlural;
|
|
4951
4878
|
const containerName = props.container?.label ?? props.containerLabel;
|
|
4952
4879
|
const filing = props.container?.direction === "outgoing";
|
|
4953
|
-
const subtitle = props.container ? /* @__PURE__ */ (0,
|
|
4880
|
+
const subtitle = props.container ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "inline-flex min-w-0 max-w-full items-center gap-1", children: [
|
|
4954
4881
|
filing ? "What this is filed under:" : "Attached to",
|
|
4955
|
-
/* @__PURE__ */ (0,
|
|
4882
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
4956
4883
|
DoorRef,
|
|
4957
4884
|
{
|
|
4958
4885
|
token: props.container.type,
|
|
@@ -4963,16 +4890,16 @@ function AttachedItemsSheet(props) {
|
|
|
4963
4890
|
)
|
|
4964
4891
|
] }) : props.containerLabel ? `Attached to ${props.containerLabel}` : "Attached items";
|
|
4965
4892
|
if (!props.open) return null;
|
|
4966
|
-
return /* @__PURE__ */ (0,
|
|
4893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
4967
4894
|
AssociationWindow,
|
|
4968
4895
|
{
|
|
4969
4896
|
open: props.open,
|
|
4970
4897
|
onClose: () => props.onOpenChange(false),
|
|
4971
4898
|
scopeId: `attached:${props.token}`,
|
|
4972
4899
|
title,
|
|
4973
|
-
icon: /* @__PURE__ */ (0,
|
|
4900
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { className: "size-3.5 text-primary" }),
|
|
4974
4901
|
subtitle,
|
|
4975
|
-
children: /* @__PURE__ */ (0,
|
|
4902
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
4976
4903
|
AttachedItemsBody,
|
|
4977
4904
|
{
|
|
4978
4905
|
token: props.token,
|
|
@@ -5061,31 +4988,31 @@ function AttachedItemsBody({
|
|
|
5061
4988
|
setBusyId(null);
|
|
5062
4989
|
}
|
|
5063
4990
|
};
|
|
5064
|
-
return /* @__PURE__ */ (0,
|
|
5065
|
-
titleError ? /* @__PURE__ */ (0,
|
|
4991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
4992
|
+
titleError ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mb-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: [
|
|
5066
4993
|
"Showing names recorded at attach time \u2014 they may be out of date.",
|
|
5067
4994
|
" ",
|
|
5068
4995
|
titleError
|
|
5069
4996
|
] }) : null,
|
|
5070
|
-
/* @__PURE__ */ (0,
|
|
5071
|
-
/* @__PURE__ */ (0,
|
|
4997
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex-1 min-h-0 overflow-y-auto -mx-1 px-1", children: links.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex items-center justify-center py-8 text-[13px] text-muted-foreground", children: "Nothing attached yet." }) : titles === null ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-center gap-2 py-8 text-[13px] text-muted-foreground", children: [
|
|
4998
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SpinnerIcon, { className: "h-4 w-4 animate-spin" }),
|
|
5072
4999
|
"Loading\u2026"
|
|
5073
|
-
] }) : /* @__PURE__ */ (0,
|
|
5000
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("ul", { className: "space-y-0.5", children: links.map((link) => {
|
|
5074
5001
|
const resolved = titles.get(link.resourceId);
|
|
5075
5002
|
const missing = !titles.has(link.resourceId);
|
|
5076
5003
|
const name = resolved ?? link.label ?? (missing ? null : "Untitled");
|
|
5077
5004
|
const busy = busyId === link.resourceId;
|
|
5078
5005
|
const pinned = metadataIsPinned(link.metadata);
|
|
5079
|
-
return /* @__PURE__ */ (0,
|
|
5006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
5080
5007
|
"li",
|
|
5081
5008
|
{
|
|
5082
5009
|
className: "group/entity-ref group flex items-center gap-2 rounded-md px-2.5 py-2 text-sm transition-colors hover:bg-accent",
|
|
5083
5010
|
children: [
|
|
5084
|
-
/* @__PURE__ */ (0,
|
|
5085
|
-
/* @__PURE__ */ (0,
|
|
5011
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
5012
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "flex-1 min-w-0 truncate", children: name === null ? (
|
|
5086
5013
|
// The X beside the row stays the one-click detach.
|
|
5087
|
-
/* @__PURE__ */ (0,
|
|
5088
|
-
) : /* @__PURE__ */ (0,
|
|
5014
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(UnresolvedRef, { token, id: link.resourceId })
|
|
5015
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
5089
5016
|
DoorRef,
|
|
5090
5017
|
{
|
|
5091
5018
|
token,
|
|
@@ -5095,7 +5022,7 @@ function AttachedItemsBody({
|
|
|
5095
5022
|
className: "text-foreground"
|
|
5096
5023
|
}
|
|
5097
5024
|
) }),
|
|
5098
|
-
onSetPinned ? /* @__PURE__ */ (0,
|
|
5025
|
+
onSetPinned ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
5099
5026
|
"button",
|
|
5100
5027
|
{
|
|
5101
5028
|
type: "button",
|
|
@@ -5107,8 +5034,8 @@ function AttachedItemsBody({
|
|
|
5107
5034
|
"flex h-6 w-6 shrink-0 items-center justify-center rounded-md transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50",
|
|
5108
5035
|
pinned ? "text-primary" : "text-muted-foreground"
|
|
5109
5036
|
),
|
|
5110
|
-
children: /* @__PURE__ */ (0,
|
|
5111
|
-
|
|
5037
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
5038
|
+
import_icons10.PinIcon,
|
|
5112
5039
|
{
|
|
5113
5040
|
className: (0, import_design_system6.cn)(
|
|
5114
5041
|
"h-3.5 w-3.5",
|
|
@@ -5118,7 +5045,7 @@ function AttachedItemsBody({
|
|
|
5118
5045
|
)
|
|
5119
5046
|
}
|
|
5120
5047
|
) : null,
|
|
5121
|
-
/* @__PURE__ */ (0,
|
|
5048
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
5122
5049
|
"button",
|
|
5123
5050
|
{
|
|
5124
5051
|
type: "button",
|
|
@@ -5129,7 +5056,7 @@ function AttachedItemsBody({
|
|
|
5129
5056
|
"flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors",
|
|
5130
5057
|
"hover:bg-destructive/10 hover:text-destructive disabled:opacity-50"
|
|
5131
5058
|
),
|
|
5132
|
-
children: busy ? /* @__PURE__ */ (0,
|
|
5059
|
+
children: busy ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SpinnerIcon, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_icons10.XIcon, { className: "h-3.5 w-3.5" })
|
|
5133
5060
|
}
|
|
5134
5061
|
)
|
|
5135
5062
|
]
|
|
@@ -5137,14 +5064,14 @@ function AttachedItemsBody({
|
|
|
5137
5064
|
link.edgeId
|
|
5138
5065
|
);
|
|
5139
5066
|
}) }) }),
|
|
5140
|
-
onAdd ? /* @__PURE__ */ (0,
|
|
5067
|
+
onAdd ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
5141
5068
|
"button",
|
|
5142
5069
|
{
|
|
5143
5070
|
type: "button",
|
|
5144
5071
|
onClick: onAdd,
|
|
5145
5072
|
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",
|
|
5146
5073
|
children: [
|
|
5147
|
-
/* @__PURE__ */ (0,
|
|
5074
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_icons10.PlusIcon, { className: "h-4 w-4" }),
|
|
5148
5075
|
"Attach ",
|
|
5149
5076
|
info.labelPlural.toLowerCase()
|
|
5150
5077
|
]
|
|
@@ -5206,8 +5133,8 @@ function getContentRoleMeta(role) {
|
|
|
5206
5133
|
}
|
|
5207
5134
|
|
|
5208
5135
|
// src/react/components/AssociationCard.tsx
|
|
5209
|
-
var
|
|
5210
|
-
var
|
|
5136
|
+
var import_icons12 = require("@ai-matrx/design-system/icons");
|
|
5137
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
5211
5138
|
function AssociationCard({
|
|
5212
5139
|
token,
|
|
5213
5140
|
container: containerProp,
|
|
@@ -5246,7 +5173,7 @@ function AssociationCard({
|
|
|
5246
5173
|
const canDrillIn = count > 0;
|
|
5247
5174
|
const countWord = filing ? "filed under" : "attached";
|
|
5248
5175
|
const drillTitle = canDrillIn ? `View the ${info.labelPlural.toLowerCase()} attached to ${container.label ?? "this"}` : void 0;
|
|
5249
|
-
return /* @__PURE__ */ (0,
|
|
5176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
5250
5177
|
look !== "tiles" ? (
|
|
5251
5178
|
// ONE-LINE LOOKS (opt-in, off by default): small icon, UPPERCASE name,
|
|
5252
5179
|
// count, then the "+".
|
|
@@ -5258,7 +5185,7 @@ function AssociationCard({
|
|
|
5258
5185
|
// so the tap target's own 44px box centers the 28px circle with
|
|
5259
5186
|
// 8px on every side. Never pass a layout class to a tap button —
|
|
5260
5187
|
// its className lands on the ICON (the 2026-09-27 crooked "+").
|
|
5261
|
-
/* @__PURE__ */ (0,
|
|
5188
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
5262
5189
|
"div",
|
|
5263
5190
|
{
|
|
5264
5191
|
"data-association-card": token,
|
|
@@ -5269,7 +5196,7 @@ function AssociationCard({
|
|
|
5269
5196
|
className
|
|
5270
5197
|
),
|
|
5271
5198
|
children: [
|
|
5272
|
-
/* @__PURE__ */ (0,
|
|
5199
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
5273
5200
|
"button",
|
|
5274
5201
|
{
|
|
5275
5202
|
type: "button",
|
|
@@ -5282,13 +5209,13 @@ function AssociationCard({
|
|
|
5282
5209
|
canDrillIn ? "cursor-pointer hover:text-foreground" : "cursor-default"
|
|
5283
5210
|
),
|
|
5284
5211
|
children: [
|
|
5285
|
-
/* @__PURE__ */ (0,
|
|
5286
|
-
/* @__PURE__ */ (0,
|
|
5287
|
-
loading ? /* @__PURE__ */ (0,
|
|
5212
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
5213
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "min-w-0 truncate text-xs font-semibold uppercase tracking-wider text-foreground", children: info.labelPlural }),
|
|
5214
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs tabular-nums text-muted-foreground", children: count })
|
|
5288
5215
|
]
|
|
5289
5216
|
}
|
|
5290
5217
|
),
|
|
5291
|
-
canAttach && (look === "compact" ? /* @__PURE__ */ (0,
|
|
5218
|
+
canAttach && (look === "compact" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5292
5219
|
import_buttons.PlusTapButton,
|
|
5293
5220
|
{
|
|
5294
5221
|
variant: "outline",
|
|
@@ -5296,7 +5223,7 @@ function AssociationCard({
|
|
|
5296
5223
|
tooltip: false,
|
|
5297
5224
|
onClick: () => setOpen(true)
|
|
5298
5225
|
}
|
|
5299
|
-
) : /* @__PURE__ */ (0,
|
|
5226
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5300
5227
|
"button",
|
|
5301
5228
|
{
|
|
5302
5229
|
type: "button",
|
|
@@ -5304,13 +5231,13 @@ function AssociationCard({
|
|
|
5304
5231
|
"aria-label": `Attach ${info.labelPlural.toLowerCase()}`,
|
|
5305
5232
|
title: `Attach ${info.labelPlural.toLowerCase()}`,
|
|
5306
5233
|
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",
|
|
5307
|
-
children: /* @__PURE__ */ (0,
|
|
5234
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_icons12.PlusIcon, { className: "h-4 w-4" })
|
|
5308
5235
|
}
|
|
5309
5236
|
))
|
|
5310
5237
|
]
|
|
5311
5238
|
}
|
|
5312
5239
|
)
|
|
5313
|
-
) : /* @__PURE__ */ (0,
|
|
5240
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
5314
5241
|
"div",
|
|
5315
5242
|
{
|
|
5316
5243
|
"data-association-card": token,
|
|
@@ -5320,7 +5247,7 @@ function AssociationCard({
|
|
|
5320
5247
|
className
|
|
5321
5248
|
),
|
|
5322
5249
|
children: [
|
|
5323
|
-
/* @__PURE__ */ (0,
|
|
5250
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5324
5251
|
"span",
|
|
5325
5252
|
{
|
|
5326
5253
|
className: (0, import_design_system7.cn)(
|
|
@@ -5329,7 +5256,7 @@ function AssociationCard({
|
|
|
5329
5256
|
)
|
|
5330
5257
|
}
|
|
5331
5258
|
),
|
|
5332
|
-
/* @__PURE__ */ (0,
|
|
5259
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
5333
5260
|
"button",
|
|
5334
5261
|
{
|
|
5335
5262
|
type: "button",
|
|
@@ -5341,7 +5268,7 @@ function AssociationCard({
|
|
|
5341
5268
|
canDrillIn ? "cursor-pointer" : "cursor-default"
|
|
5342
5269
|
),
|
|
5343
5270
|
children: [
|
|
5344
|
-
/* @__PURE__ */ (0,
|
|
5271
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5345
5272
|
"span",
|
|
5346
5273
|
{
|
|
5347
5274
|
className: (0, import_design_system7.cn)(
|
|
@@ -5349,20 +5276,20 @@ function AssociationCard({
|
|
|
5349
5276
|
role.accentBg,
|
|
5350
5277
|
role.accentText
|
|
5351
5278
|
),
|
|
5352
|
-
children: /* @__PURE__ */ (0,
|
|
5279
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon, { className: "h-4 w-4" })
|
|
5353
5280
|
}
|
|
5354
5281
|
),
|
|
5355
|
-
/* @__PURE__ */ (0,
|
|
5356
|
-
/* @__PURE__ */ (0,
|
|
5357
|
-
/* @__PURE__ */ (0,
|
|
5358
|
-
/* @__PURE__ */ (0,
|
|
5282
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
5283
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "block truncate text-sm font-medium text-foreground", children: info.labelPlural }),
|
|
5284
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "block text-xs text-muted-foreground tabular-nums", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "inline-flex items-center gap-1", children: [
|
|
5285
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }),
|
|
5359
5286
|
"Loading\u2026"
|
|
5360
5287
|
] }) : `${count} ${countWord}` })
|
|
5361
5288
|
] })
|
|
5362
5289
|
]
|
|
5363
5290
|
}
|
|
5364
5291
|
),
|
|
5365
|
-
canAttach && /* @__PURE__ */ (0,
|
|
5292
|
+
canAttach && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5366
5293
|
"button",
|
|
5367
5294
|
{
|
|
5368
5295
|
type: "button",
|
|
@@ -5370,13 +5297,13 @@ function AssociationCard({
|
|
|
5370
5297
|
"aria-label": `Attach ${info.labelPlural.toLowerCase()}`,
|
|
5371
5298
|
title: `Attach ${info.labelPlural.toLowerCase()}`,
|
|
5372
5299
|
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",
|
|
5373
|
-
children: /* @__PURE__ */ (0,
|
|
5300
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_icons12.PlusIcon, { className: "h-4 w-4" })
|
|
5374
5301
|
}
|
|
5375
5302
|
)
|
|
5376
5303
|
]
|
|
5377
5304
|
}
|
|
5378
5305
|
),
|
|
5379
|
-
listOpen && /* @__PURE__ */ (0,
|
|
5306
|
+
listOpen && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5380
5307
|
AttachedItemsSheet,
|
|
5381
5308
|
{
|
|
5382
5309
|
open: listOpen,
|
|
@@ -5395,7 +5322,7 @@ function AssociationCard({
|
|
|
5395
5322
|
onSetPinned: (resourceId, pinned, role2) => setPinned(token, resourceId, pinned, role2 ?? void 0)
|
|
5396
5323
|
}
|
|
5397
5324
|
),
|
|
5398
|
-
canAttach && /* @__PURE__ */ (0,
|
|
5325
|
+
canAttach && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5399
5326
|
AssociationPicker,
|
|
5400
5327
|
{
|
|
5401
5328
|
open,
|
|
@@ -5414,7 +5341,7 @@ function AssociationCard({
|
|
|
5414
5341
|
|
|
5415
5342
|
// src/react/components/AssociationCardGrid.tsx
|
|
5416
5343
|
var import_design_system8 = require("@ai-matrx/design-system");
|
|
5417
|
-
var
|
|
5344
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
5418
5345
|
var SIMPLE_GROUP_LABEL = "mb-1 text-xs font-medium uppercase tracking-wider text-muted-foreground";
|
|
5419
5346
|
var SIMPLE_TILE_ROW = "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1";
|
|
5420
5347
|
var TILE_GRID = "grid grid-cols-1 gap-2 @md:grid-cols-2 @3xl:grid-cols-3";
|
|
@@ -5423,11 +5350,11 @@ function GroupHeader({
|
|
|
5423
5350
|
title,
|
|
5424
5351
|
dotClassName
|
|
5425
5352
|
}) {
|
|
5426
|
-
if (look !== "tiles") return /* @__PURE__ */ (0,
|
|
5427
|
-
return /* @__PURE__ */ (0,
|
|
5428
|
-
/* @__PURE__ */ (0,
|
|
5429
|
-
/* @__PURE__ */ (0,
|
|
5430
|
-
] }) : /* @__PURE__ */ (0,
|
|
5353
|
+
if (look !== "tiles") return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { className: SIMPLE_GROUP_LABEL, children: title });
|
|
5354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "mb-2.5 flex items-baseline gap-3 pl-1.5", children: dotClassName ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5355
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: (0, import_design_system8.cn)("h-2.5 w-2.5 rounded-full", dotClassName) }),
|
|
5356
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { className: "text-sm font-semibold text-foreground", children: title })
|
|
5357
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { className: "text-sm font-semibold text-foreground", children: title }) });
|
|
5431
5358
|
}
|
|
5432
5359
|
function AssociationCardGrid({
|
|
5433
5360
|
tokens,
|
|
@@ -5440,13 +5367,13 @@ function AssociationCardGrid({
|
|
|
5440
5367
|
const excluded = new Set(excludeTokens ?? []);
|
|
5441
5368
|
const filing = primary?.direction === "outgoing";
|
|
5442
5369
|
const links = useContainerLinks(containerLinksArgs(primary));
|
|
5443
|
-
const
|
|
5370
|
+
const base = tokens ?? store.registry.curatedTokens();
|
|
5444
5371
|
const withPresent = filing ? [
|
|
5445
|
-
...
|
|
5372
|
+
...base,
|
|
5446
5373
|
...links.presentTokens.filter(
|
|
5447
|
-
(t) => isEntityTypeToken(t) && !
|
|
5374
|
+
(t) => isEntityTypeToken(t) && !base.includes(t)
|
|
5448
5375
|
)
|
|
5449
|
-
] :
|
|
5376
|
+
] : base;
|
|
5450
5377
|
const list = withPresent.filter(
|
|
5451
5378
|
(token) => !excluded.has(token) && (!filing || isAssociationTargetType(token))
|
|
5452
5379
|
);
|
|
@@ -5456,7 +5383,7 @@ function AssociationCardGrid({
|
|
|
5456
5383
|
return !role || !roleIds.has(role);
|
|
5457
5384
|
}) : [];
|
|
5458
5385
|
const rowClass = look !== "tiles" ? SIMPLE_TILE_ROW : TILE_GRID;
|
|
5459
|
-
return /* @__PURE__ */ (0,
|
|
5386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
5460
5387
|
"div",
|
|
5461
5388
|
{
|
|
5462
5389
|
"data-association-grid-look": look,
|
|
@@ -5467,8 +5394,8 @@ function AssociationCardGrid({
|
|
|
5467
5394
|
(token) => store.registry.getEntityInfo(token).contentRole === role.id
|
|
5468
5395
|
);
|
|
5469
5396
|
if (inRole.length === 0) return null;
|
|
5470
|
-
return /* @__PURE__ */ (0,
|
|
5471
|
-
/* @__PURE__ */ (0,
|
|
5397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { children: [
|
|
5398
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
5472
5399
|
GroupHeader,
|
|
5473
5400
|
{
|
|
5474
5401
|
look,
|
|
@@ -5476,18 +5403,18 @@ function AssociationCardGrid({
|
|
|
5476
5403
|
dotClassName: role.accentBar
|
|
5477
5404
|
}
|
|
5478
5405
|
),
|
|
5479
|
-
/* @__PURE__ */ (0,
|
|
5406
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: rowClass, children: inRole.map((token) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AssociationCard, { token, look }, token)) })
|
|
5480
5407
|
] }, role.id);
|
|
5481
5408
|
}),
|
|
5482
|
-
roleless.length > 0 && /* @__PURE__ */ (0,
|
|
5483
|
-
/* @__PURE__ */ (0,
|
|
5409
|
+
roleless.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { children: [
|
|
5410
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
5484
5411
|
GroupHeader,
|
|
5485
5412
|
{
|
|
5486
5413
|
look,
|
|
5487
5414
|
title: "Filed under"
|
|
5488
5415
|
}
|
|
5489
5416
|
),
|
|
5490
|
-
/* @__PURE__ */ (0,
|
|
5417
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: rowClass, children: roleless.map((token) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AssociationCard, { token, look }, token)) })
|
|
5491
5418
|
] })
|
|
5492
5419
|
]
|
|
5493
5420
|
}
|
|
@@ -5497,9 +5424,9 @@ function AssociationCardGrid({
|
|
|
5497
5424
|
// src/react/components/AssociationList.tsx
|
|
5498
5425
|
var import_react18 = require("react");
|
|
5499
5426
|
var import_design_system9 = require("@ai-matrx/design-system");
|
|
5500
|
-
var
|
|
5427
|
+
var import_icons14 = require("@ai-matrx/design-system/icons");
|
|
5501
5428
|
var import_outbound = require("@ai-matrx/kit/outbound");
|
|
5502
|
-
var
|
|
5429
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
5503
5430
|
function metadataIsPinned2(metadata) {
|
|
5504
5431
|
return metadata !== null && typeof metadata === "object" && !Array.isArray(metadata) && Reflect.get(metadata, "pinned") === true;
|
|
5505
5432
|
}
|
|
@@ -5610,15 +5537,15 @@ function AssociationList(props) {
|
|
|
5610
5537
|
const grouped = groupRows(store, visibleRows);
|
|
5611
5538
|
const isLoading = adapter.status === "loading" || adapter.status === "idle";
|
|
5612
5539
|
const attachableTokens = tokenFilter ?? store.registry.listableTokens();
|
|
5613
|
-
return /* @__PURE__ */ (0,
|
|
5614
|
-
/* @__PURE__ */ (0,
|
|
5615
|
-
props.title === null ? null : /* @__PURE__ */ (0,
|
|
5616
|
-
/* @__PURE__ */ (0,
|
|
5540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_design_system9.cn)("flex flex-col gap-2 text-foreground", props.className), children: [
|
|
5541
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_design_system9.cn)("flex items-center gap-2 px-1", props.title === null ? "justify-end" : "justify-between"), children: [
|
|
5542
|
+
props.title === null ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("h3", { className: "flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: [
|
|
5543
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Link2Icon, { className: "h-3.5 w-3.5" }),
|
|
5617
5544
|
props.title ?? "Resources",
|
|
5618
|
-
visibleRows.length > 0 && /* @__PURE__ */ (0,
|
|
5545
|
+
visibleRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "rounded bg-muted px-1 text-[10px] font-medium text-muted-foreground", children: visibleRows.length })
|
|
5619
5546
|
] }),
|
|
5620
|
-
/* @__PURE__ */ (0,
|
|
5621
|
-
/* @__PURE__ */ (0,
|
|
5547
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
5548
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
5622
5549
|
"button",
|
|
5623
5550
|
{
|
|
5624
5551
|
type: "button",
|
|
@@ -5628,19 +5555,19 @@ function AssociationList(props) {
|
|
|
5628
5555
|
showUniversal ? "bg-accent text-foreground" : "text-muted-foreground hover:bg-accent hover:text-foreground"
|
|
5629
5556
|
),
|
|
5630
5557
|
children: [
|
|
5631
|
-
/* @__PURE__ */ (0,
|
|
5558
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_icons14.PlusIcon, { className: "h-3 w-3" }),
|
|
5632
5559
|
"Add"
|
|
5633
5560
|
]
|
|
5634
5561
|
}
|
|
5635
5562
|
),
|
|
5636
|
-
/* @__PURE__ */ (0,
|
|
5563
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
5637
5564
|
"button",
|
|
5638
5565
|
{
|
|
5639
5566
|
type: "button",
|
|
5640
5567
|
onClick: () => void adapter.reload(),
|
|
5641
5568
|
title: "Refresh",
|
|
5642
5569
|
className: "text-muted-foreground/60 transition-colors hover:text-foreground",
|
|
5643
|
-
children: /* @__PURE__ */ (0,
|
|
5570
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
5644
5571
|
RefreshIcon,
|
|
5645
5572
|
{
|
|
5646
5573
|
className: (0, import_design_system9.cn)(
|
|
@@ -5653,7 +5580,7 @@ function AssociationList(props) {
|
|
|
5653
5580
|
)
|
|
5654
5581
|
] })
|
|
5655
5582
|
] }),
|
|
5656
|
-
showUniversal && /* @__PURE__ */ (0,
|
|
5583
|
+
showUniversal && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "rounded-md border border-border/60 bg-muted/30 p-2 max-h-80 flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
5657
5584
|
UniversalAssociationPicker,
|
|
5658
5585
|
{
|
|
5659
5586
|
tokens: attachableTokens,
|
|
@@ -5663,9 +5590,9 @@ function AssociationList(props) {
|
|
|
5663
5590
|
onDetach: (token, id) => adapter.detach(token, id)
|
|
5664
5591
|
}
|
|
5665
5592
|
) }),
|
|
5666
|
-
adapter.status === "error" && /* @__PURE__ */ (0,
|
|
5667
|
-
/* @__PURE__ */ (0,
|
|
5668
|
-
/* @__PURE__ */ (0,
|
|
5593
|
+
adapter.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-between gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-2.5 py-2", children: [
|
|
5594
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "truncate text-[11px] text-destructive", children: adapter.error || "Failed to load resources" }),
|
|
5595
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
5669
5596
|
"button",
|
|
5670
5597
|
{
|
|
5671
5598
|
type: "button",
|
|
@@ -5675,17 +5602,17 @@ function AssociationList(props) {
|
|
|
5675
5602
|
}
|
|
5676
5603
|
)
|
|
5677
5604
|
] }),
|
|
5678
|
-
adapter.status !== "error" && isLoading && visibleRows.length === 0 && /* @__PURE__ */ (0,
|
|
5679
|
-
/* @__PURE__ */ (0,
|
|
5680
|
-
/* @__PURE__ */ (0,
|
|
5681
|
-
/* @__PURE__ */ (0,
|
|
5605
|
+
adapter.status !== "error" && isLoading && visibleRows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "space-y-1.5 px-1", children: [
|
|
5606
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system9.Skeleton, { className: "h-3 w-20" }),
|
|
5607
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system9.Skeleton, { className: "h-7 w-full rounded-md" }),
|
|
5608
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system9.Skeleton, { className: "h-7 w-3/4 rounded-md" })
|
|
5682
5609
|
] }),
|
|
5683
|
-
adapter.status === "ready" && visibleRows.length === 0 && /* @__PURE__ */ (0,
|
|
5684
|
-
visibleRows.length > 0 && /* @__PURE__ */ (0,
|
|
5610
|
+
adapter.status === "ready" && visibleRows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "px-1 py-1 text-[11px] text-muted-foreground", children: "Nothing attached yet \u2014 use Add to link anything." }),
|
|
5611
|
+
visibleRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "space-y-2.5", children: grouped.map(({ role, tokens: tokenGroups }) => {
|
|
5685
5612
|
const roleMeta = getContentRoleMeta(role);
|
|
5686
|
-
return /* @__PURE__ */ (0,
|
|
5687
|
-
variant === "full" && /* @__PURE__ */ (0,
|
|
5688
|
-
/* @__PURE__ */ (0,
|
|
5613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "space-y-1.5", children: [
|
|
5614
|
+
variant === "full" && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-1.5 px-1", children: [
|
|
5615
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
5689
5616
|
"span",
|
|
5690
5617
|
{
|
|
5691
5618
|
className: (0, import_design_system9.cn)(
|
|
@@ -5694,7 +5621,7 @@ function AssociationList(props) {
|
|
|
5694
5621
|
)
|
|
5695
5622
|
}
|
|
5696
5623
|
),
|
|
5697
|
-
/* @__PURE__ */ (0,
|
|
5624
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
5698
5625
|
"p",
|
|
5699
5626
|
{
|
|
5700
5627
|
className: (0, import_design_system9.cn)(
|
|
@@ -5707,28 +5634,28 @@ function AssociationList(props) {
|
|
|
5707
5634
|
] }),
|
|
5708
5635
|
tokenGroups.map(({ info, token, rows: tokenRows }) => {
|
|
5709
5636
|
const TokenIcon = info?.Icon ?? null;
|
|
5710
|
-
return /* @__PURE__ */ (0,
|
|
5711
|
-
/* @__PURE__ */ (0,
|
|
5712
|
-
/* @__PURE__ */ (0,
|
|
5713
|
-
TokenIcon ? /* @__PURE__ */ (0,
|
|
5637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "space-y-0.5", children: [
|
|
5638
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-between gap-1 px-1", children: [
|
|
5639
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "flex items-center gap-1 text-[10px] font-medium text-muted-foreground/80", children: [
|
|
5640
|
+
TokenIcon ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TokenIcon, { className: "h-3 w-3" }) : null,
|
|
5714
5641
|
info?.labelPlural ?? titleize(token),
|
|
5715
|
-
/* @__PURE__ */ (0,
|
|
5642
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-muted-foreground/50", children: tokenRows.length })
|
|
5716
5643
|
] }),
|
|
5717
|
-
/* @__PURE__ */ (0,
|
|
5644
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
5718
5645
|
props.renderSectionActions && info ? props.renderSectionActions(info.token) : null,
|
|
5719
|
-
info?.canListCandidates && /* @__PURE__ */ (0,
|
|
5646
|
+
info?.canListCandidates && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
5720
5647
|
"button",
|
|
5721
5648
|
{
|
|
5722
5649
|
type: "button",
|
|
5723
5650
|
onClick: () => setPickerToken(info.token),
|
|
5724
5651
|
title: `Add ${info.labelPlural}`,
|
|
5725
5652
|
className: "rounded p-0.5 text-muted-foreground/60 transition-colors hover:bg-accent hover:text-foreground",
|
|
5726
|
-
children: /* @__PURE__ */ (0,
|
|
5653
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_icons14.PlusIcon, { className: "h-3 w-3" })
|
|
5727
5654
|
}
|
|
5728
5655
|
)
|
|
5729
5656
|
] })
|
|
5730
5657
|
] }),
|
|
5731
|
-
/* @__PURE__ */ (0,
|
|
5658
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { className: "space-y-0.5", children: tokenRows.map((row) => {
|
|
5732
5659
|
const busy = removingKeys.has(row.key);
|
|
5733
5660
|
const custom = props.renderRow?.(row, {
|
|
5734
5661
|
title: titleFor({
|
|
@@ -5741,9 +5668,9 @@ function AssociationList(props) {
|
|
|
5741
5668
|
onOpen: () => openRow(row)
|
|
5742
5669
|
});
|
|
5743
5670
|
if (custom != null) {
|
|
5744
|
-
return /* @__PURE__ */ (0,
|
|
5671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { children: custom }, row.key);
|
|
5745
5672
|
}
|
|
5746
|
-
return /* @__PURE__ */ (0,
|
|
5673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
5747
5674
|
"div",
|
|
5748
5675
|
{
|
|
5749
5676
|
className: (0, import_design_system9.cn)(
|
|
@@ -5755,7 +5682,7 @@ function AssociationList(props) {
|
|
|
5755
5682
|
token: row.token,
|
|
5756
5683
|
id: row.resourceId,
|
|
5757
5684
|
label: row.label
|
|
5758
|
-
}) ? /* @__PURE__ */ (0,
|
|
5685
|
+
}) ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(UnresolvedRef, { token: row.token, id: row.resourceId }) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
5759
5686
|
DoorRef,
|
|
5760
5687
|
{
|
|
5761
5688
|
token: row.token,
|
|
@@ -5771,9 +5698,9 @@ function AssociationList(props) {
|
|
|
5771
5698
|
className: "min-w-0 flex-1 text-foreground"
|
|
5772
5699
|
}
|
|
5773
5700
|
),
|
|
5774
|
-
row.originRefs && row.originRefs.length > 0 ? /* @__PURE__ */ (0,
|
|
5701
|
+
row.originRefs && row.originRefs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground/60", children: [
|
|
5775
5702
|
"via",
|
|
5776
|
-
row.originRefs.map((origin) => /* @__PURE__ */ (0,
|
|
5703
|
+
row.originRefs.map((origin) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
5777
5704
|
DoorRef,
|
|
5778
5705
|
{
|
|
5779
5706
|
token: origin.token,
|
|
@@ -5785,8 +5712,8 @@ function AssociationList(props) {
|
|
|
5785
5712
|
},
|
|
5786
5713
|
`${origin.token}:${origin.id}`
|
|
5787
5714
|
))
|
|
5788
|
-
] }) : row.originNote ? /* @__PURE__ */ (0,
|
|
5789
|
-
adapter.setPinned && info && row.removable && /* @__PURE__ */ (0,
|
|
5715
|
+
] }) : row.originNote ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "shrink-0 text-[10px] text-muted-foreground/60", children: row.originNote }) : null,
|
|
5716
|
+
adapter.setPinned && info && row.removable && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
5790
5717
|
"button",
|
|
5791
5718
|
{
|
|
5792
5719
|
type: "button",
|
|
@@ -5798,8 +5725,8 @@ function AssociationList(props) {
|
|
|
5798
5725
|
"shrink-0 rounded p-0.5 transition-colors hover:!text-foreground",
|
|
5799
5726
|
row.pinned ? "text-primary" : "text-muted-foreground/0 group-hover:text-muted-foreground"
|
|
5800
5727
|
),
|
|
5801
|
-
children: pinningKeys.has(row.key) ? /* @__PURE__ */ (0,
|
|
5802
|
-
|
|
5728
|
+
children: pinningKeys.has(row.key) ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
5729
|
+
import_icons14.PinIcon,
|
|
5803
5730
|
{
|
|
5804
5731
|
className: (0, import_design_system9.cn)(
|
|
5805
5732
|
"h-3 w-3",
|
|
@@ -5809,7 +5736,7 @@ function AssociationList(props) {
|
|
|
5809
5736
|
)
|
|
5810
5737
|
}
|
|
5811
5738
|
),
|
|
5812
|
-
row.removable && /* @__PURE__ */ (0,
|
|
5739
|
+
row.removable && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
5813
5740
|
"button",
|
|
5814
5741
|
{
|
|
5815
5742
|
type: "button",
|
|
@@ -5818,7 +5745,7 @@ function AssociationList(props) {
|
|
|
5818
5745
|
title: "Detach",
|
|
5819
5746
|
"aria-label": "Detach",
|
|
5820
5747
|
className: "shrink-0 rounded p-0.5 text-muted-foreground/0 transition-colors group-hover:text-muted-foreground hover:!text-destructive disabled:opacity-50",
|
|
5821
|
-
children: busy ? /* @__PURE__ */ (0,
|
|
5748
|
+
children: busy ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_icons14.XIcon, { className: "h-3 w-3" })
|
|
5822
5749
|
}
|
|
5823
5750
|
)
|
|
5824
5751
|
]
|
|
@@ -5829,7 +5756,7 @@ function AssociationList(props) {
|
|
|
5829
5756
|
})
|
|
5830
5757
|
] }, role);
|
|
5831
5758
|
}) }),
|
|
5832
|
-
pickerToken && /* @__PURE__ */ (0,
|
|
5759
|
+
pickerToken && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
5833
5760
|
AssociationPicker,
|
|
5834
5761
|
{
|
|
5835
5762
|
open: true,
|
|
@@ -5887,9 +5814,9 @@ function titleize(token) {
|
|
|
5887
5814
|
// src/react/components/AssociationCaptureToolbar.tsx
|
|
5888
5815
|
var import_react19 = require("react");
|
|
5889
5816
|
var import_design_system10 = require("@ai-matrx/design-system");
|
|
5890
|
-
var
|
|
5817
|
+
var import_icons16 = require("@ai-matrx/design-system/icons");
|
|
5891
5818
|
var import_outbound2 = require("@ai-matrx/kit/outbound");
|
|
5892
|
-
var
|
|
5819
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
5893
5820
|
function AssociationCaptureToolbar({
|
|
5894
5821
|
attach,
|
|
5895
5822
|
uploadFolderPath,
|
|
@@ -6122,7 +6049,7 @@ function AssociationCaptureToolbar({
|
|
|
6122
6049
|
}
|
|
6123
6050
|
};
|
|
6124
6051
|
const anyBuiltIn = actions.upload || actions.addFile || actions.newDocument;
|
|
6125
|
-
return /* @__PURE__ */ (0,
|
|
6052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
6126
6053
|
"div",
|
|
6127
6054
|
{
|
|
6128
6055
|
className: (0, import_design_system10.cn)(
|
|
@@ -6143,11 +6070,11 @@ function AssociationCaptureToolbar({
|
|
|
6143
6070
|
},
|
|
6144
6071
|
onDrop: handleDrop,
|
|
6145
6072
|
children: [
|
|
6146
|
-
isDragOver ? /* @__PURE__ */ (0,
|
|
6147
|
-
/* @__PURE__ */ (0,
|
|
6073
|
+
isDragOver ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "pointer-events-none absolute inset-0 z-10 grid place-items-center bg-background/70", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("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: [
|
|
6074
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(UploadIcon, { className: "size-3.5 text-primary" }),
|
|
6148
6075
|
"Drop to upload & attach"
|
|
6149
6076
|
] }) }) : null,
|
|
6150
|
-
/* @__PURE__ */ (0,
|
|
6077
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6151
6078
|
"input",
|
|
6152
6079
|
{
|
|
6153
6080
|
ref: fileInputRef,
|
|
@@ -6157,8 +6084,8 @@ function AssociationCaptureToolbar({
|
|
|
6157
6084
|
onChange: handleFilesSelected
|
|
6158
6085
|
}
|
|
6159
6086
|
),
|
|
6160
|
-
showToolbar && (anyBuiltIn || extraActions) ? /* @__PURE__ */ (0,
|
|
6161
|
-
/* @__PURE__ */ (0,
|
|
6087
|
+
showToolbar && (anyBuiltIn || extraActions) ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex flex-wrap items-center gap-0.5 border-b border-border/60 px-1.5 py-1", children: namingDoc ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-1 items-center gap-1.5 py-0.5", children: [
|
|
6088
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6162
6089
|
import_design_system10.Input,
|
|
6163
6090
|
{
|
|
6164
6091
|
autoFocus: true,
|
|
@@ -6177,17 +6104,17 @@ function AssociationCaptureToolbar({
|
|
|
6177
6104
|
style: { fontSize: 16 }
|
|
6178
6105
|
}
|
|
6179
6106
|
),
|
|
6180
|
-
/* @__PURE__ */ (0,
|
|
6107
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6181
6108
|
"button",
|
|
6182
6109
|
{
|
|
6183
6110
|
type: "button",
|
|
6184
6111
|
disabled: creatingDoc || !docName.trim(),
|
|
6185
6112
|
onClick: () => void handleCreateDoc(),
|
|
6186
6113
|
className: "flex h-7 items-center rounded-md bg-primary px-2 text-[11px] font-medium text-primary-foreground disabled:opacity-50",
|
|
6187
|
-
children: creatingDoc ? /* @__PURE__ */ (0,
|
|
6114
|
+
children: creatingDoc ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SpinnerIcon, { className: "size-3.5 animate-spin" }) : "Create"
|
|
6188
6115
|
}
|
|
6189
6116
|
),
|
|
6190
|
-
/* @__PURE__ */ (0,
|
|
6117
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6191
6118
|
"button",
|
|
6192
6119
|
{
|
|
6193
6120
|
type: "button",
|
|
@@ -6200,8 +6127,8 @@ function AssociationCaptureToolbar({
|
|
|
6200
6127
|
children: "Cancel"
|
|
6201
6128
|
}
|
|
6202
6129
|
)
|
|
6203
|
-
] }) : /* @__PURE__ */ (0,
|
|
6204
|
-
actions.upload ? /* @__PURE__ */ (0,
|
|
6130
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
6131
|
+
actions.upload ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6205
6132
|
CaptureToolbarAction,
|
|
6206
6133
|
{
|
|
6207
6134
|
icon: isUploading ? SpinnerIcon : UploadIcon,
|
|
@@ -6211,7 +6138,7 @@ function AssociationCaptureToolbar({
|
|
|
6211
6138
|
disabled: isPicking || isUploading
|
|
6212
6139
|
}
|
|
6213
6140
|
) : null,
|
|
6214
|
-
actions.addFile ? /* @__PURE__ */ (0,
|
|
6141
|
+
actions.addFile ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6215
6142
|
CaptureToolbarAction,
|
|
6216
6143
|
{
|
|
6217
6144
|
icon: isPicking ? SpinnerIcon : FolderOpenIcon,
|
|
@@ -6221,11 +6148,11 @@ function AssociationCaptureToolbar({
|
|
|
6221
6148
|
disabled: isPicking || isUploading
|
|
6222
6149
|
}
|
|
6223
6150
|
) : null,
|
|
6224
|
-
(actions.upload || actions.addFile) && actions.newDocument ? /* @__PURE__ */ (0,
|
|
6225
|
-
actions.newDocument ? /* @__PURE__ */ (0,
|
|
6151
|
+
(actions.upload || actions.addFile) && actions.newDocument ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "mx-1 h-4 w-px bg-border" }) : null,
|
|
6152
|
+
actions.newDocument ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6226
6153
|
CaptureToolbarAction,
|
|
6227
6154
|
{
|
|
6228
|
-
icon: creatingDoc ? SpinnerIcon :
|
|
6155
|
+
icon: creatingDoc ? SpinnerIcon : import_icons16.PlusIcon,
|
|
6229
6156
|
spinning: creatingDoc,
|
|
6230
6157
|
label: "New document",
|
|
6231
6158
|
onClick: () => setNamingDoc(true),
|
|
@@ -6246,7 +6173,7 @@ function CaptureToolbarAction({
|
|
|
6246
6173
|
disabled,
|
|
6247
6174
|
spinning
|
|
6248
6175
|
}) {
|
|
6249
|
-
return /* @__PURE__ */ (0,
|
|
6176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
6250
6177
|
import_design_system10.Button,
|
|
6251
6178
|
{
|
|
6252
6179
|
type: "button",
|
|
@@ -6256,7 +6183,7 @@ function CaptureToolbarAction({
|
|
|
6256
6183
|
disabled,
|
|
6257
6184
|
className: "h-7 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground",
|
|
6258
6185
|
children: [
|
|
6259
|
-
/* @__PURE__ */ (0,
|
|
6186
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { className: (0, import_design_system10.cn)("size-3.5", spinning && "animate-spin") }),
|
|
6260
6187
|
label
|
|
6261
6188
|
]
|
|
6262
6189
|
}
|
|
@@ -6265,7 +6192,7 @@ function CaptureToolbarAction({
|
|
|
6265
6192
|
|
|
6266
6193
|
// src/react/lazyPorts.tsx
|
|
6267
6194
|
var import_react20 = require("react");
|
|
6268
|
-
var
|
|
6195
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
6269
6196
|
function lazyComponent(load) {
|
|
6270
6197
|
return (0, import_react20.lazy)(async () => {
|
|
6271
6198
|
const loaded = await load();
|
|
@@ -6275,14 +6202,14 @@ function lazyComponent(load) {
|
|
|
6275
6202
|
function lazyWindowShell(load) {
|
|
6276
6203
|
const Loaded = lazyComponent(load);
|
|
6277
6204
|
return function LazyWindowShell(props) {
|
|
6278
|
-
return /* @__PURE__ */ (0,
|
|
6205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react20.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Loaded, { ...props }) });
|
|
6279
6206
|
};
|
|
6280
6207
|
}
|
|
6281
6208
|
function lazyPickerOverride(load) {
|
|
6282
6209
|
const Loaded = lazyComponent(load);
|
|
6283
6210
|
return function LazyPickerOverride(props) {
|
|
6284
6211
|
if (!props.open) return null;
|
|
6285
|
-
return /* @__PURE__ */ (0,
|
|
6212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react20.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Loaded, { ...props }) });
|
|
6286
6213
|
};
|
|
6287
6214
|
}
|
|
6288
6215
|
|
|
@@ -6396,8 +6323,8 @@ function useAssociationPickerBridge(props, options = {}) {
|
|
|
6396
6323
|
// src/react/components/AssociationEntitySelect.tsx
|
|
6397
6324
|
var import_react22 = require("react");
|
|
6398
6325
|
var import_design_system11 = require("@ai-matrx/design-system");
|
|
6399
|
-
var
|
|
6400
|
-
var
|
|
6326
|
+
var import_icons18 = require("@ai-matrx/design-system/icons");
|
|
6327
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
6401
6328
|
function AssociationEntitySelect({
|
|
6402
6329
|
token,
|
|
6403
6330
|
adapter,
|
|
@@ -6438,7 +6365,7 @@ function AssociationEntitySelect({
|
|
|
6438
6365
|
if (id) close();
|
|
6439
6366
|
else notifier.error(`Couldn't create the ${entityLabel}`);
|
|
6440
6367
|
};
|
|
6441
|
-
return /* @__PURE__ */ (0,
|
|
6368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
6442
6369
|
"div",
|
|
6443
6370
|
{
|
|
6444
6371
|
className: (0, import_design_system11.cn)(
|
|
@@ -6446,7 +6373,7 @@ function AssociationEntitySelect({
|
|
|
6446
6373
|
className
|
|
6447
6374
|
),
|
|
6448
6375
|
children: [
|
|
6449
|
-
showIcon ? /* @__PURE__ */ (0,
|
|
6376
|
+
showIcon ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6450
6377
|
InfoIcon,
|
|
6451
6378
|
{
|
|
6452
6379
|
className: (0, import_design_system11.cn)(
|
|
@@ -6456,7 +6383,7 @@ function AssociationEntitySelect({
|
|
|
6456
6383
|
"aria-hidden": true
|
|
6457
6384
|
}
|
|
6458
6385
|
) : null,
|
|
6459
|
-
active ? /* @__PURE__ */ (0,
|
|
6386
|
+
active ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6460
6387
|
import_design_system11.EditableLabel,
|
|
6461
6388
|
{
|
|
6462
6389
|
value: active.title,
|
|
@@ -6475,8 +6402,8 @@ function AssociationEntitySelect({
|
|
|
6475
6402
|
inputClassName: "text-xs font-medium"
|
|
6476
6403
|
}
|
|
6477
6404
|
) : null,
|
|
6478
|
-
active ? /* @__PURE__ */ (0,
|
|
6479
|
-
!active ? /* @__PURE__ */ (0,
|
|
6405
|
+
active ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DoorControlsSlot, { token, id: active.id, name: active.title }) : null,
|
|
6406
|
+
!active ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6480
6407
|
"span",
|
|
6481
6408
|
{
|
|
6482
6409
|
className: (0, import_design_system11.cn)(
|
|
@@ -6486,13 +6413,13 @@ function AssociationEntitySelect({
|
|
|
6486
6413
|
children: adapter.loading ? "\u2026" : emptyLabel ?? info.labelPlural
|
|
6487
6414
|
}
|
|
6488
6415
|
) : null,
|
|
6489
|
-
/* @__PURE__ */ (0,
|
|
6416
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
6490
6417
|
import_design_system11.Popover,
|
|
6491
6418
|
{
|
|
6492
6419
|
open,
|
|
6493
6420
|
onOpenChange: (next) => next ? setOpen(true) : close(),
|
|
6494
6421
|
children: [
|
|
6495
|
-
/* @__PURE__ */ (0,
|
|
6422
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system11.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
6496
6423
|
"button",
|
|
6497
6424
|
{
|
|
6498
6425
|
type: "button",
|
|
@@ -6500,17 +6427,17 @@ function AssociationEntitySelect({
|
|
|
6500
6427
|
title: `Switch or add ${info.labelPlural.toLowerCase()}`,
|
|
6501
6428
|
"aria-label": `Switch or add ${info.labelPlural.toLowerCase()}`,
|
|
6502
6429
|
children: [
|
|
6503
|
-
items.length > 1 ? /* @__PURE__ */ (0,
|
|
6430
|
+
items.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "tabular-nums", children: [
|
|
6504
6431
|
activeIndex >= 0 ? activeIndex + 1 : "\u2014",
|
|
6505
6432
|
"/",
|
|
6506
6433
|
items.length
|
|
6507
6434
|
] }) : null,
|
|
6508
|
-
/* @__PURE__ */ (0,
|
|
6435
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons18.ChevronDownIcon, { className: "size-3 opacity-60" })
|
|
6509
6436
|
]
|
|
6510
6437
|
}
|
|
6511
6438
|
) }),
|
|
6512
|
-
/* @__PURE__ */ (0,
|
|
6513
|
-
items.length > 5 ? /* @__PURE__ */ (0,
|
|
6439
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system11.PopoverContent, { sizing: "content", className: "p-0", align, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_design_system11.Command, { children: [
|
|
6440
|
+
items.length > 5 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6514
6441
|
import_design_system11.CommandInput,
|
|
6515
6442
|
{
|
|
6516
6443
|
value: query,
|
|
@@ -6518,9 +6445,9 @@ function AssociationEntitySelect({
|
|
|
6518
6445
|
placeholder: `Search ${info.labelPlural.toLowerCase()}\u2026`
|
|
6519
6446
|
}
|
|
6520
6447
|
) : null,
|
|
6521
|
-
/* @__PURE__ */ (0,
|
|
6522
|
-
/* @__PURE__ */ (0,
|
|
6523
|
-
items.length > 0 ? /* @__PURE__ */ (0,
|
|
6448
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_design_system11.CommandList, { children: [
|
|
6449
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system11.CommandEmpty, { children: "No match." }),
|
|
6450
|
+
items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system11.CommandGroup, { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
6524
6451
|
import_design_system11.CommandItem,
|
|
6525
6452
|
{
|
|
6526
6453
|
value: `${item.title} ${item.id}`,
|
|
@@ -6531,8 +6458,8 @@ function AssociationEntitySelect({
|
|
|
6531
6458
|
},
|
|
6532
6459
|
className: "group/entity-ref group gap-2",
|
|
6533
6460
|
children: [
|
|
6534
|
-
/* @__PURE__ */ (0,
|
|
6535
|
-
|
|
6461
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6462
|
+
import_icons18.CheckIcon,
|
|
6536
6463
|
{
|
|
6537
6464
|
className: (0, import_design_system11.cn)(
|
|
6538
6465
|
"size-3.5 shrink-0",
|
|
@@ -6540,8 +6467,8 @@ function AssociationEntitySelect({
|
|
|
6540
6467
|
)
|
|
6541
6468
|
}
|
|
6542
6469
|
),
|
|
6543
|
-
/* @__PURE__ */ (0,
|
|
6544
|
-
/* @__PURE__ */ (0,
|
|
6470
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "min-w-0 flex-1 truncate", children: item.title }),
|
|
6471
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6545
6472
|
"span",
|
|
6546
6473
|
{
|
|
6547
6474
|
className: "inline-flex shrink-0 items-center",
|
|
@@ -6549,7 +6476,7 @@ function AssociationEntitySelect({
|
|
|
6549
6476
|
e.preventDefault();
|
|
6550
6477
|
e.stopPropagation();
|
|
6551
6478
|
},
|
|
6552
|
-
children: /* @__PURE__ */ (0,
|
|
6479
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6553
6480
|
DoorControlsSlot,
|
|
6554
6481
|
{
|
|
6555
6482
|
token,
|
|
@@ -6559,7 +6486,7 @@ function AssociationEntitySelect({
|
|
|
6559
6486
|
)
|
|
6560
6487
|
}
|
|
6561
6488
|
),
|
|
6562
|
-
adapter.detach && item.id !== activeId ? /* @__PURE__ */ (0,
|
|
6489
|
+
adapter.detach && item.id !== activeId ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6563
6490
|
"button",
|
|
6564
6491
|
{
|
|
6565
6492
|
type: "button",
|
|
@@ -6574,7 +6501,7 @@ function AssociationEntitySelect({
|
|
|
6574
6501
|
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",
|
|
6575
6502
|
title: `Remove this ${entityLabel} from here (does not delete it)`,
|
|
6576
6503
|
"aria-label": `Remove ${item.title}`,
|
|
6577
|
-
children: /* @__PURE__ */ (0,
|
|
6504
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons18.XIcon, { className: "size-3" })
|
|
6578
6505
|
}
|
|
6579
6506
|
) : null
|
|
6580
6507
|
]
|
|
@@ -6582,9 +6509,9 @@ function AssociationEntitySelect({
|
|
|
6582
6509
|
item.id
|
|
6583
6510
|
)) }) : null
|
|
6584
6511
|
] }),
|
|
6585
|
-
createSlot !== void 0 ? /* @__PURE__ */ (0,
|
|
6586
|
-
createSlot === void 0 && adapter.createAndAttach ? /* @__PURE__ */ (0,
|
|
6587
|
-
/* @__PURE__ */ (0,
|
|
6512
|
+
createSlot !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "border-t border-border p-1", children: typeof createSlot === "function" ? createSlot(close) : createSlot }) : null,
|
|
6513
|
+
createSlot === void 0 && adapter.createAndAttach ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "border-t border-border p-1", children: creating ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-1 px-1 py-0.5", children: [
|
|
6514
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6588
6515
|
"input",
|
|
6589
6516
|
{
|
|
6590
6517
|
autoFocus: true,
|
|
@@ -6608,17 +6535,17 @@ function AssociationEntitySelect({
|
|
|
6608
6535
|
"aria-label": `New ${entityLabel} name`
|
|
6609
6536
|
}
|
|
6610
6537
|
),
|
|
6611
|
-
/* @__PURE__ */ (0,
|
|
6538
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6612
6539
|
"button",
|
|
6613
6540
|
{
|
|
6614
6541
|
type: "button",
|
|
6615
6542
|
disabled: busy || !draftName.trim(),
|
|
6616
6543
|
onClick: () => void create(draftName),
|
|
6617
6544
|
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",
|
|
6618
|
-
children: busy ? /* @__PURE__ */ (0,
|
|
6545
|
+
children: busy ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SpinnerIcon, { className: "size-3 animate-spin" }) : "Create"
|
|
6619
6546
|
}
|
|
6620
6547
|
)
|
|
6621
|
-
] }) : /* @__PURE__ */ (0,
|
|
6548
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
6622
6549
|
"button",
|
|
6623
6550
|
{
|
|
6624
6551
|
type: "button",
|
|
@@ -6629,7 +6556,7 @@ function AssociationEntitySelect({
|
|
|
6629
6556
|
},
|
|
6630
6557
|
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",
|
|
6631
6558
|
children: [
|
|
6632
|
-
busy ? /* @__PURE__ */ (0,
|
|
6559
|
+
busy ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SpinnerIcon, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons18.PlusIcon, { className: "size-3.5" }),
|
|
6633
6560
|
query.trim() ? `Create "${query.trim()}"` : `New ${info.label}`
|
|
6634
6561
|
]
|
|
6635
6562
|
}
|
|
@@ -6712,7 +6639,7 @@ function buildCategoryHierarchy(categories) {
|
|
|
6712
6639
|
}
|
|
6713
6640
|
|
|
6714
6641
|
// src/react/components/CategorySelect.tsx
|
|
6715
|
-
var
|
|
6642
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
6716
6643
|
var NONE = "__none__";
|
|
6717
6644
|
var ROOT_PARENT = "__root__";
|
|
6718
6645
|
function plural(noun) {
|
|
@@ -6748,9 +6675,9 @@ function CategorySelect({
|
|
|
6748
6675
|
// The type-ahead matches the parent's name too, so someone who knows
|
|
6749
6676
|
// the branch but not the leaf still finds it.
|
|
6750
6677
|
keywords: parent ? parent.name : "",
|
|
6751
|
-
render: depth === 0 ? /* @__PURE__ */ (0,
|
|
6752
|
-
/* @__PURE__ */ (0,
|
|
6753
|
-
/* @__PURE__ */ (0,
|
|
6678
|
+
render: depth === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "font-medium", children: category.name }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "flex items-center gap-1.5 pl-3 text-muted-foreground", children: [
|
|
6679
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CornerDownRightIcon, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
6680
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-foreground", children: category.name })
|
|
6754
6681
|
] })
|
|
6755
6682
|
})) : categories.map((category) => ({
|
|
6756
6683
|
value: category.id,
|
|
@@ -6797,8 +6724,8 @@ function CategorySelect({
|
|
|
6797
6724
|
);
|
|
6798
6725
|
return result.id;
|
|
6799
6726
|
};
|
|
6800
|
-
return /* @__PURE__ */ (0,
|
|
6801
|
-
/* @__PURE__ */ (0,
|
|
6727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
|
|
6728
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6802
6729
|
import_design_system12.CreatablePicker,
|
|
6803
6730
|
{
|
|
6804
6731
|
value: value ?? (allowNone ? NONE : null),
|
|
@@ -6814,18 +6741,18 @@ function CategorySelect({
|
|
|
6814
6741
|
emptyLabel: `No ${noun} matches that.`,
|
|
6815
6742
|
...allowCreate ? { onCreate: create } : {},
|
|
6816
6743
|
...allowCreate && hierarchy.hasHierarchy ? {
|
|
6817
|
-
createExtra: /* @__PURE__ */ (0,
|
|
6818
|
-
/* @__PURE__ */ (0,
|
|
6744
|
+
createExtra: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system12.Select, { value: createParentId, onValueChange: setCreateParentId, children: [
|
|
6745
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6819
6746
|
import_design_system12.SelectTrigger,
|
|
6820
6747
|
{
|
|
6821
6748
|
className: "h-7 text-xs",
|
|
6822
6749
|
"aria-label": `Put the new ${noun} under`,
|
|
6823
|
-
children: /* @__PURE__ */ (0,
|
|
6750
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system12.SelectValue, {})
|
|
6824
6751
|
}
|
|
6825
6752
|
),
|
|
6826
|
-
/* @__PURE__ */ (0,
|
|
6827
|
-
/* @__PURE__ */ (0,
|
|
6828
|
-
hierarchy.items.filter((item) => item.depth === 0).map((item) => /* @__PURE__ */ (0,
|
|
6753
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system12.SelectContent, { children: [
|
|
6754
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system12.SelectItem, { value: ROOT_PARENT, className: "text-xs", children: "Top level" }),
|
|
6755
|
+
hierarchy.items.filter((item) => item.depth === 0).map((item) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
6829
6756
|
import_design_system12.SelectItem,
|
|
6830
6757
|
{
|
|
6831
6758
|
value: item.category.id,
|
|
@@ -6845,21 +6772,21 @@ function CategorySelect({
|
|
|
6845
6772
|
selected === null && value !== null ? (
|
|
6846
6773
|
// A stored id whose row this reader cannot see is not "nothing chosen":
|
|
6847
6774
|
// saying so beats a blank box that looks like an unsaved field.
|
|
6848
|
-
/* @__PURE__ */ (0,
|
|
6775
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { className: "mt-1 text-xs text-muted-foreground", children: [
|
|
6849
6776
|
"This ",
|
|
6850
6777
|
noun,
|
|
6851
6778
|
" is no longer available to you."
|
|
6852
6779
|
] })
|
|
6853
6780
|
) : null,
|
|
6854
|
-
error ? /* @__PURE__ */ (0,
|
|
6781
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "mt-1 text-xs text-destructive", children: error }) : null
|
|
6855
6782
|
] });
|
|
6856
6783
|
}
|
|
6857
6784
|
|
|
6858
6785
|
// src/react/components/CategoryTagPicker.tsx
|
|
6859
6786
|
var import_react24 = require("react");
|
|
6860
6787
|
var import_design_system13 = require("@ai-matrx/design-system");
|
|
6861
|
-
var
|
|
6862
|
-
var
|
|
6788
|
+
var import_icons21 = require("@ai-matrx/design-system/icons");
|
|
6789
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
6863
6790
|
var ROOT_PARENT2 = "__root__";
|
|
6864
6791
|
function CategoryTagPicker({
|
|
6865
6792
|
entityType,
|
|
@@ -6983,44 +6910,44 @@ function CategoryTagPicker({
|
|
|
6983
6910
|
const exactMatch = categories.some(
|
|
6984
6911
|
(c) => c.name.toLowerCase() === search.trim().toLowerCase()
|
|
6985
6912
|
);
|
|
6986
|
-
return /* @__PURE__ */ (0,
|
|
6987
|
-
selected.map((c) => /* @__PURE__ */ (0,
|
|
6913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
6914
|
+
selected.map((c) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6988
6915
|
import_design_system13.Badge,
|
|
6989
6916
|
{
|
|
6990
6917
|
variant: "secondary",
|
|
6991
6918
|
className: "gap-1 pr-1 text-xs font-medium",
|
|
6992
6919
|
children: [
|
|
6993
6920
|
showHierarchy ? hierarchyById.get(c.id)?.displayName ?? c.name : c.name,
|
|
6994
|
-
/* @__PURE__ */ (0,
|
|
6921
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6995
6922
|
"button",
|
|
6996
6923
|
{
|
|
6997
6924
|
type: "button",
|
|
6998
6925
|
onClick: () => void toggle(c.id),
|
|
6999
6926
|
className: "ml-0.5 rounded-full p-0.5 hover:bg-muted-foreground/20",
|
|
7000
6927
|
"aria-label": `Remove ${c.name}`,
|
|
7001
|
-
children: /* @__PURE__ */ (0,
|
|
6928
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons21.XIcon, { className: "h-2.5 w-2.5" })
|
|
7002
6929
|
}
|
|
7003
6930
|
)
|
|
7004
6931
|
]
|
|
7005
6932
|
},
|
|
7006
6933
|
c.id
|
|
7007
6934
|
)),
|
|
7008
|
-
/* @__PURE__ */ (0,
|
|
7009
|
-
/* @__PURE__ */ (0,
|
|
6935
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system13.Popover, { open, onOpenChange: setOpen, children: [
|
|
6936
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
7010
6937
|
import_design_system13.Button,
|
|
7011
6938
|
{
|
|
7012
6939
|
variant: "outline",
|
|
7013
6940
|
size: "sm",
|
|
7014
6941
|
className: "h-7 gap-1 px-2 text-xs",
|
|
7015
6942
|
children: [
|
|
7016
|
-
/* @__PURE__ */ (0,
|
|
6943
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { className: "h-3.5 w-3.5" }),
|
|
7017
6944
|
selected.length === 0 ? addLabel : "Edit",
|
|
7018
|
-
/* @__PURE__ */ (0,
|
|
6945
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.SelectChevron, { size: "sm" })
|
|
7019
6946
|
]
|
|
7020
6947
|
}
|
|
7021
6948
|
) }),
|
|
7022
|
-
/* @__PURE__ */ (0,
|
|
7023
|
-
/* @__PURE__ */ (0,
|
|
6949
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.PopoverContent, { sizing: "content", className: "p-0", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system13.Command, { shouldFilter: false, children: [
|
|
6950
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7024
6951
|
import_design_system13.CommandInput,
|
|
7025
6952
|
{
|
|
7026
6953
|
placeholder: allowCreate ? "Search or create..." : "Search...",
|
|
@@ -7028,9 +6955,9 @@ function CategoryTagPicker({
|
|
|
7028
6955
|
onValueChange: setSearch
|
|
7029
6956
|
}
|
|
7030
6957
|
),
|
|
7031
|
-
/* @__PURE__ */ (0,
|
|
7032
|
-
/* @__PURE__ */ (0,
|
|
7033
|
-
/* @__PURE__ */ (0,
|
|
6958
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system13.CommandList, { children: [
|
|
6959
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.CommandEmpty, { className: "px-2 py-3 text-xs text-muted-foreground", children: search.trim() ? "No match." : emptyText }),
|
|
6960
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.CommandGroup, { children: showHierarchy ? filteredHierarchy.map(({ category, depth, parent }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
7034
6961
|
import_design_system13.CommandItem,
|
|
7035
6962
|
{
|
|
7036
6963
|
value: category.id,
|
|
@@ -7038,8 +6965,8 @@ function CategoryTagPicker({
|
|
|
7038
6965
|
onSelect: () => void toggle(category.id),
|
|
7039
6966
|
className: (0, import_design_system13.cn)("text-xs", depth === 1 && "pl-6"),
|
|
7040
6967
|
children: [
|
|
7041
|
-
/* @__PURE__ */ (0,
|
|
7042
|
-
|
|
6968
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6969
|
+
import_icons21.CheckIcon,
|
|
7043
6970
|
{
|
|
7044
6971
|
className: (0, import_design_system13.cn)(
|
|
7045
6972
|
"mr-2 h-3.5 w-3.5",
|
|
@@ -7047,20 +6974,20 @@ function CategoryTagPicker({
|
|
|
7047
6974
|
)
|
|
7048
6975
|
}
|
|
7049
6976
|
),
|
|
7050
|
-
depth === 1 ? /* @__PURE__ */ (0,
|
|
7051
|
-
/* @__PURE__ */ (0,
|
|
6977
|
+
depth === 1 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CornerDownRightIcon, { className: "mr-1.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : null,
|
|
6978
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: (0, import_design_system13.cn)(depth === 0 && "font-medium"), children: category.name })
|
|
7052
6979
|
]
|
|
7053
6980
|
},
|
|
7054
6981
|
category.id
|
|
7055
|
-
)) : filtered.map((c) => /* @__PURE__ */ (0,
|
|
6982
|
+
)) : filtered.map((c) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
7056
6983
|
import_design_system13.CommandItem,
|
|
7057
6984
|
{
|
|
7058
6985
|
value: c.id,
|
|
7059
6986
|
onSelect: () => void toggle(c.id),
|
|
7060
6987
|
className: "text-xs",
|
|
7061
6988
|
children: [
|
|
7062
|
-
/* @__PURE__ */ (0,
|
|
7063
|
-
|
|
6989
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6990
|
+
import_icons21.CheckIcon,
|
|
7064
6991
|
{
|
|
7065
6992
|
className: (0, import_design_system13.cn)(
|
|
7066
6993
|
"mr-2 h-3.5 w-3.5",
|
|
@@ -7073,25 +7000,25 @@ function CategoryTagPicker({
|
|
|
7073
7000
|
},
|
|
7074
7001
|
c.id
|
|
7075
7002
|
)) }),
|
|
7076
|
-
allowCreate && search.trim() && !exactMatch ? /* @__PURE__ */ (0,
|
|
7077
|
-
showHierarchy ? /* @__PURE__ */ (0,
|
|
7078
|
-
/* @__PURE__ */ (0,
|
|
7079
|
-
/* @__PURE__ */ (0,
|
|
7003
|
+
allowCreate && search.trim() && !exactMatch ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system13.CommandGroup, { children: [
|
|
7004
|
+
showHierarchy ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "space-y-1.5 px-2 pb-2", children: [
|
|
7005
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-[11px] font-medium text-muted-foreground", children: "Place in" }),
|
|
7006
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
7080
7007
|
import_design_system13.Select,
|
|
7081
7008
|
{
|
|
7082
7009
|
value: createParentId,
|
|
7083
7010
|
onValueChange: setCreateParentId,
|
|
7084
7011
|
children: [
|
|
7085
|
-
/* @__PURE__ */ (0,
|
|
7086
|
-
/* @__PURE__ */ (0,
|
|
7087
|
-
/* @__PURE__ */ (0,
|
|
7088
|
-
hierarchy.roots.map((root) => /* @__PURE__ */ (0,
|
|
7012
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.SelectTrigger, { size: "sm", className: "bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.SelectValue, {}) }),
|
|
7013
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system13.SelectContent, { children: [
|
|
7014
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.SelectItem, { value: ROOT_PARENT2, children: "Top level" }),
|
|
7015
|
+
hierarchy.roots.map((root) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.SelectItem, { value: root.id, children: root.name }, root.id))
|
|
7089
7016
|
] })
|
|
7090
7017
|
]
|
|
7091
7018
|
}
|
|
7092
7019
|
)
|
|
7093
7020
|
] }) : null,
|
|
7094
|
-
/* @__PURE__ */ (0,
|
|
7021
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
7095
7022
|
import_design_system13.CommandItem,
|
|
7096
7023
|
{
|
|
7097
7024
|
value: `__create__${search}`,
|
|
@@ -7099,7 +7026,7 @@ function CategoryTagPicker({
|
|
|
7099
7026
|
disabled: creating,
|
|
7100
7027
|
className: "text-xs text-primary",
|
|
7101
7028
|
children: [
|
|
7102
|
-
creating ? /* @__PURE__ */ (0,
|
|
7029
|
+
creating ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SpinnerIcon, { className: "mr-2 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { className: "mr-2 h-3.5 w-3.5" }),
|
|
7103
7030
|
"Create \u201C",
|
|
7104
7031
|
search.trim(),
|
|
7105
7032
|
"\u201D"
|
|
@@ -7126,20 +7053,20 @@ function partKeyOf(comment) {
|
|
|
7126
7053
|
// src/react/components/CommentBody.tsx
|
|
7127
7054
|
var import_react25 = require("react");
|
|
7128
7055
|
var import_design_system14 = require("@ai-matrx/design-system");
|
|
7129
|
-
var
|
|
7056
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
7130
7057
|
var INLINE = /(\*\*[^*\n]+\*\*|`[^`\n]+`|\*[^*\n]+\*)/g;
|
|
7131
7058
|
function renderInline(text) {
|
|
7132
7059
|
return text.split(INLINE).map((part, i) => {
|
|
7133
7060
|
if (part.length > 4 && part.startsWith("**") && part.endsWith("**")) {
|
|
7134
|
-
return /* @__PURE__ */ (0,
|
|
7061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("strong", { children: part.slice(2, -2) }, i);
|
|
7135
7062
|
}
|
|
7136
7063
|
if (part.length > 2 && part.startsWith("`") && part.endsWith("`")) {
|
|
7137
|
-
return /* @__PURE__ */ (0,
|
|
7064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("code", { className: "rounded bg-muted px-1 text-[0.9em]", children: part.slice(1, -1) }, i);
|
|
7138
7065
|
}
|
|
7139
7066
|
if (part.length > 2 && part.startsWith("*") && part.endsWith("*")) {
|
|
7140
|
-
return /* @__PURE__ */ (0,
|
|
7067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("em", { children: part.slice(1, -1) }, i);
|
|
7141
7068
|
}
|
|
7142
|
-
return /* @__PURE__ */ (0,
|
|
7069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react25.Fragment, { children: part }, i);
|
|
7143
7070
|
});
|
|
7144
7071
|
}
|
|
7145
7072
|
var BULLET = /^\s*[-*]\s+(.*)$/;
|
|
@@ -7150,14 +7077,14 @@ function renderBlocks(lines, keyPrefix) {
|
|
|
7150
7077
|
const flushBullets = () => {
|
|
7151
7078
|
if (!bullets.length) return;
|
|
7152
7079
|
out.push(
|
|
7153
|
-
/* @__PURE__ */ (0,
|
|
7080
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("ul", { className: "list-disc pl-5", children: bullets.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("li", { children: renderInline(b) }, i)) }, `${keyPrefix}-u${out.length}`)
|
|
7154
7081
|
);
|
|
7155
7082
|
bullets = [];
|
|
7156
7083
|
};
|
|
7157
7084
|
const flushPara = () => {
|
|
7158
7085
|
if (!para.length) return;
|
|
7159
7086
|
out.push(
|
|
7160
|
-
/* @__PURE__ */ (0,
|
|
7087
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "whitespace-pre-wrap", children: renderInline(para.join("\n")) }, `${keyPrefix}-p${out.length}`)
|
|
7161
7088
|
);
|
|
7162
7089
|
para = [];
|
|
7163
7090
|
};
|
|
@@ -7191,20 +7118,20 @@ function renderCommentMarkdown(body) {
|
|
|
7191
7118
|
}
|
|
7192
7119
|
return runs.map((run, i) => {
|
|
7193
7120
|
const blocks = renderBlocks(run.lines, `r${i}`);
|
|
7194
|
-
return run.quoted ? /* @__PURE__ */ (0,
|
|
7121
|
+
return run.quoted ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7195
7122
|
"blockquote",
|
|
7196
7123
|
{
|
|
7197
7124
|
className: "border-l-2 border-border pl-2 text-muted-foreground",
|
|
7198
7125
|
children: blocks
|
|
7199
7126
|
},
|
|
7200
7127
|
i
|
|
7201
|
-
) : /* @__PURE__ */ (0,
|
|
7128
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react25.Fragment, { children: blocks }, i);
|
|
7202
7129
|
});
|
|
7203
7130
|
}
|
|
7204
7131
|
function CommentBody({ body, className }) {
|
|
7205
7132
|
const { commentBody: HostBody } = useAssociationsUiPorts();
|
|
7206
|
-
if (HostBody) return /* @__PURE__ */ (0,
|
|
7207
|
-
return /* @__PURE__ */ (0,
|
|
7133
|
+
if (HostBody) return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(HostBody, { body, className });
|
|
7134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7208
7135
|
"div",
|
|
7209
7136
|
{
|
|
7210
7137
|
"data-comment-body": true,
|
|
@@ -7216,7 +7143,7 @@ function CommentBody({ body, className }) {
|
|
|
7216
7143
|
|
|
7217
7144
|
// src/react/components/CommentThread.tsx
|
|
7218
7145
|
var import_format = require("@ai-matrx/kit/format");
|
|
7219
|
-
var
|
|
7146
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
7220
7147
|
var AUTHOR_DOOR_TOKEN = "user";
|
|
7221
7148
|
var SYSTEM_AUTHOR_NAME = "AI Matrx";
|
|
7222
7149
|
function resolveAuthor(comment, authorDisplay) {
|
|
@@ -7231,24 +7158,24 @@ function resolveAuthor(comment, authorDisplay) {
|
|
|
7231
7158
|
isAgent: true
|
|
7232
7159
|
};
|
|
7233
7160
|
}
|
|
7234
|
-
const
|
|
7161
|
+
const base = {
|
|
7235
7162
|
userId: comment.createdBy,
|
|
7236
7163
|
email: comment.author.email,
|
|
7237
7164
|
displayName: comment.author.displayName,
|
|
7238
7165
|
avatarUrl: comment.author.avatarUrl
|
|
7239
7166
|
};
|
|
7240
|
-
const enriched = authorDisplay ? authorDisplay(
|
|
7241
|
-
const name = enriched?.displayName ??
|
|
7167
|
+
const enriched = authorDisplay ? authorDisplay(base) : null;
|
|
7168
|
+
const name = enriched?.displayName ?? base.displayName ?? base.email ?? "Unknown user";
|
|
7242
7169
|
return {
|
|
7243
7170
|
name,
|
|
7244
|
-
avatarUrl: enriched?.avatarUrl !== void 0 && enriched?.avatarUrl !== null ? enriched.avatarUrl :
|
|
7171
|
+
avatarUrl: enriched?.avatarUrl !== void 0 && enriched?.avatarUrl !== null ? enriched.avatarUrl : base.avatarUrl,
|
|
7245
7172
|
userId: comment.createdBy,
|
|
7246
7173
|
isAgent: false
|
|
7247
7174
|
};
|
|
7248
7175
|
}
|
|
7249
7176
|
function AuthorAvatar({ author }) {
|
|
7250
7177
|
if (author.avatarUrl) {
|
|
7251
|
-
return /* @__PURE__ */ (0,
|
|
7178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7252
7179
|
"img",
|
|
7253
7180
|
{
|
|
7254
7181
|
src: author.avatarUrl,
|
|
@@ -7257,7 +7184,7 @@ function AuthorAvatar({ author }) {
|
|
|
7257
7184
|
}
|
|
7258
7185
|
);
|
|
7259
7186
|
}
|
|
7260
|
-
return /* @__PURE__ */ (0,
|
|
7187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7261
7188
|
"span",
|
|
7262
7189
|
{
|
|
7263
7190
|
"aria-hidden": true,
|
|
@@ -7272,7 +7199,7 @@ function AuthorName({
|
|
|
7272
7199
|
}) {
|
|
7273
7200
|
const DoorRef2 = entityDoors?.EntityRef;
|
|
7274
7201
|
if (DoorRef2 && author.userId) {
|
|
7275
|
-
return /* @__PURE__ */ (0,
|
|
7202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7276
7203
|
DoorRef2,
|
|
7277
7204
|
{
|
|
7278
7205
|
token: AUTHOR_DOOR_TOKEN,
|
|
@@ -7283,7 +7210,7 @@ function AuthorName({
|
|
|
7283
7210
|
}
|
|
7284
7211
|
);
|
|
7285
7212
|
}
|
|
7286
|
-
return /* @__PURE__ */ (0,
|
|
7213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-sm font-medium text-foreground", children: author.name });
|
|
7287
7214
|
}
|
|
7288
7215
|
function CommentComposer({
|
|
7289
7216
|
onSubmit,
|
|
@@ -7314,8 +7241,8 @@ function CommentComposer({
|
|
|
7314
7241
|
}
|
|
7315
7242
|
setBody("");
|
|
7316
7243
|
}
|
|
7317
|
-
return /* @__PURE__ */ (0,
|
|
7318
|
-
/* @__PURE__ */ (0,
|
|
7244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("form", { onSubmit: submit, className: "flex flex-col gap-1.5", children: [
|
|
7245
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7319
7246
|
"textarea",
|
|
7320
7247
|
{
|
|
7321
7248
|
value: body,
|
|
@@ -7330,7 +7257,7 @@ function CommentComposer({
|
|
|
7330
7257
|
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"
|
|
7331
7258
|
}
|
|
7332
7259
|
),
|
|
7333
|
-
error && /* @__PURE__ */ (0,
|
|
7260
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7334
7261
|
import_design_system15.ErrorBox,
|
|
7335
7262
|
{
|
|
7336
7263
|
className: "text-xs text-destructive",
|
|
@@ -7340,10 +7267,10 @@ function CommentComposer({
|
|
|
7340
7267
|
origin: "associations/CommentThread"
|
|
7341
7268
|
}
|
|
7342
7269
|
),
|
|
7343
|
-
error && signIn && isSignedOutMessage(error) && /* @__PURE__ */ (0,
|
|
7344
|
-
/* @__PURE__ */ (0,
|
|
7345
|
-
/* @__PURE__ */ (0,
|
|
7346
|
-
submitting && /* @__PURE__ */ (0,
|
|
7270
|
+
error && signIn && isSignedOutMessage(error) && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SignInAgain, { onClick: signIn }),
|
|
7271
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7272
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_design_system15.Button, { type: "submit", size: "sm", disabled: !body.trim() || submitting, children: [
|
|
7273
|
+
submitting && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SpinnerIcon, { className: "mr-1 h-3 w-3 animate-spin" }),
|
|
7347
7274
|
submitLabel
|
|
7348
7275
|
] }),
|
|
7349
7276
|
trailing
|
|
@@ -7385,7 +7312,7 @@ function CommentItem({
|
|
|
7385
7312
|
notifier.error(res.error ?? "Could not delete the comment");
|
|
7386
7313
|
}
|
|
7387
7314
|
}
|
|
7388
|
-
return /* @__PURE__ */ (0,
|
|
7315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
7389
7316
|
"div",
|
|
7390
7317
|
{
|
|
7391
7318
|
"data-comment-id": comment.id,
|
|
@@ -7394,15 +7321,15 @@ function CommentItem({
|
|
|
7394
7321
|
depth > 0 && "border-l border-border pl-3"
|
|
7395
7322
|
),
|
|
7396
7323
|
children: [
|
|
7397
|
-
/* @__PURE__ */ (0,
|
|
7398
|
-
/* @__PURE__ */ (0,
|
|
7399
|
-
/* @__PURE__ */ (0,
|
|
7400
|
-
author.isAgent && /* @__PURE__ */ (0,
|
|
7401
|
-
showPart && partLabel && /* @__PURE__ */ (0,
|
|
7324
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7325
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AuthorAvatar, { author }),
|
|
7326
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AuthorName, { author, entityDoors }),
|
|
7327
|
+
author.isAgent && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "rounded bg-muted px-1 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground", children: "Agent" }),
|
|
7328
|
+
showPart && partLabel && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "truncate text-xs text-muted-foreground", title: partLabel, children: [
|
|
7402
7329
|
"on ",
|
|
7403
7330
|
partLabel
|
|
7404
7331
|
] }),
|
|
7405
|
-
/* @__PURE__ */ (0,
|
|
7332
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7406
7333
|
"span",
|
|
7407
7334
|
{
|
|
7408
7335
|
className: "text-xs text-muted-foreground",
|
|
@@ -7413,7 +7340,7 @@ function CommentItem({
|
|
|
7413
7340
|
})
|
|
7414
7341
|
}
|
|
7415
7342
|
),
|
|
7416
|
-
edited && /* @__PURE__ */ (0,
|
|
7343
|
+
edited && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7417
7344
|
"span",
|
|
7418
7345
|
{
|
|
7419
7346
|
className: "text-xs text-muted-foreground",
|
|
@@ -7422,7 +7349,7 @@ function CommentItem({
|
|
|
7422
7349
|
}
|
|
7423
7350
|
)
|
|
7424
7351
|
] }),
|
|
7425
|
-
editing ? /* @__PURE__ */ (0,
|
|
7352
|
+
editing ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pl-8", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7426
7353
|
CommentComposer,
|
|
7427
7354
|
{
|
|
7428
7355
|
initialValue: comment.body,
|
|
@@ -7434,7 +7361,7 @@ function CommentItem({
|
|
|
7434
7361
|
if (res.ok) setEditing(false);
|
|
7435
7362
|
return res;
|
|
7436
7363
|
},
|
|
7437
|
-
trailing: /* @__PURE__ */ (0,
|
|
7364
|
+
trailing: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7438
7365
|
import_design_system15.Button,
|
|
7439
7366
|
{
|
|
7440
7367
|
type: "button",
|
|
@@ -7445,10 +7372,10 @@ function CommentItem({
|
|
|
7445
7372
|
}
|
|
7446
7373
|
)
|
|
7447
7374
|
}
|
|
7448
|
-
) }) : /* @__PURE__ */ (0,
|
|
7449
|
-
!editing && /* @__PURE__ */ (0,
|
|
7450
|
-
/* @__PURE__ */ (0,
|
|
7451
|
-
/* @__PURE__ */ (0,
|
|
7375
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CommentBody, { body: comment.body, className: "pl-8" }),
|
|
7376
|
+
!editing && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex items-center gap-1 pl-7", children: confirmingDelete ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
7377
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-xs text-destructive", children: "Deletes this comment for everyone." }),
|
|
7378
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
7452
7379
|
import_design_system15.Button,
|
|
7453
7380
|
{
|
|
7454
7381
|
type: "button",
|
|
@@ -7457,12 +7384,12 @@ function CommentItem({
|
|
|
7457
7384
|
disabled: deleting,
|
|
7458
7385
|
onClick: () => void confirmDelete(),
|
|
7459
7386
|
children: [
|
|
7460
|
-
deleting && /* @__PURE__ */ (0,
|
|
7387
|
+
deleting && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SpinnerIcon, { className: "mr-1 h-3 w-3 animate-spin" }),
|
|
7461
7388
|
"Delete"
|
|
7462
7389
|
]
|
|
7463
7390
|
}
|
|
7464
7391
|
),
|
|
7465
|
-
/* @__PURE__ */ (0,
|
|
7392
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7466
7393
|
import_design_system15.Button,
|
|
7467
7394
|
{
|
|
7468
7395
|
type: "button",
|
|
@@ -7473,8 +7400,8 @@ function CommentItem({
|
|
|
7473
7400
|
children: "Cancel"
|
|
7474
7401
|
}
|
|
7475
7402
|
)
|
|
7476
|
-
] }) : /* @__PURE__ */ (0,
|
|
7477
|
-
/* @__PURE__ */ (0,
|
|
7403
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
7404
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7478
7405
|
"button",
|
|
7479
7406
|
{
|
|
7480
7407
|
type: "button",
|
|
@@ -7483,8 +7410,8 @@ function CommentItem({
|
|
|
7483
7410
|
children: "Reply"
|
|
7484
7411
|
}
|
|
7485
7412
|
),
|
|
7486
|
-
isOwn && /* @__PURE__ */ (0,
|
|
7487
|
-
canEdit && /* @__PURE__ */ (0,
|
|
7413
|
+
isOwn && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
7414
|
+
canEdit && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7488
7415
|
"button",
|
|
7489
7416
|
{
|
|
7490
7417
|
type: "button",
|
|
@@ -7493,7 +7420,7 @@ function CommentItem({
|
|
|
7493
7420
|
children: "Edit"
|
|
7494
7421
|
}
|
|
7495
7422
|
),
|
|
7496
|
-
/* @__PURE__ */ (0,
|
|
7423
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7497
7424
|
"button",
|
|
7498
7425
|
{
|
|
7499
7426
|
type: "button",
|
|
@@ -7504,9 +7431,9 @@ function CommentItem({
|
|
|
7504
7431
|
)
|
|
7505
7432
|
] })
|
|
7506
7433
|
] }) }),
|
|
7507
|
-
replying && /* @__PURE__ */ (0,
|
|
7508
|
-
/* @__PURE__ */ (0,
|
|
7509
|
-
/* @__PURE__ */ (0,
|
|
7434
|
+
replying && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-start gap-2 pl-8 pt-1", children: [
|
|
7435
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CornerDownRightIcon, { className: "mt-2 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
7436
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7510
7437
|
CommentComposer,
|
|
7511
7438
|
{
|
|
7512
7439
|
submitLabel: "Reply",
|
|
@@ -7523,7 +7450,7 @@ function CommentItem({
|
|
|
7523
7450
|
}
|
|
7524
7451
|
return res;
|
|
7525
7452
|
},
|
|
7526
|
-
trailing: /* @__PURE__ */ (0,
|
|
7453
|
+
trailing: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7527
7454
|
import_design_system15.Button,
|
|
7528
7455
|
{
|
|
7529
7456
|
type: "button",
|
|
@@ -7536,7 +7463,7 @@ function CommentItem({
|
|
|
7536
7463
|
}
|
|
7537
7464
|
) })
|
|
7538
7465
|
] }),
|
|
7539
|
-
replies.length > 0 && /* @__PURE__ */ (0,
|
|
7466
|
+
replies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex flex-col gap-3 pl-8 pt-1", children: replies.map((reply) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7540
7467
|
CommentItem,
|
|
7541
7468
|
{
|
|
7542
7469
|
comment: reply,
|
|
@@ -7592,11 +7519,11 @@ function CommentThread({
|
|
|
7592
7519
|
const roots = part ? tree.roots.filter((c) => partKeyOf(c) === part.key) : tree.roots;
|
|
7593
7520
|
const shownCount = part ? countThread(roots, childrenOf) : thread.comments.length;
|
|
7594
7521
|
const loading = (thread.status === "loading" || thread.status === "idle") && thread.comments.length === 0;
|
|
7595
|
-
return /* @__PURE__ */ (0,
|
|
7596
|
-
showHeader && /* @__PURE__ */ (0,
|
|
7597
|
-
/* @__PURE__ */ (0,
|
|
7598
|
-
/* @__PURE__ */ (0,
|
|
7599
|
-
/* @__PURE__ */ (0,
|
|
7522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { className: (0, import_design_system15.cn)("flex flex-col gap-3", className), children: [
|
|
7523
|
+
showHeader && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { className: "flex items-center gap-2", children: [
|
|
7524
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h3", { className: "text-sm font-semibold text-foreground", children: "Comments" }),
|
|
7525
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-xs text-muted-foreground tabular-nums", children: shownCount }),
|
|
7526
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7600
7527
|
"button",
|
|
7601
7528
|
{
|
|
7602
7529
|
type: "button",
|
|
@@ -7604,11 +7531,11 @@ function CommentThread({
|
|
|
7604
7531
|
"aria-label": "Refresh comments",
|
|
7605
7532
|
title: "Refresh comments",
|
|
7606
7533
|
className: "ml-auto flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
7607
|
-
children: thread.status === "loading" ? /* @__PURE__ */ (0,
|
|
7534
|
+
children: thread.status === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SpinnerIcon, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(RefreshIcon, { className: "h-3.5 w-3.5" })
|
|
7608
7535
|
}
|
|
7609
7536
|
)
|
|
7610
7537
|
] }),
|
|
7611
|
-
thread.error && /* @__PURE__ */ (0,
|
|
7538
|
+
thread.error && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
7612
7539
|
import_design_system15.ErrorBox,
|
|
7613
7540
|
{
|
|
7614
7541
|
as: "div",
|
|
@@ -7617,9 +7544,9 @@ function CommentThread({
|
|
|
7617
7544
|
operation: "Load comments",
|
|
7618
7545
|
origin: "associations/CommentThread",
|
|
7619
7546
|
children: [
|
|
7620
|
-
/* @__PURE__ */ (0,
|
|
7621
|
-
signInPort && isSignedOutMessage(thread.error) && /* @__PURE__ */ (0,
|
|
7622
|
-
/* @__PURE__ */ (0,
|
|
7547
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "min-w-0 flex-1", children: thread.error }),
|
|
7548
|
+
signInPort && isSignedOutMessage(thread.error) && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SignInAgain, { onClick: signInPort }),
|
|
7549
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7623
7550
|
import_design_system15.Button,
|
|
7624
7551
|
{
|
|
7625
7552
|
type: "button",
|
|
@@ -7633,10 +7560,10 @@ function CommentThread({
|
|
|
7633
7560
|
]
|
|
7634
7561
|
}
|
|
7635
7562
|
),
|
|
7636
|
-
loading ? /* @__PURE__ */ (0,
|
|
7637
|
-
/* @__PURE__ */ (0,
|
|
7638
|
-
/* @__PURE__ */ (0,
|
|
7639
|
-
] }) : roots.length === 0 && !thread.error ? /* @__PURE__ */ (0,
|
|
7563
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col gap-3", "aria-hidden": true, "data-testid": "comments-loading", children: [
|
|
7564
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system15.Skeleton, { className: "h-12 w-full" }),
|
|
7565
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system15.Skeleton, { className: "h-12 w-4/5" })
|
|
7566
|
+
] }) : roots.length === 0 && !thread.error ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm text-muted-foreground", children: "No comments yet." }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex flex-col gap-4", children: roots.map((comment) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7640
7567
|
CommentItem,
|
|
7641
7568
|
{
|
|
7642
7569
|
comment,
|
|
@@ -7649,7 +7576,7 @@ function CommentThread({
|
|
|
7649
7576
|
},
|
|
7650
7577
|
comment.id
|
|
7651
7578
|
)) }),
|
|
7652
|
-
/* @__PURE__ */ (0,
|
|
7579
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7653
7580
|
CommentComposer,
|
|
7654
7581
|
{
|
|
7655
7582
|
onSubmit: async (body) => {
|
|
@@ -7663,6 +7590,6 @@ function CommentThread({
|
|
|
7663
7590
|
] });
|
|
7664
7591
|
}
|
|
7665
7592
|
function SignInAgain({ onClick }) {
|
|
7666
|
-
return /* @__PURE__ */ (0,
|
|
7593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system15.Button, { type: "button", size: "sm", variant: "outline", onClick, children: "Sign in" });
|
|
7667
7594
|
}
|
|
7668
7595
|
//# sourceMappingURL=index.cjs.map
|