seat-editor 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/layout.d.ts +1 -1
- package/dist/app/{layout.js → layout.jsx} +7 -2
- package/dist/app/new-board/page.d.ts +1 -1
- package/dist/app/new-board/page.jsx +55 -0
- package/dist/app/old-board/page.d.ts +2 -1
- package/dist/app/old-board/{page.js → page.jsx} +215 -82
- package/dist/app/only-view/chair.d.ts +1 -1
- package/dist/app/only-view/chair.js +10 -2
- package/dist/app/only-view/page.d.ts +1 -1
- package/dist/app/only-view/page.jsx +101 -0
- package/dist/app/only-view/user.d.ts +1 -1
- package/dist/app/only-view/user.js +10 -2
- package/dist/app/page.d.ts +1 -1
- package/dist/app/page.jsx +13 -0
- package/dist/app/test/page.d.ts +2 -1
- package/dist/app/test/{page.js → page.jsx} +5 -3
- package/dist/app/v2/page.d.ts +1 -1
- package/dist/app/v2/page.jsx +13 -0
- package/dist/components/button-tools/index.d.ts +1 -1
- package/dist/components/button-tools/index.jsx +17 -0
- package/dist/components/form-tools/label.d.ts +1 -1
- package/dist/components/form-tools/label.jsx +44 -0
- package/dist/components/form-tools/shape.d.ts +1 -1
- package/dist/components/form-tools/shape.jsx +66 -0
- package/dist/components/input/number-indicator.d.ts +1 -1
- package/dist/components/input/{number-indicator.js → number-indicator.jsx} +11 -2
- package/dist/components/joystick/index.d.ts +2 -1
- package/dist/components/joystick/{index.js → index.jsx} +14 -13
- package/dist/components/layer/index.d.ts +1 -1
- package/dist/components/layer/index.jsx +383 -0
- package/dist/components/layer-v2/index.d.ts +1 -1
- package/dist/components/layer-v2/index.jsx +370 -0
- package/dist/components/layer-v3/index.d.ts +1 -1
- package/dist/components/layer-v3/{index.js → index.jsx} +242 -102
- package/dist/components/layer-v4/index.d.ts +1 -1
- package/dist/components/layer-v4/{index.js → index.jsx} +157 -80
- package/dist/components/lib/index.d.ts +1 -1
- package/dist/components/lib/{index.js → index.jsx} +7 -2
- package/dist/components/modal-preview/index.d.ts +1 -1
- package/dist/components/modal-preview/index.jsx +11 -0
- package/dist/features/board/index.d.ts +1 -1
- package/dist/features/board/{index.js → index.jsx} +90 -31
- package/dist/features/board-v2/index.d.ts +2 -1
- package/dist/features/board-v2/{index.js → index.jsx} +101 -39
- package/dist/features/board-v3/index copy.d.ts +2 -1
- package/dist/features/board-v3/{index copy.js → index copy.jsx } +128 -50
- package/dist/features/board-v3/index.d.ts +2 -1
- package/dist/features/board-v3/{index.js → index.jsx} +110 -32
- package/dist/features/navbar/index.d.ts +1 -1
- package/dist/features/navbar/index.jsx +5 -0
- package/dist/features/package/index.d.ts +1 -1
- package/dist/features/package/{index.js → index.jsx} +16 -6
- package/dist/features/panel/index.d.ts +1 -1
- package/dist/features/panel/{index.js → index.jsx} +25 -7
- package/dist/features/panel/select-tool.d.ts +1 -1
- package/dist/features/panel/{select-tool.js → select-tool.jsx} +23 -10
- package/dist/features/panel/selected-group.d.ts +1 -1
- package/dist/features/panel/selected-group.jsx +47 -0
- package/dist/features/panel/square-circle-tool.d.ts +1 -1
- package/dist/features/panel/{square-circle-tool.js → square-circle-tool.jsx} +4 -2
- package/dist/features/panel/table-seat-circle.d.ts +1 -1
- package/dist/features/panel/table-seat-circle.jsx +31 -0
- package/dist/features/panel/table-seat-square.d.ts +1 -1
- package/dist/features/panel/table-seat-square.jsx +46 -0
- package/dist/features/panel/text-tool.d.ts +1 -1
- package/dist/features/panel/text-tool.jsx +26 -0
- package/dist/features/panel/upload-tool.d.ts +1 -1
- package/dist/features/panel/{upload-tool.js → upload-tool.jsx} +24 -2
- package/dist/features/side-tool/index.d.ts +1 -1
- package/dist/features/side-tool/{index.js → index.jsx} +120 -98
- package/dist/features/view-only/index.d.ts +1 -1
- package/dist/features/view-only/{index.js → index.jsx} +38 -31
- package/dist/features/view-only-2/index.d.ts +1 -1
- package/dist/features/view-only-2/{index.js → index.jsx} +16 -13
- package/dist/features/view-only-3/index.d.ts +1 -1
- package/dist/features/view-only-3/{index.js → index.jsx} +46 -27
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/provider/antd-provider.jsx +46 -0
- package/dist/provider/redux-provider.d.ts +1 -1
- package/dist/provider/{redux-provider.js → redux-provider.jsx} +1 -2
- package/dist/provider/store-provider.d.ts +1 -1
- package/dist/provider/{store-provider.js → store-provider.jsx} +3 -2
- package/package.json +1 -1
- package/dist/app/new-board/page.js +0 -33
- package/dist/app/only-view/page.js +0 -78
- package/dist/app/page.js +0 -8
- package/dist/app/v2/page.js +0 -8
- package/dist/components/button-tools/index.js +0 -11
- package/dist/components/form-tools/label.js +0 -7
- package/dist/components/form-tools/shape.js +0 -25
- package/dist/components/layer/index.js +0 -295
- package/dist/components/layer-v2/index.js +0 -282
- package/dist/components/modal-preview/index.js +0 -10
- package/dist/features/navbar/index.js +0 -6
- package/dist/features/panel/selected-group.js +0 -7
- package/dist/features/panel/table-seat-circle.js +0 -9
- package/dist/features/panel/table-seat-square.js +0 -9
- package/dist/features/panel/text-tool.js +0 -7
- package/dist/provider/antd-provider.js +0 -43
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { Circle, CopyPlus, Eye, EyeOff, Image, Layers2, MousePointer, PaintBucket, Ratio, SquareMousePointer, Trash, Type, Upload, Hand, Layers, Ruler, Grid, Lock, LockOpen, Undo2, Redo2, PenTool } from "lucide-react";
|
|
4
3
|
import ButtonTools from "../../components/button-tools";
|
|
5
4
|
import { Divider, ColorPicker, Button, message, } from "antd";
|
|
@@ -16,17 +15,17 @@ const SideTool = ({ dragOnly, deleteAutorized, }) => {
|
|
|
16
15
|
{
|
|
17
16
|
id: "select",
|
|
18
17
|
name: "Select Tool",
|
|
19
|
-
icon:
|
|
18
|
+
icon: <MousePointer />,
|
|
20
19
|
},
|
|
21
20
|
{
|
|
22
21
|
id: "grab",
|
|
23
22
|
name: "Grab Tool",
|
|
24
|
-
icon:
|
|
23
|
+
icon: <Hand />,
|
|
25
24
|
},
|
|
26
25
|
{
|
|
27
26
|
id: "ruler",
|
|
28
27
|
name: "Ruler",
|
|
29
|
-
icon:
|
|
28
|
+
icon: <Ruler />,
|
|
30
29
|
},
|
|
31
30
|
// {
|
|
32
31
|
// id: "node",
|
|
@@ -43,22 +42,22 @@ const SideTool = ({ dragOnly, deleteAutorized, }) => {
|
|
|
43
42
|
{
|
|
44
43
|
id: "square",
|
|
45
44
|
name: "Square",
|
|
46
|
-
icon:
|
|
45
|
+
icon: <SquareMousePointer />,
|
|
47
46
|
},
|
|
48
47
|
{
|
|
49
48
|
id: "circle",
|
|
50
49
|
name: "Circle",
|
|
51
|
-
icon:
|
|
50
|
+
icon: <Circle />,
|
|
52
51
|
},
|
|
53
52
|
{
|
|
54
53
|
id: "table-seat-circle",
|
|
55
54
|
name: "Table Seat Circle",
|
|
56
|
-
icon:
|
|
55
|
+
icon: <Ratio />,
|
|
57
56
|
},
|
|
58
57
|
{
|
|
59
58
|
id: "image-table",
|
|
60
59
|
name: "Image Table",
|
|
61
|
-
icon:
|
|
60
|
+
icon: <Upload />,
|
|
62
61
|
},
|
|
63
62
|
// {
|
|
64
63
|
// id: "table-seat-square",
|
|
@@ -75,17 +74,17 @@ const SideTool = ({ dragOnly, deleteAutorized, }) => {
|
|
|
75
74
|
{
|
|
76
75
|
id: "background",
|
|
77
76
|
name: "Background",
|
|
78
|
-
icon:
|
|
77
|
+
icon: <Image />,
|
|
79
78
|
},
|
|
80
79
|
{
|
|
81
80
|
id: "text",
|
|
82
81
|
name: "Text",
|
|
83
|
-
icon:
|
|
82
|
+
icon: <Type />,
|
|
84
83
|
},
|
|
85
84
|
{
|
|
86
85
|
id: "polygon",
|
|
87
86
|
name: "Polygon Tool",
|
|
88
|
-
icon:
|
|
87
|
+
icon: <PenTool />,
|
|
89
88
|
}
|
|
90
89
|
// {
|
|
91
90
|
// id: "background-color",
|
|
@@ -258,99 +257,122 @@ const SideTool = ({ dragOnly, deleteAutorized, }) => {
|
|
|
258
257
|
dispatch({ type: "board/setFlagChange", payload: true });
|
|
259
258
|
dispatch({ type: "board/setUpdateBy", payload: "global" });
|
|
260
259
|
};
|
|
261
|
-
return (
|
|
260
|
+
return (<div className="h-full left-0 flex flex-col items-center border-r-2 border-gray-300 bg-white px-2 pt-4">
|
|
261
|
+
{tools === null || tools === void 0 ? void 0 : tools.map((tool) => (<ButtonTools key={tool.id} buttonProps={{
|
|
262
|
+
icon: tool.icon,
|
|
263
|
+
type: "text",
|
|
264
|
+
name: tool.name,
|
|
265
|
+
onClick: () => hanldeSelectTool(tool.id),
|
|
266
|
+
style: active === tool.id ? { color: "red" } : {},
|
|
267
|
+
}} popoverProps={{
|
|
268
|
+
content: <div>{tool.name}</div>,
|
|
269
|
+
trigger: "hover",
|
|
270
|
+
placement: "right",
|
|
271
|
+
}} items={[]}/>))}
|
|
272
|
+
{!dragOnly && (<>
|
|
273
|
+
<ButtonTools buttonProps={{
|
|
274
|
+
icon: <CopyPlus />,
|
|
275
|
+
type: "text",
|
|
276
|
+
name: "duplicate",
|
|
277
|
+
onClick: () => handleDuplicateComponent(),
|
|
278
|
+
}} items={[]} popoverProps={{
|
|
279
|
+
content: <div>Duplicate</div>,
|
|
280
|
+
trigger: "hover",
|
|
281
|
+
placement: "right",
|
|
282
|
+
}}/>
|
|
283
|
+
|
|
284
|
+
<ButtonTools buttonProps={{
|
|
285
|
+
onClick: () => handleOverride(),
|
|
286
|
+
icon: <Layers2 />,
|
|
287
|
+
type: "text",
|
|
288
|
+
name: "override",
|
|
289
|
+
}} items={[]} popoverProps={{
|
|
290
|
+
content: <div>Override Right</div>,
|
|
291
|
+
trigger: "hover",
|
|
292
|
+
placement: "right",
|
|
293
|
+
}}/>
|
|
294
|
+
<ButtonTools buttonProps={{
|
|
295
|
+
onClick: () => handleOverrideLeft(),
|
|
296
|
+
icon: <Layers />,
|
|
297
|
+
type: "text",
|
|
298
|
+
name: "override",
|
|
299
|
+
}} items={[]} popoverProps={{
|
|
300
|
+
content: <div>Override Left</div>,
|
|
301
|
+
trigger: "hover",
|
|
302
|
+
placement: "right",
|
|
303
|
+
}}/>
|
|
304
|
+
|
|
305
|
+
<Divider />
|
|
306
|
+
{actionsTools === null || actionsTools === void 0 ? void 0 : actionsTools.map((tool) => (<ButtonTools key={tool.id} buttonProps={{
|
|
262
307
|
icon: tool.icon,
|
|
263
308
|
type: "text",
|
|
264
309
|
name: tool.name,
|
|
265
310
|
onClick: () => hanldeSelectTool(tool.id),
|
|
266
311
|
style: active === tool.id ? { color: "red" } : {},
|
|
267
|
-
}
|
|
268
|
-
content:
|
|
312
|
+
}} popoverProps={{
|
|
313
|
+
content: <div>{tool.name}</div>,
|
|
269
314
|
trigger: "hover",
|
|
270
315
|
placement: "right",
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}, items: [], popoverProps: {
|
|
333
|
-
content: _jsx("div", { children: lockBackground ? "Unlock Background" : "Lock Background" }),
|
|
334
|
-
trigger: "hover",
|
|
335
|
-
placement: "right",
|
|
336
|
-
} }), _jsx(ButtonTools, { buttonProps: {
|
|
337
|
-
onClick: () => handleUndo(),
|
|
338
|
-
icon: _jsx(Undo2, {}),
|
|
339
|
-
type: "text",
|
|
340
|
-
name: "undo",
|
|
341
|
-
}, items: [], popoverProps: {
|
|
342
|
-
content: _jsx("div", { children: "Undo" }),
|
|
343
|
-
trigger: "hover",
|
|
344
|
-
placement: "right",
|
|
345
|
-
} }), _jsx(ButtonTools, { buttonProps: {
|
|
346
|
-
onClick: () => handleRedo(),
|
|
347
|
-
icon: _jsx(Redo2, {}),
|
|
348
|
-
type: "text",
|
|
349
|
-
name: "redo",
|
|
350
|
-
}, items: [], popoverProps: {
|
|
351
|
-
content: _jsx("div", { children: "Redo" }),
|
|
352
|
-
trigger: "hover",
|
|
353
|
-
placement: "right",
|
|
354
|
-
} })] }));
|
|
316
|
+
}} items={[]}/>))}
|
|
317
|
+
|
|
318
|
+
<Divider />
|
|
319
|
+
</>)}
|
|
320
|
+
{controlTools === null || controlTools === void 0 ? void 0 : controlTools.map((tool) => (<ButtonTools key={tool.id} buttonProps={{
|
|
321
|
+
icon: tool.icon,
|
|
322
|
+
type: "text",
|
|
323
|
+
name: tool.name,
|
|
324
|
+
onClick: () => hanldeSelectTool(tool.id),
|
|
325
|
+
style: active === tool.id ? { color: "red" } : {},
|
|
326
|
+
}} popoverProps={{
|
|
327
|
+
content: <div>{tool.name}</div>,
|
|
328
|
+
trigger: "hover",
|
|
329
|
+
placement: "right",
|
|
330
|
+
}} items={[]}/>))}
|
|
331
|
+
<ColorPicker value={color} onChange={handleChangeColorBackground}>
|
|
332
|
+
<Button icon={<PaintBucket />} type="text" name="Background Color" onClick={() => hanldeSelectTool("background-color")} style={active === "background-color" ? { color: "red" } : {}}/>
|
|
333
|
+
</ColorPicker>
|
|
334
|
+
<Button icon={preview ? <EyeOff /> : <Eye />} type="text" name="Preview" onClick={handleOpenModalPreview} style={active === "preview" ? { color: "red" } : {}}/>
|
|
335
|
+
<Button icon={<Grid />} type="text" name="Grid" onClick={() => toggleGrid()}/>
|
|
336
|
+
<ButtonTools buttonProps={{
|
|
337
|
+
onClick: () => handleRemoveComponent(),
|
|
338
|
+
icon: <Trash />,
|
|
339
|
+
type: "text",
|
|
340
|
+
name: "trash",
|
|
341
|
+
}} items={[]} popoverProps={{
|
|
342
|
+
content: <div>Trash</div>,
|
|
343
|
+
trigger: "hover",
|
|
344
|
+
placement: "right",
|
|
345
|
+
}}/>
|
|
346
|
+
<ButtonTools buttonProps={{
|
|
347
|
+
onClick: () => toogleSetLockBackground(),
|
|
348
|
+
icon: lockBackground ? <Lock /> : <LockOpen />,
|
|
349
|
+
type: "text",
|
|
350
|
+
name: "trash",
|
|
351
|
+
}} items={[]} popoverProps={{
|
|
352
|
+
content: <div>{lockBackground ? "Unlock Background" : "Lock Background"}</div>,
|
|
353
|
+
trigger: "hover",
|
|
354
|
+
placement: "right",
|
|
355
|
+
}}/>
|
|
356
|
+
<ButtonTools buttonProps={{
|
|
357
|
+
onClick: () => handleUndo(),
|
|
358
|
+
icon: <Undo2 />,
|
|
359
|
+
type: "text",
|
|
360
|
+
name: "undo",
|
|
361
|
+
}} items={[]} popoverProps={{
|
|
362
|
+
content: <div>Undo</div>,
|
|
363
|
+
trigger: "hover",
|
|
364
|
+
placement: "right",
|
|
365
|
+
}}/>
|
|
366
|
+
<ButtonTools buttonProps={{
|
|
367
|
+
onClick: () => handleRedo(),
|
|
368
|
+
icon: <Redo2 />,
|
|
369
|
+
type: "text",
|
|
370
|
+
name: "redo",
|
|
371
|
+
}} items={[]} popoverProps={{
|
|
372
|
+
content: <div>Redo</div>,
|
|
373
|
+
trigger: "hover",
|
|
374
|
+
placement: "right",
|
|
375
|
+
}}/>
|
|
376
|
+
</div>);
|
|
355
377
|
};
|
|
356
378
|
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
|
|
18
|
+
declare const LayerView: (props: LayerViewProps) => import("react").JSX.Element;
|
|
19
19
|
export default LayerView;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
4
3
|
import { TransformWrapper, TransformComponent, } from "react-zoom-pan-pinch";
|
|
5
4
|
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
@@ -160,39 +159,47 @@ const LayerView = (props) => {
|
|
|
160
159
|
}
|
|
161
160
|
};
|
|
162
161
|
}, []);
|
|
163
|
-
return (
|
|
162
|
+
return (<div className="relative w-full h-full flex-1" ref={containerRef} style={{
|
|
164
163
|
height: "100vh",
|
|
165
164
|
overflow: "auto",
|
|
166
165
|
WebkitOverflowScrolling: "touch",
|
|
167
166
|
touchAction: "pan-y",
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
167
|
+
}} {...props.containerProps}>
|
|
168
|
+
<TransformWrapper 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}>
|
|
182
|
+
<TransformComponent wrapperStyle={{
|
|
183
|
+
width: "100%",
|
|
184
|
+
height: "100%",
|
|
185
|
+
overflow: "visible",
|
|
186
|
+
}} contentStyle={{
|
|
187
|
+
width: "100%",
|
|
188
|
+
height: "100%",
|
|
189
|
+
}}>
|
|
190
|
+
<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={{
|
|
191
|
+
background: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : defaultBackground,
|
|
192
|
+
display: "block",
|
|
193
|
+
pointerEvents: "auto",
|
|
194
|
+
// touchAction: "pan-y",
|
|
195
|
+
}}>
|
|
196
|
+
<Layers mode="view" components={[
|
|
197
|
+
...extraComponentsEditor,
|
|
198
|
+
...renderElements(componentsEditor, mappingKey, colorMatchKey),
|
|
199
|
+
]} onClick={handleSelectComponent} selectedTable={selectedTable} selectedTableColor={selectedTableColor}/>
|
|
200
|
+
</svg>
|
|
201
|
+
</TransformComponent>
|
|
202
|
+
</TransformWrapper>
|
|
203
|
+
</div>);
|
|
197
204
|
};
|
|
198
205
|
export default LayerView;
|
|
@@ -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
|
|
18
|
+
declare const LayerView: (props: LayerViewProps) => import("react").JSX.Element;
|
|
19
19
|
export default LayerView;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
4
3
|
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
5
4
|
import Layers from "../../components/layer";
|
|
@@ -161,17 +160,21 @@ const LayerView = (props) => {
|
|
|
161
160
|
}
|
|
162
161
|
};
|
|
163
162
|
}, []);
|
|
164
|
-
return (
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
163
|
+
return (<div className="relative w-full h-full flex-1" ref={containerRef} {...props.containerProps}>
|
|
164
|
+
<svg {...props.svgProps}
|
|
165
|
+
// id="workspace"
|
|
166
|
+
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={{
|
|
167
|
+
background: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : defaultBackground,
|
|
168
|
+
display: "block",
|
|
169
|
+
pointerEvents: "auto",
|
|
170
|
+
touchAction: "auto",
|
|
171
|
+
// touchAction: "pan-y",
|
|
172
|
+
}}>
|
|
173
|
+
<Layers mode="view" components={[
|
|
174
|
+
...extraComponentsEditor,
|
|
175
|
+
...renderElements(componentsEditor, mappingKey, colorMatchKey),
|
|
176
|
+
]} onClick={handleSelectComponent} selectedTable={selectedTable} selectedTableColor={selectedTableColor}/>
|
|
177
|
+
</svg>
|
|
178
|
+
</div>);
|
|
176
179
|
};
|
|
177
180
|
export default LayerView;
|
|
@@ -64,5 +64,5 @@ export interface LayerViewProps {
|
|
|
64
64
|
onSwitch?: (e: MouseEvent, component: ComponentProps) => void;
|
|
65
65
|
refs?: React.ForwardedRef<RefLayerView>;
|
|
66
66
|
}
|
|
67
|
-
declare const LayerView: (props: LayerViewProps) =>
|
|
67
|
+
declare const LayerView: (props: LayerViewProps) => React.JSX.Element;
|
|
68
68
|
export default LayerView;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { useEffect, useMemo, useRef, useState, useImperativeHandle, } from "react";
|
|
2
|
+
import React, { useEffect, useMemo, useRef, useState, useImperativeHandle, } from "react";
|
|
4
3
|
import { TransformWrapper, TransformComponent, } from "react-zoom-pan-pinch";
|
|
5
4
|
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
6
5
|
import Layers from "../../components/layer-v4";
|
|
@@ -478,33 +477,53 @@ const LayerView = (props) => {
|
|
|
478
477
|
handlePan(0, -speedPanning);
|
|
479
478
|
}
|
|
480
479
|
};
|
|
481
|
-
return (
|
|
480
|
+
return (<div className="relative w-full h-full flex-1" ref={containerRef} style={{
|
|
482
481
|
height: "100vh",
|
|
483
482
|
overflow: "auto",
|
|
484
483
|
WebkitOverflowScrolling: "touch",
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
484
|
+
}} {...props.containerProps}>
|
|
485
|
+
{/* {isDragging?.current && (
|
|
486
|
+
<div className="absolute bottom-1/2 left-1 flex gap-4 z-[10]">
|
|
487
|
+
<button className="p-4 bg-gray-400">+</button>
|
|
488
|
+
</div>
|
|
489
|
+
)} */}
|
|
490
|
+
|
|
491
|
+
<TransformWrapper ref={transformRef} {...props.transformProps}
|
|
492
|
+
// disabled={fingerCount === 1 && scale === 1}
|
|
493
|
+
disablePadding={true} centerZoomedOut={true} panning={{
|
|
494
|
+
disabled: panningGroup,
|
|
495
|
+
wheelPanning: true,
|
|
496
|
+
}} wheel={{
|
|
497
|
+
disabled: false,
|
|
498
|
+
}} onTransformed={({ state: { scale } }) => setScale(scale)} minScale={1} maxScale={1000} initialScale={1} smooth={true}>
|
|
499
|
+
<TransformComponent wrapperStyle={{
|
|
500
|
+
width: "100%",
|
|
501
|
+
height: "100%",
|
|
502
|
+
overflow: "visible",
|
|
503
|
+
}} contentStyle={{
|
|
504
|
+
width: "100%",
|
|
505
|
+
height: "100%",
|
|
506
|
+
}}>
|
|
507
|
+
<svg id="workspace" onContextMenu={(e) => e.preventDefault()} onDrop={(e) => handleTableEvent(e, "drop")} onPointerDown={handlePointerDown} onPointerUp={handleMouseUp} 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={{
|
|
508
|
+
background: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : defaultBackground,
|
|
509
|
+
display: "block",
|
|
510
|
+
pointerEvents: "all",
|
|
511
|
+
touchAction: "none",
|
|
512
|
+
userSelect: "none",
|
|
513
|
+
}} {...props.svgProps}>
|
|
514
|
+
<g id="main-layer">
|
|
515
|
+
<Layers components={[
|
|
516
|
+
...extraComponentsEditor,
|
|
517
|
+
...renderElements(componentsEditor, mappingKey, tableMatchKey),
|
|
518
|
+
]} selectedTable={selectedTable} iconTags={iconTags} eventMatchTable={eventMatchTable}/>
|
|
519
|
+
</g>
|
|
520
|
+
{/* 🧠 Ghost universal */}
|
|
521
|
+
</svg>
|
|
522
|
+
{tooltip.visible && (<div className={`seat-editor tooltip-container ${tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.className}`} style={Object.assign({ top: tooltip.y, left: tooltip.x, minWidth: widthTooltip + "px" }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.style)}>
|
|
523
|
+
hallo dunia
|
|
524
|
+
</div>)}
|
|
525
|
+
</TransformComponent>
|
|
526
|
+
</TransformWrapper>
|
|
527
|
+
</div>);
|
|
509
528
|
};
|
|
510
529
|
export default LayerView;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ import SideTool from "./features/side-tool";
|
|
|
4
4
|
import ControlPanels from "./features/panel";
|
|
5
5
|
import LayerView, { type LayerViewProps } from "./features/view-only";
|
|
6
6
|
import LayerView2, { type LayerViewProps as LayerViewProps2 } from "./features/view-only-2";
|
|
7
|
+
import LayerView3, { type LayerViewProps as LayerViewProps3 } from "./features/view-only-3";
|
|
7
8
|
import TableEditor from "./features/package";
|
|
8
|
-
export { StoreProvider as ProviderSeatEditor, Board, SideTool, ControlPanels, LayerView, LayerView2, LayerViewProps2, LayerViewProps, TableEditor as SeatEditor };
|
|
9
|
+
export { StoreProvider as ProviderSeatEditor, Board, SideTool, ControlPanels, LayerView, LayerView2, LayerViewProps2, LayerViewProps, TableEditor as SeatEditor, LayerView3, LayerViewProps3 };
|
package/dist/index.js
CHANGED
|
@@ -4,5 +4,6 @@ import SideTool from "./features/side-tool";
|
|
|
4
4
|
import ControlPanels from "./features/panel";
|
|
5
5
|
import LayerView from "./features/view-only";
|
|
6
6
|
import LayerView2 from "./features/view-only-2";
|
|
7
|
+
import LayerView3 from "./features/view-only-3";
|
|
7
8
|
import TableEditor from "./features/package";
|
|
8
|
-
export { StoreProvider as ProviderSeatEditor, Board, SideTool, ControlPanels, LayerView, LayerView2, TableEditor as SeatEditor };
|
|
9
|
+
export { StoreProvider as ProviderSeatEditor, Board, SideTool, ControlPanels, LayerView, LayerView2, TableEditor as SeatEditor, LayerView3 };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { ConfigProvider } from "antd";
|
|
4
|
+
import { AntdRegistry } from "@ant-design/nextjs-registry";
|
|
5
|
+
import { useAppSelector, useAppDispatch } from "../hooks/use-redux";
|
|
6
|
+
export const AntdProvider = ({ children, themeColor }) => {
|
|
7
|
+
const dispatch = useAppDispatch();
|
|
8
|
+
const theme = useAppSelector((state) => state.theme);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (themeColor !== theme.primaryColor) {
|
|
11
|
+
dispatch({
|
|
12
|
+
type: "theme/setPrimaryColor",
|
|
13
|
+
payload: themeColor
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}, [themeColor]);
|
|
17
|
+
return (<AntdRegistry>
|
|
18
|
+
<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
|
+
}}>
|
|
43
|
+
{children}
|
|
44
|
+
</ConfigProvider>
|
|
45
|
+
</AntdRegistry>);
|
|
46
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { store } from "../libs/store";
|
|
4
3
|
import { Provider } from "react-redux";
|
|
5
4
|
export const ReduxProvider = ({ children }) => {
|
|
6
|
-
return
|
|
5
|
+
return <Provider store={store}>{children}</Provider>;
|
|
7
6
|
};
|