seat-editor 3.6.19 → 3.6.21
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/app/graph-view-new/page.js +1 -1
- package/dist/app/graph-view-new/page.jsx +1 -1
- package/dist/components/layer-v5/index.js +2 -3
- package/dist/components/layer-v5/index.jsx +3 -4
- package/dist/features/view-only-5/index.d.ts +1 -0
- package/dist/features/view-only-5/index.js +24 -7
- package/dist/features/view-only-5/index.jsx +24 -7
- package/package.json +1 -1
|
@@ -162,5 +162,5 @@ export default function GraphView() {
|
|
|
162
162
|
colorGroupSelection: COLORS_SECTION,
|
|
163
163
|
dataKey: "uuid_table",
|
|
164
164
|
selection: selection
|
|
165
|
-
} }), _jsxs("div", { className: "w-1/5 p-4", onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave, children: [_jsx("div", { id: "table" }), _jsxs("div", { className: "rounded-lg bg-white p-4", children: [_jsx("h1", { className: "text-2xl font-bold", children: "Section" }), sections.map((section) => (_jsxs("div", { className: clsx("font-bold text-white rounded-md p-2 cursor-pointer", sectionActive === section.id && "!bg-blue-500"), style: { backgroundColor: section.color }, onClick: () => setSectionActive(section.id), children: [_jsx("h2", { className: "text-lg", children: section.name }), section.items.length > 0 && (_jsx("ul", { className: "list-disc pl-5 bg-opacity-50 bg-white p-2 rounded ", children: section.items.map((item) => (_jsx("li", { children: item.name }, item.id))) }))] }, section.id)))] })] }), _jsx("div", { className: "w-1/5 p-4", children: _jsx("div", { className: "rounded-lg bg-white p-4", children: _jsx("h1", { className: "text-2xl font-bold", children: "Nodes" }) }) })] }) }));
|
|
165
|
+
}, allowTooltip: true }), _jsxs("div", { className: "w-1/5 p-4", onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave, children: [_jsx("div", { id: "table" }), _jsxs("div", { className: "rounded-lg bg-white p-4", children: [_jsx("h1", { className: "text-2xl font-bold", children: "Section" }), sections.map((section) => (_jsxs("div", { className: clsx("font-bold text-white rounded-md p-2 cursor-pointer", sectionActive === section.id && "!bg-blue-500"), style: { backgroundColor: section.color }, onClick: () => setSectionActive(section.id), children: [_jsx("h2", { className: "text-lg", children: section.name }), section.items.length > 0 && (_jsx("ul", { className: "list-disc pl-5 bg-opacity-50 bg-white p-2 rounded ", children: section.items.map((item) => (_jsx("li", { children: item.name }, item.id))) }))] }, section.id)))] })] }), _jsx("div", { className: "w-1/5 p-4", children: _jsx("div", { className: "rounded-lg bg-white p-4", children: _jsx("h1", { className: "text-2xl font-bold", children: "Nodes" }) }) })] }) }));
|
|
166
166
|
}
|
|
@@ -168,7 +168,7 @@ export default function GraphView() {
|
|
|
168
168
|
colorGroupSelection: COLORS_SECTION,
|
|
169
169
|
dataKey: "uuid_table",
|
|
170
170
|
selection: selection
|
|
171
|
-
}}/>
|
|
171
|
+
}} allowTooltip={true}/>
|
|
172
172
|
<div className="w-1/5 p-4" onMouseMove={handleMouseMove} onMouseLeave={handleMouseLeave}>
|
|
173
173
|
<div id="table"/>
|
|
174
174
|
<div className="rounded-lg bg-white p-4">
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createElement as _createElement } from "react";
|
|
3
3
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { isEmpty, omit } from "lodash";
|
|
5
|
-
import { arcByDirection, distributeWithSpacing,
|
|
5
|
+
import { arcByDirection, distributeWithSpacing, } from "../layer-v3/utils";
|
|
6
6
|
// import { RsvpIcons } from "../../features/board-v3/icons";
|
|
7
7
|
import { getBoundingBoxFromPoints } from "../layer-v3/utils";
|
|
8
8
|
import { LabelItem } from "../layer-v3";
|
|
@@ -960,7 +960,6 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
|
|
|
960
960
|
}
|
|
961
961
|
};
|
|
962
962
|
let date = new Date();
|
|
963
|
-
|
|
964
|
-
return (_jsxs("g", { children: [components === null || components === void 0 ? void 0 : components.map(renderShape), !isEmpty(selectionLines) && (_jsx("g", { id: "selection-lines", transform: `translate(${(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.x) - 5},${(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.y) - 5})`, children: _jsx("g", { transform: `rotate(${0}, 0,0)`, children: _jsx("rect", { width: selectionLines.width + 10, height: selectionLines.height + 10, fill: "none", stroke: "#4a90e2", strokeWidth: 1, strokeDasharray: "4 2", id: "rect-box-selection" }) }) }, `selection-${Date.now()}`))] }, `${date}`));
|
|
963
|
+
return (_jsxs("g", { children: [components === null || components === void 0 ? void 0 : components.map(renderShape), !isEmpty(selectionLines) && (_jsx("g", { id: "selection-lines", "data-selection": "selection-lines", transform: `translate(${(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.x) - 5},${(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.y) - 5})`, children: _jsx("g", { transform: `rotate(${0}, 0,0)`, children: _jsx("rect", { width: selectionLines.width + 10, height: selectionLines.height + 10, fill: "transparent", stroke: "#4a90e2", strokeWidth: 1, strokeDasharray: "4 2", id: "rect-box-selection" }) }) }, `selection-${Date.now()}`))] }, `${date}`));
|
|
965
964
|
};
|
|
966
965
|
export default Layers;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { isEmpty, omit } from "lodash";
|
|
3
|
-
import { arcByDirection, distributeWithSpacing,
|
|
3
|
+
import { arcByDirection, distributeWithSpacing, } from "../layer-v3/utils";
|
|
4
4
|
// import { RsvpIcons } from "../../features/board-v3/icons";
|
|
5
5
|
import { getBoundingBoxFromPoints } from "../layer-v3/utils";
|
|
6
6
|
import { LabelItem } from "../layer-v3";
|
|
@@ -1067,12 +1067,11 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
|
|
|
1067
1067
|
}
|
|
1068
1068
|
};
|
|
1069
1069
|
let date = new Date();
|
|
1070
|
-
const nodesRaw = rectToPolygonNodes(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.width, selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.height);
|
|
1071
1070
|
return (<g key={`${date}`}>
|
|
1072
1071
|
{components === null || components === void 0 ? void 0 : components.map(renderShape)}
|
|
1073
|
-
{!isEmpty(selectionLines) && (<g key={`selection-${Date.now()}`} id="selection-lines" transform={`translate(${(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.x) - 5},${(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.y) - 5})`}>
|
|
1072
|
+
{!isEmpty(selectionLines) && (<g key={`selection-${Date.now()}`} id="selection-lines" data-selection="selection-lines" transform={`translate(${(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.x) - 5},${(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.y) - 5})`}>
|
|
1074
1073
|
<g transform={`rotate(${0}, 0,0)`}>
|
|
1075
|
-
<rect width={selectionLines.width + 10} height={selectionLines.height + 10} fill="
|
|
1074
|
+
<rect width={selectionLines.width + 10} height={selectionLines.height + 10} fill="transparent" stroke="#4a90e2" strokeWidth={1} strokeDasharray={"4 2"} id="rect-box-selection"/>
|
|
1076
1075
|
</g>
|
|
1077
1076
|
</g>)}
|
|
1078
1077
|
</g>);
|
|
@@ -61,6 +61,9 @@ const LayerView = (props) => {
|
|
|
61
61
|
}),
|
|
62
62
|
}));
|
|
63
63
|
const dispatch = useAppDispatch();
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
setTooltip(Object.assign(Object.assign({}, tooltip), { visible: tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.open }));
|
|
66
|
+
}, [tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.open]);
|
|
64
67
|
useEffect(() => {
|
|
65
68
|
if (!loading && (loadingRender === null || loadingRender === void 0 ? void 0 : loadingRender.state)) {
|
|
66
69
|
dispatch({ type: "panel/setLoading", payload: true });
|
|
@@ -121,6 +124,7 @@ const LayerView = (props) => {
|
|
|
121
124
|
const handleUnSelectComponent = () => {
|
|
122
125
|
setSelectedLines(null);
|
|
123
126
|
dataElementSelectionGroupRef.current = [];
|
|
127
|
+
onMakeSelection && onMakeSelection([]);
|
|
124
128
|
};
|
|
125
129
|
const handleDoubleClick = (items, e) => {
|
|
126
130
|
const find = componentsEditor.find((item) => {
|
|
@@ -262,7 +266,6 @@ const LayerView = (props) => {
|
|
|
262
266
|
}, [actionPrivileged]);
|
|
263
267
|
const handlePointerDown = (e) => {
|
|
264
268
|
var _a, _b, _c;
|
|
265
|
-
console.log("handlePointerDown");
|
|
266
269
|
const svg = svgRef.current;
|
|
267
270
|
if (!e.isPrimary || !svg)
|
|
268
271
|
return;
|
|
@@ -272,13 +275,16 @@ const LayerView = (props) => {
|
|
|
272
275
|
const startY = e.clientY;
|
|
273
276
|
const { x, y } = getSvgCoords(e);
|
|
274
277
|
const targetGroup = e.target.closest("g[data-id]");
|
|
278
|
+
const targetSelectionGroup = e.target.closest("g[data-selection]");
|
|
279
|
+
console.log({ targetGroup, targetSelectionGroup });
|
|
275
280
|
const { clientX, clientY } = e;
|
|
276
281
|
const hitPoint = document.elementFromPoint(clientX, clientY);
|
|
277
282
|
const downOutTable = (hitPoint === null || hitPoint === void 0 ? void 0 : hitPoint.nodeName) === "svg";
|
|
278
|
-
console.log(hitPoint, "hit", targetGroup);
|
|
279
283
|
const makeSelection = (downOutTable || !targetGroup) && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.selection);
|
|
280
284
|
const hadSelection = dataElementSelectionGroupRef.current.length > 0;
|
|
281
|
-
const downInOutSelection = hadSelection && makeSelection;
|
|
285
|
+
const downInOutSelection = hadSelection && makeSelection && e.button !== 2;
|
|
286
|
+
console.log({ hadSelection, makeSelection, downInOutSelection });
|
|
287
|
+
const hasSelectionDownOutSelection = !targetSelectionGroup && targetGroup && hadSelection;
|
|
282
288
|
if (downOutTable) {
|
|
283
289
|
if (graph.connecting) {
|
|
284
290
|
graph.cancelConnect();
|
|
@@ -296,11 +302,11 @@ const LayerView = (props) => {
|
|
|
296
302
|
});
|
|
297
303
|
(_a = svgRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(boxSelection);
|
|
298
304
|
}
|
|
299
|
-
if (downInOutSelection) {
|
|
305
|
+
if (downInOutSelection || hasSelectionDownOutSelection) {
|
|
300
306
|
handleUnSelectComponent();
|
|
301
307
|
}
|
|
302
308
|
setPanningGroup(true);
|
|
303
|
-
if (
|
|
309
|
+
if (makeSelection && (props === null || props === void 0 ? void 0 : props.allowTooltip) && (tooltip === null || tooltip === void 0 ? void 0 : tooltip.visible)) {
|
|
304
310
|
setTooltip((prev) => (Object.assign(Object.assign({}, prev), { visible: false })));
|
|
305
311
|
return;
|
|
306
312
|
}
|
|
@@ -409,7 +415,7 @@ const LayerView = (props) => {
|
|
|
409
415
|
pointerMoveGhost(e.nativeEvent);
|
|
410
416
|
const pointerHandleUp = (e) => {
|
|
411
417
|
var _a, _b, _c, _d, _e;
|
|
412
|
-
if (targetGroup) {
|
|
418
|
+
if (targetGroup && !hadSelection) {
|
|
413
419
|
const dataId = JSON.parse(targetGroup.getAttribute("data-id") || "{}");
|
|
414
420
|
isDragging.current = false;
|
|
415
421
|
const svgSize = svg.getBoundingClientRect();
|
|
@@ -444,7 +450,18 @@ const LayerView = (props) => {
|
|
|
444
450
|
clickTimerRef.current = null;
|
|
445
451
|
}, DOUBLE_DELAY);
|
|
446
452
|
}
|
|
447
|
-
if (
|
|
453
|
+
if (hadSelection && targetSelectionGroup && e.button === 2) {
|
|
454
|
+
const svgSize = svg.getBoundingClientRect();
|
|
455
|
+
const relX = e.clientX - svgSize.left;
|
|
456
|
+
const relY = e.clientY - svgSize.top;
|
|
457
|
+
const centerX = svgSize.width / 2;
|
|
458
|
+
const centerY = svgSize.height / 2;
|
|
459
|
+
const newX = relX > centerX ? relX - widthTooltip : relX;
|
|
460
|
+
const newY = relY > centerY ? relY : relY;
|
|
461
|
+
const rightClick = e.button === 2 && allowTooltip;
|
|
462
|
+
setTooltip({ x: newX / scale, y: newY / scale, visible: rightClick });
|
|
463
|
+
}
|
|
464
|
+
if (makeSelection && ((_a = dataElementSelectionGroupRef.current) === null || _a === void 0 ? void 0 : _a.length) > 0 && e.button === 0) {
|
|
448
465
|
const allTableInSelection = (_b = dataElementSelectionGroupRef.current) === null || _b === void 0 ? void 0 : _b.map((d) => d.id);
|
|
449
466
|
const filterTableInSelection = componentProps === null || componentProps === void 0 ? void 0 : componentProps.filter((item) => {
|
|
450
467
|
var _a, _b;
|
|
@@ -60,6 +60,9 @@ const LayerView = (props) => {
|
|
|
60
60
|
}),
|
|
61
61
|
}));
|
|
62
62
|
const dispatch = useAppDispatch();
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
setTooltip(Object.assign(Object.assign({}, tooltip), { visible: tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.open }));
|
|
65
|
+
}, [tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.open]);
|
|
63
66
|
useEffect(() => {
|
|
64
67
|
if (!loading && (loadingRender === null || loadingRender === void 0 ? void 0 : loadingRender.state)) {
|
|
65
68
|
dispatch({ type: "panel/setLoading", payload: true });
|
|
@@ -120,6 +123,7 @@ const LayerView = (props) => {
|
|
|
120
123
|
const handleUnSelectComponent = () => {
|
|
121
124
|
setSelectedLines(null);
|
|
122
125
|
dataElementSelectionGroupRef.current = [];
|
|
126
|
+
onMakeSelection && onMakeSelection([]);
|
|
123
127
|
};
|
|
124
128
|
const handleDoubleClick = (items, e) => {
|
|
125
129
|
const find = componentsEditor.find((item) => {
|
|
@@ -261,7 +265,6 @@ const LayerView = (props) => {
|
|
|
261
265
|
}, [actionPrivileged]);
|
|
262
266
|
const handlePointerDown = (e) => {
|
|
263
267
|
var _a, _b, _c;
|
|
264
|
-
console.log("handlePointerDown");
|
|
265
268
|
const svg = svgRef.current;
|
|
266
269
|
if (!e.isPrimary || !svg)
|
|
267
270
|
return;
|
|
@@ -271,13 +274,16 @@ const LayerView = (props) => {
|
|
|
271
274
|
const startY = e.clientY;
|
|
272
275
|
const { x, y } = getSvgCoords(e);
|
|
273
276
|
const targetGroup = e.target.closest("g[data-id]");
|
|
277
|
+
const targetSelectionGroup = e.target.closest("g[data-selection]");
|
|
278
|
+
console.log({ targetGroup, targetSelectionGroup });
|
|
274
279
|
const { clientX, clientY } = e;
|
|
275
280
|
const hitPoint = document.elementFromPoint(clientX, clientY);
|
|
276
281
|
const downOutTable = (hitPoint === null || hitPoint === void 0 ? void 0 : hitPoint.nodeName) === "svg";
|
|
277
|
-
console.log(hitPoint, "hit", targetGroup);
|
|
278
282
|
const makeSelection = (downOutTable || !targetGroup) && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.selection);
|
|
279
283
|
const hadSelection = dataElementSelectionGroupRef.current.length > 0;
|
|
280
|
-
const downInOutSelection = hadSelection && makeSelection;
|
|
284
|
+
const downInOutSelection = hadSelection && makeSelection && e.button !== 2;
|
|
285
|
+
console.log({ hadSelection, makeSelection, downInOutSelection });
|
|
286
|
+
const hasSelectionDownOutSelection = !targetSelectionGroup && targetGroup && hadSelection;
|
|
281
287
|
if (downOutTable) {
|
|
282
288
|
if (graph.connecting) {
|
|
283
289
|
graph.cancelConnect();
|
|
@@ -295,11 +301,11 @@ const LayerView = (props) => {
|
|
|
295
301
|
});
|
|
296
302
|
(_a = svgRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(boxSelection);
|
|
297
303
|
}
|
|
298
|
-
if (downInOutSelection) {
|
|
304
|
+
if (downInOutSelection || hasSelectionDownOutSelection) {
|
|
299
305
|
handleUnSelectComponent();
|
|
300
306
|
}
|
|
301
307
|
setPanningGroup(true);
|
|
302
|
-
if (
|
|
308
|
+
if (makeSelection && (props === null || props === void 0 ? void 0 : props.allowTooltip) && (tooltip === null || tooltip === void 0 ? void 0 : tooltip.visible)) {
|
|
303
309
|
setTooltip((prev) => (Object.assign(Object.assign({}, prev), { visible: false })));
|
|
304
310
|
return;
|
|
305
311
|
}
|
|
@@ -408,7 +414,7 @@ const LayerView = (props) => {
|
|
|
408
414
|
pointerMoveGhost(e.nativeEvent);
|
|
409
415
|
const pointerHandleUp = (e) => {
|
|
410
416
|
var _a, _b, _c, _d, _e;
|
|
411
|
-
if (targetGroup) {
|
|
417
|
+
if (targetGroup && !hadSelection) {
|
|
412
418
|
const dataId = JSON.parse(targetGroup.getAttribute("data-id") || "{}");
|
|
413
419
|
isDragging.current = false;
|
|
414
420
|
const svgSize = svg.getBoundingClientRect();
|
|
@@ -443,7 +449,18 @@ const LayerView = (props) => {
|
|
|
443
449
|
clickTimerRef.current = null;
|
|
444
450
|
}, DOUBLE_DELAY);
|
|
445
451
|
}
|
|
446
|
-
if (
|
|
452
|
+
if (hadSelection && targetSelectionGroup && e.button === 2) {
|
|
453
|
+
const svgSize = svg.getBoundingClientRect();
|
|
454
|
+
const relX = e.clientX - svgSize.left;
|
|
455
|
+
const relY = e.clientY - svgSize.top;
|
|
456
|
+
const centerX = svgSize.width / 2;
|
|
457
|
+
const centerY = svgSize.height / 2;
|
|
458
|
+
const newX = relX > centerX ? relX - widthTooltip : relX;
|
|
459
|
+
const newY = relY > centerY ? relY : relY;
|
|
460
|
+
const rightClick = e.button === 2 && allowTooltip;
|
|
461
|
+
setTooltip({ x: newX / scale, y: newY / scale, visible: rightClick });
|
|
462
|
+
}
|
|
463
|
+
if (makeSelection && ((_a = dataElementSelectionGroupRef.current) === null || _a === void 0 ? void 0 : _a.length) > 0 && e.button === 0) {
|
|
447
464
|
const allTableInSelection = (_b = dataElementSelectionGroupRef.current) === null || _b === void 0 ? void 0 : _b.map((d) => d.id);
|
|
448
465
|
const filterTableInSelection = componentProps === null || componentProps === void 0 ? void 0 : componentProps.filter((item) => {
|
|
449
466
|
var _a, _b;
|