@uipath/apollo-react 6.45.3 → 6.47.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 (177) hide show
  1. package/dist/canvas/components/Guardrails/builder-types.cjs +47 -0
  2. package/dist/canvas/components/Guardrails/builder-types.d.ts +129 -0
  3. package/dist/canvas/components/Guardrails/builder-types.d.ts.map +1 -0
  4. package/dist/canvas/components/Guardrails/builder-types.js +10 -0
  5. package/dist/canvas/components/Guardrails/builder-utils.cjs +144 -0
  6. package/dist/canvas/components/Guardrails/builder-utils.d.ts +18 -0
  7. package/dist/canvas/components/Guardrails/builder-utils.d.ts.map +1 -0
  8. package/dist/canvas/components/Guardrails/builder-utils.js +98 -0
  9. package/dist/canvas/components/Guardrails/components/enum-list-chips-field.cjs +85 -0
  10. package/dist/canvas/components/Guardrails/components/enum-list-chips-field.d.ts +3 -0
  11. package/dist/canvas/components/Guardrails/components/enum-list-chips-field.d.ts.map +1 -0
  12. package/dist/canvas/components/Guardrails/components/enum-list-chips-field.js +51 -0
  13. package/dist/canvas/components/Guardrails/components/escalate-action-fields.cjs +268 -0
  14. package/dist/canvas/components/Guardrails/components/escalate-action-fields.d.ts +23 -0
  15. package/dist/canvas/components/Guardrails/components/escalate-action-fields.d.ts.map +1 -0
  16. package/dist/canvas/components/Guardrails/components/escalate-action-fields.js +234 -0
  17. package/dist/canvas/components/Guardrails/components/field-shell.cjs +46 -0
  18. package/dist/canvas/components/Guardrails/components/field-shell.d.ts +7 -0
  19. package/dist/canvas/components/Guardrails/components/field-shell.d.ts.map +1 -0
  20. package/dist/canvas/components/Guardrails/components/field-shell.js +12 -0
  21. package/dist/canvas/components/Guardrails/components/guardrail-action-section.cjs +173 -0
  22. package/dist/canvas/components/Guardrails/components/guardrail-action-section.d.ts +22 -0
  23. package/dist/canvas/components/Guardrails/components/guardrail-action-section.d.ts.map +1 -0
  24. package/dist/canvas/components/Guardrails/components/guardrail-action-section.js +139 -0
  25. package/dist/canvas/components/Guardrails/components/guardrail-chip.cjs +63 -0
  26. package/dist/canvas/components/Guardrails/components/guardrail-chip.d.ts +11 -0
  27. package/dist/canvas/components/Guardrails/components/guardrail-chip.d.ts.map +1 -0
  28. package/dist/canvas/components/Guardrails/components/guardrail-chip.js +26 -0
  29. package/dist/canvas/components/Guardrails/components/guardrail-scope-selector.cjs +217 -0
  30. package/dist/canvas/components/Guardrails/components/guardrail-scope-selector.d.ts +15 -0
  31. package/dist/canvas/components/Guardrails/components/guardrail-scope-selector.d.ts.map +1 -0
  32. package/dist/canvas/components/Guardrails/components/guardrail-scope-selector.js +183 -0
  33. package/dist/canvas/components/Guardrails/components/guardrail-status-banner.cjs +61 -0
  34. package/dist/canvas/components/Guardrails/components/guardrail-status-banner.d.ts +6 -0
  35. package/dist/canvas/components/Guardrails/components/guardrail-status-banner.d.ts.map +1 -0
  36. package/dist/canvas/components/Guardrails/components/guardrail-status-banner.js +27 -0
  37. package/dist/canvas/components/Guardrails/components/map-enum-field.cjs +116 -0
  38. package/dist/canvas/components/Guardrails/components/map-enum-field.d.ts +3 -0
  39. package/dist/canvas/components/Guardrails/components/map-enum-field.d.ts.map +1 -0
  40. package/dist/canvas/components/Guardrails/components/map-enum-field.js +82 -0
  41. package/dist/canvas/components/Guardrails/components/mixed-scopes-banner.cjs +69 -0
  42. package/dist/canvas/components/Guardrails/components/mixed-scopes-banner.d.ts +10 -0
  43. package/dist/canvas/components/Guardrails/components/mixed-scopes-banner.d.ts.map +1 -0
  44. package/dist/canvas/components/Guardrails/components/mixed-scopes-banner.js +35 -0
  45. package/dist/canvas/components/Guardrails/components/parameter-label.cjs +60 -0
  46. package/dist/canvas/components/Guardrails/components/parameter-label.d.ts +11 -0
  47. package/dist/canvas/components/Guardrails/components/parameter-label.d.ts.map +1 -0
  48. package/dist/canvas/components/Guardrails/components/parameter-label.js +26 -0
  49. package/dist/canvas/components/Guardrails/form-schema-builder.cjs +246 -0
  50. package/dist/canvas/components/Guardrails/form-schema-builder.d.ts +15 -0
  51. package/dist/canvas/components/Guardrails/form-schema-builder.d.ts.map +1 -0
  52. package/dist/canvas/components/Guardrails/form-schema-builder.js +197 -0
  53. package/dist/canvas/components/Guardrails/guardrail-builder.cjs +369 -0
  54. package/dist/canvas/components/Guardrails/guardrail-builder.d.ts +41 -0
  55. package/dist/canvas/components/Guardrails/guardrail-builder.d.ts.map +1 -0
  56. package/dist/canvas/components/Guardrails/guardrail-builder.js +335 -0
  57. package/dist/canvas/components/Guardrails/guardrail-form-layout.cjs +138 -0
  58. package/dist/canvas/components/Guardrails/guardrail-form-layout.d.ts +24 -0
  59. package/dist/canvas/components/Guardrails/guardrail-form-layout.d.ts.map +1 -0
  60. package/dist/canvas/components/Guardrails/guardrail-form-layout.js +104 -0
  61. package/dist/canvas/components/Guardrails/guardrail-validator-form.cjs +199 -0
  62. package/dist/canvas/components/Guardrails/guardrail-validator-form.d.ts +3 -0
  63. package/dist/canvas/components/Guardrails/guardrail-validator-form.d.ts.map +1 -0
  64. package/dist/canvas/components/Guardrails/guardrail-validator-form.js +165 -0
  65. package/dist/canvas/components/Guardrails/i18n.cjs +436 -0
  66. package/dist/canvas/components/Guardrails/i18n.d.ts +76 -0
  67. package/dist/canvas/components/Guardrails/i18n.d.ts.map +1 -0
  68. package/dist/canvas/components/Guardrails/i18n.js +384 -0
  69. package/dist/canvas/components/Guardrails/index.cjs +112 -0
  70. package/dist/canvas/components/Guardrails/index.d.ts +16 -0
  71. package/dist/canvas/components/Guardrails/index.d.ts.map +1 -0
  72. package/dist/canvas/components/Guardrails/index.js +9 -0
  73. package/dist/canvas/components/Guardrails/render-parameter-bridge.cjs +60 -0
  74. package/dist/canvas/components/Guardrails/render-parameter-bridge.d.ts +13 -0
  75. package/dist/canvas/components/Guardrails/render-parameter-bridge.d.ts.map +1 -0
  76. package/dist/canvas/components/Guardrails/render-parameter-bridge.js +23 -0
  77. package/dist/canvas/components/Guardrails/types.cjs +18 -0
  78. package/dist/canvas/components/Guardrails/types.d.ts +69 -0
  79. package/dist/canvas/components/Guardrails/types.d.ts.map +1 -0
  80. package/dist/canvas/components/Guardrails/types.js +0 -0
  81. package/dist/canvas/components/Guardrails/use-metadata-form-bridge.cjs +144 -0
  82. package/dist/canvas/components/Guardrails/use-metadata-form-bridge.d.ts +13 -0
  83. package/dist/canvas/components/Guardrails/use-metadata-form-bridge.d.ts.map +1 -0
  84. package/dist/canvas/components/Guardrails/use-metadata-form-bridge.js +110 -0
  85. package/dist/canvas/components/Guardrails/utils.cjs +174 -0
  86. package/dist/canvas/components/Guardrails/utils.d.ts +9 -0
  87. package/dist/canvas/components/Guardrails/utils.d.ts.map +1 -0
  88. package/dist/canvas/components/Guardrails/utils.js +122 -0
  89. package/dist/canvas/components/index.cjs +41 -34
  90. package/dist/canvas/components/index.d.ts +1 -0
  91. package/dist/canvas/components/index.d.ts.map +1 -1
  92. package/dist/canvas/components/index.js +1 -0
  93. package/dist/canvas/locales/de.cjs +1 -1
  94. package/dist/canvas/locales/de.d.ts.map +1 -1
  95. package/dist/canvas/locales/de.js +1 -1
  96. package/dist/canvas/locales/en.cjs +1 -1
  97. package/dist/canvas/locales/en.d.ts.map +1 -1
  98. package/dist/canvas/locales/en.js +1 -1
  99. package/dist/canvas/locales/es-MX.cjs +1 -1
  100. package/dist/canvas/locales/es-MX.d.ts.map +1 -1
  101. package/dist/canvas/locales/es-MX.js +1 -1
  102. package/dist/canvas/locales/es.cjs +1 -1
  103. package/dist/canvas/locales/es.d.ts.map +1 -1
  104. package/dist/canvas/locales/es.js +1 -1
  105. package/dist/canvas/locales/fr.cjs +1 -1
  106. package/dist/canvas/locales/fr.d.ts.map +1 -1
  107. package/dist/canvas/locales/fr.js +1 -1
  108. package/dist/canvas/locales/ja.cjs +1 -1
  109. package/dist/canvas/locales/ja.d.ts.map +1 -1
  110. package/dist/canvas/locales/ja.js +1 -1
  111. package/dist/canvas/locales/ko.cjs +1 -1
  112. package/dist/canvas/locales/ko.d.ts.map +1 -1
  113. package/dist/canvas/locales/ko.js +1 -1
  114. package/dist/canvas/locales/pt-BR.cjs +1 -1
  115. package/dist/canvas/locales/pt-BR.d.ts.map +1 -1
  116. package/dist/canvas/locales/pt-BR.js +1 -1
  117. package/dist/canvas/locales/pt.cjs +1 -1
  118. package/dist/canvas/locales/pt.d.ts.map +1 -1
  119. package/dist/canvas/locales/pt.js +1 -1
  120. package/dist/canvas/locales/ro.cjs +1 -1
  121. package/dist/canvas/locales/ro.d.ts.map +1 -1
  122. package/dist/canvas/locales/ro.js +1 -1
  123. package/dist/canvas/locales/ru.cjs +1 -1
  124. package/dist/canvas/locales/ru.d.ts.map +1 -1
  125. package/dist/canvas/locales/ru.js +1 -1
  126. package/dist/canvas/locales/tr.cjs +1 -1
  127. package/dist/canvas/locales/tr.d.ts.map +1 -1
  128. package/dist/canvas/locales/tr.js +1 -1
  129. package/dist/canvas/locales/zh-CN.cjs +1 -1
  130. package/dist/canvas/locales/zh-CN.d.ts.map +1 -1
  131. package/dist/canvas/locales/zh-CN.js +1 -1
  132. package/dist/canvas/locales/zh-TW.cjs +1 -1
  133. package/dist/canvas/locales/zh-TW.d.ts.map +1 -1
  134. package/dist/canvas/locales/zh-TW.js +1 -1
  135. package/dist/canvas/styles/tailwind.canvas.css +1 -1
  136. package/dist/i18n/index.cjs +5 -1
  137. package/dist/i18n/index.d.ts +1 -0
  138. package/dist/i18n/index.d.ts.map +1 -1
  139. package/dist/i18n/index.js +2 -1
  140. package/dist/icons/MaestroAutomate.cjs +71 -0
  141. package/dist/icons/MaestroAutomate.d.ts +7 -0
  142. package/dist/icons/MaestroAutomate.d.ts.map +1 -0
  143. package/dist/icons/MaestroAutomate.js +24 -0
  144. package/dist/icons/MaestroAutomateFlat.cjs +71 -0
  145. package/dist/icons/MaestroAutomateFlat.d.ts +7 -0
  146. package/dist/icons/MaestroAutomateFlat.d.ts.map +1 -0
  147. package/dist/icons/MaestroAutomateFlat.js +24 -0
  148. package/dist/icons/MaestroBpmn.cjs +71 -0
  149. package/dist/icons/MaestroBpmn.d.ts +7 -0
  150. package/dist/icons/MaestroBpmn.d.ts.map +1 -0
  151. package/dist/icons/MaestroBpmn.js +24 -0
  152. package/dist/icons/MaestroBpmnFlat.cjs +71 -0
  153. package/dist/icons/MaestroBpmnFlat.d.ts +7 -0
  154. package/dist/icons/MaestroBpmnFlat.d.ts.map +1 -0
  155. package/dist/icons/MaestroBpmnFlat.js +24 -0
  156. package/dist/icons/MaestroCase.cjs +71 -0
  157. package/dist/icons/MaestroCase.d.ts +7 -0
  158. package/dist/icons/MaestroCase.d.ts.map +1 -0
  159. package/dist/icons/MaestroCase.js +24 -0
  160. package/dist/icons/MaestroCaseFlat.cjs +71 -0
  161. package/dist/icons/MaestroCaseFlat.d.ts +7 -0
  162. package/dist/icons/MaestroCaseFlat.d.ts.map +1 -0
  163. package/dist/icons/MaestroCaseFlat.js +24 -0
  164. package/dist/icons/MaestroFlow.cjs +71 -0
  165. package/dist/icons/MaestroFlow.d.ts +7 -0
  166. package/dist/icons/MaestroFlow.d.ts.map +1 -0
  167. package/dist/icons/MaestroFlow.js +24 -0
  168. package/dist/icons/MaestroFlowFlat.cjs +71 -0
  169. package/dist/icons/MaestroFlowFlat.d.ts +7 -0
  170. package/dist/icons/MaestroFlowFlat.d.ts.map +1 -0
  171. package/dist/icons/MaestroFlowFlat.js +24 -0
  172. package/dist/icons/index.cjs +68 -4
  173. package/dist/icons/index.d.ts +8 -0
  174. package/dist/icons/index.d.ts.map +1 -1
  175. package/dist/icons/index.js +9 -1
  176. package/dist/test/setup.d.ts.map +1 -1
  177. package/package.json +12 -4
@@ -0,0 +1,15 @@
1
+ import type { GuardrailScope, GuardrailSelector } from '../builder-types';
2
+ import type { GuardrailBuilderLabels } from '../i18n';
3
+ export interface GuardrailScopeSelectorProps {
4
+ selector: GuardrailSelector;
5
+ onChange: (selector: GuardrailSelector) => void;
6
+ availableToolNames?: string[];
7
+ allowedScopes?: GuardrailScope[];
8
+ errors?: {
9
+ scopes?: string;
10
+ toolNames?: string;
11
+ };
12
+ labels: GuardrailBuilderLabels;
13
+ }
14
+ export declare function GuardrailScopeSelector({ selector, onChange, availableToolNames, allowedScopes, errors, labels, }: GuardrailScopeSelectorProps): import("react/jsx-runtime").JSX.Element;
15
+ //# sourceMappingURL=guardrail-scope-selector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guardrail-scope-selector.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/guardrail-scope-selector.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAMtD,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,QAAQ,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAEhD,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE9B,aAAa,CAAC,EAAE,cAAc,EAAE,CAAC;IACjC,MAAM,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,MAAM,EAAE,sBAAsB,CAAC;CAChC;AAMD,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,QAAQ,EACR,kBAAuB,EACvB,aAAa,EACb,MAAM,EACN,MAAM,GACP,EAAE,2BAA2B,2CAkK7B"}
@@ -0,0 +1,183 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { FormField, FormFieldError, Label, RequiredIndicator } from "@uipath/apollo-wind";
3
+ import { Check, Plus } from "lucide-react";
4
+ import { useCallback, useEffect, useId, useMemo } from "react";
5
+ import { FieldShell } from "./field-shell.js";
6
+ import { GuardrailChip } from "./guardrail-chip.js";
7
+ const ALL_SCOPES = [
8
+ 'Agent',
9
+ 'Llm',
10
+ 'Tool'
11
+ ];
12
+ function GuardrailScopeSelector({ selector, onChange, availableToolNames = [], allowedScopes, errors, labels }) {
13
+ const uid = useId();
14
+ const scopeLabels = useMemo(()=>({
15
+ Agent: labels.scopeAgentLabel,
16
+ Llm: labels.scopeLlmLabel,
17
+ Tool: labels.scopeToolLabel
18
+ }), [
19
+ labels
20
+ ]);
21
+ const selectedScopes = useMemo(()=>selector.scopes ?? [], [
22
+ selector.scopes
23
+ ]);
24
+ const hasTools = availableToolNames.length > 0;
25
+ const visibleScopes = useMemo(()=>{
26
+ const scopes = allowedScopes ?? ALL_SCOPES;
27
+ return hasTools ? scopes : scopes.filter((s)=>'Tool' !== s);
28
+ }, [
29
+ allowedScopes,
30
+ hasTools
31
+ ]);
32
+ useEffect(()=>{
33
+ if (!hasTools && selectedScopes.includes('Tool')) {
34
+ const cleaned = selectedScopes.filter((s)=>'Tool' !== s);
35
+ onChange({
36
+ scopes: cleaned
37
+ });
38
+ }
39
+ }, [
40
+ hasTools,
41
+ selectedScopes,
42
+ onChange
43
+ ]);
44
+ const handleToggleScope = useCallback((scope)=>{
45
+ const isSelected = selectedScopes.includes(scope);
46
+ const newScopes = isSelected ? selectedScopes.filter((s)=>s !== scope) : [
47
+ ...selectedScopes,
48
+ scope
49
+ ];
50
+ const hasToolScope = newScopes.includes('Tool');
51
+ if (hasToolScope) isSelected || 'Tool' !== scope ? onChange({
52
+ scopes: newScopes,
53
+ matchNames: selector.matchNames ?? [
54
+ ...availableToolNames
55
+ ]
56
+ }) : onChange({
57
+ scopes: newScopes,
58
+ matchNames: [
59
+ ...availableToolNames
60
+ ]
61
+ });
62
+ else onChange({
63
+ scopes: newScopes
64
+ });
65
+ }, [
66
+ selectedScopes,
67
+ selector.matchNames,
68
+ availableToolNames,
69
+ onChange
70
+ ]);
71
+ const handleToggleTool = useCallback((toolName)=>{
72
+ const current = selector.matchNames ?? [];
73
+ const isSelected = current.includes(toolName);
74
+ const newMatchNames = isSelected ? current.filter((n)=>n !== toolName) : [
75
+ ...current,
76
+ toolName
77
+ ];
78
+ onChange({
79
+ ...selector,
80
+ matchNames: newMatchNames
81
+ });
82
+ }, [
83
+ selector,
84
+ onChange
85
+ ]);
86
+ const selectedTools = useMemo(()=>selector.matchNames ?? [], [
87
+ selector.matchNames
88
+ ]);
89
+ const hasToolScope = selectedScopes.includes('Tool');
90
+ const targetedTools = useMemo(()=>selectedTools.filter((name)=>availableToolNames.includes(name)), [
91
+ selectedTools,
92
+ availableToolNames
93
+ ]);
94
+ const addableTools = useMemo(()=>availableToolNames.filter((name)=>!selectedTools.includes(name)), [
95
+ availableToolNames,
96
+ selectedTools
97
+ ]);
98
+ return /*#__PURE__*/ jsxs("div", {
99
+ "data-slot": "guardrail-scope-selector",
100
+ className: "space-y-3",
101
+ children: [
102
+ /*#__PURE__*/ jsxs(FormField, {
103
+ children: [
104
+ /*#__PURE__*/ jsxs(Label, {
105
+ id: `${uid}-scopes-label`,
106
+ children: [
107
+ labels.scopesLabel,
108
+ /*#__PURE__*/ jsx(RequiredIndicator, {})
109
+ ]
110
+ }),
111
+ /*#__PURE__*/ jsx(FieldShell, {
112
+ invalid: Boolean(errors?.scopes),
113
+ children: /*#__PURE__*/ jsx("div", {
114
+ role: "group",
115
+ "aria-labelledby": `${uid}-scopes-label`,
116
+ "aria-invalid": errors?.scopes ? true : void 0,
117
+ "aria-describedby": errors?.scopes ? `${uid}-scopes-error` : void 0,
118
+ className: "flex flex-wrap gap-1.5",
119
+ children: visibleScopes.map((scope)=>/*#__PURE__*/ jsx(GuardrailChip, {
120
+ pressed: selectedScopes.includes(scope),
121
+ onPressedChange: ()=>handleToggleScope(scope),
122
+ children: scopeLabels[scope]
123
+ }, scope))
124
+ })
125
+ }),
126
+ /*#__PURE__*/ jsx(FormFieldError, {
127
+ id: `${uid}-scopes-error`,
128
+ children: errors?.scopes
129
+ })
130
+ ]
131
+ }),
132
+ hasToolScope && availableToolNames.length > 0 && /*#__PURE__*/ jsxs(FormField, {
133
+ children: [
134
+ /*#__PURE__*/ jsxs(Label, {
135
+ id: `${uid}-tools-label`,
136
+ children: [
137
+ labels.toolsLabel,
138
+ /*#__PURE__*/ jsx(RequiredIndicator, {})
139
+ ]
140
+ }),
141
+ /*#__PURE__*/ jsx(FieldShell, {
142
+ invalid: Boolean(errors?.toolNames),
143
+ children: /*#__PURE__*/ jsxs("div", {
144
+ role: "group",
145
+ "aria-labelledby": `${uid}-tools-label`,
146
+ "aria-invalid": errors?.toolNames ? true : void 0,
147
+ "aria-describedby": errors?.toolNames ? `${uid}-tools-error` : void 0,
148
+ className: "flex flex-wrap gap-1.5",
149
+ children: [
150
+ targetedTools.map((name)=>/*#__PURE__*/ jsxs(GuardrailChip, {
151
+ pressed: true,
152
+ onPressedChange: ()=>handleToggleTool(name),
153
+ children: [
154
+ /*#__PURE__*/ jsx(Check, {
155
+ "aria-hidden": "true"
156
+ }),
157
+ name
158
+ ]
159
+ }, `targeted-${name}`)),
160
+ addableTools.map((name)=>/*#__PURE__*/ jsxs(GuardrailChip, {
161
+ appearance: "addable",
162
+ pressed: false,
163
+ onPressedChange: ()=>handleToggleTool(name),
164
+ children: [
165
+ /*#__PURE__*/ jsx(Plus, {
166
+ "aria-hidden": "true"
167
+ }),
168
+ name
169
+ ]
170
+ }, `addable-${name}`))
171
+ ]
172
+ })
173
+ }),
174
+ /*#__PURE__*/ jsx(FormFieldError, {
175
+ id: `${uid}-tools-error`,
176
+ children: errors?.toolNames
177
+ })
178
+ ]
179
+ })
180
+ ]
181
+ });
182
+ }
183
+ export { GuardrailScopeSelector };
@@ -0,0 +1,61 @@
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
+ GuardrailStatusBanner: ()=>GuardrailStatusBanner
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
+ function GuardrailStatusBanner({ tone, message }) {
33
+ if ('error' === tone) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.Alert, {
34
+ variant: "destructive",
35
+ "data-slot": "guardrail-status-banner",
36
+ children: [
37
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.AlertCircle, {}),
38
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.AlertDescription, {
39
+ children: message
40
+ })
41
+ ]
42
+ });
43
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.Alert, {
44
+ variant: "warning",
45
+ role: "status",
46
+ "data-slot": "guardrail-status-banner",
47
+ children: [
48
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.AlertTriangle, {}),
49
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.AlertDescription, {
50
+ children: message
51
+ })
52
+ ]
53
+ });
54
+ }
55
+ exports.GuardrailStatusBanner = __webpack_exports__.GuardrailStatusBanner;
56
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
57
+ "GuardrailStatusBanner"
58
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
59
+ Object.defineProperty(exports, '__esModule', {
60
+ value: true
61
+ });
@@ -0,0 +1,6 @@
1
+ export interface GuardrailStatusBannerProps {
2
+ tone: 'error' | 'warning';
3
+ message: string;
4
+ }
5
+ export declare function GuardrailStatusBanner({ tone, message }: GuardrailStatusBannerProps): import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=guardrail-status-banner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guardrail-status-banner.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/guardrail-status-banner.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAGD,wBAAgB,qBAAqB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,0BAA0B,2CAiBlF"}
@@ -0,0 +1,27 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Alert, AlertDescription } from "@uipath/apollo-wind";
3
+ import { AlertCircle, AlertTriangle } from "lucide-react";
4
+ function GuardrailStatusBanner({ tone, message }) {
5
+ if ('error' === tone) return /*#__PURE__*/ jsxs(Alert, {
6
+ variant: "destructive",
7
+ "data-slot": "guardrail-status-banner",
8
+ children: [
9
+ /*#__PURE__*/ jsx(AlertCircle, {}),
10
+ /*#__PURE__*/ jsx(AlertDescription, {
11
+ children: message
12
+ })
13
+ ]
14
+ });
15
+ return /*#__PURE__*/ jsxs(Alert, {
16
+ variant: "warning",
17
+ role: "status",
18
+ "data-slot": "guardrail-status-banner",
19
+ children: [
20
+ /*#__PURE__*/ jsx(AlertTriangle, {}),
21
+ /*#__PURE__*/ jsx(AlertDescription, {
22
+ children: message
23
+ })
24
+ ]
25
+ });
26
+ }
27
+ export { GuardrailStatusBanner };
@@ -0,0 +1,116 @@
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
+ MapEnumField: ()=>MapEnumField
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 external_parameter_label_cjs_namespaceObject = require("./parameter-label.cjs");
33
+ function MapEnumField(props) {
34
+ const { value, onChange, error } = props;
35
+ const paramDef = props.paramDef;
36
+ const sourceDef = props.sourceDef;
37
+ const labels = props.labels;
38
+ const sourceSelection = props.sourceSelection;
39
+ const watchedSelection = (0, apollo_wind_namespaceObject.useWatch)({
40
+ name: paramDef.keySource ?? '__guardrail-no-key-source'
41
+ });
42
+ const keys = (Array.isArray(watchedSelection) ? watchedSelection : void 0) ?? sourceSelection ?? sourceDef?.defaultValue ?? [];
43
+ const currentMap = (0, external_react_namespaceObject.useMemo)(()=>(value && 'object' == typeof value && !Array.isArray(value) ? value : paramDef.defaultValue) ?? {}, [
44
+ value,
45
+ paramDef.defaultValue
46
+ ]);
47
+ const defaults = (0, external_react_namespaceObject.useMemo)(()=>paramDef.defaultValue ?? {}, [
48
+ paramDef.defaultValue
49
+ ]);
50
+ const handleThresholdChange = (0, external_react_namespaceObject.useCallback)((key, threshold)=>{
51
+ onChange({
52
+ ...currentMap,
53
+ [key]: threshold
54
+ });
55
+ }, [
56
+ currentMap,
57
+ onChange
58
+ ]);
59
+ if (0 === keys.length) {
60
+ if (!error) return null;
61
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.FormField, {
62
+ "data-slot": "guardrail-map-enum-field",
63
+ children: [
64
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_parameter_label_cjs_namespaceObject.ParameterLabel, {
65
+ paramDef: paramDef,
66
+ labels: labels
67
+ }),
68
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.FormFieldError, {
69
+ children: error
70
+ })
71
+ ]
72
+ });
73
+ }
74
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.FormField, {
75
+ "data-slot": "guardrail-map-enum-field",
76
+ children: [
77
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_parameter_label_cjs_namespaceObject.ParameterLabel, {
78
+ paramDef: paramDef,
79
+ labels: labels
80
+ }),
81
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
82
+ className: "grid gap-1.5",
83
+ children: keys.map((key)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
84
+ className: "flex items-center gap-3",
85
+ children: [
86
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Label, {
87
+ variant: "muted",
88
+ className: "w-1/3 truncate",
89
+ children: sourceDef?.optionLabels?.[key] ?? key
90
+ }),
91
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Input, {
92
+ "aria-label": `${paramDef.label}: ${sourceDef?.optionLabels?.[key] ?? key}`,
93
+ type: "number",
94
+ value: currentMap[key] ?? defaults[key] ?? paramDef.min ?? 0,
95
+ onChange: (e)=>handleThresholdChange(key, Number.parseFloat(e.target.value) || 0),
96
+ min: paramDef.min,
97
+ max: paramDef.max,
98
+ step: paramDef.step,
99
+ className: "flex-1"
100
+ })
101
+ ]
102
+ }, key))
103
+ }),
104
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.FormFieldError, {
105
+ children: error
106
+ })
107
+ ]
108
+ });
109
+ }
110
+ exports.MapEnumField = __webpack_exports__.MapEnumField;
111
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
112
+ "MapEnumField"
113
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
114
+ Object.defineProperty(exports, '__esModule', {
115
+ value: true
116
+ });
@@ -0,0 +1,3 @@
1
+ import type { CustomFieldComponentProps } from '@uipath/apollo-wind';
2
+ export declare function MapEnumField(props: CustomFieldComponentProps): import("react/jsx-runtime").JSX.Element | null;
3
+ //# sourceMappingURL=map-enum-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-enum-field.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/map-enum-field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAgBrE,wBAAgB,YAAY,CAAC,KAAK,EAAE,yBAAyB,kDAgF5D"}
@@ -0,0 +1,82 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { FormField, FormFieldError, Input, Label, useWatch } from "@uipath/apollo-wind";
3
+ import { useCallback, useMemo } from "react";
4
+ import { ParameterLabel } from "./parameter-label.js";
5
+ function MapEnumField(props) {
6
+ const { value, onChange, error } = props;
7
+ const paramDef = props.paramDef;
8
+ const sourceDef = props.sourceDef;
9
+ const labels = props.labels;
10
+ const sourceSelection = props.sourceSelection;
11
+ const watchedSelection = useWatch({
12
+ name: paramDef.keySource ?? '__guardrail-no-key-source'
13
+ });
14
+ const keys = (Array.isArray(watchedSelection) ? watchedSelection : void 0) ?? sourceSelection ?? sourceDef?.defaultValue ?? [];
15
+ const currentMap = useMemo(()=>(value && 'object' == typeof value && !Array.isArray(value) ? value : paramDef.defaultValue) ?? {}, [
16
+ value,
17
+ paramDef.defaultValue
18
+ ]);
19
+ const defaults = useMemo(()=>paramDef.defaultValue ?? {}, [
20
+ paramDef.defaultValue
21
+ ]);
22
+ const handleThresholdChange = useCallback((key, threshold)=>{
23
+ onChange({
24
+ ...currentMap,
25
+ [key]: threshold
26
+ });
27
+ }, [
28
+ currentMap,
29
+ onChange
30
+ ]);
31
+ if (0 === keys.length) {
32
+ if (!error) return null;
33
+ return /*#__PURE__*/ jsxs(FormField, {
34
+ "data-slot": "guardrail-map-enum-field",
35
+ children: [
36
+ /*#__PURE__*/ jsx(ParameterLabel, {
37
+ paramDef: paramDef,
38
+ labels: labels
39
+ }),
40
+ /*#__PURE__*/ jsx(FormFieldError, {
41
+ children: error
42
+ })
43
+ ]
44
+ });
45
+ }
46
+ return /*#__PURE__*/ jsxs(FormField, {
47
+ "data-slot": "guardrail-map-enum-field",
48
+ children: [
49
+ /*#__PURE__*/ jsx(ParameterLabel, {
50
+ paramDef: paramDef,
51
+ labels: labels
52
+ }),
53
+ /*#__PURE__*/ jsx("div", {
54
+ className: "grid gap-1.5",
55
+ children: keys.map((key)=>/*#__PURE__*/ jsxs("div", {
56
+ className: "flex items-center gap-3",
57
+ children: [
58
+ /*#__PURE__*/ jsx(Label, {
59
+ variant: "muted",
60
+ className: "w-1/3 truncate",
61
+ children: sourceDef?.optionLabels?.[key] ?? key
62
+ }),
63
+ /*#__PURE__*/ jsx(Input, {
64
+ "aria-label": `${paramDef.label}: ${sourceDef?.optionLabels?.[key] ?? key}`,
65
+ type: "number",
66
+ value: currentMap[key] ?? defaults[key] ?? paramDef.min ?? 0,
67
+ onChange: (e)=>handleThresholdChange(key, Number.parseFloat(e.target.value) || 0),
68
+ min: paramDef.min,
69
+ max: paramDef.max,
70
+ step: paramDef.step,
71
+ className: "flex-1"
72
+ })
73
+ ]
74
+ }, key))
75
+ }),
76
+ /*#__PURE__*/ jsx(FormFieldError, {
77
+ children: error
78
+ })
79
+ ]
80
+ });
81
+ }
82
+ export { MapEnumField };
@@ -0,0 +1,69 @@
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
+ MixedScopesBanner: ()=>MixedScopesBanner
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
+ function MixedScopesBanner({ otherAppliedScopes, labels }) {
33
+ if (!otherAppliedScopes) return null;
34
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.Alert, {
35
+ variant: "info",
36
+ "data-slot": "guardrail-mixed-scopes-banner",
37
+ children: [
38
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.AlertCircle, {}),
39
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.AlertDescription, {
40
+ children: [
41
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
42
+ children: labels.mixedScopesAlsoApplied
43
+ }),
44
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("ul", {
45
+ className: "list-disc pl-5 mt-1",
46
+ children: [
47
+ otherAppliedScopes.scopes.map((scope)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("li", {
48
+ children: scope
49
+ }, `scope:${scope}`)),
50
+ otherAppliedScopes.tools.map((tool)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("li", {
51
+ children: tool
52
+ }, `tool:${tool}`))
53
+ ]
54
+ }),
55
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
56
+ children: labels.mixedScopesSaveAsNewHint
57
+ })
58
+ ]
59
+ })
60
+ ]
61
+ });
62
+ }
63
+ exports.MixedScopesBanner = __webpack_exports__.MixedScopesBanner;
64
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
65
+ "MixedScopesBanner"
66
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
67
+ Object.defineProperty(exports, '__esModule', {
68
+ value: true
69
+ });
@@ -0,0 +1,10 @@
1
+ import type { GuardrailBuilderLabels } from '../i18n';
2
+ export interface MixedScopesBannerProps {
3
+ otherAppliedScopes: {
4
+ scopes: string[];
5
+ tools: string[];
6
+ } | null;
7
+ labels: Pick<GuardrailBuilderLabels, 'mixedScopesAlsoApplied' | 'mixedScopesSaveAsNewHint'>;
8
+ }
9
+ export declare function MixedScopesBanner({ otherAppliedScopes, labels }: MixedScopesBannerProps): import("react/jsx-runtime").JSX.Element | null;
10
+ //# sourceMappingURL=mixed-scopes-banner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mixed-scopes-banner.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/mixed-scopes-banner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IAErC,kBAAkB,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,IAAI,CAAC;IACjE,MAAM,EAAE,IAAI,CAAC,sBAAsB,EAAE,wBAAwB,GAAG,0BAA0B,CAAC,CAAC;CAC7F;AAMD,wBAAgB,iBAAiB,CAAC,EAAE,kBAAkB,EAAE,MAAM,EAAE,EAAE,sBAAsB,kDAuBvF"}
@@ -0,0 +1,35 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Alert, AlertDescription } from "@uipath/apollo-wind";
3
+ import { AlertCircle } from "lucide-react";
4
+ function MixedScopesBanner({ otherAppliedScopes, labels }) {
5
+ if (!otherAppliedScopes) return null;
6
+ return /*#__PURE__*/ jsxs(Alert, {
7
+ variant: "info",
8
+ "data-slot": "guardrail-mixed-scopes-banner",
9
+ children: [
10
+ /*#__PURE__*/ jsx(AlertCircle, {}),
11
+ /*#__PURE__*/ jsxs(AlertDescription, {
12
+ children: [
13
+ /*#__PURE__*/ jsx("p", {
14
+ children: labels.mixedScopesAlsoApplied
15
+ }),
16
+ /*#__PURE__*/ jsxs("ul", {
17
+ className: "list-disc pl-5 mt-1",
18
+ children: [
19
+ otherAppliedScopes.scopes.map((scope)=>/*#__PURE__*/ jsx("li", {
20
+ children: scope
21
+ }, `scope:${scope}`)),
22
+ otherAppliedScopes.tools.map((tool)=>/*#__PURE__*/ jsx("li", {
23
+ children: tool
24
+ }, `tool:${tool}`))
25
+ ]
26
+ }),
27
+ /*#__PURE__*/ jsx("p", {
28
+ children: labels.mixedScopesSaveAsNewHint
29
+ })
30
+ ]
31
+ })
32
+ ]
33
+ });
34
+ }
35
+ export { MixedScopesBanner };