seat-editor 1.6.12 → 1.6.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/app/layout.d.ts +1 -1
  2. package/dist/app/{layout.jsx → layout.js} +2 -7
  3. package/dist/app/new-board/page.d.ts +1 -1
  4. package/dist/app/new-board/page.js +33 -0
  5. package/dist/app/old-board/page.d.ts +1 -2
  6. package/dist/app/old-board/{page.jsx → page.js} +82 -215
  7. package/dist/app/only-view/page.d.ts +1 -1
  8. package/dist/app/only-view/{page.jsx → page.js} +2 -1
  9. package/dist/app/page.d.ts +1 -1
  10. package/dist/app/page.js +8 -0
  11. package/dist/app/test/page.d.ts +1 -0
  12. package/dist/app/test/page.js +43 -0
  13. package/dist/app/v2/page.d.ts +2 -0
  14. package/dist/app/v2/page.js +8 -0
  15. package/dist/components/button-tools/index.d.ts +1 -1
  16. package/dist/components/button-tools/index.js +11 -0
  17. package/dist/components/form-tools/label.d.ts +1 -1
  18. package/dist/components/form-tools/label.js +7 -0
  19. package/dist/components/form-tools/shape.d.ts +1 -1
  20. package/dist/components/form-tools/shape.js +25 -0
  21. package/dist/components/input/number-indicator.d.ts +1 -1
  22. package/dist/components/input/{number-indicator.jsx → number-indicator.js} +2 -11
  23. package/dist/components/joystick/index.d.ts +1 -2
  24. package/dist/components/joystick/{index.jsx → index.js} +13 -14
  25. package/dist/components/layer/index.d.ts +1 -1
  26. package/dist/components/layer/index.js +295 -0
  27. package/dist/components/layer-v2/index.d.ts +19 -0
  28. package/dist/components/layer-v2/index.js +295 -0
  29. package/dist/components/lib/index.d.ts +1 -1
  30. package/dist/components/lib/{index.jsx → index.js} +2 -7
  31. package/dist/components/modal-preview/index.d.ts +1 -1
  32. package/dist/components/modal-preview/index.js +10 -0
  33. package/dist/features/board/index.d.ts +1 -1
  34. package/dist/features/board/{index.jsx → index.js} +31 -90
  35. package/dist/features/board-v2/board-slice.d.ts +14 -0
  36. package/dist/features/board-v2/board-slice.js +52 -0
  37. package/dist/features/board-v2/index.d.ts +6 -0
  38. package/dist/features/board-v2/index.js +666 -0
  39. package/dist/features/navbar/index.d.ts +1 -1
  40. package/dist/features/navbar/index.js +6 -0
  41. package/dist/features/package/index.d.ts +1 -1
  42. package/dist/features/package/{index.jsx → index.js} +7 -17
  43. package/dist/features/panel/index.d.ts +1 -1
  44. package/dist/features/panel/{index.jsx → index.js} +8 -18
  45. package/dist/features/panel/select-tool.d.ts +1 -1
  46. package/dist/features/panel/{select-tool.jsx → select-tool.js} +8 -20
  47. package/dist/features/panel/square-circle-tool.d.ts +1 -1
  48. package/dist/features/panel/{square-circle-tool.jsx → square-circle-tool.js} +2 -4
  49. package/dist/features/panel/table-seat-circle.d.ts +1 -1
  50. package/dist/features/panel/table-seat-circle.js +9 -0
  51. package/dist/features/panel/text-tool.d.ts +1 -1
  52. package/dist/features/panel/text-tool.js +7 -0
  53. package/dist/features/panel/upload-tool.d.ts +1 -1
  54. package/dist/features/panel/{upload-tool.jsx → upload-tool.js} +2 -24
  55. package/dist/features/side-tool/index.d.ts +1 -1
  56. package/dist/features/side-tool/{index.jsx → index.js} +83 -89
  57. package/dist/features/view/index.d.ts +1 -1
  58. package/dist/features/view/{index.jsx → index.js} +31 -38
  59. package/dist/features/view-only/index.d.ts +1 -1
  60. package/dist/features/view-only/{index.jsx → index.js} +31 -38
  61. package/dist/provider/antd-provider.js +43 -0
  62. package/dist/provider/redux-provider.d.ts +1 -1
  63. package/dist/provider/{redux-provider.jsx → redux-provider.js} +2 -1
  64. package/dist/provider/store-provider.d.ts +1 -1
  65. package/dist/provider/{store-provider.jsx → store-provider.js} +2 -3
  66. package/package.json +1 -1
  67. package/dist/app/new-board/page.jsx +0 -53
  68. package/dist/app/page.jsx +0 -13
  69. package/dist/components/button-tools/index.jsx +0 -17
  70. package/dist/components/form-tools/label.jsx +0 -44
  71. package/dist/components/form-tools/shape.jsx +0 -66
  72. package/dist/components/layer/index.jsx +0 -383
  73. package/dist/components/modal-preview/index.jsx +0 -11
  74. package/dist/features/navbar/index.jsx +0 -5
  75. package/dist/features/panel/table-seat-circle.jsx +0 -31
  76. package/dist/features/panel/text-tool.jsx +0 -26
  77. package/dist/provider/antd-provider.jsx +0 -46
@@ -23,5 +23,5 @@ export interface TableEditorProps {
23
23
  dragOnly?: boolean;
24
24
  viewOnly?: boolean;
25
25
  }
26
- declare const TableEditor: (props: TableEditorProps) => import("react").JSX.Element;
26
+ declare const TableEditor: (props: TableEditorProps) => import("react/jsx-runtime").JSX.Element;
27
27
  export default TableEditor;
@@ -1,6 +1,7 @@
1
1
  "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import { useEffect, useState } from "react";
3
- import Board from "../board";
4
+ import Board from "../board-v2";
4
5
  import SideTool from "../side-tool";
5
6
  import ControlPanels from "../panel";
6
7
  import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
@@ -94,21 +95,10 @@ const TableEditor = (props) => {
94
95
  dispatch({ type: "board/setFlagChange", payload: true });
95
96
  }
96
97
  }, [componentProps, extraComponentProps, props === null || props === void 0 ? void 0 : props.defaultBackground]);
97
- return (<>
98
- <div className="w-full h-screen flex relative">
99
- <div className="w-full h-full flex relative" style={{
100
- display: !viewOnly ? "none" : "flex",
101
- }}>
102
- <LayerView statusKey="status"/>
103
- </div>
104
- <div className="w-full h-full flex relative" style={{
105
- display: viewOnly ? "none" : "flex",
106
- }}>
107
- <SideTool dragOnly={dragOnly}/>
108
- <Board onSelectComponent={props.onSelectComponent}/>
109
- <ControlPanels action={props.action} responseMapping={props.responseMapping}/>
110
- </div>
111
- </div>
112
- </>);
98
+ return (_jsx(_Fragment, { children: _jsxs("div", { className: "w-full h-screen flex relative", children: [_jsx("div", { className: "w-full h-full flex relative", style: {
99
+ display: !viewOnly ? "none" : "flex",
100
+ }, children: _jsx(LayerView, { statusKey: "status" }) }), _jsxs("div", { className: "w-full h-full flex relative", style: {
101
+ display: viewOnly ? "none" : "flex",
102
+ }, children: [_jsx(SideTool, { dragOnly: dragOnly }), _jsx(Board, { onSelectComponent: props.onSelectComponent }), _jsx(ControlPanels, { action: props.action, responseMapping: props.responseMapping })] })] }) }));
113
103
  };
114
104
  export default TableEditor;
@@ -7,5 +7,5 @@ interface ControlPanelsProps {
7
7
  src: string;
8
8
  };
9
9
  }
10
- declare const ControlPanels: (props: ControlPanelsProps) => import("react").JSX.Element;
10
+ declare const ControlPanels: (props: ControlPanelsProps) => import("react/jsx-runtime").JSX.Element;
11
11
  export default ControlPanels;
@@ -10,6 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  }
11
11
  return t;
12
12
  };
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
14
  import { useEffect, useState } from "react";
14
15
  import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
15
16
  import { Form, Drawer, Input } from "antd";
@@ -56,9 +57,7 @@ const ControlPanels = (props) => {
56
57
  };
57
58
  const handleChangeComponent = (values, allValues) => {
58
59
  const { shape } = allValues, restProps = __rest(allValues, ["shape"]);
59
- console.log({ allValues });
60
60
  const newValues = createShape(shape, restProps);
61
- console.log({ newValues });
62
61
  dispatch({
63
62
  type: "board/updateComponent",
64
63
  payload: Object.assign(Object.assign({}, (selectedComponent || {})), newValues),
@@ -75,16 +74,16 @@ const ControlPanels = (props) => {
75
74
  const renderFormPanel = () => {
76
75
  switch (tool.active) {
77
76
  case "select":
78
- return <SelectToolForm action={action} responseMapping={responseMapping}/>;
77
+ return _jsx(SelectToolForm, { action: action, responseMapping: responseMapping });
79
78
  case "square":
80
79
  case "circle":
81
- return <SquareToolForm />;
80
+ return _jsx(SquareToolForm, {});
82
81
  case "table-seat-circle":
83
- return <SeatCircle />;
82
+ return _jsx(SeatCircle, {});
84
83
  case "image-table":
85
- return (<UploadTool name={tool.active} type="component" action={action} responseMapping={responseMapping}/>);
84
+ return (_jsx(UploadTool, { name: tool.active, type: "component", action: action, responseMapping: responseMapping }));
86
85
  case "background":
87
- return (<UploadTool name={tool.active} type="background" action={action} responseMapping={responseMapping}/>);
86
+ return (_jsx(UploadTool, { name: tool.active, type: "background", action: action, responseMapping: responseMapping }));
88
87
  default:
89
88
  return null;
90
89
  }
@@ -97,19 +96,10 @@ const ControlPanels = (props) => {
97
96
  });
98
97
  };
99
98
  // if(!show) return null
100
- return (<Drawer open={show} onClose={handleClose} title="Panel" styles={{
99
+ return (_jsx(Drawer, { open: show, onClose: handleClose, title: "Panel", styles: {
101
100
  body: {
102
101
  paddingBottom: 0
103
102
  }
104
- }}>
105
- <div className="bg-white h-full max-h-screen w-full p-2">
106
- <Form layout="vertical" form={form} name="table" onValuesChange={handleChangeComponent} initialValues={{ labels: [{}] }}>
107
- <Form.Item name="id" hidden>
108
- <Input />
109
- </Form.Item>
110
- {renderFormPanel()}
111
- </Form>
112
- </div>
113
- </Drawer>);
103
+ }, children: _jsx("div", { className: "bg-white h-full max-h-screen w-full p-2", children: _jsxs(Form, { layout: "vertical", form: form, name: "table", onValuesChange: handleChangeComponent, initialValues: { labels: [{}] }, children: [_jsx(Form.Item, { name: "id", hidden: true, children: _jsx(Input, {}) }), renderFormPanel()] }) }) }));
114
104
  };
115
105
  export default ControlPanels;
@@ -2,5 +2,5 @@ declare const SelectToolForm: ({ title, action, responseMapping }: {
2
2
  title?: string;
3
3
  action: any;
4
4
  responseMapping: any;
5
- }) => import("react").JSX.Element;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
6
  export default SelectToolForm;
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useAppSelector } from "../../hooks/use-redux";
3
4
  import SquareToolForm from "./square-circle-tool";
4
5
  import SeatCircle from "./table-seat-circle";
@@ -22,39 +23,26 @@ const SelectToolForm = ({ title = "Title", action, responseMapping }) => {
22
23
  .replace(/-/g, " ")
23
24
  .replace(/\b\w/g, (char) => char.toUpperCase());
24
25
  };
25
- return (<div className="flex flex-col">
26
- <h1 className="heading-s">{title}</h1>
27
- <div className="flex flex-col gap-2 mt-5">
28
- {Object.entries(countByShape).map(([shape, count]) => (<div key={shape}>
29
- <span className="font-bold">
30
- {variableFormatToString(shape)}:
31
- </span>{" "}
32
- {count}
33
- </div>))}
34
- </div>
35
- </div>);
26
+ return (_jsxs("div", { className: "flex flex-col", children: [_jsx("h1", { className: "heading-s", children: title }), _jsx("div", { className: "flex flex-col gap-2 mt-5", children: Object.entries(countByShape).map(([shape, count]) => (_jsxs("div", { children: [_jsxs("span", { className: "font-bold", children: [variableFormatToString(shape), ":"] }), " ", count] }, shape))) })] }));
36
27
  };
37
28
  const renderComponent = () => {
38
29
  switch (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.shape) {
39
30
  case "square":
40
31
  case "circle":
41
- return <SquareToolForm />;
32
+ return _jsx(SquareToolForm, {});
42
33
  case "table-seat-circle":
43
- return <SeatCircle />;
34
+ return _jsx(SeatCircle, {});
44
35
  case "image-table":
45
36
  case "background":
46
- return (<UploadTool action={action} responseMapping={responseMapping} name={selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.shape} defaultValue={selectedComponent} type={(selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.shape) === "background"
37
+ return (_jsx(UploadTool, { action: action, responseMapping: responseMapping, name: selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.shape, defaultValue: selectedComponent, type: (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.shape) === "background"
47
38
  ? "background"
48
- : "component"}/>);
39
+ : "component" }));
49
40
  case "text":
50
- return <TextTool />;
41
+ return _jsx(TextTool, {});
51
42
  default:
52
43
  return null;
53
44
  }
54
45
  };
55
- return (<div className="flex flex-col gap-2">
56
- <SummaryComponents />
57
- {renderComponent()}
58
- </div>);
46
+ return (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(SummaryComponents, {}), renderComponent()] }));
59
47
  };
60
48
  export default SelectToolForm;
@@ -1,2 +1,2 @@
1
- declare const SquareToolForm: () => import("react").JSX.Element;
1
+ declare const SquareToolForm: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default SquareToolForm;
@@ -1,10 +1,8 @@
1
1
  "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import SectionLabel from "../../components/form-tools/label";
3
4
  import SectionShape from "../../components/form-tools/shape";
4
5
  const SquareToolForm = () => {
5
- return (<>
6
- <SectionShape />
7
- <SectionLabel />
8
- </>);
6
+ return (_jsxs(_Fragment, { children: [_jsx(SectionShape, {}), _jsx(SectionLabel, {})] }));
9
7
  };
10
8
  export default SquareToolForm;
@@ -1,2 +1,2 @@
1
- declare const SeatCircle: () => import("react").JSX.Element;
1
+ declare const SeatCircle: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default SeatCircle;
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { ColorPicker, Flex, Form, InputNumber } from "antd";
4
+ import SectionLabel from "../../components/form-tools/label";
5
+ import SectionShape from "../../components/form-tools/shape";
6
+ const SeatCircle = () => {
7
+ return (_jsx(_Fragment, { children: _jsxs("div", { className: "py-2", children: [_jsx("h1", { className: "heading-s", children: " Round table" }), _jsxs(Flex, { children: [_jsx(Form.Item, { name: "seatCount", label: "Seat Count", className: "w-full", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { name: "openSpace", label: "Open Space", className: "w-full", children: _jsx(InputNumber, { max: 1, min: 0, step: 0.1 }) })] }), _jsxs(Flex, { gap: 2, children: [_jsx(Form.Item, { label: "Seat Fill", name: "seatFill", getValueFromEvent: (color) => color.toHexString(), className: "w-full ", children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) }), _jsx(Form.Item, { label: "Table Fill", name: "fill", getValueFromEvent: (color) => color.toHexString(), className: "w-full ", children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) })] }), _jsx(SectionShape, {}), _jsx(SectionLabel, {})] }) }));
8
+ };
9
+ export default SeatCircle;
@@ -1,2 +1,2 @@
1
- declare const TextTool: () => import("react").JSX.Element;
1
+ declare const TextTool: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default TextTool;
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { ColorPicker, Form, Input, InputNumber } from "antd";
4
+ const TextTool = () => {
5
+ return (_jsxs("div", { className: "py-2", children: [_jsx(Form.Item, { label: "Name", name: "shape", className: "w-full hidden", children: _jsx(Input, { defaultValue: "text" }) }), _jsx(Form.Item, { name: "text", label: "Text", children: _jsx(Input, {}) }), _jsx(Form.Item, { name: "fontColor", label: "Color", getValueFromEvent: (color) => color.toHexString(), children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) }), _jsx(Form.Item, { name: "x", label: "X", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { name: "y", label: "Y", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { name: "fontSize", label: "Size", children: _jsx(InputNumber, { suffix: "px" }) })] }));
6
+ };
7
+ export default TextTool;
@@ -10,5 +10,5 @@ interface UploadToolProps {
10
10
  };
11
11
  defaultValue?: any;
12
12
  }
13
- declare const UploadTool: ({ name, type, action, responseMapping, defaultValue, }: UploadToolProps) => import("react").JSX.Element;
13
+ declare const UploadTool: ({ name, type, action, responseMapping, defaultValue, }: UploadToolProps) => import("react/jsx-runtime").JSX.Element;
14
14
  export default UploadTool;
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
11
12
  import { useState, useEffect } from "react";
12
13
  import { Upload, Image, Button } from "antd";
13
14
  import { InboxOutlined } from "@ant-design/icons";
@@ -124,29 +125,6 @@ const UploadTool = ({ name, type, action, responseMapping, defaultValue, }) => {
124
125
  const handleDelete = () => {
125
126
  setDefaultSrc(null);
126
127
  };
127
- return (<>
128
- {defaultSrc ? (<>
129
- <div className="w-full flex flex-col items-center gap-2 max-h-[200px] overflow-y-auto">
130
- <Image src={defaultSrc}/>
131
- </div>
132
- <Button type="primary" onClick={handleDelete}>
133
- Edit
134
- </Button>
135
- </>) : (<Dragger {...propsUpload} action={""}>
136
- <p className="ant-upload-drag-icon">
137
- <InboxOutlined />
138
- </p>
139
- <p className="ant-upload-text">
140
- Click or drag file to this area to upload
141
- </p>
142
- <p className="ant-upload-hint">
143
- Support for a single or bulk upload. Strictly prohibited from
144
- uploading company data or other banned files.
145
- </p>
146
- </Dragger>)}
147
-
148
- <SectionShape />
149
- <SectionLabel />
150
- </>);
128
+ return (_jsxs(_Fragment, { children: [defaultSrc ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "w-full flex flex-col items-center gap-2 max-h-[200px] overflow-y-auto", children: _jsx(Image, { src: defaultSrc }) }), _jsx(Button, { type: "primary", onClick: handleDelete, children: "Edit" })] })) : (_jsxs(Dragger, Object.assign({}, propsUpload, { action: "", children: [_jsx("p", { className: "ant-upload-drag-icon", children: _jsx(InboxOutlined, {}) }), _jsx("p", { className: "ant-upload-text", children: "Click or drag file to this area to upload" }), _jsx("p", { className: "ant-upload-hint", children: "Support for a single or bulk upload. Strictly prohibited from uploading company data or other banned files." })] }))), _jsx(SectionShape, {}), _jsx(SectionLabel, {})] }));
151
129
  };
152
130
  export default UploadTool;
@@ -1,4 +1,4 @@
1
1
  declare const SideTool: ({ dragOnly }: {
2
2
  dragOnly?: boolean;
3
- }) => import("react").JSX.Element;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
4
  export default SideTool;
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { Circle, CopyPlus, Eye, EyeOff, Image, Layers2, MousePointer, PaintBucket, Ratio, SquareMousePointer, Trash, Type, Upload, Hand, Layers, Ruler, Grid } from "lucide-react";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Circle, CopyPlus, Eye, EyeOff, Image, Layers2, MousePointer, PaintBucket, Ratio, SquareMousePointer, Trash, Type, Upload, Hand, Layers, Ruler, Grid, MousePointer2 } from "lucide-react";
3
4
  import ButtonTools from "../../components/button-tools";
4
5
  import { Divider, ColorPicker, Button, } from "antd";
5
6
  import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
@@ -15,17 +16,22 @@ const SideTool = ({ dragOnly }) => {
15
16
  {
16
17
  id: "select",
17
18
  name: "Select Tool",
18
- icon: <MousePointer />,
19
+ icon: _jsx(MousePointer, {}),
19
20
  },
20
21
  {
21
22
  id: "grab",
22
23
  name: "Grab Tool",
23
- icon: <Hand />,
24
+ icon: _jsx(Hand, {}),
24
25
  },
25
26
  {
26
27
  id: "ruler",
27
28
  name: "Ruler",
28
- icon: <Ruler />,
29
+ icon: _jsx(Ruler, {}),
30
+ },
31
+ {
32
+ id: "node",
33
+ name: "Node Tool",
34
+ icon: _jsx(MousePointer2, {}),
29
35
  }
30
36
  ];
31
37
  const actionsTools = [
@@ -37,22 +43,22 @@ const SideTool = ({ dragOnly }) => {
37
43
  {
38
44
  id: "square",
39
45
  name: "Square",
40
- icon: <SquareMousePointer />,
46
+ icon: _jsx(SquareMousePointer, {}),
41
47
  },
42
48
  {
43
49
  id: "circle",
44
50
  name: "Circle",
45
- icon: <Circle />,
51
+ icon: _jsx(Circle, {}),
46
52
  },
47
53
  {
48
54
  id: "table-seat-circle",
49
55
  name: "Table Seat Circle",
50
- icon: <Ratio />,
56
+ icon: _jsx(Ratio, {}),
51
57
  },
52
58
  {
53
59
  id: "image-table",
54
60
  name: "Image Table",
55
- icon: <Upload />,
61
+ icon: _jsx(Upload, {}),
56
62
  },
57
63
  // {
58
64
  // id: "table-seat-square",
@@ -69,12 +75,12 @@ const SideTool = ({ dragOnly }) => {
69
75
  {
70
76
  id: "background",
71
77
  name: "Background",
72
- icon: <Image />,
78
+ icon: _jsx(Image, {}),
73
79
  },
74
80
  {
75
81
  id: "text",
76
82
  name: "Text",
77
- icon: <Type />,
83
+ icon: _jsx(Type, {}),
78
84
  },
79
85
  // {
80
86
  // id: "background-color",
@@ -83,6 +89,13 @@ const SideTool = ({ dragOnly }) => {
83
89
  // }
84
90
  ];
85
91
  const hanldeSelectTool = (id) => {
92
+ if (active === id) {
93
+ dispatch({
94
+ type: "tool/setActiveTool",
95
+ payload: "",
96
+ });
97
+ return;
98
+ }
86
99
  if (id === "background" || id === "image-table") {
87
100
  dispatch({
88
101
  type: "panel/setShow",
@@ -208,91 +221,72 @@ const SideTool = ({ dragOnly }) => {
208
221
  });
209
222
  dispatch({ type: "board/setFlagChange", payload: true });
210
223
  };
211
- return (<div className="h-full left-0 flex flex-col items-center border-r-2 border-gray-300 bg-white px-2 pt-4">
212
- {tools === null || tools === void 0 ? void 0 : tools.map((tool) => (<ButtonTools key={tool.id} buttonProps={{
213
- icon: tool.icon,
214
- type: "text",
215
- name: tool.name,
216
- onClick: () => hanldeSelectTool(tool.id),
217
- style: active === tool.id ? { color: "red" } : {},
218
- }} popoverProps={{
219
- content: <div>{tool.name}</div>,
220
- trigger: "hover",
221
- placement: "right",
222
- }} items={[]}/>))}
223
- {!dragOnly && (<>
224
- <ButtonTools buttonProps={{
225
- icon: <CopyPlus />,
226
- type: "text",
227
- name: "duplicate",
228
- onClick: () => handleDuplicateComponent(),
229
- }} items={[]} popoverProps={{
230
- content: <div>Duplicate</div>,
231
- trigger: "hover",
232
- placement: "right",
233
- }}/>
234
- <ButtonTools buttonProps={{
235
- onClick: () => handleRemoveComponent(),
236
- icon: <Trash />,
237
- type: "text",
238
- name: "trash",
239
- }} items={[]} popoverProps={{
240
- content: <div>Trash</div>,
241
- trigger: "hover",
242
- placement: "right",
243
- }}/>
244
- <ButtonTools buttonProps={{
245
- onClick: () => handleOverride(),
246
- icon: <Layers2 />,
247
- type: "text",
248
- name: "override",
249
- }} items={[]} popoverProps={{
250
- content: <div>Override Right</div>,
251
- trigger: "hover",
252
- placement: "right",
253
- }}/>
254
- <ButtonTools buttonProps={{
255
- onClick: () => handleOverrideLeft(),
256
- icon: <Layers />,
257
- type: "text",
258
- name: "override",
259
- }} items={[]} popoverProps={{
260
- content: <div>Override Left</div>,
261
- trigger: "hover",
262
- placement: "right",
263
- }}/>
264
-
265
- <Divider />
266
- {actionsTools === null || actionsTools === void 0 ? void 0 : actionsTools.map((tool) => (<ButtonTools key={tool.id} buttonProps={{
224
+ return (_jsxs("div", { className: "h-full left-0 flex flex-col items-center border-r-2 border-gray-300 bg-white px-2 pt-4", children: [tools === null || tools === void 0 ? void 0 : tools.map((tool) => (_jsx(ButtonTools, { buttonProps: {
225
+ icon: tool.icon,
226
+ type: "text",
227
+ name: tool.name,
228
+ onClick: () => hanldeSelectTool(tool.id),
229
+ style: active === tool.id ? { color: "red" } : {},
230
+ }, popoverProps: {
231
+ content: _jsx("div", { children: tool.name }),
232
+ trigger: "hover",
233
+ placement: "right",
234
+ }, items: [] }, tool.id))), !dragOnly && (_jsxs(_Fragment, { children: [_jsx(ButtonTools, { buttonProps: {
235
+ icon: _jsx(CopyPlus, {}),
236
+ type: "text",
237
+ name: "duplicate",
238
+ onClick: () => handleDuplicateComponent(),
239
+ }, items: [], popoverProps: {
240
+ content: _jsx("div", { children: "Duplicate" }),
241
+ trigger: "hover",
242
+ placement: "right",
243
+ } }), _jsx(ButtonTools, { buttonProps: {
244
+ onClick: () => handleRemoveComponent(),
245
+ icon: _jsx(Trash, {}),
246
+ type: "text",
247
+ name: "trash",
248
+ }, items: [], popoverProps: {
249
+ content: _jsx("div", { children: "Trash" }),
250
+ trigger: "hover",
251
+ placement: "right",
252
+ } }), _jsx(ButtonTools, { buttonProps: {
253
+ onClick: () => handleOverride(),
254
+ icon: _jsx(Layers2, {}),
255
+ type: "text",
256
+ name: "override",
257
+ }, items: [], popoverProps: {
258
+ content: _jsx("div", { children: "Override Right" }),
259
+ trigger: "hover",
260
+ placement: "right",
261
+ } }), _jsx(ButtonTools, { buttonProps: {
262
+ onClick: () => handleOverrideLeft(),
263
+ icon: _jsx(Layers, {}),
264
+ type: "text",
265
+ name: "override",
266
+ }, items: [], popoverProps: {
267
+ content: _jsx("div", { children: "Override Left" }),
268
+ trigger: "hover",
269
+ placement: "right",
270
+ } }), _jsx(Divider, {}), actionsTools === null || actionsTools === void 0 ? void 0 : actionsTools.map((tool) => (_jsx(ButtonTools, { buttonProps: {
271
+ icon: tool.icon,
272
+ type: "text",
273
+ name: tool.name,
274
+ onClick: () => hanldeSelectTool(tool.id),
275
+ style: active === tool.id ? { color: "red" } : {},
276
+ }, popoverProps: {
277
+ content: _jsx("div", { children: tool.name }),
278
+ trigger: "hover",
279
+ placement: "right",
280
+ }, items: [] }, tool.id))), _jsx(Divider, {})] })), controlTools === null || controlTools === void 0 ? void 0 : controlTools.map((tool) => (_jsx(ButtonTools, { buttonProps: {
267
281
  icon: tool.icon,
268
282
  type: "text",
269
283
  name: tool.name,
270
284
  onClick: () => hanldeSelectTool(tool.id),
271
285
  style: active === tool.id ? { color: "red" } : {},
272
- }} popoverProps={{
273
- content: <div>{tool.name}</div>,
286
+ }, popoverProps: {
287
+ content: _jsx("div", { children: tool.name }),
274
288
  trigger: "hover",
275
289
  placement: "right",
276
- }} items={[]}/>))}
277
-
278
- <Divider />
279
- </>)}
280
- {controlTools === null || controlTools === void 0 ? void 0 : controlTools.map((tool) => (<ButtonTools key={tool.id} buttonProps={{
281
- icon: tool.icon,
282
- type: "text",
283
- name: tool.name,
284
- onClick: () => hanldeSelectTool(tool.id),
285
- style: active === tool.id ? { color: "red" } : {},
286
- }} popoverProps={{
287
- content: <div>{tool.name}</div>,
288
- trigger: "hover",
289
- placement: "right",
290
- }} items={[]}/>))}
291
- <ColorPicker value={color} onChange={handleChangeColorBackground}>
292
- <Button icon={<PaintBucket />} type="text" name="Background Color" onClick={() => hanldeSelectTool("background-color")} style={active === "background-color" ? { color: "red" } : {}}/>
293
- </ColorPicker>
294
- <Button icon={preview ? <EyeOff /> : <Eye />} type="text" name="Preview" onClick={handleOpenModalPreview} style={active === "preview" ? { color: "red" } : {}}/>
295
- <Button icon={<Grid />} type="text" name="Grid" onClick={() => toggleGrid()}/>
296
- </div>);
290
+ }, items: [] }, tool.id))), _jsx(ColorPicker, { value: color, onChange: handleChangeColorBackground, children: _jsx(Button, { icon: _jsx(PaintBucket, {}), type: "text", name: "Background Color", onClick: () => hanldeSelectTool("background-color"), style: active === "background-color" ? { color: "red" } : {} }) }), _jsx(Button, { icon: preview ? _jsx(EyeOff, {}) : _jsx(Eye, {}), type: "text", name: "Preview", onClick: handleOpenModalPreview, style: active === "preview" ? { color: "red" } : {} }), _jsx(Button, { icon: _jsx(Grid, {}), type: "text", name: "Grid", onClick: () => toggleGrid() })] }));
297
291
  };
298
292
  export default SideTool;
@@ -15,5 +15,5 @@ export interface LayerViewProps {
15
15
  containerProps?: any;
16
16
  svgProps?: any;
17
17
  }
18
- declare const LayerView: (props: LayerViewProps) => import("react").JSX.Element;
18
+ declare const LayerView: (props: LayerViewProps) => import("react/jsx-runtime").JSX.Element;
19
19
  export default LayerView;
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  "use client";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
3
4
  import { useEffect, useMemo, useRef, useState } from "react";
4
5
  import { TransformWrapper, TransformComponent, } from "react-zoom-pan-pinch";
5
6
  import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
@@ -180,47 +181,39 @@ const LayerView = (props) => {
180
181
  }
181
182
  };
182
183
  }, []);
183
- return (<div className="relative w-full h-full flex-1" ref={containerRef} style={{
184
+ return (_jsx("div", Object.assign({ className: "relative w-full h-full flex-1", ref: containerRef, style: {
184
185
  height: "100vh",
185
186
  overflow: "auto",
186
187
  WebkitOverflowScrolling: "touch",
187
188
  touchAction: "pan-y",
188
- }} {...props.containerProps}>
189
- <TransformWrapper ref={transformRef} {...props.transformProps} disabled={fingerCount === 1 && scale === 1} disablePadding={true}
190
- // panning={{
191
- // disabled: false,
192
- // velocityDisabled: true,
193
- // }}
194
- // limitToBounds={false}
195
- // doubleClick={{ disabled: true }}
196
- // pinch={{ disabled: false }}
197
- // wheel={{ disabled: true }}
198
- // disabled={true}
199
- // disablePadding={true}
200
- centerZoomedOut={true} onTransformed={({ state: { scale } }) => setScale(scale)} minScale={1} maxScale={1000} initialScale={1}
201
- // pinch={{ step: 1 }}
202
- smooth={true}>
203
- <TransformComponent wrapperStyle={{
204
- width: "100%",
205
- height: "100%",
206
- overflow: "visible",
207
- }} contentStyle={{
208
- width: "100%",
209
- height: "100%",
210
- }}>
211
- <svg {...props.svgProps} id="workspace" ref={svgRef} width="100%" height="100%" viewBox={`${boundingBox.minX} ${boundingBox.minY} ${boundingBox.width} ${boundingBox.height}`} className="h-full" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet" style={{
212
- background: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : defaultBackground,
213
- display: "block",
214
- pointerEvents: "auto",
215
- // touchAction: "pan-y",
216
- }}>
217
- <Layers mode="view" components={[
218
- ...((extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor.length) > 0 ? extraComponentsEditor : []),
219
- ...renderElements(componentsEditor, mappingKey, colorMatchKey),
220
- ]} onClick={handleSelectComponent} selectedTable={selectedTable} selectedTableColor={selectedTableColor}/>
221
- </svg>
222
- </TransformComponent>
223
- </TransformWrapper>
224
- </div>);
189
+ } }, props.containerProps, { children: _jsx(TransformWrapper, Object.assign({ ref: transformRef }, props.transformProps, { disabled: fingerCount === 1 && scale === 1, disablePadding: true,
190
+ // panning={{
191
+ // disabled: false,
192
+ // velocityDisabled: true,
193
+ // }}
194
+ // limitToBounds={false}
195
+ // doubleClick={{ disabled: true }}
196
+ // pinch={{ disabled: false }}
197
+ // wheel={{ disabled: true }}
198
+ // disabled={true}
199
+ // disablePadding={true}
200
+ centerZoomedOut: true, onTransformed: ({ state: { scale } }) => setScale(scale), minScale: 1, maxScale: 1000, initialScale: 1,
201
+ // pinch={{ step: 1 }}
202
+ smooth: true, children: _jsx(TransformComponent, { wrapperStyle: {
203
+ width: "100%",
204
+ height: "100%",
205
+ overflow: "visible",
206
+ }, contentStyle: {
207
+ width: "100%",
208
+ height: "100%",
209
+ }, children: _jsx("svg", Object.assign({}, props.svgProps, { id: "workspace", ref: svgRef, width: "100%", height: "100%", viewBox: `${boundingBox.minX} ${boundingBox.minY} ${boundingBox.width} ${boundingBox.height}`, className: "h-full", xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid meet", style: {
210
+ background: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : defaultBackground,
211
+ display: "block",
212
+ pointerEvents: "auto",
213
+ // touchAction: "pan-y",
214
+ }, children: _jsx(Layers, { mode: "view", components: [
215
+ ...((extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor.length) > 0 ? extraComponentsEditor : []),
216
+ ...renderElements(componentsEditor, mappingKey, colorMatchKey),
217
+ ], onClick: handleSelectComponent, selectedTable: selectedTable, selectedTableColor: selectedTableColor }) })) }) })) })));
225
218
  };
226
219
  export default LayerView;