@uipath/apollo-react 7.30.1 → 7.31.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 (113) hide show
  1. package/dist/canvas/styles/tailwind.canvas.css +1 -1
  2. package/dist/chat/styles/tailwind.chat.css +1 -1
  3. package/dist/decision-table/DecisionGraphCard.cjs +112 -9
  4. package/dist/decision-table/DecisionGraphCard.d.ts +21 -0
  5. package/dist/decision-table/DecisionGraphCard.d.ts.map +1 -1
  6. package/dist/decision-table/DecisionGraphCard.js +115 -12
  7. package/dist/decision-table/DecisionGraphDialogs.cjs +223 -0
  8. package/dist/decision-table/DecisionGraphDialogs.d.ts +30 -0
  9. package/dist/decision-table/DecisionGraphDialogs.d.ts.map +1 -0
  10. package/dist/decision-table/DecisionGraphDialogs.js +183 -0
  11. package/dist/decision-table/DecisionGraphText.cjs +6 -338
  12. package/dist/decision-table/DecisionGraphText.d.ts +4 -15
  13. package/dist/decision-table/DecisionGraphText.d.ts.map +1 -1
  14. package/dist/decision-table/DecisionGraphText.js +7 -339
  15. package/dist/decision-table/DecisionGraphView.cjs +409 -0
  16. package/dist/decision-table/DecisionGraphView.d.ts +20 -0
  17. package/dist/decision-table/DecisionGraphView.d.ts.map +1 -0
  18. package/dist/decision-table/DecisionGraphView.js +375 -0
  19. package/dist/decision-table/DecisionTable.cjs +3 -1
  20. package/dist/decision-table/DecisionTable.d.ts.map +1 -1
  21. package/dist/decision-table/DecisionTable.js +3 -1
  22. package/dist/decision-table/EditableDecisionGraphText.cjs +40 -0
  23. package/dist/decision-table/EditableDecisionGraphText.d.ts +5 -0
  24. package/dist/decision-table/EditableDecisionGraphText.d.ts.map +1 -0
  25. package/dist/decision-table/EditableDecisionGraphText.js +6 -0
  26. package/dist/decision-table/GridMenu.cjs +36 -2
  27. package/dist/decision-table/GridMenu.d.ts +8 -0
  28. package/dist/decision-table/GridMenu.d.ts.map +1 -1
  29. package/dist/decision-table/GridMenu.js +33 -2
  30. package/dist/decision-table/__fixtures__/graphActionsHost.d.ts +21 -0
  31. package/dist/decision-table/__fixtures__/graphActionsHost.d.ts.map +1 -0
  32. package/dist/decision-table/constants.cjs +7 -0
  33. package/dist/decision-table/constants.d.ts +1 -0
  34. package/dist/decision-table/constants.d.ts.map +1 -1
  35. package/dist/decision-table/constants.js +5 -1
  36. package/dist/decision-table/decisionGraphActionTypes.cjs +18 -0
  37. package/dist/decision-table/decisionGraphActionTypes.d.ts +88 -0
  38. package/dist/decision-table/decisionGraphActionTypes.d.ts.map +1 -0
  39. package/dist/decision-table/decisionGraphActionTypes.js +0 -0
  40. package/dist/decision-table/decisionGraphMenuEntries.cjs +247 -0
  41. package/dist/decision-table/decisionGraphMenuEntries.d.ts +46 -0
  42. package/dist/decision-table/decisionGraphMenuEntries.d.ts.map +1 -0
  43. package/dist/decision-table/decisionGraphMenuEntries.js +186 -0
  44. package/dist/decision-table/decisionGraphPositions.cjs +136 -0
  45. package/dist/decision-table/decisionGraphPositions.d.ts +26 -0
  46. package/dist/decision-table/decisionGraphPositions.d.ts.map +1 -0
  47. package/dist/decision-table/decisionGraphPositions.js +69 -0
  48. package/dist/decision-table/decisionGraphStyles.cjs +24 -16
  49. package/dist/decision-table/decisionGraphStyles.d.ts +3 -1
  50. package/dist/decision-table/decisionGraphStyles.d.ts.map +1 -1
  51. package/dist/decision-table/decisionGraphStyles.js +4 -2
  52. package/dist/decision-table/index.cjs +62 -54
  53. package/dist/decision-table/index.d.ts +2 -0
  54. package/dist/decision-table/index.d.ts.map +1 -1
  55. package/dist/decision-table/index.js +2 -1
  56. package/dist/decision-table/locales/de.cjs +1 -1
  57. package/dist/decision-table/locales/de.d.ts.map +1 -1
  58. package/dist/decision-table/locales/de.js +1 -1
  59. package/dist/decision-table/locales/en.cjs +1 -1
  60. package/dist/decision-table/locales/en.d.ts.map +1 -1
  61. package/dist/decision-table/locales/en.js +1 -1
  62. package/dist/decision-table/locales/es-MX.cjs +1 -1
  63. package/dist/decision-table/locales/es-MX.d.ts.map +1 -1
  64. package/dist/decision-table/locales/es-MX.js +1 -1
  65. package/dist/decision-table/locales/es.cjs +1 -1
  66. package/dist/decision-table/locales/es.d.ts.map +1 -1
  67. package/dist/decision-table/locales/es.js +1 -1
  68. package/dist/decision-table/locales/fr.cjs +1 -1
  69. package/dist/decision-table/locales/fr.d.ts.map +1 -1
  70. package/dist/decision-table/locales/fr.js +1 -1
  71. package/dist/decision-table/locales/ja.cjs +1 -1
  72. package/dist/decision-table/locales/ja.d.ts.map +1 -1
  73. package/dist/decision-table/locales/ja.js +1 -1
  74. package/dist/decision-table/locales/ko.cjs +1 -1
  75. package/dist/decision-table/locales/ko.d.ts.map +1 -1
  76. package/dist/decision-table/locales/ko.js +1 -1
  77. package/dist/decision-table/locales/pt-BR.cjs +1 -1
  78. package/dist/decision-table/locales/pt-BR.d.ts.map +1 -1
  79. package/dist/decision-table/locales/pt-BR.js +1 -1
  80. package/dist/decision-table/locales/pt.cjs +1 -1
  81. package/dist/decision-table/locales/pt.d.ts.map +1 -1
  82. package/dist/decision-table/locales/pt.js +1 -1
  83. package/dist/decision-table/locales/ro.cjs +1 -1
  84. package/dist/decision-table/locales/ro.d.ts.map +1 -1
  85. package/dist/decision-table/locales/ro.js +1 -1
  86. package/dist/decision-table/locales/ru.cjs +1 -1
  87. package/dist/decision-table/locales/ru.d.ts.map +1 -1
  88. package/dist/decision-table/locales/ru.js +1 -1
  89. package/dist/decision-table/locales/tr.cjs +1 -1
  90. package/dist/decision-table/locales/tr.d.ts.map +1 -1
  91. package/dist/decision-table/locales/tr.js +1 -1
  92. package/dist/decision-table/locales/zh-CN.cjs +1 -1
  93. package/dist/decision-table/locales/zh-CN.d.ts.map +1 -1
  94. package/dist/decision-table/locales/zh-CN.js +1 -1
  95. package/dist/decision-table/locales/zh-TW.cjs +1 -1
  96. package/dist/decision-table/locales/zh-TW.d.ts.map +1 -1
  97. package/dist/decision-table/locales/zh-TW.js +1 -1
  98. package/dist/decision-table/styles/tailwind.decision-table.css +1 -1
  99. package/dist/decision-table/useDecisionGraphActions.cjs +385 -0
  100. package/dist/decision-table/useDecisionGraphActions.d.ts +24 -0
  101. package/dist/decision-table/useDecisionGraphActions.d.ts.map +1 -0
  102. package/dist/decision-table/useDecisionGraphActions.js +351 -0
  103. package/dist/decision-table/useDecisionGraphStrings.cjs +138 -0
  104. package/dist/decision-table/useDecisionGraphStrings.d.ts +2 -1
  105. package/dist/decision-table/useDecisionGraphStrings.d.ts.map +1 -1
  106. package/dist/decision-table/useDecisionGraphStrings.js +138 -0
  107. package/dist/decision-table/useDragReorder.cjs +3 -2
  108. package/dist/decision-table/useDragReorder.d.ts.map +1 -1
  109. package/dist/decision-table/useDragReorder.js +3 -2
  110. package/dist/decision-table/useRuleWindow.cjs +3 -7
  111. package/dist/decision-table/useRuleWindow.d.ts.map +1 -1
  112. package/dist/decision-table/useRuleWindow.js +1 -5
  113. package/package.json +3 -3
@@ -0,0 +1,409 @@
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
+ });
@@ -0,0 +1,20 @@
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
@@ -0,0 +1 @@
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"}