seat-editor 3.6.17 → 3.6.19

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.
@@ -580,3 +580,13 @@ export declare const data: ({
580
580
  sections: any;
581
581
  })[];
582
582
  export declare const COLORS_SECTION: string[];
583
+ export declare const background: {
584
+ x: number;
585
+ y: number;
586
+ id: string;
587
+ src: string;
588
+ image: string;
589
+ shape: string;
590
+ width: number;
591
+ height: number;
592
+ }[];
@@ -6993,3 +6993,13 @@ export const COLORS_SECTION = [
6993
6993
  "#FBC6D3",
6994
6994
  "#D5C4F9",
6995
6995
  ];
6996
+ export const background = [{
6997
+ "x": 1108,
6998
+ "y": 78,
6999
+ "id": "1754137849705",
7000
+ "src": "https://cdn.table.link/prod/5bf923de-2366-4a11-9b8b-e92de0afbf05/3a65cb36-7d85-4c38-9403-a15f94641920/68d45207-d66b-4bb5-92a2-4e5a87715e98/rsvp/1754137849587013665_BOI Reg.png",
7001
+ "image": "/5bf923de-2366-4a11-9b8b-e92de0afbf05/3a65cb36-7d85-4c38-9403-a15f94641920/68d45207-d66b-4bb5-92a2-4e5a87715e98/rsvp/1754137849587013665_BOI Reg.png",
7002
+ "shape": "background",
7003
+ "width": 1561,
7004
+ "height": 1494
7005
+ }];
@@ -9,7 +9,7 @@ import { selection } from "./selection";
9
9
  export default function GraphView() {
10
10
  const [isConnecting, setIsConnecting] = useState(false);
11
11
  const [actionPrivileged, setActionPrivileged] = useState({
12
- select: true,
12
+ select: false,
13
13
  move: false,
14
14
  switch: false,
15
15
  drop: false,
@@ -140,7 +140,9 @@ export default function GraphView() {
140
140
  };
141
141
  return (_jsx("div", { className: "w-full h-screen flex relative", children: _jsxs("div", { className: "flex", children: [_jsx("div", { className: "absolute top-0 left-0 z-10 flex gap-2", children: priviledged.map((item) => (_jsx(Button, { type: actionPrivileged[item.key] ? "primary" : "default", htmlType: "button", onClick: () => {
142
142
  setActionPrivileged((prev) => (Object.assign(Object.assign({}, prev), { [item.key]: !prev[item.key] })));
143
- }, children: item.name }, item.key))) }), _jsx(LayerView, { componentProps: componentSection, statusKey: "section", defaultBackground: "#1e2d4a", mappingKey: "properties", keyNode: "nodes", onEdgesChange: (table, edges) => console.log({ edges, table }), isConnectEdge: isConnecting, isSelectNode: isSelectNode, onSelectComponent: handleSelectItem,
143
+ }, children: item.name }, item.key))) }), _jsx(LayerView, { componentProps: componentSection, statusKey: "section", defaultBackground: "#1e2d4a", mappingKey: "properties", keyNode: "nodes", onEdgesChange: (table, edges) => console.log({ edges, table }), isConnectEdge: isConnecting, isSelectNode: isSelectNode,
144
+ // extraComponentProps={background}
145
+ onSelectComponent: handleSelectItem,
144
146
  // actionPrivileged={{
145
147
  // select: true,
146
148
  // }}
@@ -8,7 +8,7 @@ import { selection } from "./selection";
8
8
  export default function GraphView() {
9
9
  const [isConnecting, setIsConnecting] = useState(false);
10
10
  const [actionPrivileged, setActionPrivileged] = useState({
11
- select: true,
11
+ select: false,
12
12
  move: false,
13
13
  switch: false,
14
14
  drop: false,
@@ -146,7 +146,9 @@ export default function GraphView() {
146
146
  {item.name}
147
147
  </Button>))}
148
148
  </div>
149
- <LayerView componentProps={componentSection} statusKey="section" defaultBackground="#1e2d4a" mappingKey="properties" keyNode="nodes" onEdgesChange={(table, edges) => console.log({ edges, table })} isConnectEdge={isConnecting} isSelectNode={isSelectNode} onSelectComponent={handleSelectItem}
149
+ <LayerView componentProps={componentSection} statusKey="section" defaultBackground="#1e2d4a" mappingKey="properties" keyNode="nodes" onEdgesChange={(table, edges) => console.log({ edges, table })} isConnectEdge={isConnecting} isSelectNode={isSelectNode}
150
+ // extraComponentProps={background}
151
+ onSelectComponent={handleSelectItem}
150
152
  // actionPrivileged={{
151
153
  // select: true,
152
154
  // }}
@@ -275,7 +275,8 @@ const LayerView = (props) => {
275
275
  const { clientX, clientY } = e;
276
276
  const hitPoint = document.elementFromPoint(clientX, clientY);
277
277
  const downOutTable = (hitPoint === null || hitPoint === void 0 ? void 0 : hitPoint.nodeName) === "svg";
278
- const makeSelection = downOutTable && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.selection);
278
+ console.log(hitPoint, "hit", targetGroup);
279
+ const makeSelection = (downOutTable || !targetGroup) && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.selection);
279
280
  const hadSelection = dataElementSelectionGroupRef.current.length > 0;
280
281
  const downInOutSelection = hadSelection && makeSelection;
281
282
  if (downOutTable) {
@@ -407,7 +408,7 @@ const LayerView = (props) => {
407
408
  };
408
409
  pointerMoveGhost(e.nativeEvent);
409
410
  const pointerHandleUp = (e) => {
410
- var _a, _b, _c;
411
+ var _a, _b, _c, _d, _e;
411
412
  if (targetGroup) {
412
413
  const dataId = JSON.parse(targetGroup.getAttribute("data-id") || "{}");
413
414
  isDragging.current = false;
@@ -484,6 +485,9 @@ const LayerView = (props) => {
484
485
  }
485
486
  (_c = svg.querySelector("#selection-box-ghost")) === null || _c === void 0 ? void 0 : _c.remove();
486
487
  }
488
+ if (makeSelection && ((_d = dataElementSelectionGroupRef.current) === null || _d === void 0 ? void 0 : _d.length) === 0) {
489
+ (_e = svg.querySelector("#selection-box-ghost")) === null || _e === void 0 ? void 0 : _e.remove();
490
+ }
487
491
  setPanningGroup(false);
488
492
  tableGhost.current = null;
489
493
  isDragging.current = false;
@@ -274,7 +274,8 @@ const LayerView = (props) => {
274
274
  const { clientX, clientY } = e;
275
275
  const hitPoint = document.elementFromPoint(clientX, clientY);
276
276
  const downOutTable = (hitPoint === null || hitPoint === void 0 ? void 0 : hitPoint.nodeName) === "svg";
277
- const makeSelection = downOutTable && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.selection);
277
+ console.log(hitPoint, "hit", targetGroup);
278
+ const makeSelection = (downOutTable || !targetGroup) && (actionPrivileged === null || actionPrivileged === void 0 ? void 0 : actionPrivileged.selection);
278
279
  const hadSelection = dataElementSelectionGroupRef.current.length > 0;
279
280
  const downInOutSelection = hadSelection && makeSelection;
280
281
  if (downOutTable) {
@@ -406,7 +407,7 @@ const LayerView = (props) => {
406
407
  };
407
408
  pointerMoveGhost(e.nativeEvent);
408
409
  const pointerHandleUp = (e) => {
409
- var _a, _b, _c;
410
+ var _a, _b, _c, _d, _e;
410
411
  if (targetGroup) {
411
412
  const dataId = JSON.parse(targetGroup.getAttribute("data-id") || "{}");
412
413
  isDragging.current = false;
@@ -483,6 +484,9 @@ const LayerView = (props) => {
483
484
  }
484
485
  (_c = svg.querySelector("#selection-box-ghost")) === null || _c === void 0 ? void 0 : _c.remove();
485
486
  }
487
+ if (makeSelection && ((_d = dataElementSelectionGroupRef.current) === null || _d === void 0 ? void 0 : _d.length) === 0) {
488
+ (_e = svg.querySelector("#selection-box-ghost")) === null || _e === void 0 ? void 0 : _e.remove();
489
+ }
486
490
  setPanningGroup(false);
487
491
  tableGhost.current = null;
488
492
  isDragging.current = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seat-editor",
3
- "version": "3.6.17",
3
+ "version": "3.6.19",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",