@uipath/apollo-react 4.32.1 → 4.33.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/AddNodePanel/AddNodeManager.cjs +1 -0
- package/dist/canvas/components/AddNodePanel/AddNodeManager.d.ts.map +1 -1
- package/dist/canvas/components/AddNodePanel/AddNodeManager.js +1 -0
- package/dist/canvas/components/CanvasModeToolbar/CanvasModeToolbar.cjs +66 -0
- package/dist/canvas/components/CanvasModeToolbar/CanvasModeToolbar.d.ts +13 -0
- package/dist/canvas/components/CanvasModeToolbar/CanvasModeToolbar.d.ts.map +1 -0
- package/dist/canvas/components/CanvasModeToolbar/CanvasModeToolbar.js +23 -0
- package/dist/canvas/components/CanvasModeToolbar/CanvasModeToolbar.types.cjs +18 -0
- package/dist/canvas/components/CanvasModeToolbar/CanvasModeToolbar.types.d.ts +10 -0
- package/dist/canvas/components/CanvasModeToolbar/CanvasModeToolbar.types.d.ts.map +1 -0
- package/dist/canvas/components/CanvasModeToolbar/CanvasModeToolbar.types.js +0 -0
- package/dist/canvas/components/CanvasModeToolbar/index.cjs +45 -0
- package/dist/canvas/components/CanvasModeToolbar/index.d.ts +4 -0
- package/dist/canvas/components/CanvasModeToolbar/index.d.ts.map +1 -0
- package/dist/canvas/components/CanvasModeToolbar/index.js +2 -0
- package/dist/canvas/components/CanvasZoomControls/CanvasZoomControls.cjs +120 -0
- package/dist/canvas/components/CanvasZoomControls/CanvasZoomControls.d.ts +18 -0
- package/dist/canvas/components/CanvasZoomControls/CanvasZoomControls.d.ts.map +1 -0
- package/dist/canvas/components/CanvasZoomControls/CanvasZoomControls.js +86 -0
- package/dist/canvas/components/CanvasZoomControls/index.cjs +36 -0
- package/dist/canvas/components/CanvasZoomControls/index.d.ts +3 -0
- package/dist/canvas/components/CanvasZoomControls/index.d.ts.map +1 -0
- package/dist/canvas/components/CanvasZoomControls/index.js +2 -0
- package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.cjs +21 -2
- package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.d.ts +2 -1
- package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.d.ts.map +1 -1
- package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.js +21 -2
- package/dist/canvas/components/FloatingCanvasPanel/PanelChrome.cjs +4 -2
- package/dist/canvas/components/FloatingCanvasPanel/PanelChrome.d.ts +2 -1
- package/dist/canvas/components/FloatingCanvasPanel/PanelChrome.d.ts.map +1 -1
- package/dist/canvas/components/FloatingCanvasPanel/PanelChrome.js +4 -2
- package/dist/canvas/components/FloatingCanvasPanel/useFloatingPosition.cjs +18 -0
- package/dist/canvas/components/FloatingCanvasPanel/useFloatingPosition.d.ts +1 -0
- package/dist/canvas/components/FloatingCanvasPanel/useFloatingPosition.d.ts.map +1 -1
- package/dist/canvas/components/FloatingCanvasPanel/useFloatingPosition.js +20 -2
- package/dist/canvas/components/ToolbarButton.cjs +63 -0
- package/dist/canvas/components/ToolbarButton.d.ts +14 -0
- package/dist/canvas/components/ToolbarButton.d.ts.map +1 -0
- package/dist/canvas/components/ToolbarButton.js +29 -0
- package/dist/canvas/components/Toolbox/Toolbox.cjs +15 -0
- package/dist/canvas/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/Toolbox.js +15 -0
- package/dist/canvas/components/Toolbox/Toolbox.styles.cjs +2 -2
- package/dist/canvas/components/Toolbox/Toolbox.styles.js +2 -2
- package/dist/canvas/components/index.cjs +52 -38
- package/dist/canvas/components/index.d.ts +2 -0
- package/dist/canvas/components/index.d.ts.map +1 -1
- package/dist/canvas/components/index.js +2 -0
- package/dist/canvas/hooks/index.cjs +17 -10
- package/dist/canvas/hooks/index.d.ts +1 -0
- package/dist/canvas/hooks/index.d.ts.map +1 -1
- package/dist/canvas/hooks/index.js +1 -0
- package/dist/canvas/hooks/useElementsOverlap.cjs +88 -0
- package/dist/canvas/hooks/useElementsOverlap.d.ts +6 -0
- package/dist/canvas/hooks/useElementsOverlap.d.ts.map +1 -0
- package/dist/canvas/hooks/useElementsOverlap.js +54 -0
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/package.json +2 -2
|
@@ -184,6 +184,7 @@ const AddNodeManager = ({ initializing, customPanel: CustomPanel, createNodeData
|
|
|
184
184
|
nodeId: external_constants_cjs_namespaceObject.PREVIEW_NODE_ID,
|
|
185
185
|
placement: "right-start",
|
|
186
186
|
offset: external_constants_cjs_namespaceObject.FLOATING_CANVAS_PANEL_OFFSET,
|
|
187
|
+
scrollableContent: !!CustomPanel,
|
|
187
188
|
children: CustomPanel ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(CustomPanel, {
|
|
188
189
|
onNodeSelect: (item)=>handleNodeSelect(item),
|
|
189
190
|
onClose: handleClose
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddNodeManager.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/AddNodePanel/AddNodeManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAE3E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAKlC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC;IAI7E,YAAY,CAAC,EAAE,OAAO,CAAC;IAIvB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAK7F,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,YAAY,CAAC,KAAK,YAAY,CAAC;IAOtE,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK;QAAE,OAAO,EAAE,IAAI,CAAC;QAAC,QAAQ,EAAE,IAAI,EAAE,CAAA;KAAE,CAAC;IAK7F,WAAW,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,KAAK,IAAI,CAAC;IAMpF,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AASD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"AddNodeManager.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/AddNodePanel/AddNodeManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAE3E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAKlC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC;IAI7E,YAAY,CAAC,EAAE,OAAO,CAAC;IAIvB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAK7F,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,YAAY,CAAC,KAAK,YAAY,CAAC;IAOtE,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK;QAAE,OAAO,EAAE,IAAI,CAAC;QAAC,QAAQ,EAAE,IAAI,EAAE,CAAA;KAAE,CAAC;IAK7F,WAAW,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,KAAK,IAAI,CAAC;IAMpF,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AASD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA8NxD,CAAC"}
|
|
@@ -156,6 +156,7 @@ const AddNodeManager = ({ initializing, customPanel: CustomPanel, createNodeData
|
|
|
156
156
|
nodeId: PREVIEW_NODE_ID,
|
|
157
157
|
placement: "right-start",
|
|
158
158
|
offset: FLOATING_CANVAS_PANEL_OFFSET,
|
|
159
|
+
scrollableContent: !!CustomPanel,
|
|
159
160
|
children: CustomPanel ? /*#__PURE__*/ jsx(CustomPanel, {
|
|
160
161
|
onNodeSelect: (item)=>handleNodeSelect(item),
|
|
161
162
|
onClose: handleClose
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
CANVAS_MODE_TOOLBAR_HEIGHT: ()=>CANVAS_MODE_TOOLBAR_HEIGHT,
|
|
28
|
+
CountBadge: ()=>CanvasModeToolbar_CountBadge,
|
|
29
|
+
CanvasModeToolbar: ()=>CanvasModeToolbar_CanvasModeToolbar,
|
|
30
|
+
TOOLBAR_ICON_BUTTON_CLASS: ()=>TOOLBAR_ICON_BUTTON_CLASS
|
|
31
|
+
});
|
|
32
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
33
|
+
const external_react_namespaceObject = require("react");
|
|
34
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
35
|
+
const CANVAS_MODE_TOOLBAR_HEIGHT = 48;
|
|
36
|
+
const TOOLBAR_ICON_BUTTON_CLASS = 'text-foreground-muted hover:bg-surface-hover hover:text-foreground [&_svg]:size-5 [&_svg]:transition-all hover:[&_svg]:size-6 disabled:hover:[&_svg]:size-5';
|
|
37
|
+
const CanvasModeToolbar_CountBadge = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(function({ count, variant = 'default' }) {
|
|
38
|
+
if (count <= 0) return null;
|
|
39
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
40
|
+
className: `absolute -top-1 -right-1 min-w-[16px] h-4 px-1 text-[10px] font-medium rounded-full flex items-center justify-center ${'destructive' === variant ? 'bg-destructive text-destructive-foreground' : 'bg-muted text-muted-foreground'}`,
|
|
41
|
+
children: count
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
const CanvasModeToolbar_CanvasModeToolbar = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(function({ children, className }) {
|
|
45
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Row, {
|
|
46
|
+
"data-testid": "canvas-toolbar",
|
|
47
|
+
className: (0, apollo_wind_namespaceObject.cn)('gap-2 items-center rounded-2xl border border-border-subtle bg-surface-raised text-foreground px-2.5 backdrop-blur-sm shadow-lg', className),
|
|
48
|
+
style: {
|
|
49
|
+
height: CANVAS_MODE_TOOLBAR_HEIGHT
|
|
50
|
+
},
|
|
51
|
+
children: children
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
exports.CANVAS_MODE_TOOLBAR_HEIGHT = __webpack_exports__.CANVAS_MODE_TOOLBAR_HEIGHT;
|
|
55
|
+
exports.CanvasModeToolbar = __webpack_exports__.CanvasModeToolbar;
|
|
56
|
+
exports.CountBadge = __webpack_exports__.CountBadge;
|
|
57
|
+
exports.TOOLBAR_ICON_BUTTON_CLASS = __webpack_exports__.TOOLBAR_ICON_BUTTON_CLASS;
|
|
58
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
59
|
+
"CANVAS_MODE_TOOLBAR_HEIGHT",
|
|
60
|
+
"CanvasModeToolbar",
|
|
61
|
+
"CountBadge",
|
|
62
|
+
"TOOLBAR_ICON_BUTTON_CLASS"
|
|
63
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
64
|
+
Object.defineProperty(exports, '__esModule', {
|
|
65
|
+
value: true
|
|
66
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export declare const CANVAS_MODE_TOOLBAR_HEIGHT = 48;
|
|
3
|
+
export declare const TOOLBAR_ICON_BUTTON_CLASS = "text-foreground-muted hover:bg-surface-hover hover:text-foreground [&_svg]:size-5 [&_svg]:transition-all hover:[&_svg]:size-6 disabled:hover:[&_svg]:size-5";
|
|
4
|
+
export declare const CountBadge: import("react").NamedExoticComponent<{
|
|
5
|
+
count: number;
|
|
6
|
+
variant?: "default" | "destructive";
|
|
7
|
+
}>;
|
|
8
|
+
export interface CanvasModeToolbarProps {
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const CanvasModeToolbar: import("react").NamedExoticComponent<CanvasModeToolbarProps>;
|
|
13
|
+
//# sourceMappingURL=CanvasModeToolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanvasModeToolbar.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasModeToolbar/CanvasModeToolbar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C,eAAO,MAAM,yBAAyB,gKACyH,CAAC;AAMhK,eAAO,MAAM,UAAU;WAId,MAAM;cACH,SAAS,GAAG,aAAa;EAcnC,CAAC;AAMH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,eAAO,MAAM,iBAAiB,8DAgB5B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from "react";
|
|
3
|
+
import { Row, cn } from "@uipath/apollo-wind";
|
|
4
|
+
const CANVAS_MODE_TOOLBAR_HEIGHT = 48;
|
|
5
|
+
const TOOLBAR_ICON_BUTTON_CLASS = 'text-foreground-muted hover:bg-surface-hover hover:text-foreground [&_svg]:size-5 [&_svg]:transition-all hover:[&_svg]:size-6 disabled:hover:[&_svg]:size-5';
|
|
6
|
+
const CanvasModeToolbar_CountBadge = /*#__PURE__*/ memo(function({ count, variant = 'default' }) {
|
|
7
|
+
if (count <= 0) return null;
|
|
8
|
+
return /*#__PURE__*/ jsx("span", {
|
|
9
|
+
className: `absolute -top-1 -right-1 min-w-[16px] h-4 px-1 text-[10px] font-medium rounded-full flex items-center justify-center ${'destructive' === variant ? 'bg-destructive text-destructive-foreground' : 'bg-muted text-muted-foreground'}`,
|
|
10
|
+
children: count
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
const CanvasModeToolbar_CanvasModeToolbar = /*#__PURE__*/ memo(function({ children, className }) {
|
|
14
|
+
return /*#__PURE__*/ jsx(Row, {
|
|
15
|
+
"data-testid": "canvas-toolbar",
|
|
16
|
+
className: cn('gap-2 items-center rounded-2xl border border-border-subtle bg-surface-raised text-foreground px-2.5 backdrop-blur-sm shadow-lg', className),
|
|
17
|
+
style: {
|
|
18
|
+
height: CANVAS_MODE_TOOLBAR_HEIGHT
|
|
19
|
+
},
|
|
20
|
+
children: children
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
export { CANVAS_MODE_TOOLBAR_HEIGHT, CanvasModeToolbar_CanvasModeToolbar as CanvasModeToolbar, CanvasModeToolbar_CountBadge as CountBadge, TOOLBAR_ICON_BUTTON_CLASS };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.r = (exports1)=>{
|
|
5
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
6
|
+
value: 'Module'
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
13
|
+
var __webpack_exports__ = {};
|
|
14
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
16
|
+
Object.defineProperty(exports, '__esModule', {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type CanvasMode = 'design' | 'debug' | 'evaluate';
|
|
2
|
+
export interface DebugControls {
|
|
3
|
+
isInitiated?: boolean;
|
|
4
|
+
status?: string;
|
|
5
|
+
onStep?: () => void;
|
|
6
|
+
onContinue?: () => void;
|
|
7
|
+
onRestart?: () => void;
|
|
8
|
+
onStop?: () => void;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=CanvasModeToolbar.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanvasModeToolbar.types.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasModeToolbar/CanvasModeToolbar.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAEzD,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB"}
|
|
File without changes
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
CANVAS_MODE_TOOLBAR_HEIGHT: ()=>external_CanvasModeToolbar_cjs_namespaceObject.CANVAS_MODE_TOOLBAR_HEIGHT,
|
|
28
|
+
CountBadge: ()=>external_CanvasModeToolbar_cjs_namespaceObject.CountBadge,
|
|
29
|
+
CanvasModeToolbar: ()=>external_CanvasModeToolbar_cjs_namespaceObject.CanvasModeToolbar,
|
|
30
|
+
TOOLBAR_ICON_BUTTON_CLASS: ()=>external_CanvasModeToolbar_cjs_namespaceObject.TOOLBAR_ICON_BUTTON_CLASS
|
|
31
|
+
});
|
|
32
|
+
const external_CanvasModeToolbar_cjs_namespaceObject = require("./CanvasModeToolbar.cjs");
|
|
33
|
+
exports.CANVAS_MODE_TOOLBAR_HEIGHT = __webpack_exports__.CANVAS_MODE_TOOLBAR_HEIGHT;
|
|
34
|
+
exports.CanvasModeToolbar = __webpack_exports__.CanvasModeToolbar;
|
|
35
|
+
exports.CountBadge = __webpack_exports__.CountBadge;
|
|
36
|
+
exports.TOOLBAR_ICON_BUTTON_CLASS = __webpack_exports__.TOOLBAR_ICON_BUTTON_CLASS;
|
|
37
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
38
|
+
"CANVAS_MODE_TOOLBAR_HEIGHT",
|
|
39
|
+
"CanvasModeToolbar",
|
|
40
|
+
"CountBadge",
|
|
41
|
+
"TOOLBAR_ICON_BUTTON_CLASS"
|
|
42
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
43
|
+
Object.defineProperty(exports, '__esModule', {
|
|
44
|
+
value: true
|
|
45
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { CanvasModeToolbar, CountBadge, CANVAS_MODE_TOOLBAR_HEIGHT, TOOLBAR_ICON_BUTTON_CLASS, } from './CanvasModeToolbar';
|
|
2
|
+
export type { CanvasModeToolbarProps } from './CanvasModeToolbar';
|
|
3
|
+
export type { CanvasMode, DebugControls } from './CanvasModeToolbar.types';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasModeToolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
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
|
+
CanvasZoomControls: ()=>CanvasZoomControls_CanvasZoomControls
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_react_namespaceObject = require("react");
|
|
31
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
32
|
+
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
33
|
+
const external_ToolbarButton_cjs_namespaceObject = require("../ToolbarButton.cjs");
|
|
34
|
+
const index_cjs_namespaceObject = require("../../../i18n/index.cjs");
|
|
35
|
+
const ZOOM_ICON_BUTTON_CLASS = 'text-foreground-muted hover:bg-surface-hover hover:text-foreground [&_svg]:size-[18px] [&_svg]:transition-all hover:[&_svg]:size-[22px] disabled:hover:[&_svg]:size-[18px]';
|
|
36
|
+
const CanvasZoomControls_CanvasZoomControls = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(/*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(function({ orientation = 'vertical', fitViewOptions, zoomInOptions, zoomOutOptions, onOrganize, onFitView }, ref) {
|
|
37
|
+
const { zoomIn, zoomOut, fitView } = (0, react_cjs_namespaceObject.useReactFlow)();
|
|
38
|
+
const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
|
|
39
|
+
const isVertical = 'vertical' === orientation;
|
|
40
|
+
const tooltipSide = isVertical ? 'left' : 'top';
|
|
41
|
+
const handleZoomIn = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
42
|
+
zoomIn(zoomInOptions);
|
|
43
|
+
}, [
|
|
44
|
+
zoomIn,
|
|
45
|
+
zoomInOptions
|
|
46
|
+
]);
|
|
47
|
+
const handleZoomOut = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
48
|
+
zoomOut(zoomOutOptions);
|
|
49
|
+
}, [
|
|
50
|
+
zoomOut,
|
|
51
|
+
zoomOutOptions
|
|
52
|
+
]);
|
|
53
|
+
const handleFitView = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
54
|
+
if (onFitView) onFitView();
|
|
55
|
+
else fitView(fitViewOptions);
|
|
56
|
+
}, [
|
|
57
|
+
onFitView,
|
|
58
|
+
fitView,
|
|
59
|
+
fitViewOptions
|
|
60
|
+
]);
|
|
61
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
62
|
+
ref: ref,
|
|
63
|
+
"data-testid": "canvas-controls",
|
|
64
|
+
className: `flex gap-1 items-center rounded-xl border border-border-subtle bg-surface-raised text-foreground p-1 backdrop-blur-sm shadow-lg ${isVertical ? 'flex-col' : 'flex-row'}`,
|
|
65
|
+
children: [
|
|
66
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
|
|
67
|
+
testId: "zoom-in-button",
|
|
68
|
+
label: _({
|
|
69
|
+
id: 'canvas.zoom.zoom_in',
|
|
70
|
+
message: 'Zoom in'
|
|
71
|
+
}),
|
|
72
|
+
tooltipSide: tooltipSide,
|
|
73
|
+
onClick: handleZoomIn,
|
|
74
|
+
className: ZOOM_ICON_BUTTON_CLASS,
|
|
75
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ZoomIn, {})
|
|
76
|
+
}),
|
|
77
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
|
|
78
|
+
testId: "zoom-out-button",
|
|
79
|
+
label: _({
|
|
80
|
+
id: 'canvas.zoom.zoom_out',
|
|
81
|
+
message: 'Zoom out'
|
|
82
|
+
}),
|
|
83
|
+
tooltipSide: tooltipSide,
|
|
84
|
+
onClick: handleZoomOut,
|
|
85
|
+
className: ZOOM_ICON_BUTTON_CLASS,
|
|
86
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ZoomOut, {})
|
|
87
|
+
}),
|
|
88
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
|
|
89
|
+
testId: "fit-to-view-button",
|
|
90
|
+
label: _({
|
|
91
|
+
id: 'canvas.zoom.fit_to_screen',
|
|
92
|
+
message: 'Fit to screen'
|
|
93
|
+
}),
|
|
94
|
+
tooltipSide: tooltipSide,
|
|
95
|
+
onClick: handleFitView,
|
|
96
|
+
className: ZOOM_ICON_BUTTON_CLASS,
|
|
97
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Scan, {})
|
|
98
|
+
}),
|
|
99
|
+
onOrganize && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
|
|
100
|
+
testId: "organize-button",
|
|
101
|
+
label: _({
|
|
102
|
+
id: 'canvas.zoom.tidy_up',
|
|
103
|
+
message: 'Tidy up'
|
|
104
|
+
}),
|
|
105
|
+
tooltipSide: tooltipSide,
|
|
106
|
+
onClick: onOrganize,
|
|
107
|
+
className: ZOOM_ICON_BUTTON_CLASS,
|
|
108
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.BrushCleaning, {})
|
|
109
|
+
})
|
|
110
|
+
]
|
|
111
|
+
});
|
|
112
|
+
}));
|
|
113
|
+
CanvasZoomControls_CanvasZoomControls.displayName = 'CanvasZoomControls';
|
|
114
|
+
exports.CanvasZoomControls = __webpack_exports__.CanvasZoomControls;
|
|
115
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
116
|
+
"CanvasZoomControls"
|
|
117
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
118
|
+
Object.defineProperty(exports, '__esModule', {
|
|
119
|
+
value: true
|
|
120
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface CanvasZoomControlsProps {
|
|
2
|
+
orientation?: 'vertical' | 'horizontal';
|
|
3
|
+
fitViewOptions?: {
|
|
4
|
+
duration?: number;
|
|
5
|
+
padding?: number;
|
|
6
|
+
maxZoom?: number;
|
|
7
|
+
};
|
|
8
|
+
zoomInOptions?: {
|
|
9
|
+
duration?: number;
|
|
10
|
+
};
|
|
11
|
+
zoomOutOptions?: {
|
|
12
|
+
duration?: number;
|
|
13
|
+
};
|
|
14
|
+
onOrganize?: () => void;
|
|
15
|
+
onFitView?: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const CanvasZoomControls: import("react").NamedExoticComponent<CanvasZoomControlsProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
//# sourceMappingURL=CanvasZoomControls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanvasZoomControls.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasZoomControls/CanvasZoomControls.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,cAAc,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3E,aAAa,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,cAAc,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAKD,eAAO,MAAM,kBAAkB,+GAqF9B,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, memo, useCallback } from "react";
|
|
3
|
+
import { BrushCleaning, Scan, ZoomIn, ZoomOut } from "lucide-react";
|
|
4
|
+
import { useReactFlow } from "../../xyflow/react.js";
|
|
5
|
+
import { ToolbarButton } from "../ToolbarButton.js";
|
|
6
|
+
import { useSafeLingui } from "../../../i18n/index.js";
|
|
7
|
+
const ZOOM_ICON_BUTTON_CLASS = 'text-foreground-muted hover:bg-surface-hover hover:text-foreground [&_svg]:size-[18px] [&_svg]:transition-all hover:[&_svg]:size-[22px] disabled:hover:[&_svg]:size-[18px]';
|
|
8
|
+
const CanvasZoomControls_CanvasZoomControls = /*#__PURE__*/ memo(/*#__PURE__*/ forwardRef(function({ orientation = 'vertical', fitViewOptions, zoomInOptions, zoomOutOptions, onOrganize, onFitView }, ref) {
|
|
9
|
+
const { zoomIn, zoomOut, fitView } = useReactFlow();
|
|
10
|
+
const { _ } = useSafeLingui();
|
|
11
|
+
const isVertical = 'vertical' === orientation;
|
|
12
|
+
const tooltipSide = isVertical ? 'left' : 'top';
|
|
13
|
+
const handleZoomIn = useCallback(()=>{
|
|
14
|
+
zoomIn(zoomInOptions);
|
|
15
|
+
}, [
|
|
16
|
+
zoomIn,
|
|
17
|
+
zoomInOptions
|
|
18
|
+
]);
|
|
19
|
+
const handleZoomOut = useCallback(()=>{
|
|
20
|
+
zoomOut(zoomOutOptions);
|
|
21
|
+
}, [
|
|
22
|
+
zoomOut,
|
|
23
|
+
zoomOutOptions
|
|
24
|
+
]);
|
|
25
|
+
const handleFitView = useCallback(()=>{
|
|
26
|
+
if (onFitView) onFitView();
|
|
27
|
+
else fitView(fitViewOptions);
|
|
28
|
+
}, [
|
|
29
|
+
onFitView,
|
|
30
|
+
fitView,
|
|
31
|
+
fitViewOptions
|
|
32
|
+
]);
|
|
33
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
34
|
+
ref: ref,
|
|
35
|
+
"data-testid": "canvas-controls",
|
|
36
|
+
className: `flex gap-1 items-center rounded-xl border border-border-subtle bg-surface-raised text-foreground p-1 backdrop-blur-sm shadow-lg ${isVertical ? 'flex-col' : 'flex-row'}`,
|
|
37
|
+
children: [
|
|
38
|
+
/*#__PURE__*/ jsx(ToolbarButton, {
|
|
39
|
+
testId: "zoom-in-button",
|
|
40
|
+
label: _({
|
|
41
|
+
id: 'canvas.zoom.zoom_in',
|
|
42
|
+
message: 'Zoom in'
|
|
43
|
+
}),
|
|
44
|
+
tooltipSide: tooltipSide,
|
|
45
|
+
onClick: handleZoomIn,
|
|
46
|
+
className: ZOOM_ICON_BUTTON_CLASS,
|
|
47
|
+
children: /*#__PURE__*/ jsx(ZoomIn, {})
|
|
48
|
+
}),
|
|
49
|
+
/*#__PURE__*/ jsx(ToolbarButton, {
|
|
50
|
+
testId: "zoom-out-button",
|
|
51
|
+
label: _({
|
|
52
|
+
id: 'canvas.zoom.zoom_out',
|
|
53
|
+
message: 'Zoom out'
|
|
54
|
+
}),
|
|
55
|
+
tooltipSide: tooltipSide,
|
|
56
|
+
onClick: handleZoomOut,
|
|
57
|
+
className: ZOOM_ICON_BUTTON_CLASS,
|
|
58
|
+
children: /*#__PURE__*/ jsx(ZoomOut, {})
|
|
59
|
+
}),
|
|
60
|
+
/*#__PURE__*/ jsx(ToolbarButton, {
|
|
61
|
+
testId: "fit-to-view-button",
|
|
62
|
+
label: _({
|
|
63
|
+
id: 'canvas.zoom.fit_to_screen',
|
|
64
|
+
message: 'Fit to screen'
|
|
65
|
+
}),
|
|
66
|
+
tooltipSide: tooltipSide,
|
|
67
|
+
onClick: handleFitView,
|
|
68
|
+
className: ZOOM_ICON_BUTTON_CLASS,
|
|
69
|
+
children: /*#__PURE__*/ jsx(Scan, {})
|
|
70
|
+
}),
|
|
71
|
+
onOrganize && /*#__PURE__*/ jsx(ToolbarButton, {
|
|
72
|
+
testId: "organize-button",
|
|
73
|
+
label: _({
|
|
74
|
+
id: 'canvas.zoom.tidy_up',
|
|
75
|
+
message: 'Tidy up'
|
|
76
|
+
}),
|
|
77
|
+
tooltipSide: tooltipSide,
|
|
78
|
+
onClick: onOrganize,
|
|
79
|
+
className: ZOOM_ICON_BUTTON_CLASS,
|
|
80
|
+
children: /*#__PURE__*/ jsx(BrushCleaning, {})
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
});
|
|
84
|
+
}));
|
|
85
|
+
CanvasZoomControls_CanvasZoomControls.displayName = 'CanvasZoomControls';
|
|
86
|
+
export { CanvasZoomControls_CanvasZoomControls as CanvasZoomControls };
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
CanvasZoomControls: ()=>external_CanvasZoomControls_cjs_namespaceObject.CanvasZoomControls
|
|
28
|
+
});
|
|
29
|
+
const external_CanvasZoomControls_cjs_namespaceObject = require("./CanvasZoomControls.cjs");
|
|
30
|
+
exports.CanvasZoomControls = __webpack_exports__.CanvasZoomControls;
|
|
31
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
32
|
+
"CanvasZoomControls"
|
|
33
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
34
|
+
Object.defineProperty(exports, '__esModule', {
|
|
35
|
+
value: true
|
|
36
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasZoomControls/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -35,10 +35,12 @@ const external_CanvasPortal_cjs_namespaceObject = require("./CanvasPortal.cjs");
|
|
|
35
35
|
const external_PanelChrome_cjs_namespaceObject = require("./PanelChrome.cjs");
|
|
36
36
|
const external_useFloatingPosition_cjs_namespaceObject = require("./useFloatingPosition.cjs");
|
|
37
37
|
const PANEL_BASE_CLASS = 'text-(--canvas-foreground) bg-(--canvas-background-raised) border border-(--canvas-border-de-emp) text-sm flex flex-col transition-opacity duration-200 ease-in-out';
|
|
38
|
+
const PANEL_FLOATING_MAX_HEIGHT = 600;
|
|
39
|
+
const PANEL_FLOATING_MIN_HEIGHT = 100;
|
|
38
40
|
const PANEL_FLOATING_CLASS = 'rounded-lg shadow-[0_4px_16px_rgba(0,0,0,0.12)] w-auto min-w-[280px] max-w-none h-auto max-h-[600px]';
|
|
39
41
|
const PANEL_PINNED_CLASS = 'rounded-none shadow-none w-[320px] min-w-[320px] max-w-[320px] h-screen max-h-screen';
|
|
40
|
-
function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'right-start', offset = 20, fallbackPlacement, isPinned = false, useFixedPosition = false, portalToBody = false, title, header, headerActions, children, onClose, scrollKey, onMouseEnter, onMouseLeave }) {
|
|
41
|
-
const { computedAnchor, floatingStyles, refs, mergedReferenceRef } = (0, external_useFloatingPosition_cjs_namespaceObject.useFloatingPosition)({
|
|
42
|
+
function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'right-start', offset = 20, fallbackPlacement, isPinned = false, useFixedPosition = false, portalToBody = false, title, header, headerActions, children, onClose, scrollKey, scrollableContent = true, onMouseEnter, onMouseLeave }) {
|
|
43
|
+
const { computedAnchor, floatingStyles, availableHeight, refs, mergedReferenceRef } = (0, external_useFloatingPosition_cjs_namespaceObject.useFloatingPosition)({
|
|
42
44
|
open,
|
|
43
45
|
nodeId,
|
|
44
46
|
anchorRect,
|
|
@@ -49,6 +51,19 @@ function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'rig
|
|
|
49
51
|
const panelClassName = (0, external_react_namespaceObject.useMemo)(()=>(0, apollo_wind_namespaceObject.cn)(PANEL_BASE_CLASS, isPinned ? PANEL_PINNED_CLASS : PANEL_FLOATING_CLASS), [
|
|
50
52
|
isPinned
|
|
51
53
|
]);
|
|
54
|
+
const sizingStyle = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
55
|
+
if (isPinned || null == availableHeight) return {};
|
|
56
|
+
const maxHeight = Math.min(PANEL_FLOATING_MAX_HEIGHT, availableHeight);
|
|
57
|
+
const occupiedHeight = Math.max(PANEL_FLOATING_MIN_HEIGHT, maxHeight);
|
|
58
|
+
return {
|
|
59
|
+
maxHeight: `${maxHeight}px`,
|
|
60
|
+
minHeight: `${PANEL_FLOATING_MIN_HEIGHT}px`,
|
|
61
|
+
['--floating-available-height']: `${occupiedHeight}px`
|
|
62
|
+
};
|
|
63
|
+
}, [
|
|
64
|
+
isPinned,
|
|
65
|
+
availableHeight
|
|
66
|
+
]);
|
|
52
67
|
if (!open || !computedAnchor) return null;
|
|
53
68
|
if (useFixedPosition && anchorRect) {
|
|
54
69
|
const getScreenSpacePosition = ()=>{
|
|
@@ -100,6 +115,7 @@ function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'rig
|
|
|
100
115
|
style: {
|
|
101
116
|
position: 'fixed',
|
|
102
117
|
...screenPosition,
|
|
118
|
+
...sizingStyle,
|
|
103
119
|
zIndex: 1100,
|
|
104
120
|
pointerEvents: 'auto'
|
|
105
121
|
},
|
|
@@ -109,6 +125,7 @@ function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'rig
|
|
|
109
125
|
headerActions: headerActions,
|
|
110
126
|
onClose: onClose,
|
|
111
127
|
scrollKey: scrollKey,
|
|
128
|
+
scrollableContent: scrollableContent,
|
|
112
129
|
children: children
|
|
113
130
|
})
|
|
114
131
|
});
|
|
@@ -123,6 +140,7 @@ function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'rig
|
|
|
123
140
|
onPointerLeave: onMouseLeave,
|
|
124
141
|
style: {
|
|
125
142
|
...isPinned ? {} : floatingStyles,
|
|
143
|
+
...sizingStyle,
|
|
126
144
|
position: isPinned ? 'fixed' : 'absolute',
|
|
127
145
|
right: isPinned ? 0 : void 0,
|
|
128
146
|
top: isPinned ? 0 : void 0,
|
|
@@ -135,6 +153,7 @@ function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'rig
|
|
|
135
153
|
headerActions: headerActions,
|
|
136
154
|
onClose: onClose,
|
|
137
155
|
scrollKey: scrollKey,
|
|
156
|
+
scrollableContent: scrollableContent,
|
|
138
157
|
children: children
|
|
139
158
|
})
|
|
140
159
|
});
|
|
@@ -17,8 +17,9 @@ export type FloatingCanvasPanelProps = {
|
|
|
17
17
|
children?: ReactNode;
|
|
18
18
|
onClose?: () => void;
|
|
19
19
|
scrollKey?: string;
|
|
20
|
+
scrollableContent?: boolean;
|
|
20
21
|
onMouseEnter?: () => void;
|
|
21
22
|
onMouseLeave?: () => void;
|
|
22
23
|
};
|
|
23
|
-
export declare function FloatingCanvasPanel({ open, nodeId, anchorRect, placement, offset, fallbackPlacement, isPinned, useFixedPosition, portalToBody, title, header, headerActions, children, onClose, scrollKey, onMouseEnter, onMouseLeave, }: FloatingCanvasPanelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
24
|
+
export declare function FloatingCanvasPanel({ open, nodeId, anchorRect, placement, offset, fallbackPlacement, isPinned, useFixedPosition, portalToBody, title, header, headerActions, children, onClose, scrollKey, scrollableContent, onMouseEnter, onMouseLeave, }: FloatingCanvasPanelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
24
25
|
//# sourceMappingURL=FloatingCanvasPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingCanvasPanel.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"FloatingCanvasPanel.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAKtD,OAAO,EAAE,KAAK,UAAU,EAAuB,MAAM,uBAAuB,CAAC;AA4B7E,MAAM,MAAM,wBAAwB,GAAG;IAErC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAShB,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IAOnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAM3B,YAAY,CAAC,EAAE,OAAO,CAAC;IAGvB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IAOnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAG5B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAClC,IAAW,EACX,MAAM,EACN,UAAU,EACV,SAAyB,EACzB,MAAW,EACX,iBAAiB,EACjB,QAAgB,EAChB,gBAAwB,EACxB,YAAoB,EACpB,KAAK,EACL,MAAM,EACN,aAAa,EACb,QAAQ,EACR,OAAO,EACP,SAAS,EACT,iBAAwB,EACxB,YAAY,EACZ,YAAY,GACb,EAAE,wBAAwB,kDAmK1B"}
|