@uipath/apollo-react 6.57.0 → 6.58.1
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/BaseNode/BaseNodeContainer.cjs +2 -0
- package/dist/canvas/components/BaseNode/BaseNodeContainer.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNodeContainer.js +2 -0
- package/dist/canvas/components/BaseNode/BaseNodeOutline.cjs +2 -0
- package/dist/canvas/components/BaseNode/BaseNodeOutline.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNodeOutline.js +2 -0
- package/dist/canvas/components/Edges/EdgeUtils.cjs +2 -2
- package/dist/canvas/components/Edges/EdgeUtils.d.ts.map +1 -1
- package/dist/canvas/components/Edges/EdgeUtils.js +2 -2
- package/dist/canvas/components/ExecutionStatusIcon/ExecutionStatusIcon.cjs +2 -3
- package/dist/canvas/components/ExecutionStatusIcon/ExecutionStatusIcon.d.ts.map +1 -1
- package/dist/canvas/components/ExecutionStatusIcon/ExecutionStatusIcon.js +2 -3
- package/dist/canvas/components/Guardrails/builder-types.d.ts +7 -0
- package/dist/canvas/components/Guardrails/builder-types.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/escalate-action-fields.cjs +43 -24
- package/dist/canvas/components/Guardrails/components/escalate-action-fields.d.ts +10 -15
- package/dist/canvas/components/Guardrails/components/escalate-action-fields.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/escalate-action-fields.js +44 -25
- package/dist/canvas/components/Guardrails/components/guardrail-action-section.cjs +20 -13
- package/dist/canvas/components/Guardrails/components/guardrail-action-section.d.ts +6 -10
- package/dist/canvas/components/Guardrails/components/guardrail-action-section.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/guardrail-action-section.js +21 -14
- package/dist/canvas/components/Guardrails/i18n.cjs +55 -2
- package/dist/canvas/components/Guardrails/i18n.d.ts +6 -0
- package/dist/canvas/components/Guardrails/i18n.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/i18n.js +42 -1
- package/dist/canvas/components/Guardrails/index.cjs +21 -1
- package/dist/canvas/components/Guardrails/index.d.ts +7 -3
- package/dist/canvas/components/Guardrails/index.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/index.js +4 -2
- package/dist/canvas/components/LoopNode/LoopNodeExecutionCount.cjs +1 -0
- package/dist/canvas/components/LoopNode/LoopNodeExecutionCount.d.ts.map +1 -1
- package/dist/canvas/components/LoopNode/LoopNodeExecutionCount.js +1 -0
- package/dist/canvas/styles/execution-status.cjs +5 -0
- package/dist/canvas/styles/execution-status.d.ts.map +1 -1
- package/dist/canvas/styles/execution-status.js +5 -0
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/package.json +3 -3
|
@@ -46,6 +46,8 @@ const getStatusBorder = (status)=>{
|
|
|
46
46
|
case 'update':
|
|
47
47
|
return 'border-warning animate-glow [--glow-color:var(--warning)]';
|
|
48
48
|
case 'Cancelled':
|
|
49
|
+
case 'UserCancelled':
|
|
50
|
+
return 'border-icon-default animate-glow [--glow-color:var(--color-icon-default)]';
|
|
49
51
|
case 'Failed':
|
|
50
52
|
case 'Terminated':
|
|
51
53
|
case 'ERROR':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseNodeContainer.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAGtE,eAAO,MAAM,eAAe,GAC1B,SAAS,mBAAmB,GAAG,uBAAuB,GAAG,cAAc,KACtE,
|
|
1
|
+
{"version":3,"file":"BaseNodeContainer.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAGtE,eAAO,MAAM,eAAe,GAC1B,SAAS,mBAAmB,GAAG,uBAAuB,GAAG,cAAc,KACtE,MAyBF,CAAC;AAEF,UAAU,kBAAkB;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACtC,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;IAC3C,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,GAAI,qKAc3B,kBAAkB,4CAoEpB,CAAC"}
|
|
@@ -17,6 +17,8 @@ const getStatusBorder = (status)=>{
|
|
|
17
17
|
case 'update':
|
|
18
18
|
return 'border-warning animate-glow [--glow-color:var(--warning)]';
|
|
19
19
|
case 'Cancelled':
|
|
20
|
+
case 'UserCancelled':
|
|
21
|
+
return 'border-icon-default animate-glow [--glow-color:var(--color-icon-default)]';
|
|
20
22
|
case 'Failed':
|
|
21
23
|
case 'Terminated':
|
|
22
24
|
case 'ERROR':
|
|
@@ -67,6 +67,8 @@ const getStatusStroke = (status)=>{
|
|
|
67
67
|
case 'update':
|
|
68
68
|
return 'stroke-warning animate-glow [--glow-color:var(--warning)]';
|
|
69
69
|
case 'Cancelled':
|
|
70
|
+
case 'UserCancelled':
|
|
71
|
+
return 'stroke-icon-default animate-glow [--glow-color:var(--color-icon-default)]';
|
|
70
72
|
case 'Failed':
|
|
71
73
|
case 'Terminated':
|
|
72
74
|
case 'ERROR':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseNodeOutline.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeOutline.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAoBtE,eAAO,MAAM,OAAO,GAAI,OAAO,qBAAqB,EAAE,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAG,MAyBrF,CAAC;AAGF,eAAO,MAAM,eAAe,GAC1B,SAAS,mBAAmB,GAAG,uBAAuB,GAAG,cAAc,KACtE,
|
|
1
|
+
{"version":3,"file":"BaseNodeOutline.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeOutline.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAoBtE,eAAO,MAAM,OAAO,GAAI,OAAO,qBAAqB,EAAE,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAG,MAyBrF,CAAC;AAGF,eAAO,MAAM,eAAe,GAC1B,SAAS,mBAAmB,GAAG,uBAAuB,GAAG,cAAc,KACtE,MAyBF,CAAC;AAgBF,UAAU,oBAAoB;IAC5B,KAAK,EAAE,qBAAqB,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,mBAAmB,GAAG,uBAAuB,GAAG,cAAc,CAAC;CACzE;AAUD,eAAO,MAAM,eAAe,qGACqC,oBAAoB,6CA0DpF,CAAC"}
|
|
@@ -37,6 +37,8 @@ const getStatusStroke = (status)=>{
|
|
|
37
37
|
case 'update':
|
|
38
38
|
return 'stroke-warning animate-glow [--glow-color:var(--warning)]';
|
|
39
39
|
case 'Cancelled':
|
|
40
|
+
case 'UserCancelled':
|
|
41
|
+
return 'stroke-icon-default animate-glow [--glow-color:var(--color-icon-default)]';
|
|
40
42
|
case 'Failed':
|
|
41
43
|
case 'Terminated':
|
|
42
44
|
case 'ERROR':
|
|
@@ -31,7 +31,7 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
31
31
|
const execution_cjs_namespaceObject = require("../../types/execution.cjs");
|
|
32
32
|
const edgeTargetStatusToEdgeColor = {
|
|
33
33
|
ActionNeeded: 'var(--canvas-warning-icon)',
|
|
34
|
-
Cancelled: 'var(--canvas-
|
|
34
|
+
Cancelled: 'var(--canvas-icon-default)',
|
|
35
35
|
Completed: 'var(--canvas-success-icon)',
|
|
36
36
|
CRITICAL: 'var(--canvas-error-icon)',
|
|
37
37
|
ERROR: 'var(--canvas-error-icon)',
|
|
@@ -42,7 +42,7 @@ const edgeTargetStatusToEdgeColor = {
|
|
|
42
42
|
Paused: 'var(--canvas-warning-icon)',
|
|
43
43
|
Terminated: 'var(--canvas-error-icon)',
|
|
44
44
|
Warning: 'var(--canvas-warning-icon)',
|
|
45
|
-
UserCancelled: 'var(--canvas-
|
|
45
|
+
UserCancelled: 'var(--canvas-icon-default)',
|
|
46
46
|
WARNING: 'var(--canvas-warning-icon)',
|
|
47
47
|
None: 'var(--canvas-border)'
|
|
48
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EdgeUtils.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Edges/EdgeUtils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,uBAAuB,CAAC;AAChF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,eAAO,MAAM,2BAA2B,EAAE;KACvC,GAAG,IAAI,aAAa,GAAG,uBAAuB,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"EdgeUtils.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Edges/EdgeUtils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,uBAAuB,CAAC;AAChF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,eAAO,MAAM,2BAA2B,EAAE;KACvC,GAAG,IAAI,aAAa,GAAG,uBAAuB,GAAG,MAAM;CAmBzD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,aAAa,GAAG,uBAAuB,GAAG,SAAS,EAC3D,UAAU,MAAM,mDAYjB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { ElementStatusValues } from "../../types/execution.js";
|
|
3
3
|
const edgeTargetStatusToEdgeColor = {
|
|
4
4
|
ActionNeeded: 'var(--canvas-warning-icon)',
|
|
5
|
-
Cancelled: 'var(--canvas-
|
|
5
|
+
Cancelled: 'var(--canvas-icon-default)',
|
|
6
6
|
Completed: 'var(--canvas-success-icon)',
|
|
7
7
|
CRITICAL: 'var(--canvas-error-icon)',
|
|
8
8
|
ERROR: 'var(--canvas-error-icon)',
|
|
@@ -13,7 +13,7 @@ const edgeTargetStatusToEdgeColor = {
|
|
|
13
13
|
Paused: 'var(--canvas-warning-icon)',
|
|
14
14
|
Terminated: 'var(--canvas-error-icon)',
|
|
15
15
|
Warning: 'var(--canvas-warning-icon)',
|
|
16
|
-
UserCancelled: 'var(--canvas-
|
|
16
|
+
UserCancelled: 'var(--canvas-icon-default)',
|
|
17
17
|
WARNING: 'var(--canvas-warning-icon)',
|
|
18
18
|
None: 'var(--canvas-border)'
|
|
19
19
|
};
|
|
@@ -47,9 +47,8 @@ function getExecutionStatusColor(status) {
|
|
|
47
47
|
case 'Warning':
|
|
48
48
|
return 'var(--color-warning-icon)';
|
|
49
49
|
case 'Cancelled':
|
|
50
|
-
return 'var(--color-error-icon)';
|
|
51
50
|
case 'UserCancelled':
|
|
52
|
-
return 'var(--color-
|
|
51
|
+
return 'var(--color-icon-default)';
|
|
53
52
|
case 'Failed':
|
|
54
53
|
return 'var(--color-error-icon)';
|
|
55
54
|
case 'Terminated':
|
|
@@ -133,7 +132,7 @@ function ExecutionStatusIcon({ status, size = 16 }) {
|
|
|
133
132
|
case 'Cancelled':
|
|
134
133
|
case 'UserCancelled':
|
|
135
134
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
|
|
136
|
-
icon: "circle-
|
|
135
|
+
icon: "circle-slash",
|
|
137
136
|
size: size,
|
|
138
137
|
color: color
|
|
139
138
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExecutionStatusIcon.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/ExecutionStatusIcon/ExecutionStatusIcon.tsx"],"names":[],"mappings":"AAMA,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"ExecutionStatusIcon.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/ExecutionStatusIcon/ExecutionStatusIcon.tsx"],"names":[],"mappings":"AAMA,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAuC1E;AAED,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,IAAS,GACV,EAAE;IACD,MAAM,CAAC,EACH,cAAc,GACd,YAAY,GACZ,WAAW,GACX,eAAe,GACf,WAAW,GACX,QAAQ,GACR,QAAQ,GACR,aAAa,GACb,YAAY,GACZ,SAAS,GACT,WAAW,GACX,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,kDAgDA"}
|
|
@@ -18,9 +18,8 @@ function getExecutionStatusColor(status) {
|
|
|
18
18
|
case 'Warning':
|
|
19
19
|
return 'var(--color-warning-icon)';
|
|
20
20
|
case 'Cancelled':
|
|
21
|
-
return 'var(--color-error-icon)';
|
|
22
21
|
case 'UserCancelled':
|
|
23
|
-
return 'var(--color-
|
|
22
|
+
return 'var(--color-icon-default)';
|
|
24
23
|
case 'Failed':
|
|
25
24
|
return 'var(--color-error-icon)';
|
|
26
25
|
case 'Terminated':
|
|
@@ -104,7 +103,7 @@ function ExecutionStatusIcon({ status, size = 16 }) {
|
|
|
104
103
|
case 'Cancelled':
|
|
105
104
|
case 'UserCancelled':
|
|
106
105
|
return /*#__PURE__*/ jsx(CanvasIcon, {
|
|
107
|
-
icon: "circle-
|
|
106
|
+
icon: "circle-slash",
|
|
108
107
|
size: size,
|
|
109
108
|
color: color
|
|
110
109
|
});
|
|
@@ -61,6 +61,9 @@ export type GuardrailAction = {
|
|
|
61
61
|
app: GuardrailEscalateApp;
|
|
62
62
|
recipient: GuardrailEscalateRecipient;
|
|
63
63
|
};
|
|
64
|
+
export type GuardrailEscalateAction = Extract<GuardrailAction, {
|
|
65
|
+
$actionType: 'escalate';
|
|
66
|
+
}>;
|
|
64
67
|
export type GuardrailDefinitionStatus = 'Available' | 'FeatureDisabled' | 'Unauthorised' | 'Disabled';
|
|
65
68
|
export interface GuardrailDefinition {
|
|
66
69
|
validator: string;
|
|
@@ -94,10 +97,13 @@ export interface GuardrailBuilderErrors {
|
|
|
94
97
|
toolNames?: string;
|
|
95
98
|
parameters?: Record<string, string>;
|
|
96
99
|
}
|
|
100
|
+
export type GuardrailActionErrors = Pick<GuardrailBuilderErrors, 'blockReason' | 'filterFields' | 'recipient' | 'actionApp'>;
|
|
101
|
+
export type GuardrailEscalateActionErrors = Pick<GuardrailActionErrors, 'recipient' | 'actionApp'>;
|
|
97
102
|
export interface GuardrailRecipientSearchContext {
|
|
98
103
|
kind: 'user' | 'group';
|
|
99
104
|
displayValue: string;
|
|
100
105
|
placeholder: string;
|
|
106
|
+
labelId: string;
|
|
101
107
|
invalid: boolean;
|
|
102
108
|
error?: string;
|
|
103
109
|
onSelect: (selection: {
|
|
@@ -116,6 +122,7 @@ export interface GuardrailStaticRecipientContext {
|
|
|
116
122
|
kind: 'email' | 'groupName';
|
|
117
123
|
recipient: GuardrailEscalateRecipient;
|
|
118
124
|
label: string;
|
|
125
|
+
labelId: string;
|
|
119
126
|
invalid: boolean;
|
|
120
127
|
error?: string;
|
|
121
128
|
onChange: (recipient: GuardrailEscalateRecipient) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder-types.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/builder-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAQzF,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AAEtD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,EAAE,CA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AAC;IAMjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACtE,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAGD,MAAM,WAAW,yBAAyB;IAExC,GAAG,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACjC,QAAQ,EAAE,CAAC,GAAG,EAAE,oBAAoB,GAAG,IAAI,KAAK,IAAI,CAAC;IAErD,KAAK,EAAE,MAAM,CAAC;IAEd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD,MAAM,WAAW,+BAA+B;IAE9C,IAAI,EAAE,OAAO,GAAG,WAAW,CAAC;IAE5B,SAAS,EAAE,0BAA0B,CAAC;IAEtC,KAAK,EAAE,MAAM,CAAC;IAEd,OAAO,EAAE,MAAM,CAAC;IAEhB,OAAO,EAAE,OAAO,CAAC;IAEjB,KAAK,CAAC,EAAE,MAAM,CAAC;IAMf,QAAQ,EAAE,CAAC,SAAS,EAAE,0BAA0B,KAAK,IAAI,CAAC;CAC3D;AAED,MAAM,WAAW,qBAAqB;IAEpC,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,+BAA+B,KAAK,KAAK,CAAC,SAAS,CAAC;IAMlF,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,+BAA+B,KAAK,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IAE9F,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,yBAAyB,KAAK,KAAK,CAAC,SAAS,CAAC;IAEtE,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAChC"}
|
|
@@ -31,7 +31,9 @@ const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
|
31
31
|
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
32
32
|
const external_react_namespaceObject = require("react");
|
|
33
33
|
const external_builder_types_cjs_namespaceObject = require("../builder-types.cjs");
|
|
34
|
-
|
|
34
|
+
const external_i18n_cjs_namespaceObject = require("../i18n.cjs");
|
|
35
|
+
function EscalateActionFields({ action, onChange, actionTypeSelect, asGridItems = false, errors, labels: labelOverrides, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp, className }) {
|
|
36
|
+
const labels = (0, external_i18n_cjs_namespaceObject.useGuardrailActionLabels)(labelOverrides);
|
|
35
37
|
const uid = (0, external_react_namespaceObject.useId)();
|
|
36
38
|
const recipientTypeLabels = {
|
|
37
39
|
[external_builder_types_cjs_namespaceObject.GuardrailRecipientType.User]: labels.recipientUserLabel,
|
|
@@ -132,6 +134,22 @@ function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labe
|
|
|
132
134
|
const isSearchable = recipientType === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.User || recipientType === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.Group;
|
|
133
135
|
const searchKind = recipientType === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.User ? 'user' : 'group';
|
|
134
136
|
const searchPlaceholder = 'user' === searchKind ? labels.userSearchPlaceholder : labels.groupSearchPlaceholder;
|
|
137
|
+
const recipientLabel = recipientTypeLabels[displayedRecipientType] ?? labels.recipientFallbackLabel;
|
|
138
|
+
const recipientFieldId = `${uid}-escalate-recipient`;
|
|
139
|
+
const recipientLabelId = `${recipientFieldId}-label`;
|
|
140
|
+
const staticNode = isSearchable ? void 0 : renderStaticRecipient?.({
|
|
141
|
+
kind: displayedRecipientType === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.StaticEmail ? 'email' : 'groupName',
|
|
142
|
+
recipient: action.recipient,
|
|
143
|
+
label: recipientLabel,
|
|
144
|
+
labelId: recipientLabelId,
|
|
145
|
+
invalid: Boolean(errors?.recipient),
|
|
146
|
+
error: errors?.recipient,
|
|
147
|
+
onChange: (recipient)=>onChange({
|
|
148
|
+
...action,
|
|
149
|
+
recipient
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
const ownsRecipientControl = isSearchable ? !renderRecipientSearch : void 0 === staticNode;
|
|
135
153
|
const appPickerCtx = {
|
|
136
154
|
app: action.app.name ? action.app : null,
|
|
137
155
|
onChange: (app)=>onChange({
|
|
@@ -175,8 +193,10 @@ function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labe
|
|
|
175
193
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.FormField, {
|
|
176
194
|
children: [
|
|
177
195
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.Label, {
|
|
196
|
+
id: recipientLabelId,
|
|
197
|
+
htmlFor: ownsRecipientControl ? recipientFieldId : void 0,
|
|
178
198
|
children: [
|
|
179
|
-
|
|
199
|
+
recipientLabel,
|
|
180
200
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.RequiredIndicator, {})
|
|
181
201
|
]
|
|
182
202
|
}),
|
|
@@ -184,11 +204,13 @@ function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labe
|
|
|
184
204
|
kind: searchKind,
|
|
185
205
|
displayValue: recipientDisplayValue,
|
|
186
206
|
placeholder: searchPlaceholder,
|
|
207
|
+
labelId: recipientLabelId,
|
|
187
208
|
invalid: Boolean(errors?.recipient),
|
|
188
209
|
error: errors?.recipient,
|
|
189
210
|
onSelect: handleRecipientSelect,
|
|
190
211
|
onClear: handleRecipientClear
|
|
191
212
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Input, {
|
|
213
|
+
id: recipientFieldId,
|
|
192
214
|
value: recipientDisplayValue,
|
|
193
215
|
onChange: (e)=>handleRecipientSelect({
|
|
194
216
|
value: e.target.value,
|
|
@@ -196,26 +218,13 @@ function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labe
|
|
|
196
218
|
}),
|
|
197
219
|
placeholder: searchPlaceholder,
|
|
198
220
|
error: errors?.recipient
|
|
199
|
-
}) : ((
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
onChange: (recipient)=>onChange({
|
|
207
|
-
...action,
|
|
208
|
-
recipient
|
|
209
|
-
})
|
|
210
|
-
});
|
|
211
|
-
if (void 0 !== staticNode) return staticNode;
|
|
212
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Input, {
|
|
213
|
-
value: recipientValue,
|
|
214
|
-
onChange: (e)=>handleTextValueChange(e.target.value),
|
|
215
|
-
placeholder: displayedRecipientType === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.StaticEmail ? labels.emailPlaceholder : labels.groupNamePlaceholder,
|
|
216
|
-
error: errors?.recipient
|
|
217
|
-
});
|
|
218
|
-
})()
|
|
221
|
+
}) : void 0 !== staticNode ? staticNode : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Input, {
|
|
222
|
+
id: recipientFieldId,
|
|
223
|
+
value: recipientValue,
|
|
224
|
+
onChange: (e)=>handleTextValueChange(e.target.value),
|
|
225
|
+
placeholder: displayedRecipientType === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.StaticEmail ? labels.emailPlaceholder : labels.groupNamePlaceholder,
|
|
226
|
+
error: errors?.recipient
|
|
227
|
+
})
|
|
219
228
|
]
|
|
220
229
|
}),
|
|
221
230
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.FormField, {
|
|
@@ -232,6 +241,7 @@ function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labe
|
|
|
232
241
|
children: [
|
|
233
242
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Info, {}),
|
|
234
243
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.AlertDescription, {
|
|
244
|
+
className: "mt-0",
|
|
235
245
|
children: labels.appPickerUnavailable
|
|
236
246
|
})
|
|
237
247
|
]
|
|
@@ -244,9 +254,9 @@ function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labe
|
|
|
244
254
|
})
|
|
245
255
|
]
|
|
246
256
|
});
|
|
247
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
257
|
+
if (actionTypeSelect) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
248
258
|
"data-slot": "guardrail-escalate-fields",
|
|
249
|
-
className:
|
|
259
|
+
className: (0, apollo_wind_namespaceObject.cn)('@container space-y-3', className),
|
|
250
260
|
children: [
|
|
251
261
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
252
262
|
className: "grid grid-cols-1 @sm:grid-cols-2 gap-3 items-start",
|
|
@@ -258,6 +268,15 @@ function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labe
|
|
|
258
268
|
escalateHelp
|
|
259
269
|
]
|
|
260
270
|
});
|
|
271
|
+
if (asGridItems) return fields;
|
|
272
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
273
|
+
"data-slot": "guardrail-escalate-fields",
|
|
274
|
+
className: (0, apollo_wind_namespaceObject.cn)('space-y-3', className),
|
|
275
|
+
children: [
|
|
276
|
+
fields,
|
|
277
|
+
escalateHelp
|
|
278
|
+
]
|
|
279
|
+
});
|
|
261
280
|
}
|
|
262
281
|
exports.EscalateActionFields = __webpack_exports__.EscalateActionFields;
|
|
263
282
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { type
|
|
3
|
-
import type
|
|
4
|
-
type EscalateAction = Extract<GuardrailAction, {
|
|
5
|
-
$actionType: 'escalate';
|
|
6
|
-
}>;
|
|
2
|
+
import { type GuardrailAppPickerContext, type GuardrailEscalateAction, type GuardrailEscalateActionErrors, type GuardrailRecipientSearchContext, type GuardrailStaticRecipientContext } from '../builder-types';
|
|
3
|
+
import { type GuardrailActionLabels } from '../i18n';
|
|
7
4
|
export interface EscalateActionFieldsProps {
|
|
8
|
-
action:
|
|
9
|
-
onChange: (action:
|
|
10
|
-
actionTypeSelect
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
labels: GuardrailBuilderLabels;
|
|
5
|
+
action: GuardrailEscalateAction;
|
|
6
|
+
onChange: (action: GuardrailEscalateAction) => void;
|
|
7
|
+
actionTypeSelect?: ReactNode;
|
|
8
|
+
asGridItems?: boolean;
|
|
9
|
+
errors?: GuardrailEscalateActionErrors;
|
|
10
|
+
labels?: Partial<GuardrailActionLabels>;
|
|
16
11
|
renderRecipientSearch?: (ctx: GuardrailRecipientSearchContext) => ReactNode;
|
|
17
12
|
renderStaticRecipient?: (ctx: GuardrailStaticRecipientContext) => ReactNode | undefined;
|
|
18
13
|
renderAppPicker?: (ctx: GuardrailAppPickerContext) => ReactNode;
|
|
19
14
|
escalateHelp?: ReactNode;
|
|
15
|
+
className?: string;
|
|
20
16
|
}
|
|
21
|
-
export declare function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labels, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp, }: EscalateActionFieldsProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export {};
|
|
17
|
+
export declare function EscalateActionFields({ action, onChange, actionTypeSelect, asGridItems, errors, labels: labelOverrides, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp, className, }: EscalateActionFieldsProps): import("react/jsx-runtime").JSX.Element;
|
|
23
18
|
//# sourceMappingURL=escalate-action-fields.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escalate-action-fields.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/escalate-action-fields.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"escalate-action-fields.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/escalate-action-fields.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,OAAO,CAAC;AAC3D,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EAElC,KAAK,+BAA+B,EAEpC,KAAK,+BAA+B,EACrC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,qBAAqB,EAA4B,MAAM,SAAS,CAAC;AAE/E,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,uBAAuB,CAAC;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAKpD,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAK7B,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,MAAM,CAAC,EAAE,6BAA6B,CAAC;IAEvC,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACxC,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,+BAA+B,KAAK,SAAS,CAAC;IAC5E,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,+BAA+B,KAAK,SAAS,GAAG,SAAS,CAAC;IACxF,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,yBAAyB,KAAK,SAAS,CAAC;IAEhE,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAWD,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,WAAmB,EACnB,MAAM,EACN,MAAM,EAAE,cAAc,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,YAAY,EACZ,SAAS,GACV,EAAE,yBAAyB,2CAoP3B"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Alert, AlertDescription, FormField, FormFieldError, Input, Label, RequiredIndicator, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@uipath/apollo-wind";
|
|
2
|
+
import { Alert, AlertDescription, FormField, FormFieldError, Input, Label, RequiredIndicator, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, cn } from "@uipath/apollo-wind";
|
|
3
3
|
import { Info } from "lucide-react";
|
|
4
4
|
import { useCallback, useId } from "react";
|
|
5
5
|
import { GuardrailRecipientType } from "../builder-types.js";
|
|
6
|
-
|
|
6
|
+
import { useGuardrailActionLabels } from "../i18n.js";
|
|
7
|
+
function EscalateActionFields({ action, onChange, actionTypeSelect, asGridItems = false, errors, labels: labelOverrides, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp, className }) {
|
|
8
|
+
const labels = useGuardrailActionLabels(labelOverrides);
|
|
7
9
|
const uid = useId();
|
|
8
10
|
const recipientTypeLabels = {
|
|
9
11
|
[GuardrailRecipientType.User]: labels.recipientUserLabel,
|
|
@@ -104,6 +106,22 @@ function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labe
|
|
|
104
106
|
const isSearchable = recipientType === GuardrailRecipientType.User || recipientType === GuardrailRecipientType.Group;
|
|
105
107
|
const searchKind = recipientType === GuardrailRecipientType.User ? 'user' : 'group';
|
|
106
108
|
const searchPlaceholder = 'user' === searchKind ? labels.userSearchPlaceholder : labels.groupSearchPlaceholder;
|
|
109
|
+
const recipientLabel = recipientTypeLabels[displayedRecipientType] ?? labels.recipientFallbackLabel;
|
|
110
|
+
const recipientFieldId = `${uid}-escalate-recipient`;
|
|
111
|
+
const recipientLabelId = `${recipientFieldId}-label`;
|
|
112
|
+
const staticNode = isSearchable ? void 0 : renderStaticRecipient?.({
|
|
113
|
+
kind: displayedRecipientType === GuardrailRecipientType.StaticEmail ? 'email' : 'groupName',
|
|
114
|
+
recipient: action.recipient,
|
|
115
|
+
label: recipientLabel,
|
|
116
|
+
labelId: recipientLabelId,
|
|
117
|
+
invalid: Boolean(errors?.recipient),
|
|
118
|
+
error: errors?.recipient,
|
|
119
|
+
onChange: (recipient)=>onChange({
|
|
120
|
+
...action,
|
|
121
|
+
recipient
|
|
122
|
+
})
|
|
123
|
+
});
|
|
124
|
+
const ownsRecipientControl = isSearchable ? !renderRecipientSearch : void 0 === staticNode;
|
|
107
125
|
const appPickerCtx = {
|
|
108
126
|
app: action.app.name ? action.app : null,
|
|
109
127
|
onChange: (app)=>onChange({
|
|
@@ -147,8 +165,10 @@ function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labe
|
|
|
147
165
|
/*#__PURE__*/ jsxs(FormField, {
|
|
148
166
|
children: [
|
|
149
167
|
/*#__PURE__*/ jsxs(Label, {
|
|
168
|
+
id: recipientLabelId,
|
|
169
|
+
htmlFor: ownsRecipientControl ? recipientFieldId : void 0,
|
|
150
170
|
children: [
|
|
151
|
-
|
|
171
|
+
recipientLabel,
|
|
152
172
|
/*#__PURE__*/ jsx(RequiredIndicator, {})
|
|
153
173
|
]
|
|
154
174
|
}),
|
|
@@ -156,11 +176,13 @@ function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labe
|
|
|
156
176
|
kind: searchKind,
|
|
157
177
|
displayValue: recipientDisplayValue,
|
|
158
178
|
placeholder: searchPlaceholder,
|
|
179
|
+
labelId: recipientLabelId,
|
|
159
180
|
invalid: Boolean(errors?.recipient),
|
|
160
181
|
error: errors?.recipient,
|
|
161
182
|
onSelect: handleRecipientSelect,
|
|
162
183
|
onClear: handleRecipientClear
|
|
163
184
|
}) : /*#__PURE__*/ jsx(Input, {
|
|
185
|
+
id: recipientFieldId,
|
|
164
186
|
value: recipientDisplayValue,
|
|
165
187
|
onChange: (e)=>handleRecipientSelect({
|
|
166
188
|
value: e.target.value,
|
|
@@ -168,26 +190,13 @@ function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labe
|
|
|
168
190
|
}),
|
|
169
191
|
placeholder: searchPlaceholder,
|
|
170
192
|
error: errors?.recipient
|
|
171
|
-
}) : (
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
onChange: (recipient)=>onChange({
|
|
179
|
-
...action,
|
|
180
|
-
recipient
|
|
181
|
-
})
|
|
182
|
-
});
|
|
183
|
-
if (void 0 !== staticNode) return staticNode;
|
|
184
|
-
return /*#__PURE__*/ jsx(Input, {
|
|
185
|
-
value: recipientValue,
|
|
186
|
-
onChange: (e)=>handleTextValueChange(e.target.value),
|
|
187
|
-
placeholder: displayedRecipientType === GuardrailRecipientType.StaticEmail ? labels.emailPlaceholder : labels.groupNamePlaceholder,
|
|
188
|
-
error: errors?.recipient
|
|
189
|
-
});
|
|
190
|
-
})()
|
|
193
|
+
}) : void 0 !== staticNode ? staticNode : /*#__PURE__*/ jsx(Input, {
|
|
194
|
+
id: recipientFieldId,
|
|
195
|
+
value: recipientValue,
|
|
196
|
+
onChange: (e)=>handleTextValueChange(e.target.value),
|
|
197
|
+
placeholder: displayedRecipientType === GuardrailRecipientType.StaticEmail ? labels.emailPlaceholder : labels.groupNamePlaceholder,
|
|
198
|
+
error: errors?.recipient
|
|
199
|
+
})
|
|
191
200
|
]
|
|
192
201
|
}),
|
|
193
202
|
/*#__PURE__*/ jsx(FormField, {
|
|
@@ -204,6 +213,7 @@ function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labe
|
|
|
204
213
|
children: [
|
|
205
214
|
/*#__PURE__*/ jsx(Info, {}),
|
|
206
215
|
/*#__PURE__*/ jsx(AlertDescription, {
|
|
216
|
+
className: "mt-0",
|
|
207
217
|
children: labels.appPickerUnavailable
|
|
208
218
|
})
|
|
209
219
|
]
|
|
@@ -216,9 +226,9 @@ function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labe
|
|
|
216
226
|
})
|
|
217
227
|
]
|
|
218
228
|
});
|
|
219
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
229
|
+
if (actionTypeSelect) return /*#__PURE__*/ jsxs("div", {
|
|
220
230
|
"data-slot": "guardrail-escalate-fields",
|
|
221
|
-
className:
|
|
231
|
+
className: cn('@container space-y-3', className),
|
|
222
232
|
children: [
|
|
223
233
|
/*#__PURE__*/ jsxs("div", {
|
|
224
234
|
className: "grid grid-cols-1 @sm:grid-cols-2 gap-3 items-start",
|
|
@@ -230,5 +240,14 @@ function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labe
|
|
|
230
240
|
escalateHelp
|
|
231
241
|
]
|
|
232
242
|
});
|
|
243
|
+
if (asGridItems) return fields;
|
|
244
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
245
|
+
"data-slot": "guardrail-escalate-fields",
|
|
246
|
+
className: cn('space-y-3', className),
|
|
247
|
+
children: [
|
|
248
|
+
fields,
|
|
249
|
+
escalateHelp
|
|
250
|
+
]
|
|
251
|
+
});
|
|
233
252
|
}
|
|
234
253
|
export { EscalateActionFields };
|
|
@@ -30,8 +30,10 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
30
30
|
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
31
|
const external_react_namespaceObject = require("react");
|
|
32
32
|
const external_builder_utils_cjs_namespaceObject = require("../builder-utils.cjs");
|
|
33
|
+
const external_i18n_cjs_namespaceObject = require("../i18n.cjs");
|
|
33
34
|
const external_escalate_action_fields_cjs_namespaceObject = require("./escalate-action-fields.cjs");
|
|
34
|
-
function GuardrailActionSection({ action, onActionChange, showFilter = false, filterContent, errors, labels, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp }) {
|
|
35
|
+
function GuardrailActionSection({ action, onActionChange, showFilter = false, filterContent, errors, labels: labelOverrides, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp, className }) {
|
|
36
|
+
const labels = (0, external_i18n_cjs_namespaceObject.useGuardrailActionLabels)(labelOverrides);
|
|
35
37
|
const uid = (0, external_react_namespaceObject.useId)();
|
|
36
38
|
const actionTypeSelect = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.FormField, {
|
|
37
39
|
children: [
|
|
@@ -74,21 +76,26 @@ function GuardrailActionSection({ action, onActionChange, showFilter = false, fi
|
|
|
74
76
|
})
|
|
75
77
|
]
|
|
76
78
|
});
|
|
77
|
-
if ('escalate' === action.$actionType) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
if ('escalate' === action.$actionType) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
80
|
+
"data-slot": "guardrail-action-section",
|
|
81
|
+
className: (0, apollo_wind_namespaceObject.cn)('@container', className),
|
|
82
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_escalate_action_fields_cjs_namespaceObject.EscalateActionFields, {
|
|
83
|
+
action: action,
|
|
84
|
+
onChange: onActionChange,
|
|
85
|
+
actionTypeSelect: actionTypeSelect,
|
|
86
|
+
errors: errors,
|
|
87
|
+
labels: labels,
|
|
88
|
+
renderRecipientSearch: renderRecipientSearch,
|
|
89
|
+
renderStaticRecipient: renderStaticRecipient,
|
|
90
|
+
renderAppPicker: renderAppPicker,
|
|
91
|
+
escalateHelp: escalateHelp
|
|
92
|
+
})
|
|
87
93
|
});
|
|
88
94
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
89
|
-
|
|
95
|
+
"data-slot": "guardrail-action-section",
|
|
96
|
+
className: (0, apollo_wind_namespaceObject.cn)('@container', className),
|
|
90
97
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
91
|
-
className: "grid grid-cols-1 @sm:grid-cols-2 gap-3",
|
|
98
|
+
className: "grid grid-cols-1 @sm:grid-cols-2 gap-3 items-start",
|
|
92
99
|
children: [
|
|
93
100
|
actionTypeSelect,
|
|
94
101
|
'log' === action.$actionType && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.FormField, {
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type { GuardrailAction, GuardrailAppPickerContext, GuardrailRecipientSearchContext, GuardrailStaticRecipientContext } from '../builder-types';
|
|
3
|
-
import type
|
|
2
|
+
import type { GuardrailAction, GuardrailActionErrors, GuardrailAppPickerContext, GuardrailRecipientSearchContext, GuardrailStaticRecipientContext } from '../builder-types';
|
|
3
|
+
import { type GuardrailActionLabels } from '../i18n';
|
|
4
4
|
export interface GuardrailActionSectionProps {
|
|
5
5
|
action: GuardrailAction;
|
|
6
6
|
onActionChange: (action: GuardrailAction) => void;
|
|
7
7
|
showFilter?: boolean;
|
|
8
8
|
filterContent?: ReactNode;
|
|
9
|
-
errors?:
|
|
10
|
-
|
|
11
|
-
filterFields?: string;
|
|
12
|
-
recipient?: string;
|
|
13
|
-
actionApp?: string;
|
|
14
|
-
};
|
|
15
|
-
labels: GuardrailBuilderLabels;
|
|
9
|
+
errors?: GuardrailActionErrors;
|
|
10
|
+
labels?: Partial<GuardrailActionLabels>;
|
|
16
11
|
renderRecipientSearch?: (ctx: GuardrailRecipientSearchContext) => ReactNode;
|
|
17
12
|
renderStaticRecipient?: (ctx: GuardrailStaticRecipientContext) => ReactNode | undefined;
|
|
18
13
|
renderAppPicker?: (ctx: GuardrailAppPickerContext) => ReactNode;
|
|
19
14
|
escalateHelp?: ReactNode;
|
|
15
|
+
className?: string;
|
|
20
16
|
}
|
|
21
|
-
export declare function GuardrailActionSection({ action, onActionChange, showFilter, filterContent, errors, labels, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp, }: GuardrailActionSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function GuardrailActionSection({ action, onActionChange, showFilter, filterContent, errors, labels: labelOverrides, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp, className, }: GuardrailActionSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
22
18
|
//# sourceMappingURL=guardrail-action-section.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guardrail-action-section.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/guardrail-action-section.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"guardrail-action-section.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/guardrail-action-section.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EACrB,yBAAyB,EACzB,+BAA+B,EAC/B,+BAA+B,EAChC,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,qBAAqB,EAA4B,MAAM,SAAS,CAAC;AAG/E,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,eAAe,CAAC;IAExB,cAAc,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IAElD,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAE/B,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACxC,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,+BAA+B,KAAK,SAAS,CAAC;IAK5E,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,+BAA+B,KAAK,SAAS,GAAG,SAAS,CAAC;IACxF,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,yBAAyB,KAAK,SAAS,CAAC;IAEhE,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAUD,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,cAAc,EACd,UAAkB,EAClB,aAAa,EACb,MAAM,EACN,MAAM,EAAE,cAAc,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,YAAY,EACZ,SAAS,GACV,EAAE,2BAA2B,2CAwG7B"}
|