@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
|
@@ -26,7 +26,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
27
|
messages: ()=>messages
|
|
28
28
|
});
|
|
29
|
-
const messages = JSON.parse("{\"modelPicker.badge.cost.tooltip\":[\"Relative cost tier for this product\"],\"modelPicker.badge.costBasic.label\":[\"Basic\"],\"modelPicker.badge.costPremium.label\":[\"Premium\"],\"modelPicker.badge.costStandard.label\":[\"Standard\"],\"modelPicker.count.many\":[[\"n\"],\" models\"],\"modelPicker.count.one\":[[\"n\"],\" model\"],\"modelPicker.empty.noMatch\":[\"No models match \\\"\",[\"query\"],\"\\\".\"],\"modelPicker.empty.noModels\":[\"No models available.\"],\"modelPicker.folderSwitcher.allFolders\":[\"All folders\"],\"modelPicker.group.allModels.label\":[\"All models\"],\"modelPicker.group.byo.hint\":[\"Models you brought via your own connections\"],\"modelPicker.group.byo.label\":[\"Custom Models (BYO)\"],\"modelPicker.group.deprecating.hint\":[\"Migrate before the usage end date\"],\"modelPicker.group.deprecating.label\":[\"Deprecating soon\"],\"modelPicker.group.more.hint\":[\"Available, not currently promoted by this product\"],\"modelPicker.group.more.label\":[\"More models\"],\"modelPicker.group.other.label\":[\"Other\"],\"modelPicker.group.preview.hint\":[\"Newer models in early access\"],\"modelPicker.group.preview.label\":[\"Preview\"],\"modelPicker.group.recommended.hint\":[\"Based on evaluation runs for this product\"],\"modelPicker.group.recommended.label\":[\"Recommended\"],\"modelPicker.groupBy.ariaLabel\":[\"Group models by\"],\"modelPicker.groupBy.category\":[\"Category\"],\"modelPicker.groupBy.provider\":[\"Provider\"],\"modelPicker.label.default\":[\"Model\"],\"modelPicker.listbox.label\":[\"Models\"],\"modelPicker.loading.label\":[\"Loading models\"],\"modelPicker.placeholder.selectAModel\":[\"Select a model\"],\"modelPicker.row.editConfiguration\":[\"Edit configuration\"],\"modelPicker.search.placeholder\":[\"Search models\"],\"modelPicker.tag.custom.label\":[\"Custom\"],\"modelPicker.tag.deprecating.label\":[\"Deprecating \",[\"date\"]],\"modelPicker.tag.deprecating.tooltip\":[\"Will be replaced by \",[\"replacement\"]],\"modelPicker.tag.outOfRegion.label\":[\"Out of region (\",[\"geography\"],\")\"],\"modelPicker.tag.outOfRegion.tooltip\":[\"Routes traffic outside \",[\"homeRegion\"]],\"modelPicker.tag.preview.label\":[\"Preview\"],\"modelPicker.tag.recommended.label\":[\"Recommended\"],\"modelPicker.tag.recommended.tooltip\":[\"Based on evaluation runs for this product\"],\"modelPicker.tag.substituted.label\":[\"Routes to \",[\"target\"]],\"modelPicker.tag.substituted.tooltip\":[\"This model is retired. Your traffic is currently being routed to \",[\"target\"],\". Update your configuration to make this explicit.\"],\"modelPicker.useCustomModel.disabledHint\":[\"Pass onUseCustomModel or a requestContext to the picker to wire this action.\"],\"modelPicker.useCustomModel.subtitle\":[\"Bring a model from your own connection\"],\"modelPicker.useCustomModel.title\":[\"Use custom model\"]}");
|
|
29
|
+
const messages = JSON.parse("{\"modelPicker.badge.cost.tooltip\":[\"Relative cost tier for this product\"],\"modelPicker.badge.costBasic.label\":[\"Basic\"],\"modelPicker.badge.costPremium.label\":[\"Premium\"],\"modelPicker.badge.costStandard.label\":[\"Standard\"],\"modelPicker.count.many\":[[\"n\"],\" models\"],\"modelPicker.count.one\":[[\"n\"],\" model\"],\"modelPicker.empty.noMatch\":[\"No models match \\\"\",[\"query\"],\"\\\".\"],\"modelPicker.empty.noModels\":[\"No models available.\"],\"modelPicker.folderSwitcher.allFolders\":[\"All folders\"],\"modelPicker.group.allModels.label\":[\"All models\"],\"modelPicker.group.byo.hint\":[\"Models you brought via your own connections\"],\"modelPicker.group.byo.label\":[\"Custom Models (BYO)\"],\"modelPicker.group.deprecating.hint\":[\"Migrate before the usage end date\"],\"modelPicker.group.deprecating.label\":[\"Deprecating soon\"],\"modelPicker.group.more.hint\":[\"Available, not currently promoted by this product\"],\"modelPicker.group.more.label\":[\"More models\"],\"modelPicker.group.other.label\":[\"Other\"],\"modelPicker.group.preview.hint\":[\"Newer models in early access\"],\"modelPicker.group.preview.label\":[\"Preview\"],\"modelPicker.group.recommended.hint\":[\"Based on evaluation runs for this product\"],\"modelPicker.group.recommended.label\":[\"Recommended\"],\"modelPicker.groupBy.ariaLabel\":[\"Group models by\"],\"modelPicker.groupBy.category\":[\"Category\"],\"modelPicker.groupBy.provider\":[\"Provider\"],\"modelPicker.label.default\":[\"Model\"],\"modelPicker.listbox.label\":[\"Models\"],\"modelPicker.loading.label\":[\"Loading models\"],\"modelPicker.placeholder.selectAModel\":[\"Select a model\"],\"modelPicker.row.deleteConfiguration\":[\"Delete configuration\"],\"modelPicker.row.editConfiguration\":[\"Edit configuration\"],\"modelPicker.search.placeholder\":[\"Search models\"],\"modelPicker.tag.custom.label\":[\"Custom\"],\"modelPicker.tag.deprecating.label\":[\"Deprecating \",[\"date\"]],\"modelPicker.tag.deprecating.tooltip\":[\"Will be replaced by \",[\"replacement\"]],\"modelPicker.tag.outOfRegion.label\":[\"Out of region (\",[\"geography\"],\")\"],\"modelPicker.tag.outOfRegion.tooltip\":[\"Routes traffic outside \",[\"homeRegion\"]],\"modelPicker.tag.preview.label\":[\"Preview\"],\"modelPicker.tag.recommended.label\":[\"Recommended\"],\"modelPicker.tag.recommended.tooltip\":[\"Based on evaluation runs for this product\"],\"modelPicker.tag.substituted.label\":[\"Routes to \",[\"target\"]],\"modelPicker.tag.substituted.tooltip\":[\"This model is retired. Your traffic is currently being routed to \",[\"target\"],\". Update your configuration to make this explicit.\"],\"modelPicker.useCustomModel.disabledHint\":[\"Pass onUseCustomModel or a requestContext to the picker to wire this action.\"],\"modelPicker.useCustomModel.subtitle\":[\"Bring a model from your own connection\"],\"modelPicker.useCustomModel.title\":[\"Use custom model\"]}");
|
|
30
30
|
exports.messages = __webpack_exports__.messages;
|
|
31
31
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
32
32
|
"messages"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../../src/material/components/ap-model-picker/locales/en.ts"],"names":[],"mappings":"AAAkB,OAAO,KAAI,EAAC,QAAQ,EAAC,MAAI,cAAc,CAAC;AAAA,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../../src/material/components/ap-model-picker/locales/en.ts"],"names":[],"mappings":"AAAkB,OAAO,KAAI,EAAC,QAAQ,EAAC,MAAI,cAAc,CAAC;AAAA,eAAO,MAAM,QAAQ,EAAs4F,QAAQ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const messages = JSON.parse("{\"modelPicker.badge.cost.tooltip\":[\"Relative cost tier for this product\"],\"modelPicker.badge.costBasic.label\":[\"Basic\"],\"modelPicker.badge.costPremium.label\":[\"Premium\"],\"modelPicker.badge.costStandard.label\":[\"Standard\"],\"modelPicker.count.many\":[[\"n\"],\" models\"],\"modelPicker.count.one\":[[\"n\"],\" model\"],\"modelPicker.empty.noMatch\":[\"No models match \\\"\",[\"query\"],\"\\\".\"],\"modelPicker.empty.noModels\":[\"No models available.\"],\"modelPicker.folderSwitcher.allFolders\":[\"All folders\"],\"modelPicker.group.allModels.label\":[\"All models\"],\"modelPicker.group.byo.hint\":[\"Models you brought via your own connections\"],\"modelPicker.group.byo.label\":[\"Custom Models (BYO)\"],\"modelPicker.group.deprecating.hint\":[\"Migrate before the usage end date\"],\"modelPicker.group.deprecating.label\":[\"Deprecating soon\"],\"modelPicker.group.more.hint\":[\"Available, not currently promoted by this product\"],\"modelPicker.group.more.label\":[\"More models\"],\"modelPicker.group.other.label\":[\"Other\"],\"modelPicker.group.preview.hint\":[\"Newer models in early access\"],\"modelPicker.group.preview.label\":[\"Preview\"],\"modelPicker.group.recommended.hint\":[\"Based on evaluation runs for this product\"],\"modelPicker.group.recommended.label\":[\"Recommended\"],\"modelPicker.groupBy.ariaLabel\":[\"Group models by\"],\"modelPicker.groupBy.category\":[\"Category\"],\"modelPicker.groupBy.provider\":[\"Provider\"],\"modelPicker.label.default\":[\"Model\"],\"modelPicker.listbox.label\":[\"Models\"],\"modelPicker.loading.label\":[\"Loading models\"],\"modelPicker.placeholder.selectAModel\":[\"Select a model\"],\"modelPicker.row.editConfiguration\":[\"Edit configuration\"],\"modelPicker.search.placeholder\":[\"Search models\"],\"modelPicker.tag.custom.label\":[\"Custom\"],\"modelPicker.tag.deprecating.label\":[\"Deprecating \",[\"date\"]],\"modelPicker.tag.deprecating.tooltip\":[\"Will be replaced by \",[\"replacement\"]],\"modelPicker.tag.outOfRegion.label\":[\"Out of region (\",[\"geography\"],\")\"],\"modelPicker.tag.outOfRegion.tooltip\":[\"Routes traffic outside \",[\"homeRegion\"]],\"modelPicker.tag.preview.label\":[\"Preview\"],\"modelPicker.tag.recommended.label\":[\"Recommended\"],\"modelPicker.tag.recommended.tooltip\":[\"Based on evaluation runs for this product\"],\"modelPicker.tag.substituted.label\":[\"Routes to \",[\"target\"]],\"modelPicker.tag.substituted.tooltip\":[\"This model is retired. Your traffic is currently being routed to \",[\"target\"],\". Update your configuration to make this explicit.\"],\"modelPicker.useCustomModel.disabledHint\":[\"Pass onUseCustomModel or a requestContext to the picker to wire this action.\"],\"modelPicker.useCustomModel.subtitle\":[\"Bring a model from your own connection\"],\"modelPicker.useCustomModel.title\":[\"Use custom model\"]}");
|
|
1
|
+
const messages = JSON.parse("{\"modelPicker.badge.cost.tooltip\":[\"Relative cost tier for this product\"],\"modelPicker.badge.costBasic.label\":[\"Basic\"],\"modelPicker.badge.costPremium.label\":[\"Premium\"],\"modelPicker.badge.costStandard.label\":[\"Standard\"],\"modelPicker.count.many\":[[\"n\"],\" models\"],\"modelPicker.count.one\":[[\"n\"],\" model\"],\"modelPicker.empty.noMatch\":[\"No models match \\\"\",[\"query\"],\"\\\".\"],\"modelPicker.empty.noModels\":[\"No models available.\"],\"modelPicker.folderSwitcher.allFolders\":[\"All folders\"],\"modelPicker.group.allModels.label\":[\"All models\"],\"modelPicker.group.byo.hint\":[\"Models you brought via your own connections\"],\"modelPicker.group.byo.label\":[\"Custom Models (BYO)\"],\"modelPicker.group.deprecating.hint\":[\"Migrate before the usage end date\"],\"modelPicker.group.deprecating.label\":[\"Deprecating soon\"],\"modelPicker.group.more.hint\":[\"Available, not currently promoted by this product\"],\"modelPicker.group.more.label\":[\"More models\"],\"modelPicker.group.other.label\":[\"Other\"],\"modelPicker.group.preview.hint\":[\"Newer models in early access\"],\"modelPicker.group.preview.label\":[\"Preview\"],\"modelPicker.group.recommended.hint\":[\"Based on evaluation runs for this product\"],\"modelPicker.group.recommended.label\":[\"Recommended\"],\"modelPicker.groupBy.ariaLabel\":[\"Group models by\"],\"modelPicker.groupBy.category\":[\"Category\"],\"modelPicker.groupBy.provider\":[\"Provider\"],\"modelPicker.label.default\":[\"Model\"],\"modelPicker.listbox.label\":[\"Models\"],\"modelPicker.loading.label\":[\"Loading models\"],\"modelPicker.placeholder.selectAModel\":[\"Select a model\"],\"modelPicker.row.deleteConfiguration\":[\"Delete configuration\"],\"modelPicker.row.editConfiguration\":[\"Edit configuration\"],\"modelPicker.search.placeholder\":[\"Search models\"],\"modelPicker.tag.custom.label\":[\"Custom\"],\"modelPicker.tag.deprecating.label\":[\"Deprecating \",[\"date\"]],\"modelPicker.tag.deprecating.tooltip\":[\"Will be replaced by \",[\"replacement\"]],\"modelPicker.tag.outOfRegion.label\":[\"Out of region (\",[\"geography\"],\")\"],\"modelPicker.tag.outOfRegion.tooltip\":[\"Routes traffic outside \",[\"homeRegion\"]],\"modelPicker.tag.preview.label\":[\"Preview\"],\"modelPicker.tag.recommended.label\":[\"Recommended\"],\"modelPicker.tag.recommended.tooltip\":[\"Based on evaluation runs for this product\"],\"modelPicker.tag.substituted.label\":[\"Routes to \",[\"target\"]],\"modelPicker.tag.substituted.tooltip\":[\"This model is retired. Your traffic is currently being routed to \",[\"target\"],\". Update your configuration to make this explicit.\"],\"modelPicker.useCustomModel.disabledHint\":[\"Pass onUseCustomModel or a requestContext to the picker to wire this action.\"],\"modelPicker.useCustomModel.subtitle\":[\"Bring a model from your own connection\"],\"modelPicker.useCustomModel.title\":[\"Use custom model\"]}");
|
|
2
2
|
export { messages };
|
|
@@ -39,6 +39,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
39
39
|
ModelOptionRow: ()=>ModelOptionRow
|
|
40
40
|
});
|
|
41
41
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
42
|
+
const DeleteOutline_namespaceObject = require("@mui/icons-material/DeleteOutline");
|
|
43
|
+
var DeleteOutline_default = /*#__PURE__*/ __webpack_require__.n(DeleteOutline_namespaceObject);
|
|
42
44
|
const EditOutlined_namespaceObject = require("@mui/icons-material/EditOutlined");
|
|
43
45
|
var EditOutlined_default = /*#__PURE__*/ __webpack_require__.n(EditOutlined_namespaceObject);
|
|
44
46
|
const Box_namespaceObject = require("@mui/material/Box");
|
|
@@ -100,6 +102,7 @@ const ModelOptionRowInner = ({ model, index, active, selected, onSelect, onActiv
|
|
|
100
102
|
justifyContent: 'flex-start',
|
|
101
103
|
textAlign: 'left',
|
|
102
104
|
position: 'relative',
|
|
105
|
+
containerType: 'inline-size',
|
|
103
106
|
boxShadow: selected ? `inset 3px 0px 0px var(--color-primary, ${apollo_core_namespaceObject.Colors.ColorBlue500})` : 'none',
|
|
104
107
|
backgroundColor: selected ? `var(--color-background-selected, ${apollo_core_namespaceObject.Colors.ColorBlue050})` : active ? "var(--color-background-hover, rgba(82, 96, 105, 0.078))" : 'transparent',
|
|
105
108
|
'&:hover': {
|
|
@@ -139,7 +142,17 @@ const ModelOptionRowInner = ({ model, index, active, selected, onSelect, onActiv
|
|
|
139
142
|
}),
|
|
140
143
|
inlineTags.map((t)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Box_default(), {
|
|
141
144
|
sx: {
|
|
142
|
-
flexShrink:
|
|
145
|
+
flexShrink: 1,
|
|
146
|
+
minWidth: 0,
|
|
147
|
+
overflow: 'hidden',
|
|
148
|
+
'& .MuiChip-root': {
|
|
149
|
+
maxWidth: '100%'
|
|
150
|
+
},
|
|
151
|
+
'& .MuiChip-label': {
|
|
152
|
+
overflow: 'hidden',
|
|
153
|
+
textOverflow: 'ellipsis',
|
|
154
|
+
whiteSpace: 'nowrap'
|
|
155
|
+
}
|
|
143
156
|
},
|
|
144
157
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ModelTagChip_cjs_namespaceObject.ModelTagChip, {
|
|
145
158
|
tag: t,
|
|
@@ -185,7 +198,10 @@ const ModelOptionRowInner = ({ model, index, active, selected, onSelect, onActiv
|
|
|
185
198
|
flexDirection: 'column',
|
|
186
199
|
alignItems: 'flex-end',
|
|
187
200
|
gap: 0.5,
|
|
188
|
-
pt: 0.125
|
|
201
|
+
pt: 0.125,
|
|
202
|
+
'@container (max-width: 380px)': {
|
|
203
|
+
display: 'none'
|
|
204
|
+
}
|
|
189
205
|
},
|
|
190
206
|
onClick: (e)=>e.stopPropagation(),
|
|
191
207
|
children: [
|
|
@@ -219,28 +235,51 @@ const ModelOptionRowInner = ({ model, index, active, selected, onSelect, onActiv
|
|
|
219
235
|
const ModelOptionRow = /*#__PURE__*/ external_react_default().memo(ModelOptionRowInner);
|
|
220
236
|
ModelOptionRow.displayName = 'ModelOptionRow';
|
|
221
237
|
function defaultRowActions(model, options = {}) {
|
|
222
|
-
const { i18n, onEdit } = options;
|
|
223
|
-
if (!onEdit) return null;
|
|
238
|
+
const { i18n, onEdit, onDelete } = options;
|
|
239
|
+
if (!onEdit && !onDelete) return null;
|
|
224
240
|
const isByo = 'BYOMAdded' === model.modelSubscriptionType || 'BYOMReplacedAlternative' === model.modelSubscriptionType || 'BYOMReplacedLikeForLike' === model.modelSubscriptionType;
|
|
225
241
|
if (!isByo) return null;
|
|
226
242
|
const editTitle = i18n ? i18n._({
|
|
227
243
|
id: 'modelPicker.row.editConfiguration',
|
|
228
244
|
message: 'Edit configuration'
|
|
229
245
|
}) : 'Edit configuration';
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
246
|
+
const deleteTitle = i18n ? i18n._({
|
|
247
|
+
id: 'modelPicker.row.deleteConfiguration',
|
|
248
|
+
message: 'Delete configuration'
|
|
249
|
+
}) : 'Delete configuration';
|
|
250
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
251
|
+
children: [
|
|
252
|
+
onEdit && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Tooltip_default(), {
|
|
253
|
+
title: editTitle,
|
|
254
|
+
arrow: true,
|
|
255
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(IconButton_default(), {
|
|
256
|
+
size: "small",
|
|
257
|
+
sx: {
|
|
258
|
+
color: 'inherit'
|
|
259
|
+
},
|
|
260
|
+
"aria-label": editTitle,
|
|
261
|
+
onClick: ()=>onEdit(model),
|
|
262
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(EditOutlined_default(), {
|
|
263
|
+
fontSize: "small"
|
|
264
|
+
})
|
|
265
|
+
})
|
|
266
|
+
}),
|
|
267
|
+
onDelete && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Tooltip_default(), {
|
|
268
|
+
title: deleteTitle,
|
|
269
|
+
arrow: true,
|
|
270
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(IconButton_default(), {
|
|
271
|
+
size: "small",
|
|
272
|
+
sx: {
|
|
273
|
+
color: 'inherit'
|
|
274
|
+
},
|
|
275
|
+
"aria-label": deleteTitle,
|
|
276
|
+
onClick: ()=>onDelete(model),
|
|
277
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DeleteOutline_default(), {
|
|
278
|
+
fontSize: "small"
|
|
279
|
+
})
|
|
280
|
+
})
|
|
242
281
|
})
|
|
243
|
-
|
|
282
|
+
]
|
|
244
283
|
});
|
|
245
284
|
}
|
|
246
285
|
exports.DENSE_OPTION_HEIGHT = __webpack_exports__.DENSE_OPTION_HEIGHT;
|
|
@@ -24,6 +24,7 @@ export declare const ModelOptionRow: React.NamedExoticComponent<ModelOptionRowPr
|
|
|
24
24
|
export declare function defaultRowActions(model: DiscoveryModel, options?: {
|
|
25
25
|
i18n?: PickerTranslator;
|
|
26
26
|
onEdit?: (model: DiscoveryModel) => void;
|
|
27
|
+
onDelete?: (model: DiscoveryModel) => void;
|
|
27
28
|
}): React.ReactNode;
|
|
28
29
|
export { FULL_OPTION_HEIGHT, DENSE_OPTION_HEIGHT };
|
|
29
30
|
//# sourceMappingURL=ModelOptionRow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelOptionRow.d.ts","sourceRoot":"","sources":["../../../../../src/material/components/ap-model-picker/primitives/ModelOptionRow.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ModelOptionRow.d.ts","sourceRoot":"","sources":["../../../../../src/material/components/ap-model-picker/primitives/ModelOptionRow.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,KAAK,sBAAsB,EAAmB,MAAM,UAAU,CAAC;AAExE,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,cAAc,CAAC;IAMtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAMlB,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAK1C,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAMrC,UAAU,CAAC,EAAE,sBAAsB,CAAC;IAMpC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAOrC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,KAAK,CAAC,SAAS,CAAC;IAK3D,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,KAAK,CAAC,SAAS,CAAC;IAMxD,KAAK,CAAC,EAAE,OAAO,CAAC;IAKhB,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAMjC,EAAE,CAAC,EAAE,MAAM,CAAC;IAGZ,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,kBAAkB,KAAK,CAAC;AAC9B,QAAA,MAAM,mBAAmB,KAAK,CAAC;AAoQ/B,eAAO,MAAM,cAAc,iDAAkC,CAAC;AAiB9D,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,cAAc,EACrB,OAAO,GAAE;IAKP,IAAI,CAAC,EAAE,gBAAgB,CAAC;IAExB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAMzC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;CACvC,GACL,KAAK,CAAC,SAAS,CAgDjB;AAED,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import DeleteOutline from "@mui/icons-material/DeleteOutline";
|
|
2
3
|
import EditOutlined from "@mui/icons-material/EditOutlined";
|
|
3
4
|
import Box from "@mui/material/Box";
|
|
4
5
|
import ButtonBase from "@mui/material/ButtonBase";
|
|
@@ -53,6 +54,7 @@ const ModelOptionRowInner = ({ model, index, active, selected, onSelect, onActiv
|
|
|
53
54
|
justifyContent: 'flex-start',
|
|
54
55
|
textAlign: 'left',
|
|
55
56
|
position: 'relative',
|
|
57
|
+
containerType: 'inline-size',
|
|
56
58
|
boxShadow: selected ? `inset 3px 0px 0px var(--color-primary, ${Colors.ColorBlue500})` : 'none',
|
|
57
59
|
backgroundColor: selected ? `var(--color-background-selected, ${Colors.ColorBlue050})` : active ? "var(--color-background-hover, rgba(82, 96, 105, 0.078))" : 'transparent',
|
|
58
60
|
'&:hover': {
|
|
@@ -92,7 +94,17 @@ const ModelOptionRowInner = ({ model, index, active, selected, onSelect, onActiv
|
|
|
92
94
|
}),
|
|
93
95
|
inlineTags.map((t)=>/*#__PURE__*/ jsx(Box, {
|
|
94
96
|
sx: {
|
|
95
|
-
flexShrink:
|
|
97
|
+
flexShrink: 1,
|
|
98
|
+
minWidth: 0,
|
|
99
|
+
overflow: 'hidden',
|
|
100
|
+
'& .MuiChip-root': {
|
|
101
|
+
maxWidth: '100%'
|
|
102
|
+
},
|
|
103
|
+
'& .MuiChip-label': {
|
|
104
|
+
overflow: 'hidden',
|
|
105
|
+
textOverflow: 'ellipsis',
|
|
106
|
+
whiteSpace: 'nowrap'
|
|
107
|
+
}
|
|
96
108
|
},
|
|
97
109
|
children: /*#__PURE__*/ jsx(ModelTagChip, {
|
|
98
110
|
tag: t,
|
|
@@ -138,7 +150,10 @@ const ModelOptionRowInner = ({ model, index, active, selected, onSelect, onActiv
|
|
|
138
150
|
flexDirection: 'column',
|
|
139
151
|
alignItems: 'flex-end',
|
|
140
152
|
gap: 0.5,
|
|
141
|
-
pt: 0.125
|
|
153
|
+
pt: 0.125,
|
|
154
|
+
'@container (max-width: 380px)': {
|
|
155
|
+
display: 'none'
|
|
156
|
+
}
|
|
142
157
|
},
|
|
143
158
|
onClick: (e)=>e.stopPropagation(),
|
|
144
159
|
children: [
|
|
@@ -172,28 +187,51 @@ const ModelOptionRowInner = ({ model, index, active, selected, onSelect, onActiv
|
|
|
172
187
|
const ModelOptionRow = /*#__PURE__*/ react.memo(ModelOptionRowInner);
|
|
173
188
|
ModelOptionRow.displayName = 'ModelOptionRow';
|
|
174
189
|
function defaultRowActions(model, options = {}) {
|
|
175
|
-
const { i18n, onEdit } = options;
|
|
176
|
-
if (!onEdit) return null;
|
|
190
|
+
const { i18n, onEdit, onDelete } = options;
|
|
191
|
+
if (!onEdit && !onDelete) return null;
|
|
177
192
|
const isByo = 'BYOMAdded' === model.modelSubscriptionType || 'BYOMReplacedAlternative' === model.modelSubscriptionType || 'BYOMReplacedLikeForLike' === model.modelSubscriptionType;
|
|
178
193
|
if (!isByo) return null;
|
|
179
194
|
const editTitle = i18n ? i18n._({
|
|
180
195
|
id: 'modelPicker.row.editConfiguration',
|
|
181
196
|
message: 'Edit configuration'
|
|
182
197
|
}) : 'Edit configuration';
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
198
|
+
const deleteTitle = i18n ? i18n._({
|
|
199
|
+
id: 'modelPicker.row.deleteConfiguration',
|
|
200
|
+
message: 'Delete configuration'
|
|
201
|
+
}) : 'Delete configuration';
|
|
202
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
203
|
+
children: [
|
|
204
|
+
onEdit && /*#__PURE__*/ jsx(Tooltip, {
|
|
205
|
+
title: editTitle,
|
|
206
|
+
arrow: true,
|
|
207
|
+
children: /*#__PURE__*/ jsx(IconButton, {
|
|
208
|
+
size: "small",
|
|
209
|
+
sx: {
|
|
210
|
+
color: 'inherit'
|
|
211
|
+
},
|
|
212
|
+
"aria-label": editTitle,
|
|
213
|
+
onClick: ()=>onEdit(model),
|
|
214
|
+
children: /*#__PURE__*/ jsx(EditOutlined, {
|
|
215
|
+
fontSize: "small"
|
|
216
|
+
})
|
|
217
|
+
})
|
|
218
|
+
}),
|
|
219
|
+
onDelete && /*#__PURE__*/ jsx(Tooltip, {
|
|
220
|
+
title: deleteTitle,
|
|
221
|
+
arrow: true,
|
|
222
|
+
children: /*#__PURE__*/ jsx(IconButton, {
|
|
223
|
+
size: "small",
|
|
224
|
+
sx: {
|
|
225
|
+
color: 'inherit'
|
|
226
|
+
},
|
|
227
|
+
"aria-label": deleteTitle,
|
|
228
|
+
onClick: ()=>onDelete(model),
|
|
229
|
+
children: /*#__PURE__*/ jsx(DeleteOutline, {
|
|
230
|
+
fontSize: "small"
|
|
231
|
+
})
|
|
232
|
+
})
|
|
195
233
|
})
|
|
196
|
-
|
|
234
|
+
]
|
|
197
235
|
});
|
|
198
236
|
}
|
|
199
237
|
export { DENSE_OPTION_HEIGHT, FULL_OPTION_HEIGHT, ModelOptionRow, defaultRowActions };
|
|
@@ -45,10 +45,12 @@ var Paper_default = /*#__PURE__*/ __webpack_require__.n(Paper_namespaceObject);
|
|
|
45
45
|
const Popper_namespaceObject = require("@mui/material/Popper");
|
|
46
46
|
var Popper_default = /*#__PURE__*/ __webpack_require__.n(Popper_namespaceObject);
|
|
47
47
|
const apollo_core_namespaceObject = require("@uipath/apollo-core");
|
|
48
|
-
const PickerPopup = ({ open, anchorEl, onClose, width, placement = 'bottom-start', zIndex = 1400, header, footer, className, 'data-testid': dataTestId, children })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Popper_default(), {
|
|
48
|
+
const PickerPopup = ({ open, anchorEl, onClose, width, placement = 'bottom-start', zIndex = 1400, header, footer, className, container, disablePortal, 'data-testid': dataTestId, children })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Popper_default(), {
|
|
49
49
|
open: open,
|
|
50
50
|
anchorEl: anchorEl,
|
|
51
51
|
placement: placement,
|
|
52
|
+
container: container,
|
|
53
|
+
disablePortal: disablePortal,
|
|
52
54
|
style: {
|
|
53
55
|
zIndex,
|
|
54
56
|
width: width ?? anchorEl?.clientWidth
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Popper from '@mui/material/Popper';
|
|
1
2
|
import type React from 'react';
|
|
2
3
|
export interface PickerPopupProps {
|
|
3
4
|
open: boolean;
|
|
@@ -9,6 +10,8 @@ export interface PickerPopupProps {
|
|
|
9
10
|
header?: React.ReactNode;
|
|
10
11
|
footer?: React.ReactNode;
|
|
11
12
|
className?: string;
|
|
13
|
+
container?: React.ComponentProps<typeof Popper>['container'];
|
|
14
|
+
disablePortal?: boolean;
|
|
12
15
|
'data-testid'?: string;
|
|
13
16
|
children: React.ReactNode;
|
|
14
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickerPopup.d.ts","sourceRoot":"","sources":["../../../../../src/material/components/ap-model-picker/primitives/PickerPopup.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PickerPopup.d.ts","sourceRoot":"","sources":["../../../../../src/material/components/ap-model-picker/primitives/PickerPopup.tsx"],"names":[],"mappings":"AAGA,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAE1C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,cAAc,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;IAGpE,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB,SAAS,CAAC,EAAE,MAAM,CAAC;IAOnB,SAAS,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC;IAO7D,aAAa,CAAC,EAAE,OAAO,CAAC;IAGxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAYD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA8DlD,CAAC"}
|
|
@@ -4,10 +4,12 @@ import ClickAwayListener from "@mui/material/ClickAwayListener";
|
|
|
4
4
|
import Paper from "@mui/material/Paper";
|
|
5
5
|
import Popper from "@mui/material/Popper";
|
|
6
6
|
import { Colors } from "@uipath/apollo-core";
|
|
7
|
-
const PickerPopup = ({ open, anchorEl, onClose, width, placement = 'bottom-start', zIndex = 1400, header, footer, className, 'data-testid': dataTestId, children })=>/*#__PURE__*/ jsx(Popper, {
|
|
7
|
+
const PickerPopup = ({ open, anchorEl, onClose, width, placement = 'bottom-start', zIndex = 1400, header, footer, className, container, disablePortal, 'data-testid': dataTestId, children })=>/*#__PURE__*/ jsx(Popper, {
|
|
8
8
|
open: open,
|
|
9
9
|
anchorEl: anchorEl,
|
|
10
10
|
placement: placement,
|
|
11
|
+
container: container,
|
|
12
|
+
disablePortal: disablePortal,
|
|
11
13
|
style: {
|
|
12
14
|
zIndex,
|
|
13
15
|
width: width ?? anchorEl?.clientWidth
|
|
@@ -10,7 +10,7 @@ export interface ByomDetails {
|
|
|
10
10
|
integrationServiceConnectionId?: string;
|
|
11
11
|
defaultModel?: string;
|
|
12
12
|
customFieldMappings?: Record<string, string> | null;
|
|
13
|
-
|
|
13
|
+
byoConfigurationId?: string;
|
|
14
14
|
}
|
|
15
15
|
export interface ModelCostDetails {
|
|
16
16
|
inputTokenCost?: number;
|
|
@@ -41,6 +41,7 @@ export interface DiscoveryModel {
|
|
|
41
41
|
apiFlavor?: string;
|
|
42
42
|
modelSubscriptionType?: ModelSubscriptionType;
|
|
43
43
|
isRecommended?: boolean;
|
|
44
|
+
isBlockedByPolicy?: boolean;
|
|
44
45
|
isPreview?: boolean;
|
|
45
46
|
deprecationDetails?: DeprecationDetails | null;
|
|
46
47
|
byomDetails?: ByomDetails | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/types.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,aAAa,GACb,iBAAiB,GACjB,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,MAAM,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAC7B,aAAa,GACb,yBAAyB,GACzB,yBAAyB,GACzB,WAAW,GACX,MAAM,CAAC;AAEX,MAAM,MAAM,cAAc,GACtB,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,IAAI,GACJ,QAAQ,GACR,MAAM,CAAC;AAEX,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IACnC,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAQpD,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -24,7 +24,8 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
useDiscoveryModels: ()=>useDiscoveryModels
|
|
27
|
+
useDiscoveryModels: ()=>useDiscoveryModels,
|
|
28
|
+
normalizeDiscoveryModels: ()=>normalizeDiscoveryModels
|
|
28
29
|
});
|
|
29
30
|
const external_react_namespaceObject = require("react");
|
|
30
31
|
function useDiscoveryModels(ctx) {
|
|
@@ -63,7 +64,7 @@ function useDiscoveryModels(ctx) {
|
|
|
63
64
|
if (!res.ok) throw new Error(`Discovery API ${res.status} ${res.statusText}`);
|
|
64
65
|
const data = await res.json();
|
|
65
66
|
const list = Array.isArray(data) ? data : data.models ?? [];
|
|
66
|
-
if (!ctrl.signal.aborted) setModels(
|
|
67
|
+
if (!ctrl.signal.aborted) setModels(normalizeDiscoveryModels(list));
|
|
67
68
|
} catch (err) {
|
|
68
69
|
if (err?.name === 'AbortError') return;
|
|
69
70
|
if (!ctrl.signal.aborted) setError(err instanceof Error ? err : new Error(String(err)));
|
|
@@ -101,11 +102,13 @@ function camelizeDeep(value) {
|
|
|
101
102
|
for (const [k, v] of Object.entries(value))camel[k.charAt(0).toLowerCase() + k.slice(1)] = camelizeDeep(v);
|
|
102
103
|
return camel;
|
|
103
104
|
}
|
|
104
|
-
function
|
|
105
|
+
function normalizeDiscoveryModels(list) {
|
|
105
106
|
return list.map((raw)=>camelizeDeep(raw));
|
|
106
107
|
}
|
|
108
|
+
exports.normalizeDiscoveryModels = __webpack_exports__.normalizeDiscoveryModels;
|
|
107
109
|
exports.useDiscoveryModels = __webpack_exports__.useDiscoveryModels;
|
|
108
110
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
111
|
+
"normalizeDiscoveryModels",
|
|
109
112
|
"useDiscoveryModels"
|
|
110
113
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
111
114
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -6,4 +6,5 @@ export interface UseDiscoveryModelsResult {
|
|
|
6
6
|
refetch: () => void;
|
|
7
7
|
}
|
|
8
8
|
export declare function useDiscoveryModels(ctx: DiscoveryRequestContext | null): UseDiscoveryModelsResult;
|
|
9
|
+
export declare function normalizeDiscoveryModels(list: unknown[]): DiscoveryModel[];
|
|
9
10
|
//# sourceMappingURL=useDiscoveryModels.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDiscoveryModels.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/useDiscoveryModels.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvE,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAWD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,uBAAuB,GAAG,IAAI,GAAG,wBAAwB,CA4EhG"}
|
|
1
|
+
{"version":3,"file":"useDiscoveryModels.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/useDiscoveryModels.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvE,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAWD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,uBAAuB,GAAG,IAAI,GAAG,wBAAwB,CA4EhG;AAuBD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,CAE1E"}
|
|
@@ -35,7 +35,7 @@ function useDiscoveryModels(ctx) {
|
|
|
35
35
|
if (!res.ok) throw new Error(`Discovery API ${res.status} ${res.statusText}`);
|
|
36
36
|
const data = await res.json();
|
|
37
37
|
const list = Array.isArray(data) ? data : data.models ?? [];
|
|
38
|
-
if (!ctrl.signal.aborted) setModels(
|
|
38
|
+
if (!ctrl.signal.aborted) setModels(normalizeDiscoveryModels(list));
|
|
39
39
|
} catch (err) {
|
|
40
40
|
if (err?.name === 'AbortError') return;
|
|
41
41
|
if (!ctrl.signal.aborted) setError(err instanceof Error ? err : new Error(String(err)));
|
|
@@ -73,7 +73,7 @@ function camelizeDeep(value) {
|
|
|
73
73
|
for (const [k, v] of Object.entries(value))camel[k.charAt(0).toLowerCase() + k.slice(1)] = camelizeDeep(v);
|
|
74
74
|
return camel;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function normalizeDiscoveryModels(list) {
|
|
77
77
|
return list.map((raw)=>camelizeDeep(raw));
|
|
78
78
|
}
|
|
79
|
-
export { useDiscoveryModels };
|
|
79
|
+
export { normalizeDiscoveryModels, useDiscoveryModels };
|