seat-editor 3.6.21 → 3.6.23

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.
@@ -162,5 +162,7 @@ export default function GraphView() {
162
162
  colorGroupSelection: COLORS_SECTION,
163
163
  dataKey: "uuid_table",
164
164
  selection: selection
165
+ }, onRightClick: (e, data) => {
166
+ console.log({ e, data });
165
167
  }, 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
168
  }
@@ -168,6 +168,8 @@ export default function GraphView() {
168
168
  colorGroupSelection: COLORS_SECTION,
169
169
  dataKey: "uuid_table",
170
170
  selection: selection
171
+ }} onRightClick={(e, data) => {
172
+ console.log({ e, data });
171
173
  }} allowTooltip={true}/>
172
174
  <div className="w-1/5 p-4" onMouseMove={handleMouseMove} onMouseLeave={handleMouseLeave}>
173
175
  <div id="table"/>
@@ -276,14 +276,13 @@ const LayerView = (props) => {
276
276
  const { x, y } = getSvgCoords(e);
277
277
  const targetGroup = e.target.closest("g[data-id]");
278
278
  const targetSelectionGroup = e.target.closest("g[data-selection]");
279
- console.log({ targetGroup, targetSelectionGroup });
280
279
  const { clientX, clientY } = e;
281
280
  const hitPoint = document.elementFromPoint(clientX, clientY);
282
281
  const downOutTable = (hitPoint === null || hitPoint === void 0 ? void 0 : hitPoint.nodeName) === "svg";
283
282
  const makeSelection = (downOutTable || !targetGroup) && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.selection);
284
283
  const hadSelection = dataElementSelectionGroupRef.current.length > 0;
285
284
  const downInOutSelection = hadSelection && makeSelection && e.button !== 2;
286
- console.log({ hadSelection, makeSelection, downInOutSelection });
285
+ const unSelectAll = hadSelection && e.button === 2 && targetGroup && !targetSelectionGroup;
287
286
  const hasSelectionDownOutSelection = !targetSelectionGroup && targetGroup && hadSelection;
288
287
  if (downOutTable) {
289
288
  if (graph.connecting) {
@@ -302,9 +301,13 @@ const LayerView = (props) => {
302
301
  });
303
302
  (_a = svgRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(boxSelection);
304
303
  }
305
- if (downInOutSelection || hasSelectionDownOutSelection) {
304
+ if (downInOutSelection || hasSelectionDownOutSelection || unSelectAll) {
306
305
  handleUnSelectComponent();
307
306
  }
307
+ if (unSelectAll) {
308
+ setTooltip((prev) => (Object.assign(Object.assign({}, prev), { visible: false })));
309
+ return;
310
+ }
308
311
  setPanningGroup(true);
309
312
  if (makeSelection && (props === null || props === void 0 ? void 0 : props.allowTooltip) && (tooltip === null || tooltip === void 0 ? void 0 : tooltip.visible)) {
310
313
  setTooltip((prev) => (Object.assign(Object.assign({}, prev), { visible: false })));
@@ -275,14 +275,13 @@ const LayerView = (props) => {
275
275
  const { x, y } = getSvgCoords(e);
276
276
  const targetGroup = e.target.closest("g[data-id]");
277
277
  const targetSelectionGroup = e.target.closest("g[data-selection]");
278
- console.log({ targetGroup, targetSelectionGroup });
279
278
  const { clientX, clientY } = e;
280
279
  const hitPoint = document.elementFromPoint(clientX, clientY);
281
280
  const downOutTable = (hitPoint === null || hitPoint === void 0 ? void 0 : hitPoint.nodeName) === "svg";
282
281
  const makeSelection = (downOutTable || !targetGroup) && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.selection);
283
282
  const hadSelection = dataElementSelectionGroupRef.current.length > 0;
284
283
  const downInOutSelection = hadSelection && makeSelection && e.button !== 2;
285
- console.log({ hadSelection, makeSelection, downInOutSelection });
284
+ const unSelectAll = hadSelection && e.button === 2 && targetGroup && !targetSelectionGroup;
286
285
  const hasSelectionDownOutSelection = !targetSelectionGroup && targetGroup && hadSelection;
287
286
  if (downOutTable) {
288
287
  if (graph.connecting) {
@@ -301,9 +300,13 @@ const LayerView = (props) => {
301
300
  });
302
301
  (_a = svgRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(boxSelection);
303
302
  }
304
- if (downInOutSelection || hasSelectionDownOutSelection) {
303
+ if (downInOutSelection || hasSelectionDownOutSelection || unSelectAll) {
305
304
  handleUnSelectComponent();
306
305
  }
306
+ if (unSelectAll) {
307
+ setTooltip((prev) => (Object.assign(Object.assign({}, prev), { visible: false })));
308
+ return;
309
+ }
307
310
  setPanningGroup(true);
308
311
  if (makeSelection && (props === null || props === void 0 ? void 0 : props.allowTooltip) && (tooltip === null || tooltip === void 0 ? void 0 : tooltip.visible)) {
309
312
  setTooltip((prev) => (Object.assign(Object.assign({}, prev), { visible: false })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seat-editor",
3
- "version": "3.6.21",
3
+ "version": "3.6.23",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",