seat-editor 3.3.22 → 3.3.23
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/constant.d.ts +634 -0
- package/dist/app/constant.js +5590 -5602
- package/dist/app/new-board/page.jsx +3 -2
- package/dist/components/layer-v3/index.jsx +1 -1
- package/dist/features/panel/index.jsx +3 -3
- package/package.json +1 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import SeatEditor from "../../features/package";
|
|
4
|
+
import { data4 } from "../constant";
|
|
4
5
|
export default function NewBoard() {
|
|
5
6
|
const [initialValue, setInitialValue] = useState([]);
|
|
6
7
|
const [extraComponents, setExtraComponents] = useState([]);
|
|
7
8
|
const [backgroundColor, setBackgroundColor] = useState("#000000");
|
|
8
9
|
const [viewOnly, setViewOnly] = useState(false);
|
|
9
10
|
useEffect(() => {
|
|
10
|
-
setInitialValue(
|
|
11
|
+
setInitialValue(data4);
|
|
11
12
|
setExtraComponents([]);
|
|
12
13
|
}, []);
|
|
13
14
|
const handleUploadImage = (file) => {
|
|
@@ -47,7 +48,7 @@ export default function NewBoard() {
|
|
|
47
48
|
{viewOnly ? "Edit Mode ddd" : "View Mode"}
|
|
48
49
|
</button> */}
|
|
49
50
|
<div className="flex-1 h-full">
|
|
50
|
-
<SeatEditor componentProps={
|
|
51
|
+
<SeatEditor componentProps={initialValue} viewOnly={viewOnly} dragOnly={true} deleteAutorized={{
|
|
51
52
|
component: true,
|
|
52
53
|
extraComponent: true,
|
|
53
54
|
}} action={handleUploadImage} mappingKey="properties" onCurrentStateChange={(setState) => {
|
|
@@ -398,7 +398,7 @@ const Layers = ({ components, selectedComponent, activeTool, selectionLines, })
|
|
|
398
398
|
{/* Seats */}
|
|
399
399
|
<rect width={width} height={height} rx={radius} {...commonProps} fill={fill}/>
|
|
400
400
|
<g key={`${id}-seats`} data-seat={`${id}-seats`}>
|
|
401
|
-
{seats === null || seats === void 0 ? void 0 : seats.map(({ d, id }, i) => (<path key={`${id}-seat-${i}`} id={`seat-${id}`} d={d} fill=
|
|
401
|
+
{seats === null || seats === void 0 ? void 0 : seats.map(({ d, id }, i) => (<path key={`${id}-seat-${i}`} id={`seat-${id}`} d={d} fill={seatFill}/>))}
|
|
402
402
|
</g>
|
|
403
403
|
<g transform={`rotate(${-rotation}, ${width / 2}, ${height / 2})`}>
|
|
404
404
|
{labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
|
|
@@ -93,11 +93,11 @@ const ControlPanels = (props) => {
|
|
|
93
93
|
}
|
|
94
94
|
}, [tool, show]);
|
|
95
95
|
const createShape = (shape, props = {}) => {
|
|
96
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
96
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
97
97
|
const defaults = (_a = SEAT_SHAPES[shape]) !== null && _a !== void 0 ? _a : {};
|
|
98
98
|
return Object.assign(Object.assign(Object.assign({}, defaults), props), { shape: (_b = props.shape) !== null && _b !== void 0 ? _b : shape, height: (_c = adjustHeightWidthForSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props)) === null || _c === void 0 ? void 0 : _c.height, width: (_d = adjustHeightWidthForSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props)) === null || _d === void 0 ? void 0 : _d.width, fill: props.fill, seatCount: getSeatCount(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props), seatPositions: getSeatPosition(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape, props), openSpace: isSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape) ? (_e = props.openSpace) !== null && _e !== void 0 ? _e : 0 : undefined, seatFill: isSeatShape(shape !== null && shape !== void 0 ? shape : props === null || props === void 0 ? void 0 : props.shape)
|
|
99
|
-
?
|
|
100
|
-
: undefined, text: shape === "text" ? (
|
|
99
|
+
? props.seatFill
|
|
100
|
+
: undefined, text: shape === "text" ? (_f = props.text) !== null && _f !== void 0 ? _f : defaults.text : undefined, fontColor: shape === "text" ? (_g = props.fontColor) !== null && _g !== void 0 ? _g : defaults.fontColor : undefined, radius: props.radius });
|
|
101
101
|
};
|
|
102
102
|
const debouncedSyncComponents = useRef(debounce((data) => {
|
|
103
103
|
dispatch({ type: "board/setFlagChange", payload: true });
|