seat-editor 1.1.7 → 1.1.8
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.
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
export declare const dummyImage: {
|
|
2
|
+
id: number;
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
rotation: number;
|
|
8
|
+
shape: string;
|
|
9
|
+
src: string;
|
|
10
|
+
fill: string;
|
|
11
|
+
opacity: number;
|
|
12
|
+
labels: {
|
|
13
|
+
label: string;
|
|
14
|
+
fontColor: string;
|
|
15
|
+
x: number;
|
|
16
|
+
fontSize: number;
|
|
17
|
+
y: number;
|
|
18
|
+
}[];
|
|
19
|
+
}[];
|
|
1
20
|
export declare const dataDummy: {
|
|
2
21
|
status: number;
|
|
3
22
|
properties: {
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
export const dummyImage = [
|
|
2
|
+
{
|
|
3
|
+
"id": 1747388267450,
|
|
4
|
+
"x": 0,
|
|
5
|
+
"y": 0,
|
|
6
|
+
"width": 973.391304347826,
|
|
7
|
+
"height": 812,
|
|
8
|
+
"rotation": 0,
|
|
9
|
+
"shape": "background",
|
|
10
|
+
"src": "http://192.168.88.99:9106/v1/public/5bf923de-2366-4a11-9b8b-e92de0afbf05/3a65cb36-7d85-4c38-9403-a15f94641920/1745396181_floor_boi.jpeg",
|
|
11
|
+
"fill": "#bca16a",
|
|
12
|
+
"opacity": 1,
|
|
13
|
+
"labels": [
|
|
14
|
+
{
|
|
15
|
+
"label": "T22",
|
|
16
|
+
"fontColor": "#0d0c0c",
|
|
17
|
+
"x": 0,
|
|
18
|
+
"fontSize": 16,
|
|
19
|
+
"y": 8
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
];
|
|
1
24
|
export const dataDummy = [
|
|
2
25
|
{
|
|
3
26
|
status: 1,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import LayerView from "@/features/view/index";
|
|
2
|
-
import { dataDummy } from "./constant";
|
|
2
|
+
import { dataDummy, dummyImage } from "./constant";
|
|
3
3
|
const OnlyView = () => {
|
|
4
4
|
return (<>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
<div className="w-full h-screen flex relative justify-center items-center">
|
|
6
|
+
<LayerView componentProps={dataDummy} mappingKey="properties" extraComponentProps={dummyImage}/>
|
|
7
|
+
</div>
|
|
8
|
+
</>);
|
|
9
9
|
};
|
|
10
10
|
export default OnlyView;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { omit } from "lodash";
|
|
3
3
|
const Layers = ({ shadowShape, components, onClick, selectedComponent, activeTool, onMouseDown, onMouseUp, onBlur, }) => {
|
|
4
|
+
console.log({ components });
|
|
4
5
|
const renderShadowShape = (item) => {
|
|
5
6
|
const { id, x, y, width, height, fill, opacity, rotation, shape, fontColor, text, seatFill, labels, } = item;
|
|
6
7
|
const commonProps = { fill, opacity };
|
|
@@ -6,6 +6,7 @@ import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
|
6
6
|
import Layers from "../../components/layer";
|
|
7
7
|
const LayerView = (props) => {
|
|
8
8
|
const { componentProps = [], extraComponentProps = [], onSelectComponent, onCurrentStateChange, mappingKey, } = props;
|
|
9
|
+
console.log({ extraComponentProps });
|
|
9
10
|
const transformRef = useRef(null);
|
|
10
11
|
const containerRef = useRef(null);
|
|
11
12
|
console.log({ mappingKey });
|
|
@@ -23,7 +24,7 @@ const LayerView = (props) => {
|
|
|
23
24
|
}
|
|
24
25
|
if (extraComponentProps.length > 0) {
|
|
25
26
|
dispatch({
|
|
26
|
-
type: "board/
|
|
27
|
+
type: "board/setNewExtraComponents",
|
|
27
28
|
payload: extraComponentProps,
|
|
28
29
|
});
|
|
29
30
|
}
|
|
@@ -92,7 +93,8 @@ const LayerView = (props) => {
|
|
|
92
93
|
height: maxY,
|
|
93
94
|
};
|
|
94
95
|
}, [componentsEditor, extraComponentsEditor]);
|
|
95
|
-
let elementEditor = [...
|
|
96
|
+
let elementEditor = [...extraComponentsEditor, ...componentsEditor];
|
|
97
|
+
console.log({ elementEditor });
|
|
96
98
|
function renderElements(elementEditor, mappingKey) {
|
|
97
99
|
return elementEditor.map((editorItem, i) => {
|
|
98
100
|
const isUsingMapping = mappingKey &&
|