seat-editor 3.3.35 → 3.3.37

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 (83) hide show
  1. package/dist/app/constant.d.ts +3 -0
  2. package/dist/app/constant.js +2 -0
  3. package/dist/app/layout.d.ts +1 -1
  4. package/dist/app/layout.js +22 -0
  5. package/dist/app/new-board/page.d.ts +1 -1
  6. package/dist/app/new-board/page.js +58 -0
  7. package/dist/app/old-board/page.d.ts +1 -2
  8. package/dist/app/old-board/page.js +377 -0
  9. package/dist/app/only-view/chair.d.ts +1 -1
  10. package/dist/app/only-view/chair.js +2 -10
  11. package/dist/app/only-view/page.d.ts +1 -1
  12. package/dist/app/only-view/page.js +226 -0
  13. package/dist/app/only-view/user.d.ts +1 -1
  14. package/dist/app/only-view/user.js +2 -10
  15. package/dist/app/page.d.ts +1 -1
  16. package/dist/app/page.js +8 -0
  17. package/dist/app/test/page.d.ts +1 -2
  18. package/dist/app/test/page.js +43 -0
  19. package/dist/app/v2/page.d.ts +1 -1
  20. package/dist/app/v2/page.js +8 -0
  21. package/dist/components/button-tools/index.d.ts +1 -1
  22. package/dist/components/button-tools/index.js +11 -0
  23. package/dist/components/form-tools/label.d.ts +1 -1
  24. package/dist/components/form-tools/label.js +21 -0
  25. package/dist/components/form-tools/shape.d.ts +1 -1
  26. package/dist/components/form-tools/shape.js +69 -0
  27. package/dist/components/input/number-indicator.d.ts +1 -1
  28. package/dist/components/input/number-indicator.js +27 -0
  29. package/dist/components/joystick/index.d.ts +1 -2
  30. package/dist/components/joystick/index.js +48 -0
  31. package/dist/components/layer/index.d.ts +1 -1
  32. package/dist/components/layer/index.js +295 -0
  33. package/dist/components/layer-v2/index.d.ts +1 -1
  34. package/dist/components/layer-v2/index.js +282 -0
  35. package/dist/components/layer-v3/index.d.ts +1 -1
  36. package/dist/components/layer-v3/index.js +483 -0
  37. package/dist/components/layer-v4/index.d.ts +1 -1
  38. package/dist/components/layer-v4/index.js +924 -0
  39. package/dist/components/lib/index.d.ts +1 -1
  40. package/dist/components/lib/index.js +28 -0
  41. package/dist/components/modal-preview/index.d.ts +1 -1
  42. package/dist/components/modal-preview/index.js +10 -0
  43. package/dist/features/board/index.d.ts +1 -1
  44. package/dist/features/board/index.js +666 -0
  45. package/dist/features/board-v2/index.d.ts +1 -2
  46. package/dist/features/board-v2/index.js +807 -0
  47. package/dist/features/board-v3/icons.js +16 -0
  48. package/dist/features/board-v3/index.d.ts +1 -1
  49. package/dist/features/board-v3/index.js +1587 -0
  50. package/dist/features/navbar/index.d.ts +1 -1
  51. package/dist/features/navbar/index.js +6 -0
  52. package/dist/features/package/index.d.ts +1 -1
  53. package/dist/features/package/index.js +166 -0
  54. package/dist/features/panel/index.d.ts +1 -1
  55. package/dist/features/panel/index.js +243 -0
  56. package/dist/features/panel/select-tool.d.ts +1 -1
  57. package/dist/features/panel/select-tool.js +57 -0
  58. package/dist/features/panel/selected-group.d.ts +1 -1
  59. package/dist/features/panel/selected-group.js +35 -0
  60. package/dist/features/panel/square-circle-tool.d.ts +1 -1
  61. package/dist/features/panel/square-circle-tool.js +8 -0
  62. package/dist/features/panel/table-seat-circle.d.ts +1 -1
  63. package/dist/features/panel/table-seat-circle.js +9 -0
  64. package/dist/features/panel/table-seat-square.d.ts +1 -1
  65. package/dist/features/panel/table-seat-square.js +9 -0
  66. package/dist/features/panel/text-tool.d.ts +1 -1
  67. package/dist/features/panel/text-tool.js +22 -0
  68. package/dist/features/panel/upload-tool.d.ts +1 -1
  69. package/dist/features/panel/upload-tool.js +150 -0
  70. package/dist/features/side-tool/index.d.ts +1 -1
  71. package/dist/features/side-tool/index.js +365 -0
  72. package/dist/features/view-only/index.d.ts +1 -1
  73. package/dist/features/view-only/index.js +198 -0
  74. package/dist/features/view-only-2/index.d.ts +84 -14
  75. package/dist/features/view-only-2/index.js +558 -0
  76. package/dist/features/view-only-3/index.d.ts +1 -1
  77. package/dist/features/view-only-3/index.js +577 -0
  78. package/dist/provider/antd-provider.js +43 -0
  79. package/dist/provider/redux-provider.d.ts +1 -1
  80. package/dist/provider/redux-provider.js +7 -0
  81. package/dist/provider/store-provider.d.ts +1 -1
  82. package/dist/provider/store-provider.js +9 -0
  83. package/package.json +1 -1
@@ -0,0 +1,226 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import LayerView from "../../features/view-only-3";
4
+ import { useState, useRef } from "react";
5
+ import { data4 } from "../constant";
6
+ import { ChairIcon } from "./chair";
7
+ import { UserIcon } from "./user";
8
+ import { Modal } from "antd";
9
+ import JsonView from "@uiw/react-json-view";
10
+ export const dummyImage = [
11
+ {
12
+ id: "1747388267450",
13
+ x: 368,
14
+ y: 77.54706573486328,
15
+ width: 751.9405198530717,
16
+ height: 812,
17
+ rotation: 0,
18
+ shape: "background",
19
+ src: "https://cdn.table.link/prod/5bf923de-2366-4a11-9b8b-e92de0afbf05/3a65cb36-7d85-4c38-9403-a15f94641920/68d45207-d66b-4bb5-92a2-4e5a87715e98/rsvp/1753965985769725756_BOI Reg.png",
20
+ fill: "#bca16a",
21
+ opacity: 1,
22
+ labels: [
23
+ {
24
+ label: "T22",
25
+ fontColor: "#0d0c0c",
26
+ x: 0,
27
+ fontSize: 16,
28
+ y: 8,
29
+ },
30
+ ],
31
+ },
32
+ // {
33
+ // x: 100,
34
+ // y: 520,
35
+ // labels: [
36
+ // {
37
+ // x: 0,
38
+ // y: 27,
39
+ // label: "New Table 5",
40
+ // fontSize: 12,
41
+ // fontColor: "#0d0c0c",
42
+ // },
43
+ // ],
44
+ // id: "1761194669729132000",
45
+ // stroke: "#347ADB", //warna border
46
+ // fill: "#E1F4FF", //warna latar belakang
47
+ // strokeWidth: 1,
48
+ // text: "",
49
+ // shape: "background",
50
+ // width: 100,
51
+ // height: 100,
52
+ // gapTags: 10, //gap antara tags secara vertical,
53
+ // tags: [
54
+ // {
55
+ // key: "table", //key untuk penamaan tag
56
+ // items: [
57
+ // {
58
+ // type: "text", //tipe text atau icon
59
+ // value: "V1", //value untuk text atau icon
60
+ // fontSize: 14,
61
+ // fontWeight: 600,
62
+ // fill: "#3F4254",
63
+ // },
64
+ // ],
65
+ // direction: "flex", // flex untuk horizontal dan column untuk vertikal
66
+ // gap: 2, //gap antara item
67
+ // offsetX: 0, //offset x antara item
68
+ // offsetY: 0, //offset y antara item
69
+ // },
70
+ // {
71
+ // key: "rsvp_time",
72
+ // items: [
73
+ // {
74
+ // value: "11:00",
75
+ // type: "text",
76
+ // fill: "#5E6278",
77
+ // fontSize: 11,
78
+ // fontWeight: 700,
79
+ // textDecoration: "underline",
80
+ // },
81
+ // {
82
+ // value: "20:00",
83
+ // type: "text",
84
+ // fill: "#5E6278",
85
+ // fontSize: 11,
86
+ // fontWeight: 400,
87
+ // },
88
+ // ],
89
+ // direction: "column",
90
+ // gap: 2,
91
+ // },
92
+ // {
93
+ // key: "rsvp_time",
94
+ // items: [
95
+ // {
96
+ // value: "01:00",
97
+ // type: "text",
98
+ // fill: "#5E6278",
99
+ // fontSize: 11,
100
+ // fontWeight: 400,
101
+ // symbol: {
102
+ // value: "+1",
103
+ // gap: 8,
104
+ // fontSize: 9,
105
+ // position: "right-top", // right | right-top | right-bottom | left | left-top | left-bottom | top | bottom
106
+ // },
107
+ // },
108
+ // ],
109
+ // direction: "flex",
110
+ // gap: 10,
111
+ // offsetX: -3,
112
+ // offsetY: -8,
113
+ // },
114
+ // ],
115
+ // opacity: 1,
116
+ // rotation: 90,
117
+ // seatCount: 10,
118
+ // openSpace: 0.3,
119
+ // seatFill: "#ed8989",
120
+ // seatPositions: {
121
+ // top: 3,
122
+ // bottom: 3,
123
+ // left: 3,
124
+ // right: 3,
125
+ // },
126
+ // },
127
+ ];
128
+ const Card = (item) => {
129
+ const handleDragStart = (e) => {
130
+ // Jangan preventDefault di drag start
131
+ e.dataTransfer.setData("application/json", JSON.stringify(item));
132
+ e.dataTransfer.effectAllowed = "move";
133
+ };
134
+ return (_jsxs("div", { className: "h-40 bg-gray-400 shadow-lg rounded-lg p-4 m-4", "data-table": JSON.stringify(item), draggable: true, onContextMenu: (e) => e.preventDefault(), onDragStart: handleDragStart, onClick: (e) => e.stopPropagation(), onPointerDown: (e) => e.stopPropagation(), children: [_jsx("h2", { className: "text-lg font-semibold mb-2", children: "Card Title" }), _jsx("p", { className: "text-gray-600", children: item === null || item === void 0 ? void 0 : item.name })] }));
135
+ };
136
+ const TouchScrollDetect = () => {
137
+ const refLayer = useRef(null);
138
+ const [open, setOpen] = useState(false);
139
+ const [table, setTable] = useState(null);
140
+ const handleZoomIn = () => {
141
+ var _a, _b;
142
+ (_b = (_a = refLayer === null || refLayer === void 0 ? void 0 : refLayer.current) === null || _a === void 0 ? void 0 : _a.transformRef) === null || _b === void 0 ? void 0 : _b.zoomIn(0.1);
143
+ };
144
+ const handleZoomOut = () => {
145
+ var _a, _b;
146
+ (_b = (_a = refLayer === null || refLayer === void 0 ? void 0 : refLayer.current) === null || _a === void 0 ? void 0 : _a.transformRef) === null || _b === void 0 ? void 0 : _b.zoomOut();
147
+ };
148
+ const handleSwitch = (e, data) => {
149
+ console.log("hswith");
150
+ setOpen(!open);
151
+ setTable(data);
152
+ };
153
+ const handleDrop = (e, data) => {
154
+ console.log("data drop", data);
155
+ const targetData = data === null || data === void 0 ? void 0 : data.targetTable;
156
+ e.preventDefault();
157
+ setOpen(!open);
158
+ setTable(data);
159
+ };
160
+ const handleSelectTable = (item) => {
161
+ setOpen(!open);
162
+ setTable(item);
163
+ };
164
+ const renderModal = () => {
165
+ return (_jsx(Modal, { open: open, onCancel: () => setOpen(false), width: 700, title: "Preview Board", centered: true, footer: null, children: _jsx("div", { className: "flex flex-col p-4 h-[500px] overflow-auto", children: _jsx(JsonView, { value: table }) }) }));
166
+ };
167
+ const testData = [];
168
+ return (_jsxs("div", { className: "w-full h-screen border-2 border-black overflow-auto", id: "scroll-container", children: [renderModal(), _jsxs("div", { className: "flex", children: [_jsx("div", { className: "h-screen bg-gray-500 w-1/3", children: _jsx("div", { className: "p-4", children: data4.map((item, index) => (_jsx(Card, Object.assign({}, item), index))) }) }), _jsxs("div", { className: "h-screen w-2/3 relative", children: [_jsxs("div", { className: "absolute top-1 right-1 flex gap-4 z-[10]", children: [_jsx("button", { className: "p-4 bg-gray-400", onClick: () => handleZoomIn(), children: "+" }), _jsx("button", { className: "p-4 bg-gray-400", onClick: () => handleZoomOut(), children: "-" })] }), _jsx(LayerView, { refs: refLayer, statusKey: "is_hold", privilegedTags: [
169
+ {
170
+ key: "table",
171
+ items: ["text", "icon"],
172
+ },
173
+ {
174
+ key: "rsvp_time",
175
+ items: ["text", "icon"],
176
+ },
177
+ ], defaultBackground: "#000000", mappingKey: "properties", componentProps: testData === null || testData === void 0 ? void 0 : testData.map((item) => {
178
+ return {
179
+ properties: item,
180
+ test: item === null || item === void 0 ? void 0 : item.test,
181
+ };
182
+ }), onDrop: (e, data) => handleDrop(e, data), onSwitch: (e, data) => handleSwitch(e, data), extraComponentProps: [], onSelectComponent: (component) => {
183
+ handleSelectTable(component);
184
+ },
185
+ // dragTableBlockKey={[
186
+ // {
187
+ // key: "is_lock",
188
+ // value: 1,
189
+ // },
190
+ // ]}
191
+ tableMatchKey: [
192
+ {
193
+ key: 0,
194
+ properties: { fill: "white" },
195
+ className: "blink-2",
196
+ },
197
+ ], eventMatchTable: [
198
+ {
199
+ event: "mouseenter",
200
+ properties: {
201
+ strokeWidth: 5,
202
+ filter: "drop-shadow(0px 0px 5px red)",
203
+ },
204
+ },
205
+ {
206
+ event: "dragenter",
207
+ properties: { strokeWidth: 5 },
208
+ },
209
+ {
210
+ event: "selected",
211
+ properties: { strokeWidth: 5 },
212
+ },
213
+ ], iconTags: [
214
+ {
215
+ icon: _jsx(ChairIcon, {}),
216
+ key: "chair",
217
+ },
218
+ {
219
+ icon: _jsx(UserIcon, {}),
220
+ key: "user",
221
+ },
222
+ ], viewStyles: {
223
+ paddingTop: 200,
224
+ }, disabled: false, transformProps: {} })] })] })] }));
225
+ };
226
+ export default TouchScrollDetect;
@@ -1 +1 @@
1
- export function UserIcon(): import("react").JSX.Element;
1
+ export function UserIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  export const UserIcon = () => {
2
- return (<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
3
- <path d="M7.61992 10.1625C9.00754 10.1625 10.1324 9.03757 10.1324 7.64995C10.1324 6.26234 9.00754 5.13745 7.61992 5.13745C6.23231 5.13745 5.10742 6.26234 5.10742 7.64995C5.10742 9.03757 6.23231 10.1625 7.61992 10.1625Z" fill="#5E6278"/>
4
- <path d="M7.62 14.9999C9.34313 14.9999 10.74 14.1168 10.74 13.0274C10.74 11.9381 9.34313 11.0549 7.62 11.0549C5.89687 11.0549 4.5 11.9381 4.5 13.0274C4.5 14.1168 5.89687 14.9999 7.62 14.9999Z" fill="#5E6278"/>
5
- <path opacity="0.3" d="M11.595 4.23C12.7631 4.23 13.71 3.28308 13.71 2.115C13.71 0.946918 12.7631 0 11.595 0C10.4269 0 9.47998 0.946918 9.47998 2.115C9.47998 3.28308 10.4269 4.23 11.595 4.23Z" fill="#5E6278"/>
6
- <path opacity="0.3" d="M3.62257 4.23C4.79065 4.23 5.73757 3.28308 5.73757 2.115C5.73757 0.946918 4.79065 0 3.62257 0C2.45449 0 1.50757 0.946918 1.50757 2.115C1.50757 3.28308 2.45449 4.23 3.62257 4.23Z" fill="#5E6278"/>
7
- <g opacity="0.3">
8
- <path d="M11.4749 5.87256C11.2349 5.87256 11.0024 5.87256 10.7699 5.91006C11.1229 6.52313 11.2825 7.22856 11.2276 7.93388C11.1727 8.63919 10.906 9.31147 10.4624 9.86256C10.7984 9.92909 11.1399 9.96424 11.4824 9.96756C13.3874 9.96756 14.9249 9.04506 14.9249 7.92006C14.9249 6.79506 13.3799 5.87256 11.4749 5.87256Z" fill="#5E6278"/>
9
- <path d="M3.4499 6C3.6899 6 3.9224 6 4.1549 6.0375C3.80187 6.65057 3.64233 7.356 3.6972 8.06132C3.75208 8.76664 4.0188 9.43891 4.4624 9.99C4.12639 10.0565 3.78492 10.0917 3.4424 10.095C1.5374 10.095 -9.77516e-05 9.1725 -9.77516e-05 8.0475C-9.77516e-05 6.9225 1.5449 6 3.4499 6Z" fill="#5E6278"/>
10
- </g>
11
- </svg>);
3
+ return (_jsxs("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M7.61992 10.1625C9.00754 10.1625 10.1324 9.03757 10.1324 7.64995C10.1324 6.26234 9.00754 5.13745 7.61992 5.13745C6.23231 5.13745 5.10742 6.26234 5.10742 7.64995C5.10742 9.03757 6.23231 10.1625 7.61992 10.1625Z", fill: "#5E6278" }), _jsx("path", { d: "M7.62 14.9999C9.34313 14.9999 10.74 14.1168 10.74 13.0274C10.74 11.9381 9.34313 11.0549 7.62 11.0549C5.89687 11.0549 4.5 11.9381 4.5 13.0274C4.5 14.1168 5.89687 14.9999 7.62 14.9999Z", fill: "#5E6278" }), _jsx("path", { opacity: "0.3", d: "M11.595 4.23C12.7631 4.23 13.71 3.28308 13.71 2.115C13.71 0.946918 12.7631 0 11.595 0C10.4269 0 9.47998 0.946918 9.47998 2.115C9.47998 3.28308 10.4269 4.23 11.595 4.23Z", fill: "#5E6278" }), _jsx("path", { opacity: "0.3", d: "M3.62257 4.23C4.79065 4.23 5.73757 3.28308 5.73757 2.115C5.73757 0.946918 4.79065 0 3.62257 0C2.45449 0 1.50757 0.946918 1.50757 2.115C1.50757 3.28308 2.45449 4.23 3.62257 4.23Z", fill: "#5E6278" }), _jsxs("g", { opacity: "0.3", children: [_jsx("path", { d: "M11.4749 5.87256C11.2349 5.87256 11.0024 5.87256 10.7699 5.91006C11.1229 6.52313 11.2825 7.22856 11.2276 7.93388C11.1727 8.63919 10.906 9.31147 10.4624 9.86256C10.7984 9.92909 11.1399 9.96424 11.4824 9.96756C13.3874 9.96756 14.9249 9.04506 14.9249 7.92006C14.9249 6.79506 13.3799 5.87256 11.4749 5.87256Z", fill: "#5E6278" }), _jsx("path", { d: "M3.4499 6C3.6899 6 3.9224 6 4.1549 6.0375C3.80187 6.65057 3.64233 7.356 3.6972 8.06132C3.75208 8.76664 4.0188 9.43891 4.4624 9.99C4.12639 10.0565 3.78492 10.0917 3.4424 10.095C1.5374 10.095 -9.77516e-05 9.1725 -9.77516e-05 8.0475C-9.77516e-05 6.9225 1.5449 6 3.4499 6Z", fill: "#5E6278" })] })] }));
12
4
  };
@@ -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;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import Board from "../features/board-v3";
3
+ import SideTool from "../features/side-tool";
4
+ import ControlPanels from "../features/panel";
5
+ const TableEditor = () => {
6
+ return (_jsx(_Fragment, { children: _jsxs("div", { className: "w-full h-screen flex relative", children: [_jsx(SideTool, {}), _jsx(Board, {}), _jsx(ControlPanels, {})] }) }));
7
+ };
8
+ export default TableEditor;
@@ -1,2 +1 @@
1
- import React from "react";
2
- export default function DraggableRect(): React.JSX.Element;
1
+ export default function DraggableRect(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useRef, useState } from "react";
4
+ export default function DraggableRect() {
5
+ const rectRef = useRef(null);
6
+ const [pos, setPos] = useState({ x: 100, y: 100 });
7
+ const [dragging, setDragging] = useState(false);
8
+ const [offset, setOffset] = useState({ x: 0, y: 0 });
9
+ const getCoords = (e) => {
10
+ if ("touches" in e) {
11
+ return {
12
+ x: e.touches[0].clientX,
13
+ y: e.touches[0].clientY,
14
+ };
15
+ }
16
+ return {
17
+ x: e.clientX,
18
+ y: e.clientY,
19
+ };
20
+ };
21
+ const handleStart = (e) => {
22
+ e.preventDefault();
23
+ const coords = getCoords(e);
24
+ setOffset({
25
+ x: coords.x - pos.x,
26
+ y: coords.y - pos.y,
27
+ });
28
+ setDragging(true);
29
+ };
30
+ const handleMove = (e) => {
31
+ if (!dragging)
32
+ return;
33
+ const coords = getCoords(e);
34
+ setPos({
35
+ x: coords.x - offset.x,
36
+ y: coords.y - offset.y,
37
+ });
38
+ };
39
+ const handleEnd = () => {
40
+ setDragging(false);
41
+ };
42
+ return (_jsx("svg", { width: "100%", height: "500", viewBox: "0 0 800 600", style: { border: "1px solid black", touchAction: "none" }, onMouseMove: handleMove, onMouseUp: handleEnd, onTouchMove: handleMove, onTouchEnd: handleEnd, children: _jsx("rect", { ref: rectRef, x: pos.x, y: pos.y, width: "150", height: "100", fill: "tomato", onMouseDown: handleStart, onTouchStart: handleStart, style: { cursor: "grab" } }) }));
43
+ }
@@ -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;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import Board from "../../features/board-v2";
3
+ import SideTool from "../../features/side-tool";
4
+ import ControlPanels from "../../features/panel";
5
+ const TableEditor = () => {
6
+ return (_jsx(_Fragment, { children: _jsxs("div", { className: "w-full h-screen flex relative", children: [_jsx(SideTool, {}), _jsx(Board, {}), _jsx(ControlPanels, {})] }) }));
7
+ };
8
+ 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;
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Button, Popover } from "antd";
4
+ const ButtonTools = (props) => {
5
+ const { buttonProps, items, popoverProps } = props;
6
+ if (items.length === 0) {
7
+ return (_jsx(Popover, Object.assign({ trigger: "hover" }, popoverProps, { children: _jsx(Button, Object.assign({}, buttonProps)) })));
8
+ }
9
+ return (_jsx(Popover, { content: _jsxs("div", { children: [_jsx(Button, { children: "Button 1" }), _jsx(Button, { children: "Button 2" })] }), trigger: "click", children: _jsx(Button, Object.assign({}, buttonProps)) }));
10
+ };
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;
@@ -0,0 +1,21 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { Button, ColorPicker, Flex, Form, Input, InputNumber } from "antd";
4
+ const SectionLabel = () => {
5
+ return (_jsxs("div", { className: "py-2", children: [_jsx("h1", { className: "heading-s", children: "Section Labeling" }), _jsx(Form.Item, { label: "Labels in square", name: "labels", children: _jsx(Form.List, { name: "labels", children: (fields, { add, remove }) => (_jsxs(_Fragment, { children: [fields.map((field) => (_jsxs("div", { children: [_jsxs(Flex, { gap: 2, children: [_jsx(Form.Item, { name: [field.name, "label"], label: "Text", children: _jsx(Input, {}) }), _jsx(Form.Item, { name: [field.name, "fontColor"], label: "Color", getValueFromEvent: (color) => color.toHexString(), children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) })] }), _jsxs(Flex, { gap: 2, children: [_jsx(Form.Item, { name: [field.name, "x"], label: "X", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { name: [field.name, "y"], label: "Y", children: _jsx(InputNumber, {}) })] }), _jsxs(Flex, { gap: 2, children: [_jsx(Form.Item, { name: [field.name, "fontSize"], label: "Size", children: _jsx(InputNumber, { suffix: "px" }) }), _jsx(Form.Item, { name: [field.name, "rotation"], label: "Rotation", children: _jsx(InputNumber, { suffix: "\u00B0", min: 0, max: 360, parser: (value) => {
6
+ if (!value)
7
+ return 0;
8
+ const num = Number(value.replace(/\D/g, ""));
9
+ if (Number.isNaN(num))
10
+ return 0;
11
+ return Math.min(360, Math.max(0, num));
12
+ } }) })] })] }, field.key))), _jsxs(Flex, { gap: 2, children: [_jsx(Button, { type: "primary", onClick: () => add({
13
+ label: "",
14
+ fontColor: "#000000",
15
+ x: 0,
16
+ y: 0,
17
+ fontSize: 12,
18
+ rotation: 0
19
+ }), className: "btn btn-primary", children: "Add" }), _jsx(Button, { type: "primary", onClick: () => remove(fields.length - 1), className: "btn btn-primary", children: "Remove" })] })] })) }) }), _jsx("div", { className: "divider-dashed" })] }));
20
+ };
21
+ export default SectionLabel;
@@ -4,5 +4,5 @@ export declare const optionsShape: {
4
4
  }[];
5
5
  declare const SectionShape: ({ allowChangeShape, }: {
6
6
  allowChangeShape?: boolean;
7
- }) => import("react").JSX.Element;
7
+ }) => import("react/jsx-runtime").JSX.Element;
8
8
  export default SectionShape;
@@ -0,0 +1,69 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { ColorPicker, Flex, Form, InputNumber, Select } from "antd";
4
+ export const optionsShape = [
5
+ {
6
+ value: "circle",
7
+ label: "Circle",
8
+ },
9
+ {
10
+ value: "square",
11
+ label: "Square",
12
+ },
13
+ {
14
+ value: "table-seat-circle",
15
+ label: "Type 1",
16
+ },
17
+ {
18
+ value: "table-seat-square",
19
+ label: "Type 2",
20
+ },
21
+ {
22
+ value: "table-seat-half-square",
23
+ label: "Type 3",
24
+ },
25
+ {
26
+ value: "table-seat-rect-square",
27
+ label: "Type 4",
28
+ },
29
+ {
30
+ value: "table-seat-rect-circle",
31
+ label: "Type 5",
32
+ },
33
+ {
34
+ label: "Image Table",
35
+ value: "image-table",
36
+ },
37
+ ];
38
+ const SectionShape = ({ allowChangeShape = true, }) => {
39
+ const shape = Form.useWatch("shape");
40
+ return (_jsxs("div", { className: "py-2", children: [_jsx("h1", { className: "heading-s", children: "Shape" }), allowChangeShape && (_jsx(Flex, { gap: 2, className: "w-full", children: _jsx(Form.Item, { label: "Name", name: "shape", className: "w-full", children: _jsx(Select, { options: optionsShape, className: "w-full" }) }) })), _jsxs(Flex, { gap: 2, className: "w-full", children: [_jsx(Form.Item, { label: "Width", name: "width", className: "w-full", children: _jsx(InputNumber, { suffix: "px", controls: true, parser: (value) => {
41
+ var _a;
42
+ const onlyNumber = (_a = value === null || value === void 0 ? void 0 : value.replace(/\D/g, "")) !== null && _a !== void 0 ? _a : "";
43
+ return onlyNumber === "" ? 1 : Math.max(1, Number(onlyNumber));
44
+ } }) }), _jsx(Form.Item, { label: "Height", name: "height", className: "w-full", children: _jsx(InputNumber, { suffix: "px", parser: (value) => {
45
+ var _a;
46
+ const onlyNumber = (_a = value === null || value === void 0 ? void 0 : value.replace(/\D/g, "")) !== null && _a !== void 0 ? _a : "";
47
+ return onlyNumber === "" ? 1 : Math.max(1, Number(onlyNumber));
48
+ } }) })] }), _jsxs(Flex, { gap: 2, children: [_jsx(Form.Item, { label: "Position X", name: "x", className: "w-full", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { label: "Position Y", name: "y", className: "w-full", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { label: "Rotation", name: "rotation", className: "w-full", children: _jsx(InputNumber, { suffix: "\u00B0", min: 0, max: 360, parser: (value) => {
49
+ if (!value)
50
+ return 0;
51
+ const num = Number(value.replace(/\D/g, ""));
52
+ if (Number.isNaN(num))
53
+ return 0;
54
+ return Math.min(360, Math.max(0, num));
55
+ } }) })] }), _jsxs(Flex, { gap: 2, children: [_jsx(Form.Item, { label: "Fill", name: "fill", getValueFromEvent: (color) => color.toHexString(), className: "w-full ", children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) }), _jsx(Form.Item, { label: "Stroke", name: "stroke", getValueFromEvent: (color) => color.toHexString(), className: "w-full ", children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) })] }), _jsxs(Flex, { children: [_jsx(Form.Item, { label: "Stroke", name: "strokeWidth", className: "w-full", children: _jsx(InputNumber, {}) }), !(shape === null || shape === void 0 ? void 0 : shape.includes("circle")) && (_jsx(Form.Item, { label: "Radius", name: "radius", className: "w-full", children: _jsx(InputNumber, { suffix: "px", parser: (value) => {
56
+ var _a;
57
+ const onlyNumber = (_a = value === null || value === void 0 ? void 0 : value.replace(/\D/g, "")) !== null && _a !== void 0 ? _a : "";
58
+ return onlyNumber === "" ? 1 : Math.max(1, Number(onlyNumber));
59
+ } }) })), _jsx(Form.Item, { label: "opacity", name: "opacity", className: "w-full", children: _jsx(InputNumber, { step: 0.1, max: 1, min: 0, parser: (value) => {
60
+ if (value === undefined || value === null || value === "")
61
+ return null;
62
+ const cleaned = value.replace(/[^0-9.]/g, "");
63
+ const num = Number(cleaned);
64
+ if (Number.isNaN(num))
65
+ return null;
66
+ return Math.min(1, Math.max(0, num));
67
+ } }) })] })] }));
68
+ };
69
+ 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;
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState, useEffect } from "react";
4
+ import { Input, Button, Flex, Form } from "antd";
5
+ import { ArrowRight, ArrowLeft } from "lucide-react";
6
+ const NumberIndicator = ({ name, defaultValue, onChange }) => {
7
+ const [value, setValue] = useState(0);
8
+ const form = Form.useFormInstance();
9
+ useEffect(() => {
10
+ if (defaultValue) {
11
+ setValue(defaultValue);
12
+ form.setFieldsValue({ [name]: defaultValue });
13
+ }
14
+ }, [defaultValue]);
15
+ const handlePrev = () => {
16
+ setValue(value - 1);
17
+ form.setFieldsValue({ [name]: value - 1 });
18
+ onChange(value - 1);
19
+ };
20
+ const handleNext = () => {
21
+ setValue(value + 1);
22
+ form.setFieldsValue({ [name]: value + 1 });
23
+ onChange(value + 1);
24
+ };
25
+ return (_jsxs(Flex, { gap: 2, children: [_jsx(Button, { onClick: handlePrev, children: _jsx(ArrowLeft, {}) }), _jsx(Form.Item, { name: name, noStyle: true, children: _jsx(Input, { className: "flex text-center", type: "number", value: value, name: name, onChange: (e) => setValue(parseInt(e.target.value)) }) }), _jsx(Button, { onClick: handleNext, children: _jsx(ArrowRight, {}) })] }));
26
+ };
27
+ export default NumberIndicator;
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  type JoystickPosition = {
3
2
  x: number;
4
3
  y: number;
@@ -8,5 +7,5 @@ type JoystickProps = {
8
7
  onMove?: (pos: JoystickPosition) => void;
9
8
  onEnd?: () => void;
10
9
  };
11
- export declare const Joystick: ({ size, onMove, onEnd, }: JoystickProps) => React.JSX.Element;
10
+ export declare const Joystick: ({ size, onMove, onEnd, }: JoystickProps) => import("react/jsx-runtime").JSX.Element;
12
11
  export {};
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // Joystick.tsx
3
+ import { useRef, useState } from "react";
4
+ export const Joystick = ({ size = 120, onMove, onEnd, }) => {
5
+ const baseRef = useRef(null);
6
+ const [position, setPosition] = useState({ x: 0, y: 0 });
7
+ const handleMove = (e) => {
8
+ const base = baseRef.current;
9
+ if (!base)
10
+ return;
11
+ const rect = base.getBoundingClientRect();
12
+ const isTouch = "touches" in e;
13
+ const clientX = isTouch ? e.touches[0].clientX : e.clientX;
14
+ const clientY = isTouch ? e.touches[0].clientY : e.clientY;
15
+ const centerX = rect.left + rect.width / 2;
16
+ const centerY = rect.top + rect.height / 2;
17
+ const dx = clientX - centerX;
18
+ const dy = clientY - centerY;
19
+ const distance = Math.min(Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2)), size / 2 - 20);
20
+ const angle = Math.atan2(dy, dx);
21
+ const x = Math.cos(angle) * distance;
22
+ const y = Math.sin(angle) * distance;
23
+ setPosition({ x, y });
24
+ onMove === null || onMove === void 0 ? void 0 : onMove({ x, y });
25
+ };
26
+ const handleEnd = () => {
27
+ setPosition({ x: 0, y: 0 });
28
+ onEnd === null || onEnd === void 0 ? void 0 : onEnd();
29
+ };
30
+ return (_jsx("div", { ref: baseRef, onMouseMove: (e) => e.buttons === 1 && handleMove(e), onMouseUp: handleEnd, onMouseLeave: handleEnd, onTouchMove: handleMove, onTouchEnd: handleEnd, style: {
31
+ width: size,
32
+ height: size,
33
+ background: "#ddd",
34
+ borderRadius: "50%",
35
+ position: "relative",
36
+ touchAction: "none",
37
+ userSelect: "none",
38
+ }, children: _jsx("div", { onMouseDown: handleMove, onTouchStart: handleMove, style: {
39
+ width: 40,
40
+ height: 40,
41
+ background: "#3E97FF",
42
+ borderRadius: "50%",
43
+ position: "absolute",
44
+ left: `calc(50% + ${position.x}px - 20px)`,
45
+ top: `calc(50% + ${position.y}px - 20px)`,
46
+ touchAction: "none",
47
+ } }) }));
48
+ };
@@ -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;