@iblai/iblai-js 2.3.4 → 2.3.5
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.
|
@@ -264146,6 +264146,31 @@ function BasicSubTab({ form, labels, mentor, isDisabled, categories }) {
|
|
|
264146
264146
|
const { mentorId, enableRBAC } = useAgentSettings();
|
|
264147
264147
|
const fileInputRef = React__default.useRef(null);
|
|
264148
264148
|
const { copy, status: copyStatus } = useCopyToClipboard(1000);
|
|
264149
|
+
// Host dialog to portal the category list into. Resolved from the trigger
|
|
264150
|
+
// rather than assumed, because this sub-tab is not always inside a dialog.
|
|
264151
|
+
// Falling back to `null` matters: a null container makes Radix portal to
|
|
264152
|
+
// document.body, and this SDK bundles its own react-dismissable-layer, so
|
|
264153
|
+
// body-portaled content never receives the compensating pointer-events:
|
|
264154
|
+
// auto and is left inert. `portalled` below is driven off this, so the
|
|
264155
|
+
// no-dialog case renders in place instead of reaching the body.
|
|
264156
|
+
// Resolved from the field wrapper, not the trigger: the trigger is rendered
|
|
264157
|
+
// through PopoverTrigger `asChild`, which composes its own ref onto the
|
|
264158
|
+
// Button, and ours did not survive that — leaving the container null and the
|
|
264159
|
+
// list rendering in place. A callback ref on a plain div is unambiguous.
|
|
264160
|
+
const [categoryPortalContainer, setCategoryPortalContainer] = React__default.useState(null);
|
|
264161
|
+
const categoryFieldRef = React__default.useRef(null);
|
|
264162
|
+
// Resolved when the popover opens, not on mount. Mount-time lookups came back
|
|
264163
|
+
// null — the field commits before the dialog is a usable ancestor — which
|
|
264164
|
+
// silently left the list rendering in place and still clipped.
|
|
264165
|
+
const resolveCategoryPortalContainer = React__default.useCallback(() => {
|
|
264166
|
+
var _a, _b;
|
|
264167
|
+
const host = (_b = (_a = categoryFieldRef.current) === null || _a === void 0 ? void 0 : _a.closest('[role="dialog"]')) !== null && _b !== void 0 ? _b :
|
|
264168
|
+
// Fallback for hosts that render the field outside the dialog subtree.
|
|
264169
|
+
// Still never document.body: this SDK bundles its own dismissable-layer,
|
|
264170
|
+
// so body-portaled content is left inert.
|
|
264171
|
+
document.querySelector('[role="dialog"]');
|
|
264172
|
+
setCategoryPortalContainer(host !== null && host !== void 0 ? host : null);
|
|
264173
|
+
}, []);
|
|
264149
264174
|
return (jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-[1fr_200px]", children: [jsxs("div", { className: "order-2 space-y-6 sm:order-1", children: [jsx(WithFormPermissions, { name: "mentor_name",
|
|
264150
264175
|
// @ts-expect-error permissions field type is opaque
|
|
264151
264176
|
permissions: (_a = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _a === void 0 ? void 0 : _a.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "mentor_name", children: (field) => {
|
|
@@ -264166,10 +264191,34 @@ function BasicSubTab({ form, labels, mentor, isDisabled, categories }) {
|
|
|
264166
264191
|
// @ts-expect-error permissions field type is opaque
|
|
264167
264192
|
permissions: (_c = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _c === void 0 ? void 0 : _c.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "categories", children: (field) => {
|
|
264168
264193
|
var _a;
|
|
264169
|
-
return (jsxs("div", { className: "space-y-2", children: [jsxs(Label$1, { className: "flex items-center text-sm font-medium text-[#646464]", children: [labels.fields.category.label, jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsxs(Popover, {
|
|
264194
|
+
return (jsxs("div", { className: "space-y-2", ref: categoryFieldRef, children: [jsxs(Label$1, { className: "flex items-center text-sm font-medium text-[#646464]", children: [labels.fields.category.label, jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsxs(Popover, { onOpenChange: (isOpen) => {
|
|
264195
|
+
if (isOpen)
|
|
264196
|
+
resolveCategoryPortalContainer();
|
|
264197
|
+
}, children: [jsx(PopoverTrigger, { asChild: true, "aria-label": t('tabsSettingsTab.categorySelectAriaLabel'), children: jsxs(Button$1, { variant: "outline", role: "combobox", className: "w-full justify-between", disabled: isDisabled || disabled, children: [field.state.value
|
|
264170
264198
|
? (_a = categories === null || categories === void 0 ? void 0 : categories.find((category) => category.id === field.state.value)) === null || _a === void 0 ? void 0 : _a.name
|
|
264171
|
-
: labels.fields.category.triggerPlaceholder, jsx(ChevronsUpDown, { className: "opacity-50" })] }) }), jsx(PopoverContent, { className: "w-full max-w-[490px] p-0 sm:w-[400px] lg:w-[490px]",
|
|
264172
|
-
|
|
264199
|
+
: labels.fields.category.triggerPlaceholder, jsx(ChevronsUpDown, { className: "opacity-50" })] }) }), jsx(PopoverContent, { className: "flex w-full max-w-[490px] flex-col overflow-hidden p-0 sm:w-[400px] lg:w-[490px]",
|
|
264200
|
+
// Inline rather than a Tailwind arbitrary value: consuming
|
|
264201
|
+
// apps generate their CSS by scanning their own sources, so
|
|
264202
|
+
// a class that only ever appears inside this bundle is
|
|
264203
|
+
// never emitted and the cap silently does nothing. Radix
|
|
264204
|
+
// sets this variable on the content, and it is the room
|
|
264205
|
+
// left inside collisionBoundary — so the list shrinks and
|
|
264206
|
+
// scrolls instead of overhanging the dialog.
|
|
264207
|
+
style: { maxHeight: 'var(--radix-popover-content-available-height)' }, align: "start", portalled: categoryPortalContainer !== null, container: categoryPortalContainer,
|
|
264208
|
+
// Collide against the dialog, not the viewport. The dialog
|
|
264209
|
+
// is the containing block (it is transformed) and clips its
|
|
264210
|
+
// own overflow, so viewport-based measurements let the list
|
|
264211
|
+
// run past its bottom edge and get cut off. Bounding it here
|
|
264212
|
+
// is what makes --radix-popover-content-available-height
|
|
264213
|
+
// reflect the space actually visible.
|
|
264214
|
+
collisionBoundary: categoryPortalContainer, collisionPadding: 12, children: jsxs(Command, { className: "flex min-h-0 flex-1 flex-col", children: [jsx(CommandInput, { placeholder: labels.fields.category.searchPlaceholder, className: "h-9" }), jsxs(CommandList, { className: "max-h-none min-h-0 flex-1", children: [jsx(CommandEmpty, { children: labels.fields.category.emptyState }), jsx(CommandGroup, { children: categories === null || categories === void 0 ? void 0 : categories.map((category) => (jsxs(CommandItem, {
|
|
264215
|
+
// Command runs with cmdk's default filtering, which scores the
|
|
264216
|
+
// typed query against this value. It must be the name the user
|
|
264217
|
+
// can see and type — an id matches only digits, so searching by
|
|
264218
|
+
// name hid every option behind CommandEmpty. The id comes from
|
|
264219
|
+
// the closure instead of round-tripping through onSelect.
|
|
264220
|
+
value: category.name, onSelect: () => {
|
|
264221
|
+
field.handleChange(category.id);
|
|
264173
264222
|
}, children: [category.name, jsx(Check, { className: cn('ml-auto', field.state.value === category.id ? 'opacity-100' : 'opacity-0') })] }, category.id))) })] })] }) })] })] }));
|
|
264174
264223
|
} })) })] }), jsx(WithFormPermissions, { name: "profile_image",
|
|
264175
264224
|
// @ts-expect-error permissions field type is opaque
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iblai/iblai-js",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.5",
|
|
4
4
|
"description": "Unified JavaScript SDK for IBL.ai — re-exports data-layer, web-containers, and web-utils under a single package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
"dotenv": "16.6.1",
|
|
78
78
|
"winston": "3.19.0",
|
|
79
79
|
"@iblai/mcp": "1.8.8",
|
|
80
|
-
"@iblai/
|
|
80
|
+
"@iblai/data-layer": "1.12.0",
|
|
81
81
|
"@iblai/web-utils": "2.1.10",
|
|
82
|
-
"@iblai/
|
|
82
|
+
"@iblai/web-containers": "1.16.3"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@iblai/iblai-api": "4.166.0-ai",
|