@uipath/apollo-react 7.36.0 → 8.0.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/styles/tailwind.canvas.css +1 -1
- package/dist/chat/styles/tailwind.chat.css +1 -1
- package/dist/decision-table/CitationButton.cjs +66 -0
- package/dist/decision-table/CitationButton.d.ts +22 -0
- package/dist/decision-table/CitationButton.d.ts.map +1 -0
- package/dist/decision-table/CitationButton.js +29 -0
- package/dist/decision-table/DecisionGraphCard.cjs +11 -1
- package/dist/decision-table/DecisionGraphCard.d.ts +5 -0
- package/dist/decision-table/DecisionGraphCard.d.ts.map +1 -1
- package/dist/decision-table/DecisionGraphCard.js +12 -2
- package/dist/decision-table/DecisionGraphText.cjs +9 -1
- package/dist/decision-table/DecisionGraphText.d.ts +3 -2
- package/dist/decision-table/DecisionGraphText.d.ts.map +1 -1
- package/dist/decision-table/DecisionGraphText.js +9 -1
- package/dist/decision-table/DecisionText.cjs +6 -1
- package/dist/decision-table/DecisionText.d.ts +3 -2
- package/dist/decision-table/DecisionText.d.ts.map +1 -1
- package/dist/decision-table/DecisionText.js +6 -1
- package/dist/decision-table/DecisionTextHeader.cjs +14 -1
- package/dist/decision-table/DecisionTextHeader.d.ts +7 -1
- package/dist/decision-table/DecisionTextHeader.d.ts.map +1 -1
- package/dist/decision-table/DecisionTextHeader.js +15 -2
- package/dist/decision-table/RuleCard.cjs +56 -26
- package/dist/decision-table/RuleCard.d.ts +2 -0
- package/dist/decision-table/RuleCard.d.ts.map +1 -1
- package/dist/decision-table/RuleCard.js +57 -27
- package/dist/decision-table/RuleList.cjs +2 -1
- package/dist/decision-table/RuleList.d.ts +1 -0
- package/dist/decision-table/RuleList.d.ts.map +1 -1
- package/dist/decision-table/RuleList.js +2 -1
- package/dist/decision-table/__fixtures__/textMode.d.ts +3 -2
- package/dist/decision-table/__fixtures__/textMode.d.ts.map +1 -1
- package/dist/decision-table/decisionGraphTypes.d.ts +8 -0
- package/dist/decision-table/decisionGraphTypes.d.ts.map +1 -1
- package/dist/decision-table/index.d.ts +2 -2
- package/dist/decision-table/index.d.ts.map +1 -1
- package/dist/decision-table/locales/de.cjs +1 -1
- package/dist/decision-table/locales/de.d.ts.map +1 -1
- package/dist/decision-table/locales/de.js +1 -1
- package/dist/decision-table/locales/en.cjs +1 -1
- package/dist/decision-table/locales/en.d.ts.map +1 -1
- package/dist/decision-table/locales/en.js +1 -1
- package/dist/decision-table/locales/es-MX.cjs +1 -1
- package/dist/decision-table/locales/es-MX.d.ts.map +1 -1
- package/dist/decision-table/locales/es-MX.js +1 -1
- package/dist/decision-table/locales/es.cjs +1 -1
- package/dist/decision-table/locales/es.d.ts.map +1 -1
- package/dist/decision-table/locales/es.js +1 -1
- package/dist/decision-table/locales/fr.cjs +1 -1
- package/dist/decision-table/locales/fr.d.ts.map +1 -1
- package/dist/decision-table/locales/fr.js +1 -1
- package/dist/decision-table/locales/ja.cjs +1 -1
- package/dist/decision-table/locales/ja.d.ts.map +1 -1
- package/dist/decision-table/locales/ja.js +1 -1
- package/dist/decision-table/locales/ko.cjs +1 -1
- package/dist/decision-table/locales/ko.d.ts.map +1 -1
- package/dist/decision-table/locales/ko.js +1 -1
- package/dist/decision-table/locales/pt-BR.cjs +1 -1
- package/dist/decision-table/locales/pt-BR.d.ts.map +1 -1
- package/dist/decision-table/locales/pt-BR.js +1 -1
- package/dist/decision-table/locales/pt.cjs +1 -1
- package/dist/decision-table/locales/pt.d.ts.map +1 -1
- package/dist/decision-table/locales/pt.js +1 -1
- package/dist/decision-table/locales/ro.cjs +1 -1
- package/dist/decision-table/locales/ro.d.ts.map +1 -1
- package/dist/decision-table/locales/ro.js +1 -1
- package/dist/decision-table/locales/ru.cjs +1 -1
- package/dist/decision-table/locales/ru.d.ts.map +1 -1
- package/dist/decision-table/locales/ru.js +1 -1
- package/dist/decision-table/locales/tr.cjs +1 -1
- package/dist/decision-table/locales/tr.d.ts.map +1 -1
- package/dist/decision-table/locales/tr.js +1 -1
- package/dist/decision-table/locales/zh-CN.cjs +1 -1
- package/dist/decision-table/locales/zh-CN.d.ts.map +1 -1
- package/dist/decision-table/locales/zh-CN.js +1 -1
- package/dist/decision-table/locales/zh-TW.cjs +1 -1
- package/dist/decision-table/locales/zh-TW.d.ts.map +1 -1
- package/dist/decision-table/locales/zh-TW.js +1 -1
- package/dist/decision-table/ruleCardModel.d.ts +2 -1
- package/dist/decision-table/ruleCardModel.d.ts.map +1 -1
- package/dist/decision-table/sentenceStyles.cjs +32 -5
- package/dist/decision-table/sentenceStyles.d.ts +8 -1
- package/dist/decision-table/sentenceStyles.d.ts.map +1 -1
- package/dist/decision-table/sentenceStyles.js +8 -2
- package/dist/decision-table/sentenceTypes.d.ts +28 -0
- package/dist/decision-table/sentenceTypes.d.ts.map +1 -1
- package/dist/decision-table/styles/tailwind.decision-table.css +1 -1
- package/dist/decision-table/useContainerHandlers.cjs +11 -1
- package/dist/decision-table/useContainerHandlers.d.ts.map +1 -1
- package/dist/decision-table/useContainerHandlers.js +11 -1
- package/dist/decision-table/useDecisionGraphStrings.cjs +6 -2
- package/dist/decision-table/useDecisionGraphStrings.d.ts +2 -1
- package/dist/decision-table/useDecisionGraphStrings.d.ts.map +1 -1
- package/dist/decision-table/useDecisionGraphStrings.js +6 -2
- package/dist/decision-table/useDecisionTextStrings.cjs +14 -0
- package/dist/decision-table/useDecisionTextStrings.d.ts.map +1 -1
- package/dist/decision-table/useDecisionTextStrings.js +14 -0
- package/package.json +1 -1
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
CitationButtons: ()=>CitationButtons,
|
|
28
|
+
CitationButton: ()=>CitationButton
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
32
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
33
|
+
const external_sentenceStyles_cjs_namespaceObject = require("./sentenceStyles.cjs");
|
|
34
|
+
const CitationButton = ({ citation, onOpen, selected, tabIndex, className, labels, dataTestId })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.Button, {
|
|
35
|
+
variant: "ghost",
|
|
36
|
+
size: "3xs",
|
|
37
|
+
tabIndex: tabIndex,
|
|
38
|
+
"aria-label": labels.openCitation(citation.page),
|
|
39
|
+
className: (0, apollo_wind_namespaceObject.cn)(external_sentenceStyles_cjs_namespaceObject.CITATION_BUTTON_CLASS, className),
|
|
40
|
+
"data-rule-action": "citation",
|
|
41
|
+
"data-testid": dataTestId,
|
|
42
|
+
onClick: ()=>onOpen(citation),
|
|
43
|
+
children: [
|
|
44
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.FileText, {
|
|
45
|
+
"aria-hidden": true
|
|
46
|
+
}),
|
|
47
|
+
selected && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
48
|
+
"aria-hidden": true,
|
|
49
|
+
children: labels.citationPage(citation.page)
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
const CitationButtons = ({ citations, dataTestId, ...props })=>citations.map((citation, index)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(CitationButton, {
|
|
54
|
+
citation: citation,
|
|
55
|
+
dataTestId: 0 === index ? dataTestId : `${dataTestId}-${index}`,
|
|
56
|
+
...props
|
|
57
|
+
}, `${citation.kind}-${citation.page}-${index}`));
|
|
58
|
+
exports.CitationButton = __webpack_exports__.CitationButton;
|
|
59
|
+
exports.CitationButtons = __webpack_exports__.CitationButtons;
|
|
60
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
61
|
+
"CitationButton",
|
|
62
|
+
"CitationButtons"
|
|
63
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
64
|
+
Object.defineProperty(exports, '__esModule', {
|
|
65
|
+
value: true
|
|
66
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { OpenCitation, SentenceCitation } from './sentenceTypes';
|
|
3
|
+
export interface CitationLabels {
|
|
4
|
+
openCitation: (page: number) => string;
|
|
5
|
+
citationPage: (page: number) => string;
|
|
6
|
+
}
|
|
7
|
+
export interface CitationButtonProps {
|
|
8
|
+
citation: SentenceCitation;
|
|
9
|
+
onOpen: OpenCitation;
|
|
10
|
+
selected: boolean;
|
|
11
|
+
tabIndex: 0 | -1;
|
|
12
|
+
className: string;
|
|
13
|
+
labels: CitationLabels;
|
|
14
|
+
dataTestId: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const CitationButton: React.FC<CitationButtonProps>;
|
|
17
|
+
export interface CitationButtonsProps extends Omit<CitationButtonProps, 'citation' | 'dataTestId'> {
|
|
18
|
+
citations: readonly SentenceCitation[];
|
|
19
|
+
dataTestId: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const CitationButtons: React.FC<CitationButtonsProps>;
|
|
22
|
+
//# sourceMappingURL=CitationButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CitationButton.d.ts","sourceRoot":"","sources":["../../src/decision-table/CitationButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGtE,MAAM,WAAW,cAAc;IAE7B,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAEvC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACxC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,EAAE,YAAY,CAAC;IAErB,QAAQ,EAAE,OAAO,CAAC;IAElB,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAGD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAsBxD,CAAC;AAEF,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,UAAU,GAAG,YAAY,CAAC;IAChG,SAAS,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC;CACpB;AAGD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAYvD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, cn } from "@uipath/apollo-wind";
|
|
3
|
+
import { FileText } from "lucide-react";
|
|
4
|
+
import { CITATION_BUTTON_CLASS } from "./sentenceStyles.js";
|
|
5
|
+
const CitationButton = ({ citation, onOpen, selected, tabIndex, className, labels, dataTestId })=>/*#__PURE__*/ jsxs(Button, {
|
|
6
|
+
variant: "ghost",
|
|
7
|
+
size: "3xs",
|
|
8
|
+
tabIndex: tabIndex,
|
|
9
|
+
"aria-label": labels.openCitation(citation.page),
|
|
10
|
+
className: cn(CITATION_BUTTON_CLASS, className),
|
|
11
|
+
"data-rule-action": "citation",
|
|
12
|
+
"data-testid": dataTestId,
|
|
13
|
+
onClick: ()=>onOpen(citation),
|
|
14
|
+
children: [
|
|
15
|
+
/*#__PURE__*/ jsx(FileText, {
|
|
16
|
+
"aria-hidden": true
|
|
17
|
+
}),
|
|
18
|
+
selected && /*#__PURE__*/ jsx("span", {
|
|
19
|
+
"aria-hidden": true,
|
|
20
|
+
children: labels.citationPage(citation.page)
|
|
21
|
+
})
|
|
22
|
+
]
|
|
23
|
+
});
|
|
24
|
+
const CitationButtons = ({ citations, dataTestId, ...props })=>citations.map((citation, index)=>/*#__PURE__*/ jsx(CitationButton, {
|
|
25
|
+
citation: citation,
|
|
26
|
+
dataTestId: 0 === index ? dataTestId : `${dataTestId}-${index}`,
|
|
27
|
+
...props
|
|
28
|
+
}, `${citation.kind}-${citation.page}-${index}`));
|
|
29
|
+
export { CitationButton, CitationButtons };
|
|
@@ -31,6 +31,7 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
31
31
|
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
32
32
|
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
33
33
|
const external_react_namespaceObject = require("react");
|
|
34
|
+
const external_CitationButton_cjs_namespaceObject = require("./CitationButton.cjs");
|
|
34
35
|
const external_gridEvents_cjs_namespaceObject = require("./gridEvents.cjs");
|
|
35
36
|
const external_decisionGraphStyles_cjs_namespaceObject = require("./decisionGraphStyles.cjs");
|
|
36
37
|
const external_GridMenu_cjs_namespaceObject = require("./GridMenu.cjs");
|
|
@@ -126,7 +127,7 @@ const NameField = ({ field, label, dataTestId })=>{
|
|
|
126
127
|
]
|
|
127
128
|
});
|
|
128
129
|
};
|
|
129
|
-
const DecisionGraphCard = ({ node, depth, open, active, usedBy, bodyId, body, labels, onToggle, onShowProblem, onOpen, actions, cardRef, dataTestId })=>{
|
|
130
|
+
const DecisionGraphCard = ({ node, depth, open, active, usedBy, bodyId, body, labels, onToggle, onShowProblem, onOpen, actions, citations, cardRef, dataTestId })=>{
|
|
130
131
|
const { logic } = node;
|
|
131
132
|
const rename = actions?.rename ?? null;
|
|
132
133
|
const headingMark = node.mark?.mark;
|
|
@@ -203,6 +204,15 @@ const DecisionGraphCard = ({ node, depth, open, active, usedBy, bodyId, body, la
|
|
|
203
204
|
className: "size-3.5"
|
|
204
205
|
})
|
|
205
206
|
}),
|
|
207
|
+
citations && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CitationButton_cjs_namespaceObject.CitationButtons, {
|
|
208
|
+
citations: citations.citations,
|
|
209
|
+
onOpen: citations.onOpen,
|
|
210
|
+
selected: active,
|
|
211
|
+
tabIndex: 0,
|
|
212
|
+
className: (0, apollo_wind_namespaceObject.cn)('shrink-0', !active && external_decisionGraphStyles_cjs_namespaceObject.GRAPH_REVEAL_CLASS),
|
|
213
|
+
labels: labels,
|
|
214
|
+
dataTestId: `${dataTestId}-citation-${node.id}`
|
|
215
|
+
}),
|
|
206
216
|
actions && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(NodeMenu, {
|
|
207
217
|
actions: actions,
|
|
208
218
|
dataTestId: `${dataTestId}-menu-${node.id}`
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { DecisionGraphDecisionNode, DecisionGraphReferenceNode } from './decisionGraphTypes';
|
|
3
3
|
import { type GridMenuEntry } from './GridMenu';
|
|
4
|
+
import type { OpenCitation, SentenceCitation } from './sentenceTypes';
|
|
4
5
|
import type { DecisionGraphLabels } from './useDecisionGraphStrings';
|
|
5
6
|
export interface DecisionGraphRenameField {
|
|
6
7
|
from: string;
|
|
@@ -33,6 +34,10 @@ export interface DecisionGraphCardProps {
|
|
|
33
34
|
onShowProblem: (byKey: boolean) => void;
|
|
34
35
|
onOpen: (() => void) | undefined;
|
|
35
36
|
actions: DecisionGraphCardActions | null;
|
|
37
|
+
citations: {
|
|
38
|
+
citations: readonly SentenceCitation[];
|
|
39
|
+
onOpen: OpenCitation;
|
|
40
|
+
} | null;
|
|
36
41
|
cardRef: (element: HTMLElement | null) => void;
|
|
37
42
|
dataTestId: string;
|
|
38
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecisionGraphCard.d.ts","sourceRoot":"","sources":["../../src/decision-table/DecisionGraphCard.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DecisionGraphCard.d.ts","sourceRoot":"","sources":["../../src/decision-table/DecisionGraphCard.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAkBlG,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGrE,MAAM,WAAW,wBAAwB;IAEvC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,OAAO,EAAE,MAAM,G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AC;CACpB;AA+GD,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAyH9D,CAAC;AAEF,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACjC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC;CACpB;AAKD,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CA6CxE,CAAC"}
|
|
@@ -2,8 +2,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Input, cn } from "@uipath/apollo-wind";
|
|
3
3
|
import { ChevronDown, ChevronRight, CornerDownRight, Ellipsis, Network } from "lucide-react";
|
|
4
4
|
import { useId, useLayoutEffect, useRef } from "react";
|
|
5
|
+
import { CitationButtons } from "./CitationButton.js";
|
|
5
6
|
import { isComposing } from "./gridEvents.js";
|
|
6
|
-
import { GRAPH_BODY_CLASS, GRAPH_CARD_CLASS, GRAPH_CARD_COLLAPSED_CLASS, GRAPH_CARD_TONE_CLASS, GRAPH_HEADER_CLASS, GRAPH_HIT_POLICY_CLASS, GRAPH_MARK_BUTTON_CLASS, GRAPH_MENU_BUTTON_CLASS, GRAPH_NAME_CLASS, GRAPH_REFERENCE_CHIP_CLASS, GRAPH_REFERENCE_CLASS, GRAPH_RULE_COUNT_CLASS, GRAPH_TOGGLE_CLASS } from "./decisionGraphStyles.js";
|
|
7
|
+
import { GRAPH_BODY_CLASS, GRAPH_CARD_CLASS, GRAPH_CARD_COLLAPSED_CLASS, GRAPH_CARD_TONE_CLASS, GRAPH_HEADER_CLASS, GRAPH_HIT_POLICY_CLASS, GRAPH_MARK_BUTTON_CLASS, GRAPH_MENU_BUTTON_CLASS, GRAPH_NAME_CLASS, GRAPH_REFERENCE_CHIP_CLASS, GRAPH_REFERENCE_CLASS, GRAPH_REVEAL_CLASS, GRAPH_RULE_COUNT_CLASS, GRAPH_TOGGLE_CLASS } from "./decisionGraphStyles.js";
|
|
7
8
|
import { GridMenuButton } from "./GridMenu.js";
|
|
8
9
|
import { MarkGlyph } from "./MarkGlyph.js";
|
|
9
10
|
import { isLineMark } from "./sentenceMarks.js";
|
|
@@ -97,7 +98,7 @@ const NameField = ({ field, label, dataTestId })=>{
|
|
|
97
98
|
]
|
|
98
99
|
});
|
|
99
100
|
};
|
|
100
|
-
const DecisionGraphCard = ({ node, depth, open, active, usedBy, bodyId, body, labels, onToggle, onShowProblem, onOpen, actions, cardRef, dataTestId })=>{
|
|
101
|
+
const DecisionGraphCard = ({ node, depth, open, active, usedBy, bodyId, body, labels, onToggle, onShowProblem, onOpen, actions, citations, cardRef, dataTestId })=>{
|
|
101
102
|
const { logic } = node;
|
|
102
103
|
const rename = actions?.rename ?? null;
|
|
103
104
|
const headingMark = node.mark?.mark;
|
|
@@ -174,6 +175,15 @@ const DecisionGraphCard = ({ node, depth, open, active, usedBy, bodyId, body, la
|
|
|
174
175
|
className: "size-3.5"
|
|
175
176
|
})
|
|
176
177
|
}),
|
|
178
|
+
citations && /*#__PURE__*/ jsx(CitationButtons, {
|
|
179
|
+
citations: citations.citations,
|
|
180
|
+
onOpen: citations.onOpen,
|
|
181
|
+
selected: active,
|
|
182
|
+
tabIndex: 0,
|
|
183
|
+
className: cn('shrink-0', !active && GRAPH_REVEAL_CLASS),
|
|
184
|
+
labels: labels,
|
|
185
|
+
dataTestId: `${dataTestId}-citation-${node.id}`
|
|
186
|
+
}),
|
|
177
187
|
actions && /*#__PURE__*/ jsx(NodeMenu, {
|
|
178
188
|
actions: actions,
|
|
179
189
|
dataTestId: `${dataTestId}-menu-${node.id}`
|
|
@@ -49,6 +49,13 @@ const markTargetOf = ({ id, mark })=>mark?.kind === 'rule' ? {
|
|
|
49
49
|
kind: 'decision',
|
|
50
50
|
decisionId: id
|
|
51
51
|
};
|
|
52
|
+
const citationOf = (citations, decisionId)=>{
|
|
53
|
+
const cited = 'cited' === citations.kind ? citations.decisions.get(decisionId) ?? [] : [];
|
|
54
|
+
return 'cited' === citations.kind && cited.length > 0 ? {
|
|
55
|
+
citations: cited,
|
|
56
|
+
onOpen: citations.onOpenCitation
|
|
57
|
+
} : null;
|
|
58
|
+
};
|
|
52
59
|
const focuses = (mode)=>'navigate' === mode.kind && mode.focus;
|
|
53
60
|
const flashes = (mode)=>'inPlace' === mode.kind || mode.flash;
|
|
54
61
|
const prefersReducedMotion = ()=>'function' == typeof matchMedia && matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
@@ -106,7 +113,7 @@ const perRuleHeightOf = (heights, ruleCounts)=>{
|
|
|
106
113
|
}
|
|
107
114
|
return 0 === rules ? external_sentenceRuleHeights_cjs_namespaceObject.SENTENCE_MIN_RULE_HEIGHT_PX : height / rules;
|
|
108
115
|
};
|
|
109
|
-
const DecisionGraphText = ({ nodes, mode, renderBody, expansion, onFold, onOpenDecision, rules, dataTestId })=>{
|
|
116
|
+
const DecisionGraphText = ({ nodes, mode, renderBody, citations, expansion, onFold, onOpenDecision, rules, dataTestId })=>{
|
|
110
117
|
const labels = (0, external_useDecisionGraphStrings_cjs_namespaceObject.useDecisionGraphLabels)();
|
|
111
118
|
const { selected } = mode;
|
|
112
119
|
const { announce, region } = (0, external_useTextAnnouncements_cjs_namespaceObject.useTextAnnouncements)((0, external_useDecisionTextStrings_cjs_namespaceObject.useDecisionTextLabels)(), dataTestId);
|
|
@@ -340,6 +347,7 @@ const DecisionGraphText = ({ nodes, mode, renderBody, expansion, onFold, onOpenD
|
|
|
340
347
|
}),
|
|
341
348
|
onOpen: openOf(node.id),
|
|
342
349
|
actions: actions.cardOf(node, position),
|
|
350
|
+
citations: citationOf(citations, node.id),
|
|
343
351
|
cardRef: cardRef(node.id),
|
|
344
352
|
dataTestId: dataTestId
|
|
345
353
|
}),
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { type DecisionGraphMinimapSlotProps } from './DecisionGraphMinimapSlot';
|
|
3
3
|
import type { DecisionGraphMode } from './decisionGraphActionTypes';
|
|
4
|
-
import type { DecisionGraphBodyContext, DecisionGraphExpansion, DecisionGraphNode } from './decisionGraphTypes';
|
|
4
|
+
import type { DecisionGraphBodyContext, DecisionGraphCitations, DecisionGraphExpansion, DecisionGraphNode } from './decisionGraphTypes';
|
|
5
5
|
import type { DecisionTextScroll } from './useRuleWindow';
|
|
6
6
|
export interface DecisionGraphTextProps<Refusal, Logic> {
|
|
7
7
|
nodes: readonly DecisionGraphNode[];
|
|
8
8
|
mode: DecisionGraphMode<Refusal, Logic>;
|
|
9
9
|
renderBody: (decisionId: string, scroll: Exclude<DecisionTextScroll, 'self'>, context: DecisionGraphBodyContext) => React.ReactNode;
|
|
10
|
+
citations: DecisionGraphCitations;
|
|
10
11
|
onFold?: (decisionId: string) => void;
|
|
11
12
|
expansion?: DecisionGraphExpansion;
|
|
12
13
|
onOpenDecision?: (decisionId: string) => void;
|
|
13
14
|
rules?: DecisionGraphMinimapSlotProps['rules'];
|
|
14
15
|
dataTestId: string;
|
|
15
16
|
}
|
|
16
|
-
export declare const DecisionGraphText: <Refusal, Logic>({ nodes, mode, renderBody, expansion, onFold, onOpenDecision, rules, dataTestId, }: DecisionGraphTextProps<Refusal, Logic>) => React.ReactElement;
|
|
17
|
+
export declare const DecisionGraphText: <Refusal, Logic>({ nodes, mode, renderBody, citations, expansion, onFold, onOpenDecision, rules, dataTestId, }: DecisionGraphTextProps<Refusal, Logic>) => React.ReactElement;
|
|
17
18
|
//# sourceMappingURL=DecisionGraphText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecisionGraphText.d.ts","sourceRoot":"","sources":["../../src/decision-table/DecisionGraphText.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA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 const markTargetOf = ({ id, mark })=>mark?.kind === 'rule' ? {
|
|
|
21
21
|
kind: 'decision',
|
|
22
22
|
decisionId: id
|
|
23
23
|
};
|
|
24
|
+
const citationOf = (citations, decisionId)=>{
|
|
25
|
+
const cited = 'cited' === citations.kind ? citations.decisions.get(decisionId) ?? [] : [];
|
|
26
|
+
return 'cited' === citations.kind && cited.length > 0 ? {
|
|
27
|
+
citations: cited,
|
|
28
|
+
onOpen: citations.onOpenCitation
|
|
29
|
+
} : null;
|
|
30
|
+
};
|
|
24
31
|
const focuses = (mode)=>'navigate' === mode.kind && mode.focus;
|
|
25
32
|
const flashes = (mode)=>'inPlace' === mode.kind || mode.flash;
|
|
26
33
|
const prefersReducedMotion = ()=>'function' == typeof matchMedia && matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
@@ -78,7 +85,7 @@ const perRuleHeightOf = (heights, ruleCounts)=>{
|
|
|
78
85
|
}
|
|
79
86
|
return 0 === rules ? SENTENCE_MIN_RULE_HEIGHT_PX : height / rules;
|
|
80
87
|
};
|
|
81
|
-
const DecisionGraphText = ({ nodes, mode, renderBody, expansion, onFold, onOpenDecision, rules, dataTestId })=>{
|
|
88
|
+
const DecisionGraphText = ({ nodes, mode, renderBody, citations, expansion, onFold, onOpenDecision, rules, dataTestId })=>{
|
|
82
89
|
const labels = useDecisionGraphLabels();
|
|
83
90
|
const { selected } = mode;
|
|
84
91
|
const { announce, region } = useTextAnnouncements(useDecisionTextLabels(), dataTestId);
|
|
@@ -312,6 +319,7 @@ const DecisionGraphText = ({ nodes, mode, renderBody, expansion, onFold, onOpenD
|
|
|
312
319
|
}),
|
|
313
320
|
onOpen: openOf(node.id),
|
|
314
321
|
actions: actions.cardOf(node, position),
|
|
322
|
+
citations: citationOf(citations, node.id),
|
|
315
323
|
cardRef: cardRef(node.id),
|
|
316
324
|
dataTestId: dataTestId
|
|
317
325
|
}),
|
|
@@ -74,7 +74,7 @@ const nameTokensOf = (bands)=>{
|
|
|
74
74
|
text: columnId
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
|
-
const DecisionText = ({ table, mode, hitPolicies, columnTypes, numbered = false, marks = external_marks_cjs_namespaceObject.EMPTY_MARKS, onCellHover, headerMark, onOpenDecision, scroll = 'self', ariaLabel, containerProps, dataTestId, children })=>{
|
|
77
|
+
const DecisionText = ({ table, mode, hitPolicies, columnTypes, citations, numbered = false, marks = external_marks_cjs_namespaceObject.EMPTY_MARKS, onCellHover, headerMark, onOpenDecision, scroll = 'self', ariaLabel, containerProps, dataTestId, children })=>{
|
|
78
78
|
const { rules, inputs, outputs } = table;
|
|
79
79
|
const selected = 'diff' === mode.kind ? null : mode.selected;
|
|
80
80
|
const onSelect = 'select' === mode.kind || 'edit' === mode.kind ? mode.onSelect : void 0;
|
|
@@ -212,6 +212,10 @@ const DecisionText = ({ table, mode, hitPolicies, columnTypes, numbered = false,
|
|
|
212
212
|
title: title,
|
|
213
213
|
hint: policyHeader.hint,
|
|
214
214
|
mark: headerMark,
|
|
215
|
+
citations: 'cited' === citations.kind && citations.decision.length > 0 ? {
|
|
216
|
+
citations: citations.decision,
|
|
217
|
+
onOpen: citations.onOpenCitation
|
|
218
|
+
} : null,
|
|
215
219
|
labels: labels,
|
|
216
220
|
sticky: 'self' === scroll,
|
|
217
221
|
dataTestId: dataTestId
|
|
@@ -260,6 +264,7 @@ const DecisionText = ({ table, mode, hitPolicies, columnTypes, numbered = false,
|
|
|
260
264
|
selectedColumnId: navigation.selectedColumnId,
|
|
261
265
|
selectable: selectable,
|
|
262
266
|
decisionLinks: void 0 !== onOpenDecision,
|
|
267
|
+
citations: citations,
|
|
263
268
|
style: listStyle,
|
|
264
269
|
idPrefix: idPrefix,
|
|
265
270
|
dataTestId: dataTestId,
|
|
@@ -5,7 +5,7 @@ import { type DecisionTextDiff } from './decisionTextDiff';
|
|
|
5
5
|
import type { DecisionTextEdit } from './decisionTextTypes';
|
|
6
6
|
import { type HitPolicyCatalog, type HitPolicyPick } from './hitPolicyMenu';
|
|
7
7
|
import { type TableMarks } from './marks';
|
|
8
|
-
import type { DecisionTextTable, SentenceSelection } from './sentenceTypes';
|
|
8
|
+
import type { DecisionTextCitations, DecisionTextTable, SentenceSelection } from './sentenceTypes';
|
|
9
9
|
import { useCellHover } from './useCellHover';
|
|
10
10
|
import { type ContainerHandlersParams, type TextHistory, type DecisionTextContainerProps } from './useContainerHandlers';
|
|
11
11
|
import { type DecisionTextScroll } from './useRuleWindow';
|
|
@@ -34,6 +34,7 @@ export interface DecisionTextProps<Op, Policy, Total, Type, Refusal> {
|
|
|
34
34
|
mode: DecisionTextMode<Op, Policy, Total, Type, Refusal>;
|
|
35
35
|
hitPolicies: HitPolicyCatalog<Policy, Total>;
|
|
36
36
|
columnTypes: readonly ColumnTypeOption<Type>[];
|
|
37
|
+
citations: DecisionTextCitations;
|
|
37
38
|
numbered?: boolean;
|
|
38
39
|
marks?: TableMarks;
|
|
39
40
|
onCellHover?: Parameters<typeof useCellHover>[0];
|
|
@@ -45,6 +46,6 @@ export interface DecisionTextProps<Op, Policy, Total, Type, Refusal> {
|
|
|
45
46
|
dataTestId: string;
|
|
46
47
|
children?: React.ReactNode;
|
|
47
48
|
}
|
|
48
|
-
export declare const DecisionText: <Op, Policy, Total, Type, Refusal>({ table, mode, hitPolicies, columnTypes, numbered, marks, onCellHover, headerMark, onOpenDecision, scroll, ariaLabel, containerProps, dataTestId, children, }: DecisionTextProps<Op, Policy, Total, Type, Refusal>) => React.JSX.Element;
|
|
49
|
+
export declare const DecisionText: <Op, Policy, Total, Type, Refusal>({ table, mode, hitPolicies, columnTypes, citations, numbered, marks, onCellHover, headerMark, onOpenDecision, scroll, ariaLabel, containerProps, dataTestId, children, }: DecisionTextProps<Op, Policy, Total, Type, Refusal>) => React.JSX.Element;
|
|
49
50
|
export {};
|
|
50
51
|
//# sourceMappingURL=DecisionText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecisionText.d.ts","sourceRoot":"","sources":["../../src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C,cAAc,CAAC,EAAE,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;IAE3D,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAE5B,SAAS,EAAE,MAAM,CAAC;IAElB,cAAc,CAAC,EAAE,0BAA0B,CAAC;IAE5C,UAAU,EAAE,MAAM,CAAC;IAEnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAmBD,eAAO,MAAM,YAAY,GAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,0KAgB5D,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,KAAG,KAAK,CAAC,GAAG,CAAC,OA6NlE,CAAC"}
|
|
@@ -46,7 +46,7 @@ const nameTokensOf = (bands)=>{
|
|
|
46
46
|
text: columnId
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
|
-
const DecisionText = ({ table, mode, hitPolicies, columnTypes, numbered = false, marks = EMPTY_MARKS, onCellHover, headerMark, onOpenDecision, scroll = 'self', ariaLabel, containerProps, dataTestId, children })=>{
|
|
49
|
+
const DecisionText = ({ table, mode, hitPolicies, columnTypes, citations, numbered = false, marks = EMPTY_MARKS, onCellHover, headerMark, onOpenDecision, scroll = 'self', ariaLabel, containerProps, dataTestId, children })=>{
|
|
50
50
|
const { rules, inputs, outputs } = table;
|
|
51
51
|
const selected = 'diff' === mode.kind ? null : mode.selected;
|
|
52
52
|
const onSelect = 'select' === mode.kind || 'edit' === mode.kind ? mode.onSelect : void 0;
|
|
@@ -184,6 +184,10 @@ const DecisionText = ({ table, mode, hitPolicies, columnTypes, numbered = false,
|
|
|
184
184
|
title: title,
|
|
185
185
|
hint: policyHeader.hint,
|
|
186
186
|
mark: headerMark,
|
|
187
|
+
citations: 'cited' === citations.kind && citations.decision.length > 0 ? {
|
|
188
|
+
citations: citations.decision,
|
|
189
|
+
onOpen: citations.onOpenCitation
|
|
190
|
+
} : null,
|
|
187
191
|
labels: labels,
|
|
188
192
|
sticky: 'self' === scroll,
|
|
189
193
|
dataTestId: dataTestId
|
|
@@ -232,6 +236,7 @@ const DecisionText = ({ table, mode, hitPolicies, columnTypes, numbered = false,
|
|
|
232
236
|
selectedColumnId: navigation.selectedColumnId,
|
|
233
237
|
selectable: selectable,
|
|
234
238
|
decisionLinks: void 0 !== onOpenDecision,
|
|
239
|
+
citations: citations,
|
|
235
240
|
style: listStyle,
|
|
236
241
|
idPrefix: idPrefix,
|
|
237
242
|
dataTestId: dataTestId,
|
|
@@ -28,6 +28,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
30
|
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
|
+
const external_CitationButton_cjs_namespaceObject = require("./CitationButton.cjs");
|
|
31
32
|
const external_react_namespaceObject = require("react");
|
|
32
33
|
const external_MarkBadge_cjs_namespaceObject = require("./MarkBadge.cjs");
|
|
33
34
|
const external_PolicyPicker_cjs_namespaceObject = require("./PolicyPicker.cjs");
|
|
@@ -70,7 +71,7 @@ const HitPolicyChange = ({ change, describedBy, labels })=>/*#__PURE__*/ (0, jsx
|
|
|
70
71
|
})
|
|
71
72
|
]
|
|
72
73
|
});
|
|
73
|
-
const DecisionTextHeader = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ title, hint, mark, labels, sticky, dataTestId }, ref)=>{
|
|
74
|
+
const DecisionTextHeader = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ title, hint, mark, citations, labels, sticky, dataTestId }, ref)=>{
|
|
74
75
|
const badgeId = (0, external_react_namespaceObject.useId)();
|
|
75
76
|
const marks = (0, external_sentenceMarks_cjs_namespaceObject.isLineMark)(mark) ? [
|
|
76
77
|
mark
|
|
@@ -103,6 +104,18 @@ const DecisionTextHeader = /*#__PURE__*/ (0, external_react_namespaceObject.forw
|
|
|
103
104
|
}),
|
|
104
105
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
105
106
|
children: hint
|
|
107
|
+
}),
|
|
108
|
+
citations && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
109
|
+
className: external_sentenceStyles_cjs_namespaceObject.HEADER_CITATIONS_CLASS,
|
|
110
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CitationButton_cjs_namespaceObject.CitationButtons, {
|
|
111
|
+
citations: citations.citations,
|
|
112
|
+
onOpen: citations.onOpen,
|
|
113
|
+
selected: false,
|
|
114
|
+
tabIndex: 0,
|
|
115
|
+
className: external_sentenceStyles_cjs_namespaceObject.HEADER_CITATION_REVEAL_CLASS,
|
|
116
|
+
labels: labels,
|
|
117
|
+
dataTestId: `${dataTestId}-citation`
|
|
118
|
+
})
|
|
106
119
|
})
|
|
107
120
|
]
|
|
108
121
|
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
import { type CitationLabels } from './CitationButton';
|
|
2
3
|
import type { DiffLabels } from './decisionTextDiff';
|
|
3
4
|
import { type MarkBadgeProps } from './MarkBadge';
|
|
4
5
|
import type { Mark } from './marks';
|
|
5
6
|
import { type PolicyPickerProps } from './PolicyPicker';
|
|
7
|
+
import type { OpenCitation, SentenceCitation } from './sentenceTypes';
|
|
6
8
|
export interface DecisionTextHeaderProps {
|
|
7
9
|
title: {
|
|
8
10
|
kind: 'label';
|
|
@@ -17,7 +19,11 @@ export interface DecisionTextHeaderProps {
|
|
|
17
19
|
};
|
|
18
20
|
hint: string;
|
|
19
21
|
mark: Mark | undefined;
|
|
20
|
-
|
|
22
|
+
citations: {
|
|
23
|
+
citations: readonly SentenceCitation[];
|
|
24
|
+
onOpen: OpenCitation;
|
|
25
|
+
} | null;
|
|
26
|
+
labels: MarkBadgeProps['labels'] & Pick<DiffLabels, 'previousValue' | 'currentValue'> & CitationLabels;
|
|
21
27
|
sticky: boolean;
|
|
22
28
|
dataTestId: string;
|
|
23
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecisionTextHeader.d.ts","sourceRoot":"","sources":["../../src/decision-table/DecisionTextHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DecisionTextHeader.d.ts","sourceRoot":"","sources":["../../src/decision-table/DecisionTextHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAa,KAAK,cAAc,EAAW,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAWtE,MAAM,WAAW,uBAAuB;IAEtC,KAAK,EACD;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAChC;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,aAAa,CAAC,CAAA;KAAE,GACjF;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAEtD,IAAI,EAAE,MAAM,CAAC;IAEb,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;IAEvB,SAAS,EAAE;QAAE,SAAS,EAAE,SAAS,gBAAgB,EAAE,CAAC;QAAC,MAAM,EAAE,YAAY,CAAA;KAAE,GAAG,IAAI,CAAC;IACnF,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAC9B,IAAI,CAAC,UAAU,EAAE,eAAe,GAAG,cAAc,CAAC,GAClD,cAAc,CAAC;IAEjB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAuBD,eAAO,MAAM,kBAAkB,gGAwC9B,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "@uipath/apollo-wind";
|
|
3
|
+
import { CitationButtons } from "./CitationButton.js";
|
|
3
4
|
import { forwardRef, useId } from "react";
|
|
4
5
|
import { MarkBadge, markIds } from "./MarkBadge.js";
|
|
5
6
|
import { PolicyPicker } from "./PolicyPicker.js";
|
|
6
7
|
import { isLineMark } from "./sentenceMarks.js";
|
|
7
|
-
import { CHANGED_CHIP_CLASS, DECISION_TEXT_HEADER_CLASS, HEADER_LABEL_CLASS, HIT_POLICY_CHANGE_CLASS, STRUCK_VALUE_CLASS } from "./sentenceStyles.js";
|
|
8
|
+
import { CHANGED_CHIP_CLASS, DECISION_TEXT_HEADER_CLASS, HEADER_CITATIONS_CLASS, HEADER_CITATION_REVEAL_CLASS, HEADER_LABEL_CLASS, HIT_POLICY_CHANGE_CLASS, STRUCK_VALUE_CLASS } from "./sentenceStyles.js";
|
|
8
9
|
const HitPolicyChange = ({ change, describedBy, labels })=>/*#__PURE__*/ jsxs("span", {
|
|
9
10
|
className: HIT_POLICY_CHANGE_CLASS,
|
|
10
11
|
"aria-describedby": describedBy,
|
|
@@ -42,7 +43,7 @@ const HitPolicyChange = ({ change, describedBy, labels })=>/*#__PURE__*/ jsxs("s
|
|
|
42
43
|
})
|
|
43
44
|
]
|
|
44
45
|
});
|
|
45
|
-
const DecisionTextHeader = /*#__PURE__*/ forwardRef(({ title, hint, mark, labels, sticky, dataTestId }, ref)=>{
|
|
46
|
+
const DecisionTextHeader = /*#__PURE__*/ forwardRef(({ title, hint, mark, citations, labels, sticky, dataTestId }, ref)=>{
|
|
46
47
|
const badgeId = useId();
|
|
47
48
|
const marks = isLineMark(mark) ? [
|
|
48
49
|
mark
|
|
@@ -75,6 +76,18 @@ const DecisionTextHeader = /*#__PURE__*/ forwardRef(({ title, hint, mark, labels
|
|
|
75
76
|
}),
|
|
76
77
|
/*#__PURE__*/ jsx("span", {
|
|
77
78
|
children: hint
|
|
79
|
+
}),
|
|
80
|
+
citations && /*#__PURE__*/ jsx("span", {
|
|
81
|
+
className: HEADER_CITATIONS_CLASS,
|
|
82
|
+
children: /*#__PURE__*/ jsx(CitationButtons, {
|
|
83
|
+
citations: citations.citations,
|
|
84
|
+
onOpen: citations.onOpen,
|
|
85
|
+
selected: false,
|
|
86
|
+
tabIndex: 0,
|
|
87
|
+
className: HEADER_CITATION_REVEAL_CLASS,
|
|
88
|
+
labels: labels,
|
|
89
|
+
dataTestId: `${dataTestId}-citation`
|
|
90
|
+
})
|
|
78
91
|
})
|
|
79
92
|
]
|
|
80
93
|
});
|