seat-editor 1.5.0 → 1.5.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.
- package/dist/app/layout.d.ts +1 -1
- package/dist/app/{layout.js → layout.jsx} +7 -2
- package/dist/app/new-board/page.d.ts +1 -1
- package/dist/app/new-board/page.jsx +57 -0
- package/dist/app/old-board/page.d.ts +2 -1
- package/dist/app/old-board/{page.js → page.jsx} +215 -82
- package/dist/app/only-view/page.d.ts +1 -1
- package/dist/app/only-view/{page.js → page.jsx} +1 -2
- package/dist/app/page.d.ts +1 -1
- package/dist/app/page.jsx +13 -0
- package/dist/components/button-tools/index.d.ts +1 -1
- package/dist/components/button-tools/index.jsx +17 -0
- package/dist/components/form-tools/label.d.ts +1 -1
- package/dist/components/form-tools/label.jsx +44 -0
- package/dist/components/form-tools/shape.d.ts +1 -1
- package/dist/components/form-tools/shape.jsx +66 -0
- package/dist/components/input/number-indicator.d.ts +1 -1
- package/dist/components/input/{number-indicator.js → number-indicator.jsx} +11 -2
- package/dist/components/joystick/index.d.ts +2 -1
- package/dist/components/joystick/{index.js → index.jsx} +14 -13
- package/dist/components/layer/index.d.ts +1 -1
- package/dist/components/layer/index.jsx +364 -0
- package/dist/components/lib/index.d.ts +1 -1
- package/dist/components/lib/{index.js → index.jsx} +7 -2
- package/dist/components/modal-preview/index.d.ts +1 -1
- package/dist/components/modal-preview/index.jsx +11 -0
- package/dist/features/board/index.d.ts +1 -1
- package/dist/features/board/{index.js → index.jsx} +127 -72
- package/dist/features/navbar/index.d.ts +1 -1
- package/dist/features/navbar/index.jsx +5 -0
- package/dist/features/package/index.d.ts +2 -2
- package/dist/features/package/{index.js → index.jsx} +16 -6
- package/dist/features/panel/index.d.ts +1 -1
- package/dist/features/panel/{index.js → index.jsx} +15 -7
- package/dist/features/panel/select-tool.d.ts +1 -1
- package/dist/features/panel/{select-tool.js → select-tool.jsx} +16 -7
- package/dist/features/panel/square-circle-tool.d.ts +1 -1
- package/dist/features/panel/{square-circle-tool.js → square-circle-tool.jsx} +4 -2
- package/dist/features/panel/table-seat-circle.d.ts +1 -1
- package/dist/features/panel/table-seat-circle.jsx +31 -0
- package/dist/features/panel/text-tool.d.ts +1 -1
- package/dist/features/panel/text-tool.jsx +22 -0
- package/dist/features/panel/upload-tool.d.ts +1 -1
- package/dist/features/panel/{upload-tool.js → upload-tool.jsx} +24 -2
- package/dist/features/side-tool/index.d.ts +1 -1
- package/dist/features/side-tool/{index.js → index.jsx} +86 -69
- package/dist/features/view/index.d.ts +1 -1
- package/dist/features/view/{index.js → index.jsx} +40 -31
- package/dist/provider/antd-provider.jsx +46 -0
- package/dist/provider/redux-provider.d.ts +1 -1
- package/dist/provider/{redux-provider.js → redux-provider.jsx} +1 -2
- package/dist/provider/store-provider.d.ts +1 -1
- package/dist/provider/{store-provider.js → store-provider.jsx} +3 -2
- package/package.json +1 -1
- package/dist/app/new-board/page.js +0 -31
- package/dist/app/page.js +0 -8
- package/dist/components/button-tools/index.js +0 -11
- package/dist/components/form-tools/label.js +0 -7
- package/dist/components/form-tools/shape.js +0 -25
- package/dist/components/layer/index.js +0 -276
- package/dist/components/modal-preview/index.js +0 -10
- package/dist/features/navbar/index.js +0 -6
- package/dist/features/panel/table-seat-circle.js +0 -9
- package/dist/features/panel/text-tool.js +0 -7
- package/dist/provider/antd-provider.js +0 -43
package/dist/app/layout.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import localFont from "next/font/local";
|
|
3
2
|
import "./globals.css";
|
|
4
3
|
import { Layout } from "antd";
|
|
@@ -18,5 +17,11 @@ export const metadata = {
|
|
|
18
17
|
description: "Generated by create next app",
|
|
19
18
|
};
|
|
20
19
|
export default function RootLayout({ children, }) {
|
|
21
|
-
return (
|
|
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>);
|
|
22
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function NewBoard(): import("react
|
|
1
|
+
export default function NewBoard(): import("react").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { useEffect, useState } from "react";
|
|
12
|
+
import SeatEditor from "../../features/package";
|
|
13
|
+
import { constantData } from "../constant";
|
|
14
|
+
export default function NewBoard() {
|
|
15
|
+
const [initialValue, setInitialValue] = useState([]);
|
|
16
|
+
const [viewOnly, setViewOnly] = useState(true);
|
|
17
|
+
console.log("constantData", constantData);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setInitialValue(constantData);
|
|
20
|
+
}, []);
|
|
21
|
+
return (<>
|
|
22
|
+
<div className="w-full h-screen flex flex-col relative justify-center">
|
|
23
|
+
{/* <div className="w-full h-[1000px] bg-white border-r border-gray-200"> */}
|
|
24
|
+
{/* <LayerView
|
|
25
|
+
componentProps={initialValue}
|
|
26
|
+
mappingKey="properties"
|
|
27
|
+
onCurrentStateChange={(setState: any) => {
|
|
28
|
+
console.log("setState", setState);
|
|
29
|
+
setInitialValue(setState?.components??[]);
|
|
30
|
+
}}
|
|
31
|
+
extraComponentProps={[]}
|
|
32
|
+
defaultBackground="#ffffff"
|
|
33
|
+
// dragOnly={true}
|
|
34
|
+
statusKey="status"
|
|
35
|
+
action={async (action: any) => {
|
|
36
|
+
console.log("action", action);
|
|
37
|
+
}}
|
|
38
|
+
/> */}
|
|
39
|
+
{/* </div> */}
|
|
40
|
+
<button className="bg-blue-500 text-white px-4 py-2 rounded" onClick={() => setViewOnly(!viewOnly)}>
|
|
41
|
+
{viewOnly ? "Edit Mode" : "View Mode"}
|
|
42
|
+
</button>
|
|
43
|
+
<div className="flex-1 h-full">
|
|
44
|
+
<SeatEditor componentProps={initialValue} viewOnly={viewOnly} mappingKey="properties" onCurrentStateChange={(setState) => {
|
|
45
|
+
var _a;
|
|
46
|
+
console.log("setState", setState);
|
|
47
|
+
setInitialValue((_a = setState === null || setState === void 0 ? void 0 : setState.components) !== null && _a !== void 0 ? _a : []);
|
|
48
|
+
}} extraComponentProps={[]} defaultBackground="#ffffff"
|
|
49
|
+
// dragOnly={true}
|
|
50
|
+
statusKey="status" action={(action) => __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
console.log("action", action);
|
|
52
|
+
})}/>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
</div>
|
|
56
|
+
</>);
|
|
57
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import { useState } from "react";
|
|
2
|
+
import React, { useState } from "react";
|
|
4
3
|
import { Button, Input, Modal } from "antd"; //tes commit
|
|
5
4
|
// aduhuhhusd
|
|
6
5
|
import { Square, MousePointer2, Move3D, Trash, CopyPlusIcon, ZoomInIcon, ZoomOutIcon, DownloadIcon, UploadIcon, Circle, PenIcon, Pencil, } from "lucide-react";
|
|
@@ -293,85 +292,219 @@ const SeatEditor = () => {
|
|
|
293
292
|
// link.click();
|
|
294
293
|
// document.body.removeChild(link);
|
|
295
294
|
};
|
|
296
|
-
return (
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
295
|
+
return (<div className="flex h-screen w-full">
|
|
296
|
+
{/* Toolbar */}
|
|
297
|
+
<div className="w-16 bg-gray-800 text-white flex flex-col items-center py-4 space-y-4">
|
|
298
|
+
{/* Select Tool */}
|
|
299
|
+
<Button type={activeTool === "select" ? "primary" : "default"} shape="circle" icon={<MousePointer2 />} onClick={() => handleToolClick("select")}/>
|
|
300
|
+
<Button type={activeTool === "circle" ? "primary" : "default"} shape="circle" icon={<Circle />} onClick={() => handleToolClick("circle")}/>
|
|
301
|
+
<Button type={activeTool === "vip-seat" ? "primary" : "default"} shape="circle" icon={<PenIcon />} // Use any icon you prefer
|
|
302
|
+
onClick={() => handleToolClick("vip-seat")}/>
|
|
303
|
+
{/* Rectangle Tool */}
|
|
304
|
+
<Button type={activeTool === "rectangle" ? "primary" : "default"} shape="circle" icon={<Square />} onClick={() => handleToolClick("rectangle")}/>
|
|
305
|
+
{/* Node Tool */}
|
|
306
|
+
<Button type={activeTool === "node" ? "primary" : "default"} shape="circle" icon={<Move3D />} onClick={() => handleToolClick("node")}/>
|
|
307
|
+
<Button type={activeTool === "pen" ? "primary" : "default"} shape="circle" icon={<Pencil />} onClick={() => handleToolClick("pen")}/>
|
|
308
|
+
|
|
309
|
+
{/* delete */}
|
|
310
|
+
<Button type="default" shape="circle" icon={<Trash />} onClick={deleteSelectedRectangle}/>
|
|
311
|
+
{/* duplicate */}
|
|
312
|
+
<Button type="default" shape="circle" icon={<CopyPlusIcon />} // You can use a copy icon
|
|
313
|
+
onClick={duplicateRectangle}/>
|
|
314
|
+
{/* zoomIn/out */}
|
|
315
|
+
<Button type="default" shape="circle" onClick={zoomIn} icon={<ZoomInIcon />}/>
|
|
316
|
+
<Button type="default" shape="circle" onClick={zoomOut} icon={<ZoomOutIcon />}/>
|
|
317
|
+
{/* {activeTool === "image" && ( */}
|
|
318
|
+
<UploadIcon />
|
|
319
|
+
<span>Image Seat</span>
|
|
320
|
+
<input type="file" accept="image/*" onChange={handleImageUpload}/>
|
|
321
|
+
<span>Background Image</span>
|
|
322
|
+
<input type="file" accept="image/*" onChange={handleImageUploadBackground}/>
|
|
323
|
+
{/* )} */}
|
|
324
|
+
<Button shape="circle" icon={<DownloadIcon />} onClick={exportJSON}/>
|
|
325
|
+
</div>
|
|
326
|
+
|
|
327
|
+
{/* Workspace */}
|
|
328
|
+
<div className="w-full flex items-center justify-center" id={"workspace"}>
|
|
329
|
+
<div className={`bg-gray-900 relative ${getCursorStyle()} w-full h-screen `} onMouseDown={handleMouseDown} onMouseMove={handleMouseMove} onMouseUp={handleMouseUp} style={{
|
|
330
|
+
transform: `scale(${zoom})`,
|
|
331
|
+
transformOrigin: "0 0",
|
|
332
|
+
}}>
|
|
333
|
+
|
|
334
|
+
{shadowRect && (<div className="absolute border-dashed border-2 border-blue-400" style={{
|
|
335
|
+
left: shadowRect.x,
|
|
336
|
+
top: shadowRect.y,
|
|
337
|
+
width: shadowRect.width,
|
|
338
|
+
height: shadowRect.height,
|
|
339
|
+
backgroundColor: shadowRect.color,
|
|
340
|
+
}}/>)}
|
|
341
|
+
{/* Render rectangles */}
|
|
342
|
+
{rectangles.map((rect) => (<div key={rect.id} onMouseDown={(e) => handleRectangleMouseDown(e, rect)} onDoubleClick={() => handleRectangleDoubleClick(rect)} className={`absolute cursor-move border transition-transform ${(selectedRectangle === null || selectedRectangle === void 0 ? void 0 : selectedRectangle.id) === rect.id
|
|
343
|
+
? "border-black"
|
|
344
|
+
: "border-gray-300"}`} style={{
|
|
345
|
+
left: rect.x,
|
|
346
|
+
top: rect.y,
|
|
347
|
+
width: rect.width,
|
|
348
|
+
height: rect.height,
|
|
349
|
+
backgroundColor: rect.color,
|
|
350
|
+
transform: `rotate(${rect.rotation}deg)`,
|
|
351
|
+
transformOrigin: "center",
|
|
352
|
+
borderRadius: rect.shape === "circle" ? "100%" : "0%",
|
|
353
|
+
}}>
|
|
354
|
+
{rect.shape === "image-table" && (<div className="w-full h-full relative">
|
|
355
|
+
<img src={rect.src} alt="custom" className="w-full h-full object-cover" draggable={false}/>
|
|
356
|
+
<div className="absolute left-0 right-0 flex items-center justify-center" style={{
|
|
357
|
+
top: "10%",
|
|
358
|
+
height: "20%",
|
|
359
|
+
backgroundColor: rect.highlightColor || "transparent",
|
|
360
|
+
}}>
|
|
361
|
+
<span className="text-white font-bold text-xs absolute" style={{
|
|
362
|
+
top: "10%",
|
|
363
|
+
left: "50%",
|
|
364
|
+
}}>
|
|
365
|
+
{rect.table}
|
|
366
|
+
</span>
|
|
367
|
+
</div>
|
|
368
|
+
<span className="text-xs text-white flex items-center justify-center absolute w-full" style={{
|
|
369
|
+
top: "85%",
|
|
370
|
+
left: "50%",
|
|
371
|
+
transform: "translate(-50%, -50%)",
|
|
372
|
+
backgroundColor: rect.highlightColor || "transparent"
|
|
373
|
+
}}>
|
|
374
|
+
{rect.pax}
|
|
375
|
+
</span>
|
|
376
|
+
<div className="absolute left-0 right-0 flex items-center justify-center" style={{
|
|
377
|
+
top: "40%",
|
|
378
|
+
height: "20%",
|
|
379
|
+
backgroundColor: rect.highlightColor || "transparent",
|
|
380
|
+
}}>
|
|
381
|
+
<span className="text-white font-bold text-xs">
|
|
382
|
+
{rect.status}
|
|
383
|
+
</span>
|
|
384
|
+
</div>
|
|
385
|
+
</div>)}
|
|
386
|
+
{rect.shape === "image" && (<img src={rect.src} alt="custom" className="w-full h-full object-cover" draggable={false}/>)}
|
|
387
|
+
{rect.shape === "vip-seat" && (<div className="absolute left-0 right-0 flex items-center justify-center" style={{
|
|
388
|
+
top: "10%",
|
|
389
|
+
height: "20%",
|
|
390
|
+
}}>
|
|
391
|
+
<span className="text-white font-bold text-xs">
|
|
392
|
+
{rect.table}
|
|
393
|
+
</span>
|
|
394
|
+
</div>)}
|
|
395
|
+
{rect.shape === "vip-seat" && (<div className="absolute left-0 right-0 flex items-center justify-center" style={{
|
|
396
|
+
top: "40%",
|
|
397
|
+
height: "20%",
|
|
398
|
+
backgroundColor: rect.highlightColor || "transparent",
|
|
399
|
+
}}>
|
|
400
|
+
<span className="text-white font-bold text-xs">
|
|
401
|
+
{rect.status}
|
|
402
|
+
</span>
|
|
403
|
+
</div>)}
|
|
404
|
+
|
|
405
|
+
{/* Bottom Text */}
|
|
406
|
+
<div className="absolute bottom-2 left-0 right-0 text-center text-white text-sm">
|
|
407
|
+
{rect.shape === "vip-seat" ? "8 Pax" : ""}
|
|
408
|
+
</div>
|
|
409
|
+
|
|
410
|
+
{/* Resize Nodes */}
|
|
411
|
+
{/* Resize Nodes (Only Show When in Node Mode and Item is Selected) */}
|
|
412
|
+
{activeTool === "node" && (selectedRectangle === null || selectedRectangle === void 0 ? void 0 : selectedRectangle.id) === rect.id && (<>
|
|
413
|
+
{/* Top Left */}
|
|
414
|
+
<div className="absolute w-3 h-3 bg-white border border-gray-800" style={{
|
|
415
|
+
top: -6,
|
|
416
|
+
left: -6,
|
|
417
|
+
cursor: "nwse-resize",
|
|
418
|
+
borderRadius: rect.shape === "circle" ? "50%" : "0%",
|
|
419
|
+
}} onMouseDown={() => startResizing("top-left")}/>
|
|
420
|
+
{/* Top Right */}
|
|
421
|
+
<div className="absolute w-3 h-3 bg-white border border-gray-800" style={{
|
|
422
|
+
top: -6,
|
|
423
|
+
right: -6,
|
|
424
|
+
cursor: "nesw-resize",
|
|
425
|
+
borderRadius: rect.shape === "circle" ? "50%" : "0%",
|
|
426
|
+
}} onMouseDown={() => startResizing("top-right")}/>
|
|
427
|
+
{/* Bottom Left */}
|
|
428
|
+
<div className="absolute w-3 h-3 bg-white border border-gray-800" style={{
|
|
429
|
+
bottom: -6,
|
|
430
|
+
left: -6,
|
|
431
|
+
cursor: "nesw-resize",
|
|
432
|
+
borderRadius: rect.shape === "circle" ? "50%" : "0%",
|
|
433
|
+
}} onMouseDown={() => startResizing("bottom-left")}/>
|
|
434
|
+
{/* Bottom Right */}
|
|
435
|
+
<div className="absolute w-3 h-3 bg-white border border-gray-800" style={{
|
|
436
|
+
bottom: -6,
|
|
437
|
+
right: -6,
|
|
438
|
+
cursor: "nwse-resize",
|
|
439
|
+
borderRadius: rect.shape === "circle" ? "50%" : "0%",
|
|
440
|
+
}} onMouseDown={() => startResizing("bottom-right")}/>
|
|
441
|
+
</>)}
|
|
442
|
+
</div>))}
|
|
443
|
+
</div>
|
|
444
|
+
</div>
|
|
445
|
+
|
|
446
|
+
{/* Rectangle Customization Modal */}
|
|
447
|
+
<Modal open={showModal} onCancel={() => setShowModal(false)} onOk={() => setShowModal(false)} title="Edit Rectangle">
|
|
448
|
+
{selectedRectangle && (<>
|
|
449
|
+
<div className="flex gap-4 items-center">
|
|
450
|
+
<div className="flex flex-col">
|
|
451
|
+
<p className="mb-2 font-semibold">Change Color:</p>
|
|
452
|
+
<SketchPicker color={selectedRectangle.color} onChangeComplete={(color) => updateRectangle({ color: color.hex })}/>
|
|
453
|
+
</div>
|
|
454
|
+
<div className="flex flex-col">
|
|
455
|
+
<p className="mt-4 mb-2 font-semibold">Live Preview:</p>
|
|
456
|
+
<div className="relative borderflex items-center justify-center" style={{
|
|
457
|
+
width: selectedRectangle.width,
|
|
458
|
+
height: selectedRectangle.height,
|
|
459
|
+
margin: "0 auto",
|
|
460
|
+
transform: `rotate(${selectedRectangle.rotation}deg)`,
|
|
461
|
+
backgroundColor: selectedRectangle.color,
|
|
462
|
+
transition: "all 0.3s ease",
|
|
463
|
+
scale: "0.5",
|
|
464
|
+
borderRadius: selectedRectangle.shape === "circle" ? "100%" : "0%",
|
|
465
|
+
}}>
|
|
466
|
+
{selectedRectangle.shape === "vip-seat" && (<div className="absolute left-0 right-0 flex items-center justify-center" style={{
|
|
467
|
+
top: "10%",
|
|
468
|
+
height: "20%",
|
|
469
|
+
}}>
|
|
470
|
+
<span className="text-white font-bold text-xs">
|
|
471
|
+
{selectedRectangle.status}sfsdf
|
|
472
|
+
</span>
|
|
473
|
+
</div>)}
|
|
474
|
+
{selectedRectangle.shape === "vip-seat" && (<div className="absolute left-0 right-0 flex items-center justify-center" style={{
|
|
475
|
+
top: "40%",
|
|
476
|
+
height: "20%",
|
|
477
|
+
backgroundColor: selectedRectangle.highlightColor || "transparent",
|
|
478
|
+
}}>
|
|
479
|
+
<span className="text-white font-bold text-xs">
|
|
480
|
+
{selectedRectangle.status} dsdsd
|
|
481
|
+
</span>
|
|
482
|
+
</div>)}
|
|
483
|
+
</div>
|
|
484
|
+
</div>
|
|
485
|
+
</div>
|
|
486
|
+
|
|
487
|
+
{/* Preview Section */}
|
|
488
|
+
|
|
489
|
+
<p className="mt-4 mb-2 font-semibold">Edit Text:</p>
|
|
490
|
+
<Input value={selectedRectangle.pax} onChange={(e) => updateRectangle({ pax: e.target.value })}/>
|
|
491
|
+
<p className="mt-4 mb-2 font-semibold">Edit Label:</p>
|
|
492
|
+
<Input value={selectedRectangle.table} onChange={(e) => updateRectangle({ table: e.target.value })}/>
|
|
493
|
+
<p className="mt-4 mb-2 font-semibold">Edit Highlight:</p>
|
|
494
|
+
<Input value={selectedRectangle.status} onChange={(e) => updateRectangle({ status: e.target.value })}/>
|
|
495
|
+
{/* Rotation Controls */}
|
|
496
|
+
<p className="mt-4 mb-2 font-semibold">Rotate:</p>
|
|
497
|
+
<div className="flex gap-4 items-center">
|
|
498
|
+
<Button onClick={() => rotateRectangle("left")}>
|
|
499
|
+
⟲ Rotate Left
|
|
500
|
+
</Button>
|
|
501
|
+
<span>{selectedRectangle.rotation}°</span>
|
|
502
|
+
<Button onClick={() => rotateRectangle("right")}>
|
|
503
|
+
⟳ Rotate Right
|
|
504
|
+
</Button>
|
|
505
|
+
</div>
|
|
506
|
+
</>)}
|
|
507
|
+
</Modal>
|
|
508
|
+
</div>);
|
|
376
509
|
};
|
|
377
510
|
export default SeatEditor;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const TouchScrollDetect: () => import("react
|
|
1
|
+
declare const TouchScrollDetect: () => import("react").JSX.Element;
|
|
2
2
|
export default TouchScrollDetect;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import LayerView from "@/features/view";
|
|
4
3
|
import { useState, useEffect } from "react";
|
|
5
4
|
import { dataDummy } from "./constant";
|
|
@@ -36,6 +35,6 @@ const TouchScrollDetect = () => {
|
|
|
36
35
|
}
|
|
37
36
|
};
|
|
38
37
|
}, []);
|
|
39
|
-
return (
|
|
38
|
+
return (<LayerView statusKey="status" defaultBackground="#000000" componentProps={dataDummy} extraComponentProps={[]}/>);
|
|
40
39
|
};
|
|
41
40
|
export default TouchScrollDetect;
|
package/dist/app/page.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const TableEditor: () => import("react
|
|
1
|
+
declare const TableEditor: () => import("react").JSX.Element;
|
|
2
2
|
export default TableEditor;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Board from "../features/board";
|
|
2
|
+
import SideTool from "../features/side-tool";
|
|
3
|
+
import ControlPanels from "../features/panel";
|
|
4
|
+
const TableEditor = () => {
|
|
5
|
+
return (<>
|
|
6
|
+
<div className="w-full h-screen flex relative">
|
|
7
|
+
<SideTool />
|
|
8
|
+
<Board />
|
|
9
|
+
<ControlPanels />
|
|
10
|
+
</div>
|
|
11
|
+
</>);
|
|
12
|
+
};
|
|
13
|
+
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
|
|
10
|
+
declare const ButtonTools: (props: ButtonToolsProps) => import("react").JSX.Element;
|
|
11
11
|
export default ButtonTools;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Button, Popover } from "antd";
|
|
3
|
+
const ButtonTools = (props) => {
|
|
4
|
+
const { buttonProps, items, popoverProps } = props;
|
|
5
|
+
if (items.length === 0) {
|
|
6
|
+
return (<Popover trigger="hover" {...popoverProps}>
|
|
7
|
+
<Button {...buttonProps}/>
|
|
8
|
+
</Popover>);
|
|
9
|
+
}
|
|
10
|
+
return (<Popover content={<div>
|
|
11
|
+
<Button>Button 1</Button>
|
|
12
|
+
<Button>Button 2</Button>
|
|
13
|
+
</div>} trigger="click">
|
|
14
|
+
<Button {...buttonProps}/>
|
|
15
|
+
</Popover>);
|
|
16
|
+
};
|
|
17
|
+
export default ButtonTools;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SectionLabel: () => import("react
|
|
1
|
+
declare const SectionLabel: () => import("react").JSX.Element;
|
|
2
2
|
export default SectionLabel;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Button, ColorPicker, Flex, Form, Input, InputNumber } from "antd";
|
|
3
|
+
const SectionLabel = () => {
|
|
4
|
+
return (<div className="py-2">
|
|
5
|
+
<h1 className="heading-s">Section Labeling</h1>
|
|
6
|
+
<Form.Item label="Labels in square" name={"labels"}>
|
|
7
|
+
<Form.List name="labels">
|
|
8
|
+
{(fields, { add, remove }) => (<>
|
|
9
|
+
{fields.map((field) => (<div key={field.key}>
|
|
10
|
+
<Flex gap={2}>
|
|
11
|
+
<Form.Item name={[field.name, "label"]} label="Text">
|
|
12
|
+
<Input />
|
|
13
|
+
</Form.Item>
|
|
14
|
+
<Form.Item name={[field.name, "fontColor"]} label="Color" getValueFromEvent={(color) => color.toHexString()}>
|
|
15
|
+
<ColorPicker allowClear format="hex" defaultFormat="hex"/>
|
|
16
|
+
</Form.Item>
|
|
17
|
+
</Flex>
|
|
18
|
+
<Flex gap={2}>
|
|
19
|
+
<Form.Item name={[field.name, "x"]} label="X">
|
|
20
|
+
<InputNumber />
|
|
21
|
+
</Form.Item>
|
|
22
|
+
<Form.Item name={[field.name, "y"]} label="Y">
|
|
23
|
+
<InputNumber />
|
|
24
|
+
</Form.Item>
|
|
25
|
+
<Form.Item name={[field.name, "fontSize"]} label="Size">
|
|
26
|
+
<InputNumber suffix="px"/>
|
|
27
|
+
</Form.Item>
|
|
28
|
+
</Flex>
|
|
29
|
+
</div>))}
|
|
30
|
+
<Flex gap={2}>
|
|
31
|
+
<Button type="primary" onClick={() => add()} className="btn btn-primary">
|
|
32
|
+
Add
|
|
33
|
+
</Button>
|
|
34
|
+
<Button type="primary" onClick={() => remove(fields.length - 1)} className="btn btn-primary">
|
|
35
|
+
Remove
|
|
36
|
+
</Button>
|
|
37
|
+
</Flex>
|
|
38
|
+
</>)}
|
|
39
|
+
</Form.List>
|
|
40
|
+
</Form.Item>
|
|
41
|
+
<div className="divider-dashed"/>
|
|
42
|
+
</div>);
|
|
43
|
+
};
|
|
44
|
+
export default SectionLabel;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SectionShape: () => import("react
|
|
1
|
+
declare const SectionShape: () => import("react").JSX.Element;
|
|
2
2
|
export default SectionShape;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ColorPicker, Flex, Form, InputNumber, Select } from "antd";
|
|
3
|
+
const SectionShape = () => {
|
|
4
|
+
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: "Table Seat Circle",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: "Image Table",
|
|
19
|
+
value: "image-table",
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
return (<div className="py-2">
|
|
23
|
+
<h1 className="heading-s">Shape</h1>
|
|
24
|
+
<Flex gap={2} className="w-full">
|
|
25
|
+
<Form.Item label="Name" name="shape" className="w-full">
|
|
26
|
+
<Select options={optionsShape} className="w-full"/>
|
|
27
|
+
</Form.Item>
|
|
28
|
+
</Flex>
|
|
29
|
+
<Flex gap={2} className="w-full">
|
|
30
|
+
<Form.Item label="Width" name="width" className="w-full">
|
|
31
|
+
<InputNumber suffix="px"/>
|
|
32
|
+
</Form.Item>
|
|
33
|
+
<Form.Item label="Height" name="height" className="w-full">
|
|
34
|
+
<InputNumber suffix="px"/>
|
|
35
|
+
</Form.Item>
|
|
36
|
+
</Flex>
|
|
37
|
+
<Flex gap={2}>
|
|
38
|
+
<Form.Item label="Position X" name="x" className="w-full">
|
|
39
|
+
<InputNumber />
|
|
40
|
+
</Form.Item>
|
|
41
|
+
<Form.Item label="Position Y" name="y" className="w-full">
|
|
42
|
+
<InputNumber />
|
|
43
|
+
</Form.Item>
|
|
44
|
+
<Form.Item label="Rotation" name="rotation" className="w-full">
|
|
45
|
+
<InputNumber />
|
|
46
|
+
</Form.Item>
|
|
47
|
+
</Flex>
|
|
48
|
+
<Flex gap={2}>
|
|
49
|
+
<Form.Item label="Fill" name={"fill"} getValueFromEvent={(color) => color.toHexString()} className="w-full ">
|
|
50
|
+
<ColorPicker allowClear format="hex" defaultFormat="hex"/>
|
|
51
|
+
</Form.Item>
|
|
52
|
+
<Form.Item label="Stroke" name={"stroke"} getValueFromEvent={(color) => color.toHexString()} className="w-full ">
|
|
53
|
+
<ColorPicker allowClear format="hex" defaultFormat="hex"/>
|
|
54
|
+
</Form.Item>
|
|
55
|
+
</Flex>
|
|
56
|
+
<Flex>
|
|
57
|
+
<Form.Item label="Stroke Width" name={"strokeWidth"} className="w-full">
|
|
58
|
+
<InputNumber />
|
|
59
|
+
</Form.Item>
|
|
60
|
+
<Form.Item label="opacity" name={"opacity"} className="w-full">
|
|
61
|
+
<InputNumber step={0.1} max={1} min={0}/>
|
|
62
|
+
</Form.Item>
|
|
63
|
+
</Flex>
|
|
64
|
+
</div>);
|
|
65
|
+
};
|
|
66
|
+
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
|
|
6
|
+
declare const NumberIndicator: ({ name, defaultValue, onChange }: NumberIndicatorProps) => import("react").JSX.Element;
|
|
7
7
|
export default NumberIndicator;
|