seat-editor 3.6.31 → 3.6.33
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/features/view-only-5/connection-layer.js +1 -4
- package/dist/features/view-only-5/connection-layer.jsx +1 -4
- package/dist/features/view-only-5/index.d.ts +1 -1
- package/dist/features/view-only-5/index.js +1 -0
- package/dist/features/view-only-5/index.jsx +1 -0
- package/dist/features/view-only-5/use-connection-graph.js +1 -0
- package/dist/features/view-only-5/utils.js +0 -2
- package/package.json +1 -1
|
@@ -47,14 +47,12 @@ const quadraticMidpoint = (from, to) => {
|
|
|
47
47
|
};
|
|
48
48
|
export const ConnectionLayer = ({ edges, selectedEdge, connecting, draggingAnchor, mousePos, isConnectEdge, getNodeById, onSelectEdge, onDeleteEdge, onStartDragWaypoint, onInsertWaypoint, onRemoveWaypoint, onStartDragAnchor, selectedNodeId, showConnection, renderedElements, groupSelection, connectionMatchKey, isSelectNode }) => {
|
|
49
49
|
const [hoveredEdge, setHoveredEdge] = useState(null);
|
|
50
|
-
console.log({ edges });
|
|
51
50
|
const tableMatchConnectionKey = useMemo(() => renderedElements === null || renderedElements === void 0 ? void 0 : renderedElements.filter((el) => {
|
|
52
51
|
if (connectionMatchKey) {
|
|
53
52
|
return (el === null || el === void 0 ? void 0 : el[connectionMatchKey === null || connectionMatchKey === void 0 ? void 0 : connectionMatchKey.key]) === (connectionMatchKey === null || connectionMatchKey === void 0 ? void 0 : connectionMatchKey.value);
|
|
54
53
|
}
|
|
55
54
|
return true;
|
|
56
55
|
}), [renderedElements, connectionMatchKey]);
|
|
57
|
-
console.log("tableMatchConnectionKey", tableMatchConnectionKey);
|
|
58
56
|
const nodeHighlightMap = useMemo(() => {
|
|
59
57
|
if (!selectedEdge)
|
|
60
58
|
return new Map();
|
|
@@ -154,7 +152,6 @@ export const ConnectionLayer = ({ edges, selectedEdge, connecting, draggingAncho
|
|
|
154
152
|
const rotation = (_c = node.rotation) !== null && _c !== void 0 ? _c : 0;
|
|
155
153
|
const color = getLevelColor(level);
|
|
156
154
|
const padding = 4;
|
|
157
|
-
// console.log("nodeHighlightMapByNode", nodeId, level, color);
|
|
158
155
|
if (level > 1)
|
|
159
156
|
return null;
|
|
160
157
|
return (_jsxs("g", { transform: `translate(${node.x}, ${node.y}) rotate(${rotation})`, style: { pointerEvents: "none" }, children: [_jsx("rect", { x: -w / 2 - padding, y: -h / 2 - padding, width: w + padding * 2, height: h + padding * 2, fill: "none", stroke: color, strokeWidth: 8, rx: 5, opacity: 0.08 }), _jsx("rect", { x: -w / 2 - padding, y: -h / 2 - padding, width: w + padding * 2, height: h + padding * 2, fill: "none", stroke: color, strokeWidth: level === 0 ? 2.5 : 1.5,
|
|
@@ -168,7 +165,7 @@ export const ConnectionLayer = ({ edges, selectedEdge, connecting, draggingAncho
|
|
|
168
165
|
const { pathD, allPoints, fromPos, toPos, midX, midY } = ep;
|
|
169
166
|
const isSel = selectedEdge === edge.id;
|
|
170
167
|
const isHov = hoveredEdge === edge.id;
|
|
171
|
-
const connectionMatch = tableMatchConnectionKey === null || tableMatchConnectionKey === void 0 ? void 0 : tableMatchConnectionKey.some((el) => el.id === edge.to || el.id === edge.from);
|
|
168
|
+
const connectionMatch = tableMatchConnectionKey === null || tableMatchConnectionKey === void 0 ? void 0 : tableMatchConnectionKey.some((el) => { var _a, _b; return ((_a = el === null || el === void 0 ? void 0 : el[groupSelection === null || groupSelection === void 0 ? void 0 : groupSelection.dataKey]) !== null && _a !== void 0 ? _a : el.id) === edge.to || ((_b = el === null || el === void 0 ? void 0 : el[groupSelection === null || groupSelection === void 0 ? void 0 : groupSelection.dataKey]) !== null && _b !== void 0 ? _b : el.id) === edge.from; });
|
|
172
169
|
// const fromLevel = nodeHighlightMap.get(edge.from);
|
|
173
170
|
// const toLevel = nodeHighlightMap.get(edge.to);
|
|
174
171
|
const isStillConnectingProcess = (connecting === null || connecting === void 0 ? void 0 : connecting.fromId) === edge.from || (connecting === null || connecting === void 0 ? void 0 : connecting.fromId) === edge.to;
|
|
@@ -46,14 +46,12 @@ const quadraticMidpoint = (from, to) => {
|
|
|
46
46
|
};
|
|
47
47
|
export const ConnectionLayer = ({ edges, selectedEdge, connecting, draggingAnchor, mousePos, isConnectEdge, getNodeById, onSelectEdge, onDeleteEdge, onStartDragWaypoint, onInsertWaypoint, onRemoveWaypoint, onStartDragAnchor, selectedNodeId, showConnection, renderedElements, groupSelection, connectionMatchKey, isSelectNode }) => {
|
|
48
48
|
const [hoveredEdge, setHoveredEdge] = useState(null);
|
|
49
|
-
console.log({ edges });
|
|
50
49
|
const tableMatchConnectionKey = useMemo(() => renderedElements === null || renderedElements === void 0 ? void 0 : renderedElements.filter((el) => {
|
|
51
50
|
if (connectionMatchKey) {
|
|
52
51
|
return (el === null || el === void 0 ? void 0 : el[connectionMatchKey === null || connectionMatchKey === void 0 ? void 0 : connectionMatchKey.key]) === (connectionMatchKey === null || connectionMatchKey === void 0 ? void 0 : connectionMatchKey.value);
|
|
53
52
|
}
|
|
54
53
|
return true;
|
|
55
54
|
}), [renderedElements, connectionMatchKey]);
|
|
56
|
-
console.log("tableMatchConnectionKey", tableMatchConnectionKey);
|
|
57
55
|
const nodeHighlightMap = useMemo(() => {
|
|
58
56
|
if (!selectedEdge)
|
|
59
57
|
return new Map();
|
|
@@ -179,7 +177,6 @@ export const ConnectionLayer = ({ edges, selectedEdge, connecting, draggingAncho
|
|
|
179
177
|
const rotation = (_c = node.rotation) !== null && _c !== void 0 ? _c : 0;
|
|
180
178
|
const color = getLevelColor(level);
|
|
181
179
|
const padding = 4;
|
|
182
|
-
// console.log("nodeHighlightMapByNode", nodeId, level, color);
|
|
183
180
|
if (level > 1)
|
|
184
181
|
return null;
|
|
185
182
|
return (<g key={`highlight-${nodeId}`} transform={`translate(${node.x}, ${node.y}) rotate(${rotation})`} style={{ pointerEvents: "none" }}>
|
|
@@ -213,7 +210,7 @@ export const ConnectionLayer = ({ edges, selectedEdge, connecting, draggingAncho
|
|
|
213
210
|
const { pathD, allPoints, fromPos, toPos, midX, midY } = ep;
|
|
214
211
|
const isSel = selectedEdge === edge.id;
|
|
215
212
|
const isHov = hoveredEdge === edge.id;
|
|
216
|
-
const connectionMatch = tableMatchConnectionKey === null || tableMatchConnectionKey === void 0 ? void 0 : tableMatchConnectionKey.some((el) => el.id === edge.to || el.id === edge.from);
|
|
213
|
+
const connectionMatch = tableMatchConnectionKey === null || tableMatchConnectionKey === void 0 ? void 0 : tableMatchConnectionKey.some((el) => { var _a, _b; return ((_a = el === null || el === void 0 ? void 0 : el[groupSelection === null || groupSelection === void 0 ? void 0 : groupSelection.dataKey]) !== null && _a !== void 0 ? _a : el.id) === edge.to || ((_b = el === null || el === void 0 ? void 0 : el[groupSelection === null || groupSelection === void 0 ? void 0 : groupSelection.dataKey]) !== null && _b !== void 0 ? _b : el.id) === edge.from; });
|
|
217
214
|
// const fromLevel = nodeHighlightMap.get(edge.from);
|
|
218
215
|
// const toLevel = nodeHighlightMap.get(edge.to);
|
|
219
216
|
const isStillConnectingProcess = (connecting === null || connecting === void 0 ? void 0 : connecting.fromId) === edge.from || (connecting === null || connecting === void 0 ? void 0 : connecting.fromId) === edge.to;
|
|
@@ -120,7 +120,7 @@ export interface LayerViewProps<TMeta = undefined> {
|
|
|
120
120
|
key: string;
|
|
121
121
|
value: string | number;
|
|
122
122
|
};
|
|
123
|
-
onTableMainConnection?: (id: string) => void;
|
|
123
|
+
onTableMainConnection?: (id: string | null) => void;
|
|
124
124
|
}
|
|
125
125
|
declare const LayerView: <TMeta>(props: LayerViewProps<TMeta>) => React.JSX.Element;
|
|
126
126
|
export default LayerView;
|
|
@@ -700,6 +700,7 @@ const LayerView = (props) => {
|
|
|
700
700
|
graph.updateAnchor(nodeId, clickPos);
|
|
701
701
|
else
|
|
702
702
|
graph.endConnect(nodeId, clickPos);
|
|
703
|
+
onTableMainConnection && onTableMainConnection(null);
|
|
703
704
|
}, isConnectEdge: actionPrivileged.connectingNode, onSelectNode: graph.selectNode, isSelectNode: actionPrivileged.selectNode, onSelectEdge: graph.selectEdge, edges: graph.edges, showConnection: showConnection }, item.id));
|
|
704
705
|
})] })), tooltip.visible && (_jsx("div", { className: `seat-editor tooltip-container ${tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.className}`, style: Object.assign({ top: tooltip.y, left: tooltip.x, transform: `scale(${1 / scale})`, transformOrigin: "top left", minWidth: widthTooltip + "px" }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.style), children: tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.children }))] }) }))] })));
|
|
705
706
|
};
|
|
@@ -721,6 +721,7 @@ const LayerView = (props) => {
|
|
|
721
721
|
graph.updateAnchor(nodeId, clickPos);
|
|
722
722
|
else
|
|
723
723
|
graph.endConnect(nodeId, clickPos);
|
|
724
|
+
onTableMainConnection && onTableMainConnection(null);
|
|
724
725
|
}} isConnectEdge={actionPrivileged.connectingNode} onSelectNode={graph.selectNode} isSelectNode={actionPrivileged.selectNode} onSelectEdge={graph.selectEdge} edges={graph.edges} showConnection={showConnection}/>);
|
|
725
726
|
})}
|
|
726
727
|
</svg>
|
|
@@ -110,10 +110,8 @@ export const renderElements = (elementEditor, mappingKey, tableMatchKey, connect
|
|
|
110
110
|
finalProps = Object.assign(Object.assign(Object.assign({}, finalProps), tableMatch === null || tableMatch === void 0 ? void 0 : tableMatch.properties), { fill: fill, stroke, className: tableMatch === null || tableMatch === void 0 ? void 0 : tableMatch.className, element: tableMatch === null || tableMatch === void 0 ? void 0 : tableMatch.element });
|
|
111
111
|
}
|
|
112
112
|
if (connectionMatchKey) {
|
|
113
|
-
console.log("finalProps?.[connectionMatchKey.key]", finalProps, finalProps === null || finalProps === void 0 ? void 0 : finalProps[connectionMatchKey.key]);
|
|
114
113
|
if (!(finalProps === null || finalProps === void 0 ? void 0 : finalProps[connectionMatchKey.key])) {
|
|
115
114
|
finalProps = Object.assign(Object.assign({}, finalProps), { [connectionMatchKey.key]: editorItem === null || editorItem === void 0 ? void 0 : editorItem[connectionMatchKey.key] });
|
|
116
|
-
console.log("finalProps?.[connectionMatchKey.key]", finalProps, finalProps === null || finalProps === void 0 ? void 0 : finalProps[connectionMatchKey.key]);
|
|
117
115
|
}
|
|
118
116
|
}
|
|
119
117
|
return finalProps;
|