@uipath/apollo-react 4.5.0 → 4.5.2-pr525.171b58a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/components/BaseNode/BaseNode.cjs +55 -74
- package/dist/canvas/components/BaseNode/BaseNode.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.js +50 -69
- package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.cjs +67 -0
- package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.d.ts +9 -0
- package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.d.ts.map +1 -0
- package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.js +33 -0
- package/dist/canvas/components/BaseNode/BaseNodeContainer.cjs +87 -0
- package/dist/canvas/components/BaseNode/BaseNodeContainer.d.ts +23 -0
- package/dist/canvas/components/BaseNode/BaseNodeContainer.d.ts.map +1 -0
- package/dist/canvas/components/BaseNode/BaseNodeContainer.js +50 -0
- package/dist/canvas/components/BaseNode/BaseNodeInnerShape.cjs +65 -0
- package/dist/canvas/components/BaseNode/BaseNodeInnerShape.d.ts +14 -0
- package/dist/canvas/components/BaseNode/BaseNodeInnerShape.d.ts.map +1 -0
- package/dist/canvas/components/BaseNode/BaseNodeInnerShape.js +31 -0
- package/dist/canvas/components/BaseNode/BaseNodeMissingManifest.cjs +67 -0
- package/dist/canvas/components/BaseNode/BaseNodeMissingManifest.d.ts +9 -0
- package/dist/canvas/components/BaseNode/BaseNodeMissingManifest.d.ts.map +1 -0
- package/dist/canvas/components/BaseNode/BaseNodeMissingManifest.js +33 -0
- package/dist/canvas/components/BaseNode/BaseNodeTextContainer.cjs +51 -0
- package/dist/canvas/components/BaseNode/BaseNodeTextContainer.d.ts +9 -0
- package/dist/canvas/components/BaseNode/BaseNodeTextContainer.d.ts.map +1 -0
- package/dist/canvas/components/BaseNode/BaseNodeTextContainer.js +17 -0
- package/dist/canvas/components/BaseNode/NodeLabel.cjs +48 -18
- package/dist/canvas/components/BaseNode/NodeLabel.d.ts +1 -1
- package/dist/canvas/components/BaseNode/NodeLabel.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/NodeLabel.js +44 -14
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.cjs +4 -7
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.js +4 -7
- package/dist/canvas/constants.cjs +60 -0
- package/dist/canvas/constants.d.ts +15 -0
- package/dist/canvas/constants.d.ts.map +1 -1
- package/dist/canvas/constants.js +16 -1
- package/dist/canvas/icons/CasePlanIcon.cjs +1 -1
- package/dist/canvas/icons/CasePlanIcon.js +1 -1
- package/dist/canvas/index.cjs +39 -35
- package/dist/canvas/index.d.ts +1 -0
- package/dist/canvas/index.d.ts.map +1 -1
- package/dist/canvas/index.js +1 -0
- package/dist/canvas/styles/reactflow-reset.css +12 -0
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/material/components/ap-chat/components/message/suggestions/chat-suggestions.cjs +1 -0
- package/dist/material/components/ap-chat/components/message/suggestions/chat-suggestions.d.ts.map +1 -1
- package/dist/material/components/ap-chat/components/message/suggestions/chat-suggestions.js +1 -0
- package/dist/material/components/ap-tool-call/ApToolCall.cjs +127 -41
- package/dist/material/components/ap-tool-call/ApToolCall.d.ts.map +1 -1
- package/dist/material/components/ap-tool-call/ApToolCall.js +123 -38
- package/dist/material/components/ap-tool-call/ApToolCall.types.cjs +23 -1
- package/dist/material/components/ap-tool-call/ApToolCall.types.d.ts +9 -1
- package/dist/material/components/ap-tool-call/ApToolCall.types.d.ts.map +1 -1
- package/dist/material/components/ap-tool-call/ApToolCall.types.js +6 -0
- package/dist/material/components/ap-tool-call/assets/spanIcons.cjs +221 -0
- package/dist/material/components/ap-tool-call/assets/spanIcons.d.ts +2 -0
- package/dist/material/components/ap-tool-call/assets/spanIcons.d.ts.map +1 -0
- package/dist/material/components/ap-tool-call/assets/spanIcons.js +187 -0
- package/dist/material/components/ap-tool-call/components/NestedValue.d.ts +4 -0
- package/dist/material/components/ap-tool-call/components/NestedValue.d.ts.map +1 -0
- package/dist/material/components/ap-tool-call/{ToolCallSection.cjs → components/ToolCallSection.cjs} +5 -1
- package/dist/material/components/ap-tool-call/components/ToolCallSection.d.ts +4 -0
- package/dist/material/components/ap-tool-call/components/ToolCallSection.d.ts.map +1 -0
- package/dist/material/components/ap-tool-call/{ToolCallSection.js → components/ToolCallSection.js} +5 -1
- package/dist/material/components/ap-tool-call/index.cjs +8 -4
- package/dist/material/components/ap-tool-call/index.d.ts +4 -3
- package/dist/material/components/ap-tool-call/index.d.ts.map +1 -1
- package/dist/material/components/ap-tool-call/index.js +4 -3
- package/dist/material/components/ap-tool-call/locales/en.cjs +1 -1
- package/dist/material/components/ap-tool-call/locales/en.d.ts.map +1 -1
- package/dist/material/components/ap-tool-call/locales/en.js +1 -1
- package/dist/material/components/ap-tool-call/utils/traceIconUtils.cjs +254 -0
- package/dist/material/components/ap-tool-call/utils/traceIconUtils.d.ts +3 -0
- package/dist/material/components/ap-tool-call/utils/traceIconUtils.d.ts.map +1 -0
- package/dist/material/components/ap-tool-call/utils/traceIconUtils.js +220 -0
- package/package.json +3 -3
- package/dist/canvas/components/BaseNode/BaseNode.styles.cjs +0 -410
- package/dist/canvas/components/BaseNode/BaseNode.styles.d.ts +0 -75
- package/dist/canvas/components/BaseNode/BaseNode.styles.d.ts.map +0 -1
- package/dist/canvas/components/BaseNode/BaseNode.styles.js +0 -342
- package/dist/material/components/ap-tool-call/NestedValue.d.ts +0 -4
- package/dist/material/components/ap-tool-call/NestedValue.d.ts.map +0 -1
- package/dist/material/components/ap-tool-call/ToolCallSection.d.ts +0 -4
- package/dist/material/components/ap-tool-call/ToolCallSection.d.ts.map +0 -1
- /package/dist/material/components/ap-tool-call/{NestedValue.cjs → components/NestedValue.cjs} +0 -0
- /package/dist/material/components/ap-tool-call/{NestedValue.js → components/NestedValue.js} +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@uipath/apollo-wind";
|
|
3
|
+
import { DEFAULT_NODE_SIZE, NODE_CONTAINER_RADIUS_RATIO } from "../../constants.js";
|
|
4
|
+
const getStatusBorder = (status)=>{
|
|
5
|
+
switch(status){
|
|
6
|
+
case 'InProgress':
|
|
7
|
+
return 'border-info animate-glow [--glow-color:var(--info)]';
|
|
8
|
+
case 'Completed':
|
|
9
|
+
case 'add':
|
|
10
|
+
return 'border-success animate-glow [--glow-color:var(--success)]';
|
|
11
|
+
case 'Paused':
|
|
12
|
+
case 'Warning':
|
|
13
|
+
case 'WARNING':
|
|
14
|
+
case 'update':
|
|
15
|
+
return 'border-warning animate-glow [--glow-color:var(--warning)]';
|
|
16
|
+
case 'Cancelled':
|
|
17
|
+
case 'Failed':
|
|
18
|
+
case 'Terminated':
|
|
19
|
+
case 'ERROR':
|
|
20
|
+
case 'CRITICAL':
|
|
21
|
+
case 'delete':
|
|
22
|
+
return 'border-error animate-glow [--glow-color:var(--error)]';
|
|
23
|
+
default:
|
|
24
|
+
return '';
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const BaseContainer = ({ isSelected, isHovered, shape, interactionState, executionStatus, validationStatus, suggestionType, width, height, hasFooter, background, loading, children })=>{
|
|
28
|
+
const activeStatus = suggestionType ?? validationStatus ?? executionStatus;
|
|
29
|
+
const numericWidth = 'number' == typeof width ? width : void 0;
|
|
30
|
+
const numericHeight = 'number' == typeof height ? height : void 0;
|
|
31
|
+
const radiusBasis = 'rectangle' === shape ? numericHeight ?? DEFAULT_NODE_SIZE : Math.min(numericWidth ?? DEFAULT_NODE_SIZE, numericHeight ?? DEFAULT_NODE_SIZE);
|
|
32
|
+
const containerRadius = radiusBasis * NODE_CONTAINER_RADIUS_RATIO;
|
|
33
|
+
return /*#__PURE__*/ jsx("div", {
|
|
34
|
+
"data-testid": "base-container",
|
|
35
|
+
"data-execution-status": executionStatus,
|
|
36
|
+
"data-interaction-state": interactionState,
|
|
37
|
+
"data-validation-status": validationStatus,
|
|
38
|
+
"data-suggestion-type": suggestionType,
|
|
39
|
+
className: cn('relative flex items-center cursor-pointer bg-surface-overlay border-2 border-border', 'circle' === shape ? 'rounded-full' : '', 'rectangle' === shape ? 'flex-row justify-start gap-3 p-2' : 'flex-col justify-center', hasFooter && 'flex-wrap rounded-2xl', getStatusBorder(activeStatus), !isSelected && isHovered && 'border-foreground-muted', isSelected && 'border-brand', isSelected && isHovered && 'border-foreground-accent-muted', 'disabled' === interactionState && 'opacity-50 cursor-not-allowed', 'drag' === interactionState && 'cursor-grabbing opacity-80'),
|
|
40
|
+
style: {
|
|
41
|
+
width,
|
|
42
|
+
height,
|
|
43
|
+
background,
|
|
44
|
+
borderRadius: 'circle' === shape || hasFooter ? void 0 : containerRadius
|
|
45
|
+
},
|
|
46
|
+
"aria-busy": loading || void 0,
|
|
47
|
+
children: children
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
export { BaseContainer, getStatusBorder };
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
BaseInnerShape: ()=>BaseInnerShape
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
|
+
const external_constants_cjs_namespaceObject = require("../../constants.cjs");
|
|
32
|
+
const BaseInnerShape = ({ shape, color, background, hasFooter, loading, containerWidth = external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE, containerHeight = external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE, children })=>{
|
|
33
|
+
const effectiveContainerHeight = hasFooter ? external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE : containerHeight;
|
|
34
|
+
const effectiveContainerWidth = hasFooter ? external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE : containerWidth;
|
|
35
|
+
const basis = 'rectangle' === shape ? effectiveContainerHeight : Math.min(effectiveContainerWidth, effectiveContainerHeight);
|
|
36
|
+
const innerSize = basis * external_constants_cjs_namespaceObject.NODE_INNER_SHAPE_RATIO;
|
|
37
|
+
const iconSize = basis * external_constants_cjs_namespaceObject.NODE_INNER_ICON_RATIO;
|
|
38
|
+
const innerRadius = basis * external_constants_cjs_namespaceObject.NODE_INNER_RADIUS_RATIO;
|
|
39
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
40
|
+
className: (0, apollo_wind_namespaceObject.cn)('flex items-center justify-center overflow-hidden bg-surface text-foreground', 'circle' === shape ? 'rounded-full' : '', hasFooter ? 'rounded-2xl' : '', '[&>svg]:w-(--canvas-icon-size) [&>svg]:h-(--canvas-icon-size)', '[&>img]:w-(--canvas-icon-size) [&>img]:h-(--canvas-icon-size) [&>img]:object-contain'),
|
|
41
|
+
style: {
|
|
42
|
+
width: innerSize,
|
|
43
|
+
height: innerSize,
|
|
44
|
+
borderRadius: 'circle' === shape || hasFooter ? void 0 : innerRadius,
|
|
45
|
+
color,
|
|
46
|
+
background,
|
|
47
|
+
'--canvas-icon-size': `${iconSize}px`
|
|
48
|
+
},
|
|
49
|
+
children: loading ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Skeleton, {
|
|
50
|
+
"data-testid": "skeleton-icon",
|
|
51
|
+
className: "rounded-lg",
|
|
52
|
+
style: {
|
|
53
|
+
width: iconSize,
|
|
54
|
+
height: iconSize
|
|
55
|
+
}
|
|
56
|
+
}) : children
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
exports.BaseInnerShape = __webpack_exports__.BaseInnerShape;
|
|
60
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
61
|
+
"BaseInnerShape"
|
|
62
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
63
|
+
Object.defineProperty(exports, '__esModule', {
|
|
64
|
+
value: true
|
|
65
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NodeShape } from '../../schema';
|
|
2
|
+
interface BaseInnerShapeProps {
|
|
3
|
+
shape?: NodeShape;
|
|
4
|
+
color?: string;
|
|
5
|
+
background?: string;
|
|
6
|
+
hasFooter?: boolean;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
containerWidth?: number;
|
|
9
|
+
containerHeight?: number;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const BaseInnerShape: ({ shape, color, background, hasFooter, loading, containerWidth, containerHeight, children, }: BaseInnerShapeProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=BaseNodeInnerShape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseNodeInnerShape.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeInnerShape.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,UAAU,mBAAmB;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AACD,eAAO,MAAM,cAAc,GAAI,8FAS5B,mBAAmB,4CAgDrB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton, cn } from "@uipath/apollo-wind";
|
|
3
|
+
import { DEFAULT_NODE_SIZE, NODE_INNER_ICON_RATIO, NODE_INNER_RADIUS_RATIO, NODE_INNER_SHAPE_RATIO } from "../../constants.js";
|
|
4
|
+
const BaseInnerShape = ({ shape, color, background, hasFooter, loading, containerWidth = DEFAULT_NODE_SIZE, containerHeight = DEFAULT_NODE_SIZE, children })=>{
|
|
5
|
+
const effectiveContainerHeight = hasFooter ? DEFAULT_NODE_SIZE : containerHeight;
|
|
6
|
+
const effectiveContainerWidth = hasFooter ? DEFAULT_NODE_SIZE : containerWidth;
|
|
7
|
+
const basis = 'rectangle' === shape ? effectiveContainerHeight : Math.min(effectiveContainerWidth, effectiveContainerHeight);
|
|
8
|
+
const innerSize = basis * NODE_INNER_SHAPE_RATIO;
|
|
9
|
+
const iconSize = basis * NODE_INNER_ICON_RATIO;
|
|
10
|
+
const innerRadius = basis * NODE_INNER_RADIUS_RATIO;
|
|
11
|
+
return /*#__PURE__*/ jsx("div", {
|
|
12
|
+
className: cn('flex items-center justify-center overflow-hidden bg-surface text-foreground', 'circle' === shape ? 'rounded-full' : '', hasFooter ? 'rounded-2xl' : '', '[&>svg]:w-(--canvas-icon-size) [&>svg]:h-(--canvas-icon-size)', '[&>img]:w-(--canvas-icon-size) [&>img]:h-(--canvas-icon-size) [&>img]:object-contain'),
|
|
13
|
+
style: {
|
|
14
|
+
width: innerSize,
|
|
15
|
+
height: innerSize,
|
|
16
|
+
borderRadius: 'circle' === shape || hasFooter ? void 0 : innerRadius,
|
|
17
|
+
color,
|
|
18
|
+
background,
|
|
19
|
+
'--canvas-icon-size': `${iconSize}px`
|
|
20
|
+
},
|
|
21
|
+
children: loading ? /*#__PURE__*/ jsx(Skeleton, {
|
|
22
|
+
"data-testid": "skeleton-icon",
|
|
23
|
+
className: "rounded-lg",
|
|
24
|
+
style: {
|
|
25
|
+
width: iconSize,
|
|
26
|
+
height: iconSize
|
|
27
|
+
}
|
|
28
|
+
}) : children
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
export { BaseInnerShape };
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
MissingManifestNode: ()=>MissingManifestNode
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_constants_cjs_namespaceObject = require("../../constants.cjs");
|
|
31
|
+
const index_cjs_namespaceObject = require("../../utils/index.cjs");
|
|
32
|
+
const external_BaseNodeContainer_cjs_namespaceObject = require("./BaseNodeContainer.cjs");
|
|
33
|
+
const external_BaseNodeInnerShape_cjs_namespaceObject = require("./BaseNodeInnerShape.cjs");
|
|
34
|
+
const external_NodeLabel_cjs_namespaceObject = require("./NodeLabel.cjs");
|
|
35
|
+
const MissingManifestNode = ({ type, isSelected, isHovered, interactionState })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_BaseNodeContainer_cjs_namespaceObject.BaseContainer, {
|
|
36
|
+
shape: "square",
|
|
37
|
+
isSelected: isSelected,
|
|
38
|
+
isHovered: isHovered,
|
|
39
|
+
interactionState: interactionState,
|
|
40
|
+
width: external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE,
|
|
41
|
+
height: external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE,
|
|
42
|
+
children: [
|
|
43
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_BaseNodeInnerShape_cjs_namespaceObject.BaseInnerShape, {
|
|
44
|
+
shape: "square",
|
|
45
|
+
containerWidth: external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE,
|
|
46
|
+
containerHeight: external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE,
|
|
47
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.CanvasIcon, {
|
|
48
|
+
icon: "circle-alert",
|
|
49
|
+
size: external_constants_cjs_namespaceObject.NODE_ERROR_ICON_SIZE,
|
|
50
|
+
color: "var(--color-error-icon)"
|
|
51
|
+
})
|
|
52
|
+
}),
|
|
53
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_NodeLabel_cjs_namespaceObject.NodeLabel, {
|
|
54
|
+
label: "Manifest Undefined",
|
|
55
|
+
subLabel: type,
|
|
56
|
+
shape: "square",
|
|
57
|
+
readonly: true
|
|
58
|
+
})
|
|
59
|
+
]
|
|
60
|
+
});
|
|
61
|
+
exports.MissingManifestNode = __webpack_exports__.MissingManifestNode;
|
|
62
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
63
|
+
"MissingManifestNode"
|
|
64
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
65
|
+
Object.defineProperty(exports, '__esModule', {
|
|
66
|
+
value: true
|
|
67
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface MissingManifestNodeProps {
|
|
2
|
+
type?: string;
|
|
3
|
+
isSelected?: boolean;
|
|
4
|
+
isHovered?: boolean;
|
|
5
|
+
interactionState?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const MissingManifestNode: ({ type, isSelected, isHovered, interactionState, }: MissingManifestNodeProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=BaseNodeMissingManifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseNodeMissingManifest.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeMissingManifest.tsx"],"names":[],"mappings":"AAMA,UAAU,wBAAwB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,mBAAmB,GAAI,oDAKjC,wBAAwB,4CAmB1B,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DEFAULT_NODE_SIZE, NODE_ERROR_ICON_SIZE } from "../../constants.js";
|
|
3
|
+
import { CanvasIcon } from "../../utils/index.js";
|
|
4
|
+
import { BaseContainer } from "./BaseNodeContainer.js";
|
|
5
|
+
import { BaseInnerShape } from "./BaseNodeInnerShape.js";
|
|
6
|
+
import { NodeLabel } from "./NodeLabel.js";
|
|
7
|
+
const MissingManifestNode = ({ type, isSelected, isHovered, interactionState })=>/*#__PURE__*/ jsxs(BaseContainer, {
|
|
8
|
+
shape: "square",
|
|
9
|
+
isSelected: isSelected,
|
|
10
|
+
isHovered: isHovered,
|
|
11
|
+
interactionState: interactionState,
|
|
12
|
+
width: DEFAULT_NODE_SIZE,
|
|
13
|
+
height: DEFAULT_NODE_SIZE,
|
|
14
|
+
children: [
|
|
15
|
+
/*#__PURE__*/ jsx(BaseInnerShape, {
|
|
16
|
+
shape: "square",
|
|
17
|
+
containerWidth: DEFAULT_NODE_SIZE,
|
|
18
|
+
containerHeight: DEFAULT_NODE_SIZE,
|
|
19
|
+
children: /*#__PURE__*/ jsx(CanvasIcon, {
|
|
20
|
+
icon: "circle-alert",
|
|
21
|
+
size: NODE_ERROR_ICON_SIZE,
|
|
22
|
+
color: "var(--color-error-icon)"
|
|
23
|
+
})
|
|
24
|
+
}),
|
|
25
|
+
/*#__PURE__*/ jsx(NodeLabel, {
|
|
26
|
+
label: "Manifest Undefined",
|
|
27
|
+
subLabel: type,
|
|
28
|
+
shape: "square",
|
|
29
|
+
readonly: true
|
|
30
|
+
})
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
export { MissingManifestNode };
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
BaseTextContainer: ()=>BaseTextContainer
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
|
+
const external_constants_cjs_namespaceObject = require("../../constants.cjs");
|
|
32
|
+
const BaseTextContainer = ({ hasBottomHandles, shape, children })=>{
|
|
33
|
+
if ('rectangle' === shape) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
34
|
+
className: "flex flex-1 min-w-0 flex-col items-start text-left",
|
|
35
|
+
children: children
|
|
36
|
+
});
|
|
37
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
38
|
+
className: (0, apollo_wind_namespaceObject.cn)('absolute left-1/2 w-[150%] flex flex-col z-10 transition-transform duration-200', hasBottomHandles ? 'items-start text-left translate-x-[20%] translate-y-1/2' : 'items-center text-center -translate-x-1/2 translate-y-full'),
|
|
39
|
+
style: {
|
|
40
|
+
bottom: hasBottomHandles ? external_constants_cjs_namespaceObject.NODE_TEXT_BOTTOM_OFFSET_WITH_HANDLES : external_constants_cjs_namespaceObject.NODE_TEXT_BOTTOM_OFFSET
|
|
41
|
+
},
|
|
42
|
+
children: children
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
exports.BaseTextContainer = __webpack_exports__.BaseTextContainer;
|
|
46
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
47
|
+
"BaseTextContainer"
|
|
48
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
49
|
+
Object.defineProperty(exports, '__esModule', {
|
|
50
|
+
value: true
|
|
51
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NodeShape } from '../../schema';
|
|
2
|
+
interface BaseTextContainerProps {
|
|
3
|
+
hasBottomHandles?: boolean;
|
|
4
|
+
shape?: NodeShape;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const BaseTextContainer: ({ hasBottomHandles, shape, children, }: BaseTextContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=BaseNodeTextContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseNodeTextContainer.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeTextContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,UAAU,sBAAsB;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,iBAAiB,GAAI,wCAI/B,sBAAsB,4CAmBxB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@uipath/apollo-wind";
|
|
3
|
+
import { NODE_TEXT_BOTTOM_OFFSET, NODE_TEXT_BOTTOM_OFFSET_WITH_HANDLES } from "../../constants.js";
|
|
4
|
+
const BaseTextContainer = ({ hasBottomHandles, shape, children })=>{
|
|
5
|
+
if ('rectangle' === shape) return /*#__PURE__*/ jsx("div", {
|
|
6
|
+
className: "flex flex-1 min-w-0 flex-col items-start text-left",
|
|
7
|
+
children: children
|
|
8
|
+
});
|
|
9
|
+
return /*#__PURE__*/ jsx("div", {
|
|
10
|
+
className: cn('absolute left-1/2 w-[150%] flex flex-col z-10 transition-transform duration-200', hasBottomHandles ? 'items-start text-left translate-x-[20%] translate-y-1/2' : 'items-center text-center -translate-x-1/2 translate-y-full'),
|
|
11
|
+
style: {
|
|
12
|
+
bottom: hasBottomHandles ? NODE_TEXT_BOTTOM_OFFSET_WITH_HANDLES : NODE_TEXT_BOTTOM_OFFSET
|
|
13
|
+
},
|
|
14
|
+
children: children
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export { BaseTextContainer };
|
|
@@ -27,9 +27,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
NodeLabel: ()=>NodeLabel
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
30
31
|
const external_react_namespaceObject = require("react");
|
|
31
32
|
const external_CanvasTooltip_cjs_namespaceObject = require("../CanvasTooltip.cjs");
|
|
32
|
-
const
|
|
33
|
+
const external_BaseNodeTextContainer_cjs_namespaceObject = require("./BaseNodeTextContainer.cjs");
|
|
33
34
|
const ConditionalTooltip = ({ content, children })=>{
|
|
34
35
|
if (!content) return children;
|
|
35
36
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
|
|
@@ -40,6 +41,43 @@ const ConditionalTooltip = ({ content, children })=>{
|
|
|
40
41
|
children: children
|
|
41
42
|
});
|
|
42
43
|
};
|
|
44
|
+
const Header = ({ shape, backgroundColor, onDoubleClick, children, 'data-testid': dataTestId })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
45
|
+
"data-testid": dataTestId,
|
|
46
|
+
onDoubleClick: onDoubleClick,
|
|
47
|
+
className: (0, apollo_wind_namespaceObject.cn)('text-center text-sm leading-[18px] font-semibold text-foreground overflow-hidden', backgroundColor && 'px-1.5 py-0.5 rounded-sm', 'rectangle' === shape ? 'w-full text-left whitespace-nowrap text-ellipsis' : 'break-all line-clamp-3'),
|
|
48
|
+
style: backgroundColor ? {
|
|
49
|
+
backgroundColor
|
|
50
|
+
} : void 0,
|
|
51
|
+
children: children
|
|
52
|
+
});
|
|
53
|
+
const SubHeader = ({ shape, onDoubleClick, children, 'data-testid': dataTestId })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
54
|
+
"data-testid": dataTestId,
|
|
55
|
+
onDoubleClick: onDoubleClick,
|
|
56
|
+
className: (0, apollo_wind_namespaceObject.cn)('text-center text-xs leading-[18px] text-foreground-muted break-all overflow-hidden', 'rectangle' === shape ? 'w-full text-left line-clamp-2' : 'line-clamp-5'),
|
|
57
|
+
children: children
|
|
58
|
+
});
|
|
59
|
+
const EditableLabel = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ shape, backgroundColor, variant, value, placeholder, rows, onChange, onKeyDown, onBlur, 'aria-label': ariaLabel }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("textarea", {
|
|
60
|
+
ref: ref,
|
|
61
|
+
value: value,
|
|
62
|
+
placeholder: placeholder,
|
|
63
|
+
rows: rows,
|
|
64
|
+
"aria-label": ariaLabel,
|
|
65
|
+
onChange: onChange,
|
|
66
|
+
onKeyDown: onKeyDown,
|
|
67
|
+
onBlur: onBlur,
|
|
68
|
+
className: (0, apollo_wind_namespaceObject.cn)('nodrag nowheel resize-none font-[inherit] text-foreground border-none rounded-sm outline-1 outline-dashed outline-border-de-emp max-w-full', 'subtext' === variant ? 'text-xs leading-[18px] font-normal mb-0' : 'text-sm leading-[18px] font-semibold mb-0.5', 'rectangle' === shape ? 'field-sizing-fixed w-full' : 'field-sizing-content text-center', backgroundColor && 'px-1.5 py-0.5'),
|
|
69
|
+
style: backgroundColor ? {
|
|
70
|
+
backgroundColor
|
|
71
|
+
} : void 0
|
|
72
|
+
}));
|
|
73
|
+
EditableLabel.displayName = 'EditableLabel';
|
|
74
|
+
const EmptyLabelPlaceholder = ({ onDoubleClick })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
75
|
+
type: "button",
|
|
76
|
+
onDoubleClick: onDoubleClick,
|
|
77
|
+
className: "nodrag nowheel text-sm leading-[18px] font-semibold text-foreground-muted bg-transparent border border-dashed border-border-de-emp rounded-sm cursor-pointer opacity-0 transition-opacity duration-200 min-w-5 min-h-5 hover:opacity-100",
|
|
78
|
+
"aria-label": "Add node label",
|
|
79
|
+
"data-testid": "empty-label-placeholder"
|
|
80
|
+
});
|
|
43
81
|
const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackgroundColor, shape, hasBottomHandles, selected, dragging, centerAdornment, readonly, onChange })=>{
|
|
44
82
|
const [isEditing, setIsEditing] = (0, external_react_namespaceObject.useState)(false);
|
|
45
83
|
const [localLabel, setLocalLabel] = (0, external_react_namespaceObject.useState)('');
|
|
@@ -50,7 +88,7 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
50
88
|
const handleSave = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
51
89
|
setIsEditing(false);
|
|
52
90
|
setFocusTarget(null);
|
|
53
|
-
if (localLabel !== label || localSubLabel !== subLabel) onChange({
|
|
91
|
+
if (localLabel !== label || localSubLabel !== subLabel) onChange?.({
|
|
54
92
|
label: localLabel,
|
|
55
93
|
subLabel: localSubLabel
|
|
56
94
|
});
|
|
@@ -124,27 +162,23 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
124
162
|
}, [
|
|
125
163
|
handleSave
|
|
126
164
|
]);
|
|
127
|
-
if (!label && !subLabel && !isEditing) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
165
|
+
if (!label && !subLabel && !isEditing) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_BaseNodeTextContainer_cjs_namespaceObject.BaseTextContainer, {
|
|
128
166
|
hasBottomHandles: hasBottomHandles,
|
|
129
167
|
shape: shape,
|
|
130
168
|
children: [
|
|
131
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
132
|
-
onDoubleClick: readonly ? void 0 : handleDoubleClick(labelInputRef)
|
|
133
|
-
className: "nodrag nowheel",
|
|
134
|
-
role: "button",
|
|
135
|
-
"aria-label": "Add node label",
|
|
136
|
-
"data-testid": "empty-label-placeholder"
|
|
169
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(EmptyLabelPlaceholder, {
|
|
170
|
+
onDoubleClick: readonly ? void 0 : handleDoubleClick(labelInputRef)
|
|
137
171
|
}),
|
|
138
172
|
centerAdornment
|
|
139
173
|
]
|
|
140
174
|
});
|
|
141
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
175
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_BaseNodeTextContainer_cjs_namespaceObject.BaseTextContainer, {
|
|
142
176
|
hasBottomHandles: hasBottomHandles,
|
|
143
177
|
shape: shape,
|
|
144
178
|
children: [
|
|
145
179
|
isEditing ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
146
180
|
children: [
|
|
147
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
181
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(EditableLabel, {
|
|
148
182
|
ref: labelInputRef,
|
|
149
183
|
value: localLabel,
|
|
150
184
|
onChange: (e)=>setLocalLabel(e.target.value),
|
|
@@ -153,13 +187,11 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
153
187
|
shape: shape,
|
|
154
188
|
variant: "normal",
|
|
155
189
|
backgroundColor: labelBackgroundColor,
|
|
156
|
-
className: "nodrag nowheel",
|
|
157
190
|
placeholder: "Name",
|
|
158
191
|
rows: 'rectangle' === shape ? 1 : void 0,
|
|
159
|
-
role: "textbox",
|
|
160
192
|
"aria-label": "Edit node name"
|
|
161
193
|
}),
|
|
162
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
194
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(EditableLabel, {
|
|
163
195
|
ref: subLabelInputRef,
|
|
164
196
|
value: localSubLabel,
|
|
165
197
|
onChange: (e)=>setLocalSubLabel(e.target.value),
|
|
@@ -167,24 +199,22 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
167
199
|
onBlur: handleBlur,
|
|
168
200
|
shape: shape,
|
|
169
201
|
variant: "subtext",
|
|
170
|
-
className: "nodrag nowheel",
|
|
171
202
|
placeholder: "Description",
|
|
172
203
|
rows: 'rectangle' === shape ? 2 : void 0,
|
|
173
|
-
role: "textbox",
|
|
174
204
|
"aria-label": "Edit node description"
|
|
175
205
|
})
|
|
176
206
|
]
|
|
177
207
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ConditionalTooltip, {
|
|
178
208
|
content: labelTooltip,
|
|
179
209
|
children: [
|
|
180
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
210
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Header, {
|
|
181
211
|
shape: shape,
|
|
182
212
|
backgroundColor: labelBackgroundColor,
|
|
183
213
|
onDoubleClick: readonly ? void 0 : handleDoubleClick(labelInputRef),
|
|
184
214
|
"data-testid": "node-label",
|
|
185
215
|
children: label
|
|
186
216
|
}),
|
|
187
|
-
subLabel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
217
|
+
subLabel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SubHeader, {
|
|
188
218
|
shape: shape,
|
|
189
219
|
onDoubleClick: readonly ? void 0 : handleDoubleClick(subLabelInputRef),
|
|
190
220
|
"data-testid": "node-sublabel",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeLabel.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/NodeLabel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeLabel.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/NodeLabel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAClE;AA4TD,eAAO,MAAM,SAAS,mLAjKnB,cAAc,6CAiK+B,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "@uipath/apollo-wind";
|
|
3
|
+
import { forwardRef, memo, useCallback, useEffect, useRef, useState } from "react";
|
|
3
4
|
import { CanvasTooltip } from "../CanvasTooltip.js";
|
|
4
|
-
import {
|
|
5
|
+
import { BaseTextContainer } from "./BaseNodeTextContainer.js";
|
|
5
6
|
const ConditionalTooltip = ({ content, children })=>{
|
|
6
7
|
if (!content) return children;
|
|
7
8
|
return /*#__PURE__*/ jsx(CanvasTooltip, {
|
|
@@ -12,6 +13,43 @@ const ConditionalTooltip = ({ content, children })=>{
|
|
|
12
13
|
children: children
|
|
13
14
|
});
|
|
14
15
|
};
|
|
16
|
+
const Header = ({ shape, backgroundColor, onDoubleClick, children, 'data-testid': dataTestId })=>/*#__PURE__*/ jsx("div", {
|
|
17
|
+
"data-testid": dataTestId,
|
|
18
|
+
onDoubleClick: onDoubleClick,
|
|
19
|
+
className: cn('text-center text-sm leading-[18px] font-semibold text-foreground overflow-hidden', backgroundColor && 'px-1.5 py-0.5 rounded-sm', 'rectangle' === shape ? 'w-full text-left whitespace-nowrap text-ellipsis' : 'break-all line-clamp-3'),
|
|
20
|
+
style: backgroundColor ? {
|
|
21
|
+
backgroundColor
|
|
22
|
+
} : void 0,
|
|
23
|
+
children: children
|
|
24
|
+
});
|
|
25
|
+
const SubHeader = ({ shape, onDoubleClick, children, 'data-testid': dataTestId })=>/*#__PURE__*/ jsx("div", {
|
|
26
|
+
"data-testid": dataTestId,
|
|
27
|
+
onDoubleClick: onDoubleClick,
|
|
28
|
+
className: cn('text-center text-xs leading-[18px] text-foreground-muted break-all overflow-hidden', 'rectangle' === shape ? 'w-full text-left line-clamp-2' : 'line-clamp-5'),
|
|
29
|
+
children: children
|
|
30
|
+
});
|
|
31
|
+
const EditableLabel = /*#__PURE__*/ forwardRef(({ shape, backgroundColor, variant, value, placeholder, rows, onChange, onKeyDown, onBlur, 'aria-label': ariaLabel }, ref)=>/*#__PURE__*/ jsx("textarea", {
|
|
32
|
+
ref: ref,
|
|
33
|
+
value: value,
|
|
34
|
+
placeholder: placeholder,
|
|
35
|
+
rows: rows,
|
|
36
|
+
"aria-label": ariaLabel,
|
|
37
|
+
onChange: onChange,
|
|
38
|
+
onKeyDown: onKeyDown,
|
|
39
|
+
onBlur: onBlur,
|
|
40
|
+
className: cn('nodrag nowheel resize-none font-[inherit] text-foreground border-none rounded-sm outline-1 outline-dashed outline-border-de-emp max-w-full', 'subtext' === variant ? 'text-xs leading-[18px] font-normal mb-0' : 'text-sm leading-[18px] font-semibold mb-0.5', 'rectangle' === shape ? 'field-sizing-fixed w-full' : 'field-sizing-content text-center', backgroundColor && 'px-1.5 py-0.5'),
|
|
41
|
+
style: backgroundColor ? {
|
|
42
|
+
backgroundColor
|
|
43
|
+
} : void 0
|
|
44
|
+
}));
|
|
45
|
+
EditableLabel.displayName = 'EditableLabel';
|
|
46
|
+
const EmptyLabelPlaceholder = ({ onDoubleClick })=>/*#__PURE__*/ jsx("button", {
|
|
47
|
+
type: "button",
|
|
48
|
+
onDoubleClick: onDoubleClick,
|
|
49
|
+
className: "nodrag nowheel text-sm leading-[18px] font-semibold text-foreground-muted bg-transparent border border-dashed border-border-de-emp rounded-sm cursor-pointer opacity-0 transition-opacity duration-200 min-w-5 min-h-5 hover:opacity-100",
|
|
50
|
+
"aria-label": "Add node label",
|
|
51
|
+
"data-testid": "empty-label-placeholder"
|
|
52
|
+
});
|
|
15
53
|
const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackgroundColor, shape, hasBottomHandles, selected, dragging, centerAdornment, readonly, onChange })=>{
|
|
16
54
|
const [isEditing, setIsEditing] = useState(false);
|
|
17
55
|
const [localLabel, setLocalLabel] = useState('');
|
|
@@ -22,7 +60,7 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
22
60
|
const handleSave = useCallback(()=>{
|
|
23
61
|
setIsEditing(false);
|
|
24
62
|
setFocusTarget(null);
|
|
25
|
-
if (localLabel !== label || localSubLabel !== subLabel) onChange({
|
|
63
|
+
if (localLabel !== label || localSubLabel !== subLabel) onChange?.({
|
|
26
64
|
label: localLabel,
|
|
27
65
|
subLabel: localSubLabel
|
|
28
66
|
});
|
|
@@ -101,11 +139,7 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
101
139
|
shape: shape,
|
|
102
140
|
children: [
|
|
103
141
|
/*#__PURE__*/ jsx(EmptyLabelPlaceholder, {
|
|
104
|
-
onDoubleClick: readonly ? void 0 : handleDoubleClick(labelInputRef)
|
|
105
|
-
className: "nodrag nowheel",
|
|
106
|
-
role: "button",
|
|
107
|
-
"aria-label": "Add node label",
|
|
108
|
-
"data-testid": "empty-label-placeholder"
|
|
142
|
+
onDoubleClick: readonly ? void 0 : handleDoubleClick(labelInputRef)
|
|
109
143
|
}),
|
|
110
144
|
centerAdornment
|
|
111
145
|
]
|
|
@@ -125,10 +159,8 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
125
159
|
shape: shape,
|
|
126
160
|
variant: "normal",
|
|
127
161
|
backgroundColor: labelBackgroundColor,
|
|
128
|
-
className: "nodrag nowheel",
|
|
129
162
|
placeholder: "Name",
|
|
130
163
|
rows: 'rectangle' === shape ? 1 : void 0,
|
|
131
|
-
role: "textbox",
|
|
132
164
|
"aria-label": "Edit node name"
|
|
133
165
|
}),
|
|
134
166
|
/*#__PURE__*/ jsx(EditableLabel, {
|
|
@@ -139,24 +171,22 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
139
171
|
onBlur: handleBlur,
|
|
140
172
|
shape: shape,
|
|
141
173
|
variant: "subtext",
|
|
142
|
-
className: "nodrag nowheel",
|
|
143
174
|
placeholder: "Description",
|
|
144
175
|
rows: 'rectangle' === shape ? 2 : void 0,
|
|
145
|
-
role: "textbox",
|
|
146
176
|
"aria-label": "Edit node description"
|
|
147
177
|
})
|
|
148
178
|
]
|
|
149
179
|
}) : /*#__PURE__*/ jsxs(ConditionalTooltip, {
|
|
150
180
|
content: labelTooltip,
|
|
151
181
|
children: [
|
|
152
|
-
/*#__PURE__*/ jsx(
|
|
182
|
+
/*#__PURE__*/ jsx(Header, {
|
|
153
183
|
shape: shape,
|
|
154
184
|
backgroundColor: labelBackgroundColor,
|
|
155
185
|
onDoubleClick: readonly ? void 0 : handleDoubleClick(labelInputRef),
|
|
156
186
|
"data-testid": "node-label",
|
|
157
187
|
children: label
|
|
158
188
|
}),
|
|
159
|
-
subLabel && /*#__PURE__*/ jsx(
|
|
189
|
+
subLabel && /*#__PURE__*/ jsx(SubHeader, {
|
|
160
190
|
shape: shape,
|
|
161
191
|
onDoubleClick: readonly ? void 0 : handleDoubleClick(subLabelInputRef),
|
|
162
192
|
"data-testid": "node-sublabel",
|