@uipath/apollo-react 6.48.0 → 6.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/components/Guardrails/__fixtures__/catalog-coverage.d.ts +8 -0
- package/dist/canvas/components/Guardrails/__fixtures__/catalog-coverage.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/__fixtures__/definitions-wire.fixtures.d.ts +13 -0
- package/dist/canvas/components/Guardrails/__fixtures__/definitions-wire.fixtures.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/__fixtures__/dnd-geometry.d.ts +3 -0
- package/dist/canvas/components/Guardrails/__fixtures__/dnd-geometry.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/__fixtures__/guardrail-list.fixtures.d.ts +9 -0
- package/dist/canvas/components/Guardrails/__fixtures__/guardrail-list.fixtures.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/__fixtures__/host-copy-baselines.d.ts +4 -0
- package/dist/canvas/components/Guardrails/__fixtures__/host-copy-baselines.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/builder-types.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/guardrail-chip.cjs +5 -1
- package/dist/canvas/components/Guardrails/components/guardrail-chip.d.ts +1 -0
- package/dist/canvas/components/Guardrails/components/guardrail-chip.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/guardrail-chip.js +3 -2
- package/dist/canvas/components/Guardrails/components/guardrail-list-row.cjs +218 -0
- package/dist/canvas/components/Guardrails/components/guardrail-list-row.d.ts +26 -0
- package/dist/canvas/components/Guardrails/components/guardrail-list-row.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/guardrail-list-row.js +184 -0
- package/dist/canvas/components/Guardrails/components/guardrail-status-banner.cjs +2 -0
- package/dist/canvas/components/Guardrails/components/guardrail-status-banner.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/guardrail-status-banner.js +2 -0
- package/dist/canvas/components/Guardrails/components/guardrail-status-chip.cjs +60 -0
- package/dist/canvas/components/Guardrails/components/guardrail-status-chip.d.ts +7 -0
- package/dist/canvas/components/Guardrails/components/guardrail-status-chip.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/guardrail-status-chip.js +26 -0
- package/dist/canvas/components/Guardrails/components/mixed-scopes-banner.cjs +1 -0
- package/dist/canvas/components/Guardrails/components/mixed-scopes-banner.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/mixed-scopes-banner.js +1 -0
- package/dist/canvas/components/Guardrails/definitions-copy.cjs +369 -0
- package/dist/canvas/components/Guardrails/definitions-copy.d.ts +14 -0
- package/dist/canvas/components/Guardrails/definitions-copy.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/definitions-copy.js +326 -0
- package/dist/canvas/components/Guardrails/definitions-enrich.cjs +173 -0
- package/dist/canvas/components/Guardrails/definitions-enrich.d.ts +30 -0
- package/dist/canvas/components/Guardrails/definitions-enrich.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/definitions-enrich.js +130 -0
- package/dist/canvas/components/Guardrails/definitions-parse.cjs +199 -0
- package/dist/canvas/components/Guardrails/definitions-parse.d.ts +13 -0
- package/dist/canvas/components/Guardrails/definitions-parse.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/definitions-parse.js +165 -0
- package/dist/canvas/components/Guardrails/definitions-wire.cjs +18 -0
- package/dist/canvas/components/Guardrails/definitions-wire.d.ts +59 -0
- package/dist/canvas/components/Guardrails/definitions-wire.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/definitions-wire.js +0 -0
- package/dist/canvas/components/Guardrails/guardrail-list-utils.cjs +103 -0
- package/dist/canvas/components/Guardrails/guardrail-list-utils.d.ts +10 -0
- package/dist/canvas/components/Guardrails/guardrail-list-utils.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/guardrail-list-utils.js +60 -0
- package/dist/canvas/components/Guardrails/guardrail-list.cjs +214 -0
- package/dist/canvas/components/Guardrails/guardrail-list.d.ts +33 -0
- package/dist/canvas/components/Guardrails/guardrail-list.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/guardrail-list.js +180 -0
- package/dist/canvas/components/Guardrails/i18n.cjs +124 -16
- package/dist/canvas/components/Guardrails/i18n.d.ts +25 -0
- package/dist/canvas/components/Guardrails/i18n.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/i18n.js +110 -14
- package/dist/canvas/components/Guardrails/index.cjs +85 -7
- package/dist/canvas/components/Guardrails/index.d.ts +21 -2
- package/dist/canvas/components/Guardrails/index.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/index.js +11 -2
- package/dist/canvas/components/Guardrails/list-types.cjs +18 -0
- package/dist/canvas/components/Guardrails/list-types.d.ts +51 -0
- package/dist/canvas/components/Guardrails/list-types.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/list-types.js +0 -0
- package/dist/canvas/components/Guardrails/types.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/use-guardrail-definitions.cjs +158 -0
- package/dist/canvas/components/Guardrails/use-guardrail-definitions.d.ts +30 -0
- package/dist/canvas/components/Guardrails/use-guardrail-definitions.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/use-guardrail-definitions.js +121 -0
- package/dist/canvas/locales/en.cjs +1 -1
- package/dist/canvas/locales/en.d.ts.map +1 -1
- package/dist/canvas/locales/en.js +1 -1
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const CANVAS_LOCALES: string[];
|
|
2
|
+
export declare const readCanvasCatalog: (locale: string) => Record<string, string>;
|
|
3
|
+
export declare function findCatalogDrift(messages: Readonly<Record<string, string>>): {
|
|
4
|
+
missing: string[];
|
|
5
|
+
drifted: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare function findCatalogOrphans(messages: Readonly<Record<string, string>>, prefix: string): string[];
|
|
8
|
+
//# sourceMappingURL=catalog-coverage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-coverage.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/__fixtures__/catalog-coverage.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,cAAc,UAe1B,CAAC;AAIF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CACF,CAAC;AAOvE,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG;IAC5E,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAWA;AAOD,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC1C,MAAM,EAAE,MAAM,GACb,MAAM,EAAE,CAOV"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { GuardrailDefinitionWire } from '../definitions-wire';
|
|
2
|
+
export declare const PII_ENTITY_OPTIONS: string[];
|
|
3
|
+
export declare const PII_DETECTION_WIRE: GuardrailDefinitionWire;
|
|
4
|
+
export declare const HARMFUL_CONTENT_WIRE: GuardrailDefinitionWire;
|
|
5
|
+
export declare const PROMPT_INJECTION_WIRE: GuardrailDefinitionWire;
|
|
6
|
+
export declare const USER_PROMPT_ATTACKS_WIRE: GuardrailDefinitionWire;
|
|
7
|
+
export declare const INTELLECTUAL_PROPERTY_WIRE: GuardrailDefinitionWire;
|
|
8
|
+
export declare const LLM_AS_JUDGE_WIRE: GuardrailDefinitionWire;
|
|
9
|
+
export declare const BYO_WIRE: GuardrailDefinitionWire;
|
|
10
|
+
export declare const UNCURATED_WIRE: GuardrailDefinitionWire;
|
|
11
|
+
export declare const ALL_BUILT_IN_WIRE: GuardrailDefinitionWire[];
|
|
12
|
+
export declare const RAW_PAYLOAD_WITH_NOISE: unknown;
|
|
13
|
+
//# sourceMappingURL=definitions-wire.fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions-wire.fixtures.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/__fixtures__/definitions-wire.fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAUnE,eAAO,MAAM,kBAAkB,EAAE,MAAM,EA0BtC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,uBAsBhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,uBAuBlC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,uBAenC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,uBAKtC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,uBAaxC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,uBA6C/B,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,uBAuBtB,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,uBAc5B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,uBAAuB,EAOtD,CAAC;AAMF,eAAO,MAAM,sBAAsB,EAAE,OAgBpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dnd-geometry.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/__fixtures__/dnd-geometry.ts"],"names":[],"mappings":"AAsCA,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,WAAW,EACtB,QAAQ,SAAqC,GAC5C,IAAI,CAUN;AAUD,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAInD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { GuardrailListDefinition, GuardrailListItem } from '../list-types';
|
|
2
|
+
export declare const PII_GUARDRAIL: GuardrailListItem;
|
|
3
|
+
export declare const BYO_GUARDRAIL: GuardrailListItem;
|
|
4
|
+
export declare const CUSTOM_GUARDRAIL: GuardrailListItem;
|
|
5
|
+
export declare const GUARDRAILS: GuardrailListItem[];
|
|
6
|
+
export declare const PII_DEFINITION: GuardrailListDefinition;
|
|
7
|
+
export declare const BYO_DEFINITION: GuardrailListDefinition;
|
|
8
|
+
export declare const DEFINITIONS: GuardrailListDefinition[];
|
|
9
|
+
//# sourceMappingURL=guardrail-list.fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardrail-list.fixtures.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/__fixtures__/guardrail-list.fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAQhF,eAAO,MAAM,aAAa,EAAE,iBAQ3B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,iBAQ3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,iBAM9B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,iBAAiB,EAAqD,CAAC;AAEhG,eAAO,MAAM,cAAc,EAAE,uBAG5B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,uBAK5B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,uBAAuB,EAAqC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-copy-baselines.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/__fixtures__/host-copy-baselines.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAgE9D,eAAO,MAAM,cAAc,EAAE,kBA6E5B,CAAC;AAGF,eAAO,MAAM,YAAY,EAAE,kBA+D1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder-types.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/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: ()=>guardrailChipVariants,
|
|
28
|
+
GUARDRAIL_CHIP_GEOMETRY: ()=>GUARDRAIL_CHIP_GEOMETRY,
|
|
28
29
|
GuardrailChip: ()=>GuardrailChip
|
|
29
30
|
});
|
|
30
31
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
32
|
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
32
33
|
const external_class_variance_authority_namespaceObject = require("class-variance-authority");
|
|
33
34
|
const external_react_namespaceObject = require("react");
|
|
34
|
-
const
|
|
35
|
+
const GUARDRAIL_CHIP_GEOMETRY = 'min-w-0 gap-1 rounded-full border px-2.5 text-xs font-medium [&_svg]:size-3';
|
|
36
|
+
const guardrailChipVariants = (0, external_class_variance_authority_namespaceObject.cva)(`h-6 ${GUARDRAIL_CHIP_GEOMETRY}`, {
|
|
35
37
|
variants: {
|
|
36
38
|
appearance: {
|
|
37
39
|
default: 'bg-background text-foreground border-border hover:bg-muted hover:text-foreground data-[state=on]:bg-brand-subtle data-[state=on]:text-foreground-accent data-[state=on]:border-brand-lighter future:text-foreground future:hover:text-foreground future:data-[state=on]:text-foreground-accent',
|
|
@@ -52,9 +54,11 @@ const GuardrailChip = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({
|
|
|
52
54
|
...props
|
|
53
55
|
}));
|
|
54
56
|
GuardrailChip.displayName = 'GuardrailChip';
|
|
57
|
+
exports.GUARDRAIL_CHIP_GEOMETRY = __webpack_exports__.GUARDRAIL_CHIP_GEOMETRY;
|
|
55
58
|
exports.GuardrailChip = __webpack_exports__.GuardrailChip;
|
|
56
59
|
exports.guardrailChipVariants = __webpack_exports__.guardrailChipVariants;
|
|
57
60
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
61
|
+
"GUARDRAIL_CHIP_GEOMETRY",
|
|
58
62
|
"GuardrailChip",
|
|
59
63
|
"guardrailChipVariants"
|
|
60
64
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Toggle } from '@uipath/apollo-wind';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
export declare const GUARDRAIL_CHIP_GEOMETRY = "min-w-0 gap-1 rounded-full border px-2.5 text-xs font-medium [&_svg]:size-3";
|
|
4
5
|
declare const guardrailChipVariants: (props?: ({
|
|
5
6
|
appearance?: "default" | "addable" | null | undefined;
|
|
6
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guardrail-chip.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/guardrail-chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAM,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"guardrail-chip.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/guardrail-chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAM,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,eAAO,MAAM,uBAAuB,gFAC2C,CAAC;AAOhF,QAAA,MAAM,qBAAqB;;8EAgB1B,CAAC;AAEF,MAAM,WAAW,kBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,MAAM,CAAC,EACnD,YAAY,CAAC,OAAO,qBAAqB,CAAC;CAAG;AAGjD,QAAA,MAAM,aAAa,8FASlB,CAAC;AAGF,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -2,7 +2,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Toggle, cn } from "@uipath/apollo-wind";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { forwardRef } from "react";
|
|
5
|
-
const
|
|
5
|
+
const GUARDRAIL_CHIP_GEOMETRY = 'min-w-0 gap-1 rounded-full border px-2.5 text-xs font-medium [&_svg]:size-3';
|
|
6
|
+
const guardrailChipVariants = cva(`h-6 ${GUARDRAIL_CHIP_GEOMETRY}`, {
|
|
6
7
|
variants: {
|
|
7
8
|
appearance: {
|
|
8
9
|
default: 'bg-background text-foreground border-border hover:bg-muted hover:text-foreground data-[state=on]:bg-brand-subtle data-[state=on]:text-foreground-accent data-[state=on]:border-brand-lighter future:text-foreground future:hover:text-foreground future:data-[state=on]:text-foreground-accent',
|
|
@@ -23,4 +24,4 @@ const GuardrailChip = /*#__PURE__*/ forwardRef(({ appearance, className, ...prop
|
|
|
23
24
|
...props
|
|
24
25
|
}));
|
|
25
26
|
GuardrailChip.displayName = 'GuardrailChip';
|
|
26
|
-
export { GuardrailChip, guardrailChipVariants };
|
|
27
|
+
export { GUARDRAIL_CHIP_GEOMETRY, GuardrailChip, guardrailChipVariants };
|
|
@@ -0,0 +1,218 @@
|
|
|
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
|
+
GuardrailListRow: ()=>GuardrailListRow
|
|
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 external_guardrail_list_utils_cjs_namespaceObject = require("../guardrail-list-utils.cjs");
|
|
34
|
+
const external_i18n_cjs_namespaceObject = require("../i18n.cjs");
|
|
35
|
+
const external_guardrail_status_chip_cjs_namespaceObject = require("./guardrail-status-chip.cjs");
|
|
36
|
+
const GuardrailListRow = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ item, id, index, state, labels, disabled = false, handle, administration, statusChips = false, previewChip = false, byoChip = false, rowActivatesEdit = false, onEdit, onRemove, renderItemActions, renderRowTooltip, formatScopes, formatAction, className, ...props }, ref)=>{
|
|
37
|
+
const handleEdit = onEdit && !disabled ? ()=>onEdit(item) : void 0;
|
|
38
|
+
const handleRemove = onRemove && !disabled ? ()=>onRemove(item) : void 0;
|
|
39
|
+
const chips = statusChips ? (0, external_guardrail_list_utils_cjs_namespaceObject.getGuardrailListChips)({
|
|
40
|
+
status: state.status,
|
|
41
|
+
administration
|
|
42
|
+
}, labels) : [];
|
|
43
|
+
const isBuiltInValidator = 'builtInValidator' === item.$guardrailType;
|
|
44
|
+
const rowName = item.name.trim();
|
|
45
|
+
const nameRow = (template, generic)=>rowName ? (0, external_i18n_cjs_namespaceObject.formatGuardrailFormMessage)(template, {
|
|
46
|
+
name: rowName
|
|
47
|
+
}) : generic;
|
|
48
|
+
const scopes = item.selector?.scopes ?? [];
|
|
49
|
+
const scopesContent = formatScopes ? formatScopes(item) : scopes.join(', ') || null;
|
|
50
|
+
const actionContent = formatAction ? formatAction(item) : item.action?.$actionType ?? labels.actionUnknown;
|
|
51
|
+
const defaultActions = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
52
|
+
children: [
|
|
53
|
+
onEdit && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
|
|
54
|
+
type: "button",
|
|
55
|
+
variant: "ghost",
|
|
56
|
+
size: "3xs",
|
|
57
|
+
icon: true,
|
|
58
|
+
disabled: disabled,
|
|
59
|
+
"aria-label": nameRow(labels.editRow, labels.editItem),
|
|
60
|
+
onClick: handleEdit,
|
|
61
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Pencil, {})
|
|
62
|
+
}),
|
|
63
|
+
onRemove && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
|
|
64
|
+
type: "button",
|
|
65
|
+
variant: "ghost",
|
|
66
|
+
size: "3xs",
|
|
67
|
+
icon: true,
|
|
68
|
+
disabled: disabled,
|
|
69
|
+
"aria-label": nameRow(labels.removeRow, labels.removeItem),
|
|
70
|
+
className: "text-destructive future:text-destructive hover:text-destructive future:hover:text-destructive",
|
|
71
|
+
onClick: handleRemove,
|
|
72
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Trash2, {})
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
const actions = renderItemActions ? renderItemActions({
|
|
77
|
+
item,
|
|
78
|
+
id,
|
|
79
|
+
index,
|
|
80
|
+
disabled,
|
|
81
|
+
onEdit: handleEdit,
|
|
82
|
+
onRemove: handleRemove,
|
|
83
|
+
defaultActions
|
|
84
|
+
}) : defaultActions;
|
|
85
|
+
const tooltip = renderRowTooltip?.(item);
|
|
86
|
+
const activatable = rowActivatesEdit && void 0 !== handleEdit;
|
|
87
|
+
const bodyId = external_react_namespaceObject.useId();
|
|
88
|
+
const chipId = (chip)=>`${bodyId}-chip-${chip}`;
|
|
89
|
+
const byoDisabledId = `${bodyId}-byo-disabled`;
|
|
90
|
+
const byoUnavailableId = `${bodyId}-byo-unavailable`;
|
|
91
|
+
const descriptionId = `${bodyId}-description`;
|
|
92
|
+
const describedBy = activatable ? [
|
|
93
|
+
...chips.map((chip)=>chipId(chip.id)),
|
|
94
|
+
state.byoDisabled ? byoDisabledId : void 0,
|
|
95
|
+
state.byoUnavailable ? byoUnavailableId : void 0,
|
|
96
|
+
item.description ? descriptionId : void 0
|
|
97
|
+
].filter(Boolean).join(' ') : '';
|
|
98
|
+
const bodyProps = activatable ? {
|
|
99
|
+
role: 'button',
|
|
100
|
+
tabIndex: 0,
|
|
101
|
+
'aria-label': nameRow(labels.editRow, labels.editItem),
|
|
102
|
+
...describedBy ? {
|
|
103
|
+
'aria-describedby': describedBy
|
|
104
|
+
} : {},
|
|
105
|
+
onClick: handleEdit,
|
|
106
|
+
onKeyDown: (event)=>{
|
|
107
|
+
if ('Enter' === event.key || ' ' === event.key) {
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
handleEdit?.();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
} : tooltip ? {
|
|
113
|
+
tabIndex: 0
|
|
114
|
+
} : {};
|
|
115
|
+
const body = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
116
|
+
className: (0, apollo_wind_namespaceObject.cn)('min-w-0 flex-1', activatable && 'cursor-pointer rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring'),
|
|
117
|
+
...bodyProps,
|
|
118
|
+
children: [
|
|
119
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
120
|
+
className: "flex items-center gap-2",
|
|
121
|
+
children: [
|
|
122
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
123
|
+
className: "truncate text-sm font-medium",
|
|
124
|
+
children: item.name
|
|
125
|
+
}),
|
|
126
|
+
byoChip && state.isByo && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_guardrail_status_chip_cjs_namespaceObject.GuardrailStatusChip, {
|
|
127
|
+
tone: "success",
|
|
128
|
+
children: labels.byo
|
|
129
|
+
}),
|
|
130
|
+
previewChip && isBuiltInValidator && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_guardrail_status_chip_cjs_namespaceObject.GuardrailStatusChip, {
|
|
131
|
+
tone: "info",
|
|
132
|
+
children: labels.preview
|
|
133
|
+
}),
|
|
134
|
+
chips.map((chip)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_guardrail_status_chip_cjs_namespaceObject.GuardrailStatusChip, {
|
|
135
|
+
id: chipId(chip.id),
|
|
136
|
+
tone: chip.tone,
|
|
137
|
+
children: chip.label
|
|
138
|
+
}, chip.id))
|
|
139
|
+
]
|
|
140
|
+
}),
|
|
141
|
+
state.byoDisabled && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
142
|
+
id: byoDisabledId,
|
|
143
|
+
className: "whitespace-normal break-words text-xs text-error",
|
|
144
|
+
role: "alert",
|
|
145
|
+
children: labels.byoDisabledNotice
|
|
146
|
+
}),
|
|
147
|
+
state.byoUnavailable && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
148
|
+
id: byoUnavailableId,
|
|
149
|
+
className: "whitespace-normal break-words text-xs text-error",
|
|
150
|
+
role: "alert",
|
|
151
|
+
children: labels.byoUnavailableNotice
|
|
152
|
+
}),
|
|
153
|
+
item.description && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
154
|
+
id: descriptionId,
|
|
155
|
+
className: "truncate text-xs text-muted-foreground",
|
|
156
|
+
children: item.description
|
|
157
|
+
}),
|
|
158
|
+
void 0 !== state.provider && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
159
|
+
className: "truncate text-xs text-muted-foreground",
|
|
160
|
+
children: [
|
|
161
|
+
labels.provider,
|
|
162
|
+
": ",
|
|
163
|
+
state.provider
|
|
164
|
+
]
|
|
165
|
+
}),
|
|
166
|
+
(actionContent || scopesContent) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
167
|
+
className: "mt-1 flex flex-wrap items-center gap-1.5",
|
|
168
|
+
children: [
|
|
169
|
+
actionContent && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Badge, {
|
|
170
|
+
variant: "secondary",
|
|
171
|
+
className: (0, apollo_wind_namespaceObject.cn)('border-border bg-muted/60 text-xs text-muted-foreground', !formatAction && 'capitalize'),
|
|
172
|
+
children: actionContent
|
|
173
|
+
}),
|
|
174
|
+
scopesContent && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
175
|
+
className: "text-xs text-muted-foreground",
|
|
176
|
+
children: scopesContent
|
|
177
|
+
})
|
|
178
|
+
]
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
});
|
|
182
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
183
|
+
ref: ref,
|
|
184
|
+
"data-slot": "guardrail-list-row",
|
|
185
|
+
"data-guardrail-id": id,
|
|
186
|
+
className: (0, apollo_wind_namespaceObject.cn)('flex items-center gap-2', '-mx-1 rounded-md p-1 transition-colors hover:bg-accent', className),
|
|
187
|
+
...props,
|
|
188
|
+
children: [
|
|
189
|
+
handle,
|
|
190
|
+
tooltip ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.TooltipProvider, {
|
|
191
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.Tooltip, {
|
|
192
|
+
children: [
|
|
193
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.TooltipTrigger, {
|
|
194
|
+
asChild: true,
|
|
195
|
+
children: body
|
|
196
|
+
}),
|
|
197
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.TooltipContent, {
|
|
198
|
+
children: tooltip
|
|
199
|
+
})
|
|
200
|
+
]
|
|
201
|
+
})
|
|
202
|
+
}) : body,
|
|
203
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
204
|
+
"data-slot": "guardrail-list-row-actions",
|
|
205
|
+
className: "flex shrink-0 items-center gap-0",
|
|
206
|
+
children: actions
|
|
207
|
+
})
|
|
208
|
+
]
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
GuardrailListRow.displayName = 'GuardrailListRow';
|
|
212
|
+
exports.GuardrailListRow = __webpack_exports__.GuardrailListRow;
|
|
213
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
214
|
+
"GuardrailListRow"
|
|
215
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
216
|
+
Object.defineProperty(exports, '__esModule', {
|
|
217
|
+
value: true
|
|
218
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type GuardrailListLabels } from '../i18n';
|
|
3
|
+
import type { GuardrailListAdministration, GuardrailListItem, GuardrailListItemActionsContext, GuardrailListItemState, GuardrailRowTooltipRenderer } from '../list-types';
|
|
4
|
+
export interface GuardrailListRowProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
5
|
+
item: GuardrailListItem;
|
|
6
|
+
id: string;
|
|
7
|
+
index: number;
|
|
8
|
+
state: GuardrailListItemState;
|
|
9
|
+
labels: GuardrailListLabels;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
handle?: React.ReactNode;
|
|
12
|
+
administration?: GuardrailListAdministration;
|
|
13
|
+
statusChips?: boolean;
|
|
14
|
+
previewChip?: boolean;
|
|
15
|
+
byoChip?: boolean;
|
|
16
|
+
rowActivatesEdit?: boolean;
|
|
17
|
+
onEdit?: (item: GuardrailListItem) => void;
|
|
18
|
+
onRemove?: (item: GuardrailListItem) => void;
|
|
19
|
+
renderItemActions?: (ctx: GuardrailListItemActionsContext) => React.ReactNode;
|
|
20
|
+
renderRowTooltip?: GuardrailRowTooltipRenderer;
|
|
21
|
+
formatScopes?: (item: GuardrailListItem) => React.ReactNode;
|
|
22
|
+
formatAction?: (item: GuardrailListItem) => React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
declare const GuardrailListRow: React.ForwardRefExoticComponent<GuardrailListRowProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
export { GuardrailListRow };
|
|
26
|
+
//# sourceMappingURL=guardrail-list-row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardrail-list-row.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/guardrail-list-row.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA8B,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,KAAK,EACV,2BAA2B,EAC3B,iBAAiB,EACjB,+BAA+B,EAC/B,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,eAAe,CAAC;AAGvB,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC/D,IAAI,EAAE,iBAAiB,CAAC;IAExB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IAEd,KAAK,EAAE,sBAAsB,CAAC;IAC9B,MAAM,EAAE,mBAAmB,CAAC;IAE5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,cAAc,CAAC,EAAE,2BAA2B,CAAC;IAC7C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7C,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,+BAA+B,KAAK,KAAK,CAAC,SAAS,CAAC;IAE9E,gBAAgB,CAAC,EAAE,2BAA2B,CAAC;IAC/C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,KAAK,CAAC,SAAS,CAAC;IAC5D,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,KAAK,CAAC,SAAS,CAAC;CAC7D;AASD,QAAA,MAAM,gBAAgB,8FAqQrB,CAAC;AAGF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Badge, Button, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, cn } from "@uipath/apollo-wind";
|
|
3
|
+
import { Pencil, Trash2 } from "lucide-react";
|
|
4
|
+
import { forwardRef, useId } from "react";
|
|
5
|
+
import { getGuardrailListChips } from "../guardrail-list-utils.js";
|
|
6
|
+
import { formatGuardrailFormMessage } from "../i18n.js";
|
|
7
|
+
import { GuardrailStatusChip } from "./guardrail-status-chip.js";
|
|
8
|
+
const GuardrailListRow = /*#__PURE__*/ forwardRef(({ item, id, index, state, labels, disabled = false, handle, administration, statusChips = false, previewChip = false, byoChip = false, rowActivatesEdit = false, onEdit, onRemove, renderItemActions, renderRowTooltip, formatScopes, formatAction, className, ...props }, ref)=>{
|
|
9
|
+
const handleEdit = onEdit && !disabled ? ()=>onEdit(item) : void 0;
|
|
10
|
+
const handleRemove = onRemove && !disabled ? ()=>onRemove(item) : void 0;
|
|
11
|
+
const chips = statusChips ? getGuardrailListChips({
|
|
12
|
+
status: state.status,
|
|
13
|
+
administration
|
|
14
|
+
}, labels) : [];
|
|
15
|
+
const isBuiltInValidator = 'builtInValidator' === item.$guardrailType;
|
|
16
|
+
const rowName = item.name.trim();
|
|
17
|
+
const nameRow = (template, generic)=>rowName ? formatGuardrailFormMessage(template, {
|
|
18
|
+
name: rowName
|
|
19
|
+
}) : generic;
|
|
20
|
+
const scopes = item.selector?.scopes ?? [];
|
|
21
|
+
const scopesContent = formatScopes ? formatScopes(item) : scopes.join(', ') || null;
|
|
22
|
+
const actionContent = formatAction ? formatAction(item) : item.action?.$actionType ?? labels.actionUnknown;
|
|
23
|
+
const defaultActions = /*#__PURE__*/ jsxs(Fragment, {
|
|
24
|
+
children: [
|
|
25
|
+
onEdit && /*#__PURE__*/ jsx(Button, {
|
|
26
|
+
type: "button",
|
|
27
|
+
variant: "ghost",
|
|
28
|
+
size: "3xs",
|
|
29
|
+
icon: true,
|
|
30
|
+
disabled: disabled,
|
|
31
|
+
"aria-label": nameRow(labels.editRow, labels.editItem),
|
|
32
|
+
onClick: handleEdit,
|
|
33
|
+
children: /*#__PURE__*/ jsx(Pencil, {})
|
|
34
|
+
}),
|
|
35
|
+
onRemove && /*#__PURE__*/ jsx(Button, {
|
|
36
|
+
type: "button",
|
|
37
|
+
variant: "ghost",
|
|
38
|
+
size: "3xs",
|
|
39
|
+
icon: true,
|
|
40
|
+
disabled: disabled,
|
|
41
|
+
"aria-label": nameRow(labels.removeRow, labels.removeItem),
|
|
42
|
+
className: "text-destructive future:text-destructive hover:text-destructive future:hover:text-destructive",
|
|
43
|
+
onClick: handleRemove,
|
|
44
|
+
children: /*#__PURE__*/ jsx(Trash2, {})
|
|
45
|
+
})
|
|
46
|
+
]
|
|
47
|
+
});
|
|
48
|
+
const actions = renderItemActions ? renderItemActions({
|
|
49
|
+
item,
|
|
50
|
+
id,
|
|
51
|
+
index,
|
|
52
|
+
disabled,
|
|
53
|
+
onEdit: handleEdit,
|
|
54
|
+
onRemove: handleRemove,
|
|
55
|
+
defaultActions
|
|
56
|
+
}) : defaultActions;
|
|
57
|
+
const tooltip = renderRowTooltip?.(item);
|
|
58
|
+
const activatable = rowActivatesEdit && void 0 !== handleEdit;
|
|
59
|
+
const bodyId = useId();
|
|
60
|
+
const chipId = (chip)=>`${bodyId}-chip-${chip}`;
|
|
61
|
+
const byoDisabledId = `${bodyId}-byo-disabled`;
|
|
62
|
+
const byoUnavailableId = `${bodyId}-byo-unavailable`;
|
|
63
|
+
const descriptionId = `${bodyId}-description`;
|
|
64
|
+
const describedBy = activatable ? [
|
|
65
|
+
...chips.map((chip)=>chipId(chip.id)),
|
|
66
|
+
state.byoDisabled ? byoDisabledId : void 0,
|
|
67
|
+
state.byoUnavailable ? byoUnavailableId : void 0,
|
|
68
|
+
item.description ? descriptionId : void 0
|
|
69
|
+
].filter(Boolean).join(' ') : '';
|
|
70
|
+
const bodyProps = activatable ? {
|
|
71
|
+
role: 'button',
|
|
72
|
+
tabIndex: 0,
|
|
73
|
+
'aria-label': nameRow(labels.editRow, labels.editItem),
|
|
74
|
+
...describedBy ? {
|
|
75
|
+
'aria-describedby': describedBy
|
|
76
|
+
} : {},
|
|
77
|
+
onClick: handleEdit,
|
|
78
|
+
onKeyDown: (event)=>{
|
|
79
|
+
if ('Enter' === event.key || ' ' === event.key) {
|
|
80
|
+
event.preventDefault();
|
|
81
|
+
handleEdit?.();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
} : tooltip ? {
|
|
85
|
+
tabIndex: 0
|
|
86
|
+
} : {};
|
|
87
|
+
const body = /*#__PURE__*/ jsxs("div", {
|
|
88
|
+
className: cn('min-w-0 flex-1', activatable && 'cursor-pointer rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring'),
|
|
89
|
+
...bodyProps,
|
|
90
|
+
children: [
|
|
91
|
+
/*#__PURE__*/ jsxs("div", {
|
|
92
|
+
className: "flex items-center gap-2",
|
|
93
|
+
children: [
|
|
94
|
+
/*#__PURE__*/ jsx("span", {
|
|
95
|
+
className: "truncate text-sm font-medium",
|
|
96
|
+
children: item.name
|
|
97
|
+
}),
|
|
98
|
+
byoChip && state.isByo && /*#__PURE__*/ jsx(GuardrailStatusChip, {
|
|
99
|
+
tone: "success",
|
|
100
|
+
children: labels.byo
|
|
101
|
+
}),
|
|
102
|
+
previewChip && isBuiltInValidator && /*#__PURE__*/ jsx(GuardrailStatusChip, {
|
|
103
|
+
tone: "info",
|
|
104
|
+
children: labels.preview
|
|
105
|
+
}),
|
|
106
|
+
chips.map((chip)=>/*#__PURE__*/ jsx(GuardrailStatusChip, {
|
|
107
|
+
id: chipId(chip.id),
|
|
108
|
+
tone: chip.tone,
|
|
109
|
+
children: chip.label
|
|
110
|
+
}, chip.id))
|
|
111
|
+
]
|
|
112
|
+
}),
|
|
113
|
+
state.byoDisabled && /*#__PURE__*/ jsx("div", {
|
|
114
|
+
id: byoDisabledId,
|
|
115
|
+
className: "whitespace-normal break-words text-xs text-error",
|
|
116
|
+
role: "alert",
|
|
117
|
+
children: labels.byoDisabledNotice
|
|
118
|
+
}),
|
|
119
|
+
state.byoUnavailable && /*#__PURE__*/ jsx("div", {
|
|
120
|
+
id: byoUnavailableId,
|
|
121
|
+
className: "whitespace-normal break-words text-xs text-error",
|
|
122
|
+
role: "alert",
|
|
123
|
+
children: labels.byoUnavailableNotice
|
|
124
|
+
}),
|
|
125
|
+
item.description && /*#__PURE__*/ jsx("div", {
|
|
126
|
+
id: descriptionId,
|
|
127
|
+
className: "truncate text-xs text-muted-foreground",
|
|
128
|
+
children: item.description
|
|
129
|
+
}),
|
|
130
|
+
void 0 !== state.provider && /*#__PURE__*/ jsxs("div", {
|
|
131
|
+
className: "truncate text-xs text-muted-foreground",
|
|
132
|
+
children: [
|
|
133
|
+
labels.provider,
|
|
134
|
+
": ",
|
|
135
|
+
state.provider
|
|
136
|
+
]
|
|
137
|
+
}),
|
|
138
|
+
(actionContent || scopesContent) && /*#__PURE__*/ jsxs("div", {
|
|
139
|
+
className: "mt-1 flex flex-wrap items-center gap-1.5",
|
|
140
|
+
children: [
|
|
141
|
+
actionContent && /*#__PURE__*/ jsx(Badge, {
|
|
142
|
+
variant: "secondary",
|
|
143
|
+
className: cn('border-border bg-muted/60 text-xs text-muted-foreground', !formatAction && 'capitalize'),
|
|
144
|
+
children: actionContent
|
|
145
|
+
}),
|
|
146
|
+
scopesContent && /*#__PURE__*/ jsx("span", {
|
|
147
|
+
className: "text-xs text-muted-foreground",
|
|
148
|
+
children: scopesContent
|
|
149
|
+
})
|
|
150
|
+
]
|
|
151
|
+
})
|
|
152
|
+
]
|
|
153
|
+
});
|
|
154
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
155
|
+
ref: ref,
|
|
156
|
+
"data-slot": "guardrail-list-row",
|
|
157
|
+
"data-guardrail-id": id,
|
|
158
|
+
className: cn('flex items-center gap-2', '-mx-1 rounded-md p-1 transition-colors hover:bg-accent', className),
|
|
159
|
+
...props,
|
|
160
|
+
children: [
|
|
161
|
+
handle,
|
|
162
|
+
tooltip ? /*#__PURE__*/ jsx(TooltipProvider, {
|
|
163
|
+
children: /*#__PURE__*/ jsxs(Tooltip, {
|
|
164
|
+
children: [
|
|
165
|
+
/*#__PURE__*/ jsx(TooltipTrigger, {
|
|
166
|
+
asChild: true,
|
|
167
|
+
children: body
|
|
168
|
+
}),
|
|
169
|
+
/*#__PURE__*/ jsx(TooltipContent, {
|
|
170
|
+
children: tooltip
|
|
171
|
+
})
|
|
172
|
+
]
|
|
173
|
+
})
|
|
174
|
+
}) : body,
|
|
175
|
+
/*#__PURE__*/ jsx("div", {
|
|
176
|
+
"data-slot": "guardrail-list-row-actions",
|
|
177
|
+
className: "flex shrink-0 items-center gap-0",
|
|
178
|
+
children: actions
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
GuardrailListRow.displayName = 'GuardrailListRow';
|
|
184
|
+
export { GuardrailListRow };
|
|
@@ -36,6 +36,7 @@ function GuardrailStatusBanner({ tone, message }) {
|
|
|
36
36
|
children: [
|
|
37
37
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.AlertCircle, {}),
|
|
38
38
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.AlertDescription, {
|
|
39
|
+
className: "mt-0",
|
|
39
40
|
children: message
|
|
40
41
|
})
|
|
41
42
|
]
|
|
@@ -47,6 +48,7 @@ function GuardrailStatusBanner({ tone, message }) {
|
|
|
47
48
|
children: [
|
|
48
49
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.AlertTriangle, {}),
|
|
49
50
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.AlertDescription, {
|
|
51
|
+
className: "mt-0",
|
|
50
52
|
children: message
|
|
51
53
|
})
|
|
52
54
|
]
|
|
@@ -1 +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;
|
|
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;AASD,wBAAgB,qBAAqB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,0BAA0B,2CAiBlF"}
|
|
@@ -8,6 +8,7 @@ function GuardrailStatusBanner({ tone, message }) {
|
|
|
8
8
|
children: [
|
|
9
9
|
/*#__PURE__*/ jsx(AlertCircle, {}),
|
|
10
10
|
/*#__PURE__*/ jsx(AlertDescription, {
|
|
11
|
+
className: "mt-0",
|
|
11
12
|
children: message
|
|
12
13
|
})
|
|
13
14
|
]
|
|
@@ -19,6 +20,7 @@ function GuardrailStatusBanner({ tone, message }) {
|
|
|
19
20
|
children: [
|
|
20
21
|
/*#__PURE__*/ jsx(AlertTriangle, {}),
|
|
21
22
|
/*#__PURE__*/ jsx(AlertDescription, {
|
|
23
|
+
className: "mt-0",
|
|
22
24
|
children: message
|
|
23
25
|
})
|
|
24
26
|
]
|