@uipath/apollo-react 5.1.1 → 6.0.0
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/dist/canvas/locales/de.cjs +1 -1
- package/dist/canvas/locales/de.d.ts.map +1 -1
- package/dist/canvas/locales/de.js +1 -1
- package/dist/canvas/locales/es-MX.cjs +1 -1
- package/dist/canvas/locales/es-MX.d.ts.map +1 -1
- package/dist/canvas/locales/es-MX.js +1 -1
- package/dist/canvas/locales/es.cjs +1 -1
- package/dist/canvas/locales/es.d.ts.map +1 -1
- package/dist/canvas/locales/es.js +1 -1
- package/dist/canvas/locales/fr.cjs +1 -1
- package/dist/canvas/locales/fr.d.ts.map +1 -1
- package/dist/canvas/locales/fr.js +1 -1
- package/dist/canvas/locales/ko.cjs +1 -1
- package/dist/canvas/locales/ko.d.ts.map +1 -1
- package/dist/canvas/locales/ko.js +1 -1
- package/dist/canvas/locales/tr.cjs +1 -1
- package/dist/canvas/locales/tr.d.ts.map +1 -1
- package/dist/canvas/locales/tr.js +1 -1
- package/dist/canvas/locales/zh-CN.cjs +1 -1
- package/dist/canvas/locales/zh-CN.d.ts.map +1 -1
- package/dist/canvas/locales/zh-CN.js +1 -1
- package/dist/canvas/locales/zh-TW.cjs +1 -1
- package/dist/canvas/locales/zh-TW.d.ts.map +1 -1
- package/dist/canvas/locales/zh-TW.js +1 -1
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/material/components/ap-model-picker/ModelPicker.cjs +76 -23
- package/dist/material/components/ap-model-picker/ModelPicker.d.ts +6 -1
- package/dist/material/components/ap-model-picker/ModelPicker.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/ModelPicker.js +77 -24
- package/dist/material/components/ap-model-picker/i18n.cjs +3 -0
- package/dist/material/components/ap-model-picker/i18n.d.ts +1 -0
- package/dist/material/components/ap-model-picker/i18n.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/i18n.js +3 -0
- package/dist/material/components/ap-model-picker/index.cjs +7 -1
- package/dist/material/components/ap-model-picker/index.d.ts +2 -2
- package/dist/material/components/ap-model-picker/index.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/index.js +2 -2
- package/dist/material/components/ap-model-picker/locales/en.cjs +1 -1
- package/dist/material/components/ap-model-picker/locales/en.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/locales/en.js +1 -1
- package/dist/material/components/ap-model-picker/primitives/ModelOptionRow.cjs +56 -17
- package/dist/material/components/ap-model-picker/primitives/ModelOptionRow.d.ts +1 -0
- package/dist/material/components/ap-model-picker/primitives/ModelOptionRow.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/primitives/ModelOptionRow.js +56 -18
- package/dist/material/components/ap-model-picker/primitives/PickerPopup.cjs +3 -1
- package/dist/material/components/ap-model-picker/primitives/PickerPopup.d.ts +3 -0
- package/dist/material/components/ap-model-picker/primitives/PickerPopup.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/primitives/PickerPopup.js +3 -1
- package/dist/material/components/ap-model-picker/types.d.ts +2 -1
- package/dist/material/components/ap-model-picker/types.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/useDiscoveryModels.cjs +6 -3
- package/dist/material/components/ap-model-picker/useDiscoveryModels.d.ts +1 -0
- package/dist/material/components/ap-model-picker/useDiscoveryModels.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/useDiscoveryModels.js +3 -3
- package/dist/material/components/ap-model-picker/usePlatformAccess.cjs +148 -13
- package/dist/material/components/ap-model-picker/usePlatformAccess.d.ts +20 -2
- package/dist/material/components/ap-model-picker/usePlatformAccess.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/usePlatformAccess.js +142 -13
- package/dist/material/components/ap-model-picker/utils.cjs +7 -1
- package/dist/material/components/ap-model-picker/utils.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/utils.js +7 -1
- package/package.json +1 -1
|
@@ -58,9 +58,10 @@ const PickerSearchInput_cjs_namespaceObject = require("./primitives/PickerSearch
|
|
|
58
58
|
const PickerTrigger_cjs_namespaceObject = require("./primitives/PickerTrigger.cjs");
|
|
59
59
|
const external_useModelPickerState_cjs_namespaceObject = require("./useModelPickerState.cjs");
|
|
60
60
|
const external_usePlatformAccess_cjs_namespaceObject = require("./usePlatformAccess.cjs");
|
|
61
|
+
const EMPTY_MODELS = [];
|
|
61
62
|
const REQUIRED_INDICATOR = '*';
|
|
62
63
|
const AUTO_VIRTUALIZE_THRESHOLD = 120;
|
|
63
|
-
const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models, value, onChange, label, required, placeholder, disabled, invalid, errorText, variant = 'searchable', groupBy = "subscription", allowGroupingChange = true, homeRegion, recommendedModelIds, previewModelIds, filter, badgesFor, customTagsFor, customTagVariants, canManageByo, onUseCustomModel, requestContext, enableFolders = false, folders, folder
|
|
64
|
+
const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models, value, onChange, label, required, placeholder, disabled, invalid, errorText, variant = 'searchable', groupBy = "subscription", allowGroupingChange = true, homeRegion, recommendedModelIds, previewModelIds, filter, badgesFor, customTagsFor, customTagVariants, canManageByo, onUseCustomModel, requestContext, enableFolders = false, folders, folder: folderProp, onFolderChange, allFoldersLabel, loading, error, showGroupHeaders = true, popupContainer, disablePortal, onDeleteModel, slots, testId }, forwardedRef)=>{
|
|
64
65
|
const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
|
|
65
66
|
const i18n = external_react_default().useMemo(()=>({
|
|
66
67
|
_
|
|
@@ -76,8 +77,52 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
76
77
|
message: 'Select a model'
|
|
77
78
|
});
|
|
78
79
|
const initiallyCollapsedGroups = external_react_default().useMemo(()=>[], []);
|
|
80
|
+
const [internalFolder, setInternalFolder] = external_react_default().useState(null);
|
|
81
|
+
const folderIsControlled = void 0 !== folderProp;
|
|
82
|
+
const folder = folderIsControlled ? folderProp : internalFolder;
|
|
83
|
+
const handleFolderChange = external_react_default().useCallback((next)=>{
|
|
84
|
+
if (!folderIsControlled) setInternalFolder(next);
|
|
85
|
+
onFolderChange?.(next);
|
|
86
|
+
}, [
|
|
87
|
+
folderIsControlled,
|
|
88
|
+
onFolderChange
|
|
89
|
+
]);
|
|
90
|
+
const selfFetchCtx = !models && requestContext ? requestContext : null;
|
|
91
|
+
const { models: fetchedModels, loading: discoveryLoading, error: discoveryError, refetch: refetchDiscovery } = (0, external_usePlatformAccess_cjs_namespaceObject.usePlatformDiscoveryModels)(selfFetchCtx, folder ?? null);
|
|
92
|
+
const catalog = models ?? fetchedModels ?? EMPTY_MODELS;
|
|
93
|
+
const effectiveLoading = (loading ?? false) || discoveryLoading;
|
|
94
|
+
const effectiveError = error ?? discoveryError;
|
|
95
|
+
const handleDeleteModel = external_react_default().useMemo(()=>{
|
|
96
|
+
if (!onDeleteModel) return;
|
|
97
|
+
if (!selfFetchCtx) return onDeleteModel;
|
|
98
|
+
return async (m)=>{
|
|
99
|
+
await onDeleteModel(m);
|
|
100
|
+
refetchDiscovery();
|
|
101
|
+
};
|
|
102
|
+
}, [
|
|
103
|
+
onDeleteModel,
|
|
104
|
+
selfFetchCtx,
|
|
105
|
+
refetchDiscovery
|
|
106
|
+
]);
|
|
107
|
+
const connectionNames = (0, external_usePlatformAccess_cjs_namespaceObject.useByoConnectionNames)(catalog, requestContext ?? null);
|
|
108
|
+
const effectiveModels = external_react_default().useMemo(()=>{
|
|
109
|
+
const allowed = catalog.filter((m)=>!m.isBlockedByPolicy);
|
|
110
|
+
if (0 === connectionNames.size) return allowed;
|
|
111
|
+
return allowed.map((m)=>{
|
|
112
|
+
if (m.byoConnectionLabel) return m;
|
|
113
|
+
const id = m.byomDetails?.integrationServiceConnectionId;
|
|
114
|
+
const name = id ? connectionNames.get(id) : void 0;
|
|
115
|
+
return name ? {
|
|
116
|
+
...m,
|
|
117
|
+
byoConnectionLabel: name
|
|
118
|
+
} : m;
|
|
119
|
+
});
|
|
120
|
+
}, [
|
|
121
|
+
catalog,
|
|
122
|
+
connectionNames
|
|
123
|
+
]);
|
|
79
124
|
const state = (0, external_useModelPickerState_cjs_namespaceObject.useModelPickerState)({
|
|
80
|
-
models,
|
|
125
|
+
models: effectiveModels,
|
|
81
126
|
value,
|
|
82
127
|
onChange,
|
|
83
128
|
groupBy,
|
|
@@ -112,17 +157,18 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
112
157
|
const effectiveCanManageByo = canManageByo ?? isOrgAdmin ?? false;
|
|
113
158
|
const { folders: fetchedFolders } = (0, external_usePlatformAccess_cjs_namespaceObject.useUserFolders)(enableFolders && !folders && requestContext ? requestContext : null);
|
|
114
159
|
const effectiveFolders = folders ?? (enableFolders ? fetchedFolders : void 0);
|
|
115
|
-
const selectedFolderNumericId = external_react_default().useMemo(()=>effectiveFolders?.find((f)=>f.id === folder)?.numericId, [
|
|
160
|
+
const selectedFolderNumericId = external_react_default().useMemo(()=>effectiveFolders?.find((f)=>f.id === folder)?.numericId ?? effectiveFolders?.find((f)=>null != f.numericId)?.numericId, [
|
|
116
161
|
effectiveFolders,
|
|
117
162
|
folder
|
|
118
163
|
]);
|
|
119
164
|
const navigateToLlmConfigurations = external_react_default().useMemo(()=>{
|
|
120
165
|
if (!requestContext) return;
|
|
121
166
|
return (link)=>{
|
|
122
|
-
|
|
167
|
+
const url = (0, external_usePlatformAccess_cjs_namespaceObject.buildLlmConfigurationsUrl)(requestContext, {
|
|
123
168
|
...link,
|
|
124
169
|
folderNumericId: selectedFolderNumericId
|
|
125
|
-
})
|
|
170
|
+
});
|
|
171
|
+
external_usePlatformAccess_cjs_namespaceObject.platformNavigation.openInNewTab(url);
|
|
126
172
|
};
|
|
127
173
|
}, [
|
|
128
174
|
requestContext,
|
|
@@ -161,18 +207,22 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
161
207
|
]);
|
|
162
208
|
const renderRowActions = external_react_default().useMemo(()=>{
|
|
163
209
|
if (slots?.optionActions) return slots.optionActions;
|
|
164
|
-
if (!effectiveCanManageByo
|
|
210
|
+
if (!effectiveCanManageByo) return ()=>null;
|
|
211
|
+
const onEdit = navigateToLlmConfigurations ? (model)=>navigateToLlmConfigurations({
|
|
212
|
+
intent: 'edit',
|
|
213
|
+
configurationId: model.byomDetails?.byoConfigurationId
|
|
214
|
+
}) : void 0;
|
|
215
|
+
if (!onEdit && !handleDeleteModel) return ()=>null;
|
|
165
216
|
return (m)=>(0, ModelOptionRow_cjs_namespaceObject.defaultRowActions)(m, {
|
|
166
217
|
i18n,
|
|
167
|
-
onEdit
|
|
168
|
-
|
|
169
|
-
configurationId: model.byomDetails?.productLlmConfigurationId
|
|
170
|
-
})
|
|
218
|
+
onEdit,
|
|
219
|
+
onDelete: handleDeleteModel
|
|
171
220
|
});
|
|
172
221
|
}, [
|
|
173
222
|
slots?.optionActions,
|
|
174
223
|
effectiveCanManageByo,
|
|
175
224
|
navigateToLlmConfigurations,
|
|
225
|
+
handleDeleteModel,
|
|
176
226
|
i18n
|
|
177
227
|
]);
|
|
178
228
|
const footerNode = external_react_default().useMemo(()=>{
|
|
@@ -183,8 +233,8 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
183
233
|
}) : void 0);
|
|
184
234
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(UseCustomModelFooter, {
|
|
185
235
|
onActivate: ()=>{
|
|
186
|
-
closePopup();
|
|
187
236
|
activate?.();
|
|
237
|
+
closePopup();
|
|
188
238
|
},
|
|
189
239
|
disabled: !activate
|
|
190
240
|
});
|
|
@@ -198,6 +248,7 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
198
248
|
]);
|
|
199
249
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Box_default(), {
|
|
200
250
|
className: "apollo-model-picker",
|
|
251
|
+
"data-testid": testId,
|
|
201
252
|
sx: {
|
|
202
253
|
width: '100%',
|
|
203
254
|
fontFamily: apollo_core_namespaceObject.FontFamily.FontNormal
|
|
@@ -233,17 +284,17 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
233
284
|
unknownValue: unknownValue,
|
|
234
285
|
placeholder: resolvedPlaceholder,
|
|
235
286
|
disabled: disabled,
|
|
236
|
-
invalid: !!invalid || !!
|
|
287
|
+
invalid: !!invalid || !!effectiveError || !!unknownValue,
|
|
237
288
|
required: required,
|
|
238
289
|
open: open,
|
|
239
290
|
controlsId: listboxId,
|
|
240
|
-
describedById: errorText ??
|
|
291
|
+
describedById: errorText ?? effectiveError ? `${id}-error` : void 0,
|
|
241
292
|
tagContext: tagContext,
|
|
242
293
|
tagVariants: customTagVariants,
|
|
243
294
|
extra: slots?.triggerExtra?.(selected),
|
|
244
295
|
onClick: ()=>setOpen(!open)
|
|
245
296
|
}),
|
|
246
|
-
(errorText ??
|
|
297
|
+
(errorText ?? effectiveError) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Typography_default(), {
|
|
247
298
|
id: `${id}-error`,
|
|
248
299
|
variant: "caption",
|
|
249
300
|
role: "alert",
|
|
@@ -253,12 +304,14 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
253
304
|
mt: 0.5,
|
|
254
305
|
fontSize: 12
|
|
255
306
|
},
|
|
256
|
-
children: errorText ??
|
|
307
|
+
children: errorText ?? effectiveError?.message
|
|
257
308
|
}),
|
|
258
309
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(PickerPopup_cjs_namespaceObject.PickerPopup, {
|
|
259
310
|
open: open,
|
|
260
311
|
anchorEl: triggerRef.current,
|
|
261
312
|
onClose: closePopup,
|
|
313
|
+
container: popupContainer,
|
|
314
|
+
disablePortal: disablePortal,
|
|
262
315
|
header: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
263
316
|
children: [
|
|
264
317
|
slots?.popupHeader?.(),
|
|
@@ -272,10 +325,10 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
272
325
|
inputRef: searchRef,
|
|
273
326
|
listboxId: listboxId,
|
|
274
327
|
activeDescendantId: filtered[activeIndex] ? (0, OptionList_cjs_namespaceObject.optionDomId)(listboxId, filtered[activeIndex].modelId) : void 0,
|
|
275
|
-
leading: slots?.searchLeading?.() ?? (effectiveFolders && effectiveFolders.length > 0 && onFolderChange ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FolderSwitcher_cjs_namespaceObject.FolderSwitcher, {
|
|
328
|
+
leading: slots?.searchLeading?.() ?? (effectiveFolders && effectiveFolders.length > 0 && (onFolderChange || selfFetchCtx) ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FolderSwitcher_cjs_namespaceObject.FolderSwitcher, {
|
|
276
329
|
folders: effectiveFolders,
|
|
277
330
|
value: folder ?? null,
|
|
278
|
-
onChange:
|
|
331
|
+
onChange: handleFolderChange,
|
|
279
332
|
allFoldersLabel: allFoldersLabel
|
|
280
333
|
}) : void 0),
|
|
281
334
|
trailing: allowGroupingChange ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(GroupBySegmented, {
|
|
@@ -287,7 +340,7 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
287
340
|
}),
|
|
288
341
|
footer: footerNode,
|
|
289
342
|
children: [
|
|
290
|
-
|
|
343
|
+
effectiveLoading && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Box_default(), {
|
|
291
344
|
role: "status",
|
|
292
345
|
"aria-live": "polite",
|
|
293
346
|
"aria-label": _({
|
|
@@ -304,7 +357,7 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
304
357
|
size: 20
|
|
305
358
|
})
|
|
306
359
|
}),
|
|
307
|
-
|
|
360
|
+
effectiveError && !effectiveLoading && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Box_default(), {
|
|
308
361
|
role: "alert",
|
|
309
362
|
sx: {
|
|
310
363
|
py: 2,
|
|
@@ -313,9 +366,9 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
313
366
|
color: `var(--color-error-text, ${apollo_core_namespaceObject.Colors.ColorRed700})`,
|
|
314
367
|
fontSize: 13
|
|
315
368
|
},
|
|
316
|
-
children:
|
|
369
|
+
children: effectiveError.message
|
|
317
370
|
}),
|
|
318
|
-
!
|
|
371
|
+
!effectiveLoading && !effectiveError && 0 === filtered.length && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Box_default(), {
|
|
319
372
|
role: "status",
|
|
320
373
|
"aria-live": "polite",
|
|
321
374
|
sx: {
|
|
@@ -349,7 +402,7 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
349
402
|
whiteSpace: 'nowrap',
|
|
350
403
|
border: 0
|
|
351
404
|
},
|
|
352
|
-
children:
|
|
405
|
+
children: effectiveLoading || effectiveError || !(filtered.length > 0) ? '' : 1 === filtered.length ? _({
|
|
353
406
|
id: 'modelPicker.count.one',
|
|
354
407
|
message: '{n} model',
|
|
355
408
|
values: {
|
|
@@ -363,7 +416,7 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
363
416
|
}
|
|
364
417
|
})
|
|
365
418
|
}),
|
|
366
|
-
!
|
|
419
|
+
!effectiveLoading && !effectiveError && filtered.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
367
420
|
children: [
|
|
368
421
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(List, {
|
|
369
422
|
id: listboxId,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ModelBadgeKind } from './badges';
|
|
3
3
|
import { type FolderSwitcherFolder } from './primitives/FolderSwitcher';
|
|
4
|
+
import { type PickerPopupProps } from './primitives/PickerPopup';
|
|
4
5
|
import type { DiscoveryModel, ModelTag } from './types';
|
|
5
6
|
import { type PlatformRequestContext } from './usePlatformAccess';
|
|
6
7
|
import type { GroupStrategy } from './utils';
|
|
@@ -20,7 +21,7 @@ export interface ModelPickerSlots {
|
|
|
20
21
|
optionActions?: (model: DiscoveryModel) => React.ReactNode;
|
|
21
22
|
}
|
|
22
23
|
export interface ModelPickerProps {
|
|
23
|
-
models
|
|
24
|
+
models?: DiscoveryModel[];
|
|
24
25
|
value?: string | null;
|
|
25
26
|
onChange?: ModelPickerChangeHandler;
|
|
26
27
|
label?: string;
|
|
@@ -50,7 +51,11 @@ export interface ModelPickerProps {
|
|
|
50
51
|
loading?: boolean;
|
|
51
52
|
error?: Error | null;
|
|
52
53
|
showGroupHeaders?: boolean;
|
|
54
|
+
popupContainer?: PickerPopupProps['container'];
|
|
55
|
+
disablePortal?: boolean;
|
|
56
|
+
onDeleteModel?: (model: DiscoveryModel) => void | Promise<void>;
|
|
53
57
|
slots?: ModelPickerSlots;
|
|
58
|
+
testId?: string;
|
|
54
59
|
}
|
|
55
60
|
export declare const ModelPicker: React.ForwardRefExoticComponent<ModelPickerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
56
61
|
//# sourceMappingURL=ModelPicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelPicker.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/ModelPicker.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAkB,KAAK,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"ModelPicker.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/ModelPicker.tsx"],"names":[],"mappings":"AA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AM,GAAG,IAAI,KAAK,IAAI,CAAC;IAE/C,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAKlB,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAQrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAO3B,cAAc,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAO/C,aAAa,CAAC,EAAE,OAAO,CAAC;IASxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhE,KAAK,CAAC,EAAE,gBAAgB,CAAC;IAEzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAiBD,eAAO,MAAM,WAAW,4FAqjBvB,CAAC"}
|
|
@@ -14,10 +14,11 @@ import { PickerPopup } from "./primitives/PickerPopup.js";
|
|
|
14
14
|
import { PickerSearchInput } from "./primitives/PickerSearchInput.js";
|
|
15
15
|
import { PickerTrigger } from "./primitives/PickerTrigger.js";
|
|
16
16
|
import { useModelPickerState } from "./useModelPickerState.js";
|
|
17
|
-
import { buildLlmConfigurationsUrl, platformNavigation, useCanManageByo, useUserFolders } from "./usePlatformAccess.js";
|
|
17
|
+
import { buildLlmConfigurationsUrl, platformNavigation, useByoConnectionNames, useCanManageByo, usePlatformDiscoveryModels, useUserFolders } from "./usePlatformAccess.js";
|
|
18
|
+
const EMPTY_MODELS = [];
|
|
18
19
|
const REQUIRED_INDICATOR = '*';
|
|
19
20
|
const AUTO_VIRTUALIZE_THRESHOLD = 120;
|
|
20
|
-
const ModelPicker = /*#__PURE__*/ react.forwardRef(({ models, value, onChange, label, required, placeholder, disabled, invalid, errorText, variant = 'searchable', groupBy = "subscription", allowGroupingChange = true, homeRegion, recommendedModelIds, previewModelIds, filter, badgesFor, customTagsFor, customTagVariants, canManageByo, onUseCustomModel, requestContext, enableFolders = false, folders, folder
|
|
21
|
+
const ModelPicker = /*#__PURE__*/ react.forwardRef(({ models, value, onChange, label, required, placeholder, disabled, invalid, errorText, variant = 'searchable', groupBy = "subscription", allowGroupingChange = true, homeRegion, recommendedModelIds, previewModelIds, filter, badgesFor, customTagsFor, customTagVariants, canManageByo, onUseCustomModel, requestContext, enableFolders = false, folders, folder: folderProp, onFolderChange, allFoldersLabel, loading, error, showGroupHeaders = true, popupContainer, disablePortal, onDeleteModel, slots, testId }, forwardedRef)=>{
|
|
21
22
|
const { _ } = useSafeLingui();
|
|
22
23
|
const i18n = react.useMemo(()=>({
|
|
23
24
|
_
|
|
@@ -33,8 +34,52 @@ const ModelPicker = /*#__PURE__*/ react.forwardRef(({ models, value, onChange, l
|
|
|
33
34
|
message: 'Select a model'
|
|
34
35
|
});
|
|
35
36
|
const initiallyCollapsedGroups = react.useMemo(()=>[], []);
|
|
37
|
+
const [internalFolder, setInternalFolder] = react.useState(null);
|
|
38
|
+
const folderIsControlled = void 0 !== folderProp;
|
|
39
|
+
const folder = folderIsControlled ? folderProp : internalFolder;
|
|
40
|
+
const handleFolderChange = react.useCallback((next)=>{
|
|
41
|
+
if (!folderIsControlled) setInternalFolder(next);
|
|
42
|
+
onFolderChange?.(next);
|
|
43
|
+
}, [
|
|
44
|
+
folderIsControlled,
|
|
45
|
+
onFolderChange
|
|
46
|
+
]);
|
|
47
|
+
const selfFetchCtx = !models && requestContext ? requestContext : null;
|
|
48
|
+
const { models: fetchedModels, loading: discoveryLoading, error: discoveryError, refetch: refetchDiscovery } = usePlatformDiscoveryModels(selfFetchCtx, folder ?? null);
|
|
49
|
+
const catalog = models ?? fetchedModels ?? EMPTY_MODELS;
|
|
50
|
+
const effectiveLoading = (loading ?? false) || discoveryLoading;
|
|
51
|
+
const effectiveError = error ?? discoveryError;
|
|
52
|
+
const handleDeleteModel = react.useMemo(()=>{
|
|
53
|
+
if (!onDeleteModel) return;
|
|
54
|
+
if (!selfFetchCtx) return onDeleteModel;
|
|
55
|
+
return async (m)=>{
|
|
56
|
+
await onDeleteModel(m);
|
|
57
|
+
refetchDiscovery();
|
|
58
|
+
};
|
|
59
|
+
}, [
|
|
60
|
+
onDeleteModel,
|
|
61
|
+
selfFetchCtx,
|
|
62
|
+
refetchDiscovery
|
|
63
|
+
]);
|
|
64
|
+
const connectionNames = useByoConnectionNames(catalog, requestContext ?? null);
|
|
65
|
+
const effectiveModels = react.useMemo(()=>{
|
|
66
|
+
const allowed = catalog.filter((m)=>!m.isBlockedByPolicy);
|
|
67
|
+
if (0 === connectionNames.size) return allowed;
|
|
68
|
+
return allowed.map((m)=>{
|
|
69
|
+
if (m.byoConnectionLabel) return m;
|
|
70
|
+
const id = m.byomDetails?.integrationServiceConnectionId;
|
|
71
|
+
const name = id ? connectionNames.get(id) : void 0;
|
|
72
|
+
return name ? {
|
|
73
|
+
...m,
|
|
74
|
+
byoConnectionLabel: name
|
|
75
|
+
} : m;
|
|
76
|
+
});
|
|
77
|
+
}, [
|
|
78
|
+
catalog,
|
|
79
|
+
connectionNames
|
|
80
|
+
]);
|
|
36
81
|
const state = useModelPickerState({
|
|
37
|
-
models,
|
|
82
|
+
models: effectiveModels,
|
|
38
83
|
value,
|
|
39
84
|
onChange,
|
|
40
85
|
groupBy,
|
|
@@ -69,17 +114,18 @@ const ModelPicker = /*#__PURE__*/ react.forwardRef(({ models, value, onChange, l
|
|
|
69
114
|
const effectiveCanManageByo = canManageByo ?? isOrgAdmin ?? false;
|
|
70
115
|
const { folders: fetchedFolders } = useUserFolders(enableFolders && !folders && requestContext ? requestContext : null);
|
|
71
116
|
const effectiveFolders = folders ?? (enableFolders ? fetchedFolders : void 0);
|
|
72
|
-
const selectedFolderNumericId = react.useMemo(()=>effectiveFolders?.find((f)=>f.id === folder)?.numericId, [
|
|
117
|
+
const selectedFolderNumericId = react.useMemo(()=>effectiveFolders?.find((f)=>f.id === folder)?.numericId ?? effectiveFolders?.find((f)=>null != f.numericId)?.numericId, [
|
|
73
118
|
effectiveFolders,
|
|
74
119
|
folder
|
|
75
120
|
]);
|
|
76
121
|
const navigateToLlmConfigurations = react.useMemo(()=>{
|
|
77
122
|
if (!requestContext) return;
|
|
78
123
|
return (link)=>{
|
|
79
|
-
|
|
124
|
+
const url = buildLlmConfigurationsUrl(requestContext, {
|
|
80
125
|
...link,
|
|
81
126
|
folderNumericId: selectedFolderNumericId
|
|
82
|
-
})
|
|
127
|
+
});
|
|
128
|
+
platformNavigation.openInNewTab(url);
|
|
83
129
|
};
|
|
84
130
|
}, [
|
|
85
131
|
requestContext,
|
|
@@ -118,18 +164,22 @@ const ModelPicker = /*#__PURE__*/ react.forwardRef(({ models, value, onChange, l
|
|
|
118
164
|
]);
|
|
119
165
|
const renderRowActions = react.useMemo(()=>{
|
|
120
166
|
if (slots?.optionActions) return slots.optionActions;
|
|
121
|
-
if (!effectiveCanManageByo
|
|
167
|
+
if (!effectiveCanManageByo) return ()=>null;
|
|
168
|
+
const onEdit = navigateToLlmConfigurations ? (model)=>navigateToLlmConfigurations({
|
|
169
|
+
intent: 'edit',
|
|
170
|
+
configurationId: model.byomDetails?.byoConfigurationId
|
|
171
|
+
}) : void 0;
|
|
172
|
+
if (!onEdit && !handleDeleteModel) return ()=>null;
|
|
122
173
|
return (m)=>defaultRowActions(m, {
|
|
123
174
|
i18n,
|
|
124
|
-
onEdit
|
|
125
|
-
|
|
126
|
-
configurationId: model.byomDetails?.productLlmConfigurationId
|
|
127
|
-
})
|
|
175
|
+
onEdit,
|
|
176
|
+
onDelete: handleDeleteModel
|
|
128
177
|
});
|
|
129
178
|
}, [
|
|
130
179
|
slots?.optionActions,
|
|
131
180
|
effectiveCanManageByo,
|
|
132
181
|
navigateToLlmConfigurations,
|
|
182
|
+
handleDeleteModel,
|
|
133
183
|
i18n
|
|
134
184
|
]);
|
|
135
185
|
const footerNode = react.useMemo(()=>{
|
|
@@ -140,8 +190,8 @@ const ModelPicker = /*#__PURE__*/ react.forwardRef(({ models, value, onChange, l
|
|
|
140
190
|
}) : void 0);
|
|
141
191
|
return /*#__PURE__*/ jsx(UseCustomModelFooter, {
|
|
142
192
|
onActivate: ()=>{
|
|
143
|
-
closePopup();
|
|
144
193
|
activate?.();
|
|
194
|
+
closePopup();
|
|
145
195
|
},
|
|
146
196
|
disabled: !activate
|
|
147
197
|
});
|
|
@@ -155,6 +205,7 @@ const ModelPicker = /*#__PURE__*/ react.forwardRef(({ models, value, onChange, l
|
|
|
155
205
|
]);
|
|
156
206
|
return /*#__PURE__*/ jsxs(Box, {
|
|
157
207
|
className: "apollo-model-picker",
|
|
208
|
+
"data-testid": testId,
|
|
158
209
|
sx: {
|
|
159
210
|
width: '100%',
|
|
160
211
|
fontFamily: FontFamily.FontNormal
|
|
@@ -190,17 +241,17 @@ const ModelPicker = /*#__PURE__*/ react.forwardRef(({ models, value, onChange, l
|
|
|
190
241
|
unknownValue: unknownValue,
|
|
191
242
|
placeholder: resolvedPlaceholder,
|
|
192
243
|
disabled: disabled,
|
|
193
|
-
invalid: !!invalid || !!
|
|
244
|
+
invalid: !!invalid || !!effectiveError || !!unknownValue,
|
|
194
245
|
required: required,
|
|
195
246
|
open: open,
|
|
196
247
|
controlsId: listboxId,
|
|
197
|
-
describedById: errorText ??
|
|
248
|
+
describedById: errorText ?? effectiveError ? `${id}-error` : void 0,
|
|
198
249
|
tagContext: tagContext,
|
|
199
250
|
tagVariants: customTagVariants,
|
|
200
251
|
extra: slots?.triggerExtra?.(selected),
|
|
201
252
|
onClick: ()=>setOpen(!open)
|
|
202
253
|
}),
|
|
203
|
-
(errorText ??
|
|
254
|
+
(errorText ?? effectiveError) && /*#__PURE__*/ jsx(Typography, {
|
|
204
255
|
id: `${id}-error`,
|
|
205
256
|
variant: "caption",
|
|
206
257
|
role: "alert",
|
|
@@ -210,12 +261,14 @@ const ModelPicker = /*#__PURE__*/ react.forwardRef(({ models, value, onChange, l
|
|
|
210
261
|
mt: 0.5,
|
|
211
262
|
fontSize: 12
|
|
212
263
|
},
|
|
213
|
-
children: errorText ??
|
|
264
|
+
children: errorText ?? effectiveError?.message
|
|
214
265
|
}),
|
|
215
266
|
/*#__PURE__*/ jsxs(PickerPopup, {
|
|
216
267
|
open: open,
|
|
217
268
|
anchorEl: triggerRef.current,
|
|
218
269
|
onClose: closePopup,
|
|
270
|
+
container: popupContainer,
|
|
271
|
+
disablePortal: disablePortal,
|
|
219
272
|
header: /*#__PURE__*/ jsxs(Fragment, {
|
|
220
273
|
children: [
|
|
221
274
|
slots?.popupHeader?.(),
|
|
@@ -229,10 +282,10 @@ const ModelPicker = /*#__PURE__*/ react.forwardRef(({ models, value, onChange, l
|
|
|
229
282
|
inputRef: searchRef,
|
|
230
283
|
listboxId: listboxId,
|
|
231
284
|
activeDescendantId: filtered[activeIndex] ? optionDomId(listboxId, filtered[activeIndex].modelId) : void 0,
|
|
232
|
-
leading: slots?.searchLeading?.() ?? (effectiveFolders && effectiveFolders.length > 0 && onFolderChange ? /*#__PURE__*/ jsx(FolderSwitcher, {
|
|
285
|
+
leading: slots?.searchLeading?.() ?? (effectiveFolders && effectiveFolders.length > 0 && (onFolderChange || selfFetchCtx) ? /*#__PURE__*/ jsx(FolderSwitcher, {
|
|
233
286
|
folders: effectiveFolders,
|
|
234
287
|
value: folder ?? null,
|
|
235
|
-
onChange:
|
|
288
|
+
onChange: handleFolderChange,
|
|
236
289
|
allFoldersLabel: allFoldersLabel
|
|
237
290
|
}) : void 0),
|
|
238
291
|
trailing: allowGroupingChange ? /*#__PURE__*/ jsx(GroupBySegmented, {
|
|
@@ -244,7 +297,7 @@ const ModelPicker = /*#__PURE__*/ react.forwardRef(({ models, value, onChange, l
|
|
|
244
297
|
}),
|
|
245
298
|
footer: footerNode,
|
|
246
299
|
children: [
|
|
247
|
-
|
|
300
|
+
effectiveLoading && /*#__PURE__*/ jsx(Box, {
|
|
248
301
|
role: "status",
|
|
249
302
|
"aria-live": "polite",
|
|
250
303
|
"aria-label": _({
|
|
@@ -261,7 +314,7 @@ const ModelPicker = /*#__PURE__*/ react.forwardRef(({ models, value, onChange, l
|
|
|
261
314
|
size: 20
|
|
262
315
|
})
|
|
263
316
|
}),
|
|
264
|
-
|
|
317
|
+
effectiveError && !effectiveLoading && /*#__PURE__*/ jsx(Box, {
|
|
265
318
|
role: "alert",
|
|
266
319
|
sx: {
|
|
267
320
|
py: 2,
|
|
@@ -270,9 +323,9 @@ const ModelPicker = /*#__PURE__*/ react.forwardRef(({ models, value, onChange, l
|
|
|
270
323
|
color: `var(--color-error-text, ${Colors.ColorRed700})`,
|
|
271
324
|
fontSize: 13
|
|
272
325
|
},
|
|
273
|
-
children:
|
|
326
|
+
children: effectiveError.message
|
|
274
327
|
}),
|
|
275
|
-
!
|
|
328
|
+
!effectiveLoading && !effectiveError && 0 === filtered.length && /*#__PURE__*/ jsx(Box, {
|
|
276
329
|
role: "status",
|
|
277
330
|
"aria-live": "polite",
|
|
278
331
|
sx: {
|
|
@@ -306,7 +359,7 @@ const ModelPicker = /*#__PURE__*/ react.forwardRef(({ models, value, onChange, l
|
|
|
306
359
|
whiteSpace: 'nowrap',
|
|
307
360
|
border: 0
|
|
308
361
|
},
|
|
309
|
-
children:
|
|
362
|
+
children: effectiveLoading || effectiveError || !(filtered.length > 0) ? '' : 1 === filtered.length ? _({
|
|
310
363
|
id: 'modelPicker.count.one',
|
|
311
364
|
message: '{n} model',
|
|
312
365
|
values: {
|
|
@@ -320,7 +373,7 @@ const ModelPicker = /*#__PURE__*/ react.forwardRef(({ models, value, onChange, l
|
|
|
320
373
|
}
|
|
321
374
|
})
|
|
322
375
|
}),
|
|
323
|
-
!
|
|
376
|
+
!effectiveLoading && !effectiveError && filtered.length > 0 && /*#__PURE__*/ jsxs(Fragment, {
|
|
324
377
|
children: [
|
|
325
378
|
/*#__PURE__*/ jsx(List, {
|
|
326
379
|
id: listboxId,
|
|
@@ -36,6 +36,7 @@ export declare const FOLDER_SWITCHER: {
|
|
|
36
36
|
};
|
|
37
37
|
export declare const ROW_ACTIONS: {
|
|
38
38
|
readonly editConfiguration: MessageDescriptor;
|
|
39
|
+
readonly deleteConfiguration: MessageDescriptor;
|
|
39
40
|
};
|
|
40
41
|
export declare const USE_CUSTOM_MODEL: {
|
|
41
42
|
readonly title: MessageDescriptor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/i18n.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAStD,MAAM,WAAW,gBAAgB;IAC/B,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,MAAM,CAAC;CAC9C;AAMD,eAAO,MAAM,UAAU;;;;;CAWb,CAAC;AAMX,eAAO,MAAM,YAAY;;;;;CAcf,CAAC;AAMX,eAAO,MAAM,YAAY;;;;;;;;;;;;;CA2Cf,CAAC;AAMX,eAAO,MAAM,aAAa,mBAGxB,CAAC;AAEH,eAAO,MAAM,kBAAkB,mBAG7B,CAAC;AAEH,eAAO,MAAM,aAAa,mBAGxB,CAAC;AAMH,eAAO,MAAM,eAAe;;CAKlB,CAAC;AAMX,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/i18n.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAStD,MAAM,WAAW,gBAAgB;IAC/B,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,MAAM,CAAC;CAC9C;AAMD,eAAO,MAAM,UAAU;;;;;CAWb,CAAC;AAMX,eAAO,MAAM,YAAY;;;;;CAcf,CAAC;AAMX,eAAO,MAAM,YAAY;;;;;;;;;;;;;CA2Cf,CAAC;AAMX,eAAO,MAAM,aAAa,mBAGxB,CAAC;AAEH,eAAO,MAAM,kBAAkB,mBAG7B,CAAC;AAEH,eAAO,MAAM,aAAa,mBAGxB,CAAC;AAMH,eAAO,MAAM,eAAe;;CAKlB,CAAC;AAMX,eAAO,MAAM,WAAW;;;CAWd,CAAC;AAMX,eAAO,MAAM,gBAAgB;;;;CAanB,CAAC;AAMX,eAAO,MAAM,QAAQ;;;;CAOX,CAAC;AAMX,eAAO,MAAM,WAAW,mBAGtB,CAAC;AAEH,eAAO,MAAM,aAAa,mBAGxB,CAAC;AAWH,wBAAgB,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,iBAAiB,GAAG,MAAM,CAEhF"}
|
|
@@ -34,6 +34,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
34
34
|
useCanManageByo: ()=>external_usePlatformAccess_cjs_namespaceObject.useCanManageByo,
|
|
35
35
|
groupModels: ()=>external_utils_cjs_namespaceObject.groupModels,
|
|
36
36
|
useModelPickerState: ()=>external_useModelPickerState_cjs_namespaceObject.useModelPickerState,
|
|
37
|
+
usePlatformDiscoveryModels: ()=>external_usePlatformAccess_cjs_namespaceObject.usePlatformDiscoveryModels,
|
|
37
38
|
FolderSwitcher: ()=>FolderSwitcher_cjs_namespaceObject.FolderSwitcher,
|
|
38
39
|
defaultCostTier: ()=>external_utils_cjs_namespaceObject.defaultCostTier,
|
|
39
40
|
useUserFolders: ()=>external_usePlatformAccess_cjs_namespaceObject.useUserFolders,
|
|
@@ -45,7 +46,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
45
46
|
useDiscoveryModels: ()=>external_useDiscoveryModels_cjs_namespaceObject.useDiscoveryModels,
|
|
46
47
|
PickerPopup: ()=>PickerPopup_cjs_namespaceObject.PickerPopup,
|
|
47
48
|
ModelPicker: ()=>external_ModelPicker_cjs_namespaceObject.ModelPicker,
|
|
48
|
-
VirtualOptionList: ()=>OptionList_cjs_namespaceObject.VirtualOptionList
|
|
49
|
+
VirtualOptionList: ()=>OptionList_cjs_namespaceObject.VirtualOptionList,
|
|
50
|
+
useByoConnectionNames: ()=>external_usePlatformAccess_cjs_namespaceObject.useByoConnectionNames
|
|
49
51
|
});
|
|
50
52
|
const external_badges_cjs_namespaceObject = require("./badges.cjs");
|
|
51
53
|
const external_ModelPicker_cjs_namespaceObject = require("./ModelPicker.cjs");
|
|
@@ -79,9 +81,11 @@ exports.deriveModelTags = __webpack_exports__.deriveModelTags;
|
|
|
79
81
|
exports.filterModels = __webpack_exports__.filterModels;
|
|
80
82
|
exports.getSubstitutionTarget = __webpack_exports__.getSubstitutionTarget;
|
|
81
83
|
exports.groupModels = __webpack_exports__.groupModels;
|
|
84
|
+
exports.useByoConnectionNames = __webpack_exports__.useByoConnectionNames;
|
|
82
85
|
exports.useCanManageByo = __webpack_exports__.useCanManageByo;
|
|
83
86
|
exports.useDiscoveryModels = __webpack_exports__.useDiscoveryModels;
|
|
84
87
|
exports.useModelPickerState = __webpack_exports__.useModelPickerState;
|
|
88
|
+
exports.usePlatformDiscoveryModels = __webpack_exports__.usePlatformDiscoveryModels;
|
|
85
89
|
exports.useUserFolders = __webpack_exports__.useUserFolders;
|
|
86
90
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
87
91
|
"ApModelPicker",
|
|
@@ -102,9 +106,11 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
|
102
106
|
"filterModels",
|
|
103
107
|
"getSubstitutionTarget",
|
|
104
108
|
"groupModels",
|
|
109
|
+
"useByoConnectionNames",
|
|
105
110
|
"useCanManageByo",
|
|
106
111
|
"useDiscoveryModels",
|
|
107
112
|
"useModelPickerState",
|
|
113
|
+
"usePlatformDiscoveryModels",
|
|
108
114
|
"useUserFolders"
|
|
109
115
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
110
116
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -24,8 +24,8 @@ export type { UseDiscoveryModelsResult } from './useDiscoveryModels';
|
|
|
24
24
|
export { useDiscoveryModels } from './useDiscoveryModels';
|
|
25
25
|
export type { UseModelPickerStateOptions, UseModelPickerStateResult, } from './useModelPickerState';
|
|
26
26
|
export { useModelPickerState } from './useModelPickerState';
|
|
27
|
-
export type { PlatformRequestContext, UseCanManageByoResult, UseUserFoldersResult, } from './usePlatformAccess';
|
|
28
|
-
export { useCanManageByo, useUserFolders } from './usePlatformAccess';
|
|
27
|
+
export type { PlatformRequestContext, PlatformToken, UseCanManageByoResult, UseUserFoldersResult, } from './usePlatformAccess';
|
|
28
|
+
export { useByoConnectionNames, useCanManageByo, usePlatformDiscoveryModels, useUserFolders, } from './usePlatformAccess';
|
|
29
29
|
export type { DeriveModelTagsContext, GroupModelsContext, GroupStrategy, } from './utils';
|
|
30
30
|
export { defaultCostTier, deriveModelTags, filterModels, getSubstitutionTarget, groupModels, } from './utils';
|
|
31
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAErE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC/C,YAAY,EACV,wBAAwB,EACxB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,WAAW,IAAI,aAAa,EAAE,MAAM,eAAe,CAAC;AAC1E,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAChF,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,YAAY,EACV,WAAW,EACX,QAAQ,EACR,kBAAkB,EAClB,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,UAAU,EACV,qBAAqB,EACrB,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,cAAc,GACf,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,oBAAoB,EAAE,cAAc,EAA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R,kBAAkB,EAClB,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,UAAU,EACV,qBAAqB,EACrB,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,cAAc,GACf,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EACV,sBAAsB,EACtB,aAAa,EACb,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,0BAA0B,EAC1B,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,sBAAsB,EACtB,kBAAkB,EAClB,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,eAAe,EACf,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,WAAW,GACZ,MAAM,SAAS,CAAC"}
|
|
@@ -10,6 +10,6 @@ import { PickerSearchInput } from "./primitives/PickerSearchInput.js";
|
|
|
10
10
|
import { PickerTrigger } from "./primitives/PickerTrigger.js";
|
|
11
11
|
import { useDiscoveryModels } from "./useDiscoveryModels.js";
|
|
12
12
|
import { useModelPickerState } from "./useModelPickerState.js";
|
|
13
|
-
import { useCanManageByo, useUserFolders } from "./usePlatformAccess.js";
|
|
13
|
+
import { useByoConnectionNames, useCanManageByo, usePlatformDiscoveryModels, useUserFolders } from "./usePlatformAccess.js";
|
|
14
14
|
import { defaultCostTier, deriveModelTags, filterModels, getSubstitutionTarget, groupModels } from "./utils.js";
|
|
15
|
-
export { ModelPicker as ApModelPicker, FolderSwitcher, GroupHeader, GroupedOptionList, MODEL_BADGES, ModelOptionRow, ModelPicker, ModelTagChip, PickerPopup, PickerSearchInput, PickerTrigger, VirtualOptionList, defaultCostTier, defaultRowActions, deriveModelTags, filterModels, getSubstitutionTarget, groupModels, useCanManageByo, useDiscoveryModels, useModelPickerState, useUserFolders };
|
|
15
|
+
export { ModelPicker as ApModelPicker, FolderSwitcher, GroupHeader, GroupedOptionList, MODEL_BADGES, ModelOptionRow, ModelPicker, ModelTagChip, PickerPopup, PickerSearchInput, PickerTrigger, VirtualOptionList, defaultCostTier, defaultRowActions, deriveModelTags, filterModels, getSubstitutionTarget, groupModels, useByoConnectionNames, useCanManageByo, useDiscoveryModels, useModelPickerState, usePlatformDiscoveryModels, useUserFolders };
|