@uipath/apollo-react 4.24.2-pr672.9dd3fa2 → 4.24.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/components/ButtonHandle/ButtonHandle.cjs +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandle.js +1 -1
- package/dist/canvas/components/CanvasTooltip.cjs +1 -1
- package/dist/canvas/components/CanvasTooltip.js +1 -1
- package/dist/canvas/components/LoopNode/LoopNode.cjs +17 -27
- package/dist/canvas/components/LoopNode/LoopNode.d.ts.map +1 -1
- package/dist/canvas/components/LoopNode/LoopNode.js +17 -27
- package/dist/canvas/components/LoopNode/LoopNode.types.d.ts +0 -8
- package/dist/canvas/components/LoopNode/LoopNode.types.d.ts.map +1 -1
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/canvas/components/LoopNode/IterationNavigator.cjs +0 -143
- package/dist/canvas/components/LoopNode/IterationNavigator.d.ts +0 -7
- package/dist/canvas/components/LoopNode/IterationNavigator.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/IterationNavigator.js +0 -109
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACrE,cAAc,4BAA4B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
IterationNavigator: ()=>IterationNavigator
|
|
28
|
-
});
|
|
29
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
|
-
const external_react_namespaceObject = require("react");
|
|
32
|
-
const index_cjs_namespaceObject = require("../../utils/index.cjs");
|
|
33
|
-
const icon_registry_cjs_namespaceObject = require("../../utils/icon-registry.cjs");
|
|
34
|
-
function resolveState(iterationState) {
|
|
35
|
-
if (!Number.isFinite(iterationState.total)) return;
|
|
36
|
-
const total = Math.trunc(iterationState.total);
|
|
37
|
-
if (total <= 0) return;
|
|
38
|
-
const rawActiveIndex = Number.isFinite(iterationState.activeIndex) ? Math.trunc(iterationState.activeIndex) : 0;
|
|
39
|
-
return {
|
|
40
|
-
...iterationState,
|
|
41
|
-
total,
|
|
42
|
-
activeIndex: (0, index_cjs_namespaceObject.clamp)(rawActiveIndex, 0, total - 1)
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
function stopCanvasControlEvent(event) {
|
|
46
|
-
event.stopPropagation();
|
|
47
|
-
}
|
|
48
|
-
function IterationNavigator({ iterationState }) {
|
|
49
|
-
const resolvedState = resolveState(iterationState);
|
|
50
|
-
if (!resolvedState) return null;
|
|
51
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(NavigatorContent, {
|
|
52
|
-
iterationState: resolvedState
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
function NavigatorContent({ iterationState }) {
|
|
56
|
-
const { activeIndex, total, onActiveIndexChange, disabled, ariaLabel } = iterationState;
|
|
57
|
-
const canInteract = !disabled && 'function' == typeof onActiveIndexChange;
|
|
58
|
-
const canGoPrevious = canInteract && activeIndex > 0;
|
|
59
|
-
const canGoNext = canInteract && activeIndex < total - 1;
|
|
60
|
-
const label = ariaLabel ?? 'Loop iteration';
|
|
61
|
-
const visibleIndex = activeIndex + 1;
|
|
62
|
-
const handlePrevious = (0, external_react_namespaceObject.useCallback)((event)=>{
|
|
63
|
-
event.stopPropagation();
|
|
64
|
-
if (!canGoPrevious) return;
|
|
65
|
-
onActiveIndexChange?.(activeIndex - 1);
|
|
66
|
-
}, [
|
|
67
|
-
activeIndex,
|
|
68
|
-
canGoPrevious,
|
|
69
|
-
onActiveIndexChange
|
|
70
|
-
]);
|
|
71
|
-
const handleNext = (0, external_react_namespaceObject.useCallback)((event)=>{
|
|
72
|
-
event.stopPropagation();
|
|
73
|
-
if (!canGoNext) return;
|
|
74
|
-
onActiveIndexChange?.(activeIndex + 1);
|
|
75
|
-
}, [
|
|
76
|
-
activeIndex,
|
|
77
|
-
canGoNext,
|
|
78
|
-
onActiveIndexChange
|
|
79
|
-
]);
|
|
80
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("fieldset", {
|
|
81
|
-
className: (0, apollo_wind_namespaceObject.cn)('nodrag nopan pointer-events-auto m-0 flex h-6 min-w-0 shrink-0 items-center gap-1 rounded-full px-1 py-0', 'border border-border bg-surface text-foreground shadow-sm'),
|
|
82
|
-
"data-testid": "loop-iteration-navigator",
|
|
83
|
-
onPointerDown: stopCanvasControlEvent,
|
|
84
|
-
onMouseDown: stopCanvasControlEvent,
|
|
85
|
-
onDoubleClick: stopCanvasControlEvent,
|
|
86
|
-
children: [
|
|
87
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("legend", {
|
|
88
|
-
className: "sr-only",
|
|
89
|
-
children: [
|
|
90
|
-
label,
|
|
91
|
-
": ",
|
|
92
|
-
visibleIndex,
|
|
93
|
-
" of ",
|
|
94
|
-
total
|
|
95
|
-
]
|
|
96
|
-
}),
|
|
97
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
98
|
-
type: "button",
|
|
99
|
-
className: (0, apollo_wind_namespaceObject.cn)('nodrag nopan inline-flex h-4 w-4 items-center justify-center rounded-full', 'text-foreground transition-opacity', canGoPrevious ? 'cursor-pointer opacity-100' : 'cursor-not-allowed opacity-40'),
|
|
100
|
-
disabled: !canGoPrevious,
|
|
101
|
-
"aria-label": "Previous loop iteration",
|
|
102
|
-
onClick: handlePrevious,
|
|
103
|
-
onPointerDown: stopCanvasControlEvent,
|
|
104
|
-
onMouseDown: stopCanvasControlEvent,
|
|
105
|
-
"data-testid": "loop-iteration-previous",
|
|
106
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
|
|
107
|
-
icon: "chevron-left",
|
|
108
|
-
size: 12
|
|
109
|
-
})
|
|
110
|
-
}),
|
|
111
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
112
|
-
className: "min-w-8 select-none px-1 text-center text-[11px] font-semibold leading-4",
|
|
113
|
-
"data-testid": "loop-iteration-label",
|
|
114
|
-
children: [
|
|
115
|
-
visibleIndex,
|
|
116
|
-
" / ",
|
|
117
|
-
total
|
|
118
|
-
]
|
|
119
|
-
}),
|
|
120
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
121
|
-
type: "button",
|
|
122
|
-
className: (0, apollo_wind_namespaceObject.cn)('nodrag nopan inline-flex h-4 w-4 items-center justify-center rounded-full', 'text-foreground transition-opacity', canGoNext ? 'cursor-pointer opacity-100' : 'cursor-not-allowed opacity-40'),
|
|
123
|
-
disabled: !canGoNext,
|
|
124
|
-
"aria-label": "Next loop iteration",
|
|
125
|
-
onClick: handleNext,
|
|
126
|
-
onPointerDown: stopCanvasControlEvent,
|
|
127
|
-
onMouseDown: stopCanvasControlEvent,
|
|
128
|
-
"data-testid": "loop-iteration-next",
|
|
129
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
|
|
130
|
-
icon: "chevron-right",
|
|
131
|
-
size: 12
|
|
132
|
-
})
|
|
133
|
-
})
|
|
134
|
-
]
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
exports.IterationNavigator = __webpack_exports__.IterationNavigator;
|
|
138
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
139
|
-
"IterationNavigator"
|
|
140
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
141
|
-
Object.defineProperty(exports, '__esModule', {
|
|
142
|
-
value: true
|
|
143
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { LoopIterationState } from './LoopNode.types';
|
|
2
|
-
interface IterationNavigatorProps {
|
|
3
|
-
iterationState: LoopIterationState;
|
|
4
|
-
}
|
|
5
|
-
export declare function IterationNavigator({ iterationState }: IterationNavigatorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
-
export {};
|
|
7
|
-
//# sourceMappingURL=IterationNavigator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IterationNavigator.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/LoopNode/IterationNavigator.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,UAAU,uBAAuB;IAC/B,cAAc,EAAE,kBAAkB,CAAC;CACpC;AA4BD,wBAAgB,kBAAkB,CAAC,EAAE,cAAc,EAAE,EAAE,uBAAuB,kDAQ7E"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "@uipath/apollo-wind";
|
|
3
|
-
import { useCallback } from "react";
|
|
4
|
-
import { clamp } from "../../utils/index.js";
|
|
5
|
-
import { CanvasIcon } from "../../utils/icon-registry.js";
|
|
6
|
-
function resolveState(iterationState) {
|
|
7
|
-
if (!Number.isFinite(iterationState.total)) return;
|
|
8
|
-
const total = Math.trunc(iterationState.total);
|
|
9
|
-
if (total <= 0) return;
|
|
10
|
-
const rawActiveIndex = Number.isFinite(iterationState.activeIndex) ? Math.trunc(iterationState.activeIndex) : 0;
|
|
11
|
-
return {
|
|
12
|
-
...iterationState,
|
|
13
|
-
total,
|
|
14
|
-
activeIndex: clamp(rawActiveIndex, 0, total - 1)
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
function stopCanvasControlEvent(event) {
|
|
18
|
-
event.stopPropagation();
|
|
19
|
-
}
|
|
20
|
-
function IterationNavigator({ iterationState }) {
|
|
21
|
-
const resolvedState = resolveState(iterationState);
|
|
22
|
-
if (!resolvedState) return null;
|
|
23
|
-
return /*#__PURE__*/ jsx(NavigatorContent, {
|
|
24
|
-
iterationState: resolvedState
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
function NavigatorContent({ iterationState }) {
|
|
28
|
-
const { activeIndex, total, onActiveIndexChange, disabled, ariaLabel } = iterationState;
|
|
29
|
-
const canInteract = !disabled && 'function' == typeof onActiveIndexChange;
|
|
30
|
-
const canGoPrevious = canInteract && activeIndex > 0;
|
|
31
|
-
const canGoNext = canInteract && activeIndex < total - 1;
|
|
32
|
-
const label = ariaLabel ?? 'Loop iteration';
|
|
33
|
-
const visibleIndex = activeIndex + 1;
|
|
34
|
-
const handlePrevious = useCallback((event)=>{
|
|
35
|
-
event.stopPropagation();
|
|
36
|
-
if (!canGoPrevious) return;
|
|
37
|
-
onActiveIndexChange?.(activeIndex - 1);
|
|
38
|
-
}, [
|
|
39
|
-
activeIndex,
|
|
40
|
-
canGoPrevious,
|
|
41
|
-
onActiveIndexChange
|
|
42
|
-
]);
|
|
43
|
-
const handleNext = useCallback((event)=>{
|
|
44
|
-
event.stopPropagation();
|
|
45
|
-
if (!canGoNext) return;
|
|
46
|
-
onActiveIndexChange?.(activeIndex + 1);
|
|
47
|
-
}, [
|
|
48
|
-
activeIndex,
|
|
49
|
-
canGoNext,
|
|
50
|
-
onActiveIndexChange
|
|
51
|
-
]);
|
|
52
|
-
return /*#__PURE__*/ jsxs("fieldset", {
|
|
53
|
-
className: cn('nodrag nopan pointer-events-auto m-0 flex h-6 min-w-0 shrink-0 items-center gap-1 rounded-full px-1 py-0', 'border border-border bg-surface text-foreground shadow-sm'),
|
|
54
|
-
"data-testid": "loop-iteration-navigator",
|
|
55
|
-
onPointerDown: stopCanvasControlEvent,
|
|
56
|
-
onMouseDown: stopCanvasControlEvent,
|
|
57
|
-
onDoubleClick: stopCanvasControlEvent,
|
|
58
|
-
children: [
|
|
59
|
-
/*#__PURE__*/ jsxs("legend", {
|
|
60
|
-
className: "sr-only",
|
|
61
|
-
children: [
|
|
62
|
-
label,
|
|
63
|
-
": ",
|
|
64
|
-
visibleIndex,
|
|
65
|
-
" of ",
|
|
66
|
-
total
|
|
67
|
-
]
|
|
68
|
-
}),
|
|
69
|
-
/*#__PURE__*/ jsx("button", {
|
|
70
|
-
type: "button",
|
|
71
|
-
className: cn('nodrag nopan inline-flex h-4 w-4 items-center justify-center rounded-full', 'text-foreground transition-opacity', canGoPrevious ? 'cursor-pointer opacity-100' : 'cursor-not-allowed opacity-40'),
|
|
72
|
-
disabled: !canGoPrevious,
|
|
73
|
-
"aria-label": "Previous loop iteration",
|
|
74
|
-
onClick: handlePrevious,
|
|
75
|
-
onPointerDown: stopCanvasControlEvent,
|
|
76
|
-
onMouseDown: stopCanvasControlEvent,
|
|
77
|
-
"data-testid": "loop-iteration-previous",
|
|
78
|
-
children: /*#__PURE__*/ jsx(CanvasIcon, {
|
|
79
|
-
icon: "chevron-left",
|
|
80
|
-
size: 12
|
|
81
|
-
})
|
|
82
|
-
}),
|
|
83
|
-
/*#__PURE__*/ jsxs("span", {
|
|
84
|
-
className: "min-w-8 select-none px-1 text-center text-[11px] font-semibold leading-4",
|
|
85
|
-
"data-testid": "loop-iteration-label",
|
|
86
|
-
children: [
|
|
87
|
-
visibleIndex,
|
|
88
|
-
" / ",
|
|
89
|
-
total
|
|
90
|
-
]
|
|
91
|
-
}),
|
|
92
|
-
/*#__PURE__*/ jsx("button", {
|
|
93
|
-
type: "button",
|
|
94
|
-
className: cn('nodrag nopan inline-flex h-4 w-4 items-center justify-center rounded-full', 'text-foreground transition-opacity', canGoNext ? 'cursor-pointer opacity-100' : 'cursor-not-allowed opacity-40'),
|
|
95
|
-
disabled: !canGoNext,
|
|
96
|
-
"aria-label": "Next loop iteration",
|
|
97
|
-
onClick: handleNext,
|
|
98
|
-
onPointerDown: stopCanvasControlEvent,
|
|
99
|
-
onMouseDown: stopCanvasControlEvent,
|
|
100
|
-
"data-testid": "loop-iteration-next",
|
|
101
|
-
children: /*#__PURE__*/ jsx(CanvasIcon, {
|
|
102
|
-
icon: "chevron-right",
|
|
103
|
-
size: 12
|
|
104
|
-
})
|
|
105
|
-
})
|
|
106
|
-
]
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
export { IterationNavigator };
|