seat-editor 3.6.12 → 3.6.14
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.
|
@@ -602,7 +602,7 @@ const LayerView = (props) => {
|
|
|
602
602
|
const viewBox = isValidBoundingBox
|
|
603
603
|
? `${boundingBox.minX - (((_a = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _a === void 0 ? void 0 : _a.paddingLeft) || 0)} ${boundingBox.minY - (((_b = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _b === void 0 ? void 0 : _b.paddingTop) || 0)} ${boundingBox.width + (((_c = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _c === void 0 ? void 0 : _c.paddingRight) || 0)} ${boundingBox.height + (((_d = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _d === void 0 ? void 0 : _d.paddingBottom) || 0)}`
|
|
604
604
|
: "0 0 1000 1000";
|
|
605
|
-
const renderedElements = useMemo(() => renderElements(componentsEditor, mappingKey, tableMatchKey, graph.connecting, groupSelection), [componentsEditor, mappingKey, tableMatchKey, statusKey, graph.connecting]);
|
|
605
|
+
const renderedElements = useMemo(() => renderElements(componentsEditor, mappingKey, tableMatchKey, graph.connecting, groupSelection), [componentsEditor, mappingKey, tableMatchKey, statusKey, graph.connecting, groupSelection]);
|
|
606
606
|
return (_jsxs("div", Object.assign({ className: "relative w-full h-full flex-1", ref: containerRef, style: { overflow: "auto", WebkitOverflowScrolling: "touch" } }, props.containerProps, { children: [loading && (_jsx("div", { className: "absolute z-10 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-opacity-50 bg-white w-full h-full flex items-center justify-center", children: (loadingRender === null || loadingRender === void 0 ? void 0 : loadingRender.element) || _jsx(Spin, {}) })), _jsx(TransformWrapper, Object.assign({ ref: transformRef, disablePadding: true, centerZoomedOut: true, panning: { disabled: panningGroup, wheelPanning: true }, wheel: { disabled: false }, onTransformed: ({ state: { scale } }) => setScale(scale), minScale: 1, maxScale: 1000, initialScale: 1, smooth: true, centerOnInit: true }, props.transformProps, { children: _jsxs(TransformComponent, { wrapperStyle: { width: "100%", height: "100%" }, contentStyle: { width: "100%", height: "100%" }, children: [_jsxs("svg", Object.assign({ id: "workspace", ref: svgRef, width: "100%", height: "100%", overflow: "hidden", viewBox: viewBox, className: "h-full", xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid meet", onContextMenu: (e) => e.preventDefault(),
|
|
607
607
|
// onDrop={(e) => handleTableEvent(e, "drop")}
|
|
608
608
|
onPointerDown: handlePointerDown, onPointerUp: handleMouseUp, onMouseMove: (e) => graph.onMouseMove(e), onMouseUp: () => graph.onMouseUp(), onClick: (e) => {
|
|
@@ -601,7 +601,7 @@ const LayerView = (props) => {
|
|
|
601
601
|
const viewBox = isValidBoundingBox
|
|
602
602
|
? `${boundingBox.minX - (((_a = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _a === void 0 ? void 0 : _a.paddingLeft) || 0)} ${boundingBox.minY - (((_b = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _b === void 0 ? void 0 : _b.paddingTop) || 0)} ${boundingBox.width + (((_c = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _c === void 0 ? void 0 : _c.paddingRight) || 0)} ${boundingBox.height + (((_d = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _d === void 0 ? void 0 : _d.paddingBottom) || 0)}`
|
|
603
603
|
: "0 0 1000 1000";
|
|
604
|
-
const renderedElements = useMemo(() => renderElements(componentsEditor, mappingKey, tableMatchKey, graph.connecting, groupSelection), [componentsEditor, mappingKey, tableMatchKey, statusKey, graph.connecting]);
|
|
604
|
+
const renderedElements = useMemo(() => renderElements(componentsEditor, mappingKey, tableMatchKey, graph.connecting, groupSelection), [componentsEditor, mappingKey, tableMatchKey, statusKey, graph.connecting, groupSelection]);
|
|
605
605
|
return (<div className="relative w-full h-full flex-1" ref={containerRef} style={{ overflow: "auto", WebkitOverflowScrolling: "touch" }} {...props.containerProps}>
|
|
606
606
|
{loading && (<div className="absolute z-10 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-opacity-50 bg-white w-full h-full flex items-center justify-center">
|
|
607
607
|
{(loadingRender === null || loadingRender === void 0 ? void 0 : loadingRender.element) || <Spin />}
|
|
@@ -69,6 +69,7 @@ const findIndexByValue = (obj, targetValue) => {
|
|
|
69
69
|
if (!obj || !targetValue)
|
|
70
70
|
return undefined;
|
|
71
71
|
const foundEntry = Object.entries(obj).find(([_, values]) => values.includes(targetValue));
|
|
72
|
+
console.log({ foundEntry });
|
|
72
73
|
return foundEntry ? Number(foundEntry[0]) : undefined;
|
|
73
74
|
};
|
|
74
75
|
export const renderElements = (elementEditor, mappingKey, tableMatchKey, connecting, groupSelection) => {
|
|
@@ -87,7 +88,7 @@ export const renderElements = (elementEditor, mappingKey, tableMatchKey, connect
|
|
|
87
88
|
// console.log({ finalProps })
|
|
88
89
|
const findIndexSelection = findIndexByValue(groupSelection === null || groupSelection === void 0 ? void 0 : groupSelection.selection, finalProps === null || finalProps === void 0 ? void 0 : finalProps[groupSelection === null || groupSelection === void 0 ? void 0 : groupSelection.dataKey]);
|
|
89
90
|
let fill = finalProps === null || finalProps === void 0 ? void 0 : finalProps.fill;
|
|
90
|
-
|
|
91
|
+
console.log({ findIndexSelection }, { tableMatch }, { connecting });
|
|
91
92
|
if (findIndexSelection) {
|
|
92
93
|
fill = groupSelection === null || groupSelection === void 0 ? void 0 : groupSelection.colorGroupSelection[findIndexSelection];
|
|
93
94
|
}
|