seat-editor 1.6.11 → 1.6.13
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/test/page.d.ts +1 -0
- package/dist/app/test/page.js +43 -0
- package/dist/app/v2/page.d.ts +2 -0
- package/dist/app/v2/page.js +8 -0
- package/dist/components/layer-v2/index.d.ts +19 -0
- package/dist/components/layer-v2/index.js +295 -0
- package/dist/features/board/index.js +2 -2
- package/dist/features/board-v2/board-slice.d.ts +14 -0
- package/dist/features/board-v2/board-slice.js +52 -0
- package/dist/features/board-v2/index.d.ts +6 -0
- package/dist/features/{board/index.jsx → board-v2/index.js} +40 -100
- package/dist/features/package/index.js +1 -1
- package/dist/features/panel/index.js +0 -2
- package/dist/features/side-tool/index.js +13 -1
- package/package.json +1 -1
- package/dist/app/layout.jsx +0 -27
- package/dist/app/new-board/page.jsx +0 -53
- package/dist/app/old-board/page.jsx +0 -510
- package/dist/app/only-view/page.jsx +0 -40
- package/dist/app/page.jsx +0 -13
- package/dist/components/button-tools/index.jsx +0 -17
- package/dist/components/form-tools/label.jsx +0 -44
- package/dist/components/form-tools/shape.jsx +0 -66
- package/dist/components/input/number-indicator.jsx +0 -36
- package/dist/components/joystick/index.jsx +0 -49
- package/dist/components/layer/index.jsx +0 -383
- package/dist/components/lib/index.jsx +0 -33
- package/dist/components/modal-preview/index.jsx +0 -11
- package/dist/features/navbar/index.jsx +0 -5
- package/dist/features/package/index.jsx +0 -114
- package/dist/features/panel/index.jsx +0 -115
- package/dist/features/panel/select-tool.jsx +0 -60
- package/dist/features/panel/square-circle-tool.jsx +0 -10
- package/dist/features/panel/table-seat-circle.jsx +0 -31
- package/dist/features/panel/text-tool.jsx +0 -26
- package/dist/features/panel/upload-tool.jsx +0 -152
- package/dist/features/side-tool/index.jsx +0 -298
- package/dist/features/view/index.jsx +0 -226
- package/dist/features/view-only/index.jsx +0 -204
- package/dist/provider/antd-provider.jsx +0 -46
- package/dist/provider/redux-provider.jsx +0 -6
- package/dist/provider/store-provider.jsx +0 -10
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
3
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
4
|
import { TransformWrapper, TransformComponent, MiniMap, } from "react-zoom-pan-pinch";
|
|
4
5
|
import { useAppSelector, useAppDispatch } from "../../hooks/use-redux";
|
|
5
|
-
import Layers from "../../components/layer";
|
|
6
|
+
import Layers from "../../components/layer-v2";
|
|
6
7
|
import { throttle } from "lodash";
|
|
7
8
|
import ModalPreview from "../../components/modal-preview";
|
|
8
9
|
import LayerView from "../view";
|
|
@@ -137,7 +138,7 @@ const BoardTemplate = ({ onSelectComponent }) => {
|
|
|
137
138
|
fontColor: activeTool === "text" ? "#DADADA" : undefined,
|
|
138
139
|
});
|
|
139
140
|
const handleMouseDown = (e, item, direction) => {
|
|
140
|
-
if (
|
|
141
|
+
if (["node", "select"].includes(activeTool) && item && !direction) {
|
|
141
142
|
startPos.current = { x: e.clientX, y: e.clientY };
|
|
142
143
|
const rectBox = (e === null || e === void 0 ? void 0 : e.target).getBoundingClientRect();
|
|
143
144
|
setDragOffset({
|
|
@@ -165,7 +166,6 @@ const BoardTemplate = ({ onSelectComponent }) => {
|
|
|
165
166
|
isDragging.current = true;
|
|
166
167
|
moveComponent.current = false;
|
|
167
168
|
setResizeDirection(direction);
|
|
168
|
-
console.log({ item });
|
|
169
169
|
if (item) {
|
|
170
170
|
dispatch({ type: "panel/setSelectedComponent", payload: item });
|
|
171
171
|
dispatch({ type: "panel/setShow", payload: true });
|
|
@@ -205,7 +205,7 @@ const BoardTemplate = ({ onSelectComponent }) => {
|
|
|
205
205
|
setShadowShape([]);
|
|
206
206
|
};
|
|
207
207
|
const handleMouseClick = (e) => {
|
|
208
|
-
if (
|
|
208
|
+
if (["select", "node"].includes(activeTool) && selectedComponent) {
|
|
209
209
|
handleUnSelectComponent();
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
@@ -248,7 +248,7 @@ const BoardTemplate = ({ onSelectComponent }) => {
|
|
|
248
248
|
setShadowShape([createShape(x, y, theme === null || theme === void 0 ? void 0 : theme.primaryColor)]);
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
|
-
if (activeTool === "
|
|
251
|
+
if (activeTool === "node" &&
|
|
252
252
|
selectedComponent &&
|
|
253
253
|
moveComponent.current &&
|
|
254
254
|
dragOffset &&
|
|
@@ -258,8 +258,8 @@ const BoardTemplate = ({ onSelectComponent }) => {
|
|
|
258
258
|
const newX = e.clientX - workspaceRect.left - (dragOffset === null || dragOffset === void 0 ? void 0 : dragOffset.x);
|
|
259
259
|
const newY = e.clientY - workspaceRect.top - (dragOffset === null || dragOffset === void 0 ? void 0 : dragOffset.y);
|
|
260
260
|
let newPosition = {
|
|
261
|
-
x: newX,
|
|
262
|
-
y: newY,
|
|
261
|
+
x: newX / scale,
|
|
262
|
+
y: newY / scale,
|
|
263
263
|
};
|
|
264
264
|
requestAnimationFrame(() => {
|
|
265
265
|
setComponentsState((prev) => {
|
|
@@ -386,7 +386,7 @@ const BoardTemplate = ({ onSelectComponent }) => {
|
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
388
|
const handleMouseUp = () => {
|
|
389
|
-
if (
|
|
389
|
+
if (["select", "node"].includes(activeTool) && selectedComponent && isDragging.current) {
|
|
390
390
|
setResizeDirection(null);
|
|
391
391
|
}
|
|
392
392
|
};
|
|
@@ -403,7 +403,7 @@ const BoardTemplate = ({ onSelectComponent }) => {
|
|
|
403
403
|
};
|
|
404
404
|
const handleTouchStart = (e, items, direction) => {
|
|
405
405
|
var _a, _b, _c, _d;
|
|
406
|
-
if (activeTool === "
|
|
406
|
+
if (activeTool === "node" && !direction && items) {
|
|
407
407
|
// dispatch({ type: "panel/setShow", payload: false });
|
|
408
408
|
// setMoveComponent(true);
|
|
409
409
|
moveComponent.current = true;
|
|
@@ -458,7 +458,7 @@ const BoardTemplate = ({ onSelectComponent }) => {
|
|
|
458
458
|
}
|
|
459
459
|
};
|
|
460
460
|
const handleTouchMove = (e) => {
|
|
461
|
-
if (activeTool === "
|
|
461
|
+
if (activeTool === "node" &&
|
|
462
462
|
moveComponent &&
|
|
463
463
|
isTouching.current &&
|
|
464
464
|
!resizeDirection) {
|
|
@@ -607,21 +607,15 @@ const BoardTemplate = ({ onSelectComponent }) => {
|
|
|
607
607
|
}
|
|
608
608
|
};
|
|
609
609
|
const renderMiniMap = () => {
|
|
610
|
-
return (
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
// onMouseUp={handleMouseUp}
|
|
620
|
-
// onBlur={handleUnSelectComponent}
|
|
621
|
-
selectedComponent={selectedComponent}/>
|
|
622
|
-
</svg>
|
|
623
|
-
</div>
|
|
624
|
-
</MiniMap>);
|
|
610
|
+
return (_jsx(MiniMap, { width: 250, height: 250, children: _jsx("div", { className: "w-full h-full", children: _jsx("svg", { id: "workspace", width: "100%", height: "100%", viewBox: `0 0 ${widthBoard} ${heightBoard}`, className: "h-screen w-full", xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid meet", style: {
|
|
611
|
+
background: "#f5f5f5",
|
|
612
|
+
display: "block",
|
|
613
|
+
}, children: _jsx(Layers, { shadowShape: shadowShape, components: [...extraComponentsState, ...componentsState], activeTool: activeTool,
|
|
614
|
+
// onClick={handleSelectComponent}
|
|
615
|
+
// onMouseDown={handleMouseDown}
|
|
616
|
+
// onMouseUp={handleMouseUp}
|
|
617
|
+
// onBlur={handleUnSelectComponent}
|
|
618
|
+
selectedComponent: selectedComponent }) }) }) }));
|
|
625
619
|
};
|
|
626
620
|
const handelZoomIn = () => {
|
|
627
621
|
var _a;
|
|
@@ -647,80 +641,26 @@ const BoardTemplate = ({ onSelectComponent }) => {
|
|
|
647
641
|
// moveComponent &&
|
|
648
642
|
// isTouching.current &&
|
|
649
643
|
// !resizeDirection
|
|
650
|
-
return (
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
width: "100%",
|
|
672
|
-
height: "100%",
|
|
673
|
-
}}>
|
|
674
|
-
<svg id="workspace" ref={svgRef} width="100%" height="100%" viewBox={`0 0 ${widthBoard} ${heightBoard}`} className="h-screen" onMouseUp={handleMouseUp} onMouseMove={handleMouseMove} onMouseEnter={handleMouseEnter} onClick={(e) => {
|
|
675
|
-
e.stopPropagation();
|
|
676
|
-
handleMouseClick(e);
|
|
677
|
-
}} onMouseLeave={handleMouseLeave} xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet" style={{
|
|
678
|
-
background: backgroundColor,
|
|
679
|
-
display: "block",
|
|
680
|
-
cursor: activeTool === "ruler" ? "crosshair" : "auto",
|
|
681
|
-
}}>
|
|
682
|
-
<Layers shadowShape={shadowShape} components={[...extraComponentsState, ...componentsState]} style={{
|
|
683
|
-
cursor: getCursorStyle(),
|
|
684
|
-
}}
|
|
685
|
-
// onClick={handleSelectComponent}
|
|
686
|
-
onMouseDown={handleMouseDown}
|
|
687
|
-
// onMouseUp={handleMouseUp}
|
|
688
|
-
onBlur={handleUnSelectComponent} selectedComponent={selectedComponent} activeTool={activeTool} onTouchStart={(e, item, direction) => handleTouchStart(e, item, direction)} onTouchMove={(e) => handleTouchMove(e)} onTouchEnd={handleTouchEnd}/>
|
|
689
|
-
{activeTool === "ruler" && (<>
|
|
690
|
-
<g id="horizontal-ruler">
|
|
691
|
-
<rect x="0" y="0" width={window.innerWidth} height="30" fill="#e0e0e0"/>
|
|
692
|
-
<g stroke="#888" font-size="10" text-anchor="middle">
|
|
693
|
-
{Array.from({ length: window.innerWidth / 50 }, (_, i) => (<g key={i}>
|
|
694
|
-
<line x1={i * 50} y1="0" x2={i * 50} y2="10"/>
|
|
695
|
-
<text x={i * 50} y="15">
|
|
696
|
-
{i * 50}
|
|
697
|
-
</text>
|
|
698
|
-
</g>))}
|
|
699
|
-
</g>
|
|
700
|
-
</g>
|
|
701
|
-
<g id="vertical-ruler">
|
|
702
|
-
<rect x="0" y="0" width="30" height={window.innerHeight} fill="#e0e0e0"/>
|
|
703
|
-
<g stroke="#888" font-size="10" text-anchor="middle">
|
|
704
|
-
{Array.from({ length: window.innerHeight / 10 }, (_, i) => (<g key={i}>
|
|
705
|
-
<line x1="0" y1={i * 50} x2="10" y2={i * 50}/>
|
|
706
|
-
<text x="15" y={i * 50}>
|
|
707
|
-
{i * 50}
|
|
708
|
-
</text>
|
|
709
|
-
</g>))}
|
|
710
|
-
</g>
|
|
711
|
-
</g>
|
|
712
|
-
</>)}
|
|
713
|
-
{grid && (<g stroke="#ddd" strokeWidth={0.5}>
|
|
714
|
-
{/* Vertical lines */}
|
|
715
|
-
{Array.from({ length: widthBoard / 10 }, (_, i) => (<line key={`v-${i}`} x1={i * 10} y1={0} x2={i * 10} y2={heightBoard}/>))}
|
|
716
|
-
|
|
717
|
-
{/* Horizontal lines */}
|
|
718
|
-
{Array.from({ length: heightBoard / 10 }, (_, i) => (<line key={`h-${i}`} x1={0} y1={i * 10} x2={widthBoard} y2={i * 10}/>))}
|
|
719
|
-
</g>)}
|
|
720
|
-
</svg>
|
|
721
|
-
</TransformComponent>
|
|
722
|
-
</TransformWrapper>
|
|
723
|
-
</div>
|
|
724
|
-
</>);
|
|
644
|
+
return (_jsxs(_Fragment, { children: [_jsx(ModalPreview, { children: _jsx(LayerView, { statusKey: "status" }) }), _jsxs("div", { className: "relative w-full h-screen flex-1 overflow-hidden", ref: containerRef, children: [_jsx("div", { className: "absolute bottom-5 left-1/2 transform -translate-x-1/2 z-10", children: _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { icon: _jsx(ZoomIn, {}), onClick: handelZoomIn }), _jsx(Button, { icon: _jsx(ZoomOut, {}), onClick: handleZoomOut })] }) }), _jsxs(TransformWrapper, { ref: transformRef, panning: { disabled: ["node", "select"].includes(activeTool) }, centerZoomedOut: true, onTransformed: ({ state: { scale } }) => setScale(scale), minScale: 1, maxScale: 1000, initialScale: 1, pinch: { step: 1 }, smooth: true, doubleClick: { step: 1, disabled: activeTool === "select" }, disablePadding: true, children: [scale > 1 && (_jsx("div", { className: "absolute bottom-[60px] left-1/2 transform -translate-x-1/2 z-10", children: renderMiniMap() })), _jsx(TransformComponent, { wrapperStyle: {
|
|
645
|
+
width: "100%",
|
|
646
|
+
height: "100%",
|
|
647
|
+
overflow: "hidden",
|
|
648
|
+
}, contentStyle: {
|
|
649
|
+
width: "100%",
|
|
650
|
+
height: "100%",
|
|
651
|
+
}, children: _jsxs("svg", { id: "workspace", ref: svgRef, width: "100%", height: "100%", viewBox: `0 0 ${widthBoard} ${heightBoard}`, className: "h-screen", onMouseUp: handleMouseUp, onMouseMove: handleMouseMove, onMouseEnter: handleMouseEnter, onClick: (e) => {
|
|
652
|
+
e.stopPropagation();
|
|
653
|
+
handleMouseClick(e);
|
|
654
|
+
}, onMouseLeave: handleMouseLeave, xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid meet", style: {
|
|
655
|
+
background: backgroundColor,
|
|
656
|
+
display: "block",
|
|
657
|
+
cursor: activeTool === "ruler" ? "crosshair" : "auto",
|
|
658
|
+
}, children: [_jsx(Layers, { shadowShape: shadowShape, components: [...extraComponentsState, ...componentsState], style: {
|
|
659
|
+
cursor: getCursorStyle(),
|
|
660
|
+
},
|
|
661
|
+
// onClick={handleSelectComponent}
|
|
662
|
+
onMouseDown: handleMouseDown,
|
|
663
|
+
// onMouseUp={handleMouseUp}
|
|
664
|
+
onBlur: handleUnSelectComponent, selectedComponent: selectedComponent, activeTool: activeTool, onTouchStart: (e, item, direction) => handleTouchStart(e, item, direction), onTouchMove: (e) => handleTouchMove(e) }), activeTool === "ruler" && (_jsxs(_Fragment, { children: [_jsxs("g", { id: "horizontal-ruler", children: [_jsx("rect", { x: "0", y: "0", width: window.innerWidth, height: "30", fill: "#e0e0e0" }), _jsx("g", { stroke: "#888", "font-size": "10", "text-anchor": "middle", children: Array.from({ length: window.innerWidth / 50 }, (_, i) => (_jsxs("g", { children: [_jsx("line", { x1: i * 50, y1: "0", x2: i * 50, y2: "10" }), _jsx("text", { x: i * 50, y: "15", children: i * 50 })] }, i))) })] }), _jsxs("g", { id: "vertical-ruler", children: [_jsx("rect", { x: "0", y: "0", width: "30", height: window.innerHeight, fill: "#e0e0e0" }), _jsx("g", { stroke: "#888", "font-size": "10", "text-anchor": "middle", children: Array.from({ length: window.innerHeight / 10 }, (_, i) => (_jsxs("g", { children: [_jsx("line", { x1: "0", y1: i * 50, x2: "10", y2: i * 50 }), _jsx("text", { x: "15", y: i * 50, children: i * 50 })] }, i))) })] })] })), grid && (_jsxs("g", { stroke: "#ddd", strokeWidth: 0.5, children: [Array.from({ length: widthBoard / 10 }, (_, i) => (_jsx("line", { x1: i * 10, y1: 0, x2: i * 10, y2: heightBoard }, `v-${i}`))), Array.from({ length: heightBoard / 10 }, (_, i) => (_jsx("line", { x1: 0, y1: i * 10, x2: widthBoard, y2: i * 10 }, `h-${i}`)))] }))] }) })] })] })] }));
|
|
725
665
|
};
|
|
726
666
|
export default BoardTemplate;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
|
-
import Board from "../board";
|
|
4
|
+
import Board from "../board-v2";
|
|
5
5
|
import SideTool from "../side-tool";
|
|
6
6
|
import ControlPanels from "../panel";
|
|
7
7
|
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
@@ -57,9 +57,7 @@ const ControlPanels = (props) => {
|
|
|
57
57
|
};
|
|
58
58
|
const handleChangeComponent = (values, allValues) => {
|
|
59
59
|
const { shape } = allValues, restProps = __rest(allValues, ["shape"]);
|
|
60
|
-
console.log({ allValues });
|
|
61
60
|
const newValues = createShape(shape, restProps);
|
|
62
|
-
console.log({ newValues });
|
|
63
61
|
dispatch({
|
|
64
62
|
type: "board/updateComponent",
|
|
65
63
|
payload: Object.assign(Object.assign({}, (selectedComponent || {})), newValues),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Circle, CopyPlus, Eye, EyeOff, Image, Layers2, MousePointer, PaintBucket, Ratio, SquareMousePointer, Trash, Type, Upload, Hand, Layers, Ruler, Grid } from "lucide-react";
|
|
3
|
+
import { Circle, CopyPlus, Eye, EyeOff, Image, Layers2, MousePointer, PaintBucket, Ratio, SquareMousePointer, Trash, Type, Upload, Hand, Layers, Ruler, Grid, MousePointer2 } from "lucide-react";
|
|
4
4
|
import ButtonTools from "../../components/button-tools";
|
|
5
5
|
import { Divider, ColorPicker, Button, } from "antd";
|
|
6
6
|
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
@@ -27,6 +27,11 @@ const SideTool = ({ dragOnly }) => {
|
|
|
27
27
|
id: "ruler",
|
|
28
28
|
name: "Ruler",
|
|
29
29
|
icon: _jsx(Ruler, {}),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "node",
|
|
33
|
+
name: "Node Tool",
|
|
34
|
+
icon: _jsx(MousePointer2, {}),
|
|
30
35
|
}
|
|
31
36
|
];
|
|
32
37
|
const actionsTools = [
|
|
@@ -84,6 +89,13 @@ const SideTool = ({ dragOnly }) => {
|
|
|
84
89
|
// }
|
|
85
90
|
];
|
|
86
91
|
const hanldeSelectTool = (id) => {
|
|
92
|
+
if (active === id) {
|
|
93
|
+
dispatch({
|
|
94
|
+
type: "tool/setActiveTool",
|
|
95
|
+
payload: "",
|
|
96
|
+
});
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
87
99
|
if (id === "background" || id === "image-table") {
|
|
88
100
|
dispatch({
|
|
89
101
|
type: "panel/setShow",
|
package/package.json
CHANGED
package/dist/app/layout.jsx
DELETED
|
@@ -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,53 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import SeatEditor from "../../features/package";
|
|
4
|
-
import { constantData } from "../constant";
|
|
5
|
-
export default function NewBoard() {
|
|
6
|
-
const [initialValue, setInitialValue] = useState([]);
|
|
7
|
-
const [extraComponents, setExtraComponents] = useState([]);
|
|
8
|
-
const [viewOnly, setViewOnly] = useState(true);
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
setInitialValue(constantData);
|
|
11
|
-
setExtraComponents([{
|
|
12
|
-
src: "https://d3l3j4e3k9p181.cloudfront.net/dev/5bf923de-2366-4a11-9b8b-e92de0afbf05/3a65cb36-7d85-4c38-9403-a15f94641920/68d45207-d66b-4bb5-92a2-4e5a87715e98/rsvp/1751350513582817819_download (10).jpg",
|
|
13
|
-
id: 1747388267450,
|
|
14
|
-
x: 0,
|
|
15
|
-
y: 0,
|
|
16
|
-
shape: "background",
|
|
17
|
-
width: 100,
|
|
18
|
-
height: 100,
|
|
19
|
-
}]);
|
|
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
|
-
extraComponentProps={[]}
|
|
28
|
-
defaultBackground="#ffffff"
|
|
29
|
-
// dragOnly={true}
|
|
30
|
-
statusKey="status"
|
|
31
|
-
|
|
32
|
-
/> */}
|
|
33
|
-
{/* </div> */}
|
|
34
|
-
<button className="bg-blue-500 text-white px-4 py-2 rounded" onClick={() => setViewOnly(!viewOnly)}>
|
|
35
|
-
{viewOnly ? "Edit Mode" : "View Mode"}
|
|
36
|
-
</button>
|
|
37
|
-
<div className="flex-1 h-full">
|
|
38
|
-
<SeatEditor componentProps={initialValue} viewOnly={viewOnly} dragOnly mappingKey="properties" onCurrentStateChange={(setState) => {
|
|
39
|
-
var _a, _b, _c, _d;
|
|
40
|
-
if (((_a = setState === null || setState === void 0 ? void 0 : setState.components) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
41
|
-
setInitialValue((_b = setState === null || setState === void 0 ? void 0 : setState.components) !== null && _b !== void 0 ? _b : []);
|
|
42
|
-
}
|
|
43
|
-
if (((_c = setState === null || setState === void 0 ? void 0 : setState.extraComponents) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
44
|
-
setExtraComponents((_d = setState === null || setState === void 0 ? void 0 : setState.extraComponents) !== null && _d !== void 0 ? _d : []);
|
|
45
|
-
}
|
|
46
|
-
}} extraComponentProps={extraComponents} defaultBackground="#ffffff"
|
|
47
|
-
// dragOnly={true}
|
|
48
|
-
statusKey="status"/>
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
</div>
|
|
52
|
-
</>);
|
|
53
|
-
}
|