seat-editor 3.0.2 → 3.0.3
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/constant.d.ts +1 -1
- 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 +33 -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/chair.d.ts +1 -1
- package/dist/app/only-view/chair.js +2 -10
- package/dist/app/only-view/page.d.ts +1 -1
- package/dist/app/only-view/page.js +78 -0
- package/dist/app/only-view/user.d.ts +1 -1
- package/dist/app/only-view/user.js +2 -10
- 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.jsx → index.js} +102 -242
- package/dist/components/layer-v4/index.d.ts +3 -3
- package/dist/components/layer-v4/{index.jsx → index.js} +81 -158
- 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 copy.d.ts +1 -2
- package/dist/features/board-v3/{index copy.jsx → index copy.js } +50 -128
- package/dist/features/board-v3/index.d.ts +1 -2
- package/dist/features/board-v3/{index.jsx → index.js} +32 -110
- 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} +7 -25
- package/dist/features/panel/select-tool.d.ts +1 -1
- package/dist/features/panel/{select-tool.jsx → select-tool.js} +10 -23
- package/dist/features/panel/selected-group.d.ts +1 -1
- package/dist/features/panel/selected-group.js +7 -0
- 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/table-seat-square.d.ts +1 -1
- package/dist/features/panel/table-seat-square.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-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/features/view-only-3/index.d.ts +3 -3
- package/dist/features/view-only-3/{index.jsx → index.js} +27 -46
- 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/package.json +1 -1
- package/dist/app/new-board/page.jsx +0 -55
- package/dist/app/only-view/page.jsx +0 -101
- 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/modal-preview/index.jsx +0 -11
- package/dist/features/navbar/index.jsx +0 -5
- package/dist/features/panel/selected-group.jsx +0 -47
- package/dist/features/panel/table-seat-circle.jsx +0 -31
- package/dist/features/panel/table-seat-square.jsx +0 -46
- package/dist/features/panel/text-tool.jsx +0 -26
- package/dist/provider/antd-provider.jsx +0 -46
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
4
|
import { TransformWrapper, TransformComponent, } from "react-zoom-pan-pinch";
|
|
4
5
|
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
@@ -159,47 +160,39 @@ const LayerView = (props) => {
|
|
|
159
160
|
}
|
|
160
161
|
};
|
|
161
162
|
}, []);
|
|
162
|
-
return (
|
|
163
|
+
return (_jsx("div", Object.assign({ className: "relative w-full h-full flex-1", ref: containerRef, style: {
|
|
163
164
|
height: "100vh",
|
|
164
165
|
overflow: "auto",
|
|
165
166
|
WebkitOverflowScrolling: "touch",
|
|
166
167
|
touchAction: "pan-y",
|
|
167
|
-
}}
|
|
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
|
-
<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>);
|
|
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 }) })) }) })) })));
|
|
204
197
|
};
|
|
205
198
|
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,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
4
|
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
4
5
|
import Layers from "../../components/layer";
|
|
@@ -160,21 +161,17 @@ const LayerView = (props) => {
|
|
|
160
161
|
}
|
|
161
162
|
};
|
|
162
163
|
}, []);
|
|
163
|
-
return (
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
...renderElements(componentsEditor, mappingKey, colorMatchKey),
|
|
176
|
-
]} onClick={handleSelectComponent} selectedTable={selectedTable} selectedTableColor={selectedTableColor}/>
|
|
177
|
-
</svg>
|
|
178
|
-
</div>);
|
|
164
|
+
return (_jsx("div", Object.assign({ className: "relative w-full h-full flex-1", ref: containerRef }, props.containerProps, { children: _jsx("svg", Object.assign({}, 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
|
+
}, children: _jsx(Layers, { mode: "view", components: [
|
|
173
|
+
...extraComponentsEditor,
|
|
174
|
+
...renderElements(componentsEditor, mappingKey, colorMatchKey),
|
|
175
|
+
], onClick: handleSelectComponent, selectedTable: selectedTable, selectedTableColor: selectedTableColor }) })) })));
|
|
179
176
|
};
|
|
180
177
|
export default LayerView;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { CSSProperties, SVGAttributes } from "react";
|
|
2
2
|
import { ReactZoomPanPinchRef, ReactZoomPanPinchProps, ReactZoomPanPinchContentRef } from "react-zoom-pan-pinch";
|
|
3
|
-
import { PropertiesProps } from "
|
|
4
|
-
import { EventHandleType } from "
|
|
3
|
+
import { PropertiesProps } from "../../dto/table";
|
|
4
|
+
import { EventHandleType } from "../../dto/event-handler";
|
|
5
5
|
export type TableGhost = {
|
|
6
6
|
table: PropertiesProps;
|
|
7
7
|
event: EventHandleType;
|
|
@@ -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) => import("react/jsx-runtime").JSX.Element;
|
|
68
68
|
export default LayerView;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useMemo, useRef, useState, useImperativeHandle, } from "react";
|
|
3
4
|
import { TransformWrapper, TransformComponent, } from "react-zoom-pan-pinch";
|
|
4
5
|
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
5
6
|
import Layers from "../../components/layer-v4";
|
|
@@ -477,53 +478,33 @@ const LayerView = (props) => {
|
|
|
477
478
|
handlePan(0, -speedPanning);
|
|
478
479
|
}
|
|
479
480
|
};
|
|
480
|
-
return (
|
|
481
|
+
return (_jsx("div", Object.assign({ className: "relative w-full h-full flex-1", ref: containerRef, style: {
|
|
481
482
|
height: "100vh",
|
|
482
483
|
overflow: "auto",
|
|
483
484
|
WebkitOverflowScrolling: "touch",
|
|
484
|
-
}}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
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>);
|
|
485
|
+
} }, props.containerProps, { children: _jsx(TransformWrapper, Object.assign({ ref: transformRef }, props.transformProps, {
|
|
486
|
+
// disabled={fingerCount === 1 && scale === 1}
|
|
487
|
+
disablePadding: true, centerZoomedOut: true, panning: {
|
|
488
|
+
disabled: panningGroup,
|
|
489
|
+
wheelPanning: true,
|
|
490
|
+
}, wheel: {
|
|
491
|
+
disabled: false,
|
|
492
|
+
}, onTransformed: ({ state: { scale } }) => setScale(scale), minScale: 1, maxScale: 1000, initialScale: 1, smooth: true, children: _jsxs(TransformComponent, { wrapperStyle: {
|
|
493
|
+
width: "100%",
|
|
494
|
+
height: "100%",
|
|
495
|
+
overflow: "visible",
|
|
496
|
+
}, contentStyle: {
|
|
497
|
+
width: "100%",
|
|
498
|
+
height: "100%",
|
|
499
|
+
}, children: [_jsx("svg", Object.assign({ 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: {
|
|
500
|
+
background: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : defaultBackground,
|
|
501
|
+
display: "block",
|
|
502
|
+
pointerEvents: "all",
|
|
503
|
+
touchAction: "none",
|
|
504
|
+
userSelect: "none",
|
|
505
|
+
} }, props.svgProps, { children: _jsx("g", { id: "main-layer", children: _jsx(Layers, { components: [
|
|
506
|
+
...extraComponentsEditor,
|
|
507
|
+
...renderElements(componentsEditor, mappingKey, tableMatchKey),
|
|
508
|
+
], selectedTable: selectedTable, iconTags: iconTags, eventMatchTable: eventMatchTable }) }) })), tooltip.visible && (_jsx("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), children: "hallo dunia" }))] }) })) })));
|
|
528
509
|
};
|
|
529
510
|
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
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { store } from "../libs/store";
|
|
3
4
|
import { Provider } from "react-redux";
|
|
4
5
|
export const ReduxProvider = ({ children }) => {
|
|
5
|
-
return
|
|
6
|
+
return _jsx(Provider, { store: store, children: children });
|
|
6
7
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { ReduxProvider } from "./redux-provider";
|
|
3
4
|
import { AntdProvider } from "./antd-provider";
|
|
4
5
|
import { injectSeatEditorCSS } from "../utils/injectCss";
|
|
5
6
|
export const StoreProvider = ({ children, themeColor = "red", }) => {
|
|
6
7
|
injectSeatEditorCSS();
|
|
7
|
-
return (
|
|
8
|
-
<AntdProvider themeColor={themeColor}>{children}</AntdProvider>
|
|
9
|
-
</ReduxProvider>);
|
|
8
|
+
return (_jsx(ReduxProvider, { children: _jsx(AntdProvider, { themeColor: themeColor, children: children }) }));
|
|
10
9
|
};
|
package/package.json
CHANGED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import SeatEditor from "../../features/package";
|
|
4
|
-
import { extraComponent } from "../constant";
|
|
5
|
-
import { data4 } from "../constant";
|
|
6
|
-
export default function NewBoard() {
|
|
7
|
-
const [initialValue, setInitialValue] = useState([]);
|
|
8
|
-
const [extraComponents, setExtraComponents] = useState([]);
|
|
9
|
-
const [backgroundColor, setBackgroundColor] = useState("#000000");
|
|
10
|
-
const [viewOnly, setViewOnly] = useState(true);
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
setInitialValue(data4);
|
|
13
|
-
setExtraComponents(extraComponent);
|
|
14
|
-
}, []);
|
|
15
|
-
return (<>
|
|
16
|
-
<div className="w-full h-screen flex flex-col relative justify-center">
|
|
17
|
-
<div className="w-full h-[1000px] bg-white border-r border-gray-200">
|
|
18
|
-
{/* <LayerView
|
|
19
|
-
componentProps={initialValue}
|
|
20
|
-
mappingKey="properties"
|
|
21
|
-
extraComponentProps={[]}
|
|
22
|
-
defaultBackground="#ffffff"
|
|
23
|
-
// dragOnly={true}
|
|
24
|
-
statusKey="status"
|
|
25
|
-
|
|
26
|
-
/> */}
|
|
27
|
-
</div>
|
|
28
|
-
{/* <button className="bg-blue-500 text-white px-4 py-2 rounded"
|
|
29
|
-
onClick={() => setViewOnly(!viewOnly)}
|
|
30
|
-
>
|
|
31
|
-
{viewOnly ? "Edit Mode" : "View Mode"}
|
|
32
|
-
</button> */}
|
|
33
|
-
<div className="flex-1 h-full">
|
|
34
|
-
<SeatEditor componentProps={initialValue} viewOnly={false} dragOnly={true} deleteAutorized={{
|
|
35
|
-
component: true,
|
|
36
|
-
extraComponent: true,
|
|
37
|
-
}} mappingKey="properties" onCurrentStateChange={(setState) => {
|
|
38
|
-
var _a, _b, _c, _d;
|
|
39
|
-
if (((_a = setState === null || setState === void 0 ? void 0 : setState.components) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
40
|
-
setInitialValue((_b = setState === null || setState === void 0 ? void 0 : setState.components) !== null && _b !== void 0 ? _b : []);
|
|
41
|
-
}
|
|
42
|
-
if (setState === null || setState === void 0 ? void 0 : setState.backgroundColor) {
|
|
43
|
-
setBackgroundColor(setState === null || setState === void 0 ? void 0 : setState.backgroundColor);
|
|
44
|
-
}
|
|
45
|
-
if (((_c = setState === null || setState === void 0 ? void 0 : setState.extraComponents) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
46
|
-
setExtraComponents((_d = setState === null || setState === void 0 ? void 0 : setState.extraComponents) !== null && _d !== void 0 ? _d : []);
|
|
47
|
-
}
|
|
48
|
-
}} extraComponentProps={extraComponents} defaultBackground={backgroundColor}
|
|
49
|
-
// dragOnly={true}
|
|
50
|
-
statusKey="status"/>
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
</div>
|
|
54
|
-
</>);
|
|
55
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import LayerView from "@/features/view-only-3";
|
|
3
|
-
import { useState, useRef } from "react";
|
|
4
|
-
import { data4 } from "../constant";
|
|
5
|
-
import { ChairIcon } from "./chair";
|
|
6
|
-
import { UserIcon } from "./user";
|
|
7
|
-
import { Modal } from "antd";
|
|
8
|
-
import JsonView from '@uiw/react-json-view';
|
|
9
|
-
const Card = (item) => {
|
|
10
|
-
const handleDragStart = (e) => {
|
|
11
|
-
// Jangan preventDefault di drag start
|
|
12
|
-
e.dataTransfer.setData("application/json", JSON.stringify(item));
|
|
13
|
-
e.dataTransfer.effectAllowed = "move";
|
|
14
|
-
};
|
|
15
|
-
return (<div className="h-40 bg-gray-400 shadow-lg rounded-lg p-4 m-4" data-table={JSON.stringify(item)} draggable onContextMenu={(e) => e.preventDefault()} onDragStart={handleDragStart} // ✅ ini yang benar
|
|
16
|
-
onClick={(e) => e.stopPropagation()} onPointerDown={(e) => e.stopPropagation()}>
|
|
17
|
-
<h2 className="text-lg font-semibold mb-2">Card Title</h2>
|
|
18
|
-
<p className="text-gray-600">{item === null || item === void 0 ? void 0 : item.name}</p>
|
|
19
|
-
</div>);
|
|
20
|
-
};
|
|
21
|
-
const TouchScrollDetect = () => {
|
|
22
|
-
const refLayer = useRef(null);
|
|
23
|
-
const [open, setOpen] = useState(false);
|
|
24
|
-
const [table, setTable] = useState(null);
|
|
25
|
-
const handleZoomIn = () => {
|
|
26
|
-
var _a, _b;
|
|
27
|
-
(_b = (_a = refLayer === null || refLayer === void 0 ? void 0 : refLayer.current) === null || _a === void 0 ? void 0 : _a.transformRef) === null || _b === void 0 ? void 0 : _b.zoomIn(0.1);
|
|
28
|
-
};
|
|
29
|
-
const handleZoomOut = () => {
|
|
30
|
-
var _a, _b;
|
|
31
|
-
(_b = (_a = refLayer === null || refLayer === void 0 ? void 0 : refLayer.current) === null || _a === void 0 ? void 0 : _a.transformRef) === null || _b === void 0 ? void 0 : _b.zoomOut();
|
|
32
|
-
};
|
|
33
|
-
const handleSwitch = (e, data) => {
|
|
34
|
-
setOpen(!open);
|
|
35
|
-
setTable(data);
|
|
36
|
-
};
|
|
37
|
-
const handleDrop = (e, data) => {
|
|
38
|
-
e.preventDefault();
|
|
39
|
-
setOpen(!open);
|
|
40
|
-
setTable(data);
|
|
41
|
-
};
|
|
42
|
-
const handleSelectTable = (item) => {
|
|
43
|
-
setOpen(!open);
|
|
44
|
-
setTable(item);
|
|
45
|
-
};
|
|
46
|
-
const renderModal = () => {
|
|
47
|
-
return (<Modal open={open} onCancel={() => setOpen(false)} width={700} title="Preview Board" centered footer={null}>
|
|
48
|
-
<div className="flex flex-col p-4 h-[500px] overflow-auto">
|
|
49
|
-
<JsonView value={table}/>
|
|
50
|
-
</div>
|
|
51
|
-
</Modal>);
|
|
52
|
-
};
|
|
53
|
-
return (<div className="w-full h-screen border-2 border-black overflow-auto" id="scroll-container">
|
|
54
|
-
{renderModal()}
|
|
55
|
-
<div className="flex">
|
|
56
|
-
<div className="h-screen bg-gray-500 w-1/3">
|
|
57
|
-
<div className="p-4">
|
|
58
|
-
{data4.map((item, index) => (<Card key={index} {...item}/>))}
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
<div className="h-screen w-2/3 relative">
|
|
62
|
-
<div className="absolute top-1 right-1 flex gap-4 z-[10]">
|
|
63
|
-
<button className="p-4 bg-gray-400" onClick={() => handleZoomIn()}>+</button>
|
|
64
|
-
<button className="p-4 bg-gray-400" onClick={() => handleZoomOut()}>-</button>
|
|
65
|
-
</div>
|
|
66
|
-
<LayerView refs={refLayer} statusKey="status" defaultBackground="#000000" mappingKey="properties" componentProps={data4} onDrop={(e, data) => handleDrop(e, data)} onSwitch={(e, data) => handleSwitch(e, data)} extraComponentProps={[]} onSelectComponent={(component) => {
|
|
67
|
-
handleSelectTable(component);
|
|
68
|
-
}} dragTableBlockKey={[
|
|
69
|
-
{
|
|
70
|
-
key: "is_lock",
|
|
71
|
-
value: 1,
|
|
72
|
-
},
|
|
73
|
-
]} tableMatchKey={[
|
|
74
|
-
{
|
|
75
|
-
key: 0,
|
|
76
|
-
properties: { fill: "white" },
|
|
77
|
-
},
|
|
78
|
-
]} eventMatchTable={[
|
|
79
|
-
{
|
|
80
|
-
event: "mouseenter",
|
|
81
|
-
properties: { fill: "red" },
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
event: "selected",
|
|
85
|
-
properties: { fill: "white" },
|
|
86
|
-
},
|
|
87
|
-
]} iconTags={[
|
|
88
|
-
{
|
|
89
|
-
icon: <ChairIcon />,
|
|
90
|
-
key: "chair",
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
icon: <UserIcon />,
|
|
94
|
-
key: "user",
|
|
95
|
-
},
|
|
96
|
-
]}/>
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
</div>);
|
|
100
|
-
};
|
|
101
|
-
export default TouchScrollDetect;
|
package/dist/app/page.jsx
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Board from "../features/board-v3";
|
|
2
|
-
import SideTool from "../features/side-tool";
|
|
3
|
-
import ControlPanels from "../features/panel";
|
|
4
|
-
const TableEditor = () => {
|
|
5
|
-
return (<>
|
|
6
|
-
<div className="w-full h-screen flex relative">
|
|
7
|
-
<SideTool />
|
|
8
|
-
<Board />
|
|
9
|
-
<ControlPanels />
|
|
10
|
-
</div>
|
|
11
|
-
</>);
|
|
12
|
-
};
|
|
13
|
-
export default TableEditor;
|
package/dist/app/v2/page.jsx
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Board from "../../features/board-v2";
|
|
2
|
-
import SideTool from "../../features/side-tool";
|
|
3
|
-
import ControlPanels from "../../features/panel";
|
|
4
|
-
const TableEditor = () => {
|
|
5
|
-
return (<>
|
|
6
|
-
<div className="w-full h-screen flex relative">
|
|
7
|
-
<SideTool />
|
|
8
|
-
<Board />
|
|
9
|
-
<ControlPanels />
|
|
10
|
-
</div>
|
|
11
|
-
</>);
|
|
12
|
-
};
|
|
13
|
-
export default TableEditor;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { Button, Popover } from "antd";
|
|
3
|
-
const ButtonTools = (props) => {
|
|
4
|
-
const { buttonProps, items, popoverProps } = props;
|
|
5
|
-
if (items.length === 0) {
|
|
6
|
-
return (<Popover trigger="hover" {...popoverProps}>
|
|
7
|
-
<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}/>
|
|
15
|
-
</Popover>);
|
|
16
|
-
};
|
|
17
|
-
export default ButtonTools;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { Button, ColorPicker, Flex, Form, Input, InputNumber } from "antd";
|
|
3
|
-
const SectionLabel = () => {
|
|
4
|
-
return (<div className="py-2">
|
|
5
|
-
<h1 className="heading-s">Section Labeling</h1>
|
|
6
|
-
<Form.Item label="Labels in square" name={"labels"}>
|
|
7
|
-
<Form.List name="labels">
|
|
8
|
-
{(fields, { add, remove }) => (<>
|
|
9
|
-
{fields.map((field) => (<div key={field.key}>
|
|
10
|
-
<Flex gap={2}>
|
|
11
|
-
<Form.Item name={[field.name, "label"]} label="Text">
|
|
12
|
-
<Input />
|
|
13
|
-
</Form.Item>
|
|
14
|
-
<Form.Item name={[field.name, "fontColor"]} label="Color" getValueFromEvent={(color) => color.toHexString()}>
|
|
15
|
-
<ColorPicker allowClear format="hex" defaultFormat="hex"/>
|
|
16
|
-
</Form.Item>
|
|
17
|
-
</Flex>
|
|
18
|
-
<Flex gap={2}>
|
|
19
|
-
<Form.Item name={[field.name, "x"]} label="X">
|
|
20
|
-
<InputNumber />
|
|
21
|
-
</Form.Item>
|
|
22
|
-
<Form.Item name={[field.name, "y"]} label="Y">
|
|
23
|
-
<InputNumber />
|
|
24
|
-
</Form.Item>
|
|
25
|
-
<Form.Item name={[field.name, "fontSize"]} label="Size">
|
|
26
|
-
<InputNumber suffix="px"/>
|
|
27
|
-
</Form.Item>
|
|
28
|
-
</Flex>
|
|
29
|
-
</div>))}
|
|
30
|
-
<Flex gap={2}>
|
|
31
|
-
<Button type="primary" onClick={() => add()} className="btn btn-primary">
|
|
32
|
-
Add
|
|
33
|
-
</Button>
|
|
34
|
-
<Button type="primary" onClick={() => remove(fields.length - 1)} className="btn btn-primary">
|
|
35
|
-
Remove
|
|
36
|
-
</Button>
|
|
37
|
-
</Flex>
|
|
38
|
-
</>)}
|
|
39
|
-
</Form.List>
|
|
40
|
-
</Form.Item>
|
|
41
|
-
<div className="divider-dashed"/>
|
|
42
|
-
</div>);
|
|
43
|
-
};
|
|
44
|
-
export default SectionLabel;
|