seat-editor 3.4.8 → 3.5.0
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 +1 -1
- package/dist/app/graph-view/page.d.ts +1 -0
- package/dist/app/graph-view/page.js +343 -0
- package/dist/app/graph-view/page.jsx +445 -0
- package/dist/app/graph-view-new/constant.d.ts +581 -0
- package/dist/app/graph-view-new/constant.js +6973 -0
- package/dist/app/graph-view-new/page.d.ts +1 -0
- package/dist/app/graph-view-new/page.js +71 -0
- package/dist/app/graph-view-new/page.jsx +98 -0
- package/dist/app/layout.d.ts +1 -1
- package/dist/app/new-board/page.d.ts +1 -1
- package/dist/app/new-board/page.js +43 -7
- package/dist/app/new-board/page.jsx +45 -12
- package/dist/app/old-board/page.d.ts +1 -2
- package/dist/app/only-view/chair.d.ts +1 -1
- package/dist/app/only-view/chair.js +2 -10
- package/dist/app/only-view/page.d.ts +1 -1
- package/dist/app/only-view/user.d.ts +1 -1
- package/dist/app/only-view/user.js +2 -10
- package/dist/app/page.d.ts +1 -1
- package/dist/app/test/page.d.ts +1 -2
- package/dist/app/v2/page.d.ts +1 -1
- package/dist/components/button-tools/index.d.ts +1 -1
- package/dist/components/button-tools/index.js +7 -5
- package/dist/components/button-tools/index.jsx +21 -9
- package/dist/components/form-tools/label.d.ts +1 -1
- package/dist/components/form-tools/label.js +9 -20
- package/dist/components/form-tools/label.jsx +38 -28
- package/dist/components/form-tools/shape.d.ts +1 -1
- package/dist/components/form-tools/shape.js +5 -5
- package/dist/components/form-tools/shape.jsx +8 -8
- package/dist/components/input/number-indicator.d.ts +1 -1
- package/dist/components/joystick/index.d.ts +1 -2
- package/dist/components/layer/index.d.ts +1 -1
- package/dist/components/layer-v2/index.d.ts +1 -1
- package/dist/components/layer-v3/index.d.ts +1 -1
- package/dist/components/layer-v3/index.js +44 -3
- package/dist/components/layer-v3/index.jsx +120 -3
- package/dist/components/layer-v4/index.d.ts +1 -1
- package/dist/components/layer-v5/constant.d.ts +60 -0
- package/dist/components/layer-v5/constant.js +93 -0
- package/dist/components/layer-v5/index.d.ts +24 -0
- package/dist/components/layer-v5/index.js +927 -0
- package/dist/components/layer-v5/index.jsx +1049 -0
- package/dist/components/lib/index.d.ts +1 -1
- package/dist/components/modal-preview/index.d.ts +1 -1
- package/dist/features/board/index.d.ts +1 -1
- package/dist/features/board-v2/index.d.ts +1 -2
- package/dist/features/board-v3/index.d.ts +1 -1
- package/dist/features/board-v3/index.js +350 -72
- package/dist/features/board-v3/index.jsx +369 -75
- package/dist/features/board-v3/resize-element.js +5 -0
- package/dist/features/board-v3/utils.d.ts +8 -0
- package/dist/features/board-v3/utils.js +23 -7
- package/dist/features/navbar/index.d.ts +1 -1
- package/dist/features/package/index.d.ts +3 -1
- package/dist/features/package/index.js +1 -1
- package/dist/features/package/index.jsx +6 -1
- package/dist/features/panel/index.d.ts +9 -1
- package/dist/features/panel/index.js +160 -38
- package/dist/features/panel/index.jsx +173 -46
- package/dist/features/panel/polygon.d.ts +2 -0
- package/dist/features/panel/polygon.js +44 -0
- package/dist/features/panel/polygon.jsx +70 -0
- package/dist/features/panel/select-tool.d.ts +1 -1
- package/dist/features/panel/select-tool.js +3 -0
- package/dist/features/panel/select-tool.jsx +3 -0
- package/dist/features/panel/selected-group.d.ts +1 -1
- package/dist/features/panel/selected-group.js +24 -26
- package/dist/features/panel/selected-group.jsx +56 -51
- package/dist/features/panel/square-circle-tool.d.ts +1 -1
- package/dist/features/panel/table-seat-circle.d.ts +1 -1
- package/dist/features/panel/table-seat-square.d.ts +1 -1
- package/dist/features/panel/text-tool.d.ts +1 -1
- package/dist/features/panel/text-tool.js +17 -2
- package/dist/features/panel/text-tool.jsx +19 -2
- package/dist/features/panel/upload-tool.d.ts +1 -1
- package/dist/features/panel/upload-tool.js +17 -3
- package/dist/features/panel/upload-tool.jsx +23 -4
- package/dist/features/side-tool/index.d.ts +1 -1
- package/dist/features/side-tool/index.js +43 -6
- package/dist/features/side-tool/index.jsx +47 -10
- package/dist/features/view-only/index.d.ts +1 -1
- package/dist/features/view-only-2/index.d.ts +1 -1
- package/dist/features/view-only-3/index.d.ts +1 -1
- package/dist/features/view-only-4/connect-handle.d.ts +13 -0
- package/dist/features/view-only-4/connect-handle.js +23 -0
- package/dist/features/view-only-4/connect-handle.jsx +30 -0
- package/dist/features/view-only-4/connection-layer.d.ts +21 -0
- package/dist/features/view-only-4/connection-layer.js +219 -0
- package/dist/features/view-only-4/connection-layer.jsx +291 -0
- package/dist/features/view-only-4/index.d.ts +99 -0
- package/dist/features/view-only-4/index.js +684 -0
- package/dist/features/view-only-4/index.jsx +722 -0
- package/dist/features/view-only-4/integration-guide.d.ts +0 -0
- package/dist/features/view-only-4/integration-guide.js +0 -0
- package/dist/features/view-only-4/use-connection-graph.d.ts +41 -0
- package/dist/features/view-only-4/use-connection-graph.js +182 -0
- package/dist/features/view-only-4/utils.d.ts +74 -0
- package/dist/features/view-only-4/utils.js +106 -0
- package/dist/features/view-only-5/connect-handle.d.ts +30 -0
- package/dist/features/view-only-5/connect-handle.js +88 -0
- package/dist/features/view-only-5/connect-handle.jsx +96 -0
- package/dist/features/view-only-5/connection-layer.d.ts +34 -0
- package/dist/features/view-only-5/connection-layer.js +182 -0
- package/dist/features/view-only-5/connection-layer.jsx +265 -0
- package/dist/features/view-only-5/index.d.ts +102 -0
- package/dist/features/view-only-5/index.js +585 -0
- package/dist/features/view-only-5/index.jsx +614 -0
- package/dist/features/view-only-5/use-connection-graph.d.ts +57 -0
- package/dist/features/view-only-5/use-connection-graph.js +196 -0
- package/dist/features/view-only-5/utils.d.ts +52 -0
- package/dist/features/view-only-5/utils.js +80 -0
- package/dist/features/view-only-6/connect-handle.d.ts +13 -0
- package/dist/features/view-only-6/connect-handle.js +20 -0
- package/dist/features/view-only-6/connect-handle.jsx +21 -0
- package/dist/features/view-only-6/connection-layer.d.ts +22 -0
- package/dist/features/view-only-6/connection-layer.js +191 -0
- package/dist/features/view-only-6/connection-layer.jsx +244 -0
- package/dist/features/view-only-6/index.d.ts +99 -0
- package/dist/features/view-only-6/index.js +687 -0
- package/dist/features/view-only-6/index.jsx +724 -0
- package/dist/features/view-only-6/use-connection-graph.d.ts +26 -0
- package/dist/features/view-only-6/use-connection-graph.js +103 -0
- package/dist/features/view-only-6/utils.d.ts +66 -0
- package/dist/features/view-only-6/utils.js +96 -0
- package/dist/features/view-only-7/connect-handle.d.ts +13 -0
- package/dist/features/view-only-7/connect-handle.js +23 -0
- package/dist/features/view-only-7/connect-handle.jsx +30 -0
- package/dist/features/view-only-7/connection-layer.d.ts +22 -0
- package/dist/features/view-only-7/connection-layer.js +165 -0
- package/dist/features/view-only-7/connection-layer.jsx +217 -0
- package/dist/features/view-only-7/index.d.ts +99 -0
- package/dist/features/view-only-7/index.js +687 -0
- package/dist/features/view-only-7/index.jsx +724 -0
- package/dist/features/view-only-7/use-connection-graph.d.ts +26 -0
- package/dist/features/view-only-7/use-connection-graph.js +104 -0
- package/dist/features/view-only-7/utils.d.ts +69 -0
- package/dist/features/view-only-7/utils.js +144 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/provider/redux-provider.d.ts +1 -1
- package/dist/provider/store-provider.d.ts +1 -1
- package/dist/seat-editor.css +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { ColorPicker, Flex, Form, Input, InputNumber, Divider } from "antd";
|
|
3
3
|
const SectionLabel = () => {
|
|
4
4
|
return (<div className="py-2">
|
|
5
5
|
<h1 className="heading-s">Section Labeling</h1>
|
|
6
6
|
<Divider style={{ margin: 4 }}/>
|
|
7
7
|
|
|
8
|
-
<Form.Item label="Labels in table" name={"labels"} className="w-full">
|
|
8
|
+
<Form.Item label="Labels in table" name={["labels", 0, "label"]} className="w-full">
|
|
9
9
|
<Form.List name="labels">
|
|
10
10
|
{(fields, { add, remove }) => (<>
|
|
11
11
|
{fields.map((field) => (<div key={field.key} className="w-full flex-col mb-2">
|
|
@@ -40,33 +40,43 @@ const SectionLabel = () => {
|
|
|
40
40
|
<ColorPicker allowClear format="hex" defaultFormat="hex"/>
|
|
41
41
|
</Form.Item>
|
|
42
42
|
</Flex>
|
|
43
|
-
{fields.length > 1 && (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
{/* {fields.length > 1 && (
|
|
44
|
+
<Flex gap={2} className="w-full">
|
|
45
|
+
<Button
|
|
46
|
+
// type="dashed"
|
|
47
|
+
onClick={() => remove(fields.indexOf(field))}
|
|
48
|
+
className="w-full"
|
|
49
|
+
>
|
|
50
|
+
Remove
|
|
51
|
+
</Button>
|
|
52
|
+
</Flex>
|
|
53
|
+
)} */}
|
|
50
54
|
</div>))}
|
|
51
|
-
<Flex gap={2} className="w-full mt-2">
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
55
|
+
{/* <Flex gap={2} className="w-full mt-2">
|
|
56
|
+
<Button
|
|
57
|
+
// type="dashed"
|
|
58
|
+
onClick={() => remove(fields.length - 1)}
|
|
59
|
+
className="w-full"
|
|
60
|
+
>
|
|
61
|
+
Remove
|
|
62
|
+
</Button>
|
|
63
|
+
<Button
|
|
64
|
+
type="primary"
|
|
65
|
+
onClick={() =>
|
|
66
|
+
add({
|
|
67
|
+
label: "",
|
|
68
|
+
fontColor: "#000000",
|
|
69
|
+
x: 0,
|
|
70
|
+
y: 0,
|
|
71
|
+
fontSize: 12,
|
|
72
|
+
rotation: 0,
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
className="w-full"
|
|
76
|
+
>
|
|
77
|
+
Add
|
|
78
|
+
</Button>
|
|
79
|
+
</Flex> */}
|
|
70
80
|
</>)}
|
|
71
81
|
</Form.List>
|
|
72
82
|
</Form.Item>
|
|
@@ -46,26 +46,26 @@ const SectionShape = ({ allowChangeShape = true, }) => {
|
|
|
46
46
|
const disabled = item.value === "table-seat-rect-circle" && maxSeat > 4;
|
|
47
47
|
return (_jsx(Option, { value: item.value, disabled: disabled, children: item.value === "table-seat-rect-circle" ?
|
|
48
48
|
`Type 5 (only for 4 ${seatKey})` : item.label }, item.value));
|
|
49
|
-
}) }) }) })), _jsxs(Flex, { gap: 2, className: "w-full", children: [_jsx(Form.Item, { label: "Width", name: "width", className: "w-full", children: _jsx(InputNumber, { suffix: "px", controls: true, parser: (value) => {
|
|
49
|
+
}) }) }) })), _jsxs(Flex, { gap: 2, className: "w-full", children: [_jsx(Form.Item, { label: "Width", name: "width", className: "w-full", children: _jsx(InputNumber, { suffix: "px", controls: true, name: "width", step: 1, parser: (value) => {
|
|
50
50
|
var _a;
|
|
51
51
|
const onlyNumber = (_a = value === null || value === void 0 ? void 0 : value.replace(/\D/g, "")) !== null && _a !== void 0 ? _a : "";
|
|
52
52
|
return onlyNumber === "" ? 1 : Math.max(1, Number(onlyNumber));
|
|
53
|
-
} }) }), _jsx(Form.Item, { label: "Height", name: "height", className: "w-full", children: _jsx(InputNumber, { suffix: "px", parser: (value) => {
|
|
53
|
+
} }) }), _jsx(Form.Item, { label: "Height", name: "height", className: "w-full", children: _jsx(InputNumber, { suffix: "px", controls: true, step: 1, name: "height", parser: (value) => {
|
|
54
54
|
var _a;
|
|
55
55
|
const onlyNumber = (_a = value === null || value === void 0 ? void 0 : value.replace(/\D/g, "")) !== null && _a !== void 0 ? _a : "";
|
|
56
56
|
return onlyNumber === "" ? 1 : Math.max(1, Number(onlyNumber));
|
|
57
|
-
} }) }), !(shape === null || shape === void 0 ? void 0 : shape.includes("circle")) && (_jsx(Form.Item, { label: "Radius", name: "radius", className: "w-full", children: _jsx(InputNumber, { suffix: "px", parser: (value) => {
|
|
57
|
+
} }) }), !(shape === null || shape === void 0 ? void 0 : shape.includes("circle")) && (_jsx(Form.Item, { label: "Radius", name: "radius", className: "w-full", children: _jsx(InputNumber, { suffix: "px", name: "radius", parser: (value) => {
|
|
58
58
|
var _a;
|
|
59
59
|
const onlyNumber = (_a = value === null || value === void 0 ? void 0 : value.replace(/\D/g, "")) !== null && _a !== void 0 ? _a : "";
|
|
60
60
|
return onlyNumber === "" ? 1 : Math.max(1, Number(onlyNumber));
|
|
61
|
-
} }) }))] }), _jsxs(Flex, { gap: 2, children: [_jsx(Form.Item, { label: "Position X", name: "x", className: "w-full", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { label: "Position Y", name: "y", className: "w-full", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { label: "Rotation", name: "rotation", className: "w-full", children: _jsx(InputNumber, { suffix: "\u00B0", min: 0, max: 360, parser: (value) => {
|
|
61
|
+
} }) }))] }), _jsxs(Flex, { gap: 2, children: [_jsx(Form.Item, { label: "Position X", name: "x", className: "w-full", children: _jsx(InputNumber, { name: "x", step: 1 }) }), _jsx(Form.Item, { label: "Position Y", name: "y", className: "w-full", children: _jsx(InputNumber, { name: "y", step: 1 }) }), _jsx(Form.Item, { label: "Rotation", name: "rotation", className: "w-full", children: _jsx(InputNumber, { suffix: "\u00B0", min: 0, step: 1, max: 360, name: "rotation", parser: (value) => {
|
|
62
62
|
if (!value)
|
|
63
63
|
return 0;
|
|
64
64
|
const num = Number(value.replace(/\D/g, ""));
|
|
65
65
|
if (Number.isNaN(num))
|
|
66
66
|
return 0;
|
|
67
67
|
return Math.min(360, Math.max(0, num));
|
|
68
|
-
} }) })] }), _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 Fill", name: "stroke", getValueFromEvent: (color) => color.toHexString(), className: "w-full ", children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) }), _jsx(Form.Item, { label: "Stroke", name: "strokeWidth", className: "w-full", children: _jsx(InputNumber, {}) })] }), _jsx(Flex, { children: _jsx(Form.Item, { label: "opacity", name: "opacity", className: "w-full", children: _jsx(InputNumber, { step: 10, max: 100, min: 0, parser: (value) => {
|
|
68
|
+
} }) })] }), _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 Fill", name: "stroke", getValueFromEvent: (color) => color.toHexString(), className: "w-full ", children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) }), _jsx(Form.Item, { label: "Stroke Size", name: "strokeWidth", className: "w-full", children: _jsx(InputNumber, {}) })] }), _jsx(Flex, { children: _jsx(Form.Item, { label: "opacity", name: "opacity", className: "w-full", children: _jsx(InputNumber, { step: 10, max: 100, min: 0, name: "opacity", parser: (value) => {
|
|
69
69
|
if (value === undefined || value === null || value === "")
|
|
70
70
|
return null;
|
|
71
71
|
const cleaned = value.replace(/[^0-9.]/g, "");
|
|
@@ -58,21 +58,21 @@ const SectionShape = ({ allowChangeShape = true, }) => {
|
|
|
58
58
|
</Flex>)}
|
|
59
59
|
<Flex gap={2} className="w-full">
|
|
60
60
|
<Form.Item label="Width" name="width" className="w-full">
|
|
61
|
-
<InputNumber suffix="px" controls parser={(value) => {
|
|
61
|
+
<InputNumber suffix="px" controls name="width" step={1} parser={(value) => {
|
|
62
62
|
var _a;
|
|
63
63
|
const onlyNumber = (_a = value === null || value === void 0 ? void 0 : value.replace(/\D/g, "")) !== null && _a !== void 0 ? _a : "";
|
|
64
64
|
return onlyNumber === "" ? 1 : Math.max(1, Number(onlyNumber));
|
|
65
65
|
}}/>
|
|
66
66
|
</Form.Item>
|
|
67
67
|
<Form.Item label="Height" name="height" className="w-full">
|
|
68
|
-
<InputNumber suffix="px" parser={(value) => {
|
|
68
|
+
<InputNumber suffix="px" controls step={1} name="height" parser={(value) => {
|
|
69
69
|
var _a;
|
|
70
70
|
const onlyNumber = (_a = value === null || value === void 0 ? void 0 : value.replace(/\D/g, "")) !== null && _a !== void 0 ? _a : "";
|
|
71
71
|
return onlyNumber === "" ? 1 : Math.max(1, Number(onlyNumber));
|
|
72
72
|
}}/>
|
|
73
73
|
</Form.Item>
|
|
74
74
|
{!(shape === null || shape === void 0 ? void 0 : shape.includes("circle")) && (<Form.Item label="Radius" name="radius" className="w-full">
|
|
75
|
-
<InputNumber suffix="px" parser={(value) => {
|
|
75
|
+
<InputNumber suffix="px" name="radius" parser={(value) => {
|
|
76
76
|
var _a;
|
|
77
77
|
const onlyNumber = (_a = value === null || value === void 0 ? void 0 : value.replace(/\D/g, "")) !== null && _a !== void 0 ? _a : "";
|
|
78
78
|
return onlyNumber === "" ? 1 : Math.max(1, Number(onlyNumber));
|
|
@@ -81,13 +81,13 @@ const SectionShape = ({ allowChangeShape = true, }) => {
|
|
|
81
81
|
</Flex>
|
|
82
82
|
<Flex gap={2}>
|
|
83
83
|
<Form.Item label="Position X" name="x" className="w-full">
|
|
84
|
-
<InputNumber />
|
|
84
|
+
<InputNumber name="x" step={1}/>
|
|
85
85
|
</Form.Item>
|
|
86
86
|
<Form.Item label="Position Y" name="y" className="w-full">
|
|
87
|
-
<InputNumber />
|
|
87
|
+
<InputNumber name="y" step={1}/>
|
|
88
88
|
</Form.Item>
|
|
89
89
|
<Form.Item label="Rotation" name="rotation" className="w-full">
|
|
90
|
-
<InputNumber suffix="°" min={0} max={360} parser={(value) => {
|
|
90
|
+
<InputNumber suffix="°" min={0} step={1} max={360} name="rotation" parser={(value) => {
|
|
91
91
|
if (!value)
|
|
92
92
|
return 0;
|
|
93
93
|
const num = Number(value.replace(/\D/g, ""));
|
|
@@ -104,13 +104,13 @@ const SectionShape = ({ allowChangeShape = true, }) => {
|
|
|
104
104
|
<Form.Item label="Stroke Fill" name={"stroke"} getValueFromEvent={(color) => color.toHexString()} className="w-full ">
|
|
105
105
|
<ColorPicker allowClear format="hex" defaultFormat="hex"/>
|
|
106
106
|
</Form.Item>
|
|
107
|
-
<Form.Item label="Stroke" name={"strokeWidth"} className="w-full">
|
|
107
|
+
<Form.Item label="Stroke Size" name={"strokeWidth"} className="w-full">
|
|
108
108
|
<InputNumber />
|
|
109
109
|
</Form.Item>
|
|
110
110
|
</Flex>
|
|
111
111
|
<Flex>
|
|
112
112
|
<Form.Item label="opacity" name={"opacity"} className="w-full">
|
|
113
|
-
<InputNumber step={10} max={100} min={0} parser={(value) => {
|
|
113
|
+
<InputNumber step={10} max={100} min={0} name="opacity" parser={(value) => {
|
|
114
114
|
if (value === undefined || value === null || value === "")
|
|
115
115
|
return null;
|
|
116
116
|
const cleaned = value.replace(/[^0-9.]/g, "");
|
|
@@ -3,5 +3,5 @@ interface NumberIndicatorProps {
|
|
|
3
3
|
defaultValue?: number;
|
|
4
4
|
onChange: (value: number) => void;
|
|
5
5
|
}
|
|
6
|
-
declare const NumberIndicator: ({ name, defaultValue, onChange }: NumberIndicatorProps) => import("react").JSX.Element;
|
|
6
|
+
declare const NumberIndicator: ({ name, defaultValue, onChange }: NumberIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default NumberIndicator;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
type JoystickPosition = {
|
|
3
2
|
x: number;
|
|
4
3
|
y: number;
|
|
@@ -8,5 +7,5 @@ type JoystickProps = {
|
|
|
8
7
|
onMove?: (pos: JoystickPosition) => void;
|
|
9
8
|
onEnd?: () => void;
|
|
10
9
|
};
|
|
11
|
-
export declare const Joystick: ({ size, onMove, onEnd, }: JoystickProps) =>
|
|
10
|
+
export declare const Joystick: ({ size, onMove, onEnd, }: JoystickProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
export {};
|
|
@@ -15,5 +15,5 @@ interface LayersProps {
|
|
|
15
15
|
onTouchMove?: (e: React.TouchEvent<SVGRectElement | SVGCircleElement | SVGTextElement | SVGImageElement>) => void;
|
|
16
16
|
onTouchEnd?: (e: React.TouchEvent<SVGRectElement | SVGCircleElement | SVGTextElement | SVGImageElement>) => void;
|
|
17
17
|
}
|
|
18
|
-
declare const Layers: ({ shadowShape, components, onClick, selectedComponent, selectedTable, activeTool, onMouseDown, onMouseUp, onBlur, selectedTableColor, mode, style, onTouchEnd, onTouchMove, onTouchStart }: LayersProps) => import("react").JSX.Element;
|
|
18
|
+
declare const Layers: ({ shadowShape, components, onClick, selectedComponent, selectedTable, activeTool, onMouseDown, onMouseUp, onBlur, selectedTableColor, mode, style, onTouchEnd, onTouchMove, onTouchStart }: LayersProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export default Layers;
|
|
@@ -15,5 +15,5 @@ interface LayersProps {
|
|
|
15
15
|
onTouchMove?: (e: React.TouchEvent<SVGRectElement | SVGCircleElement | SVGTextElement | SVGImageElement>) => void;
|
|
16
16
|
onTouchEnd?: (e: React.TouchEvent<SVGRectElement | SVGCircleElement | SVGTextElement | SVGImageElement>) => void;
|
|
17
17
|
}
|
|
18
|
-
declare const Layers: ({ shadowShape, components, onClick, selectedComponent, selectedTable, activeTool, onMouseDown, onMouseUp, onBlur, selectedTableColor, mode, style, onTouchStart }: LayersProps) => import("react").JSX.Element;
|
|
18
|
+
declare const Layers: ({ shadowShape, components, onClick, selectedComponent, selectedTable, activeTool, onMouseDown, onMouseUp, onBlur, selectedTableColor, mode, style, onTouchStart }: LayersProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export default Layers;
|
|
@@ -9,5 +9,5 @@ interface LayersProps {
|
|
|
9
9
|
activeTool?: string;
|
|
10
10
|
selectionLines?: SelectionLines;
|
|
11
11
|
}
|
|
12
|
-
declare const Layers: ({ components, selectedComponent, activeTool, selectionLines, }: LayersProps) => import("react").JSX.Element;
|
|
12
|
+
declare const Layers: ({ components, selectedComponent, activeTool, selectionLines, }: LayersProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export default Layers;
|
|
@@ -4,10 +4,18 @@ import { createElement as _createElement } from "react";
|
|
|
4
4
|
import { isEmpty, omit } from "lodash";
|
|
5
5
|
import { arcByDirection, distributeWithSpacing, rectToPolygonNodes, rectToPolygonPoints, } from "./utils";
|
|
6
6
|
import { useAppSelector } from "../../hooks/use-redux";
|
|
7
|
+
import { useMemo } from "react";
|
|
7
8
|
const Layers = ({ components, selectedComponent, activeTool, selectionLines, }) => {
|
|
8
9
|
var _a;
|
|
9
10
|
const hasPoints = selectionLines && !isEmpty(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.points);
|
|
10
11
|
const lockBackground = useAppSelector((state) => state.tool.lockBackground);
|
|
12
|
+
const selectedGroup = useAppSelector((state) => state.panel.selectedGroup);
|
|
13
|
+
const allSelectionId = useMemo(() => {
|
|
14
|
+
const ids = (selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.map((item) => item === null || item === void 0 ? void 0 : item.id)) || [];
|
|
15
|
+
if (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id)
|
|
16
|
+
ids.push(selectedComponent.id);
|
|
17
|
+
return ids;
|
|
18
|
+
}, [selectedGroup, selectedComponent]);
|
|
11
19
|
const renderShape = (item) => {
|
|
12
20
|
var _a, _b, _c, _d, _e, _f;
|
|
13
21
|
const { id, x, y, width, height, fill, opacity, rotation = 0, shape, text, stroke, strokeWidth, labels, fontSize, fontColor, label, seatFill, src, points, seatPositions, radius = 0, } = item;
|
|
@@ -17,6 +25,19 @@ const Layers = ({ components, selectedComponent, activeTool, selectionLines, })
|
|
|
17
25
|
stroke,
|
|
18
26
|
strokeWidth,
|
|
19
27
|
};
|
|
28
|
+
const selectionBox = {
|
|
29
|
+
stroke: "#3b82f6",
|
|
30
|
+
strokeWidth: 4,
|
|
31
|
+
width: width + strokeWidth + 2,
|
|
32
|
+
height: height + strokeWidth + 2,
|
|
33
|
+
x: x - strokeWidth / 2,
|
|
34
|
+
y: y - strokeWidth / 2,
|
|
35
|
+
opacity: 0,
|
|
36
|
+
};
|
|
37
|
+
if (allSelectionId === null || allSelectionId === void 0 ? void 0 : allSelectionId.includes(id)) {
|
|
38
|
+
commonProps.stroke = "#ffa39e";
|
|
39
|
+
commonProps.strokeWidth = 4;
|
|
40
|
+
}
|
|
20
41
|
switch (shape) {
|
|
21
42
|
case "square":
|
|
22
43
|
return (_jsx("g", { "data-id": id, id: `${id}`, transform: `translate(${x}, ${y})`, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_createElement("rect", Object.assign({}, commonProps, { key: id, width: width, height: height, rx: radius })), _jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
|
|
@@ -42,7 +63,7 @@ const Layers = ({ components, selectedComponent, activeTool, selectionLines, })
|
|
|
42
63
|
const showPoints = (selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.id) == id;
|
|
43
64
|
return (_jsx("g", { "data-id": id, transform: `translate(${x}, ${y})`, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_createElement("polygon", Object.assign({}, commonProps, { key: id, points: finalPoint, x: "0", y: "0" })), (showPoints || !isClosed) &&
|
|
44
65
|
points.map((_, index) => {
|
|
45
|
-
return (_jsxs(_Fragment, { children: [_jsx("rect", { "data-point": JSON.stringify(_), id: `${index}`, x: (_ === null || _ === void 0 ? void 0 : _.x) - 5, y: (_ === null || _ === void 0 ? void 0 : _.y) - 5, width: 10, height: 10, fill: "#4a90e2", cursor: "pointer" }, `${id}-point-${index}`), _jsx("circle", { "data-point": JSON.stringify(_), id: `${index}`, cx: _ === null || _ === void 0 ? void 0 : _.x, cy: _ === null || _ === void 0 ? void 0 : _.y, r: 15, fill: "transparent", cursor: "pointer" }, `${id}-point-${index}`)] }));
|
|
66
|
+
return (_jsxs(_Fragment, { children: [_jsx("rect", { "data-point": JSON.stringify(_), id: `${index}`, x: (_ === null || _ === void 0 ? void 0 : _.x) - 5, y: (_ === null || _ === void 0 ? void 0 : _.y) - 5, width: 10, height: 10, fill: "#4a90e2", cursor: "pointer" }, `${id}-point-${index}`), _jsx("circle", { "data-point": JSON.stringify(_), id: `${index}`, cx: _ === null || _ === void 0 ? void 0 : _.x, cy: _ === null || _ === void 0 ? void 0 : _.y, r: 15, fill: "transparent", cursor: "pointer" }, `${id}-point-${index - 100}`)] }));
|
|
46
67
|
})] }) }, id));
|
|
47
68
|
case "selection-box":
|
|
48
69
|
const pointsFormat = rectToPolygonPoints(x, y, width, height);
|
|
@@ -85,7 +106,7 @@ const Layers = ({ components, selectedComponent, activeTool, selectionLines, })
|
|
|
85
106
|
const cy = centerY + (tableRadius + seatRadius) * Math.sin(angle);
|
|
86
107
|
return { cx, cy };
|
|
87
108
|
});
|
|
88
|
-
return (_jsx("g", { "data-id": id, transform: `translate(${x}, ${y})`, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_jsx("circle", Object.assign({ cx: centerX, cy: centerY, r: tableRadius, fill: fill }, commonProps)), _jsx("g", { "data-seat": `${id}-seats`, children: seatCircles.map(({ cx, cy }, i) => (_jsx("circle", { cx: cx, cy: cy, r: seatRadius, fill: seatFill }, `${id}-seat-${i}`))) }), _jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
|
|
109
|
+
return (_jsx("g", { "data-id": id, transform: `translate(${x}, ${y})`, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_jsx("circle", Object.assign({ cx: centerX, cy: centerY, r: tableRadius, fill: fill }, commonProps)), _jsx("g", { "data-seat": `${id}-seats`, children: seatCircles.map(({ cx, cy }, i) => (_jsx("circle", Object.assign({ cx: cx, cy: cy, r: seatRadius, fill: seatFill }, commonProps), `${id}-seat-${i}`))) }), _jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
|
|
89
110
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
90
111
|
const cx = width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0);
|
|
91
112
|
const cy = height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0);
|
|
@@ -434,7 +455,23 @@ const Layers = ({ components, selectedComponent, activeTool, selectionLines, })
|
|
|
434
455
|
]), { transform: `rotate(${(_c = _ === null || _ === void 0 ? void 0 : _.rotation) !== null && _c !== void 0 ? _c : 0}, ${cx},${cy})`, key: `${id}-label-${index}`, x: width / 2 + ((_d = _ === null || _ === void 0 ? void 0 : _.x) !== null && _d !== void 0 ? _d : 0), y: height / 2 + ((_e = _ === null || _ === void 0 ? void 0 : _.y) !== null && _e !== void 0 ? _e : 0), fill: (_f = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _f !== void 0 ? _f : "black", fontSize: `${(_g = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _g !== void 0 ? _g : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle" }), _ === null || _ === void 0 ? void 0 : _.label));
|
|
435
456
|
}) })] }) }, id));
|
|
436
457
|
case "bounding-box": {
|
|
437
|
-
|
|
458
|
+
const topLine = `${0},${0} ${width},${0}`;
|
|
459
|
+
const rightLine = `${width},${0} ${width},${height}`;
|
|
460
|
+
const bottomLine = `${width},${height} ${0},${height}`;
|
|
461
|
+
const leftLine = `${0},${height} ${0},${0}`;
|
|
462
|
+
return (_jsxs("g", { id: "bounding-box", transform: `translate(${x}, ${y})`, "data-bounding-box": id, children: [_jsx("rect", { width: width, height: height, fill: "none", stroke: "#3b82f6", strokeWidth: 1, strokeDasharray: "6 4", pointerEvents: "none" }), _jsx("polyline", { points: topLine, fill: "none", stroke: "transparent", strokeWidth: 3, "data-position": "top-boundaries", style: {
|
|
463
|
+
pointerEvents: activeTool === "bounding-box" ? "none" : "stroke",
|
|
464
|
+
cursor: "row-resize",
|
|
465
|
+
} }), _jsx("polyline", { points: rightLine, fill: "none", stroke: "transparent", strokeWidth: 3, "data-position": "right-boundaries", style: {
|
|
466
|
+
pointerEvents: activeTool === "bounding-box" ? "none" : "stroke",
|
|
467
|
+
cursor: "col-resize",
|
|
468
|
+
} }), _jsx("polyline", { points: bottomLine, fill: "none", stroke: "transparent", strokeWidth: 3, "data-position": "bottom-boundaries", style: {
|
|
469
|
+
pointerEvents: activeTool === "bounding-box" ? "none" : "stroke",
|
|
470
|
+
cursor: "row-resize",
|
|
471
|
+
} }), _jsx("polyline", { points: leftLine, fill: "none", stroke: "transparent", strokeWidth: 3, "data-position": "left-boundaries", style: {
|
|
472
|
+
pointerEvents: activeTool === "bounding-box" ? "none" : "stroke",
|
|
473
|
+
cursor: "col-resize",
|
|
474
|
+
} })] }, id));
|
|
438
475
|
}
|
|
439
476
|
default:
|
|
440
477
|
return _jsx("g", {}, id);
|
|
@@ -442,6 +479,10 @@ const Layers = ({ components, selectedComponent, activeTool, selectionLines, })
|
|
|
442
479
|
};
|
|
443
480
|
let date = new Date();
|
|
444
481
|
const nodesRaw = rectToPolygonNodes(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.width, selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.height);
|
|
482
|
+
// const nodesRawNew = rectToPolygonNodes(
|
|
483
|
+
// selectionLinesPoints?.width,
|
|
484
|
+
// selectionLinesPoints?.height
|
|
485
|
+
// );
|
|
445
486
|
return (_jsxs("g", { id: "selection-layer", children: [components === null || components === void 0 ? void 0 : components.map(renderShape), !isEmpty(selectionLines) && activeTool === "select" && (_jsxs(_Fragment, { children: [nodesRaw.map((p1, index) => {
|
|
446
487
|
const p2 = nodesRaw[(index + 2) % nodesRaw.length];
|
|
447
488
|
const side = index === 0
|
|
@@ -2,10 +2,18 @@
|
|
|
2
2
|
import { isEmpty, omit } from "lodash";
|
|
3
3
|
import { arcByDirection, distributeWithSpacing, rectToPolygonNodes, rectToPolygonPoints, } from "./utils";
|
|
4
4
|
import { useAppSelector } from "../../hooks/use-redux";
|
|
5
|
+
import { useMemo } from "react";
|
|
5
6
|
const Layers = ({ components, selectedComponent, activeTool, selectionLines, }) => {
|
|
6
7
|
var _a;
|
|
7
8
|
const hasPoints = selectionLines && !isEmpty(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.points);
|
|
8
9
|
const lockBackground = useAppSelector((state) => state.tool.lockBackground);
|
|
10
|
+
const selectedGroup = useAppSelector((state) => state.panel.selectedGroup);
|
|
11
|
+
const allSelectionId = useMemo(() => {
|
|
12
|
+
const ids = (selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.map((item) => item === null || item === void 0 ? void 0 : item.id)) || [];
|
|
13
|
+
if (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id)
|
|
14
|
+
ids.push(selectedComponent.id);
|
|
15
|
+
return ids;
|
|
16
|
+
}, [selectedGroup, selectedComponent]);
|
|
9
17
|
const renderShape = (item) => {
|
|
10
18
|
var _a, _b, _c, _d, _e, _f;
|
|
11
19
|
const { id, x, y, width, height, fill, opacity, rotation = 0, shape, text, stroke, strokeWidth, labels, fontSize, fontColor, label, seatFill, src, points, seatPositions, radius = 0, } = item;
|
|
@@ -15,6 +23,19 @@ const Layers = ({ components, selectedComponent, activeTool, selectionLines, })
|
|
|
15
23
|
stroke,
|
|
16
24
|
strokeWidth,
|
|
17
25
|
};
|
|
26
|
+
const selectionBox = {
|
|
27
|
+
stroke: "#3b82f6",
|
|
28
|
+
strokeWidth: 4,
|
|
29
|
+
width: width + strokeWidth + 2,
|
|
30
|
+
height: height + strokeWidth + 2,
|
|
31
|
+
x: x - strokeWidth / 2,
|
|
32
|
+
y: y - strokeWidth / 2,
|
|
33
|
+
opacity: 0,
|
|
34
|
+
};
|
|
35
|
+
if (allSelectionId === null || allSelectionId === void 0 ? void 0 : allSelectionId.includes(id)) {
|
|
36
|
+
commonProps.stroke = "#ffa39e";
|
|
37
|
+
commonProps.strokeWidth = 4;
|
|
38
|
+
}
|
|
18
39
|
switch (shape) {
|
|
19
40
|
case "square":
|
|
20
41
|
return (<g key={id} data-id={id} id={`${id}`} transform={`translate(${x}, ${y})`}>
|
|
@@ -54,7 +75,7 @@ const Layers = ({ components, selectedComponent, activeTool, selectionLines, })
|
|
|
54
75
|
points.map((_, index) => {
|
|
55
76
|
return (<>
|
|
56
77
|
<rect data-point={JSON.stringify(_)} id={`${index}`} key={`${id}-point-${index}`} x={(_ === null || _ === void 0 ? void 0 : _.x) - 5} y={(_ === null || _ === void 0 ? void 0 : _.y) - 5} width={10} height={10} fill="#4a90e2" cursor={"pointer"}/>
|
|
57
|
-
<circle data-point={JSON.stringify(_)} id={`${index}`} key={`${id}-point-${index}`} cx={_ === null || _ === void 0 ? void 0 : _.x} cy={_ === null || _ === void 0 ? void 0 : _.y} r={15} fill="transparent" cursor={"pointer"}/>
|
|
78
|
+
<circle data-point={JSON.stringify(_)} id={`${index}`} key={`${id}-point-${index - 100}`} cx={_ === null || _ === void 0 ? void 0 : _.x} cy={_ === null || _ === void 0 ? void 0 : _.y} r={15} fill="transparent" cursor={"pointer"}/>
|
|
58
79
|
</>);
|
|
59
80
|
})}
|
|
60
81
|
</g>
|
|
@@ -129,7 +150,7 @@ const Layers = ({ components, selectedComponent, activeTool, selectionLines, })
|
|
|
129
150
|
<circle cx={centerX} cy={centerY} r={tableRadius} fill={fill} {...commonProps}/>
|
|
130
151
|
{/* Seat */}
|
|
131
152
|
<g data-seat={`${id}-seats`}>
|
|
132
|
-
{seatCircles.map(({ cx, cy }, i) => (<circle key={`${id}-seat-${i}`} cx={cx} cy={cy} r={seatRadius} fill={seatFill}/>))}
|
|
153
|
+
{seatCircles.map(({ cx, cy }, i) => (<circle key={`${id}-seat-${i}`} cx={cx} cy={cy} r={seatRadius} fill={seatFill} {...commonProps}/>))}
|
|
133
154
|
</g>
|
|
134
155
|
|
|
135
156
|
<g transform={`rotate(${-rotation}, ${width / 2}, ${height / 2})`}>
|
|
@@ -556,8 +577,32 @@ const Layers = ({ components, selectedComponent, activeTool, selectionLines, })
|
|
|
556
577
|
</g>
|
|
557
578
|
</g>);
|
|
558
579
|
case "bounding-box": {
|
|
559
|
-
|
|
580
|
+
const topLine = `${0},${0} ${width},${0}`;
|
|
581
|
+
const rightLine = `${width},${0} ${width},${height}`;
|
|
582
|
+
const bottomLine = `${width},${height} ${0},${height}`;
|
|
583
|
+
const leftLine = `${0},${height} ${0},${0}`;
|
|
584
|
+
return (<g key={id} id="bounding-box" transform={`translate(${x}, ${y})`} data-bounding-box={id}>
|
|
560
585
|
<rect width={width} height={height} fill="none" stroke="#3b82f6" strokeWidth={1} strokeDasharray="6 4" pointerEvents="none"/>
|
|
586
|
+
{/* top polyline */}
|
|
587
|
+
<polyline points={topLine} fill="none" stroke="transparent" strokeWidth={3} data-position="top-boundaries" style={{
|
|
588
|
+
pointerEvents: activeTool === "bounding-box" ? "none" : "stroke",
|
|
589
|
+
cursor: "row-resize",
|
|
590
|
+
}}/>
|
|
591
|
+
{/* right polyline */}
|
|
592
|
+
<polyline points={rightLine} fill="none" stroke="transparent" strokeWidth={3} data-position="right-boundaries" style={{
|
|
593
|
+
pointerEvents: activeTool === "bounding-box" ? "none" : "stroke",
|
|
594
|
+
cursor: "col-resize",
|
|
595
|
+
}}/>
|
|
596
|
+
{/* bottom polyline */}
|
|
597
|
+
<polyline points={bottomLine} fill="none" stroke="transparent" strokeWidth={3} data-position="bottom-boundaries" style={{
|
|
598
|
+
pointerEvents: activeTool === "bounding-box" ? "none" : "stroke",
|
|
599
|
+
cursor: "row-resize",
|
|
600
|
+
}}/>
|
|
601
|
+
{/* left polyline */}
|
|
602
|
+
<polyline points={leftLine} fill="none" stroke="transparent" strokeWidth={3} data-position="left-boundaries" style={{
|
|
603
|
+
pointerEvents: activeTool === "bounding-box" ? "none" : "stroke",
|
|
604
|
+
cursor: "col-resize",
|
|
605
|
+
}}/>
|
|
561
606
|
</g>);
|
|
562
607
|
}
|
|
563
608
|
default:
|
|
@@ -566,6 +611,10 @@ const Layers = ({ components, selectedComponent, activeTool, selectionLines, })
|
|
|
566
611
|
};
|
|
567
612
|
let date = new Date();
|
|
568
613
|
const nodesRaw = rectToPolygonNodes(selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.width, selectionLines === null || selectionLines === void 0 ? void 0 : selectionLines.height);
|
|
614
|
+
// const nodesRawNew = rectToPolygonNodes(
|
|
615
|
+
// selectionLinesPoints?.width,
|
|
616
|
+
// selectionLinesPoints?.height
|
|
617
|
+
// );
|
|
569
618
|
return (<g key={`${date}`} id="selection-layer">
|
|
570
619
|
{components === null || components === void 0 ? void 0 : components.map(renderShape)}
|
|
571
620
|
{!isEmpty(selectionLines) && activeTool === "select" && (<>
|
|
@@ -625,6 +674,74 @@ const Layers = ({ components, selectedComponent, activeTool, selectionLines, })
|
|
|
625
674
|
}))}
|
|
626
675
|
</g>
|
|
627
676
|
</g>
|
|
677
|
+
{/* {!isEmpty(selectionLinesPoints) && (
|
|
678
|
+
<g
|
|
679
|
+
key={`selection-${date}`}
|
|
680
|
+
id="selection-lines"
|
|
681
|
+
data-selection={`selection-${
|
|
682
|
+
selectedComponent?.id ?? selectionLines?.id
|
|
683
|
+
}`}
|
|
684
|
+
transform={`translate(${selectionLinesPoints?.x},${selectionLinesPoints?.y})`}
|
|
685
|
+
>
|
|
686
|
+
<g transform={`rotate(${0}, 0,0)`}>
|
|
687
|
+
<rect
|
|
688
|
+
width={selectionLinesPoints?.width}
|
|
689
|
+
height={selectionLinesPoints?.height}
|
|
690
|
+
fill="none"
|
|
691
|
+
stroke="red"
|
|
692
|
+
strokeWidth={1}
|
|
693
|
+
id="rect-box-selection"
|
|
694
|
+
/>
|
|
695
|
+
|
|
696
|
+
{nodesRawNew?.map((node: Point, index: number) => {
|
|
697
|
+
const corner = (index: number) => {
|
|
698
|
+
switch (index) {
|
|
699
|
+
case 0:
|
|
700
|
+
return "top-left";
|
|
701
|
+
case 1:
|
|
702
|
+
return "top";
|
|
703
|
+
case 2:
|
|
704
|
+
return "top-right";
|
|
705
|
+
case 3:
|
|
706
|
+
return "right";
|
|
707
|
+
case 4:
|
|
708
|
+
return "bottom-right";
|
|
709
|
+
case 5:
|
|
710
|
+
return "bottom";
|
|
711
|
+
case 6:
|
|
712
|
+
return "bottom-left";
|
|
713
|
+
case 7:
|
|
714
|
+
return "left";
|
|
715
|
+
}
|
|
716
|
+
};
|
|
717
|
+
|
|
718
|
+
return (
|
|
719
|
+
<>
|
|
720
|
+
<circle
|
|
721
|
+
data-position={corner(index)}
|
|
722
|
+
key={index}
|
|
723
|
+
r={5}
|
|
724
|
+
cx={node.x}
|
|
725
|
+
cy={node.y}
|
|
726
|
+
fill="transparent"
|
|
727
|
+
style={{ cursor: "pointer" }}
|
|
728
|
+
/>
|
|
729
|
+
<circle
|
|
730
|
+
data-position={corner(index)}
|
|
731
|
+
key={index}
|
|
732
|
+
r={5}
|
|
733
|
+
cx={node.x}
|
|
734
|
+
cy={node.y}
|
|
735
|
+
fill="red"
|
|
736
|
+
id={`circle-corner-${selectedComponent?.id}`}
|
|
737
|
+
style={{ cursor: "pointer" }}
|
|
738
|
+
/>
|
|
739
|
+
</>
|
|
740
|
+
);
|
|
741
|
+
})}
|
|
742
|
+
</g>
|
|
743
|
+
</g>
|
|
744
|
+
)} */}
|
|
628
745
|
</>)}
|
|
629
746
|
</g>);
|
|
630
747
|
};
|
|
@@ -20,5 +20,5 @@ interface LayersProps {
|
|
|
20
20
|
items: string[];
|
|
21
21
|
}[];
|
|
22
22
|
}
|
|
23
|
-
declare const Layers: ({ components, selectedTable, iconTags, eventMatchTable, onHighlightGroup, onForceRestoreGroup, selectedTableColor, privilegedTags, }: LayersProps) => import("react").JSX.Element;
|
|
23
|
+
declare const Layers: ({ components, selectedTable, iconTags, eventMatchTable, onHighlightGroup, onForceRestoreGroup, selectedTableColor, privilegedTags, }: LayersProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
export default Layers;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export declare const tagsDummy: (name: string, icon: string) => ({
|
|
2
|
+
gap: string;
|
|
3
|
+
key: string;
|
|
4
|
+
items: {
|
|
5
|
+
type: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}[];
|
|
8
|
+
direction: string;
|
|
9
|
+
offsetX?: undefined;
|
|
10
|
+
offsetY?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
gap: string;
|
|
13
|
+
key: string;
|
|
14
|
+
items: {
|
|
15
|
+
type: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}[];
|
|
18
|
+
offsetX: string;
|
|
19
|
+
offsetY: string;
|
|
20
|
+
direction: string;
|
|
21
|
+
} | {
|
|
22
|
+
gap: string;
|
|
23
|
+
key: string;
|
|
24
|
+
items: ({
|
|
25
|
+
type: string;
|
|
26
|
+
value: string;
|
|
27
|
+
fontWeight: string;
|
|
28
|
+
textDecoration: string;
|
|
29
|
+
symbol?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
type: string;
|
|
32
|
+
value: string;
|
|
33
|
+
fontWeight?: undefined;
|
|
34
|
+
textDecoration?: undefined;
|
|
35
|
+
symbol?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
type: string;
|
|
38
|
+
value: string;
|
|
39
|
+
symbol: {
|
|
40
|
+
value: string;
|
|
41
|
+
gap: number;
|
|
42
|
+
position: string;
|
|
43
|
+
};
|
|
44
|
+
fontWeight?: undefined;
|
|
45
|
+
textDecoration?: undefined;
|
|
46
|
+
})[];
|
|
47
|
+
direction: string;
|
|
48
|
+
offsetY: number;
|
|
49
|
+
offsetX?: undefined;
|
|
50
|
+
})[];
|
|
51
|
+
export declare const PRIVILEGED_TAGS: {
|
|
52
|
+
CURRENT_TIME: {
|
|
53
|
+
key: string;
|
|
54
|
+
items: string[];
|
|
55
|
+
}[];
|
|
56
|
+
NEXT_3_RESERVATION: {
|
|
57
|
+
key: string;
|
|
58
|
+
items: string[];
|
|
59
|
+
}[];
|
|
60
|
+
};
|