@uipath/apollo-react 8.0.0 → 8.1.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 +8 -2
- package/dist/decision-table/CitationButton.d.ts +13 -2
- package/dist/decision-table/CitationButton.d.ts.map +1 -1
- package/dist/decision-table/CitationButton.js +8 -2
- package/dist/decision-table/DecisionGraphCard.cjs +6 -2
- package/dist/decision-table/DecisionGraphCard.d.ts.map +1 -1
- package/dist/decision-table/DecisionGraphCard.js +6 -2
- package/dist/decision-table/DecisionGraphText.cjs +4 -1
- package/dist/decision-table/DecisionGraphText.d.ts +1 -1
- package/dist/decision-table/DecisionGraphText.d.ts.map +1 -1
- package/dist/decision-table/DecisionGraphText.js +4 -1
- package/dist/decision-table/DecisionText.cjs +22 -2
- package/dist/decision-table/DecisionText.d.ts +2 -2
- package/dist/decision-table/DecisionText.d.ts.map +1 -1
- package/dist/decision-table/DecisionText.js +22 -2
- package/dist/decision-table/DecisionTextHeader.cjs +5 -2
- package/dist/decision-table/DecisionTextHeader.d.ts.map +1 -1
- package/dist/decision-table/DecisionTextHeader.js +5 -2
- package/dist/decision-table/RuleCard.cjs +5 -1
- package/dist/decision-table/RuleCard.d.ts.map +1 -1
- package/dist/decision-table/RuleCard.js +5 -1
- package/dist/decision-table/__fixtures__/textMode.d.ts +2 -3
- package/dist/decision-table/__fixtures__/textMode.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/sentenceStyles.cjs +2 -2
- package/dist/decision-table/sentenceStyles.d.ts +2 -2
- package/dist/decision-table/sentenceStyles.d.ts.map +1 -1
- package/dist/decision-table/sentenceStyles.js +2 -2
- package/dist/decision-table/useContainerHandlers.cjs +77 -2
- package/dist/decision-table/useContainerHandlers.d.ts +10 -1
- package/dist/decision-table/useContainerHandlers.d.ts.map +1 -1
- package/dist/decision-table/useContainerHandlers.js +77 -2
- package/dist/decision-table/useDecisionTextStrings.cjs +26 -4
- package/dist/decision-table/useDecisionTextStrings.d.ts.map +1 -1
- package/dist/decision-table/useDecisionTextStrings.js +26 -4
- package/package.json +3 -3
|
@@ -12,8 +12,62 @@ const clickedCitationOf = (target, view)=>{
|
|
|
12
12
|
return card.contains(button) ? button : card;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
+
const citationButtonsOf = (view, rowId)=>[
|
|
16
|
+
...view.querySelectorAll('li[data-row-id]')
|
|
17
|
+
].filter((card)=>card.dataset.rowId === rowId).flatMap((card)=>[
|
|
18
|
+
...card.querySelectorAll('[data-rule-action="citation"]')
|
|
19
|
+
]);
|
|
20
|
+
const firstStop = (row)=>row && {
|
|
21
|
+
kind: 'citation',
|
|
22
|
+
row,
|
|
23
|
+
button: 0
|
|
24
|
+
};
|
|
25
|
+
const lastStop = (row)=>row && {
|
|
26
|
+
kind: 'citation',
|
|
27
|
+
row,
|
|
28
|
+
button: row.count - 1
|
|
29
|
+
};
|
|
30
|
+
const citationStopOf = (event, citedRows)=>{
|
|
31
|
+
if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) return;
|
|
32
|
+
const view = event.currentTarget;
|
|
33
|
+
if (event.target === view) return 'Enter' === event.key ? firstStop(citedRows[0]) : void 0;
|
|
34
|
+
const target = event.target instanceof HTMLElement ? event.target : null;
|
|
35
|
+
const rowId = target?.closest('li[data-row-id]')?.dataset.rowId;
|
|
36
|
+
const at = citedRows.findIndex((row)=>row.rowId === rowId);
|
|
37
|
+
const row = citedRows[at];
|
|
38
|
+
const button = target && void 0 !== rowId ? citationButtonsOf(view, rowId).indexOf(target) : -1;
|
|
39
|
+
if (!row || button < 0) return;
|
|
40
|
+
if ('ArrowDown' === event.key) return button + 1 < row.count ? {
|
|
41
|
+
kind: 'citation',
|
|
42
|
+
row,
|
|
43
|
+
button: button + 1
|
|
44
|
+
} : firstStop(citedRows[at + 1]);
|
|
45
|
+
if ('ArrowUp' === event.key) return button > 0 ? {
|
|
46
|
+
kind: 'citation',
|
|
47
|
+
row,
|
|
48
|
+
button: button - 1
|
|
49
|
+
} : lastStop(citedRows[at - 1]);
|
|
50
|
+
if ('Home' === event.key) return firstStop(citedRows[0]);
|
|
51
|
+
if ('End' === event.key) return lastStop(citedRows[citedRows.length - 1]);
|
|
52
|
+
return 'Escape' === event.key ? {
|
|
53
|
+
kind: 'view'
|
|
54
|
+
} : void 0;
|
|
55
|
+
};
|
|
15
56
|
const isTabOnView = (event)=>'Tab' === event.key && !event.shiftKey && event.target === event.currentTarget;
|
|
16
|
-
const useContainerHandlers = ({ containerProps, hoverTo, navigation, valueEditing, ruleMenus, onOpenDecision, container, stopTabbable, focusRow, history })=>{
|
|
57
|
+
const useContainerHandlers = ({ containerProps, hoverTo, navigation, valueEditing, ruleMenus, onOpenDecision, container, stopTabbable, focusRow, history, citationKeys, citedRows, revealRow, revealStop })=>{
|
|
58
|
+
const pendingCitationRef = useRef(null);
|
|
59
|
+
const focusPendingCitation = ()=>{
|
|
60
|
+
const pending = pendingCitationRef.current;
|
|
61
|
+
const view = container();
|
|
62
|
+
const button = pending && view ? citationButtonsOf(view, pending.row.rowId)[pending.button] : void 0;
|
|
63
|
+
if (!pending || !button) return false;
|
|
64
|
+
pendingCitationRef.current = null;
|
|
65
|
+
button.focus({
|
|
66
|
+
preventScroll: true
|
|
67
|
+
});
|
|
68
|
+
revealStop(pending.row.index, button);
|
|
69
|
+
return true;
|
|
70
|
+
};
|
|
17
71
|
const focusWithinRef = useRef(false);
|
|
18
72
|
const pressedRef = useRef(false);
|
|
19
73
|
const stopPressRef = useRef(null);
|
|
@@ -23,6 +77,9 @@ const useContainerHandlers = ({ containerProps, hoverTo, navigation, valueEditin
|
|
|
23
77
|
if (focusWithinRef.current && view && hasLostFocus(view)) view.focus();
|
|
24
78
|
});
|
|
25
79
|
useEffect(()=>()=>stopPressRef.current?.(), []);
|
|
80
|
+
useEffect(()=>{
|
|
81
|
+
focusPendingCitation();
|
|
82
|
+
});
|
|
26
83
|
const endPress = ()=>{
|
|
27
84
|
stopPressRef.current?.();
|
|
28
85
|
stopPressRef.current = null;
|
|
@@ -66,11 +123,28 @@ const useContainerHandlers = ({ containerProps, hoverTo, navigation, valueEditin
|
|
|
66
123
|
step();
|
|
67
124
|
return true;
|
|
68
125
|
};
|
|
126
|
+
const moveAmongCitations = (event)=>{
|
|
127
|
+
const stop = citationKeys && !event.defaultPrevented ? citationStopOf(event, citedRows) : void 0;
|
|
128
|
+
if (!stop) return false;
|
|
129
|
+
event.preventDefault();
|
|
130
|
+
const view = event.currentTarget;
|
|
131
|
+
if ('view' === stop.kind) {
|
|
132
|
+
view.focus();
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
pendingCitationRef.current = {
|
|
136
|
+
row: stop.row,
|
|
137
|
+
button: stop.button
|
|
138
|
+
};
|
|
139
|
+
focusRow(stop.row.rowId);
|
|
140
|
+
if (!focusPendingCitation()) revealRow(stop.row.index);
|
|
141
|
+
return true;
|
|
142
|
+
};
|
|
69
143
|
const onKeyDown = (event)=>{
|
|
70
144
|
if (stopTabbable && isTabOnView(event)) {
|
|
71
145
|
event.preventDefault();
|
|
72
146
|
navigation.refocus();
|
|
73
|
-
} else if (openStopDecision(event) || valueEditing.onKeyDown(event) || navigation.onKeyDown(event) || stepHistory(event)) return;
|
|
147
|
+
} else if (!moveAmongCitations(event) && (openStopDecision(event) || valueEditing.onKeyDown(event) || navigation.onKeyDown(event) || stepHistory(event))) return;
|
|
74
148
|
consumerKeyDown?.(event);
|
|
75
149
|
};
|
|
76
150
|
const onFocus = (event)=>{
|
|
@@ -84,6 +158,7 @@ const useContainerHandlers = ({ containerProps, hoverTo, navigation, valueEditin
|
|
|
84
158
|
const onBlur = (event)=>{
|
|
85
159
|
if (!(event.relatedTarget instanceof Node) || !event.currentTarget.contains(event.relatedTarget)) {
|
|
86
160
|
focusWithinRef.current = false;
|
|
161
|
+
pendingCitationRef.current = null;
|
|
87
162
|
endPress();
|
|
88
163
|
setFocusInside(false);
|
|
89
164
|
focusRow(void 0);
|
|
@@ -134,13 +134,35 @@ const useDecisionTextLabels = ()=>{
|
|
|
134
134
|
input
|
|
135
135
|
}
|
|
136
136
|
}),
|
|
137
|
-
openCitation: (page)=>
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
openCitation: (owner, page, index)=>{
|
|
138
|
+
const numbered = index ?? 0;
|
|
139
|
+
if ('rule' === owner.kind) return _({
|
|
140
|
+
id: 'decision-text.open_rule_citation',
|
|
141
|
+
message: 'Open source{index, plural, =0 {} other { #}} of rule {position}, page {page}',
|
|
140
142
|
values: {
|
|
143
|
+
index: numbered,
|
|
144
|
+
position: owner.position,
|
|
141
145
|
page
|
|
142
146
|
}
|
|
143
|
-
})
|
|
147
|
+
});
|
|
148
|
+
if ('decision' === owner.kind) return _({
|
|
149
|
+
id: 'decision-text.open_decision_citation',
|
|
150
|
+
message: 'Open source{index, plural, =0 {} other { #}} of {decision}, page {page}',
|
|
151
|
+
values: {
|
|
152
|
+
index: numbered,
|
|
153
|
+
decision: owner.name,
|
|
154
|
+
page
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
return _({
|
|
158
|
+
id: 'decision-text.open_table_citation',
|
|
159
|
+
message: 'Open source{index, plural, =0 {} other { #}} of this decision, page {page}',
|
|
160
|
+
values: {
|
|
161
|
+
index: numbered,
|
|
162
|
+
page
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
},
|
|
144
166
|
citationPage: (page)=>_({
|
|
145
167
|
id: 'decision-text.citation_page',
|
|
146
168
|
message: 'Page {page}',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDecisionTextStrings.d.ts","sourceRoot":"","sources":["../../src/decision-table/useDecisionTextStrings.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAItF,eAAO,MAAM,qBAAqB,QAAO,
|
|
1
|
+
{"version":3,"file":"useDecisionTextStrings.d.ts","sourceRoot":"","sources":["../../src/decision-table/useDecisionTextStrings.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAItF,eAAO,MAAM,qBAAqB,QAAO,kBA0GxC,CAAC;AAGF,eAAO,MAAM,yBAAyB,QAAO,sBA8F5C,CAAC"}
|
|
@@ -105,13 +105,35 @@ const useDecisionTextLabels = ()=>{
|
|
|
105
105
|
input
|
|
106
106
|
}
|
|
107
107
|
}),
|
|
108
|
-
openCitation: (page)=>
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
openCitation: (owner, page, index)=>{
|
|
109
|
+
const numbered = index ?? 0;
|
|
110
|
+
if ('rule' === owner.kind) return _({
|
|
111
|
+
id: 'decision-text.open_rule_citation',
|
|
112
|
+
message: 'Open source{index, plural, =0 {} other { #}} of rule {position}, page {page}',
|
|
111
113
|
values: {
|
|
114
|
+
index: numbered,
|
|
115
|
+
position: owner.position,
|
|
112
116
|
page
|
|
113
117
|
}
|
|
114
|
-
})
|
|
118
|
+
});
|
|
119
|
+
if ('decision' === owner.kind) return _({
|
|
120
|
+
id: 'decision-text.open_decision_citation',
|
|
121
|
+
message: 'Open source{index, plural, =0 {} other { #}} of {decision}, page {page}',
|
|
122
|
+
values: {
|
|
123
|
+
index: numbered,
|
|
124
|
+
decision: owner.name,
|
|
125
|
+
page
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
return _({
|
|
129
|
+
id: 'decision-text.open_table_citation',
|
|
130
|
+
message: 'Open source{index, plural, =0 {} other { #}} of this decision, page {page}',
|
|
131
|
+
values: {
|
|
132
|
+
index: numbered,
|
|
133
|
+
page
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
},
|
|
115
137
|
citationPage: (page)=>_({
|
|
116
138
|
id: 'decision-text.citation_page',
|
|
117
139
|
message: 'Page {page}',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/apollo-react",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"description": "Apollo Design System - React component library with Material UI theming",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -253,8 +253,8 @@
|
|
|
253
253
|
"zustand": "^5.0.9",
|
|
254
254
|
"@uipath/apollo-core": "5.15.3",
|
|
255
255
|
"@uipath/apollo-ui-icons": "1.2.1",
|
|
256
|
-
"@uipath/apollo-
|
|
257
|
-
"@uipath/apollo-
|
|
256
|
+
"@uipath/apollo-wind": "2.95.1",
|
|
257
|
+
"@uipath/apollo-ui-icons-react": "1.1.0"
|
|
258
258
|
},
|
|
259
259
|
"devDependencies": {
|
|
260
260
|
"@lingui/cli": "^5.6.1",
|