seat-editor 2.1.0 → 2.1.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.jsx → layout.js} +2 -7
- package/dist/app/new-board/page.d.ts +1 -1
- package/dist/app/new-board/page.js +34 -0
- package/dist/app/old-board/page.d.ts +1 -2
- package/dist/app/old-board/{page.jsx → page.js} +82 -215
- package/dist/app/only-view/page.d.ts +1 -1
- package/dist/app/only-view/{page.jsx → page.js} +2 -1
- package/dist/app/page.d.ts +1 -1
- package/dist/app/page.js +8 -0
- package/dist/app/test/page.d.ts +1 -2
- package/dist/app/test/{page.jsx → page.js} +3 -5
- package/dist/app/v2/page.d.ts +1 -1
- package/dist/app/v2/page.js +8 -0
- package/dist/components/button-tools/index.d.ts +1 -1
- package/dist/components/button-tools/index.js +11 -0
- package/dist/components/form-tools/label.d.ts +1 -1
- package/dist/components/form-tools/label.js +7 -0
- package/dist/components/form-tools/shape.d.ts +1 -1
- package/dist/components/form-tools/shape.js +25 -0
- package/dist/components/input/number-indicator.d.ts +1 -1
- package/dist/components/input/{number-indicator.jsx → number-indicator.js} +2 -11
- package/dist/components/joystick/index.d.ts +1 -2
- package/dist/components/joystick/{index.jsx → index.js} +13 -14
- package/dist/components/layer/index.d.ts +1 -1
- package/dist/components/layer/index.js +295 -0
- package/dist/components/layer-v2/index.d.ts +1 -1
- package/dist/components/layer-v2/index.js +282 -0
- package/dist/components/layer-v3/index.d.ts +1 -1
- package/dist/components/layer-v3/index.js +337 -0
- package/dist/components/lib/index.d.ts +1 -1
- package/dist/components/lib/{index.jsx → index.js} +2 -7
- package/dist/components/modal-preview/index.d.ts +1 -1
- package/dist/components/modal-preview/index.js +10 -0
- package/dist/features/board/index.d.ts +1 -1
- package/dist/features/board/{index.jsx → index.js} +31 -90
- package/dist/features/board-v2/index.d.ts +1 -2
- package/dist/features/board-v2/{index.jsx → index.js} +39 -101
- package/dist/features/board-v3/index.d.ts +1 -2
- package/dist/features/board-v3/{index.jsx → index.js} +42 -120
- package/dist/features/navbar/index.d.ts +1 -1
- package/dist/features/navbar/index.js +6 -0
- package/dist/features/package/index.d.ts +1 -1
- package/dist/features/package/{index.jsx → index.js} +6 -16
- package/dist/features/panel/index.d.ts +1 -1
- package/dist/features/panel/{index.jsx → index.js} +8 -16
- package/dist/features/panel/select-tool.d.ts +1 -1
- package/dist/features/panel/{select-tool.jsx → select-tool.js} +8 -20
- package/dist/features/panel/square-circle-tool.d.ts +1 -1
- package/dist/features/panel/{square-circle-tool.jsx → square-circle-tool.js} +2 -4
- package/dist/features/panel/table-seat-circle.d.ts +1 -1
- package/dist/features/panel/table-seat-circle.js +9 -0
- package/dist/features/panel/text-tool.d.ts +1 -1
- package/dist/features/panel/text-tool.js +7 -0
- package/dist/features/panel/upload-tool.d.ts +1 -1
- package/dist/features/panel/{upload-tool.jsx → upload-tool.js} +2 -24
- package/dist/features/side-tool/index.d.ts +1 -1
- package/dist/features/side-tool/{index.jsx → index.js} +98 -120
- package/dist/features/view/index.d.ts +1 -1
- package/dist/features/view/{index.jsx → index.js} +31 -38
- package/dist/features/view-only/index.d.ts +1 -1
- package/dist/features/view-only/{index.jsx → index.js} +31 -38
- package/dist/features/view-only-2/index.d.ts +1 -1
- package/dist/features/view-only-2/{index.jsx → index.js} +13 -16
- package/dist/provider/antd-provider.js +43 -0
- package/dist/provider/redux-provider.d.ts +1 -1
- package/dist/provider/{redux-provider.jsx → redux-provider.js} +2 -1
- package/dist/provider/store-provider.d.ts +1 -1
- package/dist/provider/{store-provider.jsx → store-provider.js} +2 -3
- package/dist/seat-editor.css +1 -1
- package/package.json +1 -1
- package/dist/app/new-board/page.jsx +0 -56
- package/dist/app/page.jsx +0 -13
- package/dist/app/v2/page.jsx +0 -13
- package/dist/components/button-tools/index.jsx +0 -17
- package/dist/components/form-tools/label.jsx +0 -44
- package/dist/components/form-tools/shape.jsx +0 -66
- package/dist/components/layer/index.jsx +0 -383
- package/dist/components/layer-v2/index.jsx +0 -370
- package/dist/components/layer-v3/index.jsx +0 -418
- package/dist/components/modal-preview/index.jsx +0 -11
- package/dist/features/navbar/index.jsx +0 -5
- package/dist/features/panel/table-seat-circle.jsx +0 -31
- package/dist/features/panel/text-tool.jsx +0 -26
- package/dist/provider/antd-provider.jsx +0 -46
|
@@ -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 allowChangeShape={type === "component"}/>
|
|
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, { allowChangeShape: type === "component" }), _jsx(SectionLabel, {})] }));
|
|
151
129
|
};
|
|
152
130
|
export default UploadTool;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { Circle, CopyPlus, Eye, EyeOff, Image, Layers2, MousePointer, PaintBucket, Ratio, SquareMousePointer, Trash, Type, Upload, Hand, Layers, Ruler, Grid, MousePointer2, Lock, LockOpen, Undo2, Redo2, } from "lucide-react";
|
|
3
4
|
import ButtonTools from "../../components/button-tools";
|
|
4
5
|
import { Divider, ColorPicker, Button, message, } from "antd";
|
|
@@ -15,22 +16,22 @@ const SideTool = ({ dragOnly, deleteAutorized, }) => {
|
|
|
15
16
|
{
|
|
16
17
|
id: "select",
|
|
17
18
|
name: "Select Tool",
|
|
18
|
-
icon:
|
|
19
|
+
icon: _jsx(MousePointer, {}),
|
|
19
20
|
},
|
|
20
21
|
{
|
|
21
22
|
id: "grab",
|
|
22
23
|
name: "Grab Tool",
|
|
23
|
-
icon:
|
|
24
|
+
icon: _jsx(Hand, {}),
|
|
24
25
|
},
|
|
25
26
|
{
|
|
26
27
|
id: "ruler",
|
|
27
28
|
name: "Ruler",
|
|
28
|
-
icon:
|
|
29
|
+
icon: _jsx(Ruler, {}),
|
|
29
30
|
},
|
|
30
31
|
{
|
|
31
32
|
id: "node",
|
|
32
33
|
name: "Node Tool",
|
|
33
|
-
icon:
|
|
34
|
+
icon: _jsx(MousePointer2, {}),
|
|
34
35
|
},
|
|
35
36
|
];
|
|
36
37
|
const actionsTools = [
|
|
@@ -42,22 +43,22 @@ const SideTool = ({ dragOnly, deleteAutorized, }) => {
|
|
|
42
43
|
{
|
|
43
44
|
id: "square",
|
|
44
45
|
name: "Square",
|
|
45
|
-
icon:
|
|
46
|
+
icon: _jsx(SquareMousePointer, {}),
|
|
46
47
|
},
|
|
47
48
|
{
|
|
48
49
|
id: "circle",
|
|
49
50
|
name: "Circle",
|
|
50
|
-
icon:
|
|
51
|
+
icon: _jsx(Circle, {}),
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
54
|
id: "table-seat-circle",
|
|
54
55
|
name: "Table Seat Circle",
|
|
55
|
-
icon:
|
|
56
|
+
icon: _jsx(Ratio, {}),
|
|
56
57
|
},
|
|
57
58
|
{
|
|
58
59
|
id: "image-table",
|
|
59
60
|
name: "Image Table",
|
|
60
|
-
icon:
|
|
61
|
+
icon: _jsx(Upload, {}),
|
|
61
62
|
},
|
|
62
63
|
// {
|
|
63
64
|
// id: "table-seat-square",
|
|
@@ -74,12 +75,12 @@ const SideTool = ({ dragOnly, deleteAutorized, }) => {
|
|
|
74
75
|
{
|
|
75
76
|
id: "background",
|
|
76
77
|
name: "Background",
|
|
77
|
-
icon:
|
|
78
|
+
icon: _jsx(Image, {}),
|
|
78
79
|
},
|
|
79
80
|
{
|
|
80
81
|
id: "text",
|
|
81
82
|
name: "Text",
|
|
82
|
-
icon:
|
|
83
|
+
icon: _jsx(Type, {}),
|
|
83
84
|
},
|
|
84
85
|
// {
|
|
85
86
|
// id: "background-color",
|
|
@@ -250,122 +251,99 @@ const SideTool = ({ dragOnly, deleteAutorized, }) => {
|
|
|
250
251
|
dispatch({ type: "board/redoHistory" });
|
|
251
252
|
dispatch({ type: "board/setFlagChange", payload: true });
|
|
252
253
|
};
|
|
253
|
-
return (
|
|
254
|
-
{tools === null || tools === void 0 ? void 0 : tools.map((tool) => (<ButtonTools key={tool.id} buttonProps={{
|
|
255
|
-
icon: tool.icon,
|
|
256
|
-
type: "text",
|
|
257
|
-
name: tool.name,
|
|
258
|
-
onClick: () => hanldeSelectTool(tool.id),
|
|
259
|
-
style: active === tool.id ? { color: "red" } : {},
|
|
260
|
-
}} popoverProps={{
|
|
261
|
-
content: <div>{tool.name}</div>,
|
|
262
|
-
trigger: "hover",
|
|
263
|
-
placement: "right",
|
|
264
|
-
}} items={[]}/>))}
|
|
265
|
-
{!dragOnly && (<>
|
|
266
|
-
<ButtonTools buttonProps={{
|
|
267
|
-
icon: <CopyPlus />,
|
|
268
|
-
type: "text",
|
|
269
|
-
name: "duplicate",
|
|
270
|
-
onClick: () => handleDuplicateComponent(),
|
|
271
|
-
}} items={[]} popoverProps={{
|
|
272
|
-
content: <div>Duplicate</div>,
|
|
273
|
-
trigger: "hover",
|
|
274
|
-
placement: "right",
|
|
275
|
-
}}/>
|
|
276
|
-
|
|
277
|
-
<ButtonTools buttonProps={{
|
|
278
|
-
onClick: () => handleOverride(),
|
|
279
|
-
icon: <Layers2 />,
|
|
280
|
-
type: "text",
|
|
281
|
-
name: "override",
|
|
282
|
-
}} items={[]} popoverProps={{
|
|
283
|
-
content: <div>Override Right</div>,
|
|
284
|
-
trigger: "hover",
|
|
285
|
-
placement: "right",
|
|
286
|
-
}}/>
|
|
287
|
-
<ButtonTools buttonProps={{
|
|
288
|
-
onClick: () => handleOverrideLeft(),
|
|
289
|
-
icon: <Layers />,
|
|
290
|
-
type: "text",
|
|
291
|
-
name: "override",
|
|
292
|
-
}} items={[]} popoverProps={{
|
|
293
|
-
content: <div>Override Left</div>,
|
|
294
|
-
trigger: "hover",
|
|
295
|
-
placement: "right",
|
|
296
|
-
}}/>
|
|
297
|
-
|
|
298
|
-
<Divider />
|
|
299
|
-
{actionsTools === null || actionsTools === void 0 ? void 0 : actionsTools.map((tool) => (<ButtonTools key={tool.id} buttonProps={{
|
|
254
|
+
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: {
|
|
300
255
|
icon: tool.icon,
|
|
301
256
|
type: "text",
|
|
302
257
|
name: tool.name,
|
|
303
258
|
onClick: () => hanldeSelectTool(tool.id),
|
|
304
259
|
style: active === tool.id ? { color: "red" } : {},
|
|
305
|
-
}
|
|
306
|
-
content:
|
|
260
|
+
}, popoverProps: {
|
|
261
|
+
content: _jsx("div", { children: tool.name }),
|
|
307
262
|
trigger: "hover",
|
|
308
263
|
placement: "right",
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
264
|
+
}, items: [] }, tool.id))), !dragOnly && (_jsxs(_Fragment, { children: [_jsx(ButtonTools, { buttonProps: {
|
|
265
|
+
icon: _jsx(CopyPlus, {}),
|
|
266
|
+
type: "text",
|
|
267
|
+
name: "duplicate",
|
|
268
|
+
onClick: () => handleDuplicateComponent(),
|
|
269
|
+
}, items: [], popoverProps: {
|
|
270
|
+
content: _jsx("div", { children: "Duplicate" }),
|
|
271
|
+
trigger: "hover",
|
|
272
|
+
placement: "right",
|
|
273
|
+
} }), _jsx(ButtonTools, { buttonProps: {
|
|
274
|
+
onClick: () => handleOverride(),
|
|
275
|
+
icon: _jsx(Layers2, {}),
|
|
276
|
+
type: "text",
|
|
277
|
+
name: "override",
|
|
278
|
+
}, items: [], popoverProps: {
|
|
279
|
+
content: _jsx("div", { children: "Override Right" }),
|
|
280
|
+
trigger: "hover",
|
|
281
|
+
placement: "right",
|
|
282
|
+
} }), _jsx(ButtonTools, { buttonProps: {
|
|
283
|
+
onClick: () => handleOverrideLeft(),
|
|
284
|
+
icon: _jsx(Layers, {}),
|
|
285
|
+
type: "text",
|
|
286
|
+
name: "override",
|
|
287
|
+
}, items: [], popoverProps: {
|
|
288
|
+
content: _jsx("div", { children: "Override Left" }),
|
|
289
|
+
trigger: "hover",
|
|
290
|
+
placement: "right",
|
|
291
|
+
} }), _jsx(Divider, {}), actionsTools === null || actionsTools === void 0 ? void 0 : actionsTools.map((tool) => (_jsx(ButtonTools, { buttonProps: {
|
|
292
|
+
icon: tool.icon,
|
|
293
|
+
type: "text",
|
|
294
|
+
name: tool.name,
|
|
295
|
+
onClick: () => hanldeSelectTool(tool.id),
|
|
296
|
+
style: active === tool.id ? { color: "red" } : {},
|
|
297
|
+
}, popoverProps: {
|
|
298
|
+
content: _jsx("div", { children: tool.name }),
|
|
299
|
+
trigger: "hover",
|
|
300
|
+
placement: "right",
|
|
301
|
+
}, items: [] }, tool.id))), _jsx(Divider, {})] })), controlTools === null || controlTools === void 0 ? void 0 : controlTools.map((tool) => (_jsx(ButtonTools, { buttonProps: {
|
|
302
|
+
icon: tool.icon,
|
|
303
|
+
type: "text",
|
|
304
|
+
name: tool.name,
|
|
305
|
+
onClick: () => hanldeSelectTool(tool.id),
|
|
306
|
+
style: active === tool.id ? { color: "red" } : {},
|
|
307
|
+
}, popoverProps: {
|
|
308
|
+
content: _jsx("div", { children: tool.name }),
|
|
309
|
+
trigger: "hover",
|
|
310
|
+
placement: "right",
|
|
311
|
+
}, 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() }), _jsx(ButtonTools, { buttonProps: {
|
|
312
|
+
onClick: () => handleRemoveComponent(),
|
|
313
|
+
icon: _jsx(Trash, {}),
|
|
314
|
+
type: "text",
|
|
315
|
+
name: "trash",
|
|
316
|
+
}, items: [], popoverProps: {
|
|
317
|
+
content: _jsx("div", { children: "Trash" }),
|
|
318
|
+
trigger: "hover",
|
|
319
|
+
placement: "right",
|
|
320
|
+
} }), _jsx(ButtonTools, { buttonProps: {
|
|
321
|
+
onClick: () => toogleSetLockBackground(),
|
|
322
|
+
icon: lockBackground ? _jsx(Lock, {}) : _jsx(LockOpen, {}),
|
|
323
|
+
type: "text",
|
|
324
|
+
name: "trash",
|
|
325
|
+
}, items: [], popoverProps: {
|
|
326
|
+
content: _jsx("div", { children: lockBackground ? "Unlock Background" : "Lock Background" }),
|
|
327
|
+
trigger: "hover",
|
|
328
|
+
placement: "right",
|
|
329
|
+
} }), _jsx(ButtonTools, { buttonProps: {
|
|
330
|
+
onClick: () => handleUndo(),
|
|
331
|
+
icon: _jsx(Undo2, {}),
|
|
332
|
+
type: "text",
|
|
333
|
+
name: "undo",
|
|
334
|
+
}, items: [], popoverProps: {
|
|
335
|
+
content: _jsx("div", { children: "Undo" }),
|
|
336
|
+
trigger: "hover",
|
|
337
|
+
placement: "right",
|
|
338
|
+
} }), _jsx(ButtonTools, { buttonProps: {
|
|
339
|
+
onClick: () => handleRedo(),
|
|
340
|
+
icon: _jsx(Redo2, {}),
|
|
341
|
+
type: "text",
|
|
342
|
+
name: "redo",
|
|
343
|
+
}, items: [], popoverProps: {
|
|
344
|
+
content: _jsx("div", { children: "Redo" }),
|
|
345
|
+
trigger: "hover",
|
|
346
|
+
placement: "right",
|
|
347
|
+
} })] }));
|
|
370
348
|
};
|
|
371
349
|
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";
|
|
@@ -182,47 +183,39 @@ const LayerView = (props) => {
|
|
|
182
183
|
}
|
|
183
184
|
};
|
|
184
185
|
}, []);
|
|
185
|
-
return (
|
|
186
|
+
return (_jsx("div", Object.assign({ className: "relative w-full h-full flex-1", ref: containerRef, style: {
|
|
186
187
|
height: "100vh",
|
|
187
188
|
overflow: "auto",
|
|
188
189
|
WebkitOverflowScrolling: "touch",
|
|
189
190
|
touchAction: "pan-y",
|
|
190
|
-
}}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
<Layers mode="view" components={[
|
|
220
|
-
...((extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor.length) > 0 ? extraComponentsEditor : []),
|
|
221
|
-
...renderElements(componentsEditor, mappingKey, colorMatchKey),
|
|
222
|
-
]} onClick={handleSelectComponent} selectedTable={selectedTable} selectedTableColor={selectedTableColor}/>
|
|
223
|
-
</svg>
|
|
224
|
-
</TransformComponent>
|
|
225
|
-
</TransformWrapper>
|
|
226
|
-
</div>);
|
|
191
|
+
} }, props.containerProps, { children: _jsx(TransformWrapper, Object.assign({ ref: transformRef }, props.transformProps, { disabled: fingerCount === 1 && scale === 1, disablePadding: true,
|
|
192
|
+
// panning={{
|
|
193
|
+
// disabled: false,
|
|
194
|
+
// velocityDisabled: true,
|
|
195
|
+
// }}
|
|
196
|
+
// limitToBounds={false}
|
|
197
|
+
// doubleClick={{ disabled: true }}
|
|
198
|
+
// pinch={{ disabled: false }}
|
|
199
|
+
// wheel={{ disabled: true }}
|
|
200
|
+
// disabled={true}
|
|
201
|
+
// disablePadding={true}
|
|
202
|
+
centerZoomedOut: true, onTransformed: ({ state: { scale } }) => setScale(scale), minScale: 1, maxScale: 1000, initialScale: 1,
|
|
203
|
+
// pinch={{ step: 1 }}
|
|
204
|
+
smooth: true, children: _jsx(TransformComponent, { wrapperStyle: {
|
|
205
|
+
width: "100%",
|
|
206
|
+
height: "100%",
|
|
207
|
+
overflow: "visible",
|
|
208
|
+
}, contentStyle: {
|
|
209
|
+
width: "100%",
|
|
210
|
+
height: "100%",
|
|
211
|
+
}, 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: {
|
|
212
|
+
background: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : defaultBackground,
|
|
213
|
+
display: "block",
|
|
214
|
+
pointerEvents: "auto",
|
|
215
|
+
// touchAction: "pan-y",
|
|
216
|
+
}, children: _jsx(Layers, { mode: "view", components: [
|
|
217
|
+
...((extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor.length) > 0 ? extraComponentsEditor : []),
|
|
218
|
+
...renderElements(componentsEditor, mappingKey, colorMatchKey),
|
|
219
|
+
], onClick: handleSelectComponent, selectedTable: selectedTable, selectedTableColor: selectedTableColor }) })) }) })) })));
|
|
227
220
|
};
|
|
228
221
|
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").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";
|
|
@@ -160,47 +161,39 @@ const LayerView = (props) => {
|
|
|
160
161
|
}
|
|
161
162
|
};
|
|
162
163
|
}, []);
|
|
163
|
-
return (
|
|
164
|
+
return (_jsx("div", Object.assign({ className: "relative w-full h-full flex-1", ref: containerRef, style: {
|
|
164
165
|
height: "100vh",
|
|
165
166
|
overflow: "auto",
|
|
166
167
|
WebkitOverflowScrolling: "touch",
|
|
167
168
|
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
|
-
|
|
197
|
-
<Layers mode="view" components={[
|
|
198
|
-
...extraComponentsEditor,
|
|
199
|
-
...renderElements(componentsEditor, mappingKey, colorMatchKey),
|
|
200
|
-
]} onClick={handleSelectComponent} selectedTable={selectedTable} selectedTableColor={selectedTableColor}/>
|
|
201
|
-
</svg>
|
|
202
|
-
</TransformComponent>
|
|
203
|
-
</TransformWrapper>
|
|
204
|
-
</div>);
|
|
169
|
+
} }, props.containerProps, { children: _jsx(TransformWrapper, Object.assign({ ref: transformRef }, props.transformProps, { disabled: fingerCount === 1 && scale === 1, disablePadding: true,
|
|
170
|
+
// panning={{
|
|
171
|
+
// disabled: false,
|
|
172
|
+
// velocityDisabled: true,
|
|
173
|
+
// }}
|
|
174
|
+
// limitToBounds={false}
|
|
175
|
+
// doubleClick={{ disabled: true }}
|
|
176
|
+
// pinch={{ disabled: false }}
|
|
177
|
+
// wheel={{ disabled: true }}
|
|
178
|
+
// disabled={true}
|
|
179
|
+
// disablePadding={true}
|
|
180
|
+
centerZoomedOut: true, onTransformed: ({ state: { scale } }) => setScale(scale), minScale: 1, maxScale: 1000, initialScale: 1,
|
|
181
|
+
// pinch={{ step: 1 }}
|
|
182
|
+
smooth: true, children: _jsx(TransformComponent, { wrapperStyle: {
|
|
183
|
+
width: "100%",
|
|
184
|
+
height: "100%",
|
|
185
|
+
overflow: "visible",
|
|
186
|
+
}, contentStyle: {
|
|
187
|
+
width: "100%",
|
|
188
|
+
height: "100%",
|
|
189
|
+
}, 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: {
|
|
190
|
+
background: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : defaultBackground,
|
|
191
|
+
display: "block",
|
|
192
|
+
pointerEvents: "auto",
|
|
193
|
+
// touchAction: "pan-y",
|
|
194
|
+
}, children: _jsx(Layers, { mode: "view", components: [
|
|
195
|
+
...extraComponentsEditor,
|
|
196
|
+
...renderElements(componentsEditor, mappingKey, colorMatchKey),
|
|
197
|
+
], onClick: handleSelectComponent, selectedTable: selectedTable, selectedTableColor: selectedTableColor }) })) }) })) })));
|
|
205
198
|
};
|
|
206
199
|
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").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 { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
5
6
|
import Layers from "../../components/layer";
|
|
@@ -161,21 +162,17 @@ const LayerView = (props) => {
|
|
|
161
162
|
}
|
|
162
163
|
};
|
|
163
164
|
}, []);
|
|
164
|
-
return (
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
...renderElements(componentsEditor, mappingKey, colorMatchKey),
|
|
177
|
-
]} onClick={handleSelectComponent} selectedTable={selectedTable} selectedTableColor={selectedTableColor}/>
|
|
178
|
-
</svg>
|
|
179
|
-
</div>);
|
|
165
|
+
return (_jsx("div", Object.assign({ className: "relative w-full h-full flex-1", ref: containerRef }, props.containerProps, { children: _jsx("svg", Object.assign({}, props.svgProps, {
|
|
166
|
+
// id="workspace"
|
|
167
|
+
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: {
|
|
168
|
+
background: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : defaultBackground,
|
|
169
|
+
display: "block",
|
|
170
|
+
pointerEvents: "auto",
|
|
171
|
+
touchAction: "auto",
|
|
172
|
+
// touchAction: "pan-y",
|
|
173
|
+
}, children: _jsx(Layers, { mode: "view", components: [
|
|
174
|
+
...extraComponentsEditor,
|
|
175
|
+
...renderElements(componentsEditor, mappingKey, colorMatchKey),
|
|
176
|
+
], onClick: handleSelectComponent, selectedTable: selectedTable, selectedTableColor: selectedTableColor }) })) })));
|
|
180
177
|
};
|
|
181
178
|
export default LayerView;
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
};
|