seat-editor 3.0.0 → 3.0.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 +55 -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/chair.d.ts +1 -1
- package/dist/app/only-view/chair.js +10 -2
- package/dist/app/only-view/page.d.ts +1 -1
- package/dist/app/only-view/page.jsx +101 -0
- package/dist/app/only-view/user.d.ts +1 -1
- package/dist/app/only-view/user.js +10 -2
- package/dist/app/page.d.ts +1 -1
- package/dist/app/page.jsx +13 -0
- package/dist/app/test/page.d.ts +2 -1
- package/dist/app/test/{page.js → page.jsx} +5 -3
- package/dist/app/v2/page.d.ts +1 -1
- package/dist/app/v2/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 +383 -0
- package/dist/components/layer-v2/index.d.ts +1 -1
- package/dist/components/layer-v2/index.jsx +370 -0
- package/dist/components/layer-v3/index.d.ts +1 -1
- package/dist/components/layer-v3/{index.js → index.jsx} +242 -102
- package/dist/components/layer-v4/index.d.ts +1 -1
- package/dist/components/layer-v4/{index.js → index.jsx} +157 -80
- 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} +90 -31
- package/dist/features/board-v2/index.d.ts +2 -1
- package/dist/features/board-v2/{index.js → index.jsx} +101 -39
- package/dist/features/board-v3/index copy.d.ts +2 -1
- package/dist/features/board-v3/{index copy.js → index copy.jsx } +128 -50
- package/dist/features/board-v3/index.d.ts +2 -1
- package/dist/features/board-v3/{index.js → index.jsx} +110 -32
- package/dist/features/navbar/index.d.ts +1 -1
- package/dist/features/navbar/index.jsx +5 -0
- package/dist/features/package/index.d.ts +1 -1
- 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} +25 -7
- package/dist/features/panel/select-tool.d.ts +1 -1
- package/dist/features/panel/{select-tool.js → select-tool.jsx} +23 -10
- package/dist/features/panel/selected-group.d.ts +1 -1
- package/dist/features/panel/selected-group.jsx +47 -0
- 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/table-seat-square.d.ts +1 -1
- package/dist/features/panel/table-seat-square.jsx +46 -0
- package/dist/features/panel/text-tool.d.ts +1 -1
- package/dist/features/panel/text-tool.jsx +26 -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} +120 -98
- package/dist/features/view-only/index.d.ts +1 -1
- package/dist/features/view-only/{index.js → index.jsx} +38 -31
- package/dist/features/view-only-2/index.d.ts +1 -1
- package/dist/features/view-only-2/{index.js → index.jsx} +16 -13
- package/dist/features/view-only-3/index.d.ts +1 -1
- package/dist/features/view-only-3/{index.js → index.jsx} +46 -27
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- 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 -33
- package/dist/app/only-view/page.js +0 -78
- package/dist/app/page.js +0 -8
- package/dist/app/v2/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 -295
- package/dist/components/layer-v2/index.js +0 -282
- package/dist/components/modal-preview/index.js +0 -10
- package/dist/features/navbar/index.js +0 -6
- package/dist/features/panel/selected-group.js +0 -7
- package/dist/features/panel/table-seat-circle.js +0 -9
- package/dist/features/panel/table-seat-square.js +0 -9
- package/dist/features/panel/text-tool.js +0 -7
- package/dist/provider/antd-provider.js +0 -43
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { ReduxProvider } from "./redux-provider";
|
|
4
3
|
import { AntdProvider } from "./antd-provider";
|
|
5
4
|
import { injectSeatEditorCSS } from "../utils/injectCss";
|
|
6
5
|
export const StoreProvider = ({ children, themeColor = "red", }) => {
|
|
7
6
|
injectSeatEditorCSS();
|
|
8
|
-
return (
|
|
7
|
+
return (<ReduxProvider>
|
|
8
|
+
<AntdProvider themeColor={themeColor}>{children}</AntdProvider>
|
|
9
|
+
</ReduxProvider>);
|
|
9
10
|
};
|
package/package.json
CHANGED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
|
-
import SeatEditor from "../../features/package";
|
|
5
|
-
import { extraComponent } from "../constant";
|
|
6
|
-
import { data4 } from "../constant";
|
|
7
|
-
export default function NewBoard() {
|
|
8
|
-
const [initialValue, setInitialValue] = useState([]);
|
|
9
|
-
const [extraComponents, setExtraComponents] = useState([]);
|
|
10
|
-
const [backgroundColor, setBackgroundColor] = useState("#000000");
|
|
11
|
-
const [viewOnly, setViewOnly] = useState(true);
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
setInitialValue(data4);
|
|
14
|
-
setExtraComponents(extraComponent);
|
|
15
|
-
}, []);
|
|
16
|
-
return (_jsx(_Fragment, { children: _jsxs("div", { className: "w-full h-screen flex flex-col relative justify-center", children: [_jsx("div", { className: "w-full h-[1000px] bg-white border-r border-gray-200" }), _jsx("div", { className: "flex-1 h-full", children: _jsx(SeatEditor, { componentProps: initialValue, viewOnly: false, dragOnly: true, deleteAutorized: {
|
|
17
|
-
component: true,
|
|
18
|
-
extraComponent: true,
|
|
19
|
-
}, mappingKey: "properties", onCurrentStateChange: (setState) => {
|
|
20
|
-
var _a, _b, _c, _d;
|
|
21
|
-
if (((_a = setState === null || setState === void 0 ? void 0 : setState.components) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
22
|
-
setInitialValue((_b = setState === null || setState === void 0 ? void 0 : setState.components) !== null && _b !== void 0 ? _b : []);
|
|
23
|
-
}
|
|
24
|
-
if (setState === null || setState === void 0 ? void 0 : setState.backgroundColor) {
|
|
25
|
-
setBackgroundColor(setState === null || setState === void 0 ? void 0 : setState.backgroundColor);
|
|
26
|
-
}
|
|
27
|
-
if (((_c = setState === null || setState === void 0 ? void 0 : setState.extraComponents) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
28
|
-
setExtraComponents((_d = setState === null || setState === void 0 ? void 0 : setState.extraComponents) !== null && _d !== void 0 ? _d : []);
|
|
29
|
-
}
|
|
30
|
-
}, extraComponentProps: extraComponents, defaultBackground: backgroundColor,
|
|
31
|
-
// dragOnly={true}
|
|
32
|
-
statusKey: "status" }) })] }) }));
|
|
33
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
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
|
-
const Card = (item) => {
|
|
11
|
-
const handleDragStart = (e) => {
|
|
12
|
-
// Jangan preventDefault di drag start
|
|
13
|
-
e.dataTransfer.setData("application/json", JSON.stringify(item));
|
|
14
|
-
e.dataTransfer.effectAllowed = "move";
|
|
15
|
-
};
|
|
16
|
-
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 })] }));
|
|
17
|
-
};
|
|
18
|
-
const TouchScrollDetect = () => {
|
|
19
|
-
const refLayer = useRef(null);
|
|
20
|
-
const [open, setOpen] = useState(false);
|
|
21
|
-
const [table, setTable] = useState(null);
|
|
22
|
-
const handleZoomIn = () => {
|
|
23
|
-
var _a, _b;
|
|
24
|
-
(_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);
|
|
25
|
-
};
|
|
26
|
-
const handleZoomOut = () => {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
(_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();
|
|
29
|
-
};
|
|
30
|
-
const handleSwitch = (e, data) => {
|
|
31
|
-
setOpen(!open);
|
|
32
|
-
setTable(data);
|
|
33
|
-
};
|
|
34
|
-
const handleDrop = (e, data) => {
|
|
35
|
-
e.preventDefault();
|
|
36
|
-
setOpen(!open);
|
|
37
|
-
setTable(data);
|
|
38
|
-
};
|
|
39
|
-
const handleSelectTable = (item) => {
|
|
40
|
-
setOpen(!open);
|
|
41
|
-
setTable(item);
|
|
42
|
-
};
|
|
43
|
-
const renderModal = () => {
|
|
44
|
-
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 }) }) }));
|
|
45
|
-
};
|
|
46
|
-
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: "status", defaultBackground: "#000000", mappingKey: "properties", componentProps: data4, onDrop: (e, data) => handleDrop(e, data), onSwitch: (e, data) => handleSwitch(e, data), extraComponentProps: [], onSelectComponent: (component) => {
|
|
47
|
-
handleSelectTable(component);
|
|
48
|
-
}, dragTableBlockKey: [
|
|
49
|
-
{
|
|
50
|
-
key: "is_lock",
|
|
51
|
-
value: 1,
|
|
52
|
-
},
|
|
53
|
-
], tableMatchKey: [
|
|
54
|
-
{
|
|
55
|
-
key: 0,
|
|
56
|
-
properties: { fill: "white" },
|
|
57
|
-
},
|
|
58
|
-
], eventMatchTable: [
|
|
59
|
-
{
|
|
60
|
-
event: "mouseenter",
|
|
61
|
-
properties: { fill: "red" },
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
event: "selected",
|
|
65
|
-
properties: { fill: "white" },
|
|
66
|
-
},
|
|
67
|
-
], iconTags: [
|
|
68
|
-
{
|
|
69
|
-
icon: _jsx(ChairIcon, {}),
|
|
70
|
-
key: "chair",
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
icon: _jsx(UserIcon, {}),
|
|
74
|
-
key: "user",
|
|
75
|
-
},
|
|
76
|
-
] })] })] })] }));
|
|
77
|
-
};
|
|
78
|
-
export default TouchScrollDetect;
|
package/dist/app/page.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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;
|
package/dist/app/v2/page.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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;
|
|
@@ -1,11 +0,0 @@
|
|
|
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,7 +0,0 @@
|
|
|
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, {}) }), _jsx(Form.Item, { name: [field.name, "fontSize"], label: "Size", children: _jsx(InputNumber, { suffix: "px" }) })] })] }, field.key))), _jsxs(Flex, { gap: 2, children: [_jsx(Button, { type: "primary", onClick: () => add(), 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" })] }));
|
|
6
|
-
};
|
|
7
|
-
export default SectionLabel;
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
const SectionShape = ({ allowChangeShape = true, }) => {
|
|
5
|
-
const optionsShape = [
|
|
6
|
-
{
|
|
7
|
-
value: "circle",
|
|
8
|
-
label: "Circle",
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
value: "square",
|
|
12
|
-
label: "Square",
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
value: "table-seat-circle",
|
|
16
|
-
label: "Table Seat Circle",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
label: "Image Table",
|
|
20
|
-
value: "image-table",
|
|
21
|
-
},
|
|
22
|
-
];
|
|
23
|
-
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" }) }), _jsx(Form.Item, { label: "Height", name: "height", className: "w-full", children: _jsx(InputNumber, { suffix: "px" }) })] }), _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, {}) })] }), _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 Width", name: "strokeWidth", className: "w-full", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { label: "opacity", name: "opacity", className: "w-full", children: _jsx(InputNumber, { step: 0.1, max: 1, min: 0 }) })] })] }));
|
|
24
|
-
};
|
|
25
|
-
export default SectionShape;
|
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { createElement as _createElement } from "react";
|
|
3
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
|
-
import { useRef } from "react";
|
|
5
|
-
import { omit } from "lodash";
|
|
6
|
-
const Layers = ({ shadowShape, components, onClick, selectedComponent, selectedTable, activeTool, onMouseDown, onMouseUp, onBlur, selectedTableColor, mode = "edit", style, onTouchEnd, onTouchMove, onTouchStart }) => {
|
|
7
|
-
const refItemTemp = useRef(null);
|
|
8
|
-
const handleOnHover = (item) => {
|
|
9
|
-
if (mode === "edit") {
|
|
10
|
-
refItemTemp.current = item;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
const renderShadowShape = (item) => {
|
|
14
|
-
const { id, x, y, width, height, fill, opacity, rotation, shape, fontColor, text, seatFill, labels, } = item;
|
|
15
|
-
const commonProps = { fill, opacity };
|
|
16
|
-
switch (shape) {
|
|
17
|
-
case "square":
|
|
18
|
-
return (_jsx("rect", Object.assign({ x: x, y: y, width: width, height: height }, commonProps), id));
|
|
19
|
-
case "circle":
|
|
20
|
-
return (_jsx("circle", Object.assign({ cx: x + width / 2, cy: y + height / 2, r: width / 2 }, commonProps), id));
|
|
21
|
-
case "diamond":
|
|
22
|
-
return (_jsx("rect", Object.assign({ x: x, y: y, width: width, height: height, transform: `rotate(${rotation}, ${x}, ${y})` }, commonProps), id));
|
|
23
|
-
case "table-seat-circle": {
|
|
24
|
-
const seatCount = item.seatCount;
|
|
25
|
-
const openSpace = item.openSpace; // nilai antara 0 (tidak ada ruang) sampai maksimal ~0.9
|
|
26
|
-
const centerX = x + width / 2;
|
|
27
|
-
const centerY = y + height / 2;
|
|
28
|
-
const radius = width;
|
|
29
|
-
const seatRadius = width / 4;
|
|
30
|
-
const fullAngle = 2 * Math.PI;
|
|
31
|
-
const availableAngle = fullAngle * (1 - openSpace); // sudut yang dipakai untuk kursi
|
|
32
|
-
const angleStart = (fullAngle - availableAngle) / 2; // agar tetap seimbang
|
|
33
|
-
const angleStep = availableAngle / seatCount;
|
|
34
|
-
const seatCircles = Array.from({ length: seatCount }, (_, i) => {
|
|
35
|
-
const angle = angleStart + i * angleStep;
|
|
36
|
-
const cx = centerX + radius * Math.cos(angle);
|
|
37
|
-
const cy = centerY + radius * Math.sin(angle);
|
|
38
|
-
return { cx, cy };
|
|
39
|
-
});
|
|
40
|
-
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) => {
|
|
41
|
-
var _a, _b, _c, _d;
|
|
42
|
-
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}`));
|
|
43
|
-
}), _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));
|
|
44
|
-
}
|
|
45
|
-
case "table-seat-square": {
|
|
46
|
-
const seatCount = item.seatCount || 6;
|
|
47
|
-
const openSpace = item.openSpace || 0; // from 0 to 0.9
|
|
48
|
-
const seatRadius = width / 6;
|
|
49
|
-
// split seats evenly on top and bottom
|
|
50
|
-
const seatCountPerSide = Math.ceil(seatCount / 2);
|
|
51
|
-
const availableWidth = width * (1 - openSpace);
|
|
52
|
-
const startX = x + (width * openSpace) / 2;
|
|
53
|
-
const spacing = seatCountPerSide > 1 ? availableWidth / (seatCountPerSide - 1) : 0;
|
|
54
|
-
const topSeats = Array.from({ length: seatCountPerSide }, (_, i) => ({
|
|
55
|
-
cx: startX + i * spacing,
|
|
56
|
-
cy: y - seatRadius * 1.5,
|
|
57
|
-
}));
|
|
58
|
-
const bottomSeats = Array.from({ length: seatCount - seatCountPerSide }, // in case it's odd
|
|
59
|
-
(_, i) => ({
|
|
60
|
-
cx: startX + i * spacing,
|
|
61
|
-
cy: y + height + seatRadius * 1.5,
|
|
62
|
-
}));
|
|
63
|
-
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));
|
|
64
|
-
}
|
|
65
|
-
case "text":
|
|
66
|
-
return (_jsxs("g", { onClick: () => {
|
|
67
|
-
onClick && onClick(item);
|
|
68
|
-
}, 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));
|
|
69
|
-
case "ruler":
|
|
70
|
-
return (_jsxs("g", { children: [_jsx("rect", { x: x - (window.innerWidth * 3) / 2, y: y, width: window.innerWidth * 3, height: 1, fill: "black" }), _jsx("rect", { x: x, y: y - (window.innerHeight * 3) / 2, width: 1, height: window.innerHeight * 3, fill: "black" })] }, id));
|
|
71
|
-
default:
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
const renderShape = (item) => {
|
|
76
|
-
const { id, x, y, width, height, fill, opacity, rotation = 0, shape, text, stroke, strokeWidth, labels, fontSize, fontColor, label, seatFill, src, } = item;
|
|
77
|
-
const commonProps = {
|
|
78
|
-
fill,
|
|
79
|
-
opacity,
|
|
80
|
-
stroke,
|
|
81
|
-
strokeWidth,
|
|
82
|
-
onMouseDown: (e) => {
|
|
83
|
-
onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(e, item || refItemTemp.current);
|
|
84
|
-
},
|
|
85
|
-
onMouseEnter: (e) => {
|
|
86
|
-
// e.stopPropagation();
|
|
87
|
-
handleOnHover === null || handleOnHover === void 0 ? void 0 : handleOnHover(item);
|
|
88
|
-
},
|
|
89
|
-
onClick: (e) => {
|
|
90
|
-
// e.stopPropagation();
|
|
91
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(item);
|
|
92
|
-
},
|
|
93
|
-
onMouseUp: (e) => {
|
|
94
|
-
// e.stopPropagation();
|
|
95
|
-
onMouseUp === null || onMouseUp === void 0 ? void 0 : onMouseUp(e);
|
|
96
|
-
},
|
|
97
|
-
onBlur: (e) => {
|
|
98
|
-
// e.stopPropagation();
|
|
99
|
-
onBlur === null || onBlur === void 0 ? void 0 : onBlur();
|
|
100
|
-
},
|
|
101
|
-
onTouchMove: (e) => {
|
|
102
|
-
// e.stopPropagation();
|
|
103
|
-
onTouchMove === null || onTouchMove === void 0 ? void 0 : onTouchMove(e);
|
|
104
|
-
},
|
|
105
|
-
onTouchStart: (e) => {
|
|
106
|
-
// e.stopPropagation();
|
|
107
|
-
onTouchStart === null || onTouchStart === void 0 ? void 0 : onTouchStart(e, item);
|
|
108
|
-
},
|
|
109
|
-
onTouchEnd: (e) => {
|
|
110
|
-
// e.stopPropagation();
|
|
111
|
-
onTouchEnd === null || onTouchEnd === void 0 ? void 0 : onTouchEnd(e);
|
|
112
|
-
},
|
|
113
|
-
onDoubleClick: (e) => {
|
|
114
|
-
// e.stopPropagation();
|
|
115
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(item);
|
|
116
|
-
},
|
|
117
|
-
};
|
|
118
|
-
switch (shape) {
|
|
119
|
-
case "square":
|
|
120
|
-
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) => {
|
|
121
|
-
var _a, _b, _c, _d;
|
|
122
|
-
return (_createElement("text", Object.assign({}, omit(commonProps, ["opacity", "stroke", "strokeWidth"]), { key: `${id}-label-${index}`, 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) => {
|
|
123
|
-
e.stopPropagation();
|
|
124
|
-
onClick && onClick(item);
|
|
125
|
-
} }), _ === null || _ === void 0 ? void 0 : _.label));
|
|
126
|
-
})] }, id));
|
|
127
|
-
case "circle":
|
|
128
|
-
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) => {
|
|
129
|
-
var _a, _b, _c, _d;
|
|
130
|
-
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) => {
|
|
131
|
-
e.stopPropagation();
|
|
132
|
-
onClick && onClick(item);
|
|
133
|
-
}, children: _ === null || _ === void 0 ? void 0 : _.label }, `${id}-label-${index}`));
|
|
134
|
-
})] }, id));
|
|
135
|
-
case "diamond":
|
|
136
|
-
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));
|
|
137
|
-
case "table-seat-circle": {
|
|
138
|
-
const seatCount = item.seatCount;
|
|
139
|
-
const openSpace = item.openSpace; // nilai antara 0 (tidak ada ruang) sampai maksimal ~0.9
|
|
140
|
-
const centerX = x + width / 2;
|
|
141
|
-
const centerY = y + height / 2;
|
|
142
|
-
const radius = width;
|
|
143
|
-
const seatRadius = width / 4;
|
|
144
|
-
const fullAngle = 2 * Math.PI;
|
|
145
|
-
const availableAngle = fullAngle * (1 - openSpace); // sudut yang dipakai untuk kursi
|
|
146
|
-
const angleStart = (fullAngle - availableAngle) / 2; // agar tetap seimbang
|
|
147
|
-
const angleStep = availableAngle / seatCount;
|
|
148
|
-
const seatCircles = Array.from({ length: seatCount }, (_, i) => {
|
|
149
|
-
const angle = angleStart + i * angleStep;
|
|
150
|
-
const cx = centerX + radius * Math.cos(angle);
|
|
151
|
-
const cy = centerY + radius * Math.sin(angle);
|
|
152
|
-
return { cx, cy };
|
|
153
|
-
});
|
|
154
|
-
return (_jsxs("g", { transform: `rotate(${rotation} ${x + width / 2} ${y + height / 2})`, children: [_jsx("circle", Object.assign({ cx: centerX, style: Object.assign({ cursor: mode === "view" ? "pointer" : "default" }, style), cy: centerY, r: width - 15, fill: selectedTableColor !== null && selectedTableColor !== void 0 ? selectedTableColor : fill }, 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) => {
|
|
155
|
-
var _a, _b, _c, _d;
|
|
156
|
-
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) => {
|
|
157
|
-
e.stopPropagation();
|
|
158
|
-
onClick && onClick(item);
|
|
159
|
-
}, children: _ === null || _ === void 0 ? void 0 : _.label }, `${id}-label-${index}`));
|
|
160
|
-
}), _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));
|
|
161
|
-
}
|
|
162
|
-
case "table-seat-square": {
|
|
163
|
-
const seatCount = item.seatCount || 6;
|
|
164
|
-
const openSpace = item.openSpace || 0; // from 0 to 0.9
|
|
165
|
-
const seatRadius = width / 6;
|
|
166
|
-
// split seats evenly on top and bottom
|
|
167
|
-
const seatCountPerSide = Math.ceil(seatCount / 2);
|
|
168
|
-
const availableWidth = width * (1 - openSpace);
|
|
169
|
-
const startX = x + (width * openSpace) / 2;
|
|
170
|
-
const spacing = seatCountPerSide > 1 ? availableWidth / (seatCountPerSide - 1) : 0;
|
|
171
|
-
const topSeats = Array.from({ length: seatCountPerSide }, (_, i) => ({
|
|
172
|
-
cx: startX + i * spacing,
|
|
173
|
-
cy: y - seatRadius * 1.5,
|
|
174
|
-
}));
|
|
175
|
-
const bottomSeats = Array.from({ length: seatCount - seatCountPerSide }, // in case it's odd
|
|
176
|
-
(_, i) => ({
|
|
177
|
-
cx: startX + i * spacing,
|
|
178
|
-
cy: y + height + seatRadius * 1.5,
|
|
179
|
-
}));
|
|
180
|
-
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));
|
|
181
|
-
}
|
|
182
|
-
case "text":
|
|
183
|
-
return (_jsxs("g", { children: [_jsx("rect", { x: x, y: y, width: width, height: height, fill: "transparent", opacity: opacity, onClick: (e) => {
|
|
184
|
-
e.stopPropagation();
|
|
185
|
-
onClick && onClick(item);
|
|
186
|
-
} }), _jsx("text", Object.assign({ x: x + width / 2, y: y + height / 2, textAnchor: "middle", dominantBaseline: "middle", fill: fontColor, fontSize: fontSize !== null && fontSize !== void 0 ? fontSize : height * 0.6, opacity: opacity }, omit(commonProps, ["fill", "opacity"]), { children: text }))] }, id));
|
|
187
|
-
case "image-table":
|
|
188
|
-
case "background":
|
|
189
|
-
return (_jsxs("g", { onClick: () => {
|
|
190
|
-
onClick && onClick(item);
|
|
191
|
-
}, children: [_jsx("image", Object.assign({ href: src, x: x, y: y, width: width, height: height, transform: `rotate(${rotation} ${x + width / 2} ${y + height / 2})` }, commonProps)), labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
|
|
192
|
-
var _a, _b, _c, _d;
|
|
193
|
-
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));
|
|
194
|
-
})] }, id));
|
|
195
|
-
default:
|
|
196
|
-
return _jsx("g", {}, id);
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
let date = new Date();
|
|
200
|
-
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: [[
|
|
201
|
-
"square",
|
|
202
|
-
"circle",
|
|
203
|
-
"diamond",
|
|
204
|
-
"text",
|
|
205
|
-
"background",
|
|
206
|
-
"image-table",
|
|
207
|
-
].includes(selectedComponent.shape) && (_jsxs("g", { children: [_jsx("rect", { x: selectedComponent.x - 25 - ((selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.strokeWidth) || 0), y: selectedComponent.y - 25 - ((selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.strokeWidth) || 0), width: 20, height: 20, fill: "black", stroke: "white", strokeWidth: "2",
|
|
208
|
-
// transform={`scale(${selectedComponent.scale})`}
|
|
209
|
-
onMouseDown: (e) => {
|
|
210
|
-
e.stopPropagation();
|
|
211
|
-
onMouseDown(e, selectedComponent, "top-left");
|
|
212
|
-
}, onTouchStart: (e) => {
|
|
213
|
-
e.stopPropagation();
|
|
214
|
-
onTouchStart(e, selectedComponent, "top-left");
|
|
215
|
-
}, onTouchMove: (e) => {
|
|
216
|
-
e.stopPropagation();
|
|
217
|
-
onTouchMove(e);
|
|
218
|
-
} }), _jsx("rect", { x: selectedComponent.x + (selectedComponent.width - 15) / 2, y: selectedComponent.y - 25 - ((selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.strokeWidth) || 0), width: 20, height: 20, fill: "black", stroke: "white", strokeWidth: "2", onMouseDown: (e) => {
|
|
219
|
-
e.stopPropagation();
|
|
220
|
-
onMouseDown(e, selectedComponent, "top-center");
|
|
221
|
-
}, onTouchStart: (e) => {
|
|
222
|
-
e.stopPropagation();
|
|
223
|
-
onTouchStart(e, selectedComponent, "top-center");
|
|
224
|
-
}, onTouchMove: (e) => {
|
|
225
|
-
e.stopPropagation();
|
|
226
|
-
onTouchMove(e);
|
|
227
|
-
} }), _jsx("rect", { x: selectedComponent.x - 25 - ((selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.strokeWidth) || 0), y: selectedComponent.y + (selectedComponent.height - 15) / 2, width: 20, height: 20, fill: "black", stroke: "white", strokeWidth: "2", onMouseDown: (e) => {
|
|
228
|
-
e.stopPropagation();
|
|
229
|
-
onMouseDown(e, selectedComponent, "left-center");
|
|
230
|
-
}, onTouchStart: (e) => {
|
|
231
|
-
e.stopPropagation();
|
|
232
|
-
onTouchStart(e, selectedComponent, "left-center");
|
|
233
|
-
}, onTouchMove: (e) => {
|
|
234
|
-
e.stopPropagation();
|
|
235
|
-
onTouchMove(e);
|
|
236
|
-
} }), _jsx("rect", { x: selectedComponent.x + selectedComponent.width + 5 + ((selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.strokeWidth) || 0), y: selectedComponent.y - 25 - ((selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.strokeWidth) || 0), width: 20, height: 20, fill: "black", stroke: "white", strokeWidth: "2", onMouseDown: (e) => {
|
|
237
|
-
e.stopPropagation();
|
|
238
|
-
onMouseDown(e, selectedComponent, "top-right");
|
|
239
|
-
}, onTouchStart: (e) => {
|
|
240
|
-
e.stopPropagation();
|
|
241
|
-
onTouchStart(e, selectedComponent, "top-right");
|
|
242
|
-
}, onTouchMove: (e) => {
|
|
243
|
-
e.stopPropagation();
|
|
244
|
-
onTouchMove(e);
|
|
245
|
-
} }), _jsx("rect", { x: selectedComponent.x + selectedComponent.width + 5 + ((selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.strokeWidth) || 0), y: selectedComponent.y + selectedComponent.height + 5 + ((selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.strokeWidth) || 0), width: 20, height: 20, fill: "black", stroke: "white", strokeWidth: "2", onMouseDown: (e) => {
|
|
246
|
-
e.stopPropagation();
|
|
247
|
-
onMouseDown(e, selectedComponent, "bottom-right");
|
|
248
|
-
}, onTouchStart: (e) => {
|
|
249
|
-
e.stopPropagation();
|
|
250
|
-
onTouchStart(e, selectedComponent, "bottom-right");
|
|
251
|
-
}, onTouchMove: (e) => {
|
|
252
|
-
e.stopPropagation();
|
|
253
|
-
onTouchMove(e);
|
|
254
|
-
} }), _jsx("rect", { x: selectedComponent.x + (selectedComponent.width - 15) / 2, y: selectedComponent.y + selectedComponent.height + 5 + ((selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.strokeWidth) || 0), width: 20, height: 20, fill: "black", stroke: "white", strokeWidth: "2", onMouseDown: (e) => {
|
|
255
|
-
e.stopPropagation();
|
|
256
|
-
onMouseDown(e, selectedComponent, "bottom-center");
|
|
257
|
-
}, onTouchStart: (e) => {
|
|
258
|
-
e.stopPropagation();
|
|
259
|
-
onTouchStart(e, selectedComponent, "bottom-center");
|
|
260
|
-
}, onTouchMove: (e) => {
|
|
261
|
-
e.stopPropagation();
|
|
262
|
-
onTouchMove(e);
|
|
263
|
-
} }), _jsx("rect", { x: selectedComponent.x + selectedComponent.width + 5 + ((selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.strokeWidth) || 0), y: selectedComponent.y + (selectedComponent.height - 15) / 2, width: 20, height: 20, fill: "black", stroke: "white", strokeWidth: "2", onMouseDown: (e) => {
|
|
264
|
-
e.stopPropagation();
|
|
265
|
-
onMouseDown(e, selectedComponent, "right-center");
|
|
266
|
-
}, onTouchStart: (e) => {
|
|
267
|
-
e.stopPropagation();
|
|
268
|
-
onTouchStart(e, selectedComponent, "right-center");
|
|
269
|
-
}, onTouchMove: (e) => {
|
|
270
|
-
e.stopPropagation();
|
|
271
|
-
onTouchMove(e);
|
|
272
|
-
} }), _jsx("rect", { x: selectedComponent.x - 25 - ((selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.strokeWidth) || 0), y: selectedComponent.y + selectedComponent.height + 5 + ((selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.strokeWidth) || 0), width: 20, height: 20, fill: "black", stroke: "white", strokeWidth: "2", onMouseDown: (e) => {
|
|
273
|
-
e.stopPropagation();
|
|
274
|
-
onMouseDown(e, selectedComponent, "bottom-left");
|
|
275
|
-
}, onTouchStart: (e) => {
|
|
276
|
-
e.stopPropagation();
|
|
277
|
-
onTouchStart(e, selectedComponent, "bottom-left");
|
|
278
|
-
}, onTouchMove: (e) => {
|
|
279
|
-
e.stopPropagation();
|
|
280
|
-
onTouchMove(e);
|
|
281
|
-
} })] }, `${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) => {
|
|
282
|
-
e.stopPropagation();
|
|
283
|
-
onMouseDown(e, selectedComponent, "top-left");
|
|
284
|
-
} }), _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) => {
|
|
285
|
-
e.stopPropagation();
|
|
286
|
-
onMouseDown(e, selectedComponent, "top-right");
|
|
287
|
-
} }), _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) => {
|
|
288
|
-
e.stopPropagation();
|
|
289
|
-
onMouseDown(e, selectedComponent, "bottom-right");
|
|
290
|
-
} }), _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) => {
|
|
291
|
-
e.stopPropagation();
|
|
292
|
-
onMouseDown(e, selectedComponent, "b-left");
|
|
293
|
-
} })] }, selectedComponent.id))] }))] }, `${date}`));
|
|
294
|
-
};
|
|
295
|
-
export default Layers;
|