@uipath/apollo-react 6.51.0 → 6.53.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/components/Guardrails/__fixtures__/guardrail-palette.fixtures.d.ts +10 -0
- package/dist/canvas/components/Guardrails/__fixtures__/guardrail-palette.fixtures.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/guardrail-palette-item.cjs +73 -0
- package/dist/canvas/components/Guardrails/components/guardrail-palette-item.d.ts +12 -0
- package/dist/canvas/components/Guardrails/components/guardrail-palette-item.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/guardrail-palette-item.js +39 -0
- package/dist/canvas/components/Guardrails/guardrail-palette-utils.cjs +84 -0
- package/dist/canvas/components/Guardrails/guardrail-palette-utils.d.ts +4 -0
- package/dist/canvas/components/Guardrails/guardrail-palette-utils.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/guardrail-palette-utils.js +47 -0
- package/dist/canvas/components/Guardrails/guardrail-palette.cjs +193 -0
- package/dist/canvas/components/Guardrails/guardrail-palette.d.ts +14 -0
- package/dist/canvas/components/Guardrails/guardrail-palette.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/guardrail-palette.js +159 -0
- package/dist/canvas/components/Guardrails/guardrail-remove-dialog.cjs +156 -0
- package/dist/canvas/components/Guardrails/guardrail-remove-dialog.d.ts +21 -0
- package/dist/canvas/components/Guardrails/guardrail-remove-dialog.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/guardrail-remove-dialog.js +122 -0
- package/dist/canvas/components/Guardrails/i18n.cjs +146 -4
- package/dist/canvas/components/Guardrails/i18n.d.ts +29 -0
- package/dist/canvas/components/Guardrails/i18n.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/i18n.js +120 -2
- package/dist/canvas/components/Guardrails/index.cjs +61 -22
- package/dist/canvas/components/Guardrails/index.d.ts +8 -2
- package/dist/canvas/components/Guardrails/index.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/index.js +5 -2
- package/dist/canvas/components/Guardrails/palette-types.cjs +18 -0
- package/dist/canvas/components/Guardrails/palette-types.d.ts +18 -0
- package/dist/canvas/components/Guardrails/palette-types.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/palette-types.js +0 -0
- package/dist/canvas/locales/en.cjs +1 -1
- package/dist/canvas/locales/en.d.ts.map +1 -1
- package/dist/canvas/locales/en.js +1 -1
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GuardrailPaletteDefinition } from '../palette-types';
|
|
2
|
+
export declare const PII_DEFINITION: GuardrailPaletteDefinition;
|
|
3
|
+
export declare const PROMPT_ATTACKS_DEFINITION: GuardrailPaletteDefinition;
|
|
4
|
+
export declare const UNAUTHORIZED_DEFINITION: GuardrailPaletteDefinition;
|
|
5
|
+
export declare const BYO_FOLDER_DEFINITION: GuardrailPaletteDefinition;
|
|
6
|
+
export declare const BYO_SECOND_CONNECTION_DEFINITION: GuardrailPaletteDefinition;
|
|
7
|
+
export declare const BYO_CONNECTOR_ONLY_DEFINITION: GuardrailPaletteDefinition;
|
|
8
|
+
export declare const UIPATH_DEFINITIONS: GuardrailPaletteDefinition[];
|
|
9
|
+
export declare const MIXED_DEFINITIONS: GuardrailPaletteDefinition[];
|
|
10
|
+
//# sourceMappingURL=guardrail-palette.fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardrail-palette.fixtures.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/__fixtures__/guardrail-palette.fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAQnE,eAAO,MAAM,cAAc,EAAE,0BAK5B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,0BAKvC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,0BAKrC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,0BASnC,CAAC;AAGF,eAAO,MAAM,gCAAgC,EAAE,0BAK9C,CAAC;AAGF,eAAO,MAAM,6BAA6B,EAAE,0BAO3C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,0BAA0B,EAG1D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,0BAA0B,EAKzD,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
GuardrailPaletteItem: ()=>GuardrailPaletteItem
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
|
+
const external_react_namespaceObject = require("react");
|
|
32
|
+
const GuardrailPaletteItem = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ name, description, chips, icon, disabled = false, onSelect, className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("button", {
|
|
33
|
+
ref: ref,
|
|
34
|
+
type: "button",
|
|
35
|
+
"data-slot": "guardrail-palette-item",
|
|
36
|
+
"aria-disabled": disabled || void 0,
|
|
37
|
+
className: (0, apollo_wind_namespaceObject.cn)('flex w-full items-start gap-2 rounded-md p-2 text-left ring-offset-background transition-colors', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2', disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer hover:bg-accent hover:text-accent-foreground', className),
|
|
38
|
+
onClick: disabled ? void 0 : onSelect,
|
|
39
|
+
...props,
|
|
40
|
+
children: [
|
|
41
|
+
icon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
42
|
+
className: "mt-0.5 shrink-0 text-muted-foreground [&_svg]:size-4",
|
|
43
|
+
children: icon
|
|
44
|
+
}),
|
|
45
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
46
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
47
|
+
children: [
|
|
48
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
49
|
+
className: "flex flex-wrap items-center gap-1.5",
|
|
50
|
+
children: [
|
|
51
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
52
|
+
className: "text-sm font-medium",
|
|
53
|
+
children: name
|
|
54
|
+
}),
|
|
55
|
+
chips
|
|
56
|
+
]
|
|
57
|
+
}),
|
|
58
|
+
description && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
59
|
+
className: "whitespace-normal break-words text-xs text-muted-foreground",
|
|
60
|
+
children: description
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
}));
|
|
66
|
+
GuardrailPaletteItem.displayName = 'GuardrailPaletteItem';
|
|
67
|
+
exports.GuardrailPaletteItem = __webpack_exports__.GuardrailPaletteItem;
|
|
68
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
69
|
+
"GuardrailPaletteItem"
|
|
70
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
71
|
+
Object.defineProperty(exports, '__esModule', {
|
|
72
|
+
value: true
|
|
73
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface GuardrailPaletteItemProps extends Omit<React.ComponentPropsWithoutRef<'button'>, 'children' | 'disabled' | 'onSelect' | 'onClick'> {
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
chips?: React.ReactNode;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
onSelect: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const GuardrailPaletteItem: React.ForwardRefExoticComponent<GuardrailPaletteItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export { GuardrailPaletteItem };
|
|
12
|
+
//# sourceMappingURL=guardrail-palette-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardrail-palette-item.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/guardrail-palette-item.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,yBACf,SAAQ,IAAI,CACV,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAExC,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CACjD;IACD,IAAI,EAAE,MAAM,CAAC;IAEb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAExB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAKvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAMD,QAAA,MAAM,oBAAoB,qGAiCzB,CAAC;AAGF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@uipath/apollo-wind";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
const GuardrailPaletteItem = /*#__PURE__*/ forwardRef(({ name, description, chips, icon, disabled = false, onSelect, className, ...props }, ref)=>/*#__PURE__*/ jsxs("button", {
|
|
5
|
+
ref: ref,
|
|
6
|
+
type: "button",
|
|
7
|
+
"data-slot": "guardrail-palette-item",
|
|
8
|
+
"aria-disabled": disabled || void 0,
|
|
9
|
+
className: cn('flex w-full items-start gap-2 rounded-md p-2 text-left ring-offset-background transition-colors', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2', disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer hover:bg-accent hover:text-accent-foreground', className),
|
|
10
|
+
onClick: disabled ? void 0 : onSelect,
|
|
11
|
+
...props,
|
|
12
|
+
children: [
|
|
13
|
+
icon && /*#__PURE__*/ jsx("span", {
|
|
14
|
+
className: "mt-0.5 shrink-0 text-muted-foreground [&_svg]:size-4",
|
|
15
|
+
children: icon
|
|
16
|
+
}),
|
|
17
|
+
/*#__PURE__*/ jsxs("span", {
|
|
18
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
19
|
+
children: [
|
|
20
|
+
/*#__PURE__*/ jsxs("span", {
|
|
21
|
+
className: "flex flex-wrap items-center gap-1.5",
|
|
22
|
+
children: [
|
|
23
|
+
/*#__PURE__*/ jsx("span", {
|
|
24
|
+
className: "text-sm font-medium",
|
|
25
|
+
children: name
|
|
26
|
+
}),
|
|
27
|
+
chips
|
|
28
|
+
]
|
|
29
|
+
}),
|
|
30
|
+
description && /*#__PURE__*/ jsx("span", {
|
|
31
|
+
className: "whitespace-normal break-words text-xs text-muted-foreground",
|
|
32
|
+
children: description
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
}));
|
|
38
|
+
GuardrailPaletteItem.displayName = 'GuardrailPaletteItem';
|
|
39
|
+
export { GuardrailPaletteItem };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
getGuardrailPaletteItemId: ()=>getGuardrailPaletteItemId,
|
|
28
|
+
groupGuardrailsForPalette: ()=>groupGuardrailsForPalette
|
|
29
|
+
});
|
|
30
|
+
const external_definitions_enrich_cjs_namespaceObject = require("./definitions-enrich.cjs");
|
|
31
|
+
function getGuardrailPaletteItemId(definition) {
|
|
32
|
+
return void 0 === definition.byoValidatorName ? definition.validator : `${definition.byoValidatorName}:${definition.byoGuardrailConnectionId ?? ''}`;
|
|
33
|
+
}
|
|
34
|
+
function groupGuardrailsForPalette(definitions, uipathGroupLabel) {
|
|
35
|
+
if (!definitions.some(external_definitions_enrich_cjs_namespaceObject.isByoGuardrailDefinition)) return 0 === definitions.length ? [] : [
|
|
36
|
+
{
|
|
37
|
+
key: '__all__',
|
|
38
|
+
header: null,
|
|
39
|
+
isByo: false,
|
|
40
|
+
definitions: [
|
|
41
|
+
...definitions
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
const byoGroups = new Map();
|
|
46
|
+
const uipathDefinitions = [];
|
|
47
|
+
for (const definition of definitions)if ((0, external_definitions_enrich_cjs_namespaceObject.isByoGuardrailDefinition)(definition)) {
|
|
48
|
+
const key = definition.folderPath ?? definition.byoConnectorName;
|
|
49
|
+
const existing = byoGroups.get(key);
|
|
50
|
+
if (existing) existing.push(definition);
|
|
51
|
+
else byoGroups.set(key, [
|
|
52
|
+
definition
|
|
53
|
+
]);
|
|
54
|
+
} else uipathDefinitions.push(definition);
|
|
55
|
+
const byDisplayName = (a, b)=>a.displayName.localeCompare(b.displayName);
|
|
56
|
+
const groups = [
|
|
57
|
+
...byoGroups.entries()
|
|
58
|
+
].sort(([a], [b])=>(a ?? '').localeCompare(b ?? '')).map(([key, list])=>({
|
|
59
|
+
key: key ?? '__byo__',
|
|
60
|
+
header: key ?? null,
|
|
61
|
+
isByo: true,
|
|
62
|
+
definitions: [
|
|
63
|
+
...list
|
|
64
|
+
].sort(byDisplayName)
|
|
65
|
+
}));
|
|
66
|
+
if (uipathDefinitions.length > 0) groups.push({
|
|
67
|
+
key: '__uipath__',
|
|
68
|
+
header: uipathGroupLabel,
|
|
69
|
+
isByo: false,
|
|
70
|
+
definitions: [
|
|
71
|
+
...uipathDefinitions
|
|
72
|
+
].sort(byDisplayName)
|
|
73
|
+
});
|
|
74
|
+
return groups;
|
|
75
|
+
}
|
|
76
|
+
exports.getGuardrailPaletteItemId = __webpack_exports__.getGuardrailPaletteItemId;
|
|
77
|
+
exports.groupGuardrailsForPalette = __webpack_exports__.groupGuardrailsForPalette;
|
|
78
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
79
|
+
"getGuardrailPaletteItemId",
|
|
80
|
+
"groupGuardrailsForPalette"
|
|
81
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
82
|
+
Object.defineProperty(exports, '__esModule', {
|
|
83
|
+
value: true
|
|
84
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { GuardrailPaletteDefinition, GuardrailPaletteGroup } from './palette-types';
|
|
2
|
+
export declare function getGuardrailPaletteItemId(definition: GuardrailPaletteDefinition): string;
|
|
3
|
+
export declare function groupGuardrailsForPalette<T extends GuardrailPaletteDefinition>(definitions: readonly T[], uipathGroupLabel: string): Array<GuardrailPaletteGroup<T>>;
|
|
4
|
+
//# sourceMappingURL=guardrail-palette-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardrail-palette-utils.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/guardrail-palette-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAQzF,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,0BAA0B,GAAG,MAAM,CAIxF;AAQD,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,0BAA0B,EAC5E,WAAW,EAAE,SAAS,CAAC,EAAE,EACzB,gBAAgB,EAAE,MAAM,GACvB,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CA2CjC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { isByoGuardrailDefinition } from "./definitions-enrich.js";
|
|
2
|
+
function getGuardrailPaletteItemId(definition) {
|
|
3
|
+
return void 0 === definition.byoValidatorName ? definition.validator : `${definition.byoValidatorName}:${definition.byoGuardrailConnectionId ?? ''}`;
|
|
4
|
+
}
|
|
5
|
+
function groupGuardrailsForPalette(definitions, uipathGroupLabel) {
|
|
6
|
+
if (!definitions.some(isByoGuardrailDefinition)) return 0 === definitions.length ? [] : [
|
|
7
|
+
{
|
|
8
|
+
key: '__all__',
|
|
9
|
+
header: null,
|
|
10
|
+
isByo: false,
|
|
11
|
+
definitions: [
|
|
12
|
+
...definitions
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
];
|
|
16
|
+
const byoGroups = new Map();
|
|
17
|
+
const uipathDefinitions = [];
|
|
18
|
+
for (const definition of definitions)if (isByoGuardrailDefinition(definition)) {
|
|
19
|
+
const key = definition.folderPath ?? definition.byoConnectorName;
|
|
20
|
+
const existing = byoGroups.get(key);
|
|
21
|
+
if (existing) existing.push(definition);
|
|
22
|
+
else byoGroups.set(key, [
|
|
23
|
+
definition
|
|
24
|
+
]);
|
|
25
|
+
} else uipathDefinitions.push(definition);
|
|
26
|
+
const byDisplayName = (a, b)=>a.displayName.localeCompare(b.displayName);
|
|
27
|
+
const groups = [
|
|
28
|
+
...byoGroups.entries()
|
|
29
|
+
].sort(([a], [b])=>(a ?? '').localeCompare(b ?? '')).map(([key, list])=>({
|
|
30
|
+
key: key ?? '__byo__',
|
|
31
|
+
header: key ?? null,
|
|
32
|
+
isByo: true,
|
|
33
|
+
definitions: [
|
|
34
|
+
...list
|
|
35
|
+
].sort(byDisplayName)
|
|
36
|
+
}));
|
|
37
|
+
if (uipathDefinitions.length > 0) groups.push({
|
|
38
|
+
key: '__uipath__',
|
|
39
|
+
header: uipathGroupLabel,
|
|
40
|
+
isByo: false,
|
|
41
|
+
definitions: [
|
|
42
|
+
...uipathDefinitions
|
|
43
|
+
].sort(byDisplayName)
|
|
44
|
+
});
|
|
45
|
+
return groups;
|
|
46
|
+
}
|
|
47
|
+
export { getGuardrailPaletteItemId, groupGuardrailsForPalette };
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
GuardrailPalette: ()=>GuardrailPalette
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
32
|
+
const external_react_namespaceObject = require("react");
|
|
33
|
+
const guardrail_palette_item_cjs_namespaceObject = require("./components/guardrail-palette-item.cjs");
|
|
34
|
+
const guardrail_status_banner_cjs_namespaceObject = require("./components/guardrail-status-banner.cjs");
|
|
35
|
+
const guardrail_status_chip_cjs_namespaceObject = require("./components/guardrail-status-chip.cjs");
|
|
36
|
+
const external_guardrail_palette_utils_cjs_namespaceObject = require("./guardrail-palette-utils.cjs");
|
|
37
|
+
const external_i18n_cjs_namespaceObject = require("./i18n.cjs");
|
|
38
|
+
function definitionChips(definition, labels, previewChip) {
|
|
39
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
40
|
+
children: [
|
|
41
|
+
void 0 !== definition.byoConnectorName && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(guardrail_status_chip_cjs_namespaceObject.GuardrailStatusChip, {
|
|
42
|
+
tone: "success",
|
|
43
|
+
children: definition.byoConnectorName
|
|
44
|
+
}),
|
|
45
|
+
previewChip && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(guardrail_status_chip_cjs_namespaceObject.GuardrailStatusChip, {
|
|
46
|
+
tone: "info",
|
|
47
|
+
children: labels.preview
|
|
48
|
+
}),
|
|
49
|
+
'Unauthorised' === definition.status && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(guardrail_status_chip_cjs_namespaceObject.GuardrailStatusChip, {
|
|
50
|
+
tone: "warning",
|
|
51
|
+
children: labels.statusUnauthorized
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function GuardrailPalette({ ootbDefinitions, onSelectOotb, onCreateCustom, isLoading = false, error = null, previewChip = false, labels: labelOverrides, className }) {
|
|
57
|
+
const labels = (0, external_i18n_cjs_namespaceObject.useGuardrailPaletteLabels)(labelOverrides);
|
|
58
|
+
const headerIdPrefix = (0, external_react_namespaceObject.useId)();
|
|
59
|
+
const rootRef = (0, external_react_namespaceObject.useRef)(null);
|
|
60
|
+
const [activeEntry, setActiveEntry] = (0, external_react_namespaceObject.useState)(0);
|
|
61
|
+
const groups = (0, external_react_namespaceObject.useMemo)(()=>(0, external_guardrail_palette_utils_cjs_namespaceObject.groupGuardrailsForPalette)(ootbDefinitions, labels.uipathGroup), [
|
|
62
|
+
ootbDefinitions,
|
|
63
|
+
labels.uipathGroup
|
|
64
|
+
]);
|
|
65
|
+
const isEmpty = 0 === groups.length && void 0 === onCreateCustom;
|
|
66
|
+
const groupOffsets = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
67
|
+
let offset = onCreateCustom ? 1 : 0;
|
|
68
|
+
return groups.map((group)=>{
|
|
69
|
+
const start = offset;
|
|
70
|
+
offset += group.definitions.length;
|
|
71
|
+
return start;
|
|
72
|
+
});
|
|
73
|
+
}, [
|
|
74
|
+
groups,
|
|
75
|
+
onCreateCustom
|
|
76
|
+
]);
|
|
77
|
+
const entryCount = (onCreateCustom ? 1 : 0) + groups.reduce((total, group)=>total + group.definitions.length, 0);
|
|
78
|
+
const rovingEntry = activeEntry < entryCount ? activeEntry : 0;
|
|
79
|
+
const entryElements = ()=>Array.from(rootRef.current?.querySelectorAll('[data-slot="guardrail-palette-item"]') ?? []);
|
|
80
|
+
const handleKeyDown = (event)=>{
|
|
81
|
+
const entries = entryElements();
|
|
82
|
+
const focused = event.target;
|
|
83
|
+
const current = entries.indexOf(focused);
|
|
84
|
+
if (-1 === current) return;
|
|
85
|
+
let next;
|
|
86
|
+
switch(event.key){
|
|
87
|
+
case 'ArrowDown':
|
|
88
|
+
next = current + 1;
|
|
89
|
+
break;
|
|
90
|
+
case 'ArrowUp':
|
|
91
|
+
next = current - 1;
|
|
92
|
+
break;
|
|
93
|
+
case 'Home':
|
|
94
|
+
next = 0;
|
|
95
|
+
break;
|
|
96
|
+
case 'End':
|
|
97
|
+
next = entries.length - 1;
|
|
98
|
+
break;
|
|
99
|
+
default:
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
const target = Math.min(Math.max(next, 0), entries.length - 1);
|
|
104
|
+
setActiveEntry(target);
|
|
105
|
+
entries[target]?.focus();
|
|
106
|
+
};
|
|
107
|
+
const handleFocus = (event)=>{
|
|
108
|
+
const focused = event.target;
|
|
109
|
+
const index = entryElements().findIndex((entry)=>entry === focused);
|
|
110
|
+
if (-1 !== index) setActiveEntry(index);
|
|
111
|
+
};
|
|
112
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
113
|
+
ref: rootRef,
|
|
114
|
+
"data-slot": "guardrail-palette",
|
|
115
|
+
role: "group",
|
|
116
|
+
"aria-label": labels.listAriaLabel,
|
|
117
|
+
className: (0, apollo_wind_namespaceObject.cn)('flex flex-col gap-2', className),
|
|
118
|
+
onKeyDown: handleKeyDown,
|
|
119
|
+
onFocus: handleFocus,
|
|
120
|
+
children: [
|
|
121
|
+
error && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(guardrail_status_banner_cjs_namespaceObject.GuardrailStatusBanner, {
|
|
122
|
+
tone: "error",
|
|
123
|
+
message: labels.loadError
|
|
124
|
+
}),
|
|
125
|
+
isLoading ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("output", {
|
|
126
|
+
className: "flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",
|
|
127
|
+
children: [
|
|
128
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Loader2, {
|
|
129
|
+
className: "size-4 animate-spin",
|
|
130
|
+
"aria-hidden": "true"
|
|
131
|
+
}),
|
|
132
|
+
labels.loading
|
|
133
|
+
]
|
|
134
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
135
|
+
children: [
|
|
136
|
+
onCreateCustom && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(guardrail_palette_item_cjs_namespaceObject.GuardrailPaletteItem, {
|
|
137
|
+
name: labels.createCustom,
|
|
138
|
+
description: labels.createCustomDescription,
|
|
139
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Plus, {
|
|
140
|
+
"aria-hidden": "true"
|
|
141
|
+
}),
|
|
142
|
+
tabIndex: 0 === rovingEntry ? 0 : -1,
|
|
143
|
+
onSelect: onCreateCustom
|
|
144
|
+
}),
|
|
145
|
+
isEmpty && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
|
|
146
|
+
className: "px-2 py-1 text-sm text-muted-foreground",
|
|
147
|
+
children: labels.empty
|
|
148
|
+
}),
|
|
149
|
+
groups.map((group, groupIndex)=>{
|
|
150
|
+
const headerId = `${headerIdPrefix}-${groupIndex}`;
|
|
151
|
+
const groupOffset = groupOffsets[groupIndex] ?? 0;
|
|
152
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
153
|
+
role: "group",
|
|
154
|
+
"aria-labelledby": null !== group.header ? headerId : void 0,
|
|
155
|
+
className: "flex flex-col gap-1",
|
|
156
|
+
children: [
|
|
157
|
+
null !== group.header && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
158
|
+
id: headerId,
|
|
159
|
+
className: "flex items-center gap-1.5 px-2 py-1 text-xs font-semibold text-muted-foreground",
|
|
160
|
+
children: [
|
|
161
|
+
group.isByo && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.FolderOpen, {
|
|
162
|
+
className: "size-3.5",
|
|
163
|
+
"aria-hidden": "true"
|
|
164
|
+
}),
|
|
165
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
166
|
+
className: "truncate",
|
|
167
|
+
children: group.header
|
|
168
|
+
})
|
|
169
|
+
]
|
|
170
|
+
}),
|
|
171
|
+
group.definitions.map((definition, definitionIndex)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(guardrail_palette_item_cjs_namespaceObject.GuardrailPaletteItem, {
|
|
172
|
+
name: definition.displayName,
|
|
173
|
+
description: definition.description,
|
|
174
|
+
chips: definitionChips(definition, labels, previewChip),
|
|
175
|
+
disabled: 'Unauthorised' === definition.status,
|
|
176
|
+
tabIndex: rovingEntry === groupOffset + definitionIndex ? 0 : -1,
|
|
177
|
+
onSelect: ()=>onSelectOotb(definition)
|
|
178
|
+
}, (0, external_guardrail_palette_utils_cjs_namespaceObject.getGuardrailPaletteItemId)(definition)))
|
|
179
|
+
]
|
|
180
|
+
}, group.key);
|
|
181
|
+
})
|
|
182
|
+
]
|
|
183
|
+
})
|
|
184
|
+
]
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
exports.GuardrailPalette = __webpack_exports__.GuardrailPalette;
|
|
188
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
189
|
+
"GuardrailPalette"
|
|
190
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
191
|
+
Object.defineProperty(exports, '__esModule', {
|
|
192
|
+
value: true
|
|
193
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type GuardrailPaletteLabels } from './i18n';
|
|
2
|
+
import type { GuardrailPaletteDefinition } from './palette-types';
|
|
3
|
+
export interface GuardrailPaletteProps<T extends GuardrailPaletteDefinition = GuardrailPaletteDefinition> {
|
|
4
|
+
ootbDefinitions: T[];
|
|
5
|
+
onSelectOotb: (definition: T) => void;
|
|
6
|
+
onCreateCustom?: () => void;
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
error?: Error | null;
|
|
9
|
+
previewChip?: boolean;
|
|
10
|
+
labels?: Partial<GuardrailPaletteLabels>;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function GuardrailPalette<T extends GuardrailPaletteDefinition>({ ootbDefinitions, onSelectOotb, onCreateCustom, isLoading, error, previewChip, labels: labelOverrides, className, }: GuardrailPaletteProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=guardrail-palette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardrail-palette.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/guardrail-palette.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,sBAAsB,EAA6B,MAAM,QAAQ,CAAC;AAChF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAElE,MAAM,WAAW,qBAAqB,CACpC,CAAC,SAAS,0BAA0B,GAAG,0BAA0B;IAMjE,eAAe,EAAE,CAAC,EAAE,CAAC;IAErB,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC,KAAK,IAAI,CAAC;IAKtC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAErB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA4BD,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,0BAA0B,EAAE,EACrE,eAAe,EACf,YAAY,EACZ,cAAc,EACd,SAAiB,EACjB,KAAY,EACZ,WAAmB,EACnB,MAAM,EAAE,cAAc,EACtB,SAAS,GACV,EAAE,qBAAqB,CAAC,CAAC,CAAC,2CAuJ1B"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@uipath/apollo-wind";
|
|
3
|
+
import { FolderOpen, Loader2, Plus } from "lucide-react";
|
|
4
|
+
import { useId, useMemo, useRef, useState } from "react";
|
|
5
|
+
import { GuardrailPaletteItem } from "./components/guardrail-palette-item.js";
|
|
6
|
+
import { GuardrailStatusBanner } from "./components/guardrail-status-banner.js";
|
|
7
|
+
import { GuardrailStatusChip } from "./components/guardrail-status-chip.js";
|
|
8
|
+
import { getGuardrailPaletteItemId, groupGuardrailsForPalette } from "./guardrail-palette-utils.js";
|
|
9
|
+
import { useGuardrailPaletteLabels } from "./i18n.js";
|
|
10
|
+
function definitionChips(definition, labels, previewChip) {
|
|
11
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
12
|
+
children: [
|
|
13
|
+
void 0 !== definition.byoConnectorName && /*#__PURE__*/ jsx(GuardrailStatusChip, {
|
|
14
|
+
tone: "success",
|
|
15
|
+
children: definition.byoConnectorName
|
|
16
|
+
}),
|
|
17
|
+
previewChip && /*#__PURE__*/ jsx(GuardrailStatusChip, {
|
|
18
|
+
tone: "info",
|
|
19
|
+
children: labels.preview
|
|
20
|
+
}),
|
|
21
|
+
'Unauthorised' === definition.status && /*#__PURE__*/ jsx(GuardrailStatusChip, {
|
|
22
|
+
tone: "warning",
|
|
23
|
+
children: labels.statusUnauthorized
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function GuardrailPalette({ ootbDefinitions, onSelectOotb, onCreateCustom, isLoading = false, error = null, previewChip = false, labels: labelOverrides, className }) {
|
|
29
|
+
const labels = useGuardrailPaletteLabels(labelOverrides);
|
|
30
|
+
const headerIdPrefix = useId();
|
|
31
|
+
const rootRef = useRef(null);
|
|
32
|
+
const [activeEntry, setActiveEntry] = useState(0);
|
|
33
|
+
const groups = useMemo(()=>groupGuardrailsForPalette(ootbDefinitions, labels.uipathGroup), [
|
|
34
|
+
ootbDefinitions,
|
|
35
|
+
labels.uipathGroup
|
|
36
|
+
]);
|
|
37
|
+
const isEmpty = 0 === groups.length && void 0 === onCreateCustom;
|
|
38
|
+
const groupOffsets = useMemo(()=>{
|
|
39
|
+
let offset = onCreateCustom ? 1 : 0;
|
|
40
|
+
return groups.map((group)=>{
|
|
41
|
+
const start = offset;
|
|
42
|
+
offset += group.definitions.length;
|
|
43
|
+
return start;
|
|
44
|
+
});
|
|
45
|
+
}, [
|
|
46
|
+
groups,
|
|
47
|
+
onCreateCustom
|
|
48
|
+
]);
|
|
49
|
+
const entryCount = (onCreateCustom ? 1 : 0) + groups.reduce((total, group)=>total + group.definitions.length, 0);
|
|
50
|
+
const rovingEntry = activeEntry < entryCount ? activeEntry : 0;
|
|
51
|
+
const entryElements = ()=>Array.from(rootRef.current?.querySelectorAll('[data-slot="guardrail-palette-item"]') ?? []);
|
|
52
|
+
const handleKeyDown = (event)=>{
|
|
53
|
+
const entries = entryElements();
|
|
54
|
+
const focused = event.target;
|
|
55
|
+
const current = entries.indexOf(focused);
|
|
56
|
+
if (-1 === current) return;
|
|
57
|
+
let next;
|
|
58
|
+
switch(event.key){
|
|
59
|
+
case 'ArrowDown':
|
|
60
|
+
next = current + 1;
|
|
61
|
+
break;
|
|
62
|
+
case 'ArrowUp':
|
|
63
|
+
next = current - 1;
|
|
64
|
+
break;
|
|
65
|
+
case 'Home':
|
|
66
|
+
next = 0;
|
|
67
|
+
break;
|
|
68
|
+
case 'End':
|
|
69
|
+
next = entries.length - 1;
|
|
70
|
+
break;
|
|
71
|
+
default:
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
event.preventDefault();
|
|
75
|
+
const target = Math.min(Math.max(next, 0), entries.length - 1);
|
|
76
|
+
setActiveEntry(target);
|
|
77
|
+
entries[target]?.focus();
|
|
78
|
+
};
|
|
79
|
+
const handleFocus = (event)=>{
|
|
80
|
+
const focused = event.target;
|
|
81
|
+
const index = entryElements().findIndex((entry)=>entry === focused);
|
|
82
|
+
if (-1 !== index) setActiveEntry(index);
|
|
83
|
+
};
|
|
84
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
85
|
+
ref: rootRef,
|
|
86
|
+
"data-slot": "guardrail-palette",
|
|
87
|
+
role: "group",
|
|
88
|
+
"aria-label": labels.listAriaLabel,
|
|
89
|
+
className: cn('flex flex-col gap-2', className),
|
|
90
|
+
onKeyDown: handleKeyDown,
|
|
91
|
+
onFocus: handleFocus,
|
|
92
|
+
children: [
|
|
93
|
+
error && /*#__PURE__*/ jsx(GuardrailStatusBanner, {
|
|
94
|
+
tone: "error",
|
|
95
|
+
message: labels.loadError
|
|
96
|
+
}),
|
|
97
|
+
isLoading ? /*#__PURE__*/ jsxs("output", {
|
|
98
|
+
className: "flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",
|
|
99
|
+
children: [
|
|
100
|
+
/*#__PURE__*/ jsx(Loader2, {
|
|
101
|
+
className: "size-4 animate-spin",
|
|
102
|
+
"aria-hidden": "true"
|
|
103
|
+
}),
|
|
104
|
+
labels.loading
|
|
105
|
+
]
|
|
106
|
+
}) : /*#__PURE__*/ jsxs(Fragment, {
|
|
107
|
+
children: [
|
|
108
|
+
onCreateCustom && /*#__PURE__*/ jsx(GuardrailPaletteItem, {
|
|
109
|
+
name: labels.createCustom,
|
|
110
|
+
description: labels.createCustomDescription,
|
|
111
|
+
icon: /*#__PURE__*/ jsx(Plus, {
|
|
112
|
+
"aria-hidden": "true"
|
|
113
|
+
}),
|
|
114
|
+
tabIndex: 0 === rovingEntry ? 0 : -1,
|
|
115
|
+
onSelect: onCreateCustom
|
|
116
|
+
}),
|
|
117
|
+
isEmpty && /*#__PURE__*/ jsx("p", {
|
|
118
|
+
className: "px-2 py-1 text-sm text-muted-foreground",
|
|
119
|
+
children: labels.empty
|
|
120
|
+
}),
|
|
121
|
+
groups.map((group, groupIndex)=>{
|
|
122
|
+
const headerId = `${headerIdPrefix}-${groupIndex}`;
|
|
123
|
+
const groupOffset = groupOffsets[groupIndex] ?? 0;
|
|
124
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
125
|
+
role: "group",
|
|
126
|
+
"aria-labelledby": null !== group.header ? headerId : void 0,
|
|
127
|
+
className: "flex flex-col gap-1",
|
|
128
|
+
children: [
|
|
129
|
+
null !== group.header && /*#__PURE__*/ jsxs("div", {
|
|
130
|
+
id: headerId,
|
|
131
|
+
className: "flex items-center gap-1.5 px-2 py-1 text-xs font-semibold text-muted-foreground",
|
|
132
|
+
children: [
|
|
133
|
+
group.isByo && /*#__PURE__*/ jsx(FolderOpen, {
|
|
134
|
+
className: "size-3.5",
|
|
135
|
+
"aria-hidden": "true"
|
|
136
|
+
}),
|
|
137
|
+
/*#__PURE__*/ jsx("span", {
|
|
138
|
+
className: "truncate",
|
|
139
|
+
children: group.header
|
|
140
|
+
})
|
|
141
|
+
]
|
|
142
|
+
}),
|
|
143
|
+
group.definitions.map((definition, definitionIndex)=>/*#__PURE__*/ jsx(GuardrailPaletteItem, {
|
|
144
|
+
name: definition.displayName,
|
|
145
|
+
description: definition.description,
|
|
146
|
+
chips: definitionChips(definition, labels, previewChip),
|
|
147
|
+
disabled: 'Unauthorised' === definition.status,
|
|
148
|
+
tabIndex: rovingEntry === groupOffset + definitionIndex ? 0 : -1,
|
|
149
|
+
onSelect: ()=>onSelectOotb(definition)
|
|
150
|
+
}, getGuardrailPaletteItemId(definition)))
|
|
151
|
+
]
|
|
152
|
+
}, group.key);
|
|
153
|
+
})
|
|
154
|
+
]
|
|
155
|
+
})
|
|
156
|
+
]
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
export { GuardrailPalette };
|