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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
4
|
import { TransformWrapper, TransformComponent, MiniMap, } from "react-zoom-pan-pinch";
|
|
4
5
|
import { useAppSelector, useAppDispatch } from "../../hooks/use-redux";
|
|
5
6
|
import Layers from "../../components/layer-v2";
|
|
@@ -695,21 +696,15 @@ const BoardTemplate = ({ onSelectComponent, viewOnly }) => {
|
|
|
695
696
|
}
|
|
696
697
|
};
|
|
697
698
|
const renderMiniMap = () => {
|
|
698
|
-
return (
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
// onMouseUp={handleMouseUp}
|
|
708
|
-
// onBlur={handleUnSelectComponent}
|
|
709
|
-
selectedComponent={selectedComponent}/>
|
|
710
|
-
</svg>
|
|
711
|
-
</div>
|
|
712
|
-
</MiniMap>);
|
|
699
|
+
return (_jsx(MiniMap, { width: 250, height: 250, children: _jsx("div", { className: "w-full h-full", children: _jsx("svg", { id: "workspace", width: "100%", height: "100%", viewBox: `0 0 ${widthBoard} ${heightBoard}`, className: "h-screen w-full", xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid meet", style: {
|
|
700
|
+
background: "#f5f5f5",
|
|
701
|
+
display: "block",
|
|
702
|
+
}, children: _jsx(Layers, { shadowShape: shadowShape, components: [...extraComponentsState, ...componentsState], activeTool: activeTool,
|
|
703
|
+
// onClick={handleSelectComponent}
|
|
704
|
+
// onMouseDown={handleMouseDown}
|
|
705
|
+
// onMouseUp={handleMouseUp}
|
|
706
|
+
// onBlur={handleUnSelectComponent}
|
|
707
|
+
selectedComponent: selectedComponent }) }) }) }));
|
|
713
708
|
};
|
|
714
709
|
const handelZoomIn = () => {
|
|
715
710
|
var _a;
|
|
@@ -780,90 +775,33 @@ const BoardTemplate = ({ onSelectComponent, viewOnly }) => {
|
|
|
780
775
|
setNodes(newNodes);
|
|
781
776
|
}
|
|
782
777
|
};
|
|
783
|
-
return (
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
// onMouseUp={handleEnd}
|
|
812
|
-
onTouchMove={handleMouseMove} onTouchEnd={handleMouseUp} onClick={(e) => {
|
|
813
|
-
e.stopPropagation();
|
|
814
|
-
handleMouseClick(e);
|
|
815
|
-
}}
|
|
816
|
-
// onMouseLeave={handleMouseLeave}
|
|
817
|
-
xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet" style={{
|
|
818
|
-
background: backgroundColor,
|
|
819
|
-
display: "block",
|
|
820
|
-
cursor: activeTool === "ruler" ? "crosshair" : "auto",
|
|
821
|
-
touchAction: "none",
|
|
822
|
-
}}>
|
|
823
|
-
<Layers shadowShape={shadowShape} components={[...extraComponentsState, ...componentsState]} style={{
|
|
824
|
-
cursor: getCursorStyle(),
|
|
825
|
-
}}
|
|
826
|
-
// onClick={handleSelectComponent}
|
|
827
|
-
onMouseDown={handleMouseDown}
|
|
828
|
-
// onMouseUp={handleMouseUp}
|
|
829
|
-
// onBlur={handleUnSelectComponent}
|
|
830
|
-
selectedComponent={selectedComponent} activeTool={activeTool} onTouchStart={handleMouseDown}/>
|
|
831
|
-
|
|
832
|
-
{activeTool === "ruler" && (<>
|
|
833
|
-
<g id="horizontal-ruler">
|
|
834
|
-
<rect x="0" y="0" width={window.innerWidth} height="30" fill="#e0e0e0"/>
|
|
835
|
-
<g stroke="#888" font-size="10" text-anchor="middle">
|
|
836
|
-
{Array.from({ length: window.innerWidth / 50 }, (_, i) => (<g key={i}>
|
|
837
|
-
<line x1={i * 50} y1="0" x2={i * 50} y2="10"/>
|
|
838
|
-
<text x={i * 50} y="15">
|
|
839
|
-
{i * 50}
|
|
840
|
-
</text>
|
|
841
|
-
</g>))}
|
|
842
|
-
</g>
|
|
843
|
-
</g>
|
|
844
|
-
<g id="vertical-ruler">
|
|
845
|
-
<rect x="0" y="0" width="30" height={window.innerHeight} fill="#e0e0e0"/>
|
|
846
|
-
<g stroke="#888" font-size="10" text-anchor="middle">
|
|
847
|
-
{Array.from({ length: window.innerHeight / 10 }, (_, i) => (<g key={i}>
|
|
848
|
-
<line x1="0" y1={i * 50} x2="10" y2={i * 50}/>
|
|
849
|
-
<text x="15" y={i * 50}>
|
|
850
|
-
{i * 50}
|
|
851
|
-
</text>
|
|
852
|
-
</g>))}
|
|
853
|
-
</g>
|
|
854
|
-
</g>
|
|
855
|
-
</>)}
|
|
856
|
-
{grid && (<g stroke="#ddd" strokeWidth={0.5}>
|
|
857
|
-
{/* Vertical lines */}
|
|
858
|
-
{Array.from({ length: widthBoard / 10 }, (_, i) => (<line key={`v-${i}`} x1={i * 10} y1={0} x2={i * 10} y2={heightBoard}/>))}
|
|
859
|
-
|
|
860
|
-
{/* Horizontal lines */}
|
|
861
|
-
{Array.from({ length: heightBoard / 10 }, (_, i) => (<line key={`h-${i}`} x1={0} y1={i * 10} x2={widthBoard} y2={i * 10}/>))}
|
|
862
|
-
</g>)}
|
|
863
|
-
</svg>
|
|
864
|
-
</TransformComponent>
|
|
865
|
-
</TransformWrapper>
|
|
866
|
-
</div>
|
|
867
|
-
</>);
|
|
778
|
+
return (_jsxs(_Fragment, { children: [_jsx(ModalPreview, { children: _jsx(LayerView, { statusKey: "status" }) }), _jsxs("div", { className: "relative w-full h-screen flex-1 overflow-hidden", ref: containerRef, children: [_jsx("div", { className: "absolute bottom-5 left-1/2 transform -translate-x-1/2 z-10", children: _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { icon: _jsx(ZoomIn, {}), onClick: handelZoomIn }), _jsx(Button, { icon: _jsx(ZoomOut, {}), onClick: handleZoomOut }), _jsx(Button, { onClick: addNode, children: "Add Node" }), _jsx(Button, { onClick: removeNode, children: "Remove Node" })] }) }), _jsxs(TransformWrapper, { ref: transformRef, panning: { disabled: ["node", "select"].includes(activeTool) }, centerZoomedOut: true, onTransformed: ({ state: { scale } }) => setScale(scale), minScale: 1, maxScale: 1000, initialScale: 1, pinch: { step: 1 }, smooth: true, doubleClick: { step: 1, disabled: activeTool === "select" }, disablePadding: true, children: [scale > 1 && (_jsx("div", { className: "absolute bottom-[60px] left-1/2 transform -translate-x-1/2 z-10", children: renderMiniMap() })), _jsx(TransformComponent, { wrapperStyle: {
|
|
779
|
+
width: "100%",
|
|
780
|
+
height: "100%",
|
|
781
|
+
overflow: "hidden",
|
|
782
|
+
}, contentStyle: {
|
|
783
|
+
width: "100%",
|
|
784
|
+
height: "100%",
|
|
785
|
+
}, children: _jsxs("svg", { id: "workspace", ref: svgRef, width: "100%", height: "100%", viewBox: `0 0 ${widthBoard} ${heightBoard}`, className: "h-screen", onMouseUp: handleMouseUp, onMouseMove: handleMouseMove,
|
|
786
|
+
// onMouseEnter={handleMouseEnter}
|
|
787
|
+
// onMouseUp={handleEnd}
|
|
788
|
+
onTouchMove: handleMouseMove, onTouchEnd: handleMouseUp, onClick: (e) => {
|
|
789
|
+
e.stopPropagation();
|
|
790
|
+
handleMouseClick(e);
|
|
791
|
+
},
|
|
792
|
+
// onMouseLeave={handleMouseLeave}
|
|
793
|
+
xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid meet", style: {
|
|
794
|
+
background: backgroundColor,
|
|
795
|
+
display: "block",
|
|
796
|
+
cursor: activeTool === "ruler" ? "crosshair" : "auto",
|
|
797
|
+
touchAction: "none",
|
|
798
|
+
}, children: [_jsx(Layers, { shadowShape: shadowShape, components: [...extraComponentsState, ...componentsState], style: {
|
|
799
|
+
cursor: getCursorStyle(),
|
|
800
|
+
},
|
|
801
|
+
// onClick={handleSelectComponent}
|
|
802
|
+
onMouseDown: handleMouseDown,
|
|
803
|
+
// onMouseUp={handleMouseUp}
|
|
804
|
+
// onBlur={handleUnSelectComponent}
|
|
805
|
+
selectedComponent: selectedComponent, activeTool: activeTool, onTouchStart: handleMouseDown }), activeTool === "ruler" && (_jsxs(_Fragment, { children: [_jsxs("g", { id: "horizontal-ruler", children: [_jsx("rect", { x: "0", y: "0", width: window.innerWidth, height: "30", fill: "#e0e0e0" }), _jsx("g", { stroke: "#888", "font-size": "10", "text-anchor": "middle", children: Array.from({ length: window.innerWidth / 50 }, (_, i) => (_jsxs("g", { children: [_jsx("line", { x1: i * 50, y1: "0", x2: i * 50, y2: "10" }), _jsx("text", { x: i * 50, y: "15", children: i * 50 })] }, i))) })] }), _jsxs("g", { id: "vertical-ruler", children: [_jsx("rect", { x: "0", y: "0", width: "30", height: window.innerHeight, fill: "#e0e0e0" }), _jsx("g", { stroke: "#888", "font-size": "10", "text-anchor": "middle", children: Array.from({ length: window.innerHeight / 10 }, (_, i) => (_jsxs("g", { children: [_jsx("line", { x1: "0", y1: i * 50, x2: "10", y2: i * 50 }), _jsx("text", { x: "15", y: i * 50, children: i * 50 })] }, i))) })] })] })), grid && (_jsxs("g", { stroke: "#ddd", strokeWidth: 0.5, children: [Array.from({ length: widthBoard / 10 }, (_, i) => (_jsx("line", { x1: i * 10, y1: 0, x2: i * 10, y2: heightBoard }, `v-${i}`))), Array.from({ length: heightBoard / 10 }, (_, i) => (_jsx("line", { x1: 0, y1: i * 10, x2: widthBoard, y2: i * 10 }, `h-${i}`)))] }))] }) })] })] })] }));
|
|
868
806
|
};
|
|
869
807
|
export default BoardTemplate;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
interface BoardTemplateProps {
|
|
3
2
|
onSelectComponent?: (items: any) => void;
|
|
4
3
|
mappingKey?: string;
|
|
5
4
|
viewOnly?: boolean;
|
|
6
5
|
}
|
|
7
|
-
declare const BoardTemplate: ({ onSelectComponent, viewOnly }: BoardTemplateProps) =>
|
|
6
|
+
declare const BoardTemplate: ({ onSelectComponent, viewOnly }: BoardTemplateProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export default BoardTemplate;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useEffect, useRef, useState, } from "react";
|
|
3
4
|
import { TransformWrapper, TransformComponent, MiniMap, } from "react-zoom-pan-pinch";
|
|
4
5
|
import { useAppSelector, useAppDispatch } from "../../hooks/use-redux";
|
|
5
6
|
import Layers from "../../components/layer-v3";
|
|
@@ -663,23 +664,17 @@ const BoardTemplate = ({ onSelectComponent, viewOnly }) => {
|
|
|
663
664
|
}
|
|
664
665
|
};
|
|
665
666
|
const renderMiniMap = () => {
|
|
666
|
-
return (
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
// onMouseUp={handleMouseUp}
|
|
678
|
-
// onBlur={handleUnSelectComponent}
|
|
679
|
-
selectedComponent={selectedComponent}/>
|
|
680
|
-
</svg>
|
|
681
|
-
</div>
|
|
682
|
-
</MiniMap>);
|
|
667
|
+
return (_jsx(MiniMap, { width: 250, height: 250, children: _jsx("div", { className: "w-full h-full", children: _jsx("svg", { id: "workspace", width: "100%", height: "100%",
|
|
668
|
+
// viewBox={`0 0 ${widthBoard} ${heightBoard}`}
|
|
669
|
+
className: "h-screen w-full", xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid meet", style: {
|
|
670
|
+
background: "#f5f5f5",
|
|
671
|
+
display: "block",
|
|
672
|
+
}, children: _jsx(Layers, { shadowShape: shadowShape, components: [...extraComponentsState, ...componentsState], activeTool: activeTool,
|
|
673
|
+
// onClick={handleSelectComponent}
|
|
674
|
+
onMouseDown: handleMouseDown,
|
|
675
|
+
// onMouseUp={handleMouseUp}
|
|
676
|
+
// onBlur={handleUnSelectComponent}
|
|
677
|
+
selectedComponent: selectedComponent }) }) }) }));
|
|
683
678
|
};
|
|
684
679
|
const handelZoomIn = () => {
|
|
685
680
|
var _a;
|
|
@@ -757,107 +752,34 @@ const BoardTemplate = ({ onSelectComponent, viewOnly }) => {
|
|
|
757
752
|
const onTouchEndLine = () => {
|
|
758
753
|
setTouch(false);
|
|
759
754
|
};
|
|
760
|
-
return (
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
onTouchMove={handleMouseMove} onTouchEnd={handleMouseUp} onClick={(e) => {
|
|
790
|
-
e.stopPropagation();
|
|
791
|
-
handleMouseClick(e);
|
|
792
|
-
}}
|
|
793
|
-
// onMouseLeave={handleMouseLeave}
|
|
794
|
-
xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet" style={{
|
|
795
|
-
background: backgroundColor,
|
|
796
|
-
display: "block",
|
|
797
|
-
cursor: activeTool === "ruler" ? "crosshair" : "auto",
|
|
798
|
-
touchAction: "none",
|
|
799
|
-
}}>
|
|
800
|
-
<Layers shadowShape={shadowShape} components={[...extraComponentsState, ...componentsState]} style={{
|
|
801
|
-
cursor: getCursorStyle(),
|
|
802
|
-
}}
|
|
803
|
-
// onClick={handleSelectComponent}
|
|
804
|
-
onMouseDown={handleMouseDown}
|
|
805
|
-
// onMouseUp={handleMouseUp}
|
|
806
|
-
// onBlur={handleUnSelectComponent}
|
|
807
|
-
selectedComponent={selectedComponent} activeTool={activeTool} onTouchStart={handleMouseDown}/>
|
|
808
|
-
{/* <polygon
|
|
809
|
-
points={nodes.map((n) => `${n.x},${n.y}`).join(" ")}
|
|
810
|
-
fill="transparent"
|
|
811
|
-
stroke="blue"
|
|
812
|
-
/> */}
|
|
813
|
-
{/* Nodes */}
|
|
814
|
-
{/* {nodes.map((node, index) => (
|
|
815
|
-
<circle
|
|
816
|
-
key={index}
|
|
817
|
-
cx={node.x}
|
|
818
|
-
cy={node.y}
|
|
819
|
-
r={10}
|
|
820
|
-
fill="red"
|
|
821
|
-
onMouseDown={onTouchStartLine}
|
|
822
|
-
onTouchStart={onTouchStartLine}
|
|
823
|
-
onTouchEnd={onTouchEndLine}
|
|
824
|
-
/>
|
|
825
|
-
))} */}
|
|
826
|
-
{activeTool === "ruler" && (<>
|
|
827
|
-
<g id="horizontal-ruler">
|
|
828
|
-
<rect x="0" y="0" width={window.innerWidth} height="30" fill="#e0e0e0"/>
|
|
829
|
-
<g stroke="#888" font-size="10" text-anchor="middle">
|
|
830
|
-
{Array.from({ length: window.innerWidth / 50 }, (_, i) => (<g key={i}>
|
|
831
|
-
<line x1={i * 50} y1="0" x2={i * 50} y2="10"/>
|
|
832
|
-
<text x={i * 50} y="15">
|
|
833
|
-
{i * 50}
|
|
834
|
-
</text>
|
|
835
|
-
</g>))}
|
|
836
|
-
</g>
|
|
837
|
-
</g>
|
|
838
|
-
<g id="vertical-ruler">
|
|
839
|
-
<rect x="0" y="0" width="30" height={window.innerHeight} fill="#e0e0e0"/>
|
|
840
|
-
<g stroke="#888" font-size="10" text-anchor="middle">
|
|
841
|
-
{Array.from({ length: window.innerHeight / 10 }, (_, i) => (<g key={i}>
|
|
842
|
-
<line x1="0" y1={i * 50} x2="10" y2={i * 50}/>
|
|
843
|
-
<text x="15" y={i * 50}>
|
|
844
|
-
{i * 50}
|
|
845
|
-
</text>
|
|
846
|
-
</g>))}
|
|
847
|
-
</g>
|
|
848
|
-
</g>
|
|
849
|
-
</>)}
|
|
850
|
-
{grid && (<g stroke="#ddd" strokeWidth={0.5}>
|
|
851
|
-
{/* Vertical lines */}
|
|
852
|
-
{Array.from({ length: widthBoard / (10 * scale) }, (_, i) => (<line key={`v-${i}`} x1={i * 10 * scale} y1={0} x2={i * 10 * scale} y2={heightBoard}/>))}
|
|
853
|
-
|
|
854
|
-
{/* Horizontal lines */}
|
|
855
|
-
{Array.from({ length: heightBoard / (10 * scale) }, (_, i) => (<line key={`h-${i}`} x1={0} y1={i * 10 * scale} x2={widthBoard} y2={i * 10 * scale}/>))}
|
|
856
|
-
</g>)}
|
|
857
|
-
</svg>
|
|
858
|
-
</TransformComponent>
|
|
859
|
-
</TransformWrapper>
|
|
860
|
-
</div>
|
|
861
|
-
</>);
|
|
755
|
+
return (_jsxs(_Fragment, { children: [_jsx(ModalPreview, { children: _jsx(LayerView, { statusKey: "status" }) }), touch && _jsx(Button, { onClick: () => setTouch(false), children: "Stop Touch" }), _jsxs("div", { className: "relative w-full h-screen flex-1 overflow-hidden", ref: containerRef, children: [_jsx("div", { className: "absolute bottom-5 left-1/2 transform -translate-x-1/2 z-10", children: _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { icon: _jsx(ZoomIn, {}), onClick: handelZoomIn }), _jsx(Button, { icon: _jsx(ZoomOut, {}), onClick: handleZoomOut })] }) }), _jsxs(TransformWrapper, { ref: transformRef, panning: { disabled: ["node", "select"].includes(activeTool) }, centerZoomedOut: true, onTransformed: ({ state: { scale } }) => setScale(scale), minScale: 0.1, maxScale: 1000, initialScale: 1, pinch: { step: 1 }, wheel: { disabled: true }, smooth: true, doubleClick: { step: 1, disabled: activeTool === "select" }, disablePadding: true, centerOnInit: true, children: [scale !== 1 && (_jsx("div", { className: "absolute bottom-[60px] left-1/2 transform -translate-x-1/2 z-10", children: renderMiniMap() })), _jsx(TransformComponent, { wrapperStyle: {
|
|
756
|
+
width: "100%",
|
|
757
|
+
height: "100%",
|
|
758
|
+
}, contentStyle: {
|
|
759
|
+
width: "20000px", height: "20000px"
|
|
760
|
+
}, children: _jsxs("svg", { id: "workspace", ref: svgRef, width: "100%", height: "100%",
|
|
761
|
+
// viewBox={`0 0 ${widthBoard} ${heightBoard}`}
|
|
762
|
+
// className="h-screen"
|
|
763
|
+
onMouseUp: handleMouseUp, onMouseMove: handleMouseMove,
|
|
764
|
+
// onMouseEnter={handleMouseEnter}
|
|
765
|
+
// onMouseUp={handleEnd}
|
|
766
|
+
onTouchMove: handleMouseMove, onTouchEnd: handleMouseUp, onClick: (e) => {
|
|
767
|
+
e.stopPropagation();
|
|
768
|
+
handleMouseClick(e);
|
|
769
|
+
},
|
|
770
|
+
// onMouseLeave={handleMouseLeave}
|
|
771
|
+
xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid meet", style: {
|
|
772
|
+
background: backgroundColor,
|
|
773
|
+
display: "block",
|
|
774
|
+
cursor: activeTool === "ruler" ? "crosshair" : "auto",
|
|
775
|
+
touchAction: "none",
|
|
776
|
+
}, children: [_jsx(Layers, { shadowShape: shadowShape, components: [...extraComponentsState, ...componentsState], style: {
|
|
777
|
+
cursor: getCursorStyle(),
|
|
778
|
+
},
|
|
779
|
+
// onClick={handleSelectComponent}
|
|
780
|
+
onMouseDown: handleMouseDown,
|
|
781
|
+
// onMouseUp={handleMouseUp}
|
|
782
|
+
// onBlur={handleUnSelectComponent}
|
|
783
|
+
selectedComponent: selectedComponent, activeTool: activeTool, onTouchStart: handleMouseDown }), activeTool === "ruler" && (_jsxs(_Fragment, { children: [_jsxs("g", { id: "horizontal-ruler", children: [_jsx("rect", { x: "0", y: "0", width: window.innerWidth, height: "30", fill: "#e0e0e0" }), _jsx("g", { stroke: "#888", "font-size": "10", "text-anchor": "middle", children: Array.from({ length: window.innerWidth / 50 }, (_, i) => (_jsxs("g", { children: [_jsx("line", { x1: i * 50, y1: "0", x2: i * 50, y2: "10" }), _jsx("text", { x: i * 50, y: "15", children: i * 50 })] }, i))) })] }), _jsxs("g", { id: "vertical-ruler", children: [_jsx("rect", { x: "0", y: "0", width: "30", height: window.innerHeight, fill: "#e0e0e0" }), _jsx("g", { stroke: "#888", "font-size": "10", "text-anchor": "middle", children: Array.from({ length: window.innerHeight / 10 }, (_, i) => (_jsxs("g", { children: [_jsx("line", { x1: "0", y1: i * 50, x2: "10", y2: i * 50 }), _jsx("text", { x: "15", y: i * 50, children: i * 50 })] }, i))) })] })] })), grid && (_jsxs("g", { stroke: "#ddd", strokeWidth: 0.5, children: [Array.from({ length: widthBoard / (10 * scale) }, (_, i) => (_jsx("line", { x1: i * 10 * scale, y1: 0, x2: i * 10 * scale, y2: heightBoard }, `v-${i}`))), Array.from({ length: heightBoard / (10 * scale) }, (_, i) => (_jsx("line", { x1: 0, y1: i * 10 * scale, x2: widthBoard, y2: i * 10 * scale }, `h-${i}`)))] }))] }) })] })] })] }));
|
|
862
784
|
};
|
|
863
785
|
export default BoardTemplate;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const Navbar: () => import("react").JSX.Element;
|
|
1
|
+
declare const Navbar: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default Navbar;
|
|
@@ -27,5 +27,5 @@ export interface TableEditorProps {
|
|
|
27
27
|
extraComponent: boolean;
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
declare const TableEditor: (props: TableEditorProps) => import("react").JSX.Element;
|
|
30
|
+
declare const TableEditor: (props: TableEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
31
|
export default TableEditor;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
3
|
import { useEffect, useState } from "react";
|
|
3
4
|
import Board from "../board-v3";
|
|
4
5
|
import SideTool from "../side-tool";
|
|
@@ -94,21 +95,10 @@ const TableEditor = (props) => {
|
|
|
94
95
|
dispatch({ type: "board/setFlagChange", payload: true });
|
|
95
96
|
}
|
|
96
97
|
}, [componentProps, extraComponentProps, props === null || props === void 0 ? void 0 : props.defaultBackground]);
|
|
97
|
-
return (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
<LayerView statusKey="status"/>
|
|
103
|
-
</div>
|
|
104
|
-
<div className="w-full h-full flex relative" style={{
|
|
105
|
-
display: viewOnly ? "none" : "flex",
|
|
106
|
-
}}>
|
|
107
|
-
<SideTool dragOnly={dragOnly} deleteAutorized={deleteAutorized}/>
|
|
108
|
-
<Board onSelectComponent={props.onSelectComponent} viewOnly={viewOnly}/>
|
|
109
|
-
<ControlPanels action={props.action} responseMapping={props.responseMapping}/>
|
|
110
|
-
</div>
|
|
111
|
-
</div>
|
|
112
|
-
</>);
|
|
98
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: "w-full h-screen flex relative", children: [_jsx("div", { className: "w-full h-full flex relative", style: {
|
|
99
|
+
display: !viewOnly ? "none" : "flex",
|
|
100
|
+
}, children: _jsx(LayerView, { statusKey: "status" }) }), _jsxs("div", { className: "w-full h-full flex relative", style: {
|
|
101
|
+
display: viewOnly ? "none" : "flex",
|
|
102
|
+
}, children: [_jsx(SideTool, { dragOnly: dragOnly, deleteAutorized: deleteAutorized }), _jsx(Board, { onSelectComponent: props.onSelectComponent, viewOnly: viewOnly }), _jsx(ControlPanels, { action: props.action, responseMapping: props.responseMapping })] })] }) }));
|
|
113
103
|
};
|
|
114
104
|
export default TableEditor;
|
|
@@ -7,5 +7,5 @@ interface ControlPanelsProps {
|
|
|
7
7
|
src: string;
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
-
declare const ControlPanels: (props: ControlPanelsProps) => import("react").JSX.Element;
|
|
10
|
+
declare const ControlPanels: (props: ControlPanelsProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export default ControlPanels;
|
|
@@ -10,6 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
14
|
import { useEffect, useRef, useState } from "react";
|
|
14
15
|
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
15
16
|
import { Form, Drawer, Input } from "antd";
|
|
@@ -98,16 +99,16 @@ const ControlPanels = (props) => {
|
|
|
98
99
|
const renderFormPanel = () => {
|
|
99
100
|
switch (tool.active) {
|
|
100
101
|
case "select":
|
|
101
|
-
return (
|
|
102
|
+
return (_jsx(SelectToolForm, { action: action, responseMapping: responseMapping }));
|
|
102
103
|
case "square":
|
|
103
104
|
case "circle":
|
|
104
|
-
return
|
|
105
|
+
return _jsx(SquareToolForm, {});
|
|
105
106
|
case "table-seat-circle":
|
|
106
|
-
return
|
|
107
|
+
return _jsx(SeatCircle, {});
|
|
107
108
|
case "image-table":
|
|
108
|
-
return (
|
|
109
|
+
return (_jsx(UploadTool, { name: tool.active, type: "component", action: action, responseMapping: responseMapping }));
|
|
109
110
|
case "background":
|
|
110
|
-
return (
|
|
111
|
+
return (_jsx(UploadTool, { name: tool.active, type: "background", action: action, responseMapping: responseMapping }));
|
|
111
112
|
default:
|
|
112
113
|
return null;
|
|
113
114
|
}
|
|
@@ -120,19 +121,10 @@ const ControlPanels = (props) => {
|
|
|
120
121
|
});
|
|
121
122
|
};
|
|
122
123
|
// if(!show) return null
|
|
123
|
-
return (
|
|
124
|
+
return (_jsx(Drawer, { open: show, onClose: handleClose, title: "Panel", styles: {
|
|
124
125
|
body: {
|
|
125
126
|
paddingBottom: 0,
|
|
126
127
|
},
|
|
127
|
-
}}
|
|
128
|
-
<div className="bg-white h-full max-h-screen w-full p-2">
|
|
129
|
-
<Form layout="vertical" form={form} name="table" onValuesChange={handleChangeComponent} initialValues={{ labels: [{}] }}>
|
|
130
|
-
<Form.Item name="id" hidden>
|
|
131
|
-
<Input />
|
|
132
|
-
</Form.Item>
|
|
133
|
-
{renderFormPanel()}
|
|
134
|
-
</Form>
|
|
135
|
-
</div>
|
|
136
|
-
</Drawer>);
|
|
128
|
+
}, children: _jsx("div", { className: "bg-white h-full max-h-screen w-full p-2", children: _jsxs(Form, { layout: "vertical", form: form, name: "table", onValuesChange: handleChangeComponent, initialValues: { labels: [{}] }, children: [_jsx(Form.Item, { name: "id", hidden: true, children: _jsx(Input, {}) }), renderFormPanel()] }) }) }));
|
|
137
129
|
};
|
|
138
130
|
export default ControlPanels;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { useAppSelector } from "../../hooks/use-redux";
|
|
3
4
|
import SquareToolForm from "./square-circle-tool";
|
|
4
5
|
import SeatCircle from "./table-seat-circle";
|
|
@@ -22,39 +23,26 @@ const SelectToolForm = ({ title = "Title", action, responseMapping }) => {
|
|
|
22
23
|
.replace(/-/g, " ")
|
|
23
24
|
.replace(/\b\w/g, (char) => char.toUpperCase());
|
|
24
25
|
};
|
|
25
|
-
return (
|
|
26
|
-
<h1 className="heading-s">{title}</h1>
|
|
27
|
-
<div className="flex flex-col gap-2 mt-5">
|
|
28
|
-
{Object.entries(countByShape).map(([shape, count]) => (<div key={shape}>
|
|
29
|
-
<span className="font-bold">
|
|
30
|
-
{variableFormatToString(shape)}:
|
|
31
|
-
</span>{" "}
|
|
32
|
-
{count}
|
|
33
|
-
</div>))}
|
|
34
|
-
</div>
|
|
35
|
-
</div>);
|
|
26
|
+
return (_jsxs("div", { className: "flex flex-col", children: [_jsx("h1", { className: "heading-s", children: title }), _jsx("div", { className: "flex flex-col gap-2 mt-5", children: Object.entries(countByShape).map(([shape, count]) => (_jsxs("div", { children: [_jsxs("span", { className: "font-bold", children: [variableFormatToString(shape), ":"] }), " ", count] }, shape))) })] }));
|
|
36
27
|
};
|
|
37
28
|
const renderComponent = () => {
|
|
38
29
|
switch (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.shape) {
|
|
39
30
|
case "square":
|
|
40
31
|
case "circle":
|
|
41
|
-
return
|
|
32
|
+
return _jsx(SquareToolForm, {});
|
|
42
33
|
case "table-seat-circle":
|
|
43
|
-
return
|
|
34
|
+
return _jsx(SeatCircle, {});
|
|
44
35
|
case "image-table":
|
|
45
36
|
case "background":
|
|
46
|
-
return (
|
|
37
|
+
return (_jsx(UploadTool, { action: action, responseMapping: responseMapping, name: selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.shape, defaultValue: selectedComponent, type: (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.shape) === "background"
|
|
47
38
|
? "background"
|
|
48
|
-
: "component"}
|
|
39
|
+
: "component" }));
|
|
49
40
|
case "text":
|
|
50
|
-
return
|
|
41
|
+
return _jsx(TextTool, {});
|
|
51
42
|
default:
|
|
52
43
|
return null;
|
|
53
44
|
}
|
|
54
45
|
};
|
|
55
|
-
return (
|
|
56
|
-
<SummaryComponents />
|
|
57
|
-
{renderComponent()}
|
|
58
|
-
</div>);
|
|
46
|
+
return (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(SummaryComponents, {}), renderComponent()] }));
|
|
59
47
|
};
|
|
60
48
|
export default SelectToolForm;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SquareToolForm: () => import("react").JSX.Element;
|
|
1
|
+
declare const SquareToolForm: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default SquareToolForm;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import SectionLabel from "../../components/form-tools/label";
|
|
3
4
|
import SectionShape from "../../components/form-tools/shape";
|
|
4
5
|
const SquareToolForm = () => {
|
|
5
|
-
return (
|
|
6
|
-
<SectionShape />
|
|
7
|
-
<SectionLabel />
|
|
8
|
-
</>);
|
|
6
|
+
return (_jsxs(_Fragment, { children: [_jsx(SectionShape, {}), _jsx(SectionLabel, {})] }));
|
|
9
7
|
};
|
|
10
8
|
export default SquareToolForm;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SeatCircle: () => import("react").JSX.Element;
|
|
1
|
+
declare const SeatCircle: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default SeatCircle;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { ColorPicker, Flex, Form, InputNumber } from "antd";
|
|
4
|
+
import SectionLabel from "../../components/form-tools/label";
|
|
5
|
+
import SectionShape from "../../components/form-tools/shape";
|
|
6
|
+
const SeatCircle = () => {
|
|
7
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: "py-2", children: [_jsx("h1", { className: "heading-s", children: " Round table" }), _jsxs(Flex, { children: [_jsx(Form.Item, { name: "seatCount", label: "Seat Count", className: "w-full", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { name: "openSpace", label: "Open Space", className: "w-full", children: _jsx(InputNumber, { max: 1, min: 0, step: 0.1 }) })] }), _jsxs(Flex, { gap: 2, children: [_jsx(Form.Item, { label: "Seat Fill", name: "seatFill", getValueFromEvent: (color) => color.toHexString(), className: "w-full ", children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) }), _jsx(Form.Item, { label: "Table Fill", name: "fill", getValueFromEvent: (color) => color.toHexString(), className: "w-full ", children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) })] }), _jsx(SectionShape, {}), _jsx(SectionLabel, {})] }) }));
|
|
8
|
+
};
|
|
9
|
+
export default SeatCircle;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const TextTool: () => import("react").JSX.Element;
|
|
1
|
+
declare const TextTool: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default TextTool;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ColorPicker, Form, Input, InputNumber } from "antd";
|
|
4
|
+
const TextTool = () => {
|
|
5
|
+
return (_jsxs("div", { className: "py-2", children: [_jsx(Form.Item, { label: "Name", name: "shape", className: "w-full hidden", children: _jsx(Input, { defaultValue: "text" }) }), _jsx(Form.Item, { name: "text", label: "Text", children: _jsx(Input, {}) }), _jsx(Form.Item, { name: "fontColor", label: "Color", getValueFromEvent: (color) => color.toHexString(), children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) }), _jsx(Form.Item, { name: "x", label: "X", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { name: "y", label: "Y", children: _jsx(InputNumber, {}) }), _jsx(Form.Item, { name: "fontSize", label: "Size", children: _jsx(InputNumber, { suffix: "px" }) })] }));
|
|
6
|
+
};
|
|
7
|
+
export default TextTool;
|
|
@@ -10,5 +10,5 @@ interface UploadToolProps {
|
|
|
10
10
|
};
|
|
11
11
|
defaultValue?: any;
|
|
12
12
|
}
|
|
13
|
-
declare const UploadTool: ({ name, type, action, responseMapping, defaultValue, }: UploadToolProps) => import("react").JSX.Element;
|
|
13
|
+
declare const UploadTool: ({ name, type, action, responseMapping, defaultValue, }: UploadToolProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default UploadTool;
|