@uipath/apollo-react 7.34.0 → 7.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/components/BaseNode/BaseNodeContainer.cjs +4 -4
- package/dist/canvas/components/BaseNode/BaseNodeContainer.js +4 -4
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/chat/styles/tailwind.chat.css +1 -1
- package/dist/decision-table/DecisionGraphText.cjs +398 -6
- package/dist/decision-table/DecisionGraphText.d.ts +15 -5
- package/dist/decision-table/DecisionGraphText.d.ts.map +1 -1
- package/dist/decision-table/DecisionGraphText.js +399 -7
- package/dist/decision-table/DecisionText.cjs +16 -2
- package/dist/decision-table/DecisionText.d.ts +3 -3
- package/dist/decision-table/DecisionText.d.ts.map +1 -1
- package/dist/decision-table/DecisionText.js +16 -2
- package/dist/decision-table/__fixtures__/textMode.d.ts +3 -3
- package/dist/decision-table/__fixtures__/textMode.d.ts.map +1 -1
- package/dist/decision-table/__fixtures__/useStoryHistory.d.ts +7 -0
- package/dist/decision-table/__fixtures__/useStoryHistory.d.ts.map +1 -0
- package/dist/decision-table/decisionGraphActionTypes.d.ts +8 -0
- package/dist/decision-table/decisionGraphActionTypes.d.ts.map +1 -1
- package/dist/decision-table/decisionGraphTypes.d.ts +3 -0
- package/dist/decision-table/decisionGraphTypes.d.ts.map +1 -1
- package/dist/decision-table/index.cjs +54 -62
- package/dist/decision-table/index.d.ts +1 -2
- package/dist/decision-table/index.d.ts.map +1 -1
- package/dist/decision-table/index.js +1 -2
- package/dist/decision-table/revealIn.cjs +59 -0
- package/dist/decision-table/revealIn.d.ts +7 -0
- package/dist/decision-table/revealIn.d.ts.map +1 -0
- package/dist/decision-table/revealIn.js +25 -0
- package/dist/decision-table/sentenceTargets.cjs +5 -1
- package/dist/decision-table/sentenceTargets.d.ts +1 -0
- package/dist/decision-table/sentenceTargets.d.ts.map +1 -1
- package/dist/decision-table/sentenceTargets.js +2 -1
- package/dist/decision-table/styles/tailwind.decision-table.css +1 -1
- package/dist/decision-table/useContainerHandlers.cjs +19 -6
- package/dist/decision-table/useContainerHandlers.d.ts +8 -2
- package/dist/decision-table/useContainerHandlers.d.ts.map +1 -1
- package/dist/decision-table/useContainerHandlers.js +21 -8
- package/dist/decision-table/useGridLayout.cjs +12 -2
- package/dist/decision-table/useGridLayout.d.ts.map +1 -1
- package/dist/decision-table/useGridLayout.js +12 -2
- package/dist/decision-table/useRuleWindow.cjs +9 -4
- 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 +9 -4
- package/dist/decision-table/useValueEditing.cjs +1 -2
- package/dist/decision-table/useValueEditing.d.ts.map +1 -1
- package/dist/decision-table/useValueEditing.js +1 -2
- package/dist/decision-table/useVirtualizedAxis.cjs +17 -14
- package/dist/decision-table/useVirtualizedAxis.d.ts +2 -2
- package/dist/decision-table/useVirtualizedAxis.d.ts.map +1 -1
- package/dist/decision-table/useVirtualizedAxis.js +17 -14
- package/package.json +2 -2
- package/dist/decision-table/DecisionGraphView.cjs +0 -409
- package/dist/decision-table/DecisionGraphView.d.ts +0 -20
- package/dist/decision-table/DecisionGraphView.d.ts.map +0 -1
- package/dist/decision-table/DecisionGraphView.js +0 -375
- package/dist/decision-table/EditableDecisionGraphText.cjs +0 -40
- package/dist/decision-table/EditableDecisionGraphText.d.ts +0 -5
- package/dist/decision-table/EditableDecisionGraphText.d.ts.map +0 -1
- package/dist/decision-table/EditableDecisionGraphText.js +0 -6
|
@@ -1,409 +0,0 @@
|
|
|
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
|
-
DecisionGraphView: ()=>DecisionGraphView
|
|
28
|
-
});
|
|
29
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
|
-
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
32
|
-
const external_react_namespaceObject = require("react");
|
|
33
|
-
const external_DecisionGraphCard_cjs_namespaceObject = require("./DecisionGraphCard.cjs");
|
|
34
|
-
const external_DecisionGraphMinimapSlot_cjs_namespaceObject = require("./DecisionGraphMinimapSlot.cjs");
|
|
35
|
-
const external_decisionGraphPositions_cjs_namespaceObject = require("./decisionGraphPositions.cjs");
|
|
36
|
-
const external_decisionGraphStyles_cjs_namespaceObject = require("./decisionGraphStyles.cjs");
|
|
37
|
-
const external_sentenceRuleHeights_cjs_namespaceObject = require("./sentenceRuleHeights.cjs");
|
|
38
|
-
const external_useDecisionGraphActions_cjs_namespaceObject = require("./useDecisionGraphActions.cjs");
|
|
39
|
-
const external_useDecisionGraphStrings_cjs_namespaceObject = require("./useDecisionGraphStrings.cjs");
|
|
40
|
-
const external_useDecisionTextStrings_cjs_namespaceObject = require("./useDecisionTextStrings.cjs");
|
|
41
|
-
const external_useRuleWindow_cjs_namespaceObject = require("./useRuleWindow.cjs");
|
|
42
|
-
const external_useTextAnnouncements_cjs_namespaceObject = require("./useTextAnnouncements.cjs");
|
|
43
|
-
const NO_EXPANDED = new Set();
|
|
44
|
-
const markTargetOf = ({ id, mark })=>mark?.kind === 'rule' ? {
|
|
45
|
-
kind: 'rule',
|
|
46
|
-
decisionId: id,
|
|
47
|
-
rowId: mark.rowId
|
|
48
|
-
} : {
|
|
49
|
-
kind: 'decision',
|
|
50
|
-
decisionId: id
|
|
51
|
-
};
|
|
52
|
-
const focuses = (mode)=>'navigate' === mode.kind && mode.focus;
|
|
53
|
-
const flashes = (mode)=>'inPlace' === mode.kind || mode.flash;
|
|
54
|
-
const prefersReducedMotion = ()=>'function' == typeof matchMedia && matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
55
|
-
const flash = (element)=>{
|
|
56
|
-
if (prefersReducedMotion()) return;
|
|
57
|
-
element.animate?.([
|
|
58
|
-
{
|
|
59
|
-
boxShadow: '0 0 0 4px color-mix(in srgb, var(--color-primary) 40%, transparent)'
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
boxShadow: '0 0 0 0 transparent'
|
|
63
|
-
}
|
|
64
|
-
], {
|
|
65
|
-
duration: 1400,
|
|
66
|
-
easing: 'ease-out'
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
const scrollTo = (scroller, top)=>scroller.scrollTo?.({
|
|
70
|
-
top
|
|
71
|
-
});
|
|
72
|
-
const NEAR_MARGIN = '100% 0px';
|
|
73
|
-
const nearAfter = (current, entries)=>{
|
|
74
|
-
let next;
|
|
75
|
-
for (const { target, isIntersecting } of entries){
|
|
76
|
-
const decisionId = target instanceof HTMLElement ? target.dataset.decisionId : void 0;
|
|
77
|
-
if (void 0 !== decisionId && (next ?? current).has(decisionId) !== isIntersecting) {
|
|
78
|
-
next ??= new Set(current);
|
|
79
|
-
if (isIntersecting) next.add(decisionId);
|
|
80
|
-
else next.delete(decisionId);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return next ?? current;
|
|
84
|
-
};
|
|
85
|
-
const bodyHeightOf = (card)=>{
|
|
86
|
-
const body = card.querySelector(':scope > [data-graph-body]');
|
|
87
|
-
if (!body || body.querySelector(':scope > [data-graph-placeholder]')) return null;
|
|
88
|
-
return body.offsetHeight || null;
|
|
89
|
-
};
|
|
90
|
-
const ruleCountsOf = (nodes)=>{
|
|
91
|
-
const counts = new Map();
|
|
92
|
-
const visit = (node)=>{
|
|
93
|
-
if ('decision' !== node.kind) return;
|
|
94
|
-
if ('table' === node.logic.kind) counts.set(node.id, node.logic.ruleCount);
|
|
95
|
-
for (const child of node.children)visit(child);
|
|
96
|
-
};
|
|
97
|
-
for (const node of nodes)visit(node);
|
|
98
|
-
return counts;
|
|
99
|
-
};
|
|
100
|
-
const perRuleHeightOf = (heights, ruleCounts)=>{
|
|
101
|
-
let height = 0;
|
|
102
|
-
let rules = 0;
|
|
103
|
-
for (const [decisionId, measured] of heights){
|
|
104
|
-
const count = ruleCounts.get(decisionId) ?? 0;
|
|
105
|
-
if (0 !== count) {
|
|
106
|
-
height += measured;
|
|
107
|
-
rules += count;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return 0 === rules ? external_sentenceRuleHeights_cjs_namespaceObject.SENTENCE_MIN_RULE_HEIGHT_PX : height / rules;
|
|
111
|
-
};
|
|
112
|
-
const DecisionGraphView = ({ nodes, mode, renderBody, expansion, onFold, selected = null, onReveal, onOpenDecision, rules, dataTestId })=>{
|
|
113
|
-
const labels = (0, external_useDecisionGraphStrings_cjs_namespaceObject.useDecisionGraphLabels)();
|
|
114
|
-
const { announce, region } = (0, external_useTextAnnouncements_cjs_namespaceObject.useTextAnnouncements)((0, external_useDecisionTextStrings_cjs_namespaceObject.useDecisionTextLabels)(), dataTestId);
|
|
115
|
-
const idPrefix = (0, external_react_namespaceObject.useId)();
|
|
116
|
-
const [ownExpanded, setOwnExpanded] = (0, external_react_namespaceObject.useState)(NO_EXPANDED);
|
|
117
|
-
const expanded = expansion?.expanded ?? ownExpanded;
|
|
118
|
-
const users = (0, external_react_namespaceObject.useMemo)(()=>(0, external_decisionGraphPositions_cjs_namespaceObject.usersOf)(nodes), [
|
|
119
|
-
nodes
|
|
120
|
-
]);
|
|
121
|
-
const [scroller, setScroller] = (0, external_react_namespaceObject.useState)(null);
|
|
122
|
-
const [launcherEnd, setLauncherEnd] = (0, external_react_namespaceObject.useState)(0);
|
|
123
|
-
const cardsRef = (0, external_react_namespaceObject.useRef)(new Map());
|
|
124
|
-
const [pending, setPending] = (0, external_react_namespaceObject.useState)(null);
|
|
125
|
-
const [near, setNear] = (0, external_react_namespaceObject.useState)(()=>"u" < typeof IntersectionObserver ? null : NO_EXPANDED);
|
|
126
|
-
const [revealed, setRevealed] = (0, external_react_namespaceObject.useState)(null);
|
|
127
|
-
const [focused, setFocused] = (0, external_react_namespaceObject.useState)(null);
|
|
128
|
-
const heightsRef = (0, external_react_namespaceObject.useRef)(new Map());
|
|
129
|
-
const observersRef = (0, external_react_namespaceObject.useRef)(null);
|
|
130
|
-
const ruleCounts = (0, external_react_namespaceObject.useMemo)(()=>ruleCountsOf(nodes), [
|
|
131
|
-
nodes
|
|
132
|
-
]);
|
|
133
|
-
const setExpanded = (next)=>{
|
|
134
|
-
if (expansion) expansion.onChange(next);
|
|
135
|
-
else setOwnExpanded(next);
|
|
136
|
-
};
|
|
137
|
-
const toggle = (decisionId)=>{
|
|
138
|
-
const next = new Set(expanded);
|
|
139
|
-
const folds = next.delete(decisionId);
|
|
140
|
-
if (!folds) next.add(decisionId);
|
|
141
|
-
setExpanded(next);
|
|
142
|
-
if (folds) onFold?.(decisionId);
|
|
143
|
-
};
|
|
144
|
-
const reveal = (target)=>{
|
|
145
|
-
if (!expanded.has(target.decisionId)) setExpanded(new Set([
|
|
146
|
-
...expanded,
|
|
147
|
-
target.decisionId
|
|
148
|
-
]));
|
|
149
|
-
setPending(target);
|
|
150
|
-
setRevealed(target.decisionId);
|
|
151
|
-
if ('navigate' === target.mode.kind) onReveal?.('rule' === target.kind ? {
|
|
152
|
-
kind: 'rule',
|
|
153
|
-
decisionId: target.decisionId,
|
|
154
|
-
rowId: target.rowId
|
|
155
|
-
} : {
|
|
156
|
-
kind: 'decision',
|
|
157
|
-
decisionId: target.decisionId
|
|
158
|
-
});
|
|
159
|
-
};
|
|
160
|
-
const openOf = (decisionId)=>onOpenDecision && (()=>onOpenDecision(decisionId));
|
|
161
|
-
const actions = (0, external_useDecisionGraphActions_cjs_namespaceObject.useDecisionGraphActions)({
|
|
162
|
-
mode,
|
|
163
|
-
nodes,
|
|
164
|
-
labels,
|
|
165
|
-
openOf,
|
|
166
|
-
cardOf: (decisionId)=>cardsRef.current.get(decisionId),
|
|
167
|
-
scroller,
|
|
168
|
-
announce,
|
|
169
|
-
dataTestId
|
|
170
|
-
});
|
|
171
|
-
const cardRefsRef = (0, external_react_namespaceObject.useRef)(new Map());
|
|
172
|
-
const cardRef = (0, external_react_namespaceObject.useCallback)((decisionId)=>{
|
|
173
|
-
const cached = cardRefsRef.current.get(decisionId);
|
|
174
|
-
if (cached) return cached;
|
|
175
|
-
const attach = (element)=>{
|
|
176
|
-
const observers = observersRef.current;
|
|
177
|
-
const previous = cardsRef.current.get(decisionId);
|
|
178
|
-
if (previous && previous !== element) {
|
|
179
|
-
observers?.near.unobserve(previous);
|
|
180
|
-
observers?.size?.unobserve(previous);
|
|
181
|
-
}
|
|
182
|
-
if (!element) return void cardsRef.current.delete(decisionId);
|
|
183
|
-
cardsRef.current.set(decisionId, element);
|
|
184
|
-
observers?.near.observe(element);
|
|
185
|
-
observers?.size?.observe(element);
|
|
186
|
-
};
|
|
187
|
-
cardRefsRef.current.set(decisionId, attach);
|
|
188
|
-
return attach;
|
|
189
|
-
}, []);
|
|
190
|
-
(0, external_react_namespaceObject.useLayoutEffect)(()=>{
|
|
191
|
-
if (!scroller || "u" < typeof IntersectionObserver) return;
|
|
192
|
-
const remember = (card)=>{
|
|
193
|
-
if (!(card instanceof HTMLElement)) return;
|
|
194
|
-
const decisionId = card.dataset.decisionId;
|
|
195
|
-
const height = bodyHeightOf(card);
|
|
196
|
-
if (void 0 !== decisionId && null !== height) heightsRef.current.set(decisionId, height);
|
|
197
|
-
};
|
|
198
|
-
const nearObserver = new IntersectionObserver((entries)=>{
|
|
199
|
-
for (const { target } of entries)remember(target);
|
|
200
|
-
setNear((current)=>nearAfter(current ?? NO_EXPANDED, entries));
|
|
201
|
-
}, {
|
|
202
|
-
root: scroller,
|
|
203
|
-
rootMargin: NEAR_MARGIN
|
|
204
|
-
});
|
|
205
|
-
const sizeObserver = "u" < typeof ResizeObserver ? null : new ResizeObserver((entries)=>{
|
|
206
|
-
for (const { target } of entries)remember(target);
|
|
207
|
-
});
|
|
208
|
-
observersRef.current = {
|
|
209
|
-
near: nearObserver,
|
|
210
|
-
size: sizeObserver
|
|
211
|
-
};
|
|
212
|
-
for (const card of cardsRef.current.values()){
|
|
213
|
-
nearObserver.observe(card);
|
|
214
|
-
sizeObserver?.observe(card);
|
|
215
|
-
}
|
|
216
|
-
return ()=>{
|
|
217
|
-
nearObserver.disconnect();
|
|
218
|
-
sizeObserver?.disconnect();
|
|
219
|
-
observersRef.current = null;
|
|
220
|
-
};
|
|
221
|
-
}, [
|
|
222
|
-
scroller
|
|
223
|
-
]);
|
|
224
|
-
const perRuleHeight = perRuleHeightOf(heightsRef.current, ruleCounts);
|
|
225
|
-
const bodyOf = (decisionId, scrollContainer)=>{
|
|
226
|
-
const mounted = null === near || near.has(decisionId) || decisionId === selected || decisionId === revealed || decisionId === focused;
|
|
227
|
-
if (mounted) return renderBody(decisionId, {
|
|
228
|
-
container: scrollContainer
|
|
229
|
-
});
|
|
230
|
-
const height = heightsRef.current.get(decisionId) ?? Math.max(1, ruleCounts.get(decisionId) ?? 1) * perRuleHeight;
|
|
231
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
232
|
-
"aria-hidden": true,
|
|
233
|
-
"data-graph-placeholder": true,
|
|
234
|
-
style: {
|
|
235
|
-
height
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
};
|
|
239
|
-
const onFocus = (event)=>{
|
|
240
|
-
const card = event.target instanceof Element ? event.target.closest('[data-decision-id]') : null;
|
|
241
|
-
const decisionId = card instanceof HTMLElement ? card.dataset.decisionId : void 0;
|
|
242
|
-
if (void 0 !== decisionId) setFocused(decisionId);
|
|
243
|
-
};
|
|
244
|
-
(0, external_react_namespaceObject.useLayoutEffect)(()=>{
|
|
245
|
-
if (!pending) return;
|
|
246
|
-
const apply = ()=>{
|
|
247
|
-
const card = cardsRef.current.get(pending.decisionId);
|
|
248
|
-
if (!scroller || !card) return false;
|
|
249
|
-
if ('decision' === pending.kind) {
|
|
250
|
-
if ('navigate' === pending.mode.kind) scrollTo(scroller, (0, external_useRuleWindow_cjs_namespaceObject.contentTopIn)(card, scroller));
|
|
251
|
-
if (focuses(pending.mode)) card.querySelector('[data-graph-toggle]')?.focus({
|
|
252
|
-
preventScroll: true
|
|
253
|
-
});
|
|
254
|
-
if (flashes(pending.mode)) flash(card);
|
|
255
|
-
return true;
|
|
256
|
-
}
|
|
257
|
-
const rule = card.querySelector(`li[data-row-id="${CSS.escape(pending.rowId)}"]`);
|
|
258
|
-
if (!rule) return false;
|
|
259
|
-
if ('navigate' === pending.mode.kind) scrollTo(scroller, (0, external_useRuleWindow_cjs_namespaceObject.contentTopIn)(rule, scroller) - (scroller.clientHeight - rule.offsetHeight) / 2);
|
|
260
|
-
if (focuses(pending.mode)) {
|
|
261
|
-
if (!rule.hasAttribute('tabindex')) rule.tabIndex = -1;
|
|
262
|
-
rule.focus({
|
|
263
|
-
preventScroll: true
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
if (flashes(pending.mode)) flash(rule);
|
|
267
|
-
return true;
|
|
268
|
-
};
|
|
269
|
-
if (apply()) return void setPending(null);
|
|
270
|
-
const frame = requestAnimationFrame(()=>{
|
|
271
|
-
const card = cardsRef.current.get(pending.decisionId);
|
|
272
|
-
if (!apply() && flashes(pending.mode) && card) flash(card);
|
|
273
|
-
setPending(null);
|
|
274
|
-
});
|
|
275
|
-
return ()=>cancelAnimationFrame(frame);
|
|
276
|
-
});
|
|
277
|
-
const branch = (node, depth, position)=>{
|
|
278
|
-
if ('reference' === node.kind) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DecisionGraphCard_cjs_namespaceObject.DecisionGraphReference, {
|
|
279
|
-
node: node,
|
|
280
|
-
labels: labels,
|
|
281
|
-
actions: actions.referenceOf(node, position),
|
|
282
|
-
onReveal: ()=>reveal({
|
|
283
|
-
kind: 'decision',
|
|
284
|
-
decisionId: node.targetId,
|
|
285
|
-
mode: {
|
|
286
|
-
kind: 'navigate',
|
|
287
|
-
focus: false,
|
|
288
|
-
flash: false
|
|
289
|
-
}
|
|
290
|
-
}),
|
|
291
|
-
onOpen: openOf(node.targetId),
|
|
292
|
-
dataTestId: dataTestId
|
|
293
|
-
});
|
|
294
|
-
const open = expanded.has(node.id);
|
|
295
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
296
|
-
children: [
|
|
297
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DecisionGraphCard_cjs_namespaceObject.DecisionGraphCard, {
|
|
298
|
-
node: node,
|
|
299
|
-
depth: depth,
|
|
300
|
-
open: open,
|
|
301
|
-
active: selected === node.id,
|
|
302
|
-
usedBy: (users.get(node.id) ?? []).map((user)=>user.label),
|
|
303
|
-
bodyId: `${idPrefix}-${encodeURIComponent(node.id)}`,
|
|
304
|
-
body: open && scroller ? bodyOf(node.id, scroller) : null,
|
|
305
|
-
labels: labels,
|
|
306
|
-
onToggle: ()=>toggle(node.id),
|
|
307
|
-
onShowProblem: (byKey)=>reveal({
|
|
308
|
-
...markTargetOf(node),
|
|
309
|
-
mode: byKey ? {
|
|
310
|
-
kind: 'navigate',
|
|
311
|
-
focus: true,
|
|
312
|
-
flash: true
|
|
313
|
-
} : {
|
|
314
|
-
kind: 'inPlace'
|
|
315
|
-
}
|
|
316
|
-
}),
|
|
317
|
-
onOpen: openOf(node.id),
|
|
318
|
-
actions: actions.cardOf(node, position),
|
|
319
|
-
cardRef: cardRef(node.id),
|
|
320
|
-
dataTestId: dataTestId
|
|
321
|
-
}),
|
|
322
|
-
node.children.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
323
|
-
className: external_decisionGraphStyles_cjs_namespaceObject.GRAPH_NEST_CLASS,
|
|
324
|
-
"data-graph-nest-of": node.id,
|
|
325
|
-
children: (0, external_decisionGraphPositions_cjs_namespaceObject.childPositionsOf)(node, position).map((childPosition)=>{
|
|
326
|
-
const child = node.children[childPosition.index];
|
|
327
|
-
return child && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
328
|
-
className: external_decisionGraphStyles_cjs_namespaceObject.GRAPH_BRANCH_CLASS,
|
|
329
|
-
children: branch(child, depth + 1, childPosition)
|
|
330
|
-
}, child.id);
|
|
331
|
-
})
|
|
332
|
-
})
|
|
333
|
-
]
|
|
334
|
-
});
|
|
335
|
-
};
|
|
336
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
337
|
-
className: (0, apollo_wind_namespaceObject.cn)(external_decisionGraphStyles_cjs_namespaceObject.GRAPH_FRAME_CLASS, external_decisionGraphStyles_cjs_namespaceObject.GRAPH_OUTPUT_HUE_CLASS),
|
|
338
|
-
"data-testid": dataTestId,
|
|
339
|
-
...actions.focusWithin,
|
|
340
|
-
children: [
|
|
341
|
-
nodes.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DecisionGraphMinimapSlot_cjs_namespaceObject.DecisionGraphMinimapSlot, {
|
|
342
|
-
nodes: nodes,
|
|
343
|
-
rules: rules,
|
|
344
|
-
selected: selected,
|
|
345
|
-
onPick: (target)=>reveal({
|
|
346
|
-
...target,
|
|
347
|
-
mode: {
|
|
348
|
-
kind: 'navigate',
|
|
349
|
-
focus: true,
|
|
350
|
-
flash: true
|
|
351
|
-
}
|
|
352
|
-
}),
|
|
353
|
-
onLauncherEnd: setLauncherEnd,
|
|
354
|
-
labels: labels,
|
|
355
|
-
dataTestId: `${dataTestId}-minimap`
|
|
356
|
-
}),
|
|
357
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("section", {
|
|
358
|
-
ref: setScroller,
|
|
359
|
-
"aria-label": labels.graph,
|
|
360
|
-
className: external_decisionGraphStyles_cjs_namespaceObject.GRAPH_SCROLLER_CLASS,
|
|
361
|
-
"data-testid": `${dataTestId}-scroller`,
|
|
362
|
-
children: [
|
|
363
|
-
0 === nodes.length && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
|
|
364
|
-
className: external_decisionGraphStyles_cjs_namespaceObject.GRAPH_EMPTY_CLASS,
|
|
365
|
-
"data-testid": `${dataTestId}-empty`,
|
|
366
|
-
children: labels.empty
|
|
367
|
-
}),
|
|
368
|
-
(nodes.length > 0 || actions.addTop) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
369
|
-
className: external_decisionGraphStyles_cjs_namespaceObject.GRAPH_COLUMN_CLASS,
|
|
370
|
-
style: {
|
|
371
|
-
paddingLeft: (0, external_decisionGraphStyles_cjs_namespaceObject.graphColumnInsetOf)(launcherEnd)
|
|
372
|
-
},
|
|
373
|
-
onFocus: onFocus,
|
|
374
|
-
children: [
|
|
375
|
-
(0, external_decisionGraphPositions_cjs_namespaceObject.topPositionsOf)(nodes).map((position)=>{
|
|
376
|
-
const node = nodes[position.index];
|
|
377
|
-
return node && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
378
|
-
children: branch(node, 0, position)
|
|
379
|
-
}, node.id);
|
|
380
|
-
}),
|
|
381
|
-
actions.addTop && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("button", {
|
|
382
|
-
type: "button",
|
|
383
|
-
className: external_decisionGraphStyles_cjs_namespaceObject.GRAPH_ADD_DECISION_CLASS,
|
|
384
|
-
onClick: actions.addTop,
|
|
385
|
-
"data-graph-add": true,
|
|
386
|
-
"data-testid": `${dataTestId}-add-decision`,
|
|
387
|
-
children: [
|
|
388
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Plus, {
|
|
389
|
-
"aria-hidden": true
|
|
390
|
-
}),
|
|
391
|
-
labels.addDecision
|
|
392
|
-
]
|
|
393
|
-
})
|
|
394
|
-
]
|
|
395
|
-
})
|
|
396
|
-
]
|
|
397
|
-
}),
|
|
398
|
-
actions.dialogs,
|
|
399
|
-
region
|
|
400
|
-
]
|
|
401
|
-
});
|
|
402
|
-
};
|
|
403
|
-
exports.DecisionGraphView = __webpack_exports__.DecisionGraphView;
|
|
404
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
405
|
-
"DecisionGraphView"
|
|
406
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
407
|
-
Object.defineProperty(exports, '__esModule', {
|
|
408
|
-
value: true
|
|
409
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import { type DecisionGraphMinimapSlotProps } from './DecisionGraphMinimapSlot';
|
|
3
|
-
import type { DecisionGraphMode } from './decisionGraphActionTypes';
|
|
4
|
-
import type { DecisionGraphExpansion, DecisionGraphNode, DecisionGraphTarget } from './decisionGraphTypes';
|
|
5
|
-
import type { ContainerHandlersParams } from './useContainerHandlers';
|
|
6
|
-
import { type DecisionTextScroll } from './useRuleWindow';
|
|
7
|
-
export interface DecisionGraphViewProps<Refusal, Logic> {
|
|
8
|
-
nodes: readonly DecisionGraphNode[];
|
|
9
|
-
mode: DecisionGraphMode<Refusal, Logic>;
|
|
10
|
-
renderBody: (decisionId: string, scroll: Exclude<DecisionTextScroll, 'self'>) => React.ReactNode;
|
|
11
|
-
onFold?: (decisionId: string) => void;
|
|
12
|
-
expansion?: DecisionGraphExpansion;
|
|
13
|
-
selected?: string | null;
|
|
14
|
-
onReveal?: (target: DecisionGraphTarget) => void;
|
|
15
|
-
onOpenDecision?: ContainerHandlersParams['onOpenDecision'];
|
|
16
|
-
rules?: DecisionGraphMinimapSlotProps['rules'];
|
|
17
|
-
dataTestId: string;
|
|
18
|
-
}
|
|
19
|
-
export declare const DecisionGraphView: <Refusal, Logic>({ nodes, mode, renderBody, expansion, onFold, selected, onReveal, onOpenDecision, rules, dataTestId, }: DecisionGraphViewProps<Refusal, Logic>) => React.ReactElement;
|
|
20
|
-
//# sourceMappingURL=DecisionGraphView.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DecisionGraphView.d.ts","sourceRoot":"","sources":["../../src/decision-table/DecisionGraphView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAkBpE,OAAO,KAAK,EAEV,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAItE,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGxE,MAAM,WAAW,sBAAsB,CAAC,OAAO,EAAE,KAAK;IAEpD,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAEpC,IAAI,EAAE,iBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAExC,UAAU,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAEjG,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAEtC,SAAS,CAAC,EAAE,sBAAsB,CAAC;IAEnC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAEjD,cAAc,CAAC,EAAE,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;IAE3D,KAAK,CAAC,EAAE,6BAA6B,CAAC,OAAO,CAAC,CAAC;IAE/C,UAAU,EAAE,MAAM,CAAC;CACpB;AAwFD,eAAO,MAAM,iBAAiB,GAAI,OAAO,EAAE,KAAK,EAAE,wGAW/C,sBAAsB,CAAC,OAAO,EAAE,KAAK,CAAC,KAAG,KAAK,CAAC,YA6SjD,CAAC"}
|