seat-editor 1.3.15 → 1.3.17

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 (56) hide show
  1. package/dist/app/layout.d.ts +1 -1
  2. package/dist/app/new-board/page.d.ts +1 -1
  3. package/dist/app/old-board/page.d.ts +1 -2
  4. package/dist/app/only-view/page.d.ts +1 -1
  5. package/dist/app/page.d.ts +1 -1
  6. package/dist/components/button-tools/index.d.ts +1 -1
  7. package/dist/components/form-tools/label.d.ts +1 -1
  8. package/dist/components/form-tools/shape.d.ts +1 -1
  9. package/dist/components/input/number-indicator.d.ts +1 -1
  10. package/dist/components/layer/index.d.ts +1 -1
  11. package/dist/components/layer/index.js +25 -17
  12. package/dist/components/lib/index.d.ts +1 -1
  13. package/dist/components/modal-preview/index.d.ts +1 -1
  14. package/dist/features/board/index.d.ts +1 -1
  15. package/dist/features/board/index.js +1 -1
  16. package/dist/features/navbar/index.d.ts +1 -1
  17. package/dist/features/package/index.d.ts +1 -1
  18. package/dist/features/package/index.js +3 -0
  19. package/dist/features/panel/index.d.ts +1 -1
  20. package/dist/features/panel/select-tool.d.ts +1 -1
  21. package/dist/features/panel/square-circle-tool.d.ts +1 -1
  22. package/dist/features/panel/table-seat-circle.d.ts +1 -1
  23. package/dist/features/panel/text-tool.d.ts +1 -1
  24. package/dist/features/panel/upload-tool.d.ts +1 -1
  25. package/dist/features/side-tool/index.d.ts +1 -1
  26. package/dist/features/view/index.d.ts +1 -1
  27. package/dist/libs/store.js +4 -3
  28. package/dist/provider/redux-provider.d.ts +1 -1
  29. package/dist/provider/store-provider.d.ts +1 -1
  30. package/package.json +1 -1
  31. package/dist/app/layout.jsx +0 -27
  32. package/dist/app/new-board/page.jsx +0 -12
  33. package/dist/app/old-board/page.jsx +0 -510
  34. package/dist/app/only-view/page.jsx +0 -55
  35. package/dist/app/page.jsx +0 -13
  36. package/dist/components/button-tools/index.jsx +0 -17
  37. package/dist/components/form-tools/label.jsx +0 -44
  38. package/dist/components/form-tools/shape.jsx +0 -43
  39. package/dist/components/input/number-indicator.jsx +0 -36
  40. package/dist/components/layer/index.jsx +0 -355
  41. package/dist/components/lib/index.jsx +0 -33
  42. package/dist/components/modal-preview/index.jsx +0 -11
  43. package/dist/features/board/index.jsx +0 -579
  44. package/dist/features/navbar/index.jsx +0 -5
  45. package/dist/features/package/index.jsx +0 -49
  46. package/dist/features/panel/index.jsx +0 -87
  47. package/dist/features/panel/select-tool.jsx +0 -45
  48. package/dist/features/panel/square-circle-tool.jsx +0 -10
  49. package/dist/features/panel/table-seat-circle.jsx +0 -31
  50. package/dist/features/panel/text-tool.jsx +0 -22
  51. package/dist/features/panel/upload-tool.jsx +0 -135
  52. package/dist/features/side-tool/index.jsx +0 -218
  53. package/dist/features/view/index.jsx +0 -204
  54. package/dist/provider/antd-provider.jsx +0 -46
  55. package/dist/provider/redux-provider.jsx +0 -6
  56. package/dist/provider/store-provider.jsx +0 -10
@@ -3,4 +3,4 @@ import "./globals.css";
3
3
  export declare const metadata: Metadata;
4
4
  export default function RootLayout({ children, }: Readonly<{
5
5
  children: React.ReactNode;
6
- }>): import("react").JSX.Element;
6
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export default function NewBoard(): import("react").JSX.Element;
1
+ export default function NewBoard(): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
- import React from "react";
2
- declare const SeatEditor: () => React.JSX.Element;
1
+ declare const SeatEditor: () => import("react/jsx-runtime").JSX.Element;
3
2
  export default SeatEditor;
@@ -1,2 +1,2 @@
1
- declare const TouchScrollDetect: () => import("react").JSX.Element;
1
+ declare const TouchScrollDetect: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default TouchScrollDetect;
@@ -1,2 +1,2 @@
1
- declare const TableEditor: () => import("react").JSX.Element;
1
+ declare const TableEditor: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default TableEditor;
@@ -7,5 +7,5 @@ interface ButtonToolsProps {
7
7
  }>;
8
8
  popoverProps?: PopoverProps;
9
9
  }
10
- declare const ButtonTools: (props: ButtonToolsProps) => import("react").JSX.Element;
10
+ declare const ButtonTools: (props: ButtonToolsProps) => import("react/jsx-runtime").JSX.Element;
11
11
  export default ButtonTools;
@@ -1,2 +1,2 @@
1
- declare const SectionLabel: () => import("react").JSX.Element;
1
+ declare const SectionLabel: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default SectionLabel;
@@ -1,2 +1,2 @@
1
- declare const SectionShape: () => import("react").JSX.Element;
1
+ declare const SectionShape: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default SectionShape;
@@ -3,5 +3,5 @@ interface NumberIndicatorProps {
3
3
  defaultValue?: number;
4
4
  onChange: (value: number) => void;
5
5
  }
6
- declare const NumberIndicator: ({ name, defaultValue, onChange }: NumberIndicatorProps) => import("react").JSX.Element;
6
+ declare const NumberIndicator: ({ name, defaultValue, onChange }: NumberIndicatorProps) => import("react/jsx-runtime").JSX.Element;
7
7
  export default NumberIndicator;
@@ -15,5 +15,5 @@ interface LayersProps {
15
15
  onTouchMove?: (e: React.TouchEvent<SVGRectElement | SVGCircleElement | SVGTextElement | SVGImageElement>) => void;
16
16
  onTouchEnd?: (e: React.TouchEvent<SVGRectElement | SVGCircleElement | SVGTextElement | SVGImageElement>) => void;
17
17
  }
18
- declare const Layers: ({ shadowShape, components, onClick, selectedComponent, selectedTable, activeTool, onMouseDown, onMouseUp, onBlur, selectedTableColor, mode, style, onTouchEnd, onTouchMove, onTouchStart }: LayersProps) => import("react").JSX.Element;
18
+ declare const Layers: ({ shadowShape, components, onClick, selectedComponent, selectedTable, activeTool, onMouseDown, onMouseUp, onBlur, selectedTableColor, mode, style, onTouchEnd, onTouchMove, onTouchStart }: LayersProps) => import("react/jsx-runtime").JSX.Element;
19
19
  export default Layers;
@@ -32,7 +32,7 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
32
32
  return (_jsxs("g", { transform: `rotate(${rotation} ${x + width / 2} ${y + height / 2})`, children: [_jsx("circle", Object.assign({ cx: centerX, cy: centerY, r: width - 15 }, commonProps, { opacity: id === (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) ? 0.5 : opacity })), labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
33
33
  var _a, _b, _c, _d;
34
34
  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 }, `${id}-label-${index}`));
35
- }), _jsx("g", { fill: "#e6b9c0", opacity: id === (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) ? 0.5 : opacity, stroke: "#c49ba3", strokeWidth: "1", children: seatCircles.map(({ cx, cy }, i) => (_jsx("circle", { cx: cx, cy: cy, r: seatRadius, fill: seatFill }, `${id}-seat-${i}`))) })] }, id));
35
+ }), _jsx("g", { fill: "#e6b9c0", opacity: id === (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) ? 0.5 : opacity, stroke: "#c49ba3", strokeWidth: "1", children: seatCircles.map(({ cx, cy }, i) => (_jsx("circle", { cx: cx, cy: cy, r: seatRadius, fill: seatFill }, `${id}-seat-${i}`))) }, `${id}-seats`)] }, id));
36
36
  }
37
37
  case "table-seat-square": {
38
38
  const seatCount = item.seatCount || 6;
@@ -52,7 +52,7 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
52
52
  cx: startX + i * spacing,
53
53
  cy: y + height + seatRadius * 1.5,
54
54
  }));
55
- return (_jsxs("g", { children: [_jsx("rect", Object.assign({ x: x, y: y, width: width, height: height }, commonProps)), _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));
55
+ return (_jsxs("g", { children: [_jsx("rect", Object.assign({ x: x, y: y, width: width, height: height }, commonProps)), _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`)] }, id));
56
56
  }
57
57
  case "text":
58
58
  return (_jsxs("g", { onClick: () => onClick(item), 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));
@@ -98,27 +98,27 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
98
98
  onDoubleClick: (e) => {
99
99
  e.stopPropagation();
100
100
  onClick === null || onClick === void 0 ? void 0 : onClick(item);
101
- }
101
+ },
102
102
  };
103
103
  switch (shape) {
104
104
  case "square":
105
- return (_jsxs(_Fragment, { children: [_jsx("rect", Object.assign({ x: x, y: y, width: width, height: height, fill: selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill, style: Object.assign({ cursor: mode === "view" ? "pointer" : "default" }, style), opacity: id === (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) ? 0.5 : opacity }, omit(commonProps, "opacity"), { transform: `rotate(${rotation} ${x + width / 2} ${y + height / 2})` }), id), labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
105
+ return (_jsxs("g", { children: [_jsx("rect", Object.assign({ x: x, y: y, width: width, height: height, fill: selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill, style: Object.assign({ cursor: mode === "view" ? "pointer" : "default" }, style), opacity: id === (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) ? 0.5 : opacity }, omit(commonProps, "opacity"), { transform: `rotate(${rotation} ${x + width / 2} ${y + height / 2})` }), id), labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
106
106
  var _a, _b, _c, _d;
107
107
  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})`, onClick: (e) => {
108
108
  e.stopPropagation();
109
109
  onClick(item);
110
110
  }, children: _ === null || _ === void 0 ? void 0 : _.label }, `${id}-label-${index}`));
111
- })] }));
111
+ })] }, id));
112
112
  case "circle":
113
- return (_jsxs(_Fragment, { children: [_jsx("circle", Object.assign({ cx: x + width / 2, cy: y + height / 2, r: width / 2, style: Object.assign({ cursor: mode === "view" ? "pointer" : "default" }, style), fill: selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill, opacity: id === (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) ? 0.5 : opacity }, omit(commonProps, "opacity")), id), labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
113
+ return (_jsxs("g", { children: [_jsx("circle", Object.assign({ cx: x + width / 2, cy: y + height / 2, r: width / 2, style: Object.assign({ cursor: mode === "view" ? "pointer" : "default" }, style), fill: selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill, opacity: id === (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) ? 0.5 : opacity }, omit(commonProps, "opacity")), id), labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
114
114
  var _a, _b, _c, _d;
115
115
  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})`, onClick: (e) => {
116
116
  e.stopPropagation();
117
117
  onClick(item);
118
118
  }, children: _ === null || _ === void 0 ? void 0 : _.label }, `${id}-label-${index}`));
119
- })] }));
119
+ })] }, id));
120
120
  case "diamond":
121
- return (_jsxs(_Fragment, { 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 })] }));
121
+ return (_jsxs("g", { 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));
122
122
  case "table-seat-circle": {
123
123
  const seatCount = item.seatCount;
124
124
  const openSpace = item.openSpace; // nilai antara 0 (tidak ada ruang) sampai maksimal ~0.9
@@ -142,7 +142,7 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
142
142
  e.stopPropagation();
143
143
  onClick(item);
144
144
  }, children: _ === null || _ === void 0 ? void 0 : _.label }, `${id}-label-${index}`));
145
- }), _jsx("g", { fill: "#e6b9c0", opacity: id === (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) ? 0.5 : opacity, stroke: "#c49ba3", strokeWidth: "1", children: seatCircles.map(({ cx, cy }, i) => (_jsx("circle", { cx: cx, cy: cy, r: seatRadius, fill: seatFill }, `${id}-seat-${i}`))) })] }, id));
145
+ }), _jsx("g", { fill: "#e6b9c0", opacity: id === (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) ? 0.5 : opacity, stroke: "#c49ba3", strokeWidth: "1", children: seatCircles.map(({ cx, cy }, i) => (_jsx("circle", { cx: cx, cy: cy, r: seatRadius, fill: seatFill }, `${id}-seat-${i}`))) }, `${id}-seats`)] }, id));
146
146
  }
147
147
  case "table-seat-square": {
148
148
  const seatCount = item.seatCount || 6;
@@ -162,7 +162,7 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
162
162
  cx: startX + i * spacing,
163
163
  cy: y + height + seatRadius * 1.5,
164
164
  }));
165
- return (_jsxs("g", { transform: `rotate(${rotation}, ${x}, ${y})`, children: [_jsx("rect", Object.assign({ x: x, y: y, style: Object.assign({ cursor: mode === "view" ? "pointer" : "default" }, style), width: width, height: height }, commonProps, { fill: selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill })), _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 }), _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));
165
+ return (_jsxs("g", { transform: `rotate(${rotation}, ${x}, ${y})`, children: [_jsx("rect", Object.assign({ x: x, y: y, style: Object.assign({ cursor: mode === "view" ? "pointer" : "default" }, style), width: width, height: height }, commonProps, { fill: selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill })), _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 }), _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`)] }, id));
166
166
  }
167
167
  case "text":
168
168
  return (_jsxs("g", { children: [_jsx("rect", { x: x, y: y, width: width, height: height, fill: "transparent", opacity: opacity, onClick: (e) => {
@@ -176,10 +176,18 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
176
176
  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));
177
177
  })] }, id));
178
178
  default:
179
- return null;
179
+ return _jsx("g", {}, id);
180
180
  }
181
181
  };
182
- return (_jsxs("g", { children: [components === null || components === void 0 ? void 0 : components.map(renderShape), shadowShape === null || shadowShape === void 0 ? void 0 : shadowShape.map(renderShadowShape), selectedComponent && (_jsxs(_Fragment, { children: [["square", "circle", "diamond", "text", "background", "image-table"].includes(selectedComponent.shape) && (_jsxs("g", { children: [_jsx("rect", { x: selectedComponent.x - 25, y: selectedComponent.y - 25, width: 20, height: 20, fill: "black", stroke: "white", strokeWidth: "2", transform: `scale(${selectedComponent.scale})`, onMouseDown: (e) => {
182
+ let date = new Date();
183
+ return (_jsxs("g", { children: [components === null || components === void 0 ? void 0 : components.map(renderShape), shadowShape === null || shadowShape === void 0 ? void 0 : shadowShape.map(renderShadowShape), selectedComponent && (_jsxs(_Fragment, { children: [[
184
+ "square",
185
+ "circle",
186
+ "diamond",
187
+ "text",
188
+ "background",
189
+ "image-table",
190
+ ].includes(selectedComponent.shape) && (_jsxs("g", { children: [_jsx("rect", { x: selectedComponent.x - 25, y: selectedComponent.y - 25, width: 20, height: 20, fill: "black", stroke: "white", strokeWidth: "2", transform: `scale(${selectedComponent.scale})`, onMouseDown: (e) => {
183
191
  e.stopPropagation();
184
192
  onMouseDown(e, selectedComponent, "top-left");
185
193
  }, onTouchStart: (e) => {
@@ -251,18 +259,18 @@ const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedT
251
259
  }, onTouchMove: (e) => {
252
260
  e.stopPropagation();
253
261
  onTouchMove(e);
254
- } })] })), ["table-seat-circle", "table-seat-square"].includes(selectedComponent.shape) && (_jsxs("g", { children: [_jsx("rect", { x: selectedComponent.x - selectedComponent.width, y: selectedComponent.y - selectedComponent.height, width: 10, height: 10, fill: "black", stroke: "white", strokeWidth: "2", transform: `scale(${selectedComponent.scale})`, onMouseDown: (e) => {
262
+ } })] }, `${selectedComponent.id}-selection`)), ["table-seat-circle", "table-seat-square"].includes(selectedComponent.shape) && (_jsxs("g", { children: [_jsx("rect", { x: selectedComponent.x - selectedComponent.width, y: selectedComponent.y - selectedComponent.height, width: 20, height: 20, fill: "black", stroke: "white", strokeWidth: "2", transform: `scale(${selectedComponent.scale})`, onMouseDown: (e) => {
255
263
  e.stopPropagation();
256
264
  onMouseDown(e, selectedComponent, "top-left");
257
- } }), _jsx("rect", { x: selectedComponent.x + selectedComponent.width * 2 - 10, y: selectedComponent.y - selectedComponent.height, width: 10, height: 10, fill: "black", stroke: "white", strokeWidth: "2", transform: `scale(${selectedComponent.scale})`, onMouseDown: (e) => {
265
+ } }), _jsx("rect", { x: selectedComponent.x + selectedComponent.width * 2 - 10, y: selectedComponent.y - selectedComponent.height, width: 20, height: 20, fill: "black", stroke: "white", strokeWidth: "2", transform: `scale(${selectedComponent.scale})`, onMouseDown: (e) => {
258
266
  e.stopPropagation();
259
267
  onMouseDown(e, selectedComponent, "top-right");
260
- } }), _jsx("rect", { x: selectedComponent.x + selectedComponent.width * 2 - 10, y: selectedComponent.y + selectedComponent.height * 2, width: 10, height: 10, fill: "black", stroke: "white", strokeWidth: "2", transform: `scale(${selectedComponent.scale})`, onMouseDown: (e) => {
268
+ } }), _jsx("rect", { x: selectedComponent.x + selectedComponent.width * 2 - 10, y: selectedComponent.y + selectedComponent.height * 2, width: 20, height: 20, fill: "black", stroke: "white", strokeWidth: "2", transform: `scale(${selectedComponent.scale})`, onMouseDown: (e) => {
261
269
  e.stopPropagation();
262
270
  onMouseDown(e, selectedComponent, "bottom-right");
263
- } }), _jsx("rect", { x: selectedComponent.x - selectedComponent.width, y: selectedComponent.y + selectedComponent.height * 2, width: 10, height: 10, fill: "black", stroke: "white", strokeWidth: "2", transform: `scale(${selectedComponent.scale})`, onMouseDown: (e) => {
271
+ } }), _jsx("rect", { x: selectedComponent.x - selectedComponent.width, y: selectedComponent.y + selectedComponent.height * 2, width: 20, height: 20, fill: "black", stroke: "white", strokeWidth: "2", transform: `scale(${selectedComponent.scale})`, onMouseDown: (e) => {
264
272
  e.stopPropagation();
265
273
  onMouseDown(e, selectedComponent, "b-left");
266
- } })] }))] }))] }));
274
+ } })] }, selectedComponent.id))] }))] }, `${date}`));
267
275
  };
268
276
  export default Layers;
@@ -3,6 +3,6 @@ export interface LayerViewProps {
3
3
  componentProps: any[];
4
4
  extraComponentProps: any[];
5
5
  }
6
- declare const TableEditor: ({ componentProps, extraComponentProps, }: LayerViewProps) => import("react").JSX.Element;
6
+ declare const TableEditor: ({ componentProps, extraComponentProps, }: LayerViewProps) => import("react/jsx-runtime").JSX.Element;
7
7
  export default TableEditor;
8
8
  export { LayerView };
@@ -1,4 +1,4 @@
1
1
  declare const ModalPreview: ({ children }: {
2
2
  children: React.ReactNode;
3
- }) => import("react").JSX.Element;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
4
  export default ModalPreview;
@@ -1,5 +1,5 @@
1
1
  interface BoardTemplateProps {
2
2
  onSelectComponent?: (items: any) => void;
3
3
  }
4
- declare const BoardTemplate: ({ onSelectComponent }: BoardTemplateProps) => import("react").JSX.Element;
4
+ declare const BoardTemplate: ({ onSelectComponent }: BoardTemplateProps) => import("react/jsx-runtime").JSX.Element;
5
5
  export default BoardTemplate;
@@ -66,7 +66,7 @@ const BoardTemplate = ({ onSelectComponent }) => {
66
66
  }
67
67
  dispatch({ type: "board/setFlagChange", payload: false });
68
68
  }
69
- }, [componentsProps, extraComponentsProps, selectedComponentProps]);
69
+ }, [componentsProps, extraComponentsProps, selectedComponentProps, flagChange]);
70
70
  // Local → Redux
71
71
  useEffect(() => {
72
72
  if (isSyncingFromRedux.current) {
@@ -1,2 +1,2 @@
1
- declare const Navbar: () => import("react").JSX.Element;
1
+ declare const Navbar: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default Navbar;
@@ -22,5 +22,5 @@ export interface TableEditorProps {
22
22
  };
23
23
  dragOnly?: boolean;
24
24
  }
25
- declare const TableEditor: (props: TableEditorProps) => import("react").JSX.Element;
25
+ declare const TableEditor: (props: TableEditorProps) => import("react/jsx-runtime").JSX.Element;
26
26
  export default TableEditor;
@@ -22,18 +22,21 @@ const TableEditor = (props) => {
22
22
  type: "board/setNewComponents",
23
23
  payload: componentProps,
24
24
  });
25
+ dispatch({ type: "board/setFlagChange", payload: true });
25
26
  }
26
27
  if ((extraComponentProps === null || extraComponentProps === void 0 ? void 0 : extraComponentProps.length) > 0) {
27
28
  dispatch({
28
29
  type: "board/setNewExtraComponent",
29
30
  payload: extraComponentProps,
30
31
  });
32
+ dispatch({ type: "board/setFlagChange", payload: true });
31
33
  }
32
34
  if (props === null || props === void 0 ? void 0 : props.defaultBackground) {
33
35
  dispatch({
34
36
  type: "board/setBackgroundColor",
35
37
  payload: props === null || props === void 0 ? void 0 : props.defaultBackground,
36
38
  });
39
+ dispatch({ type: "board/setFlagChange", payload: true });
37
40
  }
38
41
  }, [componentProps, extraComponentProps, props === null || props === void 0 ? void 0 : props.defaultBackground]);
39
42
  return (_jsx(_Fragment, { children: _jsxs("div", { className: "w-full h-screen flex relative", children: [_jsx(SideTool, { dragOnly: dragOnly }), _jsx(Board, { onSelectComponent: props.onSelectComponent }), _jsx(ControlPanels, { action: props.action, responseMapping: props.responseMapping })] }) }));
@@ -7,5 +7,5 @@ interface ControlPanelsProps {
7
7
  src: string;
8
8
  };
9
9
  }
10
- declare const ControlPanels: (props: ControlPanelsProps) => import("react").JSX.Element;
10
+ declare const ControlPanels: (props: ControlPanelsProps) => import("react/jsx-runtime").JSX.Element;
11
11
  export default ControlPanels;
@@ -1,4 +1,4 @@
1
1
  declare const SelectToolForm: ({ title }: {
2
2
  title?: string;
3
- }) => import("react").JSX.Element;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
4
  export default SelectToolForm;
@@ -1,2 +1,2 @@
1
- declare const SquareToolForm: () => import("react").JSX.Element;
1
+ declare const SquareToolForm: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default SquareToolForm;
@@ -1,2 +1,2 @@
1
- declare const SeatCircle: () => import("react").JSX.Element;
1
+ declare const SeatCircle: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default SeatCircle;
@@ -1,2 +1,2 @@
1
- declare const TextTool: () => import("react").JSX.Element;
1
+ declare const TextTool: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default TextTool;
@@ -9,5 +9,5 @@ interface UploadToolProps {
9
9
  src: string;
10
10
  };
11
11
  }
12
- declare const UploadTool: ({ name, type, action, responseMapping, }: UploadToolProps) => import("react").JSX.Element;
12
+ declare const UploadTool: ({ name, type, action, responseMapping, }: UploadToolProps) => import("react/jsx-runtime").JSX.Element;
13
13
  export default UploadTool;
@@ -1,4 +1,4 @@
1
1
  declare const SideTool: ({ dragOnly }: {
2
2
  dragOnly?: boolean;
3
- }) => import("react").JSX.Element;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
4
  export default SideTool;
@@ -15,5 +15,5 @@ export interface LayerViewProps {
15
15
  containerProps?: any;
16
16
  svgProps?: any;
17
17
  }
18
- declare const LayerView: (props: LayerViewProps) => import("react").JSX.Element;
18
+ declare const LayerView: (props: LayerViewProps) => import("react/jsx-runtime").JSX.Element;
19
19
  export default LayerView;
@@ -1,11 +1,12 @@
1
1
  "use client";
2
2
  import { configureStore } from "@reduxjs/toolkit";
3
3
  import { rootReducer } from "./rootReducer";
4
+ import { logger } from "redux-logger";
4
5
  import { middleware } from "./middleware";
5
6
  import { FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER } from "redux-persist";
6
- // if(process.env.NODE_ENV === "development") {
7
- // middleware.push(logger);
8
- // }
7
+ if (process.env.NODE_ENV === "development") {
8
+ middleware.push(logger);
9
+ }
9
10
  // const rootPersistReducer = persistReducer<RootState>(rootPersistConfig, rootReducer);
10
11
  export const store = configureStore({
11
12
  reducer: rootReducer,
@@ -1,3 +1,3 @@
1
1
  export declare const ReduxProvider: ({ children }: {
2
2
  children: React.ReactNode;
3
- }) => import("react").JSX.Element;
3
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  export declare const StoreProvider: ({ children, themeColor, }: {
2
2
  children: React.ReactNode;
3
3
  themeColor?: string;
4
- }) => import("react").JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seat-editor",
3
- "version": "1.3.15",
3
+ "version": "1.3.17",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,27 +0,0 @@
1
- import localFont from "next/font/local";
2
- import "./globals.css";
3
- import { Layout } from "antd";
4
- import { StoreProvider } from "../provider/store-provider";
5
- const geistSans = localFont({
6
- src: "./fonts/GeistVF.woff",
7
- variable: "--font-geist-sans",
8
- weight: "100 900",
9
- });
10
- const geistMono = localFont({
11
- src: "./fonts/GeistMonoVF.woff",
12
- variable: "--font-geist-mono",
13
- weight: "100 900",
14
- });
15
- export const metadata = {
16
- title: "Create Next App",
17
- description: "Generated by create next app",
18
- };
19
- export default function RootLayout({ children, }) {
20
- return (<html lang="en">
21
- <body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
22
- <StoreProvider>
23
- <Layout>{children}</Layout>
24
- </StoreProvider>
25
- </body>
26
- </html>);
27
- }
@@ -1,12 +0,0 @@
1
- import Board from "../../features/board";
2
- import SideTool from "../../features/side-tool";
3
- import ControlPanels from "../../features/panel";
4
- export default function NewBoard() {
5
- return (<>
6
- <div className="w-full h-screen flex relative">
7
- <SideTool />
8
- <Board />
9
- <ControlPanels />
10
- </div>
11
- </>);
12
- }