@uipath/apollo-react 4.7.0 → 4.8.1
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/AgentCanvas/agent-flow.manifest.d.ts +2 -2
- package/dist/canvas/components/AgentCanvas/nodes/AgentNode.cjs +0 -4
- package/dist/canvas/components/AgentCanvas/nodes/AgentNode.d.ts.map +1 -1
- package/dist/canvas/components/AgentCanvas/nodes/AgentNode.js +0 -4
- package/dist/canvas/components/AgentCanvas/nodes/ResourceNode.cjs +5 -10
- package/dist/canvas/components/AgentCanvas/nodes/ResourceNode.d.ts.map +1 -1
- package/dist/canvas/components/AgentCanvas/nodes/ResourceNode.js +5 -10
- package/dist/canvas/components/BaseNode/BaseNode.cjs +29 -21
- package/dist/canvas/components/BaseNode/BaseNode.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.js +30 -22
- package/dist/canvas/components/BaseNode/BaseNodeContainer.cjs +1 -1
- package/dist/canvas/components/BaseNode/BaseNodeContainer.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNodeContainer.js +1 -1
- package/dist/canvas/components/BaseNode/BaseNodeInnerShape.cjs +1 -1
- package/dist/canvas/components/BaseNode/BaseNodeInnerShape.js +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandle.cjs +75 -128
- package/dist/canvas/components/ButtonHandle/ButtonHandle.d.ts +6 -5
- package/dist/canvas/components/ButtonHandle/ButtonHandle.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandle.js +77 -130
- package/dist/canvas/components/ButtonHandle/HandleButton.cjs +152 -0
- package/dist/canvas/components/ButtonHandle/HandleButton.d.ts +16 -0
- package/dist/canvas/components/ButtonHandle/HandleButton.d.ts.map +1 -0
- package/dist/canvas/components/ButtonHandle/HandleButton.js +115 -0
- package/dist/canvas/components/ButtonHandle/HandleLabel.cjs +62 -0
- package/dist/canvas/components/ButtonHandle/HandleLabel.d.ts +9 -0
- package/dist/canvas/components/ButtonHandle/HandleLabel.d.ts.map +1 -0
- package/dist/canvas/components/ButtonHandle/HandleLabel.js +28 -0
- package/dist/canvas/components/ButtonHandle/HandleNotch.cjs +53 -0
- package/dist/canvas/components/ButtonHandle/HandleNotch.d.ts +9 -0
- package/dist/canvas/components/ButtonHandle/HandleNotch.d.ts.map +1 -0
- package/dist/canvas/components/ButtonHandle/HandleNotch.js +19 -0
- package/dist/canvas/components/ButtonHandle/SmartHandle.cjs +28 -91
- package/dist/canvas/components/ButtonHandle/SmartHandle.d.ts +1 -2
- package/dist/canvas/components/ButtonHandle/SmartHandle.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/SmartHandle.js +29 -92
- package/dist/canvas/components/ButtonHandle/useButtonHandles.cjs +5 -4
- package/dist/canvas/components/ButtonHandle/useButtonHandles.d.ts +4 -2
- package/dist/canvas/components/ButtonHandle/useButtonHandles.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/useButtonHandles.js +5 -4
- package/dist/canvas/constants.cjs +4 -0
- package/dist/canvas/constants.d.ts +1 -0
- package/dist/canvas/constants.d.ts.map +1 -1
- package/dist/canvas/constants.js +2 -1
- package/dist/canvas/schema/node-definition/category-manifest.cjs +2 -2
- package/dist/canvas/schema/node-definition/category-manifest.d.ts +2 -2
- package/dist/canvas/schema/node-definition/category-manifest.js +2 -2
- package/dist/canvas/storybook-utils/manifests/index.d.ts +2 -2
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/package.json +2 -2
- package/dist/canvas/components/ButtonHandle/ButtonHandle.styles.cjs +0 -220
- package/dist/canvas/components/ButtonHandle/ButtonHandle.styles.d.ts +0 -46
- package/dist/canvas/components/ButtonHandle/ButtonHandle.styles.d.ts.map +0 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandle.styles.js +0 -161
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/apollo-react",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.1",
|
|
4
4
|
"description": "Apollo Design System - React component library with Material UI theming",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
"zod": "^4.3.5",
|
|
203
203
|
"zustand": "^5.0.9",
|
|
204
204
|
"@uipath/apollo-core": "5.9.0",
|
|
205
|
-
"@uipath/apollo-wind": "2.
|
|
205
|
+
"@uipath/apollo-wind": "2.6.0"
|
|
206
206
|
},
|
|
207
207
|
"devDependencies": {
|
|
208
208
|
"@lingui/cli": "^5.6.1",
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.n = (module)=>{
|
|
5
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
-
__webpack_require__.d(getter, {
|
|
7
|
-
a: getter
|
|
8
|
-
});
|
|
9
|
-
return getter;
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
|
-
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: definition[key]
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
})();
|
|
20
|
-
(()=>{
|
|
21
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
-
})();
|
|
23
|
-
(()=>{
|
|
24
|
-
__webpack_require__.r = (exports1)=>{
|
|
25
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
-
value: 'Module'
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
-
value: true
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
})();
|
|
33
|
-
var __webpack_exports__ = {};
|
|
34
|
-
__webpack_require__.r(__webpack_exports__);
|
|
35
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
-
StyledLine: ()=>StyledLine,
|
|
37
|
-
StyledNotch: ()=>StyledNotch,
|
|
38
|
-
StyledWrapper: ()=>StyledWrapper,
|
|
39
|
-
StyledAddButton: ()=>StyledAddButton,
|
|
40
|
-
StyledHandle: ()=>StyledHandle,
|
|
41
|
-
StyledLabel: ()=>StyledLabel
|
|
42
|
-
});
|
|
43
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
44
|
-
const react_namespaceObject = require("@emotion/react");
|
|
45
|
-
const styled_namespaceObject = require("@emotion/styled");
|
|
46
|
-
var styled_default = /*#__PURE__*/ __webpack_require__.n(styled_namespaceObject);
|
|
47
|
-
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
48
|
-
const external_motion_react_namespaceObject = require("motion/react");
|
|
49
|
-
const external_useButtonHandleSizeAndPosition_cjs_namespaceObject = require("./useButtonHandleSizeAndPosition.cjs");
|
|
50
|
-
const StyledAddButton = styled_default()(external_motion_react_namespaceObject.motion.div)`
|
|
51
|
-
display: flex;
|
|
52
|
-
align-items: center;
|
|
53
|
-
justify-content: center;
|
|
54
|
-
width: 24px;
|
|
55
|
-
height: 24px;
|
|
56
|
-
background: var(--canvas-background);
|
|
57
|
-
color: var(--canvas-foreground-emp);
|
|
58
|
-
border-radius: 50%;
|
|
59
|
-
border: 1px solid var(--canvas-border-de-emp);
|
|
60
|
-
cursor: pointer;
|
|
61
|
-
transition:
|
|
62
|
-
background-color 0.2s ease,
|
|
63
|
-
color 0.2s ease,
|
|
64
|
-
border-color 0.2s ease;
|
|
65
|
-
|
|
66
|
-
&:hover {
|
|
67
|
-
background-color: var(--canvas-selection-indicator);
|
|
68
|
-
color: var(--canvas-background);
|
|
69
|
-
border-color: var(--canvas-selection-indicator);
|
|
70
|
-
}
|
|
71
|
-
`;
|
|
72
|
-
const StyledWrapper = styled_default().div`
|
|
73
|
-
position: absolute;
|
|
74
|
-
display: flex;
|
|
75
|
-
align-items: center;
|
|
76
|
-
justify-content: center;
|
|
77
|
-
pointer-events: none;
|
|
78
|
-
|
|
79
|
-
${(p)=>p.$position === react_cjs_namespaceObject.Position.Top && (0, react_namespaceObject.css)`
|
|
80
|
-
flex-direction: column-reverse;
|
|
81
|
-
bottom: 100%;
|
|
82
|
-
left: 50%;
|
|
83
|
-
transform: translateX(-50%);
|
|
84
|
-
`}
|
|
85
|
-
${(p)=>p.$position === react_cjs_namespaceObject.Position.Bottom && (0, react_namespaceObject.css)`
|
|
86
|
-
flex-direction: column;
|
|
87
|
-
top: 100%;
|
|
88
|
-
left: 50%;
|
|
89
|
-
transform: translateX(-50%);
|
|
90
|
-
`}
|
|
91
|
-
${(p)=>p.$position === react_cjs_namespaceObject.Position.Left && (0, react_namespaceObject.css)`
|
|
92
|
-
flex-direction: row-reverse;
|
|
93
|
-
right: 100%;
|
|
94
|
-
top: 50%;
|
|
95
|
-
transform: translateY(-50%);
|
|
96
|
-
`}
|
|
97
|
-
${(p)=>p.$position === react_cjs_namespaceObject.Position.Right && (0, react_namespaceObject.css)`
|
|
98
|
-
flex-direction: row;
|
|
99
|
-
left: 100%;
|
|
100
|
-
top: 50%;
|
|
101
|
-
transform: translateY(-50%);
|
|
102
|
-
`}
|
|
103
|
-
`;
|
|
104
|
-
const StyledLine = styled_default().div`
|
|
105
|
-
background-color: transparent;
|
|
106
|
-
border-style: solid;
|
|
107
|
-
border-width: 1px;
|
|
108
|
-
border-color: ${(p)=>p.$selected ? 'var(--canvas-selection-indicator)' : 'var(--canvas-border-de-emp)'};
|
|
109
|
-
height: ${(p)=>p.$isVertical ? p.$size : '1px'};
|
|
110
|
-
width: ${(p)=>p.$isVertical ? '1px' : p.$size};
|
|
111
|
-
transition: border-color 0.2s ease-in-out;
|
|
112
|
-
`;
|
|
113
|
-
const StyledLabel = styled_default().div`
|
|
114
|
-
position: absolute;
|
|
115
|
-
background-color: ${(p)=>p.$backgroundColor};
|
|
116
|
-
padding: 2px 6px;
|
|
117
|
-
border-radius: 4px;
|
|
118
|
-
z-index: 1;
|
|
119
|
-
white-space: nowrap;
|
|
120
|
-
user-select: none;
|
|
121
|
-
${(p)=>p.$shouldTruncate && (0, react_namespaceObject.css)`
|
|
122
|
-
max-width: 50px;
|
|
123
|
-
overflow: hidden;
|
|
124
|
-
`}
|
|
125
|
-
|
|
126
|
-
${(p)=>p.$position === react_cjs_namespaceObject.Position.Top && (0, react_namespaceObject.css)`
|
|
127
|
-
bottom: calc(100% + 4px);
|
|
128
|
-
left: 50%;
|
|
129
|
-
transform: translateX(-50%);
|
|
130
|
-
`}
|
|
131
|
-
${(p)=>p.$position === react_cjs_namespaceObject.Position.Bottom && (0, react_namespaceObject.css)`
|
|
132
|
-
top: calc(100% + 4px);
|
|
133
|
-
left: 50%;
|
|
134
|
-
transform: translateX(-50%);
|
|
135
|
-
`}
|
|
136
|
-
${(p)=>p.$position === react_cjs_namespaceObject.Position.Left && (0, react_namespaceObject.css)`
|
|
137
|
-
right: calc(100% + 4px);
|
|
138
|
-
top: 50%;
|
|
139
|
-
transform: translateY(-50%);
|
|
140
|
-
`}
|
|
141
|
-
${(p)=>p.$position === react_cjs_namespaceObject.Position.Right && (0, react_namespaceObject.css)`
|
|
142
|
-
left: calc(100% + 4px);
|
|
143
|
-
top: 50%;
|
|
144
|
-
transform: translateY(-50%);
|
|
145
|
-
`}
|
|
146
|
-
`;
|
|
147
|
-
const StyledNotch = styled_default().div`
|
|
148
|
-
width: ${(p)=>{
|
|
149
|
-
if ('input' === p.$handleType && !p.$isVertical) return '8px';
|
|
150
|
-
if ('artifact' === p.$handleType) return '10px';
|
|
151
|
-
return '12px';
|
|
152
|
-
}};
|
|
153
|
-
height: ${(p)=>{
|
|
154
|
-
if ('input' === p.$handleType && p.$isVertical) return '8px';
|
|
155
|
-
if ('artifact' === p.$handleType) return '10px';
|
|
156
|
-
return '12px';
|
|
157
|
-
}};
|
|
158
|
-
border-width: 2px;
|
|
159
|
-
border-style: solid;
|
|
160
|
-
border-color: ${(p)=>{
|
|
161
|
-
if (p.$selected || p.$hovered) return 'var(--canvas-primary)';
|
|
162
|
-
return 'var(--canvas-border)';
|
|
163
|
-
}};
|
|
164
|
-
border-radius: ${(p)=>'artifact' === p.$handleType || 'input' === p.$handleType ? 0 : '50%'};
|
|
165
|
-
transform: ${(p)=>'artifact' === p.$handleType ? 'rotate(45deg)' : 'none'};
|
|
166
|
-
background-color: ${(p)=>{
|
|
167
|
-
if (p.$selected || p.$hovered) return 'var(--canvas-primary)';
|
|
168
|
-
return 'var(--canvas-background, white)';
|
|
169
|
-
}};
|
|
170
|
-
opacity: ${(p)=>p.$showNotch ? 1 : 0};
|
|
171
|
-
pointer-events: none;
|
|
172
|
-
transition: all 0.2s ease-in-out;
|
|
173
|
-
`;
|
|
174
|
-
const StyledHandle = (props)=>{
|
|
175
|
-
const { $total, $visible, $positionPercent, $customPositionAndOffsets, ...handleProps } = props;
|
|
176
|
-
const { position } = handleProps;
|
|
177
|
-
const { width, height, top, bottom, left, right, transform } = (0, external_useButtonHandleSizeAndPosition_cjs_namespaceObject.useButtonHandleSizeAndPosition)({
|
|
178
|
-
position,
|
|
179
|
-
positionPercent: $positionPercent,
|
|
180
|
-
numHandles: $total,
|
|
181
|
-
customPositionAndOffsets: $customPositionAndOffsets
|
|
182
|
-
});
|
|
183
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.Handle, {
|
|
184
|
-
...handleProps,
|
|
185
|
-
style: {
|
|
186
|
-
width,
|
|
187
|
-
height,
|
|
188
|
-
display: 'flex',
|
|
189
|
-
alignItems: 'center',
|
|
190
|
-
justifyContent: 'center',
|
|
191
|
-
borderWidth: 0,
|
|
192
|
-
borderRadius: 0,
|
|
193
|
-
backgroundColor: 'transparent',
|
|
194
|
-
opacity: $visible ? 1 : 0,
|
|
195
|
-
cursor: 'crosshair',
|
|
196
|
-
top,
|
|
197
|
-
bottom,
|
|
198
|
-
left,
|
|
199
|
-
right,
|
|
200
|
-
transform
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
};
|
|
204
|
-
exports.StyledAddButton = __webpack_exports__.StyledAddButton;
|
|
205
|
-
exports.StyledHandle = __webpack_exports__.StyledHandle;
|
|
206
|
-
exports.StyledLabel = __webpack_exports__.StyledLabel;
|
|
207
|
-
exports.StyledLine = __webpack_exports__.StyledLine;
|
|
208
|
-
exports.StyledNotch = __webpack_exports__.StyledNotch;
|
|
209
|
-
exports.StyledWrapper = __webpack_exports__.StyledWrapper;
|
|
210
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
211
|
-
"StyledAddButton",
|
|
212
|
-
"StyledHandle",
|
|
213
|
-
"StyledLabel",
|
|
214
|
-
"StyledLine",
|
|
215
|
-
"StyledNotch",
|
|
216
|
-
"StyledWrapper"
|
|
217
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
218
|
-
Object.defineProperty(exports, '__esModule', {
|
|
219
|
-
value: true
|
|
220
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { type HandleProps, Position } from '../../xyflow/react.ts';
|
|
2
|
-
import type { HandleConfigurationSpecificPosition } from '../../schema/node-definition/handle';
|
|
3
|
-
export declare const StyledAddButton: import("@emotion/styled").StyledComponent<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
|
|
4
|
-
theme?: import("@emotion/react").Theme;
|
|
5
|
-
}, {}, {}>;
|
|
6
|
-
export declare const StyledWrapper: import("@emotion/styled").StyledComponent<{
|
|
7
|
-
theme?: import("@emotion/react").Theme;
|
|
8
|
-
as?: React.ElementType;
|
|
9
|
-
} & {
|
|
10
|
-
$position: Position;
|
|
11
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
-
export declare const StyledLine: import("@emotion/styled").StyledComponent<{
|
|
13
|
-
theme?: import("@emotion/react").Theme;
|
|
14
|
-
as?: React.ElementType;
|
|
15
|
-
} & {
|
|
16
|
-
$isVertical: boolean;
|
|
17
|
-
$selected: boolean;
|
|
18
|
-
$size: string;
|
|
19
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
20
|
-
export declare const StyledLabel: import("@emotion/styled").StyledComponent<{
|
|
21
|
-
theme?: import("@emotion/react").Theme;
|
|
22
|
-
as?: React.ElementType;
|
|
23
|
-
} & {
|
|
24
|
-
$position: Position;
|
|
25
|
-
$backgroundColor: string;
|
|
26
|
-
$shouldTruncate?: boolean;
|
|
27
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
28
|
-
export declare const StyledNotch: import("@emotion/styled").StyledComponent<{
|
|
29
|
-
theme?: import("@emotion/react").Theme;
|
|
30
|
-
as?: React.ElementType;
|
|
31
|
-
} & {
|
|
32
|
-
$notchColor: string;
|
|
33
|
-
$handleType: "artifact" | "input" | "output";
|
|
34
|
-
$isVertical?: boolean;
|
|
35
|
-
$visible: boolean;
|
|
36
|
-
$selected: boolean;
|
|
37
|
-
$hovered?: boolean;
|
|
38
|
-
$showNotch?: boolean;
|
|
39
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
40
|
-
export declare const StyledHandle: (props: HandleProps & {
|
|
41
|
-
$positionPercent: number;
|
|
42
|
-
$total: number;
|
|
43
|
-
$visible: boolean;
|
|
44
|
-
$customPositionAndOffsets?: HandleConfigurationSpecificPosition;
|
|
45
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
46
|
-
//# sourceMappingURL=ButtonHandle.styles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonHandle.styles.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/ButtonHandle/ButtonHandle.styles.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAU,KAAK,WAAW,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAE9F,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,qCAAqC,CAAC;AAG/F,eAAO,MAAM,eAAe;;UAqB3B,CAAC;AAEF,eAAO,MAAM,aAAa;;;;eAA2B,QAAQ;yGAuC5D,CAAC;AAEF,eAAO,MAAM,UAAU;;;;iBAA6B,OAAO;eAAa,OAAO;WAAS,MAAM;yGAS7F,CAAC;AAEF,eAAO,MAAM,WAAW;;;;eACX,QAAQ;sBACD,MAAM;sBACN,OAAO;yGA4C1B,CAAC;AAEF,eAAO,MAAM,WAAW;;;;iBACT,MAAM;iBACN,UAAU,GAAG,OAAO,GAAG,QAAQ;kBAC9B,OAAO;cACX,OAAO;eACN,OAAO;eACP,OAAO;iBACL,OAAO;yGA2BrB,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,OAAO,WAAW,GAAG;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,yBAAyB,CAAC,EAAE,mCAAmC,CAAC;CACjE,4CAkCF,CAAC"}
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { css } from "@emotion/react";
|
|
3
|
-
import styled from "@emotion/styled";
|
|
4
|
-
import { Handle, Position } from "../../xyflow/react.js";
|
|
5
|
-
import { motion } from "motion/react";
|
|
6
|
-
import { useButtonHandleSizeAndPosition } from "./useButtonHandleSizeAndPosition.js";
|
|
7
|
-
const StyledAddButton = styled(motion.div)`
|
|
8
|
-
display: flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
width: 24px;
|
|
12
|
-
height: 24px;
|
|
13
|
-
background: var(--canvas-background);
|
|
14
|
-
color: var(--canvas-foreground-emp);
|
|
15
|
-
border-radius: 50%;
|
|
16
|
-
border: 1px solid var(--canvas-border-de-emp);
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
transition:
|
|
19
|
-
background-color 0.2s ease,
|
|
20
|
-
color 0.2s ease,
|
|
21
|
-
border-color 0.2s ease;
|
|
22
|
-
|
|
23
|
-
&:hover {
|
|
24
|
-
background-color: var(--canvas-selection-indicator);
|
|
25
|
-
color: var(--canvas-background);
|
|
26
|
-
border-color: var(--canvas-selection-indicator);
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
29
|
-
const StyledWrapper = styled.div`
|
|
30
|
-
position: absolute;
|
|
31
|
-
display: flex;
|
|
32
|
-
align-items: center;
|
|
33
|
-
justify-content: center;
|
|
34
|
-
pointer-events: none;
|
|
35
|
-
|
|
36
|
-
${(p)=>p.$position === Position.Top && css`
|
|
37
|
-
flex-direction: column-reverse;
|
|
38
|
-
bottom: 100%;
|
|
39
|
-
left: 50%;
|
|
40
|
-
transform: translateX(-50%);
|
|
41
|
-
`}
|
|
42
|
-
${(p)=>p.$position === Position.Bottom && css`
|
|
43
|
-
flex-direction: column;
|
|
44
|
-
top: 100%;
|
|
45
|
-
left: 50%;
|
|
46
|
-
transform: translateX(-50%);
|
|
47
|
-
`}
|
|
48
|
-
${(p)=>p.$position === Position.Left && css`
|
|
49
|
-
flex-direction: row-reverse;
|
|
50
|
-
right: 100%;
|
|
51
|
-
top: 50%;
|
|
52
|
-
transform: translateY(-50%);
|
|
53
|
-
`}
|
|
54
|
-
${(p)=>p.$position === Position.Right && css`
|
|
55
|
-
flex-direction: row;
|
|
56
|
-
left: 100%;
|
|
57
|
-
top: 50%;
|
|
58
|
-
transform: translateY(-50%);
|
|
59
|
-
`}
|
|
60
|
-
`;
|
|
61
|
-
const StyledLine = styled.div`
|
|
62
|
-
background-color: transparent;
|
|
63
|
-
border-style: solid;
|
|
64
|
-
border-width: 1px;
|
|
65
|
-
border-color: ${(p)=>p.$selected ? 'var(--canvas-selection-indicator)' : 'var(--canvas-border-de-emp)'};
|
|
66
|
-
height: ${(p)=>p.$isVertical ? p.$size : '1px'};
|
|
67
|
-
width: ${(p)=>p.$isVertical ? '1px' : p.$size};
|
|
68
|
-
transition: border-color 0.2s ease-in-out;
|
|
69
|
-
`;
|
|
70
|
-
const StyledLabel = styled.div`
|
|
71
|
-
position: absolute;
|
|
72
|
-
background-color: ${(p)=>p.$backgroundColor};
|
|
73
|
-
padding: 2px 6px;
|
|
74
|
-
border-radius: 4px;
|
|
75
|
-
z-index: 1;
|
|
76
|
-
white-space: nowrap;
|
|
77
|
-
user-select: none;
|
|
78
|
-
${(p)=>p.$shouldTruncate && css`
|
|
79
|
-
max-width: 50px;
|
|
80
|
-
overflow: hidden;
|
|
81
|
-
`}
|
|
82
|
-
|
|
83
|
-
${(p)=>p.$position === Position.Top && css`
|
|
84
|
-
bottom: calc(100% + 4px);
|
|
85
|
-
left: 50%;
|
|
86
|
-
transform: translateX(-50%);
|
|
87
|
-
`}
|
|
88
|
-
${(p)=>p.$position === Position.Bottom && css`
|
|
89
|
-
top: calc(100% + 4px);
|
|
90
|
-
left: 50%;
|
|
91
|
-
transform: translateX(-50%);
|
|
92
|
-
`}
|
|
93
|
-
${(p)=>p.$position === Position.Left && css`
|
|
94
|
-
right: calc(100% + 4px);
|
|
95
|
-
top: 50%;
|
|
96
|
-
transform: translateY(-50%);
|
|
97
|
-
`}
|
|
98
|
-
${(p)=>p.$position === Position.Right && css`
|
|
99
|
-
left: calc(100% + 4px);
|
|
100
|
-
top: 50%;
|
|
101
|
-
transform: translateY(-50%);
|
|
102
|
-
`}
|
|
103
|
-
`;
|
|
104
|
-
const StyledNotch = styled.div`
|
|
105
|
-
width: ${(p)=>{
|
|
106
|
-
if ('input' === p.$handleType && !p.$isVertical) return '8px';
|
|
107
|
-
if ('artifact' === p.$handleType) return '10px';
|
|
108
|
-
return '12px';
|
|
109
|
-
}};
|
|
110
|
-
height: ${(p)=>{
|
|
111
|
-
if ('input' === p.$handleType && p.$isVertical) return '8px';
|
|
112
|
-
if ('artifact' === p.$handleType) return '10px';
|
|
113
|
-
return '12px';
|
|
114
|
-
}};
|
|
115
|
-
border-width: 2px;
|
|
116
|
-
border-style: solid;
|
|
117
|
-
border-color: ${(p)=>{
|
|
118
|
-
if (p.$selected || p.$hovered) return 'var(--canvas-primary)';
|
|
119
|
-
return 'var(--canvas-border)';
|
|
120
|
-
}};
|
|
121
|
-
border-radius: ${(p)=>'artifact' === p.$handleType || 'input' === p.$handleType ? 0 : '50%'};
|
|
122
|
-
transform: ${(p)=>'artifact' === p.$handleType ? 'rotate(45deg)' : 'none'};
|
|
123
|
-
background-color: ${(p)=>{
|
|
124
|
-
if (p.$selected || p.$hovered) return 'var(--canvas-primary)';
|
|
125
|
-
return 'var(--canvas-background, white)';
|
|
126
|
-
}};
|
|
127
|
-
opacity: ${(p)=>p.$showNotch ? 1 : 0};
|
|
128
|
-
pointer-events: none;
|
|
129
|
-
transition: all 0.2s ease-in-out;
|
|
130
|
-
`;
|
|
131
|
-
const StyledHandle = (props)=>{
|
|
132
|
-
const { $total, $visible, $positionPercent, $customPositionAndOffsets, ...handleProps } = props;
|
|
133
|
-
const { position } = handleProps;
|
|
134
|
-
const { width, height, top, bottom, left, right, transform } = useButtonHandleSizeAndPosition({
|
|
135
|
-
position,
|
|
136
|
-
positionPercent: $positionPercent,
|
|
137
|
-
numHandles: $total,
|
|
138
|
-
customPositionAndOffsets: $customPositionAndOffsets
|
|
139
|
-
});
|
|
140
|
-
return /*#__PURE__*/ jsx(Handle, {
|
|
141
|
-
...handleProps,
|
|
142
|
-
style: {
|
|
143
|
-
width,
|
|
144
|
-
height,
|
|
145
|
-
display: 'flex',
|
|
146
|
-
alignItems: 'center',
|
|
147
|
-
justifyContent: 'center',
|
|
148
|
-
borderWidth: 0,
|
|
149
|
-
borderRadius: 0,
|
|
150
|
-
backgroundColor: 'transparent',
|
|
151
|
-
opacity: $visible ? 1 : 0,
|
|
152
|
-
cursor: 'crosshair',
|
|
153
|
-
top,
|
|
154
|
-
bottom,
|
|
155
|
-
left,
|
|
156
|
-
right,
|
|
157
|
-
transform
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
};
|
|
161
|
-
export { StyledAddButton, StyledHandle, StyledLabel, StyledLine, StyledNotch, StyledWrapper };
|