@uipath/apollo-react 4.6.3 → 4.7.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/components/BaseNode/BaseNode.cjs +74 -75
- package/dist/canvas/components/BaseNode/BaseNode.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.js +69 -70
- package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.cjs +68 -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 +34 -0
- package/dist/canvas/components/BaseNode/BaseNodeConfigContext.d.ts +2 -1
- package/dist/canvas/components/BaseNode/BaseNodeConfigContext.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNodeContainer.cjs +88 -0
- package/dist/canvas/components/BaseNode/BaseNodeContainer.d.ts +21 -0
- package/dist/canvas/components/BaseNode/BaseNodeContainer.d.ts.map +1 -0
- package/dist/canvas/components/BaseNode/BaseNodeContainer.js +51 -0
- package/dist/canvas/components/BaseNode/BaseNodeInnerShape.cjs +49 -0
- package/dist/canvas/components/BaseNode/BaseNodeInnerShape.d.ts +9 -0
- package/dist/canvas/components/BaseNode/BaseNodeInnerShape.d.ts.map +1 -0
- package/dist/canvas/components/BaseNode/BaseNodeInnerShape.js +15 -0
- package/dist/canvas/components/BaseNode/BaseNodeMissingManifest.cjs +62 -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 +28 -0
- package/dist/canvas/components/BaseNode/NodeLabel.cjs +64 -18
- package/dist/canvas/components/BaseNode/NodeLabel.d.ts +8 -1
- package/dist/canvas/components/BaseNode/NodeLabel.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/NodeLabel.js +58 -15
- 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/components/CodedAgent/CodedAgentFlow.cjs +4 -4
- package/dist/canvas/components/CodedAgent/CodedAgentFlow.js +4 -4
- 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/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/storybook-utils/manifests/node-definitions.d.ts.map +1 -1
- package/dist/canvas/styles/reactflow-reset.css +12 -0
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/package.json +2 -2
- 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
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
BaseContainer: ()=>BaseContainer,
|
|
28
|
+
getStatusBorder: ()=>getStatusBorder
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
32
|
+
const external_react_namespaceObject = require("react");
|
|
33
|
+
const getStatusBorder = (status)=>{
|
|
34
|
+
switch(status){
|
|
35
|
+
case 'InProgress':
|
|
36
|
+
return 'border-info animate-glow [--glow-color:var(--info)]';
|
|
37
|
+
case 'Completed':
|
|
38
|
+
case 'add':
|
|
39
|
+
return 'border-success';
|
|
40
|
+
case 'Paused':
|
|
41
|
+
case 'Warning':
|
|
42
|
+
case 'WARNING':
|
|
43
|
+
case 'update':
|
|
44
|
+
return 'border-warning animate-glow [--glow-color:var(--warning)]';
|
|
45
|
+
case 'Cancelled':
|
|
46
|
+
case 'Failed':
|
|
47
|
+
case 'Terminated':
|
|
48
|
+
case 'ERROR':
|
|
49
|
+
case 'CRITICAL':
|
|
50
|
+
case 'delete':
|
|
51
|
+
return 'border-error animate-glow [--glow-color:var(--error)]';
|
|
52
|
+
default:
|
|
53
|
+
return '';
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const BaseContainer = ({ isSelected, isHovered, shape, interactionState, executionStatus, validationStatus, suggestionType, hasFooter, background, loading, children })=>{
|
|
57
|
+
const activeStatus = suggestionType ?? validationStatus ?? executionStatus;
|
|
58
|
+
const className = (0, external_react_namespaceObject.useMemo)(()=>(0, apollo_wind_namespaceObject.cn)('relative flex items-center cursor-pointer bg-surface-overlay border-2 border-border', 'w-(--node-w) h-(--node-h) rounded-(--node-radius)', 'rectangle' === shape ? 'flex-row justify-start gap-3 p-2' : 'flex-col justify-center', hasFooter && 'flex-wrap', 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'), [
|
|
59
|
+
shape,
|
|
60
|
+
hasFooter,
|
|
61
|
+
activeStatus,
|
|
62
|
+
isSelected,
|
|
63
|
+
isHovered,
|
|
64
|
+
interactionState
|
|
65
|
+
]);
|
|
66
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
67
|
+
"data-testid": "base-container",
|
|
68
|
+
"data-execution-status": executionStatus,
|
|
69
|
+
"data-interaction-state": interactionState,
|
|
70
|
+
"data-validation-status": validationStatus,
|
|
71
|
+
"data-suggestion-type": suggestionType,
|
|
72
|
+
className: className,
|
|
73
|
+
style: background ? {
|
|
74
|
+
background
|
|
75
|
+
} : void 0,
|
|
76
|
+
"aria-busy": loading || void 0,
|
|
77
|
+
children: children
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
exports.BaseContainer = __webpack_exports__.BaseContainer;
|
|
81
|
+
exports.getStatusBorder = __webpack_exports__.getStatusBorder;
|
|
82
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
83
|
+
"BaseContainer",
|
|
84
|
+
"getStatusBorder"
|
|
85
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
86
|
+
Object.defineProperty(exports, '__esModule', {
|
|
87
|
+
value: true
|
|
88
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { NodeShape } from '../../schema';
|
|
2
|
+
import type { SuggestionType } from '../../types';
|
|
3
|
+
import type { ElementStatusValues } from '../../types/execution';
|
|
4
|
+
import { ValidationErrorSeverity } from '../../types/validation';
|
|
5
|
+
export declare const getStatusBorder: (status?: ElementStatusValues | ValidationErrorSeverity | SuggestionType) => string;
|
|
6
|
+
interface BaseContainerProps {
|
|
7
|
+
isSelected?: boolean;
|
|
8
|
+
isHovered?: boolean;
|
|
9
|
+
shape?: NodeShape;
|
|
10
|
+
interactionState?: string;
|
|
11
|
+
executionStatus?: ElementStatusValues;
|
|
12
|
+
validationStatus?: ValidationErrorSeverity;
|
|
13
|
+
suggestionType?: SuggestionType;
|
|
14
|
+
hasFooter?: boolean;
|
|
15
|
+
background?: string;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare const BaseContainer: ({ isSelected, isHovered, shape, interactionState, executionStatus, validationStatus, suggestionType, hasFooter, background, loading, children, }: BaseContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=BaseNodeContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseNodeContainer.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,eAAO,MAAM,eAAe,GAC1B,SAAS,mBAAmB,GAAG,uBAAuB,GAAG,cAAc,KACtE,MAsBF,CAAC;AAEF,UAAU,kBAAkB;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACtC,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;IAC3C,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,GAAI,kJAY3B,kBAAkB,4CAoCpB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@uipath/apollo-wind";
|
|
3
|
+
import { useMemo } from "react";
|
|
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';
|
|
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, hasFooter, background, loading, children })=>{
|
|
28
|
+
const activeStatus = suggestionType ?? validationStatus ?? executionStatus;
|
|
29
|
+
const className = useMemo(()=>cn('relative flex items-center cursor-pointer bg-surface-overlay border-2 border-border', 'w-(--node-w) h-(--node-h) rounded-(--node-radius)', 'rectangle' === shape ? 'flex-row justify-start gap-3 p-2' : 'flex-col justify-center', hasFooter && 'flex-wrap', 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'), [
|
|
30
|
+
shape,
|
|
31
|
+
hasFooter,
|
|
32
|
+
activeStatus,
|
|
33
|
+
isSelected,
|
|
34
|
+
isHovered,
|
|
35
|
+
interactionState
|
|
36
|
+
]);
|
|
37
|
+
return /*#__PURE__*/ jsx("div", {
|
|
38
|
+
"data-testid": "base-container",
|
|
39
|
+
"data-execution-status": executionStatus,
|
|
40
|
+
"data-interaction-state": interactionState,
|
|
41
|
+
"data-validation-status": validationStatus,
|
|
42
|
+
"data-suggestion-type": suggestionType,
|
|
43
|
+
className: className,
|
|
44
|
+
style: background ? {
|
|
45
|
+
background
|
|
46
|
+
} : void 0,
|
|
47
|
+
"aria-busy": loading || void 0,
|
|
48
|
+
children: children
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
export { BaseContainer, getStatusBorder };
|
|
@@ -0,0 +1,49 @@
|
|
|
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_react_namespaceObject = require("react");
|
|
32
|
+
const BaseInnerShape = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ loading, color, background, children })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
33
|
+
className: " flex items-center justify-center overflow-hidden bg-surface text-foreground w-(--inner-size) h-(--inner-size) rounded-(--inner-radius) [&>svg]:w-(--icon-size) [&>svg]:h-(--icon-size) [&>img]:w-(--icon-size) [&>img]:h-(--icon-size) [&>img]:object-contain ",
|
|
34
|
+
style: color || background ? {
|
|
35
|
+
color,
|
|
36
|
+
background
|
|
37
|
+
} : void 0,
|
|
38
|
+
children: loading ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Skeleton, {
|
|
39
|
+
"data-testid": "skeleton-icon",
|
|
40
|
+
className: "rounded-lg w-(--icon-size) h-(--icon-size)"
|
|
41
|
+
}) : children
|
|
42
|
+
}));
|
|
43
|
+
exports.BaseInnerShape = __webpack_exports__.BaseInnerShape;
|
|
44
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
45
|
+
"BaseInnerShape"
|
|
46
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
47
|
+
Object.defineProperty(exports, '__esModule', {
|
|
48
|
+
value: true
|
|
49
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface BaseInnerShapeProps {
|
|
2
|
+
loading?: boolean;
|
|
3
|
+
color?: string;
|
|
4
|
+
background?: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const BaseInnerShape: import("react").MemoExoticComponent<({ loading, color, background, children }: BaseInnerShapeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
8
|
+
export {};
|
|
9
|
+
//# 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":"AAGA,UAAU,mBAAmB;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,cAAc,iFACkB,mBAAmB,6CAoB/D,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton } from "@uipath/apollo-wind";
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
const BaseInnerShape = /*#__PURE__*/ memo(({ loading, color, background, children })=>/*#__PURE__*/ jsx("div", {
|
|
5
|
+
className: " flex items-center justify-center overflow-hidden bg-surface text-foreground w-(--inner-size) h-(--inner-size) rounded-(--inner-radius) [&>svg]:w-(--icon-size) [&>svg]:h-(--icon-size) [&>img]:w-(--icon-size) [&>img]:h-(--icon-size) [&>img]:object-contain ",
|
|
6
|
+
style: color || background ? {
|
|
7
|
+
color,
|
|
8
|
+
background
|
|
9
|
+
} : void 0,
|
|
10
|
+
children: loading ? /*#__PURE__*/ jsx(Skeleton, {
|
|
11
|
+
"data-testid": "skeleton-icon",
|
|
12
|
+
className: "rounded-lg w-(--icon-size) h-(--icon-size)"
|
|
13
|
+
}) : children
|
|
14
|
+
}));
|
|
15
|
+
export { BaseInnerShape };
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
children: [
|
|
41
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_BaseNodeInnerShape_cjs_namespaceObject.BaseInnerShape, {
|
|
42
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.CanvasIcon, {
|
|
43
|
+
icon: "circle-alert",
|
|
44
|
+
size: external_constants_cjs_namespaceObject.NODE_ERROR_ICON_SIZE,
|
|
45
|
+
color: "var(--color-error-icon)"
|
|
46
|
+
})
|
|
47
|
+
}),
|
|
48
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_NodeLabel_cjs_namespaceObject.NodeLabel, {
|
|
49
|
+
label: "Manifest Undefined",
|
|
50
|
+
subLabel: type,
|
|
51
|
+
shape: "square",
|
|
52
|
+
readonly: true
|
|
53
|
+
})
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
exports.MissingManifestNode = __webpack_exports__.MissingManifestNode;
|
|
57
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
58
|
+
"MissingManifestNode"
|
|
59
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
60
|
+
Object.defineProperty(exports, '__esModule', {
|
|
61
|
+
value: true
|
|
62
|
+
});
|
|
@@ -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,4CAY1B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { 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
|
+
children: [
|
|
13
|
+
/*#__PURE__*/ jsx(BaseInnerShape, {
|
|
14
|
+
children: /*#__PURE__*/ jsx(CanvasIcon, {
|
|
15
|
+
icon: "circle-alert",
|
|
16
|
+
size: NODE_ERROR_ICON_SIZE,
|
|
17
|
+
color: "var(--color-error-icon)"
|
|
18
|
+
})
|
|
19
|
+
}),
|
|
20
|
+
/*#__PURE__*/ jsx(NodeLabel, {
|
|
21
|
+
label: "Manifest Undefined",
|
|
22
|
+
subLabel: type,
|
|
23
|
+
shape: "square",
|
|
24
|
+
readonly: true
|
|
25
|
+
})
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
export { MissingManifestNode };
|
|
@@ -24,12 +24,27 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
BaseTextContainer: ()=>BaseTextContainer,
|
|
27
28
|
NodeLabel: ()=>NodeLabel
|
|
28
29
|
});
|
|
29
30
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
31
|
const external_react_namespaceObject = require("react");
|
|
32
|
+
const external_constants_cjs_namespaceObject = require("../../constants.cjs");
|
|
33
|
+
const CssUtil_cjs_namespaceObject = require("../../utils/CssUtil.cjs");
|
|
31
34
|
const external_CanvasTooltip_cjs_namespaceObject = require("../CanvasTooltip.cjs");
|
|
32
|
-
const
|
|
35
|
+
const BaseTextContainer = ({ hasBottomHandles, shape, children })=>{
|
|
36
|
+
if ('rectangle' === shape) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
37
|
+
className: "flex flex-1 min-w-0 flex-col items-start text-left",
|
|
38
|
+
children: children
|
|
39
|
+
});
|
|
40
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
41
|
+
className: (0, CssUtil_cjs_namespaceObject.cx)('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'),
|
|
42
|
+
style: {
|
|
43
|
+
bottom: hasBottomHandles ? external_constants_cjs_namespaceObject.NODE_TEXT_BOTTOM_OFFSET_WITH_HANDLES : external_constants_cjs_namespaceObject.NODE_TEXT_BOTTOM_OFFSET
|
|
44
|
+
},
|
|
45
|
+
children: children
|
|
46
|
+
});
|
|
47
|
+
};
|
|
33
48
|
const ConditionalTooltip = ({ content, children })=>{
|
|
34
49
|
if (!content) return children;
|
|
35
50
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
|
|
@@ -40,6 +55,43 @@ const ConditionalTooltip = ({ content, children })=>{
|
|
|
40
55
|
children: children
|
|
41
56
|
});
|
|
42
57
|
};
|
|
58
|
+
const Header = ({ shape, backgroundColor, onDoubleClick, children, 'data-testid': dataTestId })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
59
|
+
"data-testid": dataTestId,
|
|
60
|
+
onDoubleClick: onDoubleClick,
|
|
61
|
+
className: (0, CssUtil_cjs_namespaceObject.cx)('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' : 'wrap-break-word line-clamp-3'),
|
|
62
|
+
style: backgroundColor ? {
|
|
63
|
+
backgroundColor
|
|
64
|
+
} : void 0,
|
|
65
|
+
children: children
|
|
66
|
+
});
|
|
67
|
+
const SubHeader = ({ shape, onDoubleClick, children, 'data-testid': dataTestId })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
68
|
+
"data-testid": dataTestId,
|
|
69
|
+
onDoubleClick: onDoubleClick,
|
|
70
|
+
className: (0, CssUtil_cjs_namespaceObject.cx)('text-center text-xs leading-[18px] text-foreground-muted wrap-break-word overflow-hidden', 'rectangle' === shape ? 'w-full text-left line-clamp-2' : 'line-clamp-5'),
|
|
71
|
+
children: children
|
|
72
|
+
});
|
|
73
|
+
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", {
|
|
74
|
+
ref: ref,
|
|
75
|
+
value: value,
|
|
76
|
+
placeholder: placeholder,
|
|
77
|
+
rows: rows,
|
|
78
|
+
"aria-label": ariaLabel,
|
|
79
|
+
onChange: onChange,
|
|
80
|
+
onKeyDown: onKeyDown,
|
|
81
|
+
onBlur: onBlur,
|
|
82
|
+
className: (0, CssUtil_cjs_namespaceObject.cx)('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'),
|
|
83
|
+
style: backgroundColor ? {
|
|
84
|
+
backgroundColor
|
|
85
|
+
} : void 0
|
|
86
|
+
}));
|
|
87
|
+
EditableLabel.displayName = 'EditableLabel';
|
|
88
|
+
const EmptyLabelPlaceholder = ({ onDoubleClick })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
89
|
+
type: "button",
|
|
90
|
+
onDoubleClick: onDoubleClick,
|
|
91
|
+
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",
|
|
92
|
+
"aria-label": "Add node label",
|
|
93
|
+
"data-testid": "empty-label-placeholder"
|
|
94
|
+
});
|
|
43
95
|
const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackgroundColor, shape, hasBottomHandles, selected, dragging, centerAdornment, readonly, onChange })=>{
|
|
44
96
|
const [isEditing, setIsEditing] = (0, external_react_namespaceObject.useState)(false);
|
|
45
97
|
const [localLabel, setLocalLabel] = (0, external_react_namespaceObject.useState)('');
|
|
@@ -50,7 +102,7 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
50
102
|
const handleSave = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
51
103
|
setIsEditing(false);
|
|
52
104
|
setFocusTarget(null);
|
|
53
|
-
if (localLabel !== label || localSubLabel !== subLabel) onChange({
|
|
105
|
+
if (localLabel !== label || localSubLabel !== subLabel) onChange?.({
|
|
54
106
|
label: localLabel,
|
|
55
107
|
subLabel: localSubLabel
|
|
56
108
|
});
|
|
@@ -124,27 +176,23 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
124
176
|
}, [
|
|
125
177
|
handleSave
|
|
126
178
|
]);
|
|
127
|
-
if (!label && !subLabel && !isEditing) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
179
|
+
if (!label && !subLabel && !isEditing) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(BaseTextContainer, {
|
|
128
180
|
hasBottomHandles: hasBottomHandles,
|
|
129
181
|
shape: shape,
|
|
130
182
|
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"
|
|
183
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(EmptyLabelPlaceholder, {
|
|
184
|
+
onDoubleClick: readonly ? void 0 : handleDoubleClick(labelInputRef)
|
|
137
185
|
}),
|
|
138
186
|
centerAdornment
|
|
139
187
|
]
|
|
140
188
|
});
|
|
141
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
189
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(BaseTextContainer, {
|
|
142
190
|
hasBottomHandles: hasBottomHandles,
|
|
143
191
|
shape: shape,
|
|
144
192
|
children: [
|
|
145
193
|
isEditing ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
146
194
|
children: [
|
|
147
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
195
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(EditableLabel, {
|
|
148
196
|
ref: labelInputRef,
|
|
149
197
|
value: localLabel,
|
|
150
198
|
onChange: (e)=>setLocalLabel(e.target.value),
|
|
@@ -153,13 +201,11 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
153
201
|
shape: shape,
|
|
154
202
|
variant: "normal",
|
|
155
203
|
backgroundColor: labelBackgroundColor,
|
|
156
|
-
className: "nodrag nowheel",
|
|
157
204
|
placeholder: "Name",
|
|
158
205
|
rows: 'rectangle' === shape ? 1 : void 0,
|
|
159
|
-
role: "textbox",
|
|
160
206
|
"aria-label": "Edit node name"
|
|
161
207
|
}),
|
|
162
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
208
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(EditableLabel, {
|
|
163
209
|
ref: subLabelInputRef,
|
|
164
210
|
value: localSubLabel,
|
|
165
211
|
onChange: (e)=>setLocalSubLabel(e.target.value),
|
|
@@ -167,24 +213,22 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
167
213
|
onBlur: handleBlur,
|
|
168
214
|
shape: shape,
|
|
169
215
|
variant: "subtext",
|
|
170
|
-
className: "nodrag nowheel",
|
|
171
216
|
placeholder: "Description",
|
|
172
217
|
rows: 'rectangle' === shape ? 2 : void 0,
|
|
173
|
-
role: "textbox",
|
|
174
218
|
"aria-label": "Edit node description"
|
|
175
219
|
})
|
|
176
220
|
]
|
|
177
221
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ConditionalTooltip, {
|
|
178
222
|
content: labelTooltip,
|
|
179
223
|
children: [
|
|
180
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
224
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Header, {
|
|
181
225
|
shape: shape,
|
|
182
226
|
backgroundColor: labelBackgroundColor,
|
|
183
227
|
onDoubleClick: readonly ? void 0 : handleDoubleClick(labelInputRef),
|
|
184
228
|
"data-testid": "node-label",
|
|
185
229
|
children: label
|
|
186
230
|
}),
|
|
187
|
-
subLabel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
231
|
+
subLabel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SubHeader, {
|
|
188
232
|
shape: shape,
|
|
189
233
|
onDoubleClick: readonly ? void 0 : handleDoubleClick(subLabelInputRef),
|
|
190
234
|
"data-testid": "node-sublabel",
|
|
@@ -197,8 +241,10 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
197
241
|
});
|
|
198
242
|
};
|
|
199
243
|
const NodeLabel = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(NodeLabelInternal);
|
|
244
|
+
exports.BaseTextContainer = __webpack_exports__.BaseTextContainer;
|
|
200
245
|
exports.NodeLabel = __webpack_exports__.NodeLabel;
|
|
201
246
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
247
|
+
"BaseTextContainer",
|
|
202
248
|
"NodeLabel"
|
|
203
249
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
204
250
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -1,4 +1,10 @@
|
|
|
1
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;
|
|
2
8
|
export interface NodeLabelProps {
|
|
3
9
|
label?: string;
|
|
4
10
|
subLabel?: string;
|
|
@@ -10,10 +16,11 @@ export interface NodeLabelProps {
|
|
|
10
16
|
dragging?: boolean;
|
|
11
17
|
centerAdornment?: React.ReactNode;
|
|
12
18
|
readonly?: boolean;
|
|
13
|
-
onChange
|
|
19
|
+
onChange?: (values: {
|
|
14
20
|
label: string;
|
|
15
21
|
subLabel: string;
|
|
16
22
|
}) => void;
|
|
17
23
|
}
|
|
18
24
|
export declare const NodeLabel: import("react").MemoExoticComponent<({ label, subLabel, labelTooltip, labelBackgroundColor, shape, hasBottomHandles, selected, dragging, centerAdornment, readonly, onChange, }: NodeLabelProps) => import("react/jsx-runtime").JSX.Element>;
|
|
25
|
+
export {};
|
|
19
26
|
//# sourceMappingURL=NodeLabel.d.ts.map
|
|
@@ -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,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;AA+IF,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;AA+KD,eAAO,MAAM,SAAS,mLAjKnB,cAAc,6CAiK+B,CAAC"}
|