@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.
Files changed (60) hide show
  1. package/dist/canvas/components/BaseNode/BaseNodeContainer.cjs +4 -4
  2. package/dist/canvas/components/BaseNode/BaseNodeContainer.js +4 -4
  3. package/dist/canvas/styles/tailwind.canvas.css +1 -1
  4. package/dist/chat/styles/tailwind.chat.css +1 -1
  5. package/dist/decision-table/DecisionGraphText.cjs +398 -6
  6. package/dist/decision-table/DecisionGraphText.d.ts +15 -5
  7. package/dist/decision-table/DecisionGraphText.d.ts.map +1 -1
  8. package/dist/decision-table/DecisionGraphText.js +399 -7
  9. package/dist/decision-table/DecisionText.cjs +16 -2
  10. package/dist/decision-table/DecisionText.d.ts +3 -3
  11. package/dist/decision-table/DecisionText.d.ts.map +1 -1
  12. package/dist/decision-table/DecisionText.js +16 -2
  13. package/dist/decision-table/__fixtures__/textMode.d.ts +3 -3
  14. package/dist/decision-table/__fixtures__/textMode.d.ts.map +1 -1
  15. package/dist/decision-table/__fixtures__/useStoryHistory.d.ts +7 -0
  16. package/dist/decision-table/__fixtures__/useStoryHistory.d.ts.map +1 -0
  17. package/dist/decision-table/decisionGraphActionTypes.d.ts +8 -0
  18. package/dist/decision-table/decisionGraphActionTypes.d.ts.map +1 -1
  19. package/dist/decision-table/decisionGraphTypes.d.ts +3 -0
  20. package/dist/decision-table/decisionGraphTypes.d.ts.map +1 -1
  21. package/dist/decision-table/index.cjs +54 -62
  22. package/dist/decision-table/index.d.ts +1 -2
  23. package/dist/decision-table/index.d.ts.map +1 -1
  24. package/dist/decision-table/index.js +1 -2
  25. package/dist/decision-table/revealIn.cjs +59 -0
  26. package/dist/decision-table/revealIn.d.ts +7 -0
  27. package/dist/decision-table/revealIn.d.ts.map +1 -0
  28. package/dist/decision-table/revealIn.js +25 -0
  29. package/dist/decision-table/sentenceTargets.cjs +5 -1
  30. package/dist/decision-table/sentenceTargets.d.ts +1 -0
  31. package/dist/decision-table/sentenceTargets.d.ts.map +1 -1
  32. package/dist/decision-table/sentenceTargets.js +2 -1
  33. package/dist/decision-table/styles/tailwind.decision-table.css +1 -1
  34. package/dist/decision-table/useContainerHandlers.cjs +19 -6
  35. package/dist/decision-table/useContainerHandlers.d.ts +8 -2
  36. package/dist/decision-table/useContainerHandlers.d.ts.map +1 -1
  37. package/dist/decision-table/useContainerHandlers.js +21 -8
  38. package/dist/decision-table/useGridLayout.cjs +12 -2
  39. package/dist/decision-table/useGridLayout.d.ts.map +1 -1
  40. package/dist/decision-table/useGridLayout.js +12 -2
  41. package/dist/decision-table/useRuleWindow.cjs +9 -4
  42. package/dist/decision-table/useRuleWindow.d.ts +1 -1
  43. package/dist/decision-table/useRuleWindow.d.ts.map +1 -1
  44. package/dist/decision-table/useRuleWindow.js +9 -4
  45. package/dist/decision-table/useValueEditing.cjs +1 -2
  46. package/dist/decision-table/useValueEditing.d.ts.map +1 -1
  47. package/dist/decision-table/useValueEditing.js +1 -2
  48. package/dist/decision-table/useVirtualizedAxis.cjs +17 -14
  49. package/dist/decision-table/useVirtualizedAxis.d.ts +2 -2
  50. package/dist/decision-table/useVirtualizedAxis.d.ts.map +1 -1
  51. package/dist/decision-table/useVirtualizedAxis.js +17 -14
  52. package/package.json +2 -2
  53. package/dist/decision-table/DecisionGraphView.cjs +0 -409
  54. package/dist/decision-table/DecisionGraphView.d.ts +0 -20
  55. package/dist/decision-table/DecisionGraphView.d.ts.map +0 -1
  56. package/dist/decision-table/DecisionGraphView.js +0 -375
  57. package/dist/decision-table/EditableDecisionGraphText.cjs +0 -40
  58. package/dist/decision-table/EditableDecisionGraphText.d.ts +0 -5
  59. package/dist/decision-table/EditableDecisionGraphText.d.ts.map +0 -1
  60. package/dist/decision-table/EditableDecisionGraphText.js +0 -6
@@ -27,14 +27,406 @@ __webpack_require__.d(__webpack_exports__, {
27
27
  DecisionGraphText: ()=>DecisionGraphText
28
28
  });
29
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
- const external_DecisionGraphView_cjs_namespaceObject = require("./DecisionGraphView.cjs");
31
- const READ = {
32
- kind: 'read'
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_revealIn_cjs_namespaceObject = require("./revealIn.cjs");
38
+ const external_sentenceRuleHeights_cjs_namespaceObject = require("./sentenceRuleHeights.cjs");
39
+ const external_useDecisionGraphActions_cjs_namespaceObject = require("./useDecisionGraphActions.cjs");
40
+ const external_useDecisionGraphStrings_cjs_namespaceObject = require("./useDecisionGraphStrings.cjs");
41
+ const external_useDecisionTextStrings_cjs_namespaceObject = require("./useDecisionTextStrings.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 NEAR_MARGIN = '100% 0px';
70
+ const nearAfter = (current, entries)=>{
71
+ let next;
72
+ for (const { target, isIntersecting } of entries){
73
+ const decisionId = target instanceof HTMLElement ? target.dataset.decisionId : void 0;
74
+ if (void 0 !== decisionId && (next ?? current).has(decisionId) !== isIntersecting) {
75
+ next ??= new Set(current);
76
+ if (isIntersecting) next.add(decisionId);
77
+ else next.delete(decisionId);
78
+ }
79
+ }
80
+ return next ?? current;
81
+ };
82
+ const bodyHeightOf = (card)=>{
83
+ const body = card.querySelector(':scope > [data-graph-body]');
84
+ if (!body || body.querySelector(':scope > [data-graph-placeholder]')) return null;
85
+ return body.offsetHeight || null;
86
+ };
87
+ const ruleCountsOf = (nodes)=>{
88
+ const counts = new Map();
89
+ const visit = (node)=>{
90
+ if ('decision' !== node.kind) return;
91
+ if ('table' === node.logic.kind) counts.set(node.id, node.logic.ruleCount);
92
+ for (const child of node.children)visit(child);
93
+ };
94
+ for (const node of nodes)visit(node);
95
+ return counts;
33
96
  };
34
- const DecisionGraphText = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DecisionGraphView_cjs_namespaceObject.DecisionGraphView, {
35
- ...props,
36
- mode: READ
97
+ const perRuleHeightOf = (heights, ruleCounts)=>{
98
+ let height = 0;
99
+ let rules = 0;
100
+ for (const [decisionId, measured] of heights){
101
+ const count = ruleCounts.get(decisionId) ?? 0;
102
+ if (0 !== count) {
103
+ height += measured;
104
+ rules += count;
105
+ }
106
+ }
107
+ return 0 === rules ? external_sentenceRuleHeights_cjs_namespaceObject.SENTENCE_MIN_RULE_HEIGHT_PX : height / rules;
108
+ };
109
+ const DecisionGraphText = ({ nodes, mode, renderBody, expansion, onFold, onOpenDecision, rules, dataTestId })=>{
110
+ const labels = (0, external_useDecisionGraphStrings_cjs_namespaceObject.useDecisionGraphLabels)();
111
+ const { selected } = mode;
112
+ const { announce, region } = (0, external_useTextAnnouncements_cjs_namespaceObject.useTextAnnouncements)((0, external_useDecisionTextStrings_cjs_namespaceObject.useDecisionTextLabels)(), dataTestId);
113
+ const idPrefix = (0, external_react_namespaceObject.useId)();
114
+ const [ownExpanded, setOwnExpanded] = (0, external_react_namespaceObject.useState)(NO_EXPANDED);
115
+ const expanded = expansion?.expanded ?? ownExpanded;
116
+ const users = (0, external_react_namespaceObject.useMemo)(()=>(0, external_decisionGraphPositions_cjs_namespaceObject.usersOf)(nodes), [
117
+ nodes
118
+ ]);
119
+ const drawn = (0, external_react_namespaceObject.useMemo)(()=>new Set((0, external_decisionGraphPositions_cjs_namespaceObject.decisionsOf)(nodes).map(({ id })=>id)), [
120
+ nodes
121
+ ]);
122
+ const [scroller, setScroller] = (0, external_react_namespaceObject.useState)(null);
123
+ const [launcherEnd, setLauncherEnd] = (0, external_react_namespaceObject.useState)(0);
124
+ const cardsRef = (0, external_react_namespaceObject.useRef)(new Map());
125
+ const [pending, setPending] = (0, external_react_namespaceObject.useState)(null);
126
+ const [near, setNear] = (0, external_react_namespaceObject.useState)(()=>"u" < typeof IntersectionObserver ? null : NO_EXPANDED);
127
+ const [revealed, setRevealed] = (0, external_react_namespaceObject.useState)(null);
128
+ const [focused, setFocused] = (0, external_react_namespaceObject.useState)(null);
129
+ const heightsRef = (0, external_react_namespaceObject.useRef)(new Map());
130
+ const observersRef = (0, external_react_namespaceObject.useRef)(null);
131
+ const ruleCounts = (0, external_react_namespaceObject.useMemo)(()=>ruleCountsOf(nodes), [
132
+ nodes
133
+ ]);
134
+ const setExpanded = (next)=>{
135
+ if (expansion) expansion.onChange(next);
136
+ else setOwnExpanded(next);
137
+ };
138
+ const toggle = (decisionId)=>{
139
+ const next = new Set(expanded);
140
+ const folds = next.delete(decisionId);
141
+ if (!folds) next.add(decisionId);
142
+ setExpanded(next);
143
+ if (folds) onFold?.(decisionId);
144
+ };
145
+ const reveal = (target)=>{
146
+ if (!expanded.has(target.decisionId)) setExpanded(new Set([
147
+ ...expanded,
148
+ target.decisionId
149
+ ]));
150
+ setPending(target);
151
+ setRevealed(target.decisionId);
152
+ if ('navigate' === target.mode.kind && 'read' !== mode.kind) mode.onReveal('rule' === target.kind ? {
153
+ kind: 'rule',
154
+ decisionId: target.decisionId,
155
+ rowId: target.rowId
156
+ } : {
157
+ kind: 'decision',
158
+ decisionId: target.decisionId
159
+ });
160
+ };
161
+ const bodyContext = {
162
+ revealDecision: (decisionId, byKey)=>{
163
+ if (!drawn.has(decisionId)) return void onOpenDecision?.(decisionId);
164
+ reveal({
165
+ kind: 'decision',
166
+ decisionId,
167
+ mode: {
168
+ kind: 'navigate',
169
+ focus: byKey,
170
+ flash: true
171
+ }
172
+ });
173
+ }
174
+ };
175
+ const openOf = (decisionId)=>onOpenDecision && (()=>onOpenDecision(decisionId));
176
+ const actions = (0, external_useDecisionGraphActions_cjs_namespaceObject.useDecisionGraphActions)({
177
+ mode,
178
+ nodes,
179
+ labels,
180
+ openOf,
181
+ cardOf: (decisionId)=>cardsRef.current.get(decisionId),
182
+ scroller,
183
+ announce,
184
+ dataTestId
37
185
  });
186
+ const cardRefsRef = (0, external_react_namespaceObject.useRef)(new Map());
187
+ const cardRef = (0, external_react_namespaceObject.useCallback)((decisionId)=>{
188
+ const cached = cardRefsRef.current.get(decisionId);
189
+ if (cached) return cached;
190
+ const attach = (element)=>{
191
+ const observers = observersRef.current;
192
+ const previous = cardsRef.current.get(decisionId);
193
+ if (previous && previous !== element) {
194
+ observers?.near.unobserve(previous);
195
+ observers?.size?.unobserve(previous);
196
+ }
197
+ if (!element) return void cardsRef.current.delete(decisionId);
198
+ cardsRef.current.set(decisionId, element);
199
+ observers?.near.observe(element);
200
+ observers?.size?.observe(element);
201
+ };
202
+ cardRefsRef.current.set(decisionId, attach);
203
+ return attach;
204
+ }, []);
205
+ (0, external_react_namespaceObject.useLayoutEffect)(()=>{
206
+ if (!scroller || "u" < typeof IntersectionObserver) return;
207
+ const remember = (card)=>{
208
+ if (!(card instanceof HTMLElement)) return;
209
+ const decisionId = card.dataset.decisionId;
210
+ const height = bodyHeightOf(card);
211
+ if (void 0 !== decisionId && null !== height) heightsRef.current.set(decisionId, height);
212
+ };
213
+ const nearObserver = new IntersectionObserver((entries)=>{
214
+ for (const { target } of entries)remember(target);
215
+ setNear((current)=>nearAfter(current ?? NO_EXPANDED, entries));
216
+ }, {
217
+ root: scroller,
218
+ rootMargin: NEAR_MARGIN
219
+ });
220
+ const sizeObserver = "u" < typeof ResizeObserver ? null : new ResizeObserver((entries)=>{
221
+ for (const { target } of entries)remember(target);
222
+ });
223
+ observersRef.current = {
224
+ near: nearObserver,
225
+ size: sizeObserver
226
+ };
227
+ for (const card of cardsRef.current.values()){
228
+ nearObserver.observe(card);
229
+ sizeObserver?.observe(card);
230
+ }
231
+ return ()=>{
232
+ nearObserver.disconnect();
233
+ sizeObserver?.disconnect();
234
+ observersRef.current = null;
235
+ };
236
+ }, [
237
+ scroller
238
+ ]);
239
+ const perRuleHeight = perRuleHeightOf(heightsRef.current, ruleCounts);
240
+ const bodyOf = (decisionId, scrollContainer)=>{
241
+ const mounted = null === near || near.has(decisionId) || decisionId === selected || decisionId === revealed || decisionId === focused;
242
+ if (mounted) return renderBody(decisionId, {
243
+ container: scrollContainer
244
+ }, bodyContext);
245
+ const height = heightsRef.current.get(decisionId) ?? Math.max(1, ruleCounts.get(decisionId) ?? 1) * perRuleHeight;
246
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
247
+ "aria-hidden": true,
248
+ "data-graph-placeholder": true,
249
+ style: {
250
+ height
251
+ }
252
+ });
253
+ };
254
+ const onFocus = (event)=>{
255
+ const card = event.target instanceof Element ? event.target.closest('[data-graph-card]') : null;
256
+ const decisionId = card instanceof HTMLElement ? card.dataset.decisionId : void 0;
257
+ if (void 0 !== decisionId) setFocused(decisionId);
258
+ };
259
+ (0, external_react_namespaceObject.useLayoutEffect)(()=>{
260
+ if (!pending) return;
261
+ const apply = ()=>{
262
+ const card = cardsRef.current.get(pending.decisionId);
263
+ if (!scroller || !card) return false;
264
+ if ('decision' === pending.kind) {
265
+ const heading = card.querySelector('[data-graph-toggle]');
266
+ if ('navigate' === pending.mode.kind) (0, external_revealIn_cjs_namespaceObject.revealIn)(scroller, {
267
+ vertical: card,
268
+ horizontal: heading ?? card,
269
+ block: 'start'
270
+ });
271
+ if (focuses(pending.mode)) heading?.focus({
272
+ preventScroll: true
273
+ });
274
+ if (flashes(pending.mode)) flash(card);
275
+ return true;
276
+ }
277
+ const rule = card.querySelector(`li[data-row-id="${CSS.escape(pending.rowId)}"]`);
278
+ if (!rule) return false;
279
+ if ('navigate' === pending.mode.kind) (0, external_revealIn_cjs_namespaceObject.revealIn)(scroller, {
280
+ vertical: rule,
281
+ horizontal: rule,
282
+ block: 'center'
283
+ });
284
+ if (focuses(pending.mode)) {
285
+ if (!rule.hasAttribute('tabindex')) rule.tabIndex = -1;
286
+ rule.focus({
287
+ preventScroll: true
288
+ });
289
+ }
290
+ if (flashes(pending.mode)) flash(rule);
291
+ return true;
292
+ };
293
+ if (apply()) return void setPending(null);
294
+ const frame = requestAnimationFrame(()=>{
295
+ const card = cardsRef.current.get(pending.decisionId);
296
+ if (!apply() && flashes(pending.mode) && card) flash(card);
297
+ setPending(null);
298
+ });
299
+ return ()=>cancelAnimationFrame(frame);
300
+ });
301
+ const branch = (node, depth, position)=>{
302
+ if ('reference' === node.kind) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DecisionGraphCard_cjs_namespaceObject.DecisionGraphReference, {
303
+ node: node,
304
+ labels: labels,
305
+ actions: actions.referenceOf(node, position),
306
+ onReveal: ()=>reveal({
307
+ kind: 'decision',
308
+ decisionId: node.targetId,
309
+ mode: {
310
+ kind: 'navigate',
311
+ focus: false,
312
+ flash: false
313
+ }
314
+ }),
315
+ onOpen: openOf(node.targetId),
316
+ dataTestId: dataTestId
317
+ });
318
+ const open = expanded.has(node.id);
319
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
320
+ children: [
321
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DecisionGraphCard_cjs_namespaceObject.DecisionGraphCard, {
322
+ node: node,
323
+ depth: depth,
324
+ open: open,
325
+ active: selected === node.id,
326
+ usedBy: (users.get(node.id) ?? []).map((user)=>user.label),
327
+ bodyId: `${idPrefix}-${encodeURIComponent(node.id)}`,
328
+ body: open && scroller ? bodyOf(node.id, scroller) : null,
329
+ labels: labels,
330
+ onToggle: ()=>toggle(node.id),
331
+ onShowProblem: (byKey)=>reveal({
332
+ ...markTargetOf(node),
333
+ mode: byKey ? {
334
+ kind: 'navigate',
335
+ focus: true,
336
+ flash: true
337
+ } : {
338
+ kind: 'inPlace'
339
+ }
340
+ }),
341
+ onOpen: openOf(node.id),
342
+ actions: actions.cardOf(node, position),
343
+ cardRef: cardRef(node.id),
344
+ dataTestId: dataTestId
345
+ }),
346
+ node.children.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
347
+ className: external_decisionGraphStyles_cjs_namespaceObject.GRAPH_NEST_CLASS,
348
+ "data-graph-nest-of": node.id,
349
+ children: (0, external_decisionGraphPositions_cjs_namespaceObject.childPositionsOf)(node, position).map((childPosition)=>{
350
+ const child = node.children[childPosition.index];
351
+ return child && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
352
+ className: external_decisionGraphStyles_cjs_namespaceObject.GRAPH_BRANCH_CLASS,
353
+ children: branch(child, depth + 1, childPosition)
354
+ }, child.id);
355
+ })
356
+ })
357
+ ]
358
+ });
359
+ };
360
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
361
+ className: (0, apollo_wind_namespaceObject.cn)(external_decisionGraphStyles_cjs_namespaceObject.GRAPH_FRAME_CLASS, external_decisionGraphStyles_cjs_namespaceObject.GRAPH_OUTPUT_HUE_CLASS),
362
+ "data-testid": dataTestId,
363
+ ...actions.focusWithin,
364
+ children: [
365
+ nodes.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DecisionGraphMinimapSlot_cjs_namespaceObject.DecisionGraphMinimapSlot, {
366
+ nodes: nodes,
367
+ rules: rules,
368
+ selected: selected,
369
+ onPick: (target)=>reveal({
370
+ ...target,
371
+ mode: {
372
+ kind: 'navigate',
373
+ focus: true,
374
+ flash: true
375
+ }
376
+ }),
377
+ onLauncherEnd: setLauncherEnd,
378
+ labels: labels,
379
+ dataTestId: `${dataTestId}-minimap`
380
+ }),
381
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("section", {
382
+ ref: setScroller,
383
+ "aria-label": labels.graph,
384
+ className: external_decisionGraphStyles_cjs_namespaceObject.GRAPH_SCROLLER_CLASS,
385
+ style: {
386
+ scrollPaddingInlineStart: launcherEnd + external_decisionGraphStyles_cjs_namespaceObject.GRAPH_MINIMAP_GAP_PX
387
+ },
388
+ "data-testid": `${dataTestId}-scroller`,
389
+ children: [
390
+ 0 === nodes.length && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
391
+ className: external_decisionGraphStyles_cjs_namespaceObject.GRAPH_EMPTY_CLASS,
392
+ "data-testid": `${dataTestId}-empty`,
393
+ children: labels.empty
394
+ }),
395
+ (nodes.length > 0 || actions.addTop) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
396
+ className: external_decisionGraphStyles_cjs_namespaceObject.GRAPH_COLUMN_CLASS,
397
+ style: {
398
+ paddingLeft: (0, external_decisionGraphStyles_cjs_namespaceObject.graphColumnInsetOf)(launcherEnd)
399
+ },
400
+ onFocus: onFocus,
401
+ children: [
402
+ (0, external_decisionGraphPositions_cjs_namespaceObject.topPositionsOf)(nodes).map((position)=>{
403
+ const node = nodes[position.index];
404
+ return node && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
405
+ children: branch(node, 0, position)
406
+ }, node.id);
407
+ }),
408
+ actions.addTop && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("button", {
409
+ type: "button",
410
+ className: external_decisionGraphStyles_cjs_namespaceObject.GRAPH_ADD_DECISION_CLASS,
411
+ onClick: actions.addTop,
412
+ "data-graph-add": true,
413
+ "data-testid": `${dataTestId}-add-decision`,
414
+ children: [
415
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Plus, {
416
+ "aria-hidden": true
417
+ }),
418
+ labels.addDecision
419
+ ]
420
+ })
421
+ ]
422
+ })
423
+ ]
424
+ }),
425
+ actions.dialogs,
426
+ region
427
+ ]
428
+ });
429
+ };
38
430
  exports.DecisionGraphText = __webpack_exports__.DecisionGraphText;
39
431
  for(var __rspack_i in __webpack_exports__)if (-1 === [
40
432
  "DecisionGraphText"
@@ -1,7 +1,17 @@
1
1
  import type React from 'react';
2
- import { type DecisionGraphViewProps } from './DecisionGraphView';
3
- export type DecisionGraphTextProps = Omit<DecisionGraphViewProps<never, never>, 'mode' | 'dataTestId'> & {
4
- dataTestId: DecisionGraphViewProps<never, never>['dataTestId'];
5
- };
6
- export declare const DecisionGraphText: React.FC<DecisionGraphTextProps>;
2
+ import { type DecisionGraphMinimapSlotProps } from './DecisionGraphMinimapSlot';
3
+ import type { DecisionGraphMode } from './decisionGraphActionTypes';
4
+ import type { DecisionGraphBodyContext, DecisionGraphExpansion, DecisionGraphNode } from './decisionGraphTypes';
5
+ import type { DecisionTextScroll } from './useRuleWindow';
6
+ export interface DecisionGraphTextProps<Refusal, Logic> {
7
+ nodes: readonly DecisionGraphNode[];
8
+ mode: DecisionGraphMode<Refusal, Logic>;
9
+ renderBody: (decisionId: string, scroll: Exclude<DecisionTextScroll, 'self'>, context: DecisionGraphBodyContext) => React.ReactNode;
10
+ onFold?: (decisionId: string) => void;
11
+ expansion?: DecisionGraphExpansion;
12
+ onOpenDecision?: (decisionId: string) => void;
13
+ rules?: DecisionGraphMinimapSlotProps['rules'];
14
+ dataTestId: string;
15
+ }
16
+ export declare const DecisionGraphText: <Refusal, Logic>({ nodes, mode, renderBody, expansion, onFold, onOpenDecision, rules, dataTestId, }: DecisionGraphTextProps<Refusal, Logic>) => React.ReactElement;
7
17
  //# sourceMappingURL=DecisionGraphText.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DecisionGraphText.d.ts","sourceRoot":"","sources":["../../src/decision-table/DecisionGraphText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGrF,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,sBAAsB,CAAC,KAAK,EAAE,KAAK,CAAC,EACpC,MAAM,GAAG,YAAY,CACtB,GAAG;IAEF,UAAU,EAAE,sBAAsB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC;CAChE,CAAC;AAKF,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAE9D,CAAC"}
1
+ {"version":3,"file":"DecisionGraphText.d.ts","sourceRoot":"","sources":["../../src/decision-table/DecisionGraphText.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;AAoBpE,OAAO,KAAK,EACV,wBAAwB,EAExB,sBAAsB,EACtB,iBAAiB,EAElB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,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,CACV,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,EAC3C,OAAO,EAAE,wBAAwB,KAC9B,KAAK,CAAC,SAAS,CAAC;IAErB,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAEtC,SAAS,CAAC,EAAE,sBAAsB,CAAC;IAEnC,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAE9C,KAAK,CAAC,EAAE,6BAA6B,CAAC,OAAO,CAAC,CAAC;IAE/C,UAAU,EAAE,MAAM,CAAC;CACpB;AAsFD,eAAO,MAAM,iBAAiB,GAAI,OAAO,EAAE,KAAK,EAAE,oFAS/C,sBAAsB,CAAC,OAAO,EAAE,KAAK,CAAC,KAAG,KAAK,CAAC,YA0TjD,CAAC"}