@uipath/apollo-react 7.21.1 → 7.23.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/BandColumn.cjs +12 -3
- package/dist/decision-table/BandColumn.d.ts +3 -1
- package/dist/decision-table/BandColumn.d.ts.map +1 -1
- package/dist/decision-table/BandColumn.js +13 -4
- package/dist/decision-table/BandList.cjs +2 -1
- package/dist/decision-table/BandList.d.ts +1 -0
- package/dist/decision-table/BandList.d.ts.map +1 -1
- package/dist/decision-table/BandList.js +2 -1
- package/dist/decision-table/ConditionLine.cjs +7 -2
- package/dist/decision-table/ConditionLine.d.ts +2 -1
- package/dist/decision-table/ConditionLine.d.ts.map +1 -1
- package/dist/decision-table/ConditionLine.js +8 -3
- package/dist/decision-table/DecisionText.cjs +53 -7
- package/dist/decision-table/DecisionText.d.ts +14 -1
- package/dist/decision-table/DecisionText.d.ts.map +1 -1
- package/dist/decision-table/DecisionText.js +55 -9
- package/dist/decision-table/DecisionTextHeader.cjs +45 -3
- package/dist/decision-table/DecisionTextHeader.d.ts +6 -2
- package/dist/decision-table/DecisionTextHeader.d.ts.map +1 -1
- package/dist/decision-table/DecisionTextHeader.js +46 -4
- package/dist/decision-table/DiffFoldRow.cjs +59 -0
- package/dist/decision-table/DiffFoldRow.d.ts +13 -0
- package/dist/decision-table/DiffFoldRow.d.ts.map +1 -0
- package/dist/decision-table/DiffFoldRow.js +25 -0
- package/dist/decision-table/LineText.cjs +57 -15
- package/dist/decision-table/LineText.d.ts +3 -1
- package/dist/decision-table/LineText.d.ts.map +1 -1
- package/dist/decision-table/LineText.js +58 -16
- package/dist/decision-table/MarkTooltip.cjs +4 -2
- package/dist/decision-table/MarkTooltip.d.ts.map +1 -1
- package/dist/decision-table/MarkTooltip.js +4 -2
- package/dist/decision-table/RuleCard.cjs +58 -13
- package/dist/decision-table/RuleCard.d.ts +2 -1
- package/dist/decision-table/RuleCard.d.ts.map +1 -1
- package/dist/decision-table/RuleCard.js +59 -14
- package/dist/decision-table/RuleLine.cjs +17 -1
- package/dist/decision-table/RuleLine.d.ts +3 -1
- package/dist/decision-table/RuleLine.d.ts.map +1 -1
- package/dist/decision-table/RuleLine.js +18 -2
- package/dist/decision-table/RuleList.cjs +17 -3
- package/dist/decision-table/RuleList.d.ts +5 -1
- package/dist/decision-table/RuleList.d.ts.map +1 -1
- package/dist/decision-table/RuleList.js +17 -3
- package/dist/decision-table/SentenceBands.cjs +2 -1
- package/dist/decision-table/SentenceBands.d.ts +1 -1
- package/dist/decision-table/SentenceBands.d.ts.map +1 -1
- package/dist/decision-table/SentenceBands.js +2 -1
- package/dist/decision-table/TokenChip.cjs +5 -3
- package/dist/decision-table/TokenChip.d.ts +2 -0
- package/dist/decision-table/TokenChip.d.ts.map +1 -1
- package/dist/decision-table/TokenChip.js +6 -4
- package/dist/decision-table/__fixtures__/diffSentences.fixtures.d.ts +17 -0
- package/dist/decision-table/__fixtures__/diffSentences.fixtures.d.ts.map +1 -0
- package/dist/decision-table/decisionTextDiff.cjs +379 -0
- package/dist/decision-table/decisionTextDiff.d.ts +106 -0
- package/dist/decision-table/decisionTextDiff.d.ts.map +1 -0
- package/dist/decision-table/decisionTextDiff.js +330 -0
- package/dist/decision-table/decisionTextTypes.d.ts +2 -1
- package/dist/decision-table/decisionTextTypes.d.ts.map +1 -1
- package/dist/decision-table/index.d.ts +2 -0
- 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.cjs +19 -9
- package/dist/decision-table/ruleCardModel.d.ts +7 -3
- package/dist/decision-table/ruleCardModel.d.ts.map +1 -1
- package/dist/decision-table/ruleCardModel.js +19 -9
- package/dist/decision-table/sentenceParts.cjs +31 -10
- package/dist/decision-table/sentenceParts.d.ts +2 -1
- package/dist/decision-table/sentenceParts.d.ts.map +1 -1
- package/dist/decision-table/sentenceParts.js +29 -11
- package/dist/decision-table/sentenceStyles.cjs +64 -11
- package/dist/decision-table/sentenceStyles.d.ts +14 -1
- package/dist/decision-table/sentenceStyles.d.ts.map +1 -1
- package/dist/decision-table/sentenceStyles.js +17 -3
- package/dist/decision-table/styles/tailwind.decision-table.css +1 -1
- package/dist/decision-table/useDecisionTextStrings.cjs +45 -0
- package/dist/decision-table/useDecisionTextStrings.d.ts.map +1 -1
- package/dist/decision-table/useDecisionTextStrings.js +45 -0
- package/dist/decision-table/useRuleWindow.cjs +122 -9
- package/dist/decision-table/useRuleWindow.d.ts +4 -1
- package/dist/decision-table/useRuleWindow.d.ts.map +1 -1
- package/dist/decision-table/useRuleWindow.js +122 -9
- package/dist/decision-table/useVirtualizedAxis.cjs +8 -4
- package/dist/decision-table/useVirtualizedAxis.d.ts.map +1 -1
- package/dist/decision-table/useVirtualizedAxis.js +8 -4
- package/package.json +1 -1
|
@@ -27,6 +27,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
BandColumn: ()=>BandColumn
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
30
31
|
const external_MarkBadge_cjs_namespaceObject = require("./MarkBadge.cjs");
|
|
31
32
|
const external_sentenceMarks_cjs_namespaceObject = require("./sentenceMarks.cjs");
|
|
32
33
|
const external_sentenceStyles_cjs_namespaceObject = require("./sentenceStyles.cjs");
|
|
@@ -36,7 +37,7 @@ const columnMark = (mark)=>({
|
|
|
36
37
|
glyph: mark?.glyph,
|
|
37
38
|
matched: void 0
|
|
38
39
|
});
|
|
39
|
-
const BandColumn = ({ column, mark, badgeId, labels, onToggle, editorId })=>{
|
|
40
|
+
const BandColumn = ({ column, mark, badgeId, change, labels, onToggle, editorId })=>{
|
|
40
41
|
const { tone, title } = columnMark(mark);
|
|
41
42
|
const columnMarks = (0, external_sentenceMarks_cjs_namespaceObject.isLineMark)(mark) ? [
|
|
42
43
|
mark
|
|
@@ -44,6 +45,7 @@ const BandColumn = ({ column, mark, badgeId, labels, onToggle, editorId })=>{
|
|
|
44
45
|
const chip = {
|
|
45
46
|
'aria-describedby': columnMarks ? (0, external_MarkBadge_cjs_namespaceObject.markIds)(badgeId, columnMarks).join(' ') : void 0,
|
|
46
47
|
'data-tone': tone,
|
|
48
|
+
'data-change': change,
|
|
47
49
|
'data-mark-title': title
|
|
48
50
|
};
|
|
49
51
|
const content = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
@@ -53,6 +55,13 @@ const BandColumn = ({ column, mark, badgeId, labels, onToggle, editorId })=>{
|
|
|
53
55
|
className: external_sentenceStyles_cjs_namespaceObject.POPOVER_ICON_CLASS,
|
|
54
56
|
children: column.icon
|
|
55
57
|
}),
|
|
58
|
+
change && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
59
|
+
className: "sr-only",
|
|
60
|
+
children: [
|
|
61
|
+
labels.changeStatus(change),
|
|
62
|
+
" "
|
|
63
|
+
]
|
|
64
|
+
}),
|
|
56
65
|
column.name,
|
|
57
66
|
columnMarks && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_MarkBadge_cjs_namespaceObject.MarkBadge, {
|
|
58
67
|
id: badgeId,
|
|
@@ -62,7 +71,7 @@ const BandColumn = ({ column, mark, badgeId, labels, onToggle, editorId })=>{
|
|
|
62
71
|
]
|
|
63
72
|
});
|
|
64
73
|
if (!onToggle) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("li", {
|
|
65
|
-
className: external_sentenceStyles_cjs_namespaceObject.BAND_COLUMN_CLASS,
|
|
74
|
+
className: (0, apollo_wind_namespaceObject.cn)(external_sentenceStyles_cjs_namespaceObject.BAND_COLUMN_CLASS, external_sentenceStyles_cjs_namespaceObject.CHANGED_CHIP_CLASS),
|
|
66
75
|
"data-column-id": column.id,
|
|
67
76
|
...chip,
|
|
68
77
|
children: content
|
|
@@ -72,7 +81,7 @@ const BandColumn = ({ column, mark, badgeId, labels, onToggle, editorId })=>{
|
|
|
72
81
|
"data-column-id": column.id,
|
|
73
82
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
74
83
|
type: "button",
|
|
75
|
-
className: external_sentenceStyles_cjs_namespaceObject.BAND_COLUMN_BUTTON_CLASS,
|
|
84
|
+
className: (0, apollo_wind_namespaceObject.cn)(external_sentenceStyles_cjs_namespaceObject.BAND_COLUMN_BUTTON_CLASS, external_sentenceStyles_cjs_namespaceObject.CHANGED_CHIP_CLASS),
|
|
76
85
|
"aria-expanded": void 0 !== editorId,
|
|
77
86
|
"aria-controls": editorId,
|
|
78
87
|
onClick: ()=>onToggle(column.id),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
import type { DiffChange, DiffLabels } from './decisionTextDiff';
|
|
2
3
|
import { type MarkBadgeProps } from './MarkBadge';
|
|
3
4
|
import type { Mark } from './marks';
|
|
4
5
|
import type { SentenceBandColumn } from './sentenceTypes';
|
|
@@ -6,7 +7,8 @@ export interface BandColumnProps {
|
|
|
6
7
|
column: SentenceBandColumn;
|
|
7
8
|
mark: Mark | undefined;
|
|
8
9
|
badgeId: string;
|
|
9
|
-
|
|
10
|
+
change: DiffChange | undefined;
|
|
11
|
+
labels: MarkBadgeProps['labels'] & Pick<DiffLabels, 'changeStatus'>;
|
|
10
12
|
onToggle: ((columnId: string) => void) | undefined;
|
|
11
13
|
editorId: string | undefined;
|
|
12
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BandColumn.d.ts","sourceRoot":"","sources":["../../src/decision-table/BandColumn.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BandColumn.d.ts","sourceRoot":"","sources":["../../src/decision-table/BandColumn.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAa,KAAK,cAAc,EAAW,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AASpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAW1D,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,kBAAkB,CAAC;IAC3B,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAEhB,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/B,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAEpE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAEnD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAGD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAsDhD,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@uipath/apollo-wind";
|
|
2
3
|
import { MarkBadge, markIds } from "./MarkBadge.js";
|
|
3
4
|
import { isLineMark } from "./sentenceMarks.js";
|
|
4
|
-
import { BAND_COLUMN_BUTTON_CLASS, BAND_COLUMN_CLASS, BAND_COLUMN_ITEM_CLASS, POPOVER_ICON_CLASS } from "./sentenceStyles.js";
|
|
5
|
+
import { BAND_COLUMN_BUTTON_CLASS, BAND_COLUMN_CLASS, BAND_COLUMN_ITEM_CLASS, CHANGED_CHIP_CLASS, POPOVER_ICON_CLASS } from "./sentenceStyles.js";
|
|
5
6
|
const columnMark = (mark)=>({
|
|
6
7
|
tone: mark?.tone,
|
|
7
8
|
title: mark?.title,
|
|
8
9
|
glyph: mark?.glyph,
|
|
9
10
|
matched: void 0
|
|
10
11
|
});
|
|
11
|
-
const BandColumn = ({ column, mark, badgeId, labels, onToggle, editorId })=>{
|
|
12
|
+
const BandColumn = ({ column, mark, badgeId, change, labels, onToggle, editorId })=>{
|
|
12
13
|
const { tone, title } = columnMark(mark);
|
|
13
14
|
const columnMarks = isLineMark(mark) ? [
|
|
14
15
|
mark
|
|
@@ -16,6 +17,7 @@ const BandColumn = ({ column, mark, badgeId, labels, onToggle, editorId })=>{
|
|
|
16
17
|
const chip = {
|
|
17
18
|
'aria-describedby': columnMarks ? markIds(badgeId, columnMarks).join(' ') : void 0,
|
|
18
19
|
'data-tone': tone,
|
|
20
|
+
'data-change': change,
|
|
19
21
|
'data-mark-title': title
|
|
20
22
|
};
|
|
21
23
|
const content = /*#__PURE__*/ jsxs(Fragment, {
|
|
@@ -25,6 +27,13 @@ const BandColumn = ({ column, mark, badgeId, labels, onToggle, editorId })=>{
|
|
|
25
27
|
className: POPOVER_ICON_CLASS,
|
|
26
28
|
children: column.icon
|
|
27
29
|
}),
|
|
30
|
+
change && /*#__PURE__*/ jsxs("span", {
|
|
31
|
+
className: "sr-only",
|
|
32
|
+
children: [
|
|
33
|
+
labels.changeStatus(change),
|
|
34
|
+
" "
|
|
35
|
+
]
|
|
36
|
+
}),
|
|
28
37
|
column.name,
|
|
29
38
|
columnMarks && /*#__PURE__*/ jsx(MarkBadge, {
|
|
30
39
|
id: badgeId,
|
|
@@ -34,7 +43,7 @@ const BandColumn = ({ column, mark, badgeId, labels, onToggle, editorId })=>{
|
|
|
34
43
|
]
|
|
35
44
|
});
|
|
36
45
|
if (!onToggle) return /*#__PURE__*/ jsx("li", {
|
|
37
|
-
className: BAND_COLUMN_CLASS,
|
|
46
|
+
className: cn(BAND_COLUMN_CLASS, CHANGED_CHIP_CLASS),
|
|
38
47
|
"data-column-id": column.id,
|
|
39
48
|
...chip,
|
|
40
49
|
children: content
|
|
@@ -44,7 +53,7 @@ const BandColumn = ({ column, mark, badgeId, labels, onToggle, editorId })=>{
|
|
|
44
53
|
"data-column-id": column.id,
|
|
45
54
|
children: /*#__PURE__*/ jsx("button", {
|
|
46
55
|
type: "button",
|
|
47
|
-
className: BAND_COLUMN_BUTTON_CLASS,
|
|
56
|
+
className: cn(BAND_COLUMN_BUTTON_CLASS, CHANGED_CHIP_CLASS),
|
|
48
57
|
"aria-expanded": void 0 !== editorId,
|
|
49
58
|
"aria-controls": editorId,
|
|
50
59
|
onClick: ()=>onToggle(column.id),
|
|
@@ -30,7 +30,7 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
30
30
|
const external_BandColumn_cjs_namespaceObject = require("./BandColumn.cjs");
|
|
31
31
|
const external_sentenceStyles_cjs_namespaceObject = require("./sentenceStyles.cjs");
|
|
32
32
|
const external_useHorizontalOverflow_cjs_namespaceObject = require("./useHorizontalOverflow.cjs");
|
|
33
|
-
const BandList = ({ band, marks, badgeIdPrefix, labels, onToggleColumn, openColumnId, editorId })=>{
|
|
33
|
+
const BandList = ({ band, marks, badgeIdPrefix, changes, labels, onToggleColumn, openColumnId, editorId })=>{
|
|
34
34
|
const { ref, overflows } = (0, external_useHorizontalOverflow_cjs_namespaceObject.useHorizontalOverflow)();
|
|
35
35
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("ul", {
|
|
36
36
|
ref: ref,
|
|
@@ -41,6 +41,7 @@ const BandList = ({ band, marks, badgeIdPrefix, labels, onToggleColumn, openColu
|
|
|
41
41
|
column: column,
|
|
42
42
|
mark: marks.get(column.id),
|
|
43
43
|
badgeId: `${badgeIdPrefix}-${columnIndex}`,
|
|
44
|
+
change: changes?.get(column.id),
|
|
44
45
|
labels: labels,
|
|
45
46
|
onToggle: onToggleColumn,
|
|
46
47
|
editorId: column.id === openColumnId ? editorId : void 0
|
|
@@ -6,6 +6,7 @@ export interface BandListProps {
|
|
|
6
6
|
band: SentenceBand;
|
|
7
7
|
marks: TableMarks['columns'];
|
|
8
8
|
badgeIdPrefix: string;
|
|
9
|
+
changes: ReadonlyMap<string, NonNullable<BandColumnProps['change']>> | undefined;
|
|
9
10
|
labels: BandColumnProps['labels'];
|
|
10
11
|
onToggleColumn: BandColumnProps['onToggle'];
|
|
11
12
|
openColumnId: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BandList.d.ts","sourceRoot":"","sources":["../../src/decision-table/BandList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAE7B,aAAa,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"BandList.d.ts","sourceRoot":"","sources":["../../src/decision-table/BandList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAE7B,aAAa,EAAE,MAAM,CAAC;IAEtB,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACjF,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;IAClC,cAAc,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;IAE5C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAGD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAgC5C,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { BandColumn } from "./BandColumn.js";
|
|
3
3
|
import { BAND_COLUMNS_CLASS } from "./sentenceStyles.js";
|
|
4
4
|
import { useHorizontalOverflow } from "./useHorizontalOverflow.js";
|
|
5
|
-
const BandList = ({ band, marks, badgeIdPrefix, labels, onToggleColumn, openColumnId, editorId })=>{
|
|
5
|
+
const BandList = ({ band, marks, badgeIdPrefix, changes, labels, onToggleColumn, openColumnId, editorId })=>{
|
|
6
6
|
const { ref, overflows } = useHorizontalOverflow();
|
|
7
7
|
return /*#__PURE__*/ jsx("ul", {
|
|
8
8
|
ref: ref,
|
|
@@ -13,6 +13,7 @@ const BandList = ({ band, marks, badgeIdPrefix, labels, onToggleColumn, openColu
|
|
|
13
13
|
column: column,
|
|
14
14
|
mark: marks.get(column.id),
|
|
15
15
|
badgeId: `${badgeIdPrefix}-${columnIndex}`,
|
|
16
|
+
change: changes?.get(column.id),
|
|
16
17
|
labels: labels,
|
|
17
18
|
onToggle: onToggleColumn,
|
|
18
19
|
editorId: column.id === openColumnId ? editorId : void 0
|
|
@@ -33,18 +33,23 @@ const external_LineText_cjs_namespaceObject = require("./LineText.cjs");
|
|
|
33
33
|
const external_MarkBadge_cjs_namespaceObject = require("./MarkBadge.cjs");
|
|
34
34
|
const external_RemoveConditionButton_cjs_namespaceObject = require("./RemoveConditionButton.cjs");
|
|
35
35
|
const external_sentenceStyles_cjs_namespaceObject = require("./sentenceStyles.cjs");
|
|
36
|
-
const ConditionLine = ({ line, pending, badge, removal, ...lineProps })=>{
|
|
36
|
+
const ConditionLine = ({ line, pending, change, badge, removal, ...lineProps })=>{
|
|
37
37
|
const matched = lineProps.cells?.[line.columnId]?.matched;
|
|
38
38
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("li", {
|
|
39
|
-
className: (0, apollo_wind_namespaceObject.cn)(external_sentenceStyles_cjs_namespaceObject.LINE_CLASS, external_sentenceStyles_cjs_namespaceObject.MATCHED_LINE_CLASS, pending && external_sentenceStyles_cjs_namespaceObject.PENDING_LINE_CLASS),
|
|
39
|
+
className: (0, apollo_wind_namespaceObject.cn)(external_sentenceStyles_cjs_namespaceObject.LINE_CLASS, external_sentenceStyles_cjs_namespaceObject.MATCHED_LINE_CLASS, pending && external_sentenceStyles_cjs_namespaceObject.PENDING_LINE_CLASS, 'delete' === change && external_sentenceStyles_cjs_namespaceObject.REMOVED_LINE_CLASS, 'add' === change && external_sentenceStyles_cjs_namespaceObject.ADDED_LINE_CLASS),
|
|
40
40
|
"data-column-id": line.columnId,
|
|
41
41
|
"data-pending": pending || void 0,
|
|
42
|
+
"data-change": change,
|
|
42
43
|
"data-matched": matched,
|
|
43
44
|
children: [
|
|
44
45
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_LineLead_cjs_namespaceObject.LineLead, {
|
|
45
46
|
matched: matched,
|
|
46
47
|
labels: lineProps.labels
|
|
47
48
|
}),
|
|
49
|
+
change && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
50
|
+
className: "sr-only",
|
|
51
|
+
children: lineProps.labels.changeStatus(change)
|
|
52
|
+
}),
|
|
48
53
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_LineText_cjs_namespaceObject.LineText, {
|
|
49
54
|
parts: line.parts,
|
|
50
55
|
...lineProps
|
|
@@ -3,9 +3,10 @@ import { type LineTextProps } from './LineText';
|
|
|
3
3
|
import { type MarkBadgeProps } from './MarkBadge';
|
|
4
4
|
import { type RemoveConditionButtonProps } from './RemoveConditionButton';
|
|
5
5
|
import type { SentenceLine } from './sentenceTypes';
|
|
6
|
-
export interface ConditionLineProps extends Pick<LineTextProps, 'cells' | 'selectedColumnId' | 'stopOf' | 'linkOf' | 'labels'> {
|
|
6
|
+
export interface ConditionLineProps extends Pick<LineTextProps, 'cells' | 'selectedColumnId' | 'stopOf' | 'linkOf' | 'diffOf' | 'labels'> {
|
|
7
7
|
line: SentenceLine;
|
|
8
8
|
pending: boolean;
|
|
9
|
+
change?: 'add' | 'delete';
|
|
9
10
|
badge: MarkBadgeProps | null;
|
|
10
11
|
removal: RemoveConditionButtonProps | null;
|
|
11
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionLine.d.ts","sourceRoot":"","sources":["../../src/decision-table/ConditionLine.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAyB,KAAK,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConditionLine.d.ts","sourceRoot":"","sources":["../../src/decision-table/ConditionLine.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAyB,KAAK,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAQjG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,WAAW,kBACf,SAAQ,IAAI,CACV,aAAa,EACb,OAAO,GAAG,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CACzE;IACD,IAAI,EAAE,YAAY,CAAC;IAEnB,OAAO,EAAE,OAAO,CAAC;IAEjB,MAAM,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC1B,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,0BAA0B,GAAG,IAAI,CAAC;CAC5C;AAGD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA8BtD,CAAC"}
|
|
@@ -4,19 +4,24 @@ import { LineLead } from "./LineLead.js";
|
|
|
4
4
|
import { LineText } from "./LineText.js";
|
|
5
5
|
import { MarkBadge } from "./MarkBadge.js";
|
|
6
6
|
import { RemoveConditionButton } from "./RemoveConditionButton.js";
|
|
7
|
-
import { LINE_CLASS, MATCHED_LINE_CLASS, PENDING_LINE_CLASS } from "./sentenceStyles.js";
|
|
8
|
-
const ConditionLine = ({ line, pending, badge, removal, ...lineProps })=>{
|
|
7
|
+
import { ADDED_LINE_CLASS, LINE_CLASS, MATCHED_LINE_CLASS, PENDING_LINE_CLASS, REMOVED_LINE_CLASS } from "./sentenceStyles.js";
|
|
8
|
+
const ConditionLine = ({ line, pending, change, badge, removal, ...lineProps })=>{
|
|
9
9
|
const matched = lineProps.cells?.[line.columnId]?.matched;
|
|
10
10
|
return /*#__PURE__*/ jsxs("li", {
|
|
11
|
-
className: cn(LINE_CLASS, MATCHED_LINE_CLASS, pending && PENDING_LINE_CLASS),
|
|
11
|
+
className: cn(LINE_CLASS, MATCHED_LINE_CLASS, pending && PENDING_LINE_CLASS, 'delete' === change && REMOVED_LINE_CLASS, 'add' === change && ADDED_LINE_CLASS),
|
|
12
12
|
"data-column-id": line.columnId,
|
|
13
13
|
"data-pending": pending || void 0,
|
|
14
|
+
"data-change": change,
|
|
14
15
|
"data-matched": matched,
|
|
15
16
|
children: [
|
|
16
17
|
/*#__PURE__*/ jsx(LineLead, {
|
|
17
18
|
matched: matched,
|
|
18
19
|
labels: lineProps.labels
|
|
19
20
|
}),
|
|
21
|
+
change && /*#__PURE__*/ jsx("span", {
|
|
22
|
+
className: "sr-only",
|
|
23
|
+
children: lineProps.labels.changeStatus(change)
|
|
24
|
+
}),
|
|
20
25
|
/*#__PURE__*/ jsx(LineText, {
|
|
21
26
|
parts: line.parts,
|
|
22
27
|
...lineProps
|
|
@@ -33,6 +33,7 @@ const external_AddRuleFooter_cjs_namespaceObject = require("./AddRuleFooter.cjs"
|
|
|
33
33
|
const external_bandColumns_cjs_namespaceObject = require("./bandColumns.cjs");
|
|
34
34
|
const external_ColumnEditorOverlay_cjs_namespaceObject = require("./ColumnEditorOverlay.cjs");
|
|
35
35
|
const external_DecisionTextHeader_cjs_namespaceObject = require("./DecisionTextHeader.cjs");
|
|
36
|
+
const external_decisionTextDiff_cjs_namespaceObject = require("./decisionTextDiff.cjs");
|
|
36
37
|
const external_EmptyRules_cjs_namespaceObject = require("./EmptyRules.cjs");
|
|
37
38
|
const external_GridMenu_cjs_namespaceObject = require("./GridMenu.cjs");
|
|
38
39
|
const external_MarkTooltip_cjs_namespaceObject = require("./MarkTooltip.cjs");
|
|
@@ -54,15 +55,48 @@ const external_useRuleWindow_cjs_namespaceObject = require("./useRuleWindow.cjs"
|
|
|
54
55
|
const external_useSentenceNavigation_cjs_namespaceObject = require("./useSentenceNavigation.cjs");
|
|
55
56
|
const external_useValueEditing_cjs_namespaceObject = require("./useValueEditing.cjs");
|
|
56
57
|
const external_ValueEditorOverlay_cjs_namespaceObject = require("./ValueEditorOverlay.cjs");
|
|
57
|
-
const
|
|
58
|
+
const NO_FOLDS = new Set();
|
|
59
|
+
const nameTokensOf = (bands)=>{
|
|
60
|
+
const names = new Map(bands.flatMap(({ id, columns })=>columns.map((column)=>[
|
|
61
|
+
column.id,
|
|
62
|
+
{
|
|
63
|
+
kind: 'outputs' === id ? 'output' : 'input',
|
|
64
|
+
columnId: column.id,
|
|
65
|
+
text: column.name
|
|
66
|
+
}
|
|
67
|
+
])));
|
|
68
|
+
return (columnId)=>names.get(columnId) ?? {
|
|
69
|
+
kind: 'input',
|
|
70
|
+
columnId,
|
|
71
|
+
text: columnId
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
const DecisionText = ({ rules, inputs, outputs, header, numbered = false, marks = external_marks_cjs_namespaceObject.EMPTY_MARKS, addRule, onCellHover, selected, onSelect, edit: hostEdit, diff, policy, headerMark, onOpenDecision, labels: hostLabels, scroll = 'self', ariaLabel, containerProps, dataTestId, children })=>{
|
|
58
75
|
const idPrefix = (0, external_react_namespaceObject.useId)();
|
|
59
76
|
const labels = (0, external_useDecisionTextStrings_cjs_namespaceObject.useDecisionTextLabels)(hostLabels);
|
|
60
77
|
const { edit, refusal } = (0, external_useEditState_cjs_namespaceObject.useEditState)(hostEdit, (0, external_useDecisionTextStrings_cjs_namespaceObject.useDecisionTextEditLabels)(hostEdit?.labels));
|
|
61
|
-
const
|
|
78
|
+
const columns = (0, external_react_namespaceObject.useMemo)(()=>diff && (0, external_decisionTextDiff_cjs_namespaceObject.diffColumnsOf)(inputs, outputs, diff), [
|
|
79
|
+
inputs,
|
|
80
|
+
outputs,
|
|
81
|
+
diff
|
|
82
|
+
]);
|
|
83
|
+
const bands = (0, external_react_namespaceObject.useMemo)(()=>(0, external_bandColumns_cjs_namespaceObject.bandsOf)(columns?.inputs ?? inputs, columns?.outputs ?? outputs, labels), [
|
|
84
|
+
columns,
|
|
62
85
|
inputs,
|
|
63
86
|
outputs,
|
|
64
87
|
labels
|
|
65
88
|
]);
|
|
89
|
+
const [folds, setFolds] = (0, external_react_namespaceObject.useState)({
|
|
90
|
+
diff,
|
|
91
|
+
expanded: NO_FOLDS
|
|
92
|
+
});
|
|
93
|
+
const expanded = folds.diff === diff ? folds.expanded : NO_FOLDS;
|
|
94
|
+
const diffRows = (0, external_react_namespaceObject.useMemo)(()=>diff && (0, external_decisionTextDiff_cjs_namespaceObject.diffRowsOf)(rules, diff, nameTokensOf(bands), expanded), [
|
|
95
|
+
rules,
|
|
96
|
+
diff,
|
|
97
|
+
bands,
|
|
98
|
+
expanded
|
|
99
|
+
]);
|
|
66
100
|
const { rows: rowMarks, columns: bandMarks } = (0, external_sentenceMarks_cjs_namespaceObject.tableMarks)(marks);
|
|
67
101
|
const hoverTo = (0, external_useCellHover_cjs_namespaceObject.useCellHover)(onCellHover);
|
|
68
102
|
const shown = (0, external_usePendingCondition_cjs_namespaceObject.usePendingCondition)({
|
|
@@ -70,7 +104,8 @@ const DecisionText = ({ rules, inputs, outputs, header, numbered = false, marks
|
|
|
70
104
|
rules,
|
|
71
105
|
bands
|
|
72
106
|
});
|
|
73
|
-
const
|
|
107
|
+
const listed = diffRows?.rules ?? shown.rules;
|
|
108
|
+
const ruleWindow = (0, external_useRuleWindow_cjs_namespaceObject.useRuleWindow)(listed, selected?.rowId, edit?.editing?.rowId ?? selected?.rowId, scroll);
|
|
74
109
|
const selectable = void 0 !== onSelect;
|
|
75
110
|
const addRuleAction = (0, external_useAddRule_cjs_namespaceObject.useAddRule)({
|
|
76
111
|
...ruleWindow,
|
|
@@ -117,24 +152,33 @@ const DecisionText = ({ rules, inputs, outputs, header, numbered = false, marks
|
|
|
117
152
|
});
|
|
118
153
|
const columnEditorId = `${idPrefix}-column-editor`;
|
|
119
154
|
const listStyle = (0, external_sentenceRuleHeights_cjs_namespaceObject.sentenceListStyle)(numbered, rules.length);
|
|
155
|
+
const onExpandFold = (0, external_react_namespaceObject.useCallback)((firstRowId)=>setFolds((current)=>({
|
|
156
|
+
diff,
|
|
157
|
+
expanded: new Set(current.diff === diff ? current.expanded : NO_FOLDS).add(firstRowId)
|
|
158
|
+
})), [
|
|
159
|
+
diff
|
|
160
|
+
]);
|
|
120
161
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("section", {
|
|
121
162
|
ref: ruleWindow.attachSection,
|
|
122
163
|
"data-testid": dataTestId,
|
|
123
164
|
...sectionProps,
|
|
124
165
|
"aria-label": ariaLabel,
|
|
125
|
-
className: (0, apollo_wind_namespaceObject.cn)(external_sentenceStyles_cjs_namespaceObject.DECISION_TEXT_FRAME_CLASS, sectionProps.className),
|
|
166
|
+
className: (0, apollo_wind_namespaceObject.cn)('self' === scroll ? external_sentenceStyles_cjs_namespaceObject.DECISION_TEXT_FRAME_CLASS : external_sentenceStyles_cjs_namespaceObject.DECISION_TEXT_INLINE_FRAME_CLASS, sectionProps.className),
|
|
126
167
|
children: [
|
|
127
168
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DecisionTextHeader_cjs_namespaceObject.DecisionTextHeader, {
|
|
128
169
|
ref: ruleWindow.headerRef,
|
|
129
170
|
header: header,
|
|
130
|
-
policy: policy,
|
|
171
|
+
policy: diff ? void 0 : policy,
|
|
131
172
|
mark: headerMark,
|
|
173
|
+
hitPolicy: diff?.hitPolicy,
|
|
132
174
|
labels: labels,
|
|
175
|
+
sticky: 'self' === scroll,
|
|
133
176
|
dataTestId: dataTestId
|
|
134
177
|
}),
|
|
135
178
|
bands.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_SentenceBands_cjs_namespaceObject.SentenceBands, {
|
|
136
179
|
bands: bands,
|
|
137
180
|
marks: bandMarks,
|
|
181
|
+
changes: columns?.changes,
|
|
138
182
|
style: listStyle,
|
|
139
183
|
idPrefix: idPrefix,
|
|
140
184
|
dataTestId: dataTestId,
|
|
@@ -143,14 +187,16 @@ const DecisionText = ({ rules, inputs, outputs, header, numbered = false, marks
|
|
|
143
187
|
openColumnId: columnEditing.openId,
|
|
144
188
|
editorId: columnEditorId
|
|
145
189
|
}),
|
|
146
|
-
0 ===
|
|
190
|
+
0 === listed.length ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_EmptyRules_cjs_namespaceObject.EmptyRules, {
|
|
147
191
|
title: labels.emptyRules,
|
|
148
192
|
addRule: addRuleAction,
|
|
149
193
|
dataTestId: dataTestId
|
|
150
194
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_RuleList_cjs_namespaceObject.RuleList, {
|
|
151
195
|
ref: ruleWindow.listRef,
|
|
152
|
-
rules:
|
|
196
|
+
rules: listed,
|
|
153
197
|
pending: shown.pending,
|
|
198
|
+
diffRows: diffRows?.rows,
|
|
199
|
+
onExpandFold: onExpandFold,
|
|
154
200
|
segments: ruleWindow.segments,
|
|
155
201
|
numbered: numbered,
|
|
156
202
|
marks: rowMarks,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { AddRuleButtonProps } from './AddRuleButton';
|
|
3
3
|
import { type DecisionTextHeaderProps } from './DecisionTextHeader';
|
|
4
|
+
import { type DecisionTextDiff } from './decisionTextDiff';
|
|
4
5
|
import type { DecisionTextEdit, DecisionTextLabels } from './decisionTextTypes';
|
|
5
6
|
import { type TableMarks } from './marks';
|
|
6
7
|
import type { SentenceBandColumn, SentenceHeader, SentenceRule, SentenceSelection } from './sentenceTypes';
|
|
7
8
|
import { useCellHover } from './useCellHover';
|
|
8
9
|
import { type ContainerHandlersParams, type DecisionTextContainerProps } from './useContainerHandlers';
|
|
10
|
+
import { type DecisionTextScroll } from './useRuleWindow';
|
|
9
11
|
import { type SentenceNavigationSource } from './useSentenceNavigation';
|
|
10
12
|
interface DecisionTextBaseProps {
|
|
11
13
|
rules: readonly SentenceRule[];
|
|
@@ -20,6 +22,7 @@ interface DecisionTextBaseProps {
|
|
|
20
22
|
headerMark?: DecisionTextHeaderProps['mark'];
|
|
21
23
|
onOpenDecision?: ContainerHandlersParams['onOpenDecision'];
|
|
22
24
|
labels?: Partial<DecisionTextLabels>;
|
|
25
|
+
scroll?: DecisionTextScroll;
|
|
23
26
|
ariaLabel: string;
|
|
24
27
|
containerProps?: DecisionTextContainerProps;
|
|
25
28
|
dataTestId: string;
|
|
@@ -29,13 +32,23 @@ interface ReadOnlyDecisionText {
|
|
|
29
32
|
selected?: SentenceSelection | null;
|
|
30
33
|
onSelect?: undefined;
|
|
31
34
|
edit?: undefined;
|
|
35
|
+
diff?: undefined;
|
|
36
|
+
}
|
|
37
|
+
interface DiffDecisionText {
|
|
38
|
+
diff: DecisionTextDiff;
|
|
39
|
+
selected?: undefined;
|
|
40
|
+
onSelect?: undefined;
|
|
41
|
+
edit?: undefined;
|
|
42
|
+
addRule?: undefined;
|
|
43
|
+
policy?: undefined;
|
|
32
44
|
}
|
|
33
45
|
interface EditableDecisionText {
|
|
34
46
|
selected: SentenceSelection | null;
|
|
35
47
|
onSelect: NonNullable<SentenceNavigationSource['onSelect']>;
|
|
36
48
|
edit?: DecisionTextEdit;
|
|
49
|
+
diff?: undefined;
|
|
37
50
|
}
|
|
38
|
-
export type DecisionTextProps = DecisionTextBaseProps & (ReadOnlyDecisionText | EditableDecisionText);
|
|
51
|
+
export type DecisionTextProps = DecisionTextBaseProps & (ReadOnlyDecisionText | EditableDecisionText | DiffDecisionText);
|
|
39
52
|
export declare const DecisionText: React.FC<DecisionTextProps>;
|
|
40
53
|
export {};
|
|
41
54
|
//# sourceMappingURL=DecisionText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecisionText.d.ts","sourceRoot":"","sources":["../../src/decision-table/DecisionText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAI1D,OAAO,EAAsB,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAIhF,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAMvD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"DecisionText.d.ts","sourceRoot":"","sources":["../../src/decision-table/DecisionText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAI1D,OAAO,EAAsB,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,KAAK,gBAAgB,EAA6B,MAAM,oBAAoB,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAIhF,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAMvD,OAAO,KAAK,EAEV,kBAAkB,EAClB,cAAc,EAEd,YAAY,EACZ,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAEhC,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EAAE,KAAK,kBAAkB,EAAiB,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,KAAK,wBAAwB,EAAyB,MAAM,yBAAyB,CAAC;AAI/F,UAAU,qBAAqB;IAC7B,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IAE/B,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAEtC,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACvC,MAAM,EAAE,cAAc,CAAC;IAEvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAE7B,WAAW,CAAC,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAEjD,MAAM,CAAC,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAE3C,UAAU,CAAC,EAAE,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAE7C,cAAc,CAAC,EAAE,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;IAE3D,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAErC,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;AAGD,UAAU,oBAAoB;IAE5B,QAAQ,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAGD,UAAU,gBAAgB;IAExB,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAGD,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAEnC,QAAQ,EAAE,WAAW,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC,CAAC;IAE5D,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,GACnD,CAAC,oBAAoB,GAAG,oBAAoB,GAAG,gBAAgB,CAAC,CAAC;AAmBnE,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAgMpD,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "@uipath/apollo-wind";
|
|
3
|
-
import { useId, useMemo } from "react";
|
|
3
|
+
import { useCallback, useId, useMemo, useState } from "react";
|
|
4
4
|
import { AddRuleFooter } from "./AddRuleFooter.js";
|
|
5
5
|
import { bandsOf } from "./bandColumns.js";
|
|
6
6
|
import { ColumnEditorOverlay } from "./ColumnEditorOverlay.js";
|
|
7
7
|
import { DecisionTextHeader } from "./DecisionTextHeader.js";
|
|
8
|
+
import { diffColumnsOf, diffRowsOf } from "./decisionTextDiff.js";
|
|
8
9
|
import { EmptyRules } from "./EmptyRules.js";
|
|
9
10
|
import { GridContextMenu } from "./GridMenu.js";
|
|
10
11
|
import { MarkTooltip } from "./MarkTooltip.js";
|
|
@@ -13,7 +14,7 @@ import { RuleList } from "./RuleList.js";
|
|
|
13
14
|
import { SentenceBands } from "./SentenceBands.js";
|
|
14
15
|
import { tableMarks } from "./sentenceMarks.js";
|
|
15
16
|
import { sentenceListStyle } from "./sentenceRuleHeights.js";
|
|
16
|
-
import { DECISION_TEXT_FRAME_CLASS } from "./sentenceStyles.js";
|
|
17
|
+
import { DECISION_TEXT_FRAME_CLASS, DECISION_TEXT_INLINE_FRAME_CLASS } from "./sentenceStyles.js";
|
|
17
18
|
import { useAddRule } from "./useAddRule.js";
|
|
18
19
|
import { useCellHover } from "./useCellHover.js";
|
|
19
20
|
import { useColumnEditing } from "./useColumnEditing.js";
|
|
@@ -26,15 +27,48 @@ import { useRuleWindow } from "./useRuleWindow.js";
|
|
|
26
27
|
import { useSentenceNavigation } from "./useSentenceNavigation.js";
|
|
27
28
|
import { useValueEditing } from "./useValueEditing.js";
|
|
28
29
|
import { ValueEditorOverlay } from "./ValueEditorOverlay.js";
|
|
29
|
-
const
|
|
30
|
+
const NO_FOLDS = new Set();
|
|
31
|
+
const nameTokensOf = (bands)=>{
|
|
32
|
+
const names = new Map(bands.flatMap(({ id, columns })=>columns.map((column)=>[
|
|
33
|
+
column.id,
|
|
34
|
+
{
|
|
35
|
+
kind: 'outputs' === id ? 'output' : 'input',
|
|
36
|
+
columnId: column.id,
|
|
37
|
+
text: column.name
|
|
38
|
+
}
|
|
39
|
+
])));
|
|
40
|
+
return (columnId)=>names.get(columnId) ?? {
|
|
41
|
+
kind: 'input',
|
|
42
|
+
columnId,
|
|
43
|
+
text: columnId
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
const DecisionText = ({ rules, inputs, outputs, header, numbered = false, marks = EMPTY_MARKS, addRule, onCellHover, selected, onSelect, edit: hostEdit, diff, policy, headerMark, onOpenDecision, labels: hostLabels, scroll = 'self', ariaLabel, containerProps, dataTestId, children })=>{
|
|
30
47
|
const idPrefix = useId();
|
|
31
48
|
const labels = useDecisionTextLabels(hostLabels);
|
|
32
49
|
const { edit, refusal } = useEditState(hostEdit, useDecisionTextEditLabels(hostEdit?.labels));
|
|
33
|
-
const
|
|
50
|
+
const columns = useMemo(()=>diff && diffColumnsOf(inputs, outputs, diff), [
|
|
51
|
+
inputs,
|
|
52
|
+
outputs,
|
|
53
|
+
diff
|
|
54
|
+
]);
|
|
55
|
+
const bands = useMemo(()=>bandsOf(columns?.inputs ?? inputs, columns?.outputs ?? outputs, labels), [
|
|
56
|
+
columns,
|
|
34
57
|
inputs,
|
|
35
58
|
outputs,
|
|
36
59
|
labels
|
|
37
60
|
]);
|
|
61
|
+
const [folds, setFolds] = useState({
|
|
62
|
+
diff,
|
|
63
|
+
expanded: NO_FOLDS
|
|
64
|
+
});
|
|
65
|
+
const expanded = folds.diff === diff ? folds.expanded : NO_FOLDS;
|
|
66
|
+
const diffRows = useMemo(()=>diff && diffRowsOf(rules, diff, nameTokensOf(bands), expanded), [
|
|
67
|
+
rules,
|
|
68
|
+
diff,
|
|
69
|
+
bands,
|
|
70
|
+
expanded
|
|
71
|
+
]);
|
|
38
72
|
const { rows: rowMarks, columns: bandMarks } = tableMarks(marks);
|
|
39
73
|
const hoverTo = useCellHover(onCellHover);
|
|
40
74
|
const shown = usePendingCondition({
|
|
@@ -42,7 +76,8 @@ const DecisionText = ({ rules, inputs, outputs, header, numbered = false, marks
|
|
|
42
76
|
rules,
|
|
43
77
|
bands
|
|
44
78
|
});
|
|
45
|
-
const
|
|
79
|
+
const listed = diffRows?.rules ?? shown.rules;
|
|
80
|
+
const ruleWindow = useRuleWindow(listed, selected?.rowId, edit?.editing?.rowId ?? selected?.rowId, scroll);
|
|
46
81
|
const selectable = void 0 !== onSelect;
|
|
47
82
|
const addRuleAction = useAddRule({
|
|
48
83
|
...ruleWindow,
|
|
@@ -89,24 +124,33 @@ const DecisionText = ({ rules, inputs, outputs, header, numbered = false, marks
|
|
|
89
124
|
});
|
|
90
125
|
const columnEditorId = `${idPrefix}-column-editor`;
|
|
91
126
|
const listStyle = sentenceListStyle(numbered, rules.length);
|
|
127
|
+
const onExpandFold = useCallback((firstRowId)=>setFolds((current)=>({
|
|
128
|
+
diff,
|
|
129
|
+
expanded: new Set(current.diff === diff ? current.expanded : NO_FOLDS).add(firstRowId)
|
|
130
|
+
})), [
|
|
131
|
+
diff
|
|
132
|
+
]);
|
|
92
133
|
return /*#__PURE__*/ jsxs("section", {
|
|
93
134
|
ref: ruleWindow.attachSection,
|
|
94
135
|
"data-testid": dataTestId,
|
|
95
136
|
...sectionProps,
|
|
96
137
|
"aria-label": ariaLabel,
|
|
97
|
-
className: cn(DECISION_TEXT_FRAME_CLASS, sectionProps.className),
|
|
138
|
+
className: cn('self' === scroll ? DECISION_TEXT_FRAME_CLASS : DECISION_TEXT_INLINE_FRAME_CLASS, sectionProps.className),
|
|
98
139
|
children: [
|
|
99
140
|
/*#__PURE__*/ jsx(DecisionTextHeader, {
|
|
100
141
|
ref: ruleWindow.headerRef,
|
|
101
142
|
header: header,
|
|
102
|
-
policy: policy,
|
|
143
|
+
policy: diff ? void 0 : policy,
|
|
103
144
|
mark: headerMark,
|
|
145
|
+
hitPolicy: diff?.hitPolicy,
|
|
104
146
|
labels: labels,
|
|
147
|
+
sticky: 'self' === scroll,
|
|
105
148
|
dataTestId: dataTestId
|
|
106
149
|
}),
|
|
107
150
|
bands.length > 0 && /*#__PURE__*/ jsx(SentenceBands, {
|
|
108
151
|
bands: bands,
|
|
109
152
|
marks: bandMarks,
|
|
153
|
+
changes: columns?.changes,
|
|
110
154
|
style: listStyle,
|
|
111
155
|
idPrefix: idPrefix,
|
|
112
156
|
dataTestId: dataTestId,
|
|
@@ -115,14 +159,16 @@ const DecisionText = ({ rules, inputs, outputs, header, numbered = false, marks
|
|
|
115
159
|
openColumnId: columnEditing.openId,
|
|
116
160
|
editorId: columnEditorId
|
|
117
161
|
}),
|
|
118
|
-
0 ===
|
|
162
|
+
0 === listed.length ? /*#__PURE__*/ jsx(EmptyRules, {
|
|
119
163
|
title: labels.emptyRules,
|
|
120
164
|
addRule: addRuleAction,
|
|
121
165
|
dataTestId: dataTestId
|
|
122
166
|
}) : /*#__PURE__*/ jsx(RuleList, {
|
|
123
167
|
ref: ruleWindow.listRef,
|
|
124
|
-
rules:
|
|
168
|
+
rules: listed,
|
|
125
169
|
pending: shown.pending,
|
|
170
|
+
diffRows: diffRows?.rows,
|
|
171
|
+
onExpandFold: onExpandFold,
|
|
126
172
|
segments: ruleWindow.segments,
|
|
127
173
|
numbered: numbered,
|
|
128
174
|
marks: rowMarks,
|