@uipath/apollo-react 6.50.0 → 6.52.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.
Files changed (70) hide show
  1. package/dist/canvas/components/AgentCanvas/agent-flow.manifest.d.ts +3 -3
  2. package/dist/canvas/components/BaseNode/BaseNode.cjs +4 -3
  3. package/dist/canvas/components/BaseNode/BaseNode.d.ts.map +1 -1
  4. package/dist/canvas/components/BaseNode/BaseNode.js +4 -3
  5. package/dist/canvas/components/BaseNode/BaseNodeContainer.cjs +16 -3
  6. package/dist/canvas/components/BaseNode/BaseNodeContainer.d.ts +1 -1
  7. package/dist/canvas/components/BaseNode/BaseNodeContainer.d.ts.map +1 -1
  8. package/dist/canvas/components/BaseNode/BaseNodeContainer.js +17 -4
  9. package/dist/canvas/components/BaseNode/BaseNodeOutline.cjs +131 -0
  10. package/dist/canvas/components/BaseNode/BaseNodeOutline.d.ts +17 -0
  11. package/dist/canvas/components/BaseNode/BaseNodeOutline.d.ts.map +1 -0
  12. package/dist/canvas/components/BaseNode/BaseNodeOutline.js +91 -0
  13. package/dist/canvas/components/BaseNode/NodeLabel.cjs +8 -7
  14. package/dist/canvas/components/BaseNode/NodeLabel.d.ts +1 -1
  15. package/dist/canvas/components/BaseNode/NodeLabel.d.ts.map +1 -1
  16. package/dist/canvas/components/BaseNode/NodeLabel.js +8 -7
  17. package/dist/canvas/components/CaseFlow/case-flow.manifest.d.ts +3 -3
  18. package/dist/canvas/components/Guardrails/__fixtures__/guardrail-palette.fixtures.d.ts +10 -0
  19. package/dist/canvas/components/Guardrails/__fixtures__/guardrail-palette.fixtures.d.ts.map +1 -0
  20. package/dist/canvas/components/Guardrails/components/guardrail-palette-item.cjs +73 -0
  21. package/dist/canvas/components/Guardrails/components/guardrail-palette-item.d.ts +12 -0
  22. package/dist/canvas/components/Guardrails/components/guardrail-palette-item.d.ts.map +1 -0
  23. package/dist/canvas/components/Guardrails/components/guardrail-palette-item.js +39 -0
  24. package/dist/canvas/components/Guardrails/guardrail-palette-utils.cjs +84 -0
  25. package/dist/canvas/components/Guardrails/guardrail-palette-utils.d.ts +4 -0
  26. package/dist/canvas/components/Guardrails/guardrail-palette-utils.d.ts.map +1 -0
  27. package/dist/canvas/components/Guardrails/guardrail-palette-utils.js +47 -0
  28. package/dist/canvas/components/Guardrails/guardrail-palette.cjs +193 -0
  29. package/dist/canvas/components/Guardrails/guardrail-palette.d.ts +14 -0
  30. package/dist/canvas/components/Guardrails/guardrail-palette.d.ts.map +1 -0
  31. package/dist/canvas/components/Guardrails/guardrail-palette.js +159 -0
  32. package/dist/canvas/components/Guardrails/i18n.cjs +75 -4
  33. package/dist/canvas/components/Guardrails/i18n.d.ts +15 -0
  34. package/dist/canvas/components/Guardrails/i18n.d.ts.map +1 -1
  35. package/dist/canvas/components/Guardrails/i18n.js +60 -1
  36. package/dist/canvas/components/Guardrails/index.cjs +24 -1
  37. package/dist/canvas/components/Guardrails/index.d.ts +6 -2
  38. package/dist/canvas/components/Guardrails/index.d.ts.map +1 -1
  39. package/dist/canvas/components/Guardrails/index.js +4 -2
  40. package/dist/canvas/components/Guardrails/palette-types.cjs +18 -0
  41. package/dist/canvas/components/Guardrails/palette-types.d.ts +18 -0
  42. package/dist/canvas/components/Guardrails/palette-types.d.ts.map +1 -0
  43. package/dist/canvas/components/Guardrails/palette-types.js +0 -0
  44. package/dist/canvas/locales/en.cjs +1 -1
  45. package/dist/canvas/locales/en.d.ts.map +1 -1
  46. package/dist/canvas/locales/en.js +1 -1
  47. package/dist/canvas/schema/node-definition/index.cjs +17 -5
  48. package/dist/canvas/schema/node-definition/index.d.ts +2 -2
  49. package/dist/canvas/schema/node-definition/index.d.ts.map +1 -1
  50. package/dist/canvas/schema/node-definition/index.js +2 -2
  51. package/dist/canvas/schema/node-definition/node-manifest.d.ts +12 -0
  52. package/dist/canvas/schema/node-definition/node-manifest.d.ts.map +1 -1
  53. package/dist/canvas/schema/node-definition/shape.cjs +29 -2
  54. package/dist/canvas/schema/node-definition/shape.d.ts +9 -0
  55. package/dist/canvas/schema/node-definition/shape.d.ts.map +1 -1
  56. package/dist/canvas/schema/node-definition/shape.js +17 -2
  57. package/dist/canvas/schema/node-instance/base.d.ts +3 -0
  58. package/dist/canvas/schema/node-instance/base.d.ts.map +1 -1
  59. package/dist/canvas/schema/node-instance/node.d.ts +3 -0
  60. package/dist/canvas/schema/node-instance/node.d.ts.map +1 -1
  61. package/dist/canvas/schema/toolbar.d.ts +15 -0
  62. package/dist/canvas/schema/toolbar.d.ts.map +1 -1
  63. package/dist/canvas/storybook-utils/manifests/index.d.ts +3 -3
  64. package/dist/canvas/styles/tailwind.canvas.css +1 -1
  65. package/dist/canvas/styles/variables.css +8 -0
  66. package/dist/canvas/utils/node-size.cjs +2 -1
  67. package/dist/canvas/utils/node-size.d.ts +1 -1
  68. package/dist/canvas/utils/node-size.d.ts.map +1 -1
  69. package/dist/canvas/utils/node-size.js +2 -1
  70. package/package.json +2 -2
@@ -24,7 +24,7 @@ export declare const caseFlowManifest: {
24
24
  canvasLabel?: string | undefined;
25
25
  description?: string | undefined;
26
26
  icon?: string | undefined;
27
- shape?: "square" | "circle" | "container" | "rectangle" | undefined;
27
+ shape?: "document" | "square" | "circle" | "container" | "rectangle" | "pill" | "clipped" | undefined;
28
28
  color?: string | undefined;
29
29
  background?: string | undefined;
30
30
  iconBackground?: string | undefined;
@@ -97,7 +97,7 @@ export declare const caseFlowManifest: {
97
97
  requiresPermissions?: string[] | undefined;
98
98
  hideOnExecution?: boolean | undefined;
99
99
  nodeTypes?: string[] | undefined;
100
- shapes?: ("square" | "circle" | "container" | "rectangle")[] | undefined;
100
+ shapes?: ("document" | "square" | "circle" | "container" | "rectangle" | "pill" | "clipped")[] | undefined;
101
101
  handles?: {
102
102
  handleType: "input" | "output" | "artifact";
103
103
  type?: "target" | "source" | undefined;
@@ -113,7 +113,7 @@ export declare const caseFlowManifest: {
113
113
  requiresPermissions?: string[] | undefined;
114
114
  hideOnExecution?: boolean | undefined;
115
115
  nodeTypes?: string[] | undefined;
116
- shapes?: ("square" | "circle" | "container" | "rectangle")[] | undefined;
116
+ shapes?: ("document" | "square" | "circle" | "container" | "rectangle" | "pill" | "clipped")[] | undefined;
117
117
  handles?: {
118
118
  handleType: "input" | "output" | "artifact";
119
119
  type?: "target" | "source" | undefined;
@@ -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"}