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.
Files changed (145) hide show
  1. package/dist/app/constant.d.ts +1 -1
  2. package/dist/app/graph-view/page.d.ts +1 -0
  3. package/dist/app/graph-view/page.js +343 -0
  4. package/dist/app/graph-view/page.jsx +445 -0
  5. package/dist/app/graph-view-new/constant.d.ts +581 -0
  6. package/dist/app/graph-view-new/constant.js +6973 -0
  7. package/dist/app/graph-view-new/page.d.ts +1 -0
  8. package/dist/app/graph-view-new/page.js +71 -0
  9. package/dist/app/graph-view-new/page.jsx +98 -0
  10. package/dist/app/layout.d.ts +1 -1
  11. package/dist/app/new-board/page.d.ts +1 -1
  12. package/dist/app/new-board/page.js +43 -7
  13. package/dist/app/new-board/page.jsx +45 -12
  14. package/dist/app/old-board/page.d.ts +1 -2
  15. package/dist/app/only-view/chair.d.ts +1 -1
  16. package/dist/app/only-view/chair.js +2 -10
  17. package/dist/app/only-view/page.d.ts +1 -1
  18. package/dist/app/only-view/user.d.ts +1 -1
  19. package/dist/app/only-view/user.js +2 -10
  20. package/dist/app/page.d.ts +1 -1
  21. package/dist/app/test/page.d.ts +1 -2
  22. package/dist/app/v2/page.d.ts +1 -1
  23. package/dist/components/button-tools/index.d.ts +1 -1
  24. package/dist/components/button-tools/index.js +7 -5
  25. package/dist/components/button-tools/index.jsx +21 -9
  26. package/dist/components/form-tools/label.d.ts +1 -1
  27. package/dist/components/form-tools/label.js +9 -20
  28. package/dist/components/form-tools/label.jsx +38 -28
  29. package/dist/components/form-tools/shape.d.ts +1 -1
  30. package/dist/components/form-tools/shape.js +5 -5
  31. package/dist/components/form-tools/shape.jsx +8 -8
  32. package/dist/components/input/number-indicator.d.ts +1 -1
  33. package/dist/components/joystick/index.d.ts +1 -2
  34. package/dist/components/layer/index.d.ts +1 -1
  35. package/dist/components/layer-v2/index.d.ts +1 -1
  36. package/dist/components/layer-v3/index.d.ts +1 -1
  37. package/dist/components/layer-v3/index.js +44 -3
  38. package/dist/components/layer-v3/index.jsx +120 -3
  39. package/dist/components/layer-v4/index.d.ts +1 -1
  40. package/dist/components/layer-v5/constant.d.ts +60 -0
  41. package/dist/components/layer-v5/constant.js +93 -0
  42. package/dist/components/layer-v5/index.d.ts +24 -0
  43. package/dist/components/layer-v5/index.js +927 -0
  44. package/dist/components/layer-v5/index.jsx +1049 -0
  45. package/dist/components/lib/index.d.ts +1 -1
  46. package/dist/components/modal-preview/index.d.ts +1 -1
  47. package/dist/features/board/index.d.ts +1 -1
  48. package/dist/features/board-v2/index.d.ts +1 -2
  49. package/dist/features/board-v3/index.d.ts +1 -1
  50. package/dist/features/board-v3/index.js +350 -72
  51. package/dist/features/board-v3/index.jsx +369 -75
  52. package/dist/features/board-v3/resize-element.js +5 -0
  53. package/dist/features/board-v3/utils.d.ts +8 -0
  54. package/dist/features/board-v3/utils.js +23 -7
  55. package/dist/features/navbar/index.d.ts +1 -1
  56. package/dist/features/package/index.d.ts +3 -1
  57. package/dist/features/package/index.js +1 -1
  58. package/dist/features/package/index.jsx +6 -1
  59. package/dist/features/panel/index.d.ts +9 -1
  60. package/dist/features/panel/index.js +160 -38
  61. package/dist/features/panel/index.jsx +173 -46
  62. package/dist/features/panel/polygon.d.ts +2 -0
  63. package/dist/features/panel/polygon.js +44 -0
  64. package/dist/features/panel/polygon.jsx +70 -0
  65. package/dist/features/panel/select-tool.d.ts +1 -1
  66. package/dist/features/panel/select-tool.js +3 -0
  67. package/dist/features/panel/select-tool.jsx +3 -0
  68. package/dist/features/panel/selected-group.d.ts +1 -1
  69. package/dist/features/panel/selected-group.js +24 -26
  70. package/dist/features/panel/selected-group.jsx +56 -51
  71. package/dist/features/panel/square-circle-tool.d.ts +1 -1
  72. package/dist/features/panel/table-seat-circle.d.ts +1 -1
  73. package/dist/features/panel/table-seat-square.d.ts +1 -1
  74. package/dist/features/panel/text-tool.d.ts +1 -1
  75. package/dist/features/panel/text-tool.js +17 -2
  76. package/dist/features/panel/text-tool.jsx +19 -2
  77. package/dist/features/panel/upload-tool.d.ts +1 -1
  78. package/dist/features/panel/upload-tool.js +17 -3
  79. package/dist/features/panel/upload-tool.jsx +23 -4
  80. package/dist/features/side-tool/index.d.ts +1 -1
  81. package/dist/features/side-tool/index.js +43 -6
  82. package/dist/features/side-tool/index.jsx +47 -10
  83. package/dist/features/view-only/index.d.ts +1 -1
  84. package/dist/features/view-only-2/index.d.ts +1 -1
  85. package/dist/features/view-only-3/index.d.ts +1 -1
  86. package/dist/features/view-only-4/connect-handle.d.ts +13 -0
  87. package/dist/features/view-only-4/connect-handle.js +23 -0
  88. package/dist/features/view-only-4/connect-handle.jsx +30 -0
  89. package/dist/features/view-only-4/connection-layer.d.ts +21 -0
  90. package/dist/features/view-only-4/connection-layer.js +219 -0
  91. package/dist/features/view-only-4/connection-layer.jsx +291 -0
  92. package/dist/features/view-only-4/index.d.ts +99 -0
  93. package/dist/features/view-only-4/index.js +684 -0
  94. package/dist/features/view-only-4/index.jsx +722 -0
  95. package/dist/features/view-only-4/integration-guide.d.ts +0 -0
  96. package/dist/features/view-only-4/integration-guide.js +0 -0
  97. package/dist/features/view-only-4/use-connection-graph.d.ts +41 -0
  98. package/dist/features/view-only-4/use-connection-graph.js +182 -0
  99. package/dist/features/view-only-4/utils.d.ts +74 -0
  100. package/dist/features/view-only-4/utils.js +106 -0
  101. package/dist/features/view-only-5/connect-handle.d.ts +30 -0
  102. package/dist/features/view-only-5/connect-handle.js +88 -0
  103. package/dist/features/view-only-5/connect-handle.jsx +96 -0
  104. package/dist/features/view-only-5/connection-layer.d.ts +34 -0
  105. package/dist/features/view-only-5/connection-layer.js +182 -0
  106. package/dist/features/view-only-5/connection-layer.jsx +265 -0
  107. package/dist/features/view-only-5/index.d.ts +102 -0
  108. package/dist/features/view-only-5/index.js +585 -0
  109. package/dist/features/view-only-5/index.jsx +614 -0
  110. package/dist/features/view-only-5/use-connection-graph.d.ts +57 -0
  111. package/dist/features/view-only-5/use-connection-graph.js +196 -0
  112. package/dist/features/view-only-5/utils.d.ts +52 -0
  113. package/dist/features/view-only-5/utils.js +80 -0
  114. package/dist/features/view-only-6/connect-handle.d.ts +13 -0
  115. package/dist/features/view-only-6/connect-handle.js +20 -0
  116. package/dist/features/view-only-6/connect-handle.jsx +21 -0
  117. package/dist/features/view-only-6/connection-layer.d.ts +22 -0
  118. package/dist/features/view-only-6/connection-layer.js +191 -0
  119. package/dist/features/view-only-6/connection-layer.jsx +244 -0
  120. package/dist/features/view-only-6/index.d.ts +99 -0
  121. package/dist/features/view-only-6/index.js +687 -0
  122. package/dist/features/view-only-6/index.jsx +724 -0
  123. package/dist/features/view-only-6/use-connection-graph.d.ts +26 -0
  124. package/dist/features/view-only-6/use-connection-graph.js +103 -0
  125. package/dist/features/view-only-6/utils.d.ts +66 -0
  126. package/dist/features/view-only-6/utils.js +96 -0
  127. package/dist/features/view-only-7/connect-handle.d.ts +13 -0
  128. package/dist/features/view-only-7/connect-handle.js +23 -0
  129. package/dist/features/view-only-7/connect-handle.jsx +30 -0
  130. package/dist/features/view-only-7/connection-layer.d.ts +22 -0
  131. package/dist/features/view-only-7/connection-layer.js +165 -0
  132. package/dist/features/view-only-7/connection-layer.jsx +217 -0
  133. package/dist/features/view-only-7/index.d.ts +99 -0
  134. package/dist/features/view-only-7/index.js +687 -0
  135. package/dist/features/view-only-7/index.jsx +724 -0
  136. package/dist/features/view-only-7/use-connection-graph.d.ts +26 -0
  137. package/dist/features/view-only-7/use-connection-graph.js +104 -0
  138. package/dist/features/view-only-7/utils.d.ts +69 -0
  139. package/dist/features/view-only-7/utils.js +144 -0
  140. package/dist/index.d.ts +2 -1
  141. package/dist/index.js +2 -1
  142. package/dist/provider/redux-provider.d.ts +1 -1
  143. package/dist/provider/store-provider.d.ts +1 -1
  144. package/dist/seat-editor.css +1 -1
  145. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ export default function GraphView(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,71 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import clsx from "clsx";
4
+ import LayerView from "../../features/view-only-5";
5
+ import { data } from "./constant";
6
+ import { Button } from "antd";
7
+ import { useMemo, useState } from "react";
8
+ export default function GraphView() {
9
+ const [isConnecting, setIsConnecting] = useState(false);
10
+ const [isSelectNode, setIsSelectNode] = useState(false);
11
+ const [sections, setSections] = useState([
12
+ {
13
+ id: 1,
14
+ name: "Section 1",
15
+ color: "#1e2d4a",
16
+ items: [],
17
+ },
18
+ {
19
+ id: 2,
20
+ name: "Section 2",
21
+ color: "#F6F6F6",
22
+ items: [],
23
+ }
24
+ ]);
25
+ const [sectionActive, setSectionActive] = useState(null);
26
+ const componentSection = useMemo(() => data === null || data === void 0 ? void 0 : data.map((data) => {
27
+ var _a;
28
+ return (Object.assign(Object.assign({}, data), { section: (_a = sections.find((section) => section.items.some((item) => item.uuid_table === data.uuid_table))) === null || _a === void 0 ? void 0 : _a.id }));
29
+ }), [data, sections]);
30
+ const onMakeSelection = (datas) => {
31
+ setSections((prev) => {
32
+ const uuidSet = new Set(datas.map((d) => d.uuid_table));
33
+ return prev.map((section) => {
34
+ // remove item dari section lain
35
+ if (section.id !== sectionActive) {
36
+ return Object.assign(Object.assign({}, section), { items: section.items.filter((item) => !uuidSet.has(item.uuid_table)) });
37
+ }
38
+ // section active
39
+ const filteredItems = section.items.filter((item) => !uuidSet.has(item.uuid_table));
40
+ const newItems = datas.filter((d) => !section.items.some((item) => item.uuid_table === d.uuid_table));
41
+ return Object.assign(Object.assign({}, section), { items: [...filteredItems, ...newItems] });
42
+ });
43
+ });
44
+ };
45
+ const handleSelectItem = (data) => {
46
+ setSections((prev) => prev.map((section) => {
47
+ if (section.id !== sectionActive)
48
+ return section;
49
+ const isExist = section.items.some((item) => item.uuid_table === data.uuid_table);
50
+ return Object.assign(Object.assign({}, section), { items: isExist
51
+ ? section.items.filter((item) => item.uuid_table !== data.uuid_table)
52
+ : [...section.items, data] });
53
+ }));
54
+ };
55
+ return (_jsx("div", { className: "w-full h-screen flex relative", children: _jsxs("div", { className: "flex", children: [_jsxs("div", { className: "absolute top-0 left-0 z-10 flex gap-2", children: [_jsx(Button, { type: "primary", onClick: () => setIsConnecting(!isConnecting), children: isConnecting ? "Disconnect" : "Connect" }), _jsx(Button, { type: "primary", onClick: () => setIsSelectNode(!isSelectNode), children: isSelectNode ? "Deselect" : "Select" })] }), _jsx(LayerView, { componentProps: componentSection, statusKey: "section", defaultBackground: "#1e2d4a", mappingKey: "properties", keyNode: "nodes", onEdgesChange: (table, edges) => console.log({ edges, table }), isConnectEdge: isConnecting, isSelectNode: isSelectNode, onSelectComponent: handleSelectItem, actionPrivileged: {
56
+ select: true,
57
+ }, onMakeSelection: onMakeSelection, tableMatchKey: [
58
+ {
59
+ key: 1,
60
+ properties: {
61
+ fill: "#1e2d4a",
62
+ },
63
+ },
64
+ {
65
+ key: 2,
66
+ properties: {
67
+ fill: "#F6F6F6",
68
+ },
69
+ },
70
+ ] }), _jsx("div", { className: "w-1/5 p-4", children: _jsxs("div", { className: "rounded-lg bg-white p-4", children: [_jsx("h1", { className: "text-2xl font-bold", children: "Section" }), sections.map((section) => (_jsxs("div", { className: clsx("font-bold text-white rounded-md p-2 cursor-pointer", sectionActive === section.id && "!bg-blue-500"), style: { backgroundColor: section.color }, onClick: () => setSectionActive(section.id), children: [_jsx("h2", { className: "text-lg", children: section.name }), section.items.length > 0 && (_jsx("ul", { className: "list-disc pl-5 bg-opacity-50 bg-white p-2 rounded ", children: section.items.map((item) => (_jsx("li", { children: item.name }, item.id))) }))] }, section.id)))] }) }), _jsx("div", { className: "w-1/5 p-4", children: _jsx("div", { className: "rounded-lg bg-white p-4", children: _jsx("h1", { className: "text-2xl font-bold", children: "Nodes" }) }) })] }) }));
71
+ }
@@ -0,0 +1,98 @@
1
+ "use client";
2
+ import clsx from "clsx";
3
+ import LayerView from "../../features/view-only-5";
4
+ import { data } from "./constant";
5
+ import { Button } from "antd";
6
+ import { useMemo, useState } from "react";
7
+ export default function GraphView() {
8
+ const [isConnecting, setIsConnecting] = useState(false);
9
+ const [isSelectNode, setIsSelectNode] = useState(false);
10
+ const [sections, setSections] = useState([
11
+ {
12
+ id: 1,
13
+ name: "Section 1",
14
+ color: "#1e2d4a",
15
+ items: [],
16
+ },
17
+ {
18
+ id: 2,
19
+ name: "Section 2",
20
+ color: "#F6F6F6",
21
+ items: [],
22
+ }
23
+ ]);
24
+ const [sectionActive, setSectionActive] = useState(null);
25
+ const componentSection = useMemo(() => data === null || data === void 0 ? void 0 : data.map((data) => {
26
+ var _a;
27
+ return (Object.assign(Object.assign({}, data), { section: (_a = sections.find((section) => section.items.some((item) => item.uuid_table === data.uuid_table))) === null || _a === void 0 ? void 0 : _a.id }));
28
+ }), [data, sections]);
29
+ const onMakeSelection = (datas) => {
30
+ setSections((prev) => {
31
+ const uuidSet = new Set(datas.map((d) => d.uuid_table));
32
+ return prev.map((section) => {
33
+ // remove item dari section lain
34
+ if (section.id !== sectionActive) {
35
+ return Object.assign(Object.assign({}, section), { items: section.items.filter((item) => !uuidSet.has(item.uuid_table)) });
36
+ }
37
+ // section active
38
+ const filteredItems = section.items.filter((item) => !uuidSet.has(item.uuid_table));
39
+ const newItems = datas.filter((d) => !section.items.some((item) => item.uuid_table === d.uuid_table));
40
+ return Object.assign(Object.assign({}, section), { items: [...filteredItems, ...newItems] });
41
+ });
42
+ });
43
+ };
44
+ const handleSelectItem = (data) => {
45
+ setSections((prev) => prev.map((section) => {
46
+ if (section.id !== sectionActive)
47
+ return section;
48
+ const isExist = section.items.some((item) => item.uuid_table === data.uuid_table);
49
+ return Object.assign(Object.assign({}, section), { items: isExist
50
+ ? section.items.filter((item) => item.uuid_table !== data.uuid_table)
51
+ : [...section.items, data] });
52
+ }));
53
+ };
54
+ return (<div className="w-full h-screen flex relative">
55
+ <div className="flex">
56
+ <div className="absolute top-0 left-0 z-10 flex gap-2">
57
+ <Button type="primary" onClick={() => setIsConnecting(!isConnecting)}>
58
+ {isConnecting ? "Disconnect" : "Connect"}
59
+ </Button>
60
+ <Button type="primary" onClick={() => setIsSelectNode(!isSelectNode)}>
61
+ {isSelectNode ? "Deselect" : "Select"}
62
+ </Button>
63
+ </div>
64
+ <LayerView componentProps={componentSection} statusKey="section" defaultBackground="#1e2d4a" mappingKey="properties" keyNode="nodes" onEdgesChange={(table, edges) => console.log({ edges, table })} isConnectEdge={isConnecting} isSelectNode={isSelectNode} onSelectComponent={handleSelectItem} actionPrivileged={{
65
+ select: true,
66
+ }} onMakeSelection={onMakeSelection} tableMatchKey={[
67
+ {
68
+ key: 1,
69
+ properties: {
70
+ fill: "#1e2d4a",
71
+ },
72
+ },
73
+ {
74
+ key: 2,
75
+ properties: {
76
+ fill: "#F6F6F6",
77
+ },
78
+ },
79
+ ]}/>
80
+ <div className="w-1/5 p-4">
81
+ <div className="rounded-lg bg-white p-4">
82
+ <h1 className="text-2xl font-bold">Section</h1>
83
+ {sections.map((section) => (<div key={section.id} className={clsx("font-bold text-white rounded-md p-2 cursor-pointer", sectionActive === section.id && "!bg-blue-500")} style={{ backgroundColor: section.color }} onClick={() => setSectionActive(section.id)}>
84
+ <h2 className="text-lg">{section.name}</h2>
85
+ {section.items.length > 0 && (<ul className="list-disc pl-5 bg-opacity-50 bg-white p-2 rounded ">
86
+ {section.items.map((item) => (<li key={item.id}>{item.name}</li>))}
87
+ </ul>)}
88
+ </div>))}
89
+ </div>
90
+ </div>
91
+ <div className="w-1/5 p-4">
92
+ <div className="rounded-lg bg-white p-4">
93
+ <h1 className="text-2xl font-bold">Nodes</h1>
94
+ </div>
95
+ </div>
96
+ </div>
97
+ </div>);
98
+ }
@@ -3,4 +3,4 @@ import "./globals.css";
3
3
  export declare const metadata: Metadata;
4
4
  export default function RootLayout({ children, }: Readonly<{
5
5
  children: React.ReactNode;
6
- }>): import("react").JSX.Element;
6
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export default function NewBoard(): import("react").JSX.Element;
1
+ export default function NewBoard(): import("react/jsx-runtime").JSX.Element;
@@ -6,6 +6,40 @@ import SeatEditor from "../../features/package";
6
6
  // import LayerView from "@/features/view-only-2";
7
7
  // import SeatEdit from "@/features/package";
8
8
  import { data4 } from "../constant";
9
+ const background = [
10
+ {
11
+ id: "1776070944676",
12
+ shape: "polygon",
13
+ fill: "#ef0606",
14
+ points: [
15
+ {
16
+ x: 100,
17
+ y: 500,
18
+ },
19
+ {
20
+ x: 400,
21
+ y: 500,
22
+ },
23
+ {
24
+ x: 400,
25
+ y: 400,
26
+ },
27
+ {
28
+ x: 100,
29
+ y: 400,
30
+ },
31
+ {
32
+ x: 100,
33
+ y: 500,
34
+ },
35
+ ],
36
+ rotation: 0,
37
+ x: 0,
38
+ y: 0,
39
+ width: 340,
40
+ height: 179,
41
+ },
42
+ ];
9
43
  export default function NewBoard() {
10
44
  const [initialValue, setInitialValue] = useState([]);
11
45
  const [extraComponents, setExtraComponents] = useState([]);
@@ -24,7 +58,8 @@ export default function NewBoard() {
24
58
  });
25
59
  return test;
26
60
  };
27
- const test = [{
61
+ const test = [
62
+ {
28
63
  test: "test",
29
64
  properties: {
30
65
  shape: "image-table",
@@ -34,8 +69,9 @@ export default function NewBoard() {
34
69
  y: 100,
35
70
  backgroundColor: "#ffffff",
36
71
  src: "dummyImage",
37
- }
38
- }];
72
+ },
73
+ },
74
+ ];
39
75
  // const ayo =test?.map((item) => {
40
76
  // return {
41
77
  // properties: item?.properties?.
@@ -45,15 +81,15 @@ export default function NewBoard() {
45
81
  component: true,
46
82
  extraComponent: true,
47
83
  }, action: handleUploadImage, mappingKey: "properties", onCurrentStateChange: (setState) => {
48
- var _a, _b, _c, _d;
84
+ var _a, _b, _c;
49
85
  if (((_a = setState === null || setState === void 0 ? void 0 : setState.components) === null || _a === void 0 ? void 0 : _a.length) > 0) {
50
86
  setInitialValue((_b = setState.components) !== null && _b !== void 0 ? _b : []);
51
87
  }
52
88
  if (setState === null || setState === void 0 ? void 0 : setState.background) {
53
- setBackgroundColor(setState.background);
89
+ // setBackgroundColor(setState.background);
54
90
  }
55
- if (((_c = setState === null || setState === void 0 ? void 0 : setState.extraComponents) === null || _c === void 0 ? void 0 : _c.length) > 0) {
56
- setExtraComponents((_d = setState.extraComponents) !== null && _d !== void 0 ? _d : []);
91
+ if (setState === null || setState === void 0 ? void 0 : setState.extraComponents) {
92
+ setExtraComponents((_c = setState.extraComponents) !== null && _c !== void 0 ? _c : []);
57
93
  }
58
94
  }, extraComponentProps: extraComponents, defaultBackground: backgroundColor,
59
95
  // dragOnly={true}
@@ -5,6 +5,40 @@ import SeatEditor from "../../features/package";
5
5
  // import LayerView from "@/features/view-only-2";
6
6
  // import SeatEdit from "@/features/package";
7
7
  import { data4 } from "../constant";
8
+ const background = [
9
+ {
10
+ id: "1776070944676",
11
+ shape: "polygon",
12
+ fill: "#ef0606",
13
+ points: [
14
+ {
15
+ x: 100,
16
+ y: 500,
17
+ },
18
+ {
19
+ x: 400,
20
+ y: 500,
21
+ },
22
+ {
23
+ x: 400,
24
+ y: 400,
25
+ },
26
+ {
27
+ x: 100,
28
+ y: 400,
29
+ },
30
+ {
31
+ x: 100,
32
+ y: 500,
33
+ },
34
+ ],
35
+ rotation: 0,
36
+ x: 0,
37
+ y: 0,
38
+ width: 340,
39
+ height: 179,
40
+ },
41
+ ];
8
42
  export default function NewBoard() {
9
43
  const [initialValue, setInitialValue] = useState([]);
10
44
  const [extraComponents, setExtraComponents] = useState([]);
@@ -23,7 +57,8 @@ export default function NewBoard() {
23
57
  });
24
58
  return test;
25
59
  };
26
- const test = [{
60
+ const test = [
61
+ {
27
62
  test: "test",
28
63
  properties: {
29
64
  shape: "image-table",
@@ -33,8 +68,9 @@ export default function NewBoard() {
33
68
  y: 100,
34
69
  backgroundColor: "#ffffff",
35
70
  src: "dummyImage",
36
- }
37
- }];
71
+ },
72
+ },
73
+ ];
38
74
  // const ayo =test?.map((item) => {
39
75
  // return {
40
76
  // properties: item?.properties?.
@@ -42,9 +78,7 @@ export default function NewBoard() {
42
78
  // })
43
79
  return (<>
44
80
  <div className="w-full h-screen flex flex-col relative justify-center">
45
- <div className="w-full h-[1000px] bg-white border-r border-gray-200">
46
-
47
- </div>
81
+ <div className="w-full h-[1000px] bg-white border-r border-gray-200"></div>
48
82
  {/* <button className="bg-blue-500 text-white px-4 py-2 rounded"
49
83
  onClick={() => setViewOnly(!viewOnly)}
50
84
  >
@@ -55,15 +89,15 @@ export default function NewBoard() {
55
89
  component: true,
56
90
  extraComponent: true,
57
91
  }} action={handleUploadImage} mappingKey="properties" onCurrentStateChange={(setState) => {
58
- var _a, _b, _c, _d;
92
+ var _a, _b, _c;
59
93
  if (((_a = setState === null || setState === void 0 ? void 0 : setState.components) === null || _a === void 0 ? void 0 : _a.length) > 0) {
60
94
  setInitialValue((_b = setState.components) !== null && _b !== void 0 ? _b : []);
61
95
  }
62
96
  if (setState === null || setState === void 0 ? void 0 : setState.background) {
63
- setBackgroundColor(setState.background);
97
+ // setBackgroundColor(setState.background);
64
98
  }
65
- if (((_c = setState === null || setState === void 0 ? void 0 : setState.extraComponents) === null || _c === void 0 ? void 0 : _c.length) > 0) {
66
- setExtraComponents((_d = setState.extraComponents) !== null && _d !== void 0 ? _d : []);
99
+ if (setState === null || setState === void 0 ? void 0 : setState.extraComponents) {
100
+ setExtraComponents((_c = setState.extraComponents) !== null && _c !== void 0 ? _c : []);
67
101
  }
68
102
  }} extraComponentProps={extraComponents} defaultBackground={backgroundColor}
69
103
  // dragOnly={true}
@@ -73,8 +107,7 @@ export default function NewBoard() {
73
107
  // return null
74
108
  // }}
75
109
  defaultSeatCountKey="capacity"/>
76
- </div>
77
-
110
+ </div>
78
111
  </div>
79
112
  </>);
80
113
  }
@@ -1,3 +1,2 @@
1
- import React from "react";
2
- declare const SeatEditor: () => React.JSX.Element;
1
+ declare const SeatEditor: () => import("react/jsx-runtime").JSX.Element;
3
2
  export default SeatEditor;
@@ -1 +1 @@
1
- export function ChairIcon(): import("react").JSX.Element;
1
+ export function ChairIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  export const ChairIcon = () => {
2
- return (<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
3
- <g clip-path="url(#clip0_3019_14165)">
4
- <path d="M15.9717 7.5339V4.70339C15.9717 3.07627 14.7076 2.5 13.5189 2.5H6.46226C5.27359 2.5 4.00943 3.07627 4.00943 4.70339V7.5339C3.14151 7.73729 2.5 8.4322 2.5 9.27966V13.822C2.5 15.161 3.5 15.6864 4.48113 15.7373V16.8898C4.48113 17.2288 4.78302 17.5 5.16038 17.5H5.85849C6.23585 17.5 6.53774 17.2288 6.53774 16.8898V15.7373H13.4623V16.8898C13.4623 17.2288 13.7642 17.5 14.1415 17.5H14.8396C15.217 17.5 15.5189 17.2288 15.5189 16.8898V15.7373C16.9717 15.6695 17.5 14.7203 17.5 13.822V9.26271C17.4623 8.4322 16.8208 7.72034 15.9717 7.5339ZM4.68868 4.70339C4.68868 3.31356 5.80189 3.09322 6.46226 3.09322H13.5189C14.1792 3.09322 15.2925 3.29661 15.2925 4.68644V7.4661C14.2736 7.55085 13.4623 8.31356 13.4623 9.26271V9.68644H6.51887V9.26271C6.51887 8.31356 5.70755 7.55085 4.68868 7.4661V4.70339ZM13.4434 10.2966V12.3983H6.51887V10.2966H13.4434ZM5.85849 16.8898H5.16038V15.7373H5.85849V16.8898ZM14.8208 16.8898H14.1226V15.7373H14.8208V16.8898ZM16.8208 13.822H16.8019C16.8019 14.4153 16.5566 15.1441 15.3302 15.1441H14.8208H14.1226H5.85849H5.16038H4.65094C3.99057 15.1441 3.17925 14.9237 3.17925 13.822V9.26271C3.17925 8.6017 3.78302 8.05932 4.51887 8.05932C5.25472 8.05932 5.85849 8.6017 5.85849 9.26271V12.7034C5.85849 12.8729 6.00943 13.0085 6.19811 13.0085H13.8019C13.9906 13.0085 14.1415 12.8729 14.1415 12.7034V9.26271C14.1415 8.6017 14.7453 8.05932 15.4811 8.05932C16.217 8.05932 16.8208 8.6017 16.8208 9.26271V13.822Z" fill="#347ADB" stroke="#347ADB" stroke-width="0.8"/>
5
- </g>
6
- <defs>
7
- <clipPath id="clip0_3019_14165">
8
- <rect width="16.6667" height="16.6667" fill="white" transform="translate(1.66675 1.6665)"/>
9
- </clipPath>
10
- </defs>
11
- </svg>);
3
+ return (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("g", { "clip-path": "url(#clip0_3019_14165)", children: _jsx("path", { d: "M15.9717 7.5339V4.70339C15.9717 3.07627 14.7076 2.5 13.5189 2.5H6.46226C5.27359 2.5 4.00943 3.07627 4.00943 4.70339V7.5339C3.14151 7.73729 2.5 8.4322 2.5 9.27966V13.822C2.5 15.161 3.5 15.6864 4.48113 15.7373V16.8898C4.48113 17.2288 4.78302 17.5 5.16038 17.5H5.85849C6.23585 17.5 6.53774 17.2288 6.53774 16.8898V15.7373H13.4623V16.8898C13.4623 17.2288 13.7642 17.5 14.1415 17.5H14.8396C15.217 17.5 15.5189 17.2288 15.5189 16.8898V15.7373C16.9717 15.6695 17.5 14.7203 17.5 13.822V9.26271C17.4623 8.4322 16.8208 7.72034 15.9717 7.5339ZM4.68868 4.70339C4.68868 3.31356 5.80189 3.09322 6.46226 3.09322H13.5189C14.1792 3.09322 15.2925 3.29661 15.2925 4.68644V7.4661C14.2736 7.55085 13.4623 8.31356 13.4623 9.26271V9.68644H6.51887V9.26271C6.51887 8.31356 5.70755 7.55085 4.68868 7.4661V4.70339ZM13.4434 10.2966V12.3983H6.51887V10.2966H13.4434ZM5.85849 16.8898H5.16038V15.7373H5.85849V16.8898ZM14.8208 16.8898H14.1226V15.7373H14.8208V16.8898ZM16.8208 13.822H16.8019C16.8019 14.4153 16.5566 15.1441 15.3302 15.1441H14.8208H14.1226H5.85849H5.16038H4.65094C3.99057 15.1441 3.17925 14.9237 3.17925 13.822V9.26271C3.17925 8.6017 3.78302 8.05932 4.51887 8.05932C5.25472 8.05932 5.85849 8.6017 5.85849 9.26271V12.7034C5.85849 12.8729 6.00943 13.0085 6.19811 13.0085H13.8019C13.9906 13.0085 14.1415 12.8729 14.1415 12.7034V9.26271C14.1415 8.6017 14.7453 8.05932 15.4811 8.05932C16.217 8.05932 16.8208 8.6017 16.8208 9.26271V13.822Z", fill: "#347ADB", stroke: "#347ADB", "stroke-width": "0.8" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_3019_14165", children: _jsx("rect", { width: "16.6667", height: "16.6667", fill: "white", transform: "translate(1.66675 1.6665)" }) }) })] }));
12
4
  };
@@ -17,5 +17,5 @@ export declare const dummyImage: {
17
17
  y: number;
18
18
  }[];
19
19
  }[];
20
- declare const TouchScrollDetect: () => import("react").JSX.Element;
20
+ declare const TouchScrollDetect: () => import("react/jsx-runtime").JSX.Element;
21
21
  export default TouchScrollDetect;
@@ -1 +1 @@
1
- export function UserIcon(): import("react").JSX.Element;
1
+ export function UserIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  export const UserIcon = () => {
2
- return (<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
3
- <path d="M7.61992 10.1625C9.00754 10.1625 10.1324 9.03757 10.1324 7.64995C10.1324 6.26234 9.00754 5.13745 7.61992 5.13745C6.23231 5.13745 5.10742 6.26234 5.10742 7.64995C5.10742 9.03757 6.23231 10.1625 7.61992 10.1625Z" fill="#5E6278"/>
4
- <path d="M7.62 14.9999C9.34313 14.9999 10.74 14.1168 10.74 13.0274C10.74 11.9381 9.34313 11.0549 7.62 11.0549C5.89687 11.0549 4.5 11.9381 4.5 13.0274C4.5 14.1168 5.89687 14.9999 7.62 14.9999Z" fill="#5E6278"/>
5
- <path opacity="0.3" d="M11.595 4.23C12.7631 4.23 13.71 3.28308 13.71 2.115C13.71 0.946918 12.7631 0 11.595 0C10.4269 0 9.47998 0.946918 9.47998 2.115C9.47998 3.28308 10.4269 4.23 11.595 4.23Z" fill="#5E6278"/>
6
- <path opacity="0.3" d="M3.62257 4.23C4.79065 4.23 5.73757 3.28308 5.73757 2.115C5.73757 0.946918 4.79065 0 3.62257 0C2.45449 0 1.50757 0.946918 1.50757 2.115C1.50757 3.28308 2.45449 4.23 3.62257 4.23Z" fill="#5E6278"/>
7
- <g opacity="0.3">
8
- <path d="M11.4749 5.87256C11.2349 5.87256 11.0024 5.87256 10.7699 5.91006C11.1229 6.52313 11.2825 7.22856 11.2276 7.93388C11.1727 8.63919 10.906 9.31147 10.4624 9.86256C10.7984 9.92909 11.1399 9.96424 11.4824 9.96756C13.3874 9.96756 14.9249 9.04506 14.9249 7.92006C14.9249 6.79506 13.3799 5.87256 11.4749 5.87256Z" fill="#5E6278"/>
9
- <path d="M3.4499 6C3.6899 6 3.9224 6 4.1549 6.0375C3.80187 6.65057 3.64233 7.356 3.6972 8.06132C3.75208 8.76664 4.0188 9.43891 4.4624 9.99C4.12639 10.0565 3.78492 10.0917 3.4424 10.095C1.5374 10.095 -9.77516e-05 9.1725 -9.77516e-05 8.0475C-9.77516e-05 6.9225 1.5449 6 3.4499 6Z" fill="#5E6278"/>
10
- </g>
11
- </svg>);
3
+ return (_jsxs("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M7.61992 10.1625C9.00754 10.1625 10.1324 9.03757 10.1324 7.64995C10.1324 6.26234 9.00754 5.13745 7.61992 5.13745C6.23231 5.13745 5.10742 6.26234 5.10742 7.64995C5.10742 9.03757 6.23231 10.1625 7.61992 10.1625Z", fill: "#5E6278" }), _jsx("path", { d: "M7.62 14.9999C9.34313 14.9999 10.74 14.1168 10.74 13.0274C10.74 11.9381 9.34313 11.0549 7.62 11.0549C5.89687 11.0549 4.5 11.9381 4.5 13.0274C4.5 14.1168 5.89687 14.9999 7.62 14.9999Z", fill: "#5E6278" }), _jsx("path", { opacity: "0.3", d: "M11.595 4.23C12.7631 4.23 13.71 3.28308 13.71 2.115C13.71 0.946918 12.7631 0 11.595 0C10.4269 0 9.47998 0.946918 9.47998 2.115C9.47998 3.28308 10.4269 4.23 11.595 4.23Z", fill: "#5E6278" }), _jsx("path", { opacity: "0.3", d: "M3.62257 4.23C4.79065 4.23 5.73757 3.28308 5.73757 2.115C5.73757 0.946918 4.79065 0 3.62257 0C2.45449 0 1.50757 0.946918 1.50757 2.115C1.50757 3.28308 2.45449 4.23 3.62257 4.23Z", fill: "#5E6278" }), _jsxs("g", { opacity: "0.3", children: [_jsx("path", { d: "M11.4749 5.87256C11.2349 5.87256 11.0024 5.87256 10.7699 5.91006C11.1229 6.52313 11.2825 7.22856 11.2276 7.93388C11.1727 8.63919 10.906 9.31147 10.4624 9.86256C10.7984 9.92909 11.1399 9.96424 11.4824 9.96756C13.3874 9.96756 14.9249 9.04506 14.9249 7.92006C14.9249 6.79506 13.3799 5.87256 11.4749 5.87256Z", fill: "#5E6278" }), _jsx("path", { d: "M3.4499 6C3.6899 6 3.9224 6 4.1549 6.0375C3.80187 6.65057 3.64233 7.356 3.6972 8.06132C3.75208 8.76664 4.0188 9.43891 4.4624 9.99C4.12639 10.0565 3.78492 10.0917 3.4424 10.095C1.5374 10.095 -9.77516e-05 9.1725 -9.77516e-05 8.0475C-9.77516e-05 6.9225 1.5449 6 3.4499 6Z", fill: "#5E6278" })] })] }));
12
4
  };
@@ -1,2 +1,2 @@
1
- declare const TableEditor: () => import("react").JSX.Element;
1
+ declare const TableEditor: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default TableEditor;
@@ -1,2 +1 @@
1
- import React from "react";
2
- export default function DraggableRect(): React.JSX.Element;
1
+ export default function DraggableRect(): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- declare const TableEditor: () => import("react").JSX.Element;
1
+ declare const TableEditor: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default TableEditor;
@@ -7,5 +7,5 @@ interface ButtonToolsProps {
7
7
  }>;
8
8
  popoverProps?: PopoverProps;
9
9
  }
10
- declare const ButtonTools: (props: ButtonToolsProps) => import("react").JSX.Element;
10
+ declare const ButtonTools: (props: ButtonToolsProps) => import("react/jsx-runtime").JSX.Element;
11
11
  export default ButtonTools;
@@ -1,11 +1,13 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { Button, Popover } from "antd";
4
4
  const ButtonTools = (props) => {
5
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)) }));
6
+ const content = (_jsx("div", { children: items.map((item, i) => (_jsx(Button, { type: "text", onClick: item.onClick, children: item.label }, i))) }));
7
+ return (_jsx(Popover, Object.assign({ content: items.length > 0 ? content : null, trigger: "click", placement: "right", styles: {
8
+ body: {
9
+ maxWidth: "fit-content",
10
+ },
11
+ } }, popoverProps, { children: _jsx(Button, Object.assign({}, buttonProps)) })));
10
12
  };
11
13
  export default ButtonTools;
@@ -2,16 +2,28 @@
2
2
  import { Button, Popover } from "antd";
3
3
  const ButtonTools = (props) => {
4
4
  const { buttonProps, items, popoverProps } = props;
5
- if (items.length === 0) {
6
- return (<Popover trigger="hover" {...popoverProps}>
5
+ const content = (<div>
6
+ {items.map((item, i) => (<Button key={i} type="text" onClick={item.onClick}>
7
+ {item.label}
8
+ </Button>))}
9
+ </div>);
10
+ return (<Popover content={items.length > 0 ? content : null} trigger="click" placement="right" styles={{
11
+ body: {
12
+ maxWidth: "fit-content",
13
+ },
14
+ }} {...popoverProps}>
15
+ {/* <Popover
16
+ title={buttonProps?.name}
17
+ trigger={"hover"}
18
+ placement="right"
19
+ styles={{
20
+ body: {
21
+ minWidth: "max-content",
22
+ },
23
+ }}
24
+ > */}
7
25
  <Button {...buttonProps}/>
8
- </Popover>);
9
- }
10
- return (<Popover content={<div>
11
- <Button>Button 1</Button>
12
- <Button>Button 2</Button>
13
- </div>} trigger="click">
14
- <Button {...buttonProps}/>
26
+ {/* </Popover> */}
15
27
  </Popover>);
16
28
  };
17
29
  export default ButtonTools;
@@ -1,2 +1,2 @@
1
- declare const SectionLabel: () => import("react").JSX.Element;
1
+ declare const SectionLabel: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default SectionLabel;
@@ -1,25 +1,14 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { Button, ColorPicker, Flex, Form, Input, InputNumber, Divider, } from "antd";
3
+ import { ColorPicker, Flex, Form, Input, InputNumber, Divider } from "antd";
4
4
  const SectionLabel = () => {
5
- return (_jsxs("div", { className: "py-2", children: [_jsx("h1", { className: "heading-s", children: "Section Labeling" }), _jsx(Divider, { style: { margin: 4 } }), _jsx(Form.Item, { label: "Labels in table", name: "labels", className: "w-full", children: _jsx(Form.List, { name: "labels", children: (fields, { add, remove }) => (_jsxs(_Fragment, { children: [fields.map((field) => (_jsxs("div", { className: "w-full flex-col mb-2", children: [_jsx(Flex, { gap: 5, className: "w-full flex justify-between", children: _jsx(Form.Item, { name: [field.name, "label"], label: "Text", className: "w-full", children: _jsx(Input, {}) }) }), _jsxs(Flex, { gap: 5, className: "w-full flex justify-between", children: [_jsx(Form.Item, { name: [field.name, "x"], label: "Position X", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { name: [field.name, "y"], label: "Position Y", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { name: [field.name, "rotation"], label: "Rotation", children: _jsx(InputNumber, { suffix: "\u00B0", min: 0, max: 360, parser: (value) => {
6
- if (!value)
7
- return 0;
8
- const num = Number(value.replace(/\D/g, ""));
9
- if (Number.isNaN(num))
10
- return 0;
11
- return Math.min(360, Math.max(0, num));
12
- } }) })] }), _jsxs(Flex, { gap: 5, children: [_jsx(Form.Item, { name: [field.name, "fontSize"], label: "Size", children: _jsx(InputNumber, { suffix: "px" }) }), _jsx(Form.Item, { name: [field.name, "fontColor"], label: "Color", getValueFromEvent: (color) => color.toHexString(), children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) })] }), fields.length > 1 && (_jsx(Flex, { gap: 2, className: "w-full", children: _jsx(Button
13
- // type="dashed"
14
- , {
15
- // type="dashed"
16
- onClick: () => remove(fields.indexOf(field)), className: "w-full", children: "Remove" }) }))] }, field.key))), _jsx(Flex, { gap: 2, className: "w-full mt-2", children: _jsx(Button, { type: "primary", onClick: () => add({
17
- label: "",
18
- fontColor: "#000000",
19
- x: 0,
20
- y: 0,
21
- fontSize: 12,
22
- rotation: 0,
23
- }), className: "w-full", children: "Add" }) })] })) }) }), _jsx("div", { className: "divider-dashed" })] }));
5
+ return (_jsxs("div", { className: "py-2", children: [_jsx("h1", { className: "heading-s", children: "Section Labeling" }), _jsx(Divider, { style: { margin: 4 } }), _jsx(Form.Item, { label: "Labels in table", name: ["labels", 0, "label"], className: "w-full", children: _jsx(Form.List, { name: "labels", children: (fields, { add, remove }) => (_jsx(_Fragment, { children: fields.map((field) => (_jsxs("div", { className: "w-full flex-col mb-2", children: [_jsx(Flex, { gap: 5, className: "w-full flex justify-between", children: _jsx(Form.Item, { name: [field.name, "label"], label: "Text", className: "w-full", children: _jsx(Input, {}) }) }), _jsxs(Flex, { gap: 5, className: "w-full flex justify-between", children: [_jsx(Form.Item, { name: [field.name, "x"], label: "Position X", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { name: [field.name, "y"], label: "Position Y", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { name: [field.name, "rotation"], label: "Rotation", children: _jsx(InputNumber, { suffix: "\u00B0", min: 0, max: 360, parser: (value) => {
6
+ if (!value)
7
+ return 0;
8
+ const num = Number(value.replace(/\D/g, ""));
9
+ if (Number.isNaN(num))
10
+ return 0;
11
+ return Math.min(360, Math.max(0, num));
12
+ } }) })] }), _jsxs(Flex, { gap: 5, children: [_jsx(Form.Item, { name: [field.name, "fontSize"], label: "Size", children: _jsx(InputNumber, { suffix: "px" }) }), _jsx(Form.Item, { name: [field.name, "fontColor"], label: "Color", getValueFromEvent: (color) => color.toHexString(), children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) })] })] }, field.key))) })) }) }), _jsx("div", { className: "divider-dashed" })] }));
24
13
  };
25
14
  export default SectionLabel;