seat-editor 3.0.0 → 3.0.2

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.
Files changed (100) hide show
  1. package/dist/app/layout.d.ts +1 -1
  2. package/dist/app/{layout.js → layout.jsx} +7 -2
  3. package/dist/app/new-board/page.d.ts +1 -1
  4. package/dist/app/new-board/page.jsx +55 -0
  5. package/dist/app/old-board/page.d.ts +2 -1
  6. package/dist/app/old-board/{page.js → page.jsx} +215 -82
  7. package/dist/app/only-view/chair.d.ts +1 -1
  8. package/dist/app/only-view/chair.js +10 -2
  9. package/dist/app/only-view/page.d.ts +1 -1
  10. package/dist/app/only-view/page.jsx +101 -0
  11. package/dist/app/only-view/user.d.ts +1 -1
  12. package/dist/app/only-view/user.js +10 -2
  13. package/dist/app/page.d.ts +1 -1
  14. package/dist/app/page.jsx +13 -0
  15. package/dist/app/test/page.d.ts +2 -1
  16. package/dist/app/test/{page.js → page.jsx} +5 -3
  17. package/dist/app/v2/page.d.ts +1 -1
  18. package/dist/app/v2/page.jsx +13 -0
  19. package/dist/components/button-tools/index.d.ts +1 -1
  20. package/dist/components/button-tools/index.jsx +17 -0
  21. package/dist/components/form-tools/label.d.ts +1 -1
  22. package/dist/components/form-tools/label.jsx +44 -0
  23. package/dist/components/form-tools/shape.d.ts +1 -1
  24. package/dist/components/form-tools/shape.jsx +66 -0
  25. package/dist/components/input/number-indicator.d.ts +1 -1
  26. package/dist/components/input/{number-indicator.js → number-indicator.jsx} +11 -2
  27. package/dist/components/joystick/index.d.ts +2 -1
  28. package/dist/components/joystick/{index.js → index.jsx} +14 -13
  29. package/dist/components/layer/index.d.ts +1 -1
  30. package/dist/components/layer/index.jsx +383 -0
  31. package/dist/components/layer-v2/index.d.ts +1 -1
  32. package/dist/components/layer-v2/index.jsx +370 -0
  33. package/dist/components/layer-v3/index.d.ts +1 -1
  34. package/dist/components/layer-v3/{index.js → index.jsx} +242 -102
  35. package/dist/components/layer-v4/index.d.ts +1 -1
  36. package/dist/components/layer-v4/{index.js → index.jsx} +157 -80
  37. package/dist/components/lib/index.d.ts +1 -1
  38. package/dist/components/lib/{index.js → index.jsx} +7 -2
  39. package/dist/components/modal-preview/index.d.ts +1 -1
  40. package/dist/components/modal-preview/index.jsx +11 -0
  41. package/dist/features/board/index.d.ts +1 -1
  42. package/dist/features/board/{index.js → index.jsx} +90 -31
  43. package/dist/features/board-v2/index.d.ts +2 -1
  44. package/dist/features/board-v2/{index.js → index.jsx} +101 -39
  45. package/dist/features/board-v3/index copy.d.ts +2 -1
  46. package/dist/features/board-v3/{index copy.js → index copy.jsx } +128 -50
  47. package/dist/features/board-v3/index.d.ts +2 -1
  48. package/dist/features/board-v3/{index.js → index.jsx} +110 -32
  49. package/dist/features/navbar/index.d.ts +1 -1
  50. package/dist/features/navbar/index.jsx +5 -0
  51. package/dist/features/package/index.d.ts +1 -1
  52. package/dist/features/package/{index.js → index.jsx} +16 -6
  53. package/dist/features/panel/index.d.ts +1 -1
  54. package/dist/features/panel/{index.js → index.jsx} +25 -7
  55. package/dist/features/panel/select-tool.d.ts +1 -1
  56. package/dist/features/panel/{select-tool.js → select-tool.jsx} +23 -10
  57. package/dist/features/panel/selected-group.d.ts +1 -1
  58. package/dist/features/panel/selected-group.jsx +47 -0
  59. package/dist/features/panel/square-circle-tool.d.ts +1 -1
  60. package/dist/features/panel/{square-circle-tool.js → square-circle-tool.jsx} +4 -2
  61. package/dist/features/panel/table-seat-circle.d.ts +1 -1
  62. package/dist/features/panel/table-seat-circle.jsx +31 -0
  63. package/dist/features/panel/table-seat-square.d.ts +1 -1
  64. package/dist/features/panel/table-seat-square.jsx +46 -0
  65. package/dist/features/panel/text-tool.d.ts +1 -1
  66. package/dist/features/panel/text-tool.jsx +26 -0
  67. package/dist/features/panel/upload-tool.d.ts +1 -1
  68. package/dist/features/panel/{upload-tool.js → upload-tool.jsx} +24 -2
  69. package/dist/features/side-tool/index.d.ts +1 -1
  70. package/dist/features/side-tool/{index.js → index.jsx} +120 -98
  71. package/dist/features/view-only/index.d.ts +1 -1
  72. package/dist/features/view-only/{index.js → index.jsx} +38 -31
  73. package/dist/features/view-only-2/index.d.ts +1 -1
  74. package/dist/features/view-only-2/{index.js → index.jsx} +16 -13
  75. package/dist/features/view-only-3/index.d.ts +1 -1
  76. package/dist/features/view-only-3/{index.js → index.jsx} +46 -27
  77. package/dist/index.d.ts +2 -1
  78. package/dist/index.js +2 -1
  79. package/dist/provider/antd-provider.jsx +46 -0
  80. package/dist/provider/redux-provider.d.ts +1 -1
  81. package/dist/provider/{redux-provider.js → redux-provider.jsx} +1 -2
  82. package/dist/provider/store-provider.d.ts +1 -1
  83. package/dist/provider/{store-provider.js → store-provider.jsx} +3 -2
  84. package/package.json +1 -1
  85. package/dist/app/new-board/page.js +0 -33
  86. package/dist/app/only-view/page.js +0 -78
  87. package/dist/app/page.js +0 -8
  88. package/dist/app/v2/page.js +0 -8
  89. package/dist/components/button-tools/index.js +0 -11
  90. package/dist/components/form-tools/label.js +0 -7
  91. package/dist/components/form-tools/shape.js +0 -25
  92. package/dist/components/layer/index.js +0 -295
  93. package/dist/components/layer-v2/index.js +0 -282
  94. package/dist/components/modal-preview/index.js +0 -10
  95. package/dist/features/navbar/index.js +0 -6
  96. package/dist/features/panel/selected-group.js +0 -7
  97. package/dist/features/panel/table-seat-circle.js +0 -9
  98. package/dist/features/panel/table-seat-square.js +0 -9
  99. package/dist/features/panel/text-tool.js +0 -7
  100. package/dist/provider/antd-provider.js +0 -43
@@ -1,6 +1,4 @@
1
1
  "use client";
2
- import { createElement as _createElement } from "react";
3
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
4
2
  import { useRef } from "react";
5
3
  import { isArray, isEmpty, omit } from "lodash";
6
4
  const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedTable, activeTool, onMouseDown, onMouseUp, onBlur, selectedTableColor, mode = "edit", style, selectionLines, }) => {
@@ -33,11 +31,11 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
33
31
  const pointsFormat = !isEmpty(points)
34
32
  ? points
35
33
  : rectToPolygonPoints(x, y, width, height);
36
- return _jsx("polygon", Object.assign({ points: pointsFormat }, commonProps), id);
34
+ return <polygon key={id} points={pointsFormat} {...commonProps}/>;
37
35
  case "circle":
38
- return (_jsx("circle", Object.assign({ cx: x + width / 2, cy: y + height / 2, r: Math.min(height, width) / 2 }, commonProps), id));
36
+ return (<circle key={id} cx={x + width / 2} cy={y + height / 2} r={Math.min(height, width) / 2} {...commonProps}/>);
39
37
  case "diamond":
40
- return (_jsx("rect", Object.assign({ x: x, y: y, width: width, height: height, transform: `rotate(${rotation}, ${x}, ${y})` }, commonProps), id));
38
+ return (<rect key={id} x={x} y={y} width={width} height={height} transform={`rotate(${rotation}, ${x}, ${y})`} {...commonProps}/>);
41
39
  case "table-seat-circle": {
42
40
  const seatCount = item.seatCount;
43
41
  const openSpace = (_a = item.openSpace) !== null && _a !== void 0 ? _a : 0.2;
@@ -58,13 +56,26 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
58
56
  const cy = centerY + (radius - inset) * Math.sin(angle);
59
57
  return { cx, cy };
60
58
  });
61
- return (_jsxs("g", { transform: `rotate(${rotation} ${centerX} ${centerY})`, children: [_jsx("circle", Object.assign({ cx: centerX, cy: centerY, r: radius - 15, fill: selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill }, commonProps)), labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
62
- var _a, _b, _c, _d;
63
- return (_jsx("text", { x: centerX + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0), y: centerY + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0), fill: (_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black", fontSize: `${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle", transform: `rotate(${rotation} ${centerX} ${centerY})`, onClick: (e) => {
64
- e.stopPropagation();
65
- onClick && onClick(item);
66
- }, children: _ === null || _ === void 0 ? void 0 : _.label }, `${id}-label-${index}`));
67
- }), _jsx("g", { fill: "#e6b9c0", stroke: "#c49ba3", strokeWidth: "1", children: seatCircles.map(({ cx, cy }, i) => (_jsx("circle", { cx: cx, cy: cy, r: seatRadius, fill: seatFill }, `${id}-seat-${i}`))) })] }, id));
59
+ return (<g key={id} transform={`rotate(${rotation} ${centerX} ${centerY})`}>
60
+ {/* Meja */}
61
+ <circle cx={centerX} cy={centerY} r={radius - 15} fill={selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill} {...commonProps}/>
62
+
63
+ {/* Label */}
64
+ {labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
65
+ var _a, _b, _c, _d;
66
+ return (<text key={`${id}-label-${index}`} x={centerX + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0)} y={centerY + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0)} fill={(_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black"} fontSize={`${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`} fontWeight="bold" textAnchor="middle" dominantBaseline="middle" transform={`rotate(${rotation} ${centerX} ${centerY})`} onClick={(e) => {
67
+ e.stopPropagation();
68
+ onClick && onClick(item);
69
+ }}>
70
+ {_ === null || _ === void 0 ? void 0 : _.label}
71
+ </text>);
72
+ })}
73
+
74
+ {/* Kursi */}
75
+ <g fill="#e6b9c0" stroke="#c49ba3" strokeWidth="1">
76
+ {seatCircles.map(({ cx, cy }, i) => (<circle key={`${id}-seat-${i}`} cx={cx} cy={cy} r={seatRadius} fill={seatFill}/>))}
77
+ </g>
78
+ </g>);
68
79
  }
69
80
  case "table-seat-square": {
70
81
  const seatCount = item.seatCount || 6;
@@ -84,14 +95,29 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
84
95
  cx: startX + i * spacing,
85
96
  cy: y + height + seatRadius * 1.5,
86
97
  }));
87
- return (_jsxs("g", { children: [_jsx("g", { fill: "#e6b9c0", fillOpacity: "0.5", stroke: "#c49ba3", strokeWidth: "1", children: [...topSeats, ...bottomSeats].map(({ cx, cy }, i) => (_jsx("circle", { cx: cx, cy: cy, r: seatRadius }, `${id}-seat-${i}`))) }, `${id}-seats`), _jsx("rect", Object.assign({ x: x, y: y, width: width, height: height }, commonProps))] }, id));
98
+ return (<g key={id}>
99
+ {/* Seats */}
100
+ <g fill="#e6b9c0" fillOpacity="0.5" stroke="#c49ba3" strokeWidth="1" key={`${id}-seats`}>
101
+ {[...topSeats, ...bottomSeats].map(({ cx, cy }, i) => (<circle key={`${id}-seat-${i}`} cx={cx} cy={cy} r={seatRadius}/>))}
102
+ </g>
103
+ {/* Square Table */}
104
+ <rect x={x} y={y} width={width} height={height} {...commonProps}/>
105
+ </g>);
88
106
  }
89
107
  case "text":
90
- return (_jsxs("g", { onClick: () => {
108
+ return (<g key={id} onClick={() => {
91
109
  onClick && onClick(item);
92
- }, children: [_jsx("rect", { x: x, y: y, width: width, height: height, fill: "transparent", opacity: opacity }), _jsx("text", { x: x + width / 2, y: y + height / 2, textAnchor: "middle", dominantBaseline: "middle", fill: fontColor, fontSize: height * 0.6, opacity: opacity, children: text })] }, id));
110
+ }}>
111
+ <rect x={x} y={y} width={width} height={height} fill="transparent" opacity={opacity}/>
112
+ <text x={x + width / 2} y={y + height / 2} textAnchor="middle" dominantBaseline="middle" fill={fontColor} fontSize={height * 0.6} opacity={opacity}>
113
+ {text}
114
+ </text>
115
+ </g>);
93
116
  case "ruler":
94
- return (_jsxs("g", { children: [_jsx("rect", { x: x - (window.innerWidth * 3) / 2, y: y, width: window.innerWidth * 3, height: 1, fill: "black" }), _jsx("rect", { x: x, y: y - (window.innerHeight * 3) / 2, width: 1, height: window.innerHeight * 3, fill: "black" })] }, id));
117
+ return (<g key={id}>
118
+ <rect x={x - (window.innerWidth * 3) / 2} y={y} width={window.innerWidth * 3} height={1} fill="black"/>
119
+ <rect x={x} y={y - (window.innerHeight * 3) / 2} width={1} height={window.innerHeight * 3} fill="black"/>
120
+ </g>);
95
121
  default:
96
122
  return null;
97
123
  }
@@ -150,15 +176,22 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
150
176
  };
151
177
  switch (shape) {
152
178
  case "square":
153
- return (_jsx("g", { "data-id": id,
154
- // data-table={JSON.stringify(item)}
155
- transform: `translate(${x}, ${y})`, stroke: "red", children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_createElement("rect", Object.assign({}, commonProps, { key: id, width: width, height: height })), labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
156
- var _a, _b, _c, _d;
157
- return (_createElement("text", Object.assign({}, omit(commonProps, ["opacity", "stroke", "strokeWidth"]), { key: `${id}-label-${index}`, x: x + width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0), y: y + height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0), fill: (_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black", fontSize: `${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle", transform: `rotate(${rotation} ${x + width / 2} ${y + height / 2})`, onClick: (e) => {
158
- e.stopPropagation();
159
- onClick && onClick(item);
160
- } }), _ === null || _ === void 0 ? void 0 : _.text));
161
- })] }) }, id));
179
+ return (<g key={id} data-id={id}
180
+ // data-table={JSON.stringify(item)}
181
+ transform={`translate(${x}, ${y})`} stroke="red">
182
+ <g transform={`rotate(${rotation}, 0, 0)`}>
183
+ <rect {...commonProps} key={id} width={width} height={height}/>
184
+ {labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
185
+ var _a, _b, _c, _d;
186
+ return (<text {...omit(commonProps, ["opacity", "stroke", "strokeWidth"])} key={`${id}-label-${index}`} x={x + width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0)} y={y + height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0)} fill={(_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black"} fontSize={`${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`} fontWeight="bold" textAnchor="middle" dominantBaseline="middle" transform={`rotate(${rotation} ${x + width / 2} ${y + height / 2})`} onClick={(e) => {
187
+ e.stopPropagation();
188
+ onClick && onClick(item);
189
+ }}>
190
+ {_ === null || _ === void 0 ? void 0 : _.text}
191
+ </text>);
192
+ })}
193
+ </g>
194
+ </g>);
162
195
  case "polygon":
163
196
  function isPolygonClosed(points) {
164
197
  if (points.length < 3)
@@ -171,31 +204,55 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
171
204
  const isClosed = isPolygonClosed(points);
172
205
  console.log({ isClosed });
173
206
  const showPoints = (selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.id) == id;
174
- return (_jsx("g", { "data-id": id, transform: `translate(${x}, ${y})`, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_createElement("polygon", Object.assign({}, commonProps, { key: id, points: finalPoint, x: "0", y: "0" })), (showPoints || !isClosed) &&
175
- points.map((_, index) => {
176
- return (_jsxs(_Fragment, { children: [_jsx("rect", { "data-point": JSON.stringify(_), id: `${index}`, x: (_ === null || _ === void 0 ? void 0 : _.x) - 5, y: (_ === null || _ === void 0 ? void 0 : _.y) - 5, width: 10, height: 10, fill: "#4a90e2", cursor: "pointer" }, `${id}-point-${index}`), _jsx("circle", { "data-point": JSON.stringify(_), id: `${index}`, cx: _ === null || _ === void 0 ? void 0 : _.x, cy: _ === null || _ === void 0 ? void 0 : _.y, r: 15, fill: "transparent", cursor: "pointer" }, `${id}-point-${index}`)] }));
177
- })] }) }, id));
207
+ return (<g key={id} data-id={id} transform={`translate(${x}, ${y})`}>
208
+ <g transform={`rotate(${rotation}, 0, 0)`}>
209
+ <polygon {...commonProps} key={id} points={finalPoint} x="0" y="0"/>
210
+ {(showPoints || !isClosed) &&
211
+ points.map((_, index) => {
212
+ return (<>
213
+ <rect data-point={JSON.stringify(_)} id={`${index}`} key={`${id}-point-${index}`} x={(_ === null || _ === void 0 ? void 0 : _.x) - 5} y={(_ === null || _ === void 0 ? void 0 : _.y) - 5} width={10} height={10} fill="#4a90e2" cursor={"pointer"}/>
214
+ <circle data-point={JSON.stringify(_)} id={`${index}`} key={`${id}-point-${index}`} cx={_ === null || _ === void 0 ? void 0 : _.x} cy={_ === null || _ === void 0 ? void 0 : _.y} r={15} fill="transparent" cursor={"pointer"}/>
215
+ </>);
216
+ })}
217
+ </g>
218
+ </g>);
178
219
  case "selection-box":
179
220
  const pointsFormat = !isEmpty(points)
180
221
  ? points
181
222
  : rectToPolygonPoints(x, y, width, height);
182
- return (_jsx("g", { "data-table": JSON.stringify(item), "data-id": id, children: _jsxs("g", { transform: `rotate(${rotation} ${x + width / 2} ${y + height / 2})`, children: [_createElement("polygon", Object.assign({}, commonProps, { key: id, points: pointsFormat })), points.map((_, index) => {
183
- return (_jsx("rect", { x: (_ === null || _ === void 0 ? void 0 : _.x) - 5, y: (_ === null || _ === void 0 ? void 0 : _.y) - 5, width: 10, height: 10, fill: "blue" }, `${id}-point-${index}`));
184
- }), labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
185
- var _a, _b, _c, _d;
186
- return (_createElement("text", Object.assign({}, omit(commonProps, ["opacity", "stroke", "strokeWidth"]), { key: `${id}-label-${index}`, x: x + width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0), y: y + height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0), fill: (_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black", fontSize: `${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle", transform: `rotate(${rotation} ${x + width / 2} ${y + height / 2})`, onClick: (e) => {
187
- e.stopPropagation();
188
- onClick && onClick(item);
189
- } }), _ === null || _ === void 0 ? void 0 : _.label));
190
- })] }) }, id));
223
+ return (<g key={id} data-table={JSON.stringify(item)} data-id={id}>
224
+ <g transform={`rotate(${rotation} ${x + width / 2} ${y + height / 2})`}>
225
+ <polygon {...commonProps} key={id} points={pointsFormat}/>
226
+ {/* circle every points */}
227
+ {points.map((_, index) => {
228
+ return (<rect key={`${id}-point-${index}`} x={(_ === null || _ === void 0 ? void 0 : _.x) - 5} y={(_ === null || _ === void 0 ? void 0 : _.y) - 5} width={10} height={10} fill="blue"/>);
229
+ })}
230
+ {labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
231
+ var _a, _b, _c, _d;
232
+ return (<text {...omit(commonProps, ["opacity", "stroke", "strokeWidth"])} key={`${id}-label-${index}`} x={x + width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0)} y={y + height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0)} fill={(_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black"} fontSize={`${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`} fontWeight="bold" textAnchor="middle" dominantBaseline="middle" transform={`rotate(${rotation} ${x + width / 2} ${y + height / 2})`} onClick={(e) => {
233
+ e.stopPropagation();
234
+ onClick && onClick(item);
235
+ }}>
236
+ {_ === null || _ === void 0 ? void 0 : _.label}
237
+ </text>);
238
+ })}
239
+ </g>
240
+ </g>);
191
241
  case "circle":
192
- return (_jsx("g", { "data-id": id, transform: `translate(${x}, ${y})`, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_jsx("circle", Object.assign({ cx: width / 2, cy: height / 2, r: Math.min(height, width) / 2, style: Object.assign({ cursor: mode === "view" ? "pointer" : "default" }, style), fill: selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill }, omit(commonProps, "opacity")), id), labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
193
- var _a, _b, _c, _d;
194
- return (_jsx("text", { x: width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0), y: width / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0), fill: (_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black", fontSize: `${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle", transform: `rotate(${rotation} ${x + width / 2} ${y + height / 2})`, onClick: (e) => {
195
- e.stopPropagation();
196
- onClick && onClick(item);
197
- }, children: _ === null || _ === void 0 ? void 0 : _.label }, `${id}-label-${index}`));
198
- })] }) }, id));
242
+ return (<g key={id} data-id={id} transform={`translate(${x}, ${y})`}>
243
+ <g transform={`rotate(${rotation}, 0, 0)`}>
244
+ <circle key={id} cx={width / 2} cy={height / 2} r={Math.min(height, width) / 2} style={Object.assign({ cursor: mode === "view" ? "pointer" : "default" }, style)} fill={selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill} {...omit(commonProps, "opacity")}/>
245
+ {labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
246
+ var _a, _b, _c, _d;
247
+ return (<text key={`${id}-label-${index}`} x={width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0)} y={width / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0)} fill={(_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black"} fontSize={`${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`} fontWeight="bold" textAnchor="middle" dominantBaseline="middle" transform={`rotate(${rotation} ${x + width / 2} ${y + height / 2})`} onClick={(e) => {
248
+ e.stopPropagation();
249
+ onClick && onClick(item);
250
+ }}>
251
+ {_ === null || _ === void 0 ? void 0 : _.label}
252
+ </text>);
253
+ })}
254
+ </g>
255
+ </g>);
199
256
  // case "elipse":
200
257
  // return (
201
258
  // <g
@@ -245,7 +302,12 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
245
302
  // </g>
246
303
  // );
247
304
  case "diamond":
248
- return (_jsxs("g", { "data-table": JSON.stringify(item), children: [_jsx("rect", Object.assign({ x: x, y: y, width: width, height: height, style: Object.assign({ cursor: mode === "view" ? "pointer" : "default" }, style), transform: `rotate(${rotation}, ${x}, ${y})` }, commonProps, { fill: selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill }), id), _jsx("text", { x: x + width / 2, y: y + height / 2, fill: fontColor !== null && fontColor !== void 0 ? fontColor : "black", fontSize: `${fontSize !== null && fontSize !== void 0 ? fontSize : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle", children: label })] }, id));
305
+ return (<g key={id} data-table={JSON.stringify(item)}>
306
+ <rect key={id} x={x} y={y} width={width} height={height} style={Object.assign({ cursor: mode === "view" ? "pointer" : "default" }, style)} transform={`rotate(${rotation}, ${x}, ${y})`} {...commonProps} fill={selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill}/>
307
+ <text x={x + width / 2} y={y + height / 2} fill={fontColor !== null && fontColor !== void 0 ? fontColor : "black"} fontSize={`${fontSize !== null && fontSize !== void 0 ? fontSize : 10}px`} fontWeight="bold" textAnchor="middle" dominantBaseline="middle">
308
+ {label}
309
+ </text>
310
+ </g>);
249
311
  case "table-seat-circle": {
250
312
  const seatCount = item.seatCount;
251
313
  const openSpace = (_a = item.openSpace) !== null && _a !== void 0 ? _a : 0;
@@ -266,13 +328,27 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
266
328
  const cy = centerY + (tableRadius + seatRadius) * Math.sin(angle);
267
329
  return { cx, cy };
268
330
  });
269
- return (_jsx("g", { "data-id": id, transform: `translate(${x}, ${y})`, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_jsx("circle", Object.assign({ cx: centerX, cy: centerY, r: tableRadius, fill: selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill }, commonProps)), _jsx("g", { "data-seat": `${id}-seats`, children: seatCircles.map(({ cx, cy }, i) => (_jsx("circle", { cx: cx, cy: cy, r: seatRadius, fill: seatFill }, `${id}-seat-${i}`))) }), labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
270
- var _a, _b, _c, _d;
271
- return (_jsx("text", { x: centerX + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0), y: centerY + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0), fill: (_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black", fontSize: `${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle", transform: `rotate(${rotation} ${centerX} ${centerY})`, onClick: (e) => {
272
- e.stopPropagation();
273
- onClick && onClick(item);
274
- }, children: _ === null || _ === void 0 ? void 0 : _.label }, `${id}-label-${index}`));
275
- })] }) }, id));
331
+ return (<g key={id} data-id={id} transform={`translate(${x}, ${y})`}>
332
+ <g transform={`rotate(${rotation}, 0, 0)`}>
333
+ {/* Meja */}
334
+ <circle cx={centerX} cy={centerY} r={tableRadius} fill={selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill} {...commonProps}/>
335
+ {/* Seat */}
336
+ <g data-seat={`${id}-seats`}>
337
+ {seatCircles.map(({ cx, cy }, i) => (<circle key={`${id}-seat-${i}`} cx={cx} cy={cy} r={seatRadius} fill={seatFill}/>))}
338
+ </g>
339
+
340
+ {/* Label */}
341
+ {labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
342
+ var _a, _b, _c, _d;
343
+ return (<text key={`${id}-label-${index}`} x={centerX + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0)} y={centerY + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0)} fill={(_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black"} fontSize={`${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`} fontWeight="bold" textAnchor="middle" dominantBaseline="middle" transform={`rotate(${rotation} ${centerX} ${centerY})`} onClick={(e) => {
344
+ e.stopPropagation();
345
+ onClick && onClick(item);
346
+ }}>
347
+ {_ === null || _ === void 0 ? void 0 : _.label}
348
+ </text>);
349
+ })}
350
+ </g>
351
+ </g>);
276
352
  }
277
353
  case "table-seat-square": {
278
354
  const openSpace = item.openSpace || 0; // from 0 to 0.9
@@ -328,7 +404,20 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
328
404
  cy,
329
405
  id: "right",
330
406
  }));
331
- return (_jsx("g", { "data-id": id, transform: `translate(${x}, ${y})`, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_jsx("rect", Object.assign({ width: width, height: height }, commonProps, { fill: selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill })), _jsx("g", { fill: "#e6b9c0", stroke: "#c49ba3", strokeWidth: "1", "data-seat": `${id}-seats`, transform: `translate(${-x}, ${-y})`, children: [...topSeats, ...bottomSeats, ...leftSeats, ...rightSeats].map(({ cx, cy, id }, i) => (_jsx("circle", { id: `seat-${id}`, cx: cx, cy: cy, r: r, fill: seatFill }, `${id}-seat-${i}`))) }, `${id}-seats`), _jsx("text", { x: x + width / 2, y: y + height / 2, fill: fontColor !== null && fontColor !== void 0 ? fontColor : "black", fontSize: `${fontSize !== null && fontSize !== void 0 ? fontSize : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle", children: label })] }) }, id));
407
+ return (<g key={id} data-id={id} transform={`translate(${x}, ${y})`}>
408
+ <g transform={`rotate(${rotation}, 0, 0)`}>
409
+ {/* Square Table */}
410
+ <rect width={width} height={height} {...commonProps} fill={selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill}/>
411
+ {/* Seats */}
412
+ <g fill="#e6b9c0" stroke="#c49ba3" strokeWidth="1" key={`${id}-seats`} data-seat={`${id}-seats`} transform={`translate(${-x}, ${-y})`}>
413
+ {[...topSeats, ...bottomSeats, ...leftSeats, ...rightSeats].map(({ cx, cy, id }, i) => (<circle key={`${id}-seat-${i}`} id={`seat-${id}`} cx={cx} cy={cy} r={r} fill={seatFill}/>))}
414
+ </g>
415
+
416
+ <text x={x + width / 2} y={y + height / 2} fill={fontColor !== null && fontColor !== void 0 ? fontColor : "black"} fontSize={`${fontSize !== null && fontSize !== void 0 ? fontSize : 10}px`} fontWeight="bold" textAnchor="middle" dominantBaseline="middle">
417
+ {label}
418
+ </text>
419
+ </g>
420
+ </g>);
332
421
  }
333
422
  case "table-seat-square-side": {
334
423
  const seatRadius = Math.min(width, height) * 0.15;
@@ -390,23 +479,49 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
390
479
  // cy: y + height / 2,
391
480
  // },
392
481
  // ];
393
- return (_jsx("g", { transform: `translate(${x}, ${y}) )`, "data-id": id, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_jsx("rect", Object.assign({ x: x, y: y, width: width, height: height, rx: 10 }, commonProps, { fill: selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill })), _jsx("g", { children: seats === null || seats === void 0 ? void 0 : seats.map(({ d }, i) => (_jsx("path", { id: `seat-${id}`, d: d, fill: "white" }, `${id}-seat-${i}`))) }), _jsx("text", { x: x + width / 2, y: y + height / 2, fill: fontColor !== null && fontColor !== void 0 ? fontColor : "black", fontSize: `${fontSize !== null && fontSize !== void 0 ? fontSize : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle", children: label })] }) }, id));
482
+ return (<g key={id} transform={`translate(${x}, ${y}) )`} data-id={id}>
483
+ <g transform={`rotate(${rotation}, 0, 0)`}>
484
+ {/* Seats */}
485
+ {/* Square Table */}
486
+ <rect x={x} y={y} width={width} height={height} rx={10} {...commonProps} fill={selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill}/>
487
+ <g>
488
+ {seats === null || seats === void 0 ? void 0 : seats.map(({ d }, i) => (<path key={`${id}-seat-${i}`} id={`seat-${id}`} d={d} fill="white"/>))}
489
+ </g>
490
+
491
+
492
+
493
+ {/* Label */}
494
+ <text x={x + width / 2} y={y + height / 2} fill={fontColor !== null && fontColor !== void 0 ? fontColor : "black"} fontSize={`${fontSize !== null && fontSize !== void 0 ? fontSize : 10}px`} fontWeight="bold" textAnchor="middle" dominantBaseline="middle">
495
+ {label}
496
+ </text>
497
+ </g>
498
+ </g>);
394
499
  }
395
500
  case "text":
396
- return (_jsxs("g", { "data-table": JSON.stringify(item), children: [_jsx("rect", { x: x, y: y, width: width, height: height, fill: "transparent", opacity: opacity, onClick: (e) => {
397
- e.stopPropagation();
398
- onClick && onClick(item);
399
- } }), _jsx("text", Object.assign({ x: x + width / 2, y: y + height / 2, textAnchor: "middle", dominantBaseline: "middle", fill: fontColor, fontSize: fontSize !== null && fontSize !== void 0 ? fontSize : height * 0.6, opacity: opacity }, omit(commonProps, ["fill", "opacity"]), { children: text }))] }, id));
501
+ return (<g key={id} data-table={JSON.stringify(item)}>
502
+ <rect x={x} y={y} width={width} height={height} fill="transparent" opacity={opacity} onClick={(e) => {
503
+ e.stopPropagation();
504
+ onClick && onClick(item);
505
+ }}/>
506
+ <text x={x + width / 2} y={y + height / 2} textAnchor="middle" dominantBaseline="middle" fill={fontColor} fontSize={fontSize !== null && fontSize !== void 0 ? fontSize : height * 0.6} opacity={opacity} {...omit(commonProps, ["fill", "opacity"])}>
507
+ {text}
508
+ </text>
509
+ </g>);
400
510
  case "image-table":
401
511
  case "background":
402
- return (_jsxs("g", { onClick: () => {
512
+ return (<g key={id} onClick={() => {
403
513
  onClick && onClick(item);
404
- }, "data-table": JSON.stringify(item), children: [_jsx("image", Object.assign({ href: src, x: x, y: y, width: width, height: height, transform: `rotate(${rotation} ${x + width / 2} ${y + height / 2})` }, commonProps)), labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
405
- var _a, _b, _c, _d;
406
- return (_jsx("text", { x: x + width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0), y: y + height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0), fill: (_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black", fontSize: `${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle", transform: `rotate(${rotation} ${x + width / 2} ${y + height / 2})`, children: _ === null || _ === void 0 ? void 0 : _.label }, index));
407
- })] }, id));
514
+ }} data-table={JSON.stringify(item)}>
515
+ <image href={src} x={x} y={y} width={width} height={height} transform={`rotate(${rotation} ${x + width / 2} ${y + height / 2})`} {...commonProps}/>
516
+ {labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
517
+ var _a, _b, _c, _d;
518
+ return (<text key={index} x={x + width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0)} y={y + height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0)} fill={(_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black"} fontSize={`${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`} fontWeight="bold" textAnchor="middle" dominantBaseline="middle" transform={`rotate(${rotation} ${x + width / 2} ${y + height / 2})`}>
519
+ {_ === null || _ === void 0 ? void 0 : _.label}
520
+ </text>);
521
+ })}
522
+ </g>);
408
523
  default:
409
- return _jsx("g", {}, id);
524
+ return <g key={id}/>;
410
525
  }
411
526
  };
412
527
  let date = new Date();
@@ -417,43 +532,68 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
417
532
  const polylinePoints = [...nodesRaw, nodesRaw[0]]
418
533
  .map((n) => `${n.x},${n.y}`)
419
534
  .join(" ");
420
- return (_jsxs("g", { id: "selection-layer", children: [components === null || components === void 0 ? void 0 : components.map(renderShape), shadowShape === null || shadowShape === void 0 ? void 0 : shadowShape.map(renderShadowShape), !isEmpty(selectionLines) && activeTool === "select" && (_jsxs(_Fragment, { children: [nodesRaw.map((p1, index) => {
421
- const p2 = nodesRaw[(index + 2) % nodesRaw.length];
422
- const side = index === 0
423
- ? "top"
424
- : index === 1
425
- ? "right"
426
- : index === 2
427
- ? "bottom"
428
- : "left";
429
- const mx = (p1.x + p2.x) / 2;
430
- const my = (p1.y + p2.y) / 2;
431
- if (side === "top")
432
- return (_jsx("g", { id: "help-group-0", "data-selection": `selection-${selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id}`, transform: `translate(${selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.x},${selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.y})`, children: _jsx("g", { transform: `rotate(${(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.rotation) || 0}, 0,0)`, children: side === "top" && (_jsxs("g", { id: "help-group-1", children: [_jsx("line", { x1: mx, y1: my + selectionLines.height / 2, x2: mx, y2: my - selectionLines.height / 3 - 10, stroke: "#4a90e2", strokeWidth: 2, id: "line-help" }), _jsx("circle", { id: "circle-help", "data-role": "rotate", cx: mx, cy: my - selectionLines.height / 3 - 10, r: 8, fill: "#4a90e2" })] })) }) }, `selection-${date}`));
433
- }), _jsx("g", { id: "selection-lines", "data-selection": `selection-${(_a = selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) !== null && _a !== void 0 ? _a : selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.id}`, transform: `translate(${selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.x},${selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.y})`, children: _jsxs("g", { transform: `rotate(${(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.rotation) || 0}, 0,0)`, children: [!hasPoints && (_jsx("rect", { width: selectionLines.width, height: selectionLines.height, fill: "none", stroke: "#4a90e2", strokeWidth: 1, id: "rect-box-selection" })), !hasPoints &&
434
- (nodesRaw === null || nodesRaw === void 0 ? void 0 : nodesRaw.map((node, index) => {
435
- const corner = (index) => {
436
- switch (index) {
437
- case 0:
438
- return "top-left";
439
- case 1:
440
- return "top";
441
- case 2:
442
- return "top-right";
443
- case 3:
444
- return "right";
445
- case 4:
446
- return "bottom-right";
447
- case 5:
448
- return "bottom";
449
- case 6:
450
- return "bottom-left";
451
- case 7:
452
- return "left";
453
- }
454
- };
455
- return (_jsxs(_Fragment, { children: [_jsx("circle", { "data-position": corner(index), r: 5, cx: node.x, cy: node.y, fill: "transparent", style: { cursor: "pointer" } }, index), _jsx("circle", { "data-position": corner(index), r: 5, cx: node.x, cy: node.y, fill: "#4a90e2", id: `circle-corner-${selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id}`, style: { cursor: "pointer" } }, index)] }));
456
- }))] }) }, `selection-${date}`)] }))] }, `${date}`));
535
+ return (<g key={`${date}`} id="selection-layer">
536
+ {components === null || components === void 0 ? void 0 : components.map(renderShape)}
537
+ {shadowShape === null || shadowShape === void 0 ? void 0 : shadowShape.map(renderShadowShape)}
538
+ {!isEmpty(selectionLines) && activeTool === "select" && (<>
539
+ {nodesRaw.map((p1, index) => {
540
+ const p2 = nodesRaw[(index + 2) % nodesRaw.length];
541
+ const side = index === 0
542
+ ? "top"
543
+ : index === 1
544
+ ? "right"
545
+ : index === 2
546
+ ? "bottom"
547
+ : "left";
548
+ const mx = (p1.x + p2.x) / 2;
549
+ const my = (p1.y + p2.y) / 2;
550
+ if (side === "top")
551
+ return (<g key={`selection-${date}`} id="help-group-0" data-selection={`selection-${selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id}`} transform={`translate(${selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.x},${selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.y})`}>
552
+ <g transform={`rotate(${(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.rotation) || 0}, 0,0)`}>
553
+ {side === "top" && (<g id="help-group-1">
554
+ <line x1={mx} y1={my + selectionLines.height / 2} x2={mx} y2={my - selectionLines.height / 3 - 10} // panjang line
555
+ stroke="#4a90e2" strokeWidth={2} id="line-help"/>
556
+
557
+ <circle id="circle-help" data-role="rotate" cx={mx} cy={my - selectionLines.height / 3 - 10} r={8} fill="#4a90e2"/>
558
+ </g>)}
559
+ </g>
560
+ </g>);
561
+ })}
562
+ <g key={`selection-${date}`} id="selection-lines" data-selection={`selection-${(_a = selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) !== null && _a !== void 0 ? _a : selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.id}`} transform={`translate(${selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.x},${selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.y})`}>
563
+ <g transform={`rotate(${(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.rotation) || 0}, 0,0)`}>
564
+ {!hasPoints && (<rect width={selectionLines.width} height={selectionLines.height} fill="none" stroke="#4a90e2" strokeWidth={1} id="rect-box-selection"/>)}
565
+
566
+ {!hasPoints &&
567
+ (nodesRaw === null || nodesRaw === void 0 ? void 0 : nodesRaw.map((node, index) => {
568
+ const corner = (index) => {
569
+ switch (index) {
570
+ case 0:
571
+ return "top-left";
572
+ case 1:
573
+ return "top";
574
+ case 2:
575
+ return "top-right";
576
+ case 3:
577
+ return "right";
578
+ case 4:
579
+ return "bottom-right";
580
+ case 5:
581
+ return "bottom";
582
+ case 6:
583
+ return "bottom-left";
584
+ case 7:
585
+ return "left";
586
+ }
587
+ };
588
+ return (<>
589
+ <circle data-position={corner(index)} key={index} r={5} cx={node.x} cy={node.y} fill="transparent" style={{ cursor: "pointer" }}/>
590
+ <circle data-position={corner(index)} key={index} r={5} cx={node.x} cy={node.y} fill="#4a90e2" id={`circle-corner-${selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id}`} style={{ cursor: "pointer" }}/>
591
+ </>);
592
+ }))}
593
+ </g>
594
+ </g>
595
+ </>)}
596
+ </g>);
457
597
  };
458
598
  export default Layers;
459
599
  export function rectToPolygonNodes(x, y, width, height) {
@@ -16,5 +16,5 @@ interface LayersProps {
16
16
  onForceRestoreGroup?: (group: SVGGElement, eventType: EventHandleType) => void;
17
17
  selectedTableColor?: string;
18
18
  }
19
- declare const Layers: ({ components, selectedTable, iconTags, eventMatchTable, onHighlightGroup, onForceRestoreGroup, selectedTableColor, }: LayersProps) => import("react/jsx-runtime").JSX.Element;
19
+ declare const Layers: ({ components, selectedTable, iconTags, eventMatchTable, onHighlightGroup, onForceRestoreGroup, selectedTableColor, }: LayersProps) => import("react").JSX.Element;
20
20
  export default Layers;