seat-editor 1.4.13 → 1.4.14

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 (57) hide show
  1. package/dist/app/layout.d.ts +1 -1
  2. package/dist/app/new-board/page.d.ts +1 -1
  3. package/dist/app/new-board/page.jsx +23 -3
  4. package/dist/app/old-board/page.d.ts +2 -1
  5. package/dist/app/only-view/page.d.ts +1 -1
  6. package/dist/app/page.d.ts +1 -1
  7. package/dist/components/button-tools/index.d.ts +1 -1
  8. package/dist/components/form-tools/label.d.ts +1 -1
  9. package/dist/components/form-tools/shape.d.ts +1 -1
  10. package/dist/components/input/number-indicator.d.ts +1 -1
  11. package/dist/components/joystick/index.d.ts +2 -1
  12. package/dist/components/layer/index.d.ts +1 -1
  13. package/dist/components/lib/index.d.ts +1 -1
  14. package/dist/components/modal-preview/index.d.ts +1 -1
  15. package/dist/features/board/index.d.ts +1 -1
  16. package/dist/features/navbar/index.d.ts +1 -1
  17. package/dist/features/package/index.d.ts +1 -1
  18. package/dist/features/panel/index.d.ts +1 -1
  19. package/dist/features/panel/select-tool.d.ts +1 -1
  20. package/dist/features/panel/square-circle-tool.d.ts +1 -1
  21. package/dist/features/panel/table-seat-circle.d.ts +1 -1
  22. package/dist/features/panel/text-tool.d.ts +1 -1
  23. package/dist/features/panel/upload-tool.d.ts +1 -1
  24. package/dist/features/side-tool/index.d.ts +1 -1
  25. package/dist/features/view/index.d.ts +1 -1
  26. package/dist/features/view/index.jsx +17 -2
  27. package/dist/provider/redux-provider.d.ts +1 -1
  28. package/dist/provider/store-provider.d.ts +1 -1
  29. package/dist/seat-editor.css +1 -1
  30. package/package.json +1 -1
  31. package/dist/app/layout.js +0 -22
  32. package/dist/app/new-board/page.js +0 -30
  33. package/dist/app/old-board/page.js +0 -377
  34. package/dist/app/only-view/page.js +0 -41
  35. package/dist/app/page.js +0 -8
  36. package/dist/components/button-tools/index.js +0 -11
  37. package/dist/components/form-tools/label.js +0 -7
  38. package/dist/components/form-tools/shape.js +0 -25
  39. package/dist/components/input/number-indicator.js +0 -27
  40. package/dist/components/joystick/index.js +0 -48
  41. package/dist/components/layer/index.js +0 -276
  42. package/dist/components/lib/index.js +0 -28
  43. package/dist/components/modal-preview/index.js +0 -10
  44. package/dist/features/board/index.js +0 -626
  45. package/dist/features/navbar/index.js +0 -6
  46. package/dist/features/package/index.js +0 -109
  47. package/dist/features/panel/index.js +0 -98
  48. package/dist/features/panel/select-tool.js +0 -44
  49. package/dist/features/panel/square-circle-tool.js +0 -8
  50. package/dist/features/panel/table-seat-circle.js +0 -9
  51. package/dist/features/panel/text-tool.js +0 -7
  52. package/dist/features/panel/upload-tool.js +0 -155
  53. package/dist/features/side-tool/index.js +0 -244
  54. package/dist/features/view/index.js +0 -198
  55. package/dist/provider/antd-provider.js +0 -43
  56. package/dist/provider/redux-provider.js +0 -7
  57. package/dist/provider/store-provider.js +0 -9
@@ -1,244 +0,0 @@
1
- "use client";
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 } from "lucide-react";
4
- import ButtonTools from "../../components/button-tools";
5
- import { Divider, ColorPicker, Button, } from "antd";
6
- import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
7
- import { useState } from "react";
8
- const SideTool = ({ dragOnly }) => {
9
- const [color, setColor] = useState("#000000");
10
- const dispatch = useAppDispatch();
11
- const { active } = useAppSelector((state) => state.tool);
12
- const { selectedComponent } = useAppSelector((state) => state.panel);
13
- const { components, extraComponents } = useAppSelector((state) => state.board);
14
- const [preview, setPreview] = useState(false);
15
- const tools = [
16
- {
17
- id: "select",
18
- name: "Select Tool",
19
- icon: _jsx(MousePointer, {}),
20
- },
21
- {
22
- id: "grab",
23
- name: "Grab Tool",
24
- icon: _jsx(Hand, {}),
25
- }
26
- ];
27
- const actionsTools = [
28
- // {
29
- // id: "table-split",
30
- // name: "Table Split",
31
- // icon: <TableCellsSplit />,
32
- // },
33
- {
34
- id: "square",
35
- name: "Square",
36
- icon: _jsx(SquareMousePointer, {}),
37
- },
38
- {
39
- id: "circle",
40
- name: "Circle",
41
- icon: _jsx(Circle, {}),
42
- },
43
- {
44
- id: "table-seat-circle",
45
- name: "Table Seat Circle",
46
- icon: _jsx(Ratio, {}),
47
- },
48
- {
49
- id: "image-table",
50
- name: "Image Table",
51
- icon: _jsx(Upload, {}),
52
- },
53
- // {
54
- // id: "table-seat-square",
55
- // name: "Table Seat Square",
56
- // icon: <Dock />,
57
- // },
58
- // {
59
- // id: "diamond",
60
- // name: "Diamond",
61
- // icon: <Diamond />,
62
- // },
63
- ];
64
- const controlTools = [
65
- {
66
- id: "background",
67
- name: "Background",
68
- icon: _jsx(Image, {}),
69
- },
70
- {
71
- id: "text",
72
- name: "Text",
73
- icon: _jsx(Type, {}),
74
- },
75
- // {
76
- // id: "background-color",
77
- // name: "Background Color",
78
- // icon: <PaintBucket/>
79
- // }
80
- ];
81
- const hanldeSelectTool = (id) => {
82
- if (id === "background" || id === "text" || id === "image-table") {
83
- dispatch({
84
- type: "panel/setShow",
85
- payload: true,
86
- });
87
- }
88
- dispatch({
89
- type: "tool/setActiveTool",
90
- payload: id,
91
- });
92
- };
93
- const handleChangeColorBackground = (color) => {
94
- setColor(color.toHexString());
95
- dispatch({
96
- type: "board/setBackgroundColor",
97
- payload: color.toHexString(),
98
- });
99
- };
100
- const handleOpenModalPreview = () => {
101
- dispatch({
102
- type: "tool/setTooglePreview",
103
- payload: true,
104
- });
105
- };
106
- const handleRemoveComponent = () => {
107
- dispatch({
108
- type: "board/removeComponent",
109
- payload: selectedComponent,
110
- });
111
- dispatch({
112
- type: "board/removeExtraComponent",
113
- payload: selectedComponent,
114
- });
115
- dispatch({ type: "board/setFlagChange", payload: true });
116
- };
117
- const handleDuplicateComponent = () => {
118
- const newComponent = Object.assign(Object.assign({}, selectedComponent), { x: selectedComponent.x + 20, y: selectedComponent.y + 20, id: Date.now() });
119
- dispatch({
120
- type: "board/addComponent",
121
- payload: newComponent,
122
- });
123
- dispatch({
124
- type: "panel/setSelectedComponent",
125
- payload: newComponent,
126
- });
127
- dispatch({ type: "board/setFlagChange", payload: true });
128
- };
129
- function swapOneStepById(arr, id, direction) {
130
- const index = arr.findIndex((item) => (item === null || item === void 0 ? void 0 : item.id) === id);
131
- if (index === -1)
132
- return arr; // id tidak ditemukan
133
- const newArr = [...arr];
134
- if (direction === "left" && index > 0) {
135
- [newArr[index - 1], newArr[index]] = [newArr[index], newArr[index - 1]];
136
- }
137
- if (direction === "right" && index < arr.length - 1) {
138
- [newArr[index + 1], newArr[index]] = [newArr[index], newArr[index + 1]];
139
- }
140
- return newArr;
141
- }
142
- const handleOverride = () => {
143
- if ((selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.shape) === "background") {
144
- const setNewExtraComponents = swapOneStepById(extraComponents, selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id, "right");
145
- dispatch({
146
- type: "board/setNewExtraComponents",
147
- payload: setNewExtraComponents,
148
- });
149
- dispatch({ type: "board/setFlagChange", payload: true });
150
- return;
151
- }
152
- const newArr = swapOneStepById(components, selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id, "right");
153
- dispatch({
154
- type: "board/setNewComponents",
155
- payload: newArr,
156
- });
157
- dispatch({ type: "board/setFlagChange", payload: true });
158
- };
159
- const handleOverrideLeft = () => {
160
- if ((selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.shape) === "background") {
161
- const setNewExtraComponents = swapOneStepById(extraComponents, selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id, "left");
162
- dispatch({
163
- type: "board/setNewExtraComponents",
164
- payload: setNewExtraComponents,
165
- });
166
- dispatch({ type: "board/setFlagChange", payload: true });
167
- return;
168
- }
169
- const newArr = swapOneStepById(components, selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id, "left");
170
- dispatch({
171
- type: "board/setNewComponents",
172
- payload: newArr,
173
- });
174
- dispatch({ type: "board/setFlagChange", payload: true });
175
- };
176
- 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: {
177
- icon: tool.icon,
178
- type: "text",
179
- name: tool.name,
180
- onClick: () => hanldeSelectTool(tool.id),
181
- style: active === tool.id ? { color: "red" } : {},
182
- }, popoverProps: {
183
- content: _jsx("div", { children: tool.name }),
184
- trigger: "hover",
185
- placement: "right",
186
- }, items: [] }, tool.id))), !dragOnly && (_jsxs(_Fragment, { children: [_jsx(ButtonTools, { buttonProps: {
187
- icon: _jsx(CopyPlus, {}),
188
- type: "text",
189
- name: "duplicate",
190
- onClick: () => handleDuplicateComponent(),
191
- }, items: [], popoverProps: {
192
- content: _jsx("div", { children: "Duplicate" }),
193
- trigger: "hover",
194
- placement: "right",
195
- } }), _jsx(ButtonTools, { buttonProps: {
196
- onClick: () => handleRemoveComponent(),
197
- icon: _jsx(Trash, {}),
198
- type: "text",
199
- name: "trash",
200
- }, items: [], popoverProps: {
201
- content: _jsx("div", { children: "Trash" }),
202
- trigger: "hover",
203
- placement: "right",
204
- } }), _jsx(ButtonTools, { buttonProps: {
205
- onClick: () => handleOverride(),
206
- icon: _jsx(Layers2, {}),
207
- type: "text",
208
- name: "override",
209
- }, items: [], popoverProps: {
210
- content: _jsx("div", { children: "Override Right" }),
211
- trigger: "hover",
212
- placement: "right",
213
- } }), _jsx(ButtonTools, { buttonProps: {
214
- onClick: () => handleOverrideLeft(),
215
- icon: _jsx(Layers, {}),
216
- type: "text",
217
- name: "override",
218
- }, items: [], popoverProps: {
219
- content: _jsx("div", { children: "Override Left" }),
220
- trigger: "hover",
221
- placement: "right",
222
- } }), _jsx(Divider, {}), actionsTools === null || actionsTools === void 0 ? void 0 : actionsTools.map((tool) => (_jsx(ButtonTools, { buttonProps: {
223
- icon: tool.icon,
224
- type: "text",
225
- name: tool.name,
226
- onClick: () => hanldeSelectTool(tool.id),
227
- style: active === tool.id ? { color: "red" } : {},
228
- }, popoverProps: {
229
- content: _jsx("div", { children: tool.name }),
230
- trigger: "hover",
231
- placement: "right",
232
- }, items: [] }, tool.id))), _jsx(Divider, {})] })), controlTools === null || controlTools === void 0 ? void 0 : controlTools.map((tool) => (_jsx(ButtonTools, { buttonProps: {
233
- icon: tool.icon,
234
- type: "text",
235
- name: tool.name,
236
- onClick: () => hanldeSelectTool(tool.id),
237
- style: active === tool.id ? { color: "red" } : {},
238
- }, popoverProps: {
239
- content: _jsx("div", { children: tool.name }),
240
- trigger: "hover",
241
- placement: "right",
242
- }, 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" } : {} })] }));
243
- };
244
- export default SideTool;
@@ -1,198 +0,0 @@
1
- "use client";
2
- "use client";
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
- import { useEffect, useMemo, useRef, useState } from "react";
5
- import { TransformWrapper, TransformComponent, } from "react-zoom-pan-pinch";
6
- import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
7
- import Layers from "../../components/layer";
8
- import { isEqual } from "lodash";
9
- const LayerView = (props) => {
10
- const { componentProps, extraComponentProps, onSelectComponent, onCurrentStateChange, mappingKey, selectedTableColor, colorMatchKey, statusKey, defaultBackground, } = props;
11
- const transformRef = useRef(null);
12
- const containerRef = useRef(null);
13
- const svgRef = useRef(null);
14
- const [scale, setScale] = useState(1);
15
- const [selectedTable, setSelectedTable] = useState(null);
16
- const { components: componentsEditor, extraComponents: extraComponentsEditor, } = useAppSelector((state) => state.board);
17
- const backgroundColor = useAppSelector((state) => state.board.backgroundColor);
18
- const dispatch = useAppDispatch();
19
- useEffect(() => {
20
- if (!isEqual(componentsEditor, componentProps)) {
21
- dispatch({
22
- type: "board/setNewComponents",
23
- payload: componentProps,
24
- });
25
- }
26
- if (!isEqual(extraComponentsEditor, extraComponentProps)) {
27
- dispatch({
28
- type: "board/setNewExtraComponents",
29
- payload: extraComponentProps,
30
- });
31
- }
32
- if (defaultBackground) {
33
- dispatch({
34
- type: "board/setBackgroundColor",
35
- payload: defaultBackground,
36
- });
37
- }
38
- }, [componentProps, extraComponentProps, defaultBackground]);
39
- useEffect(() => {
40
- onCurrentStateChange &&
41
- onCurrentStateChange({
42
- components: componentsEditor,
43
- extraComponents: extraComponentsEditor,
44
- });
45
- }, [componentsEditor, extraComponentsEditor]);
46
- const handleSelectComponent = (items) => {
47
- const find = componentsEditor.find((item) => {
48
- if (mappingKey && (item === null || item === void 0 ? void 0 : item[mappingKey])) {
49
- return item[mappingKey].id === (items === null || items === void 0 ? void 0 : items.id);
50
- }
51
- return (item === null || item === void 0 ? void 0 : item.id) === (items === null || items === void 0 ? void 0 : items.id);
52
- });
53
- onSelectComponent && onSelectComponent(find);
54
- setSelectedTable(find);
55
- };
56
- const boundingBox = useMemo(() => {
57
- var _a, _b, _c, _d, _e, _f;
58
- if (!componentsEditor && (componentsEditor === null || componentsEditor === void 0 ? void 0 : componentsEditor.length) === 0) {
59
- return { minX: 0, minY: 0, width: 500, height: 500 };
60
- }
61
- let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
62
- componentsEditor === null || componentsEditor === void 0 ? void 0 : componentsEditor.forEach((_) => {
63
- var _a, _b, _c, _d;
64
- let values = mappingKey ? _[mappingKey] : _;
65
- if (!values)
66
- return;
67
- if ((_a = values === null || values === void 0 ? void 0 : values.shape) === null || _a === void 0 ? void 0 : _a.includes("square")) {
68
- minX = Math.min(minX, values.x);
69
- minY = Math.min(minY, values.y);
70
- maxX = Math.max(maxX, values.x + values.width);
71
- maxY = Math.max(maxY, values.y + values.height);
72
- }
73
- if ((_b = values === null || values === void 0 ? void 0 : values.shape) === null || _b === void 0 ? void 0 : _b.includes("circle")) {
74
- minX = Math.min(minX, values.x);
75
- minY = Math.min(minY, values.y);
76
- maxX = Math.max(maxX, values.x + values.width);
77
- maxY = Math.max(maxY, values.y + values.height);
78
- }
79
- if ((_c = values === null || values === void 0 ? void 0 : values.shape) === null || _c === void 0 ? void 0 : _c.includes("table-seat-circle")) {
80
- minX = Math.min(minX, values.x);
81
- minY = Math.min(minY, values.y);
82
- maxX = Math.max(maxX, values.x + values.width);
83
- maxY = Math.max(maxY, values.y + values.height);
84
- }
85
- if ((_d = values === null || values === void 0 ? void 0 : values.shape) === null || _d === void 0 ? void 0 : _d.includes("image-table")) {
86
- minX = Math.min(minX, values.x);
87
- minY = Math.min(minY, values.y);
88
- maxX = Math.max(maxX, values.x + values.width);
89
- maxY = Math.max(maxY, values.y + values.height);
90
- }
91
- });
92
- extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor.forEach((values) => {
93
- var _a, _b;
94
- if ((_a = values === null || values === void 0 ? void 0 : values.shape) === null || _a === void 0 ? void 0 : _a.includes("background")) {
95
- minX = Math.min(minX, values.x);
96
- minY = Math.min(minY, values.y);
97
- maxX = Math.max(maxX, values.x + values.width);
98
- maxY = Math.max(maxY, values.y + values.height);
99
- }
100
- if ((_b = values === null || values === void 0 ? void 0 : values.shape) === null || _b === void 0 ? void 0 : _b.includes("text")) {
101
- minX = Math.min(minX, values.x);
102
- minY = Math.min(minY, values.y);
103
- maxX = Math.max(maxX, values.x + values.width);
104
- maxY = Math.max(maxY, values.y + values.height);
105
- }
106
- });
107
- if ((extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor.length) === 1 && ((_b = (_a = extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor[0]) === null || _a === void 0 ? void 0 : _a.shape) === null || _b === void 0 ? void 0 : _b.includes("background"))) {
108
- minX = (_c = extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor[0]) === null || _c === void 0 ? void 0 : _c.x;
109
- minY = (_d = extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor[0]) === null || _d === void 0 ? void 0 : _d.y;
110
- maxX = (_e = extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor[0]) === null || _e === void 0 ? void 0 : _e.width;
111
- maxY = (_f = extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor[0]) === null || _f === void 0 ? void 0 : _f.height;
112
- }
113
- if ((extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor.length) < 1) {
114
- minX = minX - minX * 0.5;
115
- minY = minY - minY * 0.5;
116
- }
117
- return {
118
- minX,
119
- minY,
120
- width: maxX,
121
- height: maxY,
122
- };
123
- }, [componentsEditor, extraComponentsEditor]);
124
- const renderElements = (elementEditor, mappingKey, colorMatchKey) => {
125
- return elementEditor.map((editorItem, i) => {
126
- var _a, _b, _c, _d;
127
- const isUsingMapping = mappingKey &&
128
- typeof editorItem[mappingKey] === "object" &&
129
- editorItem[mappingKey] !== null;
130
- const finalProps = isUsingMapping ? editorItem[mappingKey] : editorItem;
131
- if (colorMatchKey) {
132
- if (isUsingMapping) {
133
- return Object.assign(Object.assign({}, finalProps), { fill: (_b = (_a = colorMatchKey.find((item) => item.key == (editorItem === null || editorItem === void 0 ? void 0 : editorItem[statusKey]))) === null || _a === void 0 ? void 0 : _a.color) !== null && _b !== void 0 ? _b : finalProps.fill });
134
- }
135
- else {
136
- return Object.assign(Object.assign({}, finalProps), { fill: (_d = (_c = colorMatchKey.find((item) => item.key == (editorItem === null || editorItem === void 0 ? void 0 : editorItem[statusKey]))) === null || _c === void 0 ? void 0 : _c.color) !== null && _d !== void 0 ? _d : finalProps.fill });
137
- }
138
- }
139
- return finalProps;
140
- });
141
- };
142
- const [fingerCount, setFingerCount] = useState(0);
143
- useEffect(() => {
144
- const container = document.getElementById("workspace");
145
- const handleTouchStart = (e) => {
146
- const count = e.touches.length;
147
- setFingerCount(count);
148
- };
149
- const handleTouchEnd = () => {
150
- setFingerCount(0);
151
- };
152
- if (container) {
153
- container.addEventListener("touchstart", handleTouchStart);
154
- container.addEventListener("touchend", handleTouchEnd);
155
- }
156
- return () => {
157
- if (container) {
158
- container.removeEventListener("touchstart", handleTouchStart);
159
- container.removeEventListener("touchend", handleTouchEnd);
160
- }
161
- };
162
- }, []);
163
- return (_jsx("div", Object.assign({ className: "relative w-full h-full flex-1", ref: containerRef, style: {
164
- height: "100vh",
165
- overflow: "auto",
166
- WebkitOverflowScrolling: "touch",
167
- touchAction: "pan-y",
168
- } }, props.containerProps, { children: _jsx(TransformWrapper, Object.assign({ ref: transformRef }, props.transformProps, { disabled: fingerCount === 1 && scale === 1, disablePadding: true,
169
- // panning={{
170
- // disabled: false,
171
- // velocityDisabled: true,
172
- // }}
173
- // limitToBounds={false}
174
- // doubleClick={{ disabled: true }}
175
- // pinch={{ disabled: false }}
176
- // wheel={{ disabled: true }}
177
- // disabled={true}
178
- // disablePadding={true}
179
- centerZoomedOut: true, onTransformed: ({ state: { scale } }) => setScale(scale), minScale: 1, maxScale: 1000, initialScale: 1,
180
- // pinch={{ step: 1 }}
181
- smooth: true, children: _jsx(TransformComponent, { wrapperStyle: {
182
- width: "100%",
183
- height: "100%",
184
- overflow: "visible",
185
- }, contentStyle: {
186
- width: "100%",
187
- height: "100%",
188
- }, 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: {
189
- background: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : defaultBackground,
190
- display: "block",
191
- pointerEvents: "auto",
192
- // touchAction: "pan-y",
193
- }, children: _jsx(Layers, { mode: "view", components: [
194
- ...extraComponentsEditor,
195
- ...renderElements(componentsEditor, mappingKey, colorMatchKey),
196
- ], onClick: handleSelectComponent, selectedTable: selectedTable, selectedTableColor: selectedTableColor }) })) }) })) })));
197
- };
198
- export default LayerView;
@@ -1,43 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useEffect } from "react";
4
- import { ConfigProvider } from "antd";
5
- import { AntdRegistry } from "@ant-design/nextjs-registry";
6
- import { useAppSelector, useAppDispatch } from "../hooks/use-redux";
7
- export const AntdProvider = ({ children, themeColor }) => {
8
- const dispatch = useAppDispatch();
9
- const theme = useAppSelector((state) => state.theme);
10
- useEffect(() => {
11
- if (themeColor !== theme.primaryColor) {
12
- dispatch({
13
- type: "theme/setPrimaryColor",
14
- payload: themeColor
15
- });
16
- }
17
- }, [themeColor]);
18
- return (_jsx(AntdRegistry, { children: _jsx(ConfigProvider, { theme: {
19
- token: {
20
- colorPrimary: themeColor,
21
- },
22
- // token: {
23
- // colorPrimary: theme.theme["--primary-color"],
24
- // colorPrimaryBorderHover: theme.theme["--primary-color"],
25
- // fontFamily: "var(--font-inter), sans-serif",
26
- // colorError: theme.theme["--danger"],
27
- // controlOutlineWidth: 4,
28
- // controlOutline: theme.theme["--surface-color"],
29
- // colorBgContainerDisabled: "var(--netral-03)",
30
- // colorTextPlaceholder: "var(--netral-06)",
31
- // },
32
- components: {
33
- Form: {
34
- labelFontSize: 14,
35
- fontWeightStrong: 500,
36
- itemMarginBottom: 12,
37
- },
38
- Button: {
39
- colorPrimary: themeColor
40
- }
41
- },
42
- }, children: children }) }));
43
- };
@@ -1,7 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { store } from "../libs/store";
4
- import { Provider } from "react-redux";
5
- export const ReduxProvider = ({ children }) => {
6
- return _jsx(Provider, { store: store, children: children });
7
- };
@@ -1,9 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { ReduxProvider } from "./redux-provider";
4
- import { AntdProvider } from "./antd-provider";
5
- import { injectSeatEditorCSS } from "../utils/injectCss";
6
- export const StoreProvider = ({ children, themeColor = "red", }) => {
7
- injectSeatEditorCSS();
8
- return (_jsx(ReduxProvider, { children: _jsx(AntdProvider, { themeColor: themeColor, children: children }) }));
9
- };