@uipath/apollo-react 7.33.0 → 7.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/chat/styles/tailwind.chat.css +1 -1
- package/dist/decision-table/DecisionGraphView.cjs +35 -9
- package/dist/decision-table/DecisionGraphView.d.ts +4 -5
- package/dist/decision-table/DecisionGraphView.d.ts.map +1 -1
- package/dist/decision-table/DecisionGraphView.js +37 -11
- package/dist/decision-table/DecisionText.cjs +12 -2
- package/dist/decision-table/DecisionText.d.ts.map +1 -1
- package/dist/decision-table/DecisionText.js +12 -2
- package/dist/decision-table/decisionGraphTypes.d.ts +3 -0
- package/dist/decision-table/decisionGraphTypes.d.ts.map +1 -1
- package/dist/decision-table/index.d.ts +1 -1
- package/dist/decision-table/index.d.ts.map +1 -1
- 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 +7 -5
- package/dist/decision-table/useContainerHandlers.d.ts +3 -2
- package/dist/decision-table/useContainerHandlers.d.ts.map +1 -1
- package/dist/decision-table/useContainerHandlers.js +8 -6
- 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/dist/material/components/ap-model-picker/ModelPicker.cjs +101 -6
- package/dist/material/components/ap-model-picker/ModelPicker.d.ts +8 -0
- package/dist/material/components/ap-model-picker/ModelPicker.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/ModelPicker.js +101 -6
- package/dist/material/components/ap-model-picker/communityByoApi.cjs +946 -0
- package/dist/material/components/ap-model-picker/communityByoApi.d.ts +20 -0
- package/dist/material/components/ap-model-picker/communityByoApi.d.ts.map +1 -0
- package/dist/material/components/ap-model-picker/communityByoApi.js +909 -0
- package/dist/material/components/ap-model-picker/communityByoLabels.cjs +387 -0
- package/dist/material/components/ap-model-picker/communityByoLabels.d.ts +5 -0
- package/dist/material/components/ap-model-picker/communityByoLabels.d.ts.map +1 -0
- package/dist/material/components/ap-model-picker/communityByoLabels.js +350 -0
- package/dist/material/components/ap-model-picker/index.cjs +8 -1
- package/dist/material/components/ap-model-picker/index.d.ts +3 -1
- package/dist/material/components/ap-model-picker/index.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/index.js +2 -1
- package/dist/material/components/ap-model-picker/locales/de.cjs +1 -1
- package/dist/material/components/ap-model-picker/locales/de.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/locales/de.js +1 -1
- package/dist/material/components/ap-model-picker/locales/en.cjs +1 -1
- package/dist/material/components/ap-model-picker/locales/en.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/locales/en.js +1 -1
- package/dist/material/components/ap-model-picker/locales/es-MX.cjs +1 -1
- package/dist/material/components/ap-model-picker/locales/es-MX.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/locales/es-MX.js +1 -1
- package/dist/material/components/ap-model-picker/locales/es.cjs +1 -1
- package/dist/material/components/ap-model-picker/locales/es.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/locales/es.js +1 -1
- package/dist/material/components/ap-model-picker/locales/fr.cjs +1 -1
- package/dist/material/components/ap-model-picker/locales/fr.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/locales/fr.js +1 -1
- package/dist/material/components/ap-model-picker/locales/ja.cjs +1 -1
- package/dist/material/components/ap-model-picker/locales/ja.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/locales/ja.js +1 -1
- package/dist/material/components/ap-model-picker/locales/ko.cjs +1 -1
- package/dist/material/components/ap-model-picker/locales/ko.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/locales/ko.js +1 -1
- package/dist/material/components/ap-model-picker/locales/pt-BR.cjs +1 -1
- package/dist/material/components/ap-model-picker/locales/pt-BR.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/locales/pt-BR.js +1 -1
- package/dist/material/components/ap-model-picker/locales/pt.cjs +1 -1
- package/dist/material/components/ap-model-picker/locales/pt.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/locales/pt.js +1 -1
- package/dist/material/components/ap-model-picker/locales/ro.cjs +1 -1
- package/dist/material/components/ap-model-picker/locales/ro.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/locales/ro.js +1 -1
- package/dist/material/components/ap-model-picker/locales/ru.cjs +1 -1
- package/dist/material/components/ap-model-picker/locales/ru.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/locales/ru.js +1 -1
- package/dist/material/components/ap-model-picker/locales/tr.cjs +1 -1
- package/dist/material/components/ap-model-picker/locales/tr.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/locales/tr.js +1 -1
- package/dist/material/components/ap-model-picker/locales/zh-CN.cjs +1 -1
- package/dist/material/components/ap-model-picker/locales/zh-CN.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/locales/zh-CN.js +1 -1
- package/dist/material/components/ap-model-picker/locales/zh-TW.cjs +1 -1
- package/dist/material/components/ap-model-picker/locales/zh-TW.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/locales/zh-TW.js +1 -1
- package/dist/material/components/ap-model-picker/usePlatformAccess.cjs +10 -4
- package/dist/material/components/ap-model-picker/usePlatformAccess.d.ts +2 -0
- package/dist/material/components/ap-model-picker/usePlatformAccess.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/usePlatformAccess.js +1 -1
- package/package.json +3 -3
|
@@ -31,7 +31,7 @@ const external_gridEvents_cjs_namespaceObject = require("./gridEvents.cjs");
|
|
|
31
31
|
const external_sentenceTargets_cjs_namespaceObject = require("./sentenceTargets.cjs");
|
|
32
32
|
const external_useSentenceNavigation_cjs_namespaceObject = require("./useSentenceNavigation.cjs");
|
|
33
33
|
const isTabOnView = (event)=>'Tab' === event.key && !event.shiftKey && event.target === event.currentTarget;
|
|
34
|
-
const useContainerHandlers = ({ containerProps, hoverTo, navigation, valueEditing, ruleMenus, onOpenDecision, container, stopTabbable })=>{
|
|
34
|
+
const useContainerHandlers = ({ containerProps, hoverTo, navigation, valueEditing, ruleMenus, onOpenDecision, container, stopTabbable, focusRow })=>{
|
|
35
35
|
const focusWithinRef = (0, external_react_namespaceObject.useRef)(false);
|
|
36
36
|
const pressedRef = (0, external_react_namespaceObject.useRef)(false);
|
|
37
37
|
const stopPressRef = (0, external_react_namespaceObject.useRef)(null);
|
|
@@ -66,13 +66,13 @@ const useContainerHandlers = ({ containerProps, hoverTo, navigation, valueEditin
|
|
|
66
66
|
if (!event.currentTarget.contains(to)) hoverTo(null);
|
|
67
67
|
consumerPointerOut?.(event);
|
|
68
68
|
};
|
|
69
|
-
const openDecision = (event, decisionId)=>{
|
|
69
|
+
const openDecision = (event, decisionId, byKey)=>{
|
|
70
70
|
if (!onOpenDecision || void 0 === decisionId) return false;
|
|
71
71
|
event.preventDefault();
|
|
72
|
-
onOpenDecision(decisionId);
|
|
72
|
+
onOpenDecision(decisionId, byKey);
|
|
73
73
|
return true;
|
|
74
74
|
};
|
|
75
|
-
const openStopDecision = (event)=>'Enter' === event.key && event.altKey && !(0, external_useSentenceNavigation_cjs_namespaceObject.isIgnoredKey)(event) && openDecision(event, (0, external_sentenceTargets_cjs_namespaceObject.stopDecisionOf)(event.target));
|
|
75
|
+
const openStopDecision = (event)=>'Enter' === event.key && event.altKey && !(0, external_useSentenceNavigation_cjs_namespaceObject.isIgnoredKey)(event) && openDecision(event, (0, external_sentenceTargets_cjs_namespaceObject.stopDecisionOf)(event.target), true);
|
|
76
76
|
const onKeyDown = (event)=>{
|
|
77
77
|
if (stopTabbable && isTabOnView(event)) {
|
|
78
78
|
event.preventDefault();
|
|
@@ -84,6 +84,7 @@ const useContainerHandlers = ({ containerProps, hoverTo, navigation, valueEditin
|
|
|
84
84
|
const entered = !focusWithinRef.current && event.target === event.currentTarget;
|
|
85
85
|
focusWithinRef.current = true;
|
|
86
86
|
setFocusInside(true);
|
|
87
|
+
focusRow((0, external_sentenceTargets_cjs_namespaceObject.rowIdOf)(event.target));
|
|
87
88
|
if (entered && stopTabbable && !pressedRef.current) navigation.refocus();
|
|
88
89
|
consumerFocus?.(event);
|
|
89
90
|
};
|
|
@@ -92,11 +93,12 @@ const useContainerHandlers = ({ containerProps, hoverTo, navigation, valueEditin
|
|
|
92
93
|
focusWithinRef.current = false;
|
|
93
94
|
endPress();
|
|
94
95
|
setFocusInside(false);
|
|
96
|
+
focusRow(void 0);
|
|
95
97
|
}
|
|
96
98
|
consumerBlur?.(event);
|
|
97
99
|
};
|
|
98
100
|
const onClick = (event)=>{
|
|
99
|
-
const claimed = openDecision(event, (0, external_sentenceTargets_cjs_namespaceObject.clickedDecision)(event.target)) || ruleMenus.onClick(event) || valueEditing.onClick(event);
|
|
101
|
+
const claimed = openDecision(event, (0, external_sentenceTargets_cjs_namespaceObject.clickedDecision)(event.target), 0 === event.detail) || ruleMenus.onClick(event) || valueEditing.onClick(event);
|
|
100
102
|
const selection = claimed ? null : (0, external_sentenceTargets_cjs_namespaceObject.clickedSelection)(event.target);
|
|
101
103
|
if (selection) navigation.select(selection, void 0, false);
|
|
102
104
|
consumerClick?.(event);
|
|
@@ -11,11 +11,12 @@ export interface ContainerHandlersParams {
|
|
|
11
11
|
navigation: SentenceNavigation;
|
|
12
12
|
valueEditing: ValueEditing;
|
|
13
13
|
ruleMenus: RuleMenus;
|
|
14
|
-
onOpenDecision: ((decisionId: string) => void) | undefined;
|
|
14
|
+
onOpenDecision: ((decisionId: string, byKey: boolean) => void) | undefined;
|
|
15
15
|
container: RuleWindow['container'];
|
|
16
16
|
stopTabbable: boolean;
|
|
17
|
+
focusRow: (rowId: string | undefined) => void;
|
|
17
18
|
}
|
|
18
|
-
export declare const useContainerHandlers: ({ containerProps, hoverTo, navigation, valueEditing, ruleMenus, onOpenDecision, container, stopTabbable, }: ContainerHandlersParams) => {
|
|
19
|
+
export declare const useContainerHandlers: ({ containerProps, hoverTo, navigation, valueEditing, ruleMenus, onOpenDecision, container, stopTabbable, focusRow, }: ContainerHandlersParams) => {
|
|
19
20
|
tabIndex: number;
|
|
20
21
|
onPointerOver: (event: React.PointerEvent<HTMLElement>) => void;
|
|
21
22
|
onPointerDown: (event: React.PointerEvent<HTMLElement>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContainerHandlers.d.ts","sourceRoot":"","sources":["../../src/decision-table/useContainerHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useContainerHandlers.d.ts","sourceRoot":"","sources":["../../src/decision-table/useContainerHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,E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W,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBtD,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from "react";
|
|
2
2
|
import { hasLostFocus, onNextGesture } from "./gridEvents.js";
|
|
3
|
-
import { clickedDecision, clickedSelection, stopDecisionOf, valueTokenAt } from "./sentenceTargets.js";
|
|
3
|
+
import { clickedDecision, clickedSelection, rowIdOf, stopDecisionOf, valueTokenAt } from "./sentenceTargets.js";
|
|
4
4
|
import { isIgnoredKey } from "./useSentenceNavigation.js";
|
|
5
5
|
const isTabOnView = (event)=>'Tab' === event.key && !event.shiftKey && event.target === event.currentTarget;
|
|
6
|
-
const useContainerHandlers = ({ containerProps, hoverTo, navigation, valueEditing, ruleMenus, onOpenDecision, container, stopTabbable })=>{
|
|
6
|
+
const useContainerHandlers = ({ containerProps, hoverTo, navigation, valueEditing, ruleMenus, onOpenDecision, container, stopTabbable, focusRow })=>{
|
|
7
7
|
const focusWithinRef = useRef(false);
|
|
8
8
|
const pressedRef = useRef(false);
|
|
9
9
|
const stopPressRef = useRef(null);
|
|
@@ -38,13 +38,13 @@ const useContainerHandlers = ({ containerProps, hoverTo, navigation, valueEditin
|
|
|
38
38
|
if (!event.currentTarget.contains(to)) hoverTo(null);
|
|
39
39
|
consumerPointerOut?.(event);
|
|
40
40
|
};
|
|
41
|
-
const openDecision = (event, decisionId)=>{
|
|
41
|
+
const openDecision = (event, decisionId, byKey)=>{
|
|
42
42
|
if (!onOpenDecision || void 0 === decisionId) return false;
|
|
43
43
|
event.preventDefault();
|
|
44
|
-
onOpenDecision(decisionId);
|
|
44
|
+
onOpenDecision(decisionId, byKey);
|
|
45
45
|
return true;
|
|
46
46
|
};
|
|
47
|
-
const openStopDecision = (event)=>'Enter' === event.key && event.altKey && !isIgnoredKey(event) && openDecision(event, stopDecisionOf(event.target));
|
|
47
|
+
const openStopDecision = (event)=>'Enter' === event.key && event.altKey && !isIgnoredKey(event) && openDecision(event, stopDecisionOf(event.target), true);
|
|
48
48
|
const onKeyDown = (event)=>{
|
|
49
49
|
if (stopTabbable && isTabOnView(event)) {
|
|
50
50
|
event.preventDefault();
|
|
@@ -56,6 +56,7 @@ const useContainerHandlers = ({ containerProps, hoverTo, navigation, valueEditin
|
|
|
56
56
|
const entered = !focusWithinRef.current && event.target === event.currentTarget;
|
|
57
57
|
focusWithinRef.current = true;
|
|
58
58
|
setFocusInside(true);
|
|
59
|
+
focusRow(rowIdOf(event.target));
|
|
59
60
|
if (entered && stopTabbable && !pressedRef.current) navigation.refocus();
|
|
60
61
|
consumerFocus?.(event);
|
|
61
62
|
};
|
|
@@ -64,11 +65,12 @@ const useContainerHandlers = ({ containerProps, hoverTo, navigation, valueEditin
|
|
|
64
65
|
focusWithinRef.current = false;
|
|
65
66
|
endPress();
|
|
66
67
|
setFocusInside(false);
|
|
68
|
+
focusRow(void 0);
|
|
67
69
|
}
|
|
68
70
|
consumerBlur?.(event);
|
|
69
71
|
};
|
|
70
72
|
const onClick = (event)=>{
|
|
71
|
-
const claimed = openDecision(event, clickedDecision(event.target)) || ruleMenus.onClick(event) || valueEditing.onClick(event);
|
|
73
|
+
const claimed = openDecision(event, clickedDecision(event.target), 0 === event.detail) || ruleMenus.onClick(event) || valueEditing.onClick(event);
|
|
72
74
|
const selection = claimed ? null : clickedSelection(event.target);
|
|
73
75
|
if (selection) navigation.select(selection, void 0, false);
|
|
74
76
|
consumerClick?.(event);
|
|
@@ -113,14 +113,24 @@ const useGridLayout = ({ columns, rowCount, rowHeightPx, leadingColumnWidth, tra
|
|
|
113
113
|
columns,
|
|
114
114
|
separatorBefore
|
|
115
115
|
]);
|
|
116
|
-
const
|
|
116
|
+
const retainedRows = (0, external_react_namespaceObject.useMemo)(()=>null === retainedRowIndex ? [] : [
|
|
117
|
+
retainedRowIndex
|
|
118
|
+
], [
|
|
119
|
+
retainedRowIndex
|
|
120
|
+
]);
|
|
121
|
+
const retainedColumns = (0, external_react_namespaceObject.useMemo)(()=>null === retainedColumnIndex ? [] : [
|
|
122
|
+
retainedColumnIndex
|
|
123
|
+
], [
|
|
124
|
+
retainedColumnIndex
|
|
125
|
+
]);
|
|
126
|
+
const rowWindow = (0, external_useVirtualizedAxis_cjs_namespaceObject.useVirtualizedAxis)(rowCount, rowHeightPx, retainedRows, {
|
|
117
127
|
axis: 'vertical',
|
|
118
128
|
overscanItems: external_constants_cjs_namespaceObject.DEFAULT_ROW_OVERSCAN,
|
|
119
129
|
fallbackViewportPx: external_constants_cjs_namespaceObject.FALLBACK_ROW_VIEWPORT_PX,
|
|
120
130
|
leadingFixedPx: headerHeight,
|
|
121
131
|
stickyLeadingPx: headerHeight
|
|
122
132
|
});
|
|
123
|
-
const columnWindow = (0, external_useVirtualizedAxis_cjs_namespaceObject.useVirtualizedAxis)(windowedCount, external_constants_cjs_namespaceObject.COLUMN_ESTIMATE_PX,
|
|
133
|
+
const columnWindow = (0, external_useVirtualizedAxis_cjs_namespaceObject.useVirtualizedAxis)(windowedCount, external_constants_cjs_namespaceObject.COLUMN_ESTIMATE_PX, retainedColumns, {
|
|
124
134
|
axis: 'horizontal',
|
|
125
135
|
overscanItems: external_constants_cjs_namespaceObject.DEFAULT_COLUMN_OVERSCAN,
|
|
126
136
|
fallbackViewportPx: external_constants_cjs_namespaceObject.FALLBACK_COLUMN_VIEWPORT_PX,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGridLayout.d.ts","sourceRoot":"","sources":["../../src/decision-table/useGridLayout.ts"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CAAC;AAI3E,UAAU,iBAAiB;IACzB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IAEjB,WAAW,EAAE,MAAM,CAAC;IAEpB,kBAAkB,EAAE,MAAM,CAAC;IAE3B,mBAAmB,EAAE,MAAM,CAAC;IAE5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC;IAErF,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAEhE,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAE5D,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAWD,eAAO,MAAM,oBAAoB,GAAI,SAAS,UAAU,EAAE,EAAE,oBAAe,KAAG,GAAG,CAAC,MAAM,CASvF,CAAC;AA6BF,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AAa1D,eAAO,MAAM,aAAa,GAAI,iMAY3B,iBAAiB;;;;;;;;;;;;wBAyCqB,uBAAuB,GAAG,IAAI;+BA4JzD,cAAc,GAAG,IAAI;;;;kCAbpB,MAAM;wCAIH,MAAM;;;;CAwCvB,CAAC"}
|
|
@@ -84,14 +84,24 @@ const useGridLayout = ({ columns, rowCount, rowHeightPx, leadingColumnWidth, tra
|
|
|
84
84
|
columns,
|
|
85
85
|
separatorBefore
|
|
86
86
|
]);
|
|
87
|
-
const
|
|
87
|
+
const retainedRows = useMemo(()=>null === retainedRowIndex ? [] : [
|
|
88
|
+
retainedRowIndex
|
|
89
|
+
], [
|
|
90
|
+
retainedRowIndex
|
|
91
|
+
]);
|
|
92
|
+
const retainedColumns = useMemo(()=>null === retainedColumnIndex ? [] : [
|
|
93
|
+
retainedColumnIndex
|
|
94
|
+
], [
|
|
95
|
+
retainedColumnIndex
|
|
96
|
+
]);
|
|
97
|
+
const rowWindow = useVirtualizedAxis(rowCount, rowHeightPx, retainedRows, {
|
|
88
98
|
axis: 'vertical',
|
|
89
99
|
overscanItems: DEFAULT_ROW_OVERSCAN,
|
|
90
100
|
fallbackViewportPx: FALLBACK_ROW_VIEWPORT_PX,
|
|
91
101
|
leadingFixedPx: headerHeight,
|
|
92
102
|
stickyLeadingPx: headerHeight
|
|
93
103
|
});
|
|
94
|
-
const columnWindow = useVirtualizedAxis(windowedCount, COLUMN_ESTIMATE_PX,
|
|
104
|
+
const columnWindow = useVirtualizedAxis(windowedCount, COLUMN_ESTIMATE_PX, retainedColumns, {
|
|
95
105
|
axis: 'horizontal',
|
|
96
106
|
overscanItems: DEFAULT_COLUMN_OVERSCAN,
|
|
97
107
|
fallbackViewportPx: FALLBACK_COLUMN_VIEWPORT_PX,
|
|
@@ -81,7 +81,7 @@ const forwardPageScrolls = (document)=>{
|
|
|
81
81
|
};
|
|
82
82
|
const scrollportTopOf = (scroller)=>isPageScroller(scroller) ? 0 : scroller.getBoundingClientRect().top;
|
|
83
83
|
const contentTopIn = (element, scroller)=>element.getBoundingClientRect().top - scrollportTopOf(scroller) - (isPageScroller(scroller) ? 0 : scroller.clientTop) + scroller.scrollTop;
|
|
84
|
-
const useRuleWindow = (rules, selectedRowId,
|
|
84
|
+
const useRuleWindow = (rules, selectedRowId, retainedRowIds, scroll = 'self')=>{
|
|
85
85
|
const named = 'self' === scroll ? void 0 : scroll.container ?? null;
|
|
86
86
|
const listRef = (0, external_react_namespaceObject.useRef)(null);
|
|
87
87
|
const headerRef = (0, external_react_namespaceObject.useRef)(null);
|
|
@@ -106,11 +106,16 @@ const useRuleWindow = (rules, selectedRowId, retainedRowId, scroll = 'self')=>{
|
|
|
106
106
|
rules,
|
|
107
107
|
selectedRowId
|
|
108
108
|
]);
|
|
109
|
-
const
|
|
109
|
+
const retainedRows = (0, external_react_namespaceObject.useMemo)(()=>retainedRowIds.flatMap((rowId)=>{
|
|
110
|
+
const index = rowIndexOf(rules, rowId);
|
|
111
|
+
return null === index ? [] : [
|
|
112
|
+
index
|
|
113
|
+
];
|
|
114
|
+
}), [
|
|
110
115
|
rules,
|
|
111
|
-
|
|
116
|
+
retainedRowIds
|
|
112
117
|
]);
|
|
113
|
-
const { segments, measureRef, scrollItemIntoView } = (0, external_useVirtualizedAxis_cjs_namespaceObject.useVirtualizedAxis)(rules.length, external_sentenceRuleHeights_cjs_namespaceObject.SENTENCE_MIN_RULE_HEIGHT_PX,
|
|
118
|
+
const { segments, measureRef, scrollItemIntoView } = (0, external_useVirtualizedAxis_cjs_namespaceObject.useVirtualizedAxis)(rules.length, external_sentenceRuleHeights_cjs_namespaceObject.SENTENCE_MIN_RULE_HEIGHT_PX, retainedRows, {
|
|
114
119
|
axis: 'vertical',
|
|
115
120
|
overscanItems: SENTENCE_RULE_OVERSCAN,
|
|
116
121
|
fallbackViewportPx: external_constants_cjs_namespaceObject.FALLBACK_ROW_VIEWPORT_PX,
|
|
@@ -17,5 +17,5 @@ export interface RuleWindow {
|
|
|
17
17
|
firstVisibleRow: () => number;
|
|
18
18
|
scrollStopIntoView: (rowIndex: number, stop: HTMLElement) => void;
|
|
19
19
|
}
|
|
20
|
-
export declare const useRuleWindow: (rules: readonly SentenceRule[], selectedRowId: string | undefined,
|
|
20
|
+
export declare const useRuleWindow: (rules: readonly SentenceRule[], selectedRowId: string | undefined, retainedRowIds: readonly (string | undefined)[], scroll?: DecisionTextScroll) => RuleWindow;
|
|
21
21
|
//# sourceMappingURL=useRuleWindow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRuleWindow.d.ts","sourceRoot":"","sources":["../../src/decision-table/useRuleWindow.ts"],"names":[],"mappings":"AA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,CAAC;AACpD,OAAO,EAAE,KAAK,WAAW,EAAsB,MAAM,sBAAsB,CAAC;AAE5E,eAAO,MAAM,sBAAsB,KAAK,CAAC;AA2BzC,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG;IAAE,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CAAE,CAAC;AA6C7E,eAAO,MAAM,YAAY,GAAI,SAAS,WAAW,EAAE,UAAU,WAAW,KAAG,MAIvD,CAAC;AAErB,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAClD,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAClD,QAAQ,EAAE,WAAW,EAAE,CAAC;IAExB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAErD,SAAS,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IAEpC,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAE9C,eAAe,EAAE,MAAM,MAAM,CAAC;IAE9B,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;CACnE;AAGD,eAAO,MAAM,aAAa,GACxB,OAAO,SAAS,YAAY,EAAE,EAC9B,eAAe,MAAM,GAAG,SAAS,EACjC,gBAAgB,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,EAC/C,SAAQ,kBAA2B,KAClC,UAmLF,CAAC"}
|
|
@@ -51,7 +51,7 @@ const forwardPageScrolls = (document)=>{
|
|
|
51
51
|
};
|
|
52
52
|
const scrollportTopOf = (scroller)=>isPageScroller(scroller) ? 0 : scroller.getBoundingClientRect().top;
|
|
53
53
|
const contentTopIn = (element, scroller)=>element.getBoundingClientRect().top - scrollportTopOf(scroller) - (isPageScroller(scroller) ? 0 : scroller.clientTop) + scroller.scrollTop;
|
|
54
|
-
const useRuleWindow = (rules, selectedRowId,
|
|
54
|
+
const useRuleWindow = (rules, selectedRowId, retainedRowIds, scroll = 'self')=>{
|
|
55
55
|
const named = 'self' === scroll ? void 0 : scroll.container ?? null;
|
|
56
56
|
const listRef = useRef(null);
|
|
57
57
|
const headerRef = useRef(null);
|
|
@@ -76,11 +76,16 @@ const useRuleWindow = (rules, selectedRowId, retainedRowId, scroll = 'self')=>{
|
|
|
76
76
|
rules,
|
|
77
77
|
selectedRowId
|
|
78
78
|
]);
|
|
79
|
-
const
|
|
79
|
+
const retainedRows = useMemo(()=>retainedRowIds.flatMap((rowId)=>{
|
|
80
|
+
const index = rowIndexOf(rules, rowId);
|
|
81
|
+
return null === index ? [] : [
|
|
82
|
+
index
|
|
83
|
+
];
|
|
84
|
+
}), [
|
|
80
85
|
rules,
|
|
81
|
-
|
|
86
|
+
retainedRowIds
|
|
82
87
|
]);
|
|
83
|
-
const { segments, measureRef, scrollItemIntoView } = useVirtualizedAxis(rules.length, SENTENCE_MIN_RULE_HEIGHT_PX,
|
|
88
|
+
const { segments, measureRef, scrollItemIntoView } = useVirtualizedAxis(rules.length, SENTENCE_MIN_RULE_HEIGHT_PX, retainedRows, {
|
|
84
89
|
axis: 'vertical',
|
|
85
90
|
overscanItems: SENTENCE_RULE_OVERSCAN,
|
|
86
91
|
fallbackViewportPx: FALLBACK_ROW_VIEWPORT_PX,
|
|
@@ -44,7 +44,6 @@ const textIn = (rules, cell)=>{
|
|
|
44
44
|
const rule = rules.find((candidate)=>candidate.rowId === cell.rowId);
|
|
45
45
|
return rule && ('rule' === cell.kind ? '' : (0, external_sentenceParts_cjs_namespaceObject.cellTextOf)(rule, cell.columnId));
|
|
46
46
|
};
|
|
47
|
-
const rowIdOf = (element)=>element instanceof HTMLElement ? element.closest('li[data-row-id]')?.dataset.rowId : void 0;
|
|
48
47
|
const useValueEditing = ({ edit, rules, bands, selected, onSelect, navigation, labels, container })=>{
|
|
49
48
|
const pendingRef = (0, external_react_namespaceObject.useRef)(null);
|
|
50
49
|
const stopAwaitingRef = (0, external_react_namespaceObject.useRef)(null);
|
|
@@ -142,7 +141,7 @@ const useValueEditing = ({ edit, rules, bands, selected, onSelect, navigation, l
|
|
|
142
141
|
const staysOn = (rowId)=>{
|
|
143
142
|
const view = container();
|
|
144
143
|
const focused = view && (0, external_gridEvents_cjs_namespaceObject.activeElementOf)(view);
|
|
145
|
-
return null !== view && ((0, external_gridEvents_cjs_namespaceObject.hasLostFocus)(view) || focused === view || rowIdOf(focused) === rowId);
|
|
144
|
+
return null !== view && ((0, external_gridEvents_cjs_namespaceObject.hasLostFocus)(view) || focused === view || (0, external_sentenceTargets_cjs_namespaceObject.rowIdOf)(focused) === rowId);
|
|
146
145
|
};
|
|
147
146
|
(0, external_react_namespaceObject.useLayoutEffect)(()=>{
|
|
148
147
|
const refocus = refocusRef.current;
|
|
@@ -1 +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,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
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,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAoBtD,OAAO,KAAK,EACV,YAAY,EAEZ,YAAY,EACZ,iBAAiB,EACjB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AACz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umnNameOf, bandColumnOf, cellTextOf, columnNameOf, hasStop, isOutcome, tokenText, valueTokenOf } from "./sentenceParts.js";
|
|
4
4
|
import { cellSelection, ruleSelection, selectedColumnOf } from "./sentenceSelection.js";
|
|
5
|
-
import { addConditionOf, clickedAction, clickedDecision, clickedValue } from "./sentenceTargets.js";
|
|
5
|
+
import { addConditionOf, clickedAction, clickedDecision, clickedValue, rowIdOf } from "./sentenceTargets.js";
|
|
6
6
|
import { isIgnoredKey } from "./useSentenceNavigation.js";
|
|
7
7
|
const isStartKey = (event)=>'Enter' === event.key || 'F2' === event.key || ' ' === event.key && void 0 === clickedDecision(event.target);
|
|
8
8
|
const isClearKey = (event)=>'Delete' === event.key || 'Backspace' === event.key;
|
|
@@ -15,7 +15,6 @@ const textIn = (rules, cell)=>{
|
|
|
15
15
|
const rule = rules.find((candidate)=>candidate.rowId === cell.rowId);
|
|
16
16
|
return rule && ('rule' === cell.kind ? '' : cellTextOf(rule, cell.columnId));
|
|
17
17
|
};
|
|
18
|
-
const rowIdOf = (element)=>element instanceof HTMLElement ? element.closest('li[data-row-id]')?.dataset.rowId : void 0;
|
|
19
18
|
const useValueEditing = ({ edit, rules, bands, selected, onSelect, navigation, labels, container })=>{
|
|
20
19
|
const pendingRef = useRef(null);
|
|
21
20
|
const stopAwaitingRef = useRef(null);
|
|
@@ -33,20 +33,23 @@ const windowSegments = ({ itemCount, itemSizePx, start, end, retained, offsetsPx
|
|
|
33
33
|
const sizeBetween = (from, to)=>offsetsPx ? offsetsPx[to] - offsetsPx[from] : (to - from) * itemSizePx;
|
|
34
34
|
const safeStart = Math.min(Math.max(0, start), itemCount);
|
|
35
35
|
const safeEnd = Math.min(Math.max(safeStart, end), itemCount);
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
const outside = [
|
|
37
|
+
...new Set(retained)
|
|
38
|
+
].filter((index)=>index >= 0 && index < itemCount && (index < safeStart || index >= safeEnd)).sort((left, right)=>left - right);
|
|
39
|
+
const single = (index)=>({
|
|
40
|
+
from: index,
|
|
41
|
+
to: index + 1
|
|
42
|
+
});
|
|
43
|
+
const runs = [
|
|
44
|
+
...outside.filter((index)=>index < safeStart).map(single),
|
|
45
|
+
...safeStart < safeEnd ? [
|
|
46
|
+
{
|
|
47
|
+
from: safeStart,
|
|
48
|
+
to: safeEnd
|
|
49
|
+
}
|
|
50
|
+
] : [],
|
|
51
|
+
...outside.filter((index)=>index >= safeEnd).map(single)
|
|
52
|
+
];
|
|
50
53
|
const segments = [];
|
|
51
54
|
let cursor = 0;
|
|
52
55
|
for (const run of runs){
|
|
@@ -11,7 +11,7 @@ interface WindowSegmentsInput {
|
|
|
11
11
|
itemSizePx: number;
|
|
12
12
|
start: number;
|
|
13
13
|
end: number;
|
|
14
|
-
retained: number
|
|
14
|
+
retained: readonly number[];
|
|
15
15
|
offsetsPx?: number[];
|
|
16
16
|
}
|
|
17
17
|
export declare const windowSegments: ({ itemCount, itemSizePx, start, end, retained, offsetsPx, }: WindowSegmentsInput) => AxisSegment[];
|
|
@@ -29,6 +29,6 @@ interface VirtualizedAxis {
|
|
|
29
29
|
measureRef: (element: HTMLElement | null) => void;
|
|
30
30
|
scrollItemIntoView: (container: HTMLElement | null, index: number) => void;
|
|
31
31
|
}
|
|
32
|
-
export declare const useVirtualizedAxis: (itemCount: number, itemSizePx: number, retained: number
|
|
32
|
+
export declare const useVirtualizedAxis: (itemCount: number, itemSizePx: number, retained: readonly number[], options: VirtualizedAxisOptions) => VirtualizedAxis;
|
|
33
33
|
export {};
|
|
34
34
|
//# sourceMappingURL=useVirtualizedAxis.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVirtualizedAxis.d.ts","sourceRoot":"","sources":["../../src/decision-table/useVirtualizedAxis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MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC;IAM1C,gBAAgB,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC;IAO3C,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,UAAU,eAAe;IACvB,QAAQ,EAAE,WAAW,EAAE,CAAC;IAExB,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAElD,kBAAkB,EAAE,CAAC,SAAS,EAAE,WAAW,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5E;AAgBD,eAAO,MAAM,kBAAkB,GAC7B,WAAW,MAAM,EACjB,YAAY,MAAM,EAClB,UAAU,SAAS,MAAM,EAAE,EAC3B,SAAS,sBAAsB,KAC9B,eA6SF,CAAC"}
|
|
@@ -4,20 +4,23 @@ const windowSegments = ({ itemCount, itemSizePx, start, end, retained, offsetsPx
|
|
|
4
4
|
const sizeBetween = (from, to)=>offsetsPx ? offsetsPx[to] - offsetsPx[from] : (to - from) * itemSizePx;
|
|
5
5
|
const safeStart = Math.min(Math.max(0, start), itemCount);
|
|
6
6
|
const safeEnd = Math.min(Math.max(safeStart, end), itemCount);
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
const outside = [
|
|
8
|
+
...new Set(retained)
|
|
9
|
+
].filter((index)=>index >= 0 && index < itemCount && (index < safeStart || index >= safeEnd)).sort((left, right)=>left - right);
|
|
10
|
+
const single = (index)=>({
|
|
11
|
+
from: index,
|
|
12
|
+
to: index + 1
|
|
13
|
+
});
|
|
14
|
+
const runs = [
|
|
15
|
+
...outside.filter((index)=>index < safeStart).map(single),
|
|
16
|
+
...safeStart < safeEnd ? [
|
|
17
|
+
{
|
|
18
|
+
from: safeStart,
|
|
19
|
+
to: safeEnd
|
|
20
|
+
}
|
|
21
|
+
] : [],
|
|
22
|
+
...outside.filter((index)=>index >= safeEnd).map(single)
|
|
23
|
+
];
|
|
21
24
|
const segments = [];
|
|
22
25
|
let cursor = 0;
|
|
23
26
|
for (const run of runs){
|
|
@@ -59,9 +59,12 @@ var DialogTitle_default = /*#__PURE__*/ __webpack_require__.n(DialogTitle_namesp
|
|
|
59
59
|
const Typography_namespaceObject = require("@mui/material/Typography");
|
|
60
60
|
var Typography_default = /*#__PURE__*/ __webpack_require__.n(Typography_namespaceObject);
|
|
61
61
|
const apollo_core_namespaceObject = require("@uipath/apollo-core");
|
|
62
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
62
63
|
const external_react_namespaceObject = require("react");
|
|
63
64
|
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
|
|
64
65
|
const index_cjs_namespaceObject = require("../../../i18n/index.cjs");
|
|
66
|
+
const external_communityByoApi_cjs_namespaceObject = require("./communityByoApi.cjs");
|
|
67
|
+
const external_communityByoLabels_cjs_namespaceObject = require("./communityByoLabels.cjs");
|
|
65
68
|
const external_i18n_cjs_namespaceObject = require("./i18n.cjs");
|
|
66
69
|
const FolderSwitcher_cjs_namespaceObject = require("./primitives/FolderSwitcher.cjs");
|
|
67
70
|
const ModelOptionRow_cjs_namespaceObject = require("./primitives/ModelOptionRow.cjs");
|
|
@@ -75,7 +78,7 @@ const external_utils_cjs_namespaceObject = require("./utils.cjs");
|
|
|
75
78
|
const EMPTY_MODELS = [];
|
|
76
79
|
const REQUIRED_INDICATOR = '*';
|
|
77
80
|
const AUTO_VIRTUALIZE_THRESHOLD = 120;
|
|
78
|
-
const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models, value, valueConnectionId, onChange, label, required, placeholder, disabled, invalid, errorText, variant = 'searchable', groupBy = "subscription", allowGroupingChange = true, homeRegion, recommendedModelIds, previewModelIds, filter, badgesFor, customTagsFor, customTagVariants, canManageByo, onUseCustomModel, requestContext, enableFolders = false, folders, folder: folderProp, onFolderChange, allFoldersLabel, loading, error, showGroupHeaders = true, popupContainer, disablePortal, onDeleteModel, onModelDeleted, slots, testId }, forwardedRef)=>{
|
|
81
|
+
const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models, value, valueConnectionId, onChange, label, required, placeholder, disabled, invalid, errorText, variant = 'searchable', groupBy = "subscription", allowGroupingChange = true, homeRegion, recommendedModelIds, previewModelIds, filter, badgesFor, customTagsFor, customTagVariants, canManageByo, onUseCustomModel, isCommunity = false, onCustomModelSaved, communityDialogHost: CommunityDialogHost, notify, requestContext, enableFolders = false, folders, folder: folderProp, onFolderChange, allFoldersLabel, loading, error, showGroupHeaders = true, popupContainer, disablePortal, onDeleteModel, onModelDeleted, slots, testId }, forwardedRef)=>{
|
|
79
82
|
const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
|
|
80
83
|
const i18n = external_react_default().useMemo(()=>({
|
|
81
84
|
_
|
|
@@ -166,11 +169,20 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
166
169
|
catalog,
|
|
167
170
|
connectionNames
|
|
168
171
|
]);
|
|
172
|
+
const [pendingSelection, setPendingSelection] = external_react_default().useState(null);
|
|
173
|
+
const userPicks = external_react_default().useRef(0);
|
|
174
|
+
const handleUserChange = external_react_default().useCallback((model)=>{
|
|
175
|
+
userPicks.current += 1;
|
|
176
|
+
setPendingSelection(null);
|
|
177
|
+
onChange?.(model);
|
|
178
|
+
}, [
|
|
179
|
+
onChange
|
|
180
|
+
]);
|
|
169
181
|
const state = (0, external_useModelPickerState_cjs_namespaceObject.useModelPickerState)({
|
|
170
182
|
models: effectiveModels,
|
|
171
183
|
value,
|
|
172
184
|
valueConnectionId,
|
|
173
|
-
onChange,
|
|
185
|
+
onChange: handleUserChange,
|
|
174
186
|
groupBy,
|
|
175
187
|
recommendedModelIds,
|
|
176
188
|
previewModelIds,
|
|
@@ -204,6 +216,56 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
204
216
|
]);
|
|
205
217
|
const { canManage: isOrgAdmin } = (0, external_usePlatformAccess_cjs_namespaceObject.useCanManageByo)(void 0 === canManageByo && requestContext ? requestContext : null);
|
|
206
218
|
const effectiveCanManageByo = canManageByo ?? isOrgAdmin ?? false;
|
|
219
|
+
const catalogRef = external_react_default().useRef(catalog);
|
|
220
|
+
catalogRef.current = catalog;
|
|
221
|
+
const communityApi = external_react_default().useMemo(()=>isCommunity && requestContext ? (0, external_communityByoApi_cjs_namespaceObject.createCommunityByoApi)(requestContext, {
|
|
222
|
+
takenModelNames: ()=>catalogRef.current.filter((m)=>m.modelSubscriptionType?.startsWith('BYOM')).map((m)=>m.modelName)
|
|
223
|
+
}) : null, [
|
|
224
|
+
isCommunity,
|
|
225
|
+
requestContext
|
|
226
|
+
]);
|
|
227
|
+
const communityLabels = external_react_default().useMemo(()=>(0, external_communityByoLabels_cjs_namespaceObject.communityDialogLabels)(i18n), [
|
|
228
|
+
i18n
|
|
229
|
+
]);
|
|
230
|
+
const [communityDialog, setCommunityDialog] = external_react_default().useState(null);
|
|
231
|
+
const closeCommunityDialog = external_react_default().useCallback((open)=>{
|
|
232
|
+
if (!open) setCommunityDialog(null);
|
|
233
|
+
}, []);
|
|
234
|
+
const handleCommunitySaved = external_react_default().useCallback(async (model, edited)=>{
|
|
235
|
+
const picksBefore = userPicks.current;
|
|
236
|
+
const catalogBefore = catalogRef.current;
|
|
237
|
+
notify?.((0, external_communityByoLabels_cjs_namespaceObject.communitySavedMessage)(i18n, model.name, edited), 'success');
|
|
238
|
+
const showsOtherFolder = null !== folder && folder.toLowerCase() !== model.folderId.toLowerCase();
|
|
239
|
+
if (showsOtherFolder) handleFolderChange(model.folderId);
|
|
240
|
+
else if (selfFetchCtx) await refetchDiscovery();
|
|
241
|
+
await onCustomModelSaved?.(model);
|
|
242
|
+
if (userPicks.current === picksBefore) setPendingSelection({
|
|
243
|
+
model,
|
|
244
|
+
staleCatalog: catalogBefore
|
|
245
|
+
});
|
|
246
|
+
}, [
|
|
247
|
+
notify,
|
|
248
|
+
i18n,
|
|
249
|
+
folder,
|
|
250
|
+
handleFolderChange,
|
|
251
|
+
selfFetchCtx,
|
|
252
|
+
refetchDiscovery,
|
|
253
|
+
onCustomModelSaved
|
|
254
|
+
]);
|
|
255
|
+
external_react_default().useEffect(()=>{
|
|
256
|
+
if (!pendingSelection || catalog === pendingSelection.staleCatalog) return;
|
|
257
|
+
const { model } = pendingSelection;
|
|
258
|
+
const added = effectiveModels.find((m)=>m.modelName === model.name && m.byomDetails?.integrationServiceConnectionId === model.connectionId && (!filter || filter(m)));
|
|
259
|
+
if (!added) return;
|
|
260
|
+
setPendingSelection(null);
|
|
261
|
+
onChange?.(added);
|
|
262
|
+
}, [
|
|
263
|
+
pendingSelection,
|
|
264
|
+
catalog,
|
|
265
|
+
effectiveModels,
|
|
266
|
+
filter,
|
|
267
|
+
onChange
|
|
268
|
+
]);
|
|
207
269
|
const { folders: fetchedFolders } = (0, external_usePlatformAccess_cjs_namespaceObject.useUserFolders)(enableFolders && !folders && requestContext ? requestContext : null);
|
|
208
270
|
const effectiveFolders = folders ?? (enableFolders ? fetchedFolders : void 0);
|
|
209
271
|
const selectedFolderNumericId = external_react_default().useMemo(()=>effectiveFolders?.find((f)=>f.id === folder)?.numericId ?? effectiveFolders?.find((f)=>null != f.numericId)?.numericId, [
|
|
@@ -258,13 +320,27 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
258
320
|
const renderRowActions = external_react_default().useMemo(()=>{
|
|
259
321
|
if (slots?.optionActions) return slots.optionActions;
|
|
260
322
|
if (!effectiveCanManageByo) return ()=>null;
|
|
261
|
-
const
|
|
323
|
+
const editInDialog = communityApi ? (model)=>{
|
|
324
|
+
const configurationId = model.byomDetails?.byoConfigurationId;
|
|
325
|
+
if (!configurationId) return;
|
|
326
|
+
setCommunityDialog({
|
|
327
|
+
editing: {
|
|
328
|
+
configurationId,
|
|
329
|
+
name: model.modelName
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
closePopup();
|
|
333
|
+
} : void 0;
|
|
334
|
+
const editInTrustLayer = navigateToLlmConfigurations ? (model)=>navigateToLlmConfigurations({
|
|
262
335
|
intent: 'edit',
|
|
263
336
|
configurationId: model.byomDetails?.byoConfigurationId
|
|
264
337
|
}) : void 0;
|
|
265
|
-
if (!
|
|
338
|
+
if (!editInDialog && !editInTrustLayer && !handleDeleteModel) return ()=>null;
|
|
266
339
|
return (m)=>{
|
|
267
|
-
const
|
|
340
|
+
const hasConfigurationId = !!m.byomDetails?.byoConfigurationId;
|
|
341
|
+
let onEdit = editInTrustLayer;
|
|
342
|
+
if (editInDialog) onEdit = hasConfigurationId ? editInDialog : void 0;
|
|
343
|
+
const deletable = handleDeleteModel && (onDeleteModel || hasConfigurationId);
|
|
268
344
|
return (0, ModelOptionRow_cjs_namespaceObject.defaultRowActions)(m, {
|
|
269
345
|
i18n,
|
|
270
346
|
onEdit,
|
|
@@ -274,6 +350,8 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
274
350
|
}, [
|
|
275
351
|
slots?.optionActions,
|
|
276
352
|
effectiveCanManageByo,
|
|
353
|
+
communityApi,
|
|
354
|
+
closePopup,
|
|
277
355
|
navigateToLlmConfigurations,
|
|
278
356
|
handleDeleteModel,
|
|
279
357
|
onDeleteModel,
|
|
@@ -282,7 +360,7 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
282
360
|
const footerNode = external_react_default().useMemo(()=>{
|
|
283
361
|
if (slots && Object.hasOwn(slots, 'popupFooter')) return slots.popupFooter ? slots.popupFooter(slotCtx) : null;
|
|
284
362
|
if (!effectiveCanManageByo) return null;
|
|
285
|
-
const activate = onUseCustomModel ?? (navigateToLlmConfigurations ? ()=>navigateToLlmConfigurations({
|
|
363
|
+
const activate = onUseCustomModel ?? (communityApi ? ()=>setCommunityDialog({}) : void 0) ?? (navigateToLlmConfigurations ? ()=>navigateToLlmConfigurations({
|
|
286
364
|
intent: 'add'
|
|
287
365
|
}) : void 0);
|
|
288
366
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(UseCustomModelFooter, {
|
|
@@ -296,6 +374,7 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
296
374
|
slots,
|
|
297
375
|
effectiveCanManageByo,
|
|
298
376
|
onUseCustomModel,
|
|
377
|
+
communityApi,
|
|
299
378
|
navigateToLlmConfigurations,
|
|
300
379
|
slotCtx,
|
|
301
380
|
closePopup
|
|
@@ -552,10 +631,26 @@ const ModelPicker = /*#__PURE__*/ external_react_default().forwardRef(({ models,
|
|
|
552
631
|
]
|
|
553
632
|
})
|
|
554
633
|
]
|
|
634
|
+
}),
|
|
635
|
+
communityApi && communityDialog && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(CommunityDialogFrame, {
|
|
636
|
+
host: CommunityDialogHost,
|
|
637
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.ByoModelDialog, {
|
|
638
|
+
open: true,
|
|
639
|
+
onOpenChange: closeCommunityDialog,
|
|
640
|
+
api: communityApi,
|
|
641
|
+
editing: communityDialog.editing,
|
|
642
|
+
onSaved: (model)=>handleCommunitySaved(model, Boolean(communityDialog.editing)),
|
|
643
|
+
labels: communityLabels
|
|
644
|
+
})
|
|
555
645
|
})
|
|
556
646
|
]
|
|
557
647
|
});
|
|
558
648
|
});
|
|
649
|
+
const CommunityDialogFrame = ({ host: Host, children })=>Host ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Host, {
|
|
650
|
+
children: children
|
|
651
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
|
|
652
|
+
children: children
|
|
653
|
+
});
|
|
559
654
|
ModelPicker.displayName = 'ModelPicker';
|
|
560
655
|
const GroupBySegmented = ({ value, onChange })=>{
|
|
561
656
|
const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ByoSavedModel } from '@uipath/apollo-wind';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import type { ModelBadgeKind } from './badges';
|
|
3
4
|
import { type FolderSwitcherFolder } from './primitives/FolderSwitcher';
|
|
@@ -6,6 +7,7 @@ import type { DiscoveryModel, ModelTag } from './types';
|
|
|
6
7
|
import { type PlatformRequestContext } from './usePlatformAccess';
|
|
7
8
|
import type { GroupStrategy } from './utils';
|
|
8
9
|
export type ModelPickerVariant = 'searchable' | 'virtualized';
|
|
10
|
+
export type ModelPickerNoticeStatus = 'success' | 'error' | 'info' | 'warning';
|
|
9
11
|
export type ModelPickerChangeHandler = (model: DiscoveryModel) => void;
|
|
10
12
|
export interface ModelPickerSlotContext {
|
|
11
13
|
selected: DiscoveryModel | null;
|
|
@@ -43,6 +45,12 @@ export interface ModelPickerProps {
|
|
|
43
45
|
customTagVariants?: Record<string, string>;
|
|
44
46
|
canManageByo?: boolean;
|
|
45
47
|
onUseCustomModel?: () => void;
|
|
48
|
+
isCommunity?: boolean;
|
|
49
|
+
onCustomModelSaved?: (model: ByoSavedModel) => void | Promise<void>;
|
|
50
|
+
communityDialogHost?: React.ComponentType<{
|
|
51
|
+
children: React.ReactNode;
|
|
52
|
+
}>;
|
|
53
|
+
notify?: (message: string, status: ModelPickerNoticeStatus) => void;
|
|
46
54
|
requestContext?: PlatformRequestContext;
|
|
47
55
|
enableFolders?: boolean;
|
|
48
56
|
folders?: readonly FolderSwitcherFolder[];
|