@uipath/apollo-react 7.18.0 → 7.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/chat/headless/hooks/use-chat-messages.cjs +8 -0
- package/dist/chat/headless/hooks/use-chat-messages.d.ts.map +1 -1
- package/dist/chat/headless/hooks/use-chat-messages.js +8 -0
- package/dist/chat/styles/tailwind.chat.css +1 -1
- package/dist/decision-table/CellTextEditor.cjs +78 -0
- package/dist/decision-table/CellTextEditor.d.ts +8 -0
- package/dist/decision-table/CellTextEditor.d.ts.map +1 -0
- package/dist/decision-table/CellTextEditor.js +44 -0
- package/dist/decision-table/ConditionLine.cjs +5 -1
- package/dist/decision-table/ConditionLine.d.ts +3 -1
- package/dist/decision-table/ConditionLine.d.ts.map +1 -1
- package/dist/decision-table/ConditionLine.js +5 -1
- package/dist/decision-table/DecisionText.cjs +49 -3
- package/dist/decision-table/DecisionText.d.ts +20 -4
- package/dist/decision-table/DecisionText.d.ts.map +1 -1
- package/dist/decision-table/DecisionText.js +49 -3
- package/dist/decision-table/DecisionTextHeader.cjs +23 -3
- package/dist/decision-table/DecisionTextHeader.d.ts +6 -0
- package/dist/decision-table/DecisionTextHeader.d.ts.map +1 -1
- package/dist/decision-table/DecisionTextHeader.js +24 -4
- package/dist/decision-table/GridCell.cjs +11 -31
- package/dist/decision-table/GridCell.d.ts +1 -9
- package/dist/decision-table/GridCell.d.ts.map +1 -1
- package/dist/decision-table/GridCell.js +12 -32
- package/dist/decision-table/LineText.cjs +4 -3
- package/dist/decision-table/LineText.d.ts +2 -1
- package/dist/decision-table/LineText.d.ts.map +1 -1
- package/dist/decision-table/LineText.js +4 -3
- package/dist/decision-table/PolicyOptionItem.cjs +121 -0
- package/dist/decision-table/PolicyOptionItem.d.ts +16 -0
- package/dist/decision-table/PolicyOptionItem.d.ts.map +1 -0
- package/dist/decision-table/PolicyOptionItem.js +84 -0
- package/dist/decision-table/PolicyPicker.cjs +110 -0
- package/dist/decision-table/PolicyPicker.d.ts +17 -0
- package/dist/decision-table/PolicyPicker.d.ts.map +1 -0
- package/dist/decision-table/PolicyPicker.js +76 -0
- package/dist/decision-table/RemoveConditionButton.cjs +52 -0
- package/dist/decision-table/RemoveConditionButton.d.ts +7 -0
- package/dist/decision-table/RemoveConditionButton.d.ts.map +1 -0
- package/dist/decision-table/RemoveConditionButton.js +18 -0
- package/dist/decision-table/RuleActions.cjs +76 -0
- package/dist/decision-table/RuleActions.d.ts +15 -0
- package/dist/decision-table/RuleActions.d.ts.map +1 -0
- package/dist/decision-table/RuleActions.js +42 -0
- package/dist/decision-table/RuleCard.cjs +17 -3
- package/dist/decision-table/RuleCard.d.ts +7 -1
- package/dist/decision-table/RuleCard.d.ts.map +1 -1
- package/dist/decision-table/RuleCard.js +18 -4
- package/dist/decision-table/RuleLine.cjs +7 -2
- package/dist/decision-table/RuleLine.d.ts +4 -1
- package/dist/decision-table/RuleLine.d.ts.map +1 -1
- package/dist/decision-table/RuleLine.js +7 -2
- package/dist/decision-table/RuleList.cjs +4 -1
- package/dist/decision-table/RuleList.d.ts +8 -0
- package/dist/decision-table/RuleList.d.ts.map +1 -1
- package/dist/decision-table/RuleList.js +4 -1
- package/dist/decision-table/TokenChip.cjs +23 -3
- package/dist/decision-table/TokenChip.d.ts +7 -0
- package/dist/decision-table/TokenChip.d.ts.map +1 -1
- package/dist/decision-table/TokenChip.js +24 -4
- package/dist/decision-table/ValueEditorOverlay.cjs +71 -0
- package/dist/decision-table/ValueEditorOverlay.d.ts +11 -0
- package/dist/decision-table/ValueEditorOverlay.d.ts.map +1 -0
- package/dist/decision-table/ValueEditorOverlay.js +37 -0
- package/dist/decision-table/__fixtures__/editableSentences.fixtures.d.ts +37 -0
- package/dist/decision-table/__fixtures__/editableSentences.fixtures.d.ts.map +1 -0
- package/dist/decision-table/__fixtures__/sentences.fixtures.d.ts +19 -6
- package/dist/decision-table/__fixtures__/sentences.fixtures.d.ts.map +1 -1
- package/dist/decision-table/decisionTextTypes.cjs +18 -0
- package/dist/decision-table/decisionTextTypes.d.ts +21 -0
- package/dist/decision-table/decisionTextTypes.d.ts.map +1 -0
- package/dist/decision-table/decisionTextTypes.js +0 -0
- package/dist/decision-table/gridEvents.cjs +22 -2
- package/dist/decision-table/gridEvents.d.ts +1 -0
- package/dist/decision-table/gridEvents.d.ts.map +1 -1
- package/dist/decision-table/gridEvents.js +18 -1
- package/dist/decision-table/gridTypes.d.ts +8 -0
- package/dist/decision-table/gridTypes.d.ts.map +1 -1
- package/dist/decision-table/index.d.ts +7 -2
- package/dist/decision-table/index.d.ts.map +1 -1
- package/dist/decision-table/ruleCardModel.cjs +37 -4
- package/dist/decision-table/ruleCardModel.d.ts +18 -4
- package/dist/decision-table/ruleCardModel.d.ts.map +1 -1
- package/dist/decision-table/ruleCardModel.js +36 -6
- package/dist/decision-table/sentenceParts.cjs +38 -5
- package/dist/decision-table/sentenceParts.d.ts +6 -1
- package/dist/decision-table/sentenceParts.d.ts.map +1 -1
- package/dist/decision-table/sentenceParts.js +19 -1
- package/dist/decision-table/sentenceStyles.cjs +77 -4
- package/dist/decision-table/sentenceStyles.d.ts +18 -0
- package/dist/decision-table/sentenceStyles.d.ts.map +1 -1
- package/dist/decision-table/sentenceStyles.js +20 -1
- package/dist/decision-table/sentenceTargets.cjs +88 -4
- package/dist/decision-table/sentenceTargets.d.ts +24 -1
- package/dist/decision-table/sentenceTargets.d.ts.map +1 -1
- package/dist/decision-table/sentenceTargets.js +68 -5
- package/dist/decision-table/sentenceTypes.d.ts +13 -2
- 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 +42 -8
- package/dist/decision-table/useContainerHandlers.d.ts +10 -5
- package/dist/decision-table/useContainerHandlers.d.ts.map +1 -1
- package/dist/decision-table/useContainerHandlers.js +44 -10
- package/dist/decision-table/useEditorPlacement.cjs +104 -0
- package/dist/decision-table/useEditorPlacement.d.ts +17 -0
- package/dist/decision-table/useEditorPlacement.d.ts.map +1 -0
- package/dist/decision-table/useEditorPlacement.js +70 -0
- package/dist/decision-table/useRuleMenus.cjs +149 -0
- package/dist/decision-table/useRuleMenus.d.ts +24 -0
- package/dist/decision-table/useRuleMenus.d.ts.map +1 -0
- package/dist/decision-table/useRuleMenus.js +115 -0
- package/dist/decision-table/useRuleWindow.cjs +6 -2
- package/dist/decision-table/useRuleWindow.d.ts +1 -1
- package/dist/decision-table/useRuleWindow.d.ts.map +1 -1
- package/dist/decision-table/useRuleWindow.js +6 -2
- package/dist/decision-table/useSentenceNavigation.cjs +41 -9
- package/dist/decision-table/useSentenceNavigation.d.ts +7 -2
- package/dist/decision-table/useSentenceNavigation.d.ts.map +1 -1
- package/dist/decision-table/useSentenceNavigation.js +39 -10
- package/dist/decision-table/useValueEditing.cjs +306 -0
- package/dist/decision-table/useValueEditing.d.ts +34 -0
- package/dist/decision-table/useValueEditing.d.ts.map +1 -0
- package/dist/decision-table/useValueEditing.js +272 -0
- package/dist/decision-table/valueTypes.cjs +18 -0
- package/dist/decision-table/valueTypes.d.ts +6 -0
- package/dist/decision-table/valueTypes.d.ts.map +1 -0
- package/dist/decision-table/valueTypes.js +0 -0
- package/package.json +3 -3
|
@@ -0,0 +1,306 @@
|
|
|
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
|
+
useValueEditing: ()=>useValueEditing
|
|
28
|
+
});
|
|
29
|
+
const external_react_namespaceObject = require("react");
|
|
30
|
+
const external_gridEvents_cjs_namespaceObject = require("./gridEvents.cjs");
|
|
31
|
+
const external_ruleCardModel_cjs_namespaceObject = require("./ruleCardModel.cjs");
|
|
32
|
+
const external_sentenceParts_cjs_namespaceObject = require("./sentenceParts.cjs");
|
|
33
|
+
const external_sentenceTargets_cjs_namespaceObject = require("./sentenceTargets.cjs");
|
|
34
|
+
const external_useSentenceNavigation_cjs_namespaceObject = require("./useSentenceNavigation.cjs");
|
|
35
|
+
const isStartKey = (event)=>'Enter' === event.key || 'F2' === event.key || ' ' === event.key && void 0 === (0, external_sentenceTargets_cjs_namespaceObject.clickedDecision)(event.target);
|
|
36
|
+
const isClearKey = (event)=>'Delete' === event.key || 'Backspace' === event.key;
|
|
37
|
+
const valueKey = ({ rowId, columnId, index })=>JSON.stringify([
|
|
38
|
+
rowId,
|
|
39
|
+
columnId,
|
|
40
|
+
index
|
|
41
|
+
]);
|
|
42
|
+
const pressTargetOf = (target)=>{
|
|
43
|
+
const decisionId = (0, external_sentenceTargets_cjs_namespaceObject.clickedDecision)(target);
|
|
44
|
+
if (void 0 !== decisionId) return {
|
|
45
|
+
kind: 'decision',
|
|
46
|
+
decisionId
|
|
47
|
+
};
|
|
48
|
+
const action = (0, external_sentenceTargets_cjs_namespaceObject.clickedAction)(target);
|
|
49
|
+
if (action) return {
|
|
50
|
+
kind: 'action',
|
|
51
|
+
action
|
|
52
|
+
};
|
|
53
|
+
const value = (0, external_sentenceTargets_cjs_namespaceObject.clickedValue)(target);
|
|
54
|
+
if (value) return {
|
|
55
|
+
kind: 'value',
|
|
56
|
+
value
|
|
57
|
+
};
|
|
58
|
+
return (0, external_sentenceTargets_cjs_namespaceObject.clickedAddRule)(target) ? {
|
|
59
|
+
kind: 'addRule'
|
|
60
|
+
} : null;
|
|
61
|
+
};
|
|
62
|
+
const movedAway = ({ element, at })=>{
|
|
63
|
+
if (!element.isConnected) return true;
|
|
64
|
+
const { x, y, width, height } = element.getBoundingClientRect();
|
|
65
|
+
return x !== at.x || y !== at.y || width !== at.width || height !== at.height;
|
|
66
|
+
};
|
|
67
|
+
const textIn = (rules, cell)=>{
|
|
68
|
+
const rule = rules.find((candidate)=>candidate.rowId === cell.rowId);
|
|
69
|
+
return rule && (void 0 === cell.columnId ? '' : (0, external_sentenceParts_cjs_namespaceObject.cellTextOf)(rule, cell.columnId));
|
|
70
|
+
};
|
|
71
|
+
const rowIdOf = (element)=>element instanceof HTMLElement ? element.closest('li[data-row-id]')?.dataset.rowId : void 0;
|
|
72
|
+
const useValueEditing = ({ edit, rules, bands, selected, onSelect, navigation, labels, container, openMenu, onOpenDecision, addRule })=>{
|
|
73
|
+
const pendingRef = (0, external_react_namespaceObject.useRef)(null);
|
|
74
|
+
const stopAwaitingRef = (0, external_react_namespaceObject.useRef)(null);
|
|
75
|
+
const pressedRef = (0, external_react_namespaceObject.useRef)(null);
|
|
76
|
+
const recoveredRef = (0, external_react_namespaceObject.useRef)(false);
|
|
77
|
+
const refocusRef = (0, external_react_namespaceObject.useRef)(null);
|
|
78
|
+
const goneRef = (0, external_react_namespaceObject.useRef)(null);
|
|
79
|
+
const target = edit?.editing ?? null;
|
|
80
|
+
const openedRef = (0, external_react_namespaceObject.useRef)(target ? valueKey(target) : void 0);
|
|
81
|
+
const row = target ? rules.findIndex((rule)=>rule.rowId === target.rowId) : -1;
|
|
82
|
+
const rule = rules[row];
|
|
83
|
+
const awaitHost = (pending)=>{
|
|
84
|
+
stopAwaitingRef.current?.();
|
|
85
|
+
const view = container();
|
|
86
|
+
pendingRef.current = pending && {
|
|
87
|
+
...pending,
|
|
88
|
+
focused: view && (0, external_gridEvents_cjs_namespaceObject.activeElementOf)(view)
|
|
89
|
+
};
|
|
90
|
+
stopAwaitingRef.current = pending && view ? (0, external_gridEvents_cjs_namespaceObject.onNextGesture)(view, ()=>awaitHost(null)) : null;
|
|
91
|
+
};
|
|
92
|
+
(0, external_react_namespaceObject.useEffect)(()=>()=>stopAwaitingRef.current?.(), []);
|
|
93
|
+
const start = (value)=>{
|
|
94
|
+
if (!edit) return;
|
|
95
|
+
awaitHost(null);
|
|
96
|
+
if (selected?.rowId !== value.rowId || selected?.columnId !== value.columnId) navigation.select({
|
|
97
|
+
rowId: value.rowId,
|
|
98
|
+
columnId: value.columnId
|
|
99
|
+
}, ()=>null, false);
|
|
100
|
+
edit.onStartEdit(value);
|
|
101
|
+
};
|
|
102
|
+
const editorOf = ()=>{
|
|
103
|
+
if (!edit || !target || !rule) return null;
|
|
104
|
+
const token = (0, external_sentenceParts_cjs_namespaceObject.valueTokenOf)(rule, target);
|
|
105
|
+
const column = (0, external_sentenceParts_cjs_namespaceObject.columnNameOf)(rule, target.columnId) || (0, external_sentenceParts_cjs_namespaceObject.bandColumnNameOf)(bands, target.columnId);
|
|
106
|
+
return {
|
|
107
|
+
target,
|
|
108
|
+
value: token?.text ?? '',
|
|
109
|
+
ariaLabel: (0, external_sentenceParts_cjs_namespaceObject.hasStop)(rule, target.columnId) ? (0, external_ruleCardModel_cjs_namespaceObject.cellName)(labels, column, token ? (0, external_sentenceParts_cjs_namespaceObject.tokenText)(token, labels.emptyValue) : '', row + 1) : edit.labels.newCondition(column, row + 1),
|
|
110
|
+
onCommit: (text, move)=>{
|
|
111
|
+
awaitHost({
|
|
112
|
+
from: target,
|
|
113
|
+
move,
|
|
114
|
+
rules
|
|
115
|
+
});
|
|
116
|
+
edit.onCommit(target, text, move);
|
|
117
|
+
},
|
|
118
|
+
onCancel: ()=>{
|
|
119
|
+
awaitHost({
|
|
120
|
+
from: target,
|
|
121
|
+
move: 'cancel',
|
|
122
|
+
rules
|
|
123
|
+
});
|
|
124
|
+
edit.onCancel();
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
const resolve = ({ from, move, rules: before })=>{
|
|
129
|
+
const cell = {
|
|
130
|
+
rowId: from.rowId,
|
|
131
|
+
columnId: from.columnId
|
|
132
|
+
};
|
|
133
|
+
const rowRule = rules.find((candidate)=>candidate.rowId === from.rowId);
|
|
134
|
+
if ('cancel' === move) {
|
|
135
|
+
if ((0, external_sentenceParts_cjs_namespaceObject.hasStop)(rowRule, cell.columnId)) navigation.select(cell);
|
|
136
|
+
else navigation.select({
|
|
137
|
+
rowId: from.rowId
|
|
138
|
+
}, external_sentenceTargets_cjs_namespaceObject.addConditionOf);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const sibling = {
|
|
142
|
+
...from,
|
|
143
|
+
index: from.index + ('left' === move ? -1 : 1)
|
|
144
|
+
};
|
|
145
|
+
if (('left' === move || 'right' === move) && rowRule && (0, external_sentenceParts_cjs_namespaceObject.valueTokenOf)(rowRule, sibling)) return void start(sibling);
|
|
146
|
+
navigation.selectAfter(cell, move, before);
|
|
147
|
+
};
|
|
148
|
+
(0, external_react_namespaceObject.useLayoutEffect)(()=>{
|
|
149
|
+
const opened = target ? valueKey(target) : void 0;
|
|
150
|
+
if (opened === openedRef.current) return;
|
|
151
|
+
openedRef.current = opened;
|
|
152
|
+
if (target && (selected?.rowId !== target.rowId || selected?.columnId !== target.columnId)) onSelect?.({
|
|
153
|
+
rowId: target.rowId,
|
|
154
|
+
columnId: target.columnId
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
(0, external_react_namespaceObject.useLayoutEffect)(()=>{
|
|
158
|
+
const gone = target && !rule ? valueKey(target) : null;
|
|
159
|
+
if (null !== gone && gone !== goneRef.current) edit?.onCancel();
|
|
160
|
+
goneRef.current = gone;
|
|
161
|
+
});
|
|
162
|
+
const staysOn = (rowId)=>{
|
|
163
|
+
const view = container();
|
|
164
|
+
const focused = view && (0, external_gridEvents_cjs_namespaceObject.activeElementOf)(view);
|
|
165
|
+
return null !== view && ((0, external_gridEvents_cjs_namespaceObject.hasLostFocus)(view) || focused === view || rowIdOf(focused) === rowId);
|
|
166
|
+
};
|
|
167
|
+
(0, external_react_namespaceObject.useLayoutEffect)(()=>{
|
|
168
|
+
const refocus = refocusRef.current;
|
|
169
|
+
if (null === refocus) return;
|
|
170
|
+
const stayed = staysOn(refocus.cell.rowId);
|
|
171
|
+
if (stayed && textIn(rules, refocus.cell) === refocus.text) return;
|
|
172
|
+
refocusRef.current = null;
|
|
173
|
+
if (stayed) navigation.refocus(refocus.scroll);
|
|
174
|
+
});
|
|
175
|
+
(0, external_react_namespaceObject.useLayoutEffect)(()=>{
|
|
176
|
+
const pending = pendingRef.current;
|
|
177
|
+
if (!pending || target && valueKey(target) === valueKey(pending.from)) return;
|
|
178
|
+
awaitHost(null);
|
|
179
|
+
if (!target && (0, external_gridEvents_cjs_namespaceObject.focusStays)(container(), pending.focused)) resolve(pending);
|
|
180
|
+
});
|
|
181
|
+
const cancelEditOf = (cell)=>{
|
|
182
|
+
if (target?.rowId !== cell.rowId || cell.columnId && target.columnId !== cell.columnId) return;
|
|
183
|
+
awaitHost(null);
|
|
184
|
+
edit?.onCancel();
|
|
185
|
+
};
|
|
186
|
+
const clear = (cell, refocusNow, scroll)=>{
|
|
187
|
+
refocusRef.current = {
|
|
188
|
+
cell,
|
|
189
|
+
text: textIn(rules, cell),
|
|
190
|
+
scroll
|
|
191
|
+
};
|
|
192
|
+
edit?.onClearCell(cell);
|
|
193
|
+
cancelEditOf(cell);
|
|
194
|
+
if (refocusNow && staysOn(cell.rowId)) navigation.refocus(scroll);
|
|
195
|
+
};
|
|
196
|
+
const onKeyDown = (event)=>{
|
|
197
|
+
refocusRef.current = null;
|
|
198
|
+
const columnId = navigation.selectedColumnId;
|
|
199
|
+
const rowId = selected?.rowId;
|
|
200
|
+
if (!edit || !(isStartKey(event) || isClearKey(event)) || (0, external_useSentenceNavigation_cjs_namespaceObject.isIgnoredKey)(event)) return false;
|
|
201
|
+
if (null === columnId || void 0 === rowId) return false;
|
|
202
|
+
event.preventDefault();
|
|
203
|
+
if (isClearKey(event)) clear({
|
|
204
|
+
rowId,
|
|
205
|
+
columnId
|
|
206
|
+
}, true, true);
|
|
207
|
+
else start({
|
|
208
|
+
rowId,
|
|
209
|
+
columnId,
|
|
210
|
+
index: 0
|
|
211
|
+
});
|
|
212
|
+
return true;
|
|
213
|
+
};
|
|
214
|
+
const onAction = (action)=>{
|
|
215
|
+
if ('clear' === action.action) {
|
|
216
|
+
clear(action.cell, selected?.rowId === action.cell.rowId, false);
|
|
217
|
+
if (selected?.rowId !== action.cell.rowId) navigation.select({
|
|
218
|
+
rowId: action.cell.rowId
|
|
219
|
+
}, void 0, false);
|
|
220
|
+
return true;
|
|
221
|
+
}
|
|
222
|
+
if ('delete' !== action.action) return false;
|
|
223
|
+
refocusRef.current = {
|
|
224
|
+
cell: {
|
|
225
|
+
rowId: action.rowId
|
|
226
|
+
},
|
|
227
|
+
text: textIn(rules, {
|
|
228
|
+
rowId: action.rowId
|
|
229
|
+
}),
|
|
230
|
+
scroll: true
|
|
231
|
+
};
|
|
232
|
+
edit?.onDeleteRule(action.rowId);
|
|
233
|
+
cancelEditOf({
|
|
234
|
+
rowId: action.rowId
|
|
235
|
+
});
|
|
236
|
+
if (selected?.rowId === action.rowId && staysOn(action.rowId)) navigation.refocus();
|
|
237
|
+
return true;
|
|
238
|
+
};
|
|
239
|
+
const recover = ({ target })=>{
|
|
240
|
+
switch(target.kind){
|
|
241
|
+
case 'decision':
|
|
242
|
+
onOpenDecision?.(target.decisionId);
|
|
243
|
+
return void 0 !== onOpenDecision;
|
|
244
|
+
case 'action':
|
|
245
|
+
return onAction(target.action) || openMenu(target.action);
|
|
246
|
+
case 'value':
|
|
247
|
+
start(target.value);
|
|
248
|
+
return true;
|
|
249
|
+
case 'addRule':
|
|
250
|
+
addRule?.onAdd();
|
|
251
|
+
return void 0 !== addRule;
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
const ranOwnClick = ({ target }, clicked)=>'addRule' === target.kind && (0, external_sentenceTargets_cjs_namespaceObject.clickedAddRule)(clicked);
|
|
255
|
+
const forgetPress = ()=>{
|
|
256
|
+
pressedRef.current = null;
|
|
257
|
+
recoveredRef.current = false;
|
|
258
|
+
};
|
|
259
|
+
const takeRecoveredClick = (event)=>{
|
|
260
|
+
const pressed = pressedRef.current;
|
|
261
|
+
const recovered = recoveredRef.current;
|
|
262
|
+
forgetPress();
|
|
263
|
+
return event.detail > 0 && (recovered || null !== pressed && movedAway(pressed) && !ranOwnClick(pressed, event.target) && recover(pressed));
|
|
264
|
+
};
|
|
265
|
+
const onClick = (event)=>{
|
|
266
|
+
const action = edit ? (0, external_sentenceTargets_cjs_namespaceObject.clickedAction)(event.target) : null;
|
|
267
|
+
if (action) return onAction(action);
|
|
268
|
+
const value = edit ? (0, external_sentenceTargets_cjs_namespaceObject.clickedValue)(event.target) : null;
|
|
269
|
+
if (!value) return false;
|
|
270
|
+
start(value);
|
|
271
|
+
return true;
|
|
272
|
+
};
|
|
273
|
+
const onPointerDown = (event)=>{
|
|
274
|
+
recoveredRef.current = false;
|
|
275
|
+
refocusRef.current = null;
|
|
276
|
+
const target = edit && 0 === event.button ? pressTargetOf(event.target) : null;
|
|
277
|
+
pressedRef.current = target && event.target instanceof Element ? {
|
|
278
|
+
target,
|
|
279
|
+
element: event.target,
|
|
280
|
+
at: event.target.getBoundingClientRect()
|
|
281
|
+
} : null;
|
|
282
|
+
};
|
|
283
|
+
const onRelease = ()=>{
|
|
284
|
+
const pressed = pressedRef.current;
|
|
285
|
+
if (!pressed || pressed.element.isConnected) return;
|
|
286
|
+
pressedRef.current = null;
|
|
287
|
+
recoveredRef.current = recover(pressed);
|
|
288
|
+
};
|
|
289
|
+
return {
|
|
290
|
+
editor: editorOf(),
|
|
291
|
+
editorKey: target ? valueKey(target) : void 0,
|
|
292
|
+
onKeyDown,
|
|
293
|
+
onClick,
|
|
294
|
+
takeRecoveredClick,
|
|
295
|
+
onPointerDown,
|
|
296
|
+
onRelease,
|
|
297
|
+
forgetPress
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
exports.useValueEditing = __webpack_exports__.useValueEditing;
|
|
301
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
302
|
+
"useValueEditing"
|
|
303
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
304
|
+
Object.defineProperty(exports, '__esModule', {
|
|
305
|
+
value: true
|
|
306
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { AddRuleButtonProps } from './AddRuleButton';
|
|
3
|
+
import type { DecisionTextEdit } from './decisionTextTypes';
|
|
4
|
+
import { type RuleCardLabels } from './ruleCardModel';
|
|
5
|
+
import type { SentenceBand, SentenceRule, SentenceSelection } from './sentenceTypes';
|
|
6
|
+
import type { RuleMenus } from './useRuleMenus';
|
|
7
|
+
import type { RuleWindow } from './useRuleWindow';
|
|
8
|
+
import { type SentenceNavigation, type SentenceNavigationSource } from './useSentenceNavigation';
|
|
9
|
+
import type { SentenceEditorContext } from './valueTypes';
|
|
10
|
+
export interface ValueEditingParams {
|
|
11
|
+
edit: DecisionTextEdit | undefined;
|
|
12
|
+
rules: readonly SentenceRule[];
|
|
13
|
+
bands: readonly SentenceBand[];
|
|
14
|
+
selected: SentenceSelection | null | undefined;
|
|
15
|
+
onSelect: SentenceNavigationSource['onSelect'];
|
|
16
|
+
navigation: SentenceNavigation;
|
|
17
|
+
labels: Pick<RuleCardLabels, 'cell' | 'emptyValue'>;
|
|
18
|
+
container: RuleWindow['container'];
|
|
19
|
+
openMenu: RuleMenus['openFor'];
|
|
20
|
+
onOpenDecision: ((decisionId: string) => void) | undefined;
|
|
21
|
+
addRule: AddRuleButtonProps | undefined;
|
|
22
|
+
}
|
|
23
|
+
export interface ValueEditing {
|
|
24
|
+
editor: SentenceEditorContext | null;
|
|
25
|
+
editorKey: string | undefined;
|
|
26
|
+
onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => boolean;
|
|
27
|
+
onClick: (event: React.MouseEvent<HTMLElement>) => boolean;
|
|
28
|
+
takeRecoveredClick: (event: React.MouseEvent<HTMLElement>) => boolean;
|
|
29
|
+
onPointerDown: (event: React.PointerEvent<HTMLElement>) => void;
|
|
30
|
+
onRelease: () => void;
|
|
31
|
+
forgetPress: () => void;
|
|
32
|
+
}
|
|
33
|
+
export declare const useValueEditing: ({ edit, rules, bands, selected, onSelect, navigation, labels, container, openMenu, onOpenDecision, addRule, }: ValueEditingParams) => ValueEditing;
|
|
34
|
+
//# sourceMappingURL=useValueEditing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useValueEditing.d.ts","sourceRoot":"","sources":["../../src/decision-table/useValueEditing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAiBhE,OAAO,KAAK,EACV,YAAY,EAEZ,YAAY,EACZ,iBAAiB,EAElB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC9B,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACnC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IAC/B,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IAC/B,QAAQ,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/C,QAAQ,EAAE,wBAAwB,CAAC,UAAU,CAAC,CAAC;IAC/C,UAAU,EAAE,kBAAkB,CAAC;IAC/B,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,YAAY,CAAC,CAAC;IACpD,SAAS,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAEnC,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE/B,cAAc,EAAE,CAAC,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAE3D,OAAO,EAAE,kBAAkB,GAAG,SAAS,CAAC;CACzC;AAmBD,MAAM,WAAW,YAAY;IAE3B,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAErC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAE9B,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,OAAO,CAAC;IAEhE,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,OAAO,CAAC;IAE3D,kBAAkB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,OAAO,CAAC;IAEtE,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEhE,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAuDD,eAAO,MAAM,eAAe,GAAI,+GAY7B,kBAAkB,KAAG,YA+NvB,CAAC"}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { useEffect, useLayoutEffect, useRef } from "react";
|
|
2
|
+
import { activeElementOf, focusStays, hasLostFocus, onNextGesture } from "./gridEvents.js";
|
|
3
|
+
import { cellName } from "./ruleCardModel.js";
|
|
4
|
+
import { bandColumnNameOf, cellTextOf, columnNameOf, hasStop, tokenText, valueTokenOf } from "./sentenceParts.js";
|
|
5
|
+
import { addConditionOf, clickedAction, clickedAddRule, clickedDecision, clickedValue } from "./sentenceTargets.js";
|
|
6
|
+
import { isIgnoredKey } from "./useSentenceNavigation.js";
|
|
7
|
+
const isStartKey = (event)=>'Enter' === event.key || 'F2' === event.key || ' ' === event.key && void 0 === clickedDecision(event.target);
|
|
8
|
+
const isClearKey = (event)=>'Delete' === event.key || 'Backspace' === event.key;
|
|
9
|
+
const valueKey = ({ rowId, columnId, index })=>JSON.stringify([
|
|
10
|
+
rowId,
|
|
11
|
+
columnId,
|
|
12
|
+
index
|
|
13
|
+
]);
|
|
14
|
+
const pressTargetOf = (target)=>{
|
|
15
|
+
const decisionId = clickedDecision(target);
|
|
16
|
+
if (void 0 !== decisionId) return {
|
|
17
|
+
kind: 'decision',
|
|
18
|
+
decisionId
|
|
19
|
+
};
|
|
20
|
+
const action = clickedAction(target);
|
|
21
|
+
if (action) return {
|
|
22
|
+
kind: 'action',
|
|
23
|
+
action
|
|
24
|
+
};
|
|
25
|
+
const value = clickedValue(target);
|
|
26
|
+
if (value) return {
|
|
27
|
+
kind: 'value',
|
|
28
|
+
value
|
|
29
|
+
};
|
|
30
|
+
return clickedAddRule(target) ? {
|
|
31
|
+
kind: 'addRule'
|
|
32
|
+
} : null;
|
|
33
|
+
};
|
|
34
|
+
const movedAway = ({ element, at })=>{
|
|
35
|
+
if (!element.isConnected) return true;
|
|
36
|
+
const { x, y, width, height } = element.getBoundingClientRect();
|
|
37
|
+
return x !== at.x || y !== at.y || width !== at.width || height !== at.height;
|
|
38
|
+
};
|
|
39
|
+
const textIn = (rules, cell)=>{
|
|
40
|
+
const rule = rules.find((candidate)=>candidate.rowId === cell.rowId);
|
|
41
|
+
return rule && (void 0 === cell.columnId ? '' : cellTextOf(rule, cell.columnId));
|
|
42
|
+
};
|
|
43
|
+
const rowIdOf = (element)=>element instanceof HTMLElement ? element.closest('li[data-row-id]')?.dataset.rowId : void 0;
|
|
44
|
+
const useValueEditing = ({ edit, rules, bands, selected, onSelect, navigation, labels, container, openMenu, onOpenDecision, addRule })=>{
|
|
45
|
+
const pendingRef = useRef(null);
|
|
46
|
+
const stopAwaitingRef = useRef(null);
|
|
47
|
+
const pressedRef = useRef(null);
|
|
48
|
+
const recoveredRef = useRef(false);
|
|
49
|
+
const refocusRef = useRef(null);
|
|
50
|
+
const goneRef = useRef(null);
|
|
51
|
+
const target = edit?.editing ?? null;
|
|
52
|
+
const openedRef = useRef(target ? valueKey(target) : void 0);
|
|
53
|
+
const row = target ? rules.findIndex((rule)=>rule.rowId === target.rowId) : -1;
|
|
54
|
+
const rule = rules[row];
|
|
55
|
+
const awaitHost = (pending)=>{
|
|
56
|
+
stopAwaitingRef.current?.();
|
|
57
|
+
const view = container();
|
|
58
|
+
pendingRef.current = pending && {
|
|
59
|
+
...pending,
|
|
60
|
+
focused: view && activeElementOf(view)
|
|
61
|
+
};
|
|
62
|
+
stopAwaitingRef.current = pending && view ? onNextGesture(view, ()=>awaitHost(null)) : null;
|
|
63
|
+
};
|
|
64
|
+
useEffect(()=>()=>stopAwaitingRef.current?.(), []);
|
|
65
|
+
const start = (value)=>{
|
|
66
|
+
if (!edit) return;
|
|
67
|
+
awaitHost(null);
|
|
68
|
+
if (selected?.rowId !== value.rowId || selected?.columnId !== value.columnId) navigation.select({
|
|
69
|
+
rowId: value.rowId,
|
|
70
|
+
columnId: value.columnId
|
|
71
|
+
}, ()=>null, false);
|
|
72
|
+
edit.onStartEdit(value);
|
|
73
|
+
};
|
|
74
|
+
const editorOf = ()=>{
|
|
75
|
+
if (!edit || !target || !rule) return null;
|
|
76
|
+
const token = valueTokenOf(rule, target);
|
|
77
|
+
const column = columnNameOf(rule, target.columnId) || bandColumnNameOf(bands, target.columnId);
|
|
78
|
+
return {
|
|
79
|
+
target,
|
|
80
|
+
value: token?.text ?? '',
|
|
81
|
+
ariaLabel: hasStop(rule, target.columnId) ? cellName(labels, column, token ? tokenText(token, labels.emptyValue) : '', row + 1) : edit.labels.newCondition(column, row + 1),
|
|
82
|
+
onCommit: (text, move)=>{
|
|
83
|
+
awaitHost({
|
|
84
|
+
from: target,
|
|
85
|
+
move,
|
|
86
|
+
rules
|
|
87
|
+
});
|
|
88
|
+
edit.onCommit(target, text, move);
|
|
89
|
+
},
|
|
90
|
+
onCancel: ()=>{
|
|
91
|
+
awaitHost({
|
|
92
|
+
from: target,
|
|
93
|
+
move: 'cancel',
|
|
94
|
+
rules
|
|
95
|
+
});
|
|
96
|
+
edit.onCancel();
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
const resolve = ({ from, move, rules: before })=>{
|
|
101
|
+
const cell = {
|
|
102
|
+
rowId: from.rowId,
|
|
103
|
+
columnId: from.columnId
|
|
104
|
+
};
|
|
105
|
+
const rowRule = rules.find((candidate)=>candidate.rowId === from.rowId);
|
|
106
|
+
if ('cancel' === move) {
|
|
107
|
+
if (hasStop(rowRule, cell.columnId)) navigation.select(cell);
|
|
108
|
+
else navigation.select({
|
|
109
|
+
rowId: from.rowId
|
|
110
|
+
}, addConditionOf);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const sibling = {
|
|
114
|
+
...from,
|
|
115
|
+
index: from.index + ('left' === move ? -1 : 1)
|
|
116
|
+
};
|
|
117
|
+
if (('left' === move || 'right' === move) && rowRule && valueTokenOf(rowRule, sibling)) return void start(sibling);
|
|
118
|
+
navigation.selectAfter(cell, move, before);
|
|
119
|
+
};
|
|
120
|
+
useLayoutEffect(()=>{
|
|
121
|
+
const opened = target ? valueKey(target) : void 0;
|
|
122
|
+
if (opened === openedRef.current) return;
|
|
123
|
+
openedRef.current = opened;
|
|
124
|
+
if (target && (selected?.rowId !== target.rowId || selected?.columnId !== target.columnId)) onSelect?.({
|
|
125
|
+
rowId: target.rowId,
|
|
126
|
+
columnId: target.columnId
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
useLayoutEffect(()=>{
|
|
130
|
+
const gone = target && !rule ? valueKey(target) : null;
|
|
131
|
+
if (null !== gone && gone !== goneRef.current) edit?.onCancel();
|
|
132
|
+
goneRef.current = gone;
|
|
133
|
+
});
|
|
134
|
+
const staysOn = (rowId)=>{
|
|
135
|
+
const view = container();
|
|
136
|
+
const focused = view && activeElementOf(view);
|
|
137
|
+
return null !== view && (hasLostFocus(view) || focused === view || rowIdOf(focused) === rowId);
|
|
138
|
+
};
|
|
139
|
+
useLayoutEffect(()=>{
|
|
140
|
+
const refocus = refocusRef.current;
|
|
141
|
+
if (null === refocus) return;
|
|
142
|
+
const stayed = staysOn(refocus.cell.rowId);
|
|
143
|
+
if (stayed && textIn(rules, refocus.cell) === refocus.text) return;
|
|
144
|
+
refocusRef.current = null;
|
|
145
|
+
if (stayed) navigation.refocus(refocus.scroll);
|
|
146
|
+
});
|
|
147
|
+
useLayoutEffect(()=>{
|
|
148
|
+
const pending = pendingRef.current;
|
|
149
|
+
if (!pending || target && valueKey(target) === valueKey(pending.from)) return;
|
|
150
|
+
awaitHost(null);
|
|
151
|
+
if (!target && focusStays(container(), pending.focused)) resolve(pending);
|
|
152
|
+
});
|
|
153
|
+
const cancelEditOf = (cell)=>{
|
|
154
|
+
if (target?.rowId !== cell.rowId || cell.columnId && target.columnId !== cell.columnId) return;
|
|
155
|
+
awaitHost(null);
|
|
156
|
+
edit?.onCancel();
|
|
157
|
+
};
|
|
158
|
+
const clear = (cell, refocusNow, scroll)=>{
|
|
159
|
+
refocusRef.current = {
|
|
160
|
+
cell,
|
|
161
|
+
text: textIn(rules, cell),
|
|
162
|
+
scroll
|
|
163
|
+
};
|
|
164
|
+
edit?.onClearCell(cell);
|
|
165
|
+
cancelEditOf(cell);
|
|
166
|
+
if (refocusNow && staysOn(cell.rowId)) navigation.refocus(scroll);
|
|
167
|
+
};
|
|
168
|
+
const onKeyDown = (event)=>{
|
|
169
|
+
refocusRef.current = null;
|
|
170
|
+
const columnId = navigation.selectedColumnId;
|
|
171
|
+
const rowId = selected?.rowId;
|
|
172
|
+
if (!edit || !(isStartKey(event) || isClearKey(event)) || isIgnoredKey(event)) return false;
|
|
173
|
+
if (null === columnId || void 0 === rowId) return false;
|
|
174
|
+
event.preventDefault();
|
|
175
|
+
if (isClearKey(event)) clear({
|
|
176
|
+
rowId,
|
|
177
|
+
columnId
|
|
178
|
+
}, true, true);
|
|
179
|
+
else start({
|
|
180
|
+
rowId,
|
|
181
|
+
columnId,
|
|
182
|
+
index: 0
|
|
183
|
+
});
|
|
184
|
+
return true;
|
|
185
|
+
};
|
|
186
|
+
const onAction = (action)=>{
|
|
187
|
+
if ('clear' === action.action) {
|
|
188
|
+
clear(action.cell, selected?.rowId === action.cell.rowId, false);
|
|
189
|
+
if (selected?.rowId !== action.cell.rowId) navigation.select({
|
|
190
|
+
rowId: action.cell.rowId
|
|
191
|
+
}, void 0, false);
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
if ('delete' !== action.action) return false;
|
|
195
|
+
refocusRef.current = {
|
|
196
|
+
cell: {
|
|
197
|
+
rowId: action.rowId
|
|
198
|
+
},
|
|
199
|
+
text: textIn(rules, {
|
|
200
|
+
rowId: action.rowId
|
|
201
|
+
}),
|
|
202
|
+
scroll: true
|
|
203
|
+
};
|
|
204
|
+
edit?.onDeleteRule(action.rowId);
|
|
205
|
+
cancelEditOf({
|
|
206
|
+
rowId: action.rowId
|
|
207
|
+
});
|
|
208
|
+
if (selected?.rowId === action.rowId && staysOn(action.rowId)) navigation.refocus();
|
|
209
|
+
return true;
|
|
210
|
+
};
|
|
211
|
+
const recover = ({ target })=>{
|
|
212
|
+
switch(target.kind){
|
|
213
|
+
case 'decision':
|
|
214
|
+
onOpenDecision?.(target.decisionId);
|
|
215
|
+
return void 0 !== onOpenDecision;
|
|
216
|
+
case 'action':
|
|
217
|
+
return onAction(target.action) || openMenu(target.action);
|
|
218
|
+
case 'value':
|
|
219
|
+
start(target.value);
|
|
220
|
+
return true;
|
|
221
|
+
case 'addRule':
|
|
222
|
+
addRule?.onAdd();
|
|
223
|
+
return void 0 !== addRule;
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
const ranOwnClick = ({ target }, clicked)=>'addRule' === target.kind && clickedAddRule(clicked);
|
|
227
|
+
const forgetPress = ()=>{
|
|
228
|
+
pressedRef.current = null;
|
|
229
|
+
recoveredRef.current = false;
|
|
230
|
+
};
|
|
231
|
+
const takeRecoveredClick = (event)=>{
|
|
232
|
+
const pressed = pressedRef.current;
|
|
233
|
+
const recovered = recoveredRef.current;
|
|
234
|
+
forgetPress();
|
|
235
|
+
return event.detail > 0 && (recovered || null !== pressed && movedAway(pressed) && !ranOwnClick(pressed, event.target) && recover(pressed));
|
|
236
|
+
};
|
|
237
|
+
const onClick = (event)=>{
|
|
238
|
+
const action = edit ? clickedAction(event.target) : null;
|
|
239
|
+
if (action) return onAction(action);
|
|
240
|
+
const value = edit ? clickedValue(event.target) : null;
|
|
241
|
+
if (!value) return false;
|
|
242
|
+
start(value);
|
|
243
|
+
return true;
|
|
244
|
+
};
|
|
245
|
+
const onPointerDown = (event)=>{
|
|
246
|
+
recoveredRef.current = false;
|
|
247
|
+
refocusRef.current = null;
|
|
248
|
+
const target = edit && 0 === event.button ? pressTargetOf(event.target) : null;
|
|
249
|
+
pressedRef.current = target && event.target instanceof Element ? {
|
|
250
|
+
target,
|
|
251
|
+
element: event.target,
|
|
252
|
+
at: event.target.getBoundingClientRect()
|
|
253
|
+
} : null;
|
|
254
|
+
};
|
|
255
|
+
const onRelease = ()=>{
|
|
256
|
+
const pressed = pressedRef.current;
|
|
257
|
+
if (!pressed || pressed.element.isConnected) return;
|
|
258
|
+
pressedRef.current = null;
|
|
259
|
+
recoveredRef.current = recover(pressed);
|
|
260
|
+
};
|
|
261
|
+
return {
|
|
262
|
+
editor: editorOf(),
|
|
263
|
+
editorKey: target ? valueKey(target) : void 0,
|
|
264
|
+
onKeyDown,
|
|
265
|
+
onClick,
|
|
266
|
+
takeRecoveredClick,
|
|
267
|
+
onPointerDown,
|
|
268
|
+
onRelease,
|
|
269
|
+
forgetPress
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
export { useValueEditing };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.r = (exports1)=>{
|
|
5
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
6
|
+
value: 'Module'
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
13
|
+
var __webpack_exports__ = {};
|
|
14
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
16
|
+
Object.defineProperty(exports, '__esModule', {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueTypes.d.ts","sourceRoot":"","sources":["../../src/decision-table/valueTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,MAAM,EAAE,eAAe,CAAC;CACzB"}
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/apollo-react",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.19.1",
|
|
4
4
|
"description": "Apollo Design System - React component library with Material UI theming",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -251,10 +251,10 @@
|
|
|
251
251
|
"use-sync-external-store": "^1.2.0",
|
|
252
252
|
"zod": "^4.6.6",
|
|
253
253
|
"zustand": "^5.0.9",
|
|
254
|
+
"@uipath/apollo-core": "5.15.2",
|
|
254
255
|
"@uipath/apollo-ui-icons": "1.2.1",
|
|
255
256
|
"@uipath/apollo-ui-icons-react": "1.0.0",
|
|
256
|
-
"@uipath/apollo-wind": "2.93.0"
|
|
257
|
-
"@uipath/apollo-core": "5.15.2"
|
|
257
|
+
"@uipath/apollo-wind": "2.93.0"
|
|
258
258
|
},
|
|
259
259
|
"devDependencies": {
|
|
260
260
|
"@lingui/cli": "^5.6.1",
|