seat-editor 3.3.13 → 3.3.15
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 -0
- package/dist/app/constant.js +1 -0
- package/dist/app/layout.d.ts +6 -0
- package/dist/app/layout.jsx +27 -0
- package/dist/app/new-board/page.jsx +55 -0
- package/dist/app/old-board/page.d.ts +3 -0
- package/dist/app/old-board/page.jsx +510 -0
- package/dist/app/only-view/chair.d.ts +1 -0
- package/dist/app/only-view/chair.js +12 -0
- package/dist/app/only-view/constant.d.ts +60 -0
- package/dist/app/only-view/constant.js +1336 -0
- package/dist/app/only-view/page.jsx +248 -0
- package/dist/app/only-view/user.d.ts +1 -0
- package/dist/app/only-view/user.js +12 -0
- package/dist/app/page.d.ts +2 -0
- package/dist/app/page.jsx +13 -0
- package/dist/app/test/page.d.ts +2 -0
- package/dist/app/test/page.jsx +45 -0
- package/dist/app/v2/page.d.ts +2 -0
- package/dist/app/v2/page.jsx +13 -0
- package/dist/components/button-tools/index.d.ts +11 -0
- package/dist/components/button-tools/index.jsx +17 -0
- package/dist/components/form-tools/label.d.ts +2 -0
- package/dist/components/form-tools/label.jsx +63 -0
- package/dist/components/form-tools/shape.d.ts +8 -0
- package/dist/components/form-tools/shape.jsx +113 -0
- package/dist/components/input/number-indicator.d.ts +7 -0
- package/dist/components/input/number-indicator.jsx +36 -0
- package/dist/components/joystick/index.d.ts +12 -0
- package/dist/components/joystick/index.jsx +49 -0
- package/dist/components/layer/index.d.ts +19 -0
- package/dist/components/layer/index.jsx +383 -0
- package/dist/components/layer-v2/index.d.ts +19 -0
- package/dist/components/layer-v2/index.jsx +370 -0
- package/dist/components/layer-v3/index.d.ts +13 -0
- package/dist/components/layer-v3/index.jsx +631 -0
- package/dist/components/layer-v3/utils.d.ts +19 -0
- package/dist/components/layer-v3/utils.js +72 -0
- package/dist/components/layer-v4/constant.d.ts +60 -0
- package/dist/components/layer-v4/constant.js +93 -0
- package/dist/components/layer-v4/index.d.ts +24 -0
- package/dist/components/layer-v4/index.jsx +1046 -0
- package/dist/components/lib/index.d.ts +8 -0
- package/dist/components/lib/index.jsx +33 -0
- package/dist/components/modal-preview/index.d.ts +4 -0
- package/dist/components/modal-preview/index.jsx +11 -0
- package/dist/dto/event-handler.d.ts +1 -0
- package/dist/dto/event-handler.js +1 -0
- package/dist/dto/table.d.ts +80 -0
- package/dist/dto/table.js +1 -0
- package/dist/features/board/board-slice.d.ts +14 -0
- package/dist/features/board/board-slice.js +52 -0
- package/dist/features/board/index.d.ts +6 -0
- package/dist/features/board/index.jsx +725 -0
- package/dist/features/board-v2/board-slice.d.ts +14 -0
- package/dist/features/board-v2/board-slice.js +52 -0
- package/dist/features/board-v2/index.d.ts +8 -0
- package/dist/features/board-v2/index.jsx +869 -0
- package/dist/features/board-v3/board-slice.d.ts +19 -0
- package/dist/features/board-v3/board-slice.js +274 -0
- package/dist/features/board-v3/constant.d.ts +5 -0
- package/dist/features/board-v3/constant.js +5 -0
- package/dist/features/board-v3/history-slice.d.ts +27 -0
- package/dist/features/board-v3/history-slice.js +27 -0
- package/dist/features/board-v3/icons.d.ts +4 -0
- package/dist/features/board-v3/icons.jsx +100 -0
- package/dist/features/board-v3/index.d.ts +16 -0
- package/dist/features/board-v3/index.jsx +1678 -0
- package/dist/features/board-v3/polygon.d.ts +28 -0
- package/dist/features/board-v3/polygon.js +109 -0
- package/dist/features/board-v3/rect.d.ts +9 -0
- package/dist/features/board-v3/rect.js +152 -0
- package/dist/features/board-v3/resize-element.d.ts +12 -0
- package/dist/features/board-v3/resize-element.js +43 -0
- package/dist/features/board-v3/utils.d.ts +180 -0
- package/dist/features/board-v3/utils.js +1235 -0
- package/dist/features/navbar/index.d.ts +2 -0
- package/dist/features/navbar/index.jsx +5 -0
- package/dist/features/panel/index.d.ts +6 -0
- package/dist/features/panel/index.jsx +251 -0
- package/dist/features/panel/panel-slice.d.ts +23 -0
- package/dist/features/panel/panel-slice.js +46 -0
- package/dist/features/panel/select-tool.d.ts +6 -0
- package/dist/features/panel/select-tool.jsx +70 -0
- package/dist/features/panel/selected-group.d.ts +2 -0
- package/dist/features/panel/selected-group.jsx +93 -0
- package/dist/features/panel/square-circle-tool.d.ts +2 -0
- package/dist/features/panel/square-circle-tool.jsx +10 -0
- package/dist/features/panel/table-seat-circle.d.ts +2 -0
- package/dist/features/panel/table-seat-circle.jsx +36 -0
- package/dist/features/panel/table-seat-square.d.ts +2 -0
- package/dist/features/panel/table-seat-square.jsx +51 -0
- package/dist/features/panel/text-tool.d.ts +2 -0
- package/dist/features/panel/text-tool.jsx +57 -0
- package/dist/features/panel/upload-tool.d.ts +10 -0
- package/dist/features/panel/upload-tool.jsx +176 -0
- package/dist/features/panel/utils.d.ts +5 -0
- package/dist/features/panel/utils.js +47 -0
- package/dist/features/side-tool/index.d.ts +8 -0
- package/dist/features/side-tool/index.jsx +390 -0
- package/dist/features/side-tool/side-tool-slice.d.ts +16 -0
- package/dist/features/side-tool/side-tool-slice.js +28 -0
- package/dist/features/theme/theme-slice.d.ts +12 -0
- package/dist/features/theme/theme-slice.js +15 -0
- package/dist/features/view-only/index.d.ts +19 -0
- package/dist/features/view-only/index.jsx +205 -0
- package/dist/features/view-only-2/index.d.ts +19 -0
- package/dist/features/view-only-2/index.jsx +190 -0
- package/dist/features/view-only-3/index.d.ts +89 -0
- package/dist/features/view-only-3/index.jsx +590 -0
- package/dist/features/view-only-3/utils.d.ts +1 -0
- package/dist/features/view-only-3/utils.js +3 -0
- package/dist/hooks/use-redux.d.ts +4 -0
- package/dist/hooks/use-redux.js +3 -0
- package/dist/index.js +10 -0
- package/dist/libs/middleware.d.ts +2 -0
- package/dist/libs/middleware.js +5 -0
- package/dist/libs/rootReducer.d.ts +12 -0
- package/dist/libs/rootReducer.js +14 -0
- package/dist/libs/store.d.ts +18 -0
- package/dist/libs/store.js +19 -0
- package/dist/provider/antd-provider.d.ts +4 -0
- package/dist/provider/antd-provider.jsx +46 -0
- package/dist/provider/redux-provider.d.ts +3 -0
- package/dist/provider/redux-provider.jsx +6 -0
- package/dist/provider/store-provider.d.ts +4 -0
- package/dist/provider/store-provider.jsx +10 -0
- package/dist/utils/constant.d.ts +3 -0
- package/dist/utils/constant.js +13 -0
- package/dist/utils/format.d.ts +2 -0
- package/dist/utils/format.js +29 -0
- package/dist/utils/injectCss.d.ts +1 -0
- package/dist/utils/injectCss.js +13 -0
- package/dist/utils/regex.d.ts +3 -0
- package/dist/utils/regex.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import LayerView from "../../features/view-only";
|
|
2
|
+
export interface LayerViewProps {
|
|
3
|
+
componentProps: any[];
|
|
4
|
+
extraComponentProps: any[];
|
|
5
|
+
}
|
|
6
|
+
declare const TableEditor: ({ componentProps, extraComponentProps, }: LayerViewProps) => import("react").JSX.Element;
|
|
7
|
+
export default TableEditor;
|
|
8
|
+
export { LayerView };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import Board from "../../features/board";
|
|
4
|
+
import SideTool from "../../features/side-tool";
|
|
5
|
+
import ControlPanels from "../../features/panel";
|
|
6
|
+
import LayerView from "../../features/view-only";
|
|
7
|
+
import { useAppDispatch } from "../../hooks/use-redux";
|
|
8
|
+
const TableEditor = ({ componentProps = [], extraComponentProps = [], }) => {
|
|
9
|
+
const dispatch = useAppDispatch();
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (componentProps.length > 0) {
|
|
12
|
+
dispatch({
|
|
13
|
+
type: "board/setNewComponents",
|
|
14
|
+
payload: componentProps,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
if (extraComponentProps.length > 0) {
|
|
18
|
+
dispatch({
|
|
19
|
+
type: "board/setNewExtraComponent",
|
|
20
|
+
payload: extraComponentProps,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}, [componentProps, extraComponentProps]);
|
|
24
|
+
return (<>
|
|
25
|
+
<div className="w-full h-screen flex relative">
|
|
26
|
+
<SideTool />
|
|
27
|
+
<Board />
|
|
28
|
+
<ControlPanels />
|
|
29
|
+
</div>
|
|
30
|
+
</>);
|
|
31
|
+
};
|
|
32
|
+
export default TableEditor;
|
|
33
|
+
export { LayerView };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Modal } from "antd";
|
|
3
|
+
import { useAppSelector, useAppDispatch } from "../../hooks/use-redux";
|
|
4
|
+
const ModalPreview = ({ children }) => {
|
|
5
|
+
const { isPreview } = useAppSelector((state) => state.tool);
|
|
6
|
+
const dispatch = useAppDispatch();
|
|
7
|
+
return (<Modal open={isPreview} onCancel={() => dispatch({ type: "tool/setTooglePreview", payload: false })} width={700} title="Preview Board" centered footer={null}>
|
|
8
|
+
<div className="flex flex-col p-4 h-[500px]">{children}</div>
|
|
9
|
+
</Modal>);
|
|
10
|
+
};
|
|
11
|
+
export default ModalPreview;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type EventHandleType = "dragover" | "dragleave" | "drop" | "dragend" | "mousemove" | "mouseleave" | "mouseenter" | "dragleave" | "dragenter" | "pointerover" | "mousedown" | "pointerup" | "pointerdown" | "pointermove" | "pointerup" | "touchstart" | "touchmove" | "touchend" | "selected";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { SVGAttributes } from "react";
|
|
2
|
+
export type Shape = "square" | "circle" | "diamond" | "table-seat-circle" | "table-seat-square" | "background" | "image-table" | "text" | "ellipse" | "polygon" | "selection-box" | "table-seat-rect-circle" | "table-seat-half-square" | "table-seat-rect-square" | "bounding-box";
|
|
3
|
+
export type TagType = "icon" | "text";
|
|
4
|
+
export type Position = "right-top" | "right" | "right-bottom" | "left" | "left-top" | "left-bottom" | "top" | "bottom";
|
|
5
|
+
export type Direction = "flex" | "column";
|
|
6
|
+
export interface Label extends SVGAttributes<SVGElement> {
|
|
7
|
+
label?: string;
|
|
8
|
+
x?: number;
|
|
9
|
+
y?: number;
|
|
10
|
+
fontColor?: string;
|
|
11
|
+
rotation?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface Symbol extends SVGAttributes<SVGElement> {
|
|
14
|
+
value?: string;
|
|
15
|
+
gap?: number;
|
|
16
|
+
fontSize?: number;
|
|
17
|
+
position: Position;
|
|
18
|
+
}
|
|
19
|
+
export interface Item extends SVGAttributes<SVGElement> {
|
|
20
|
+
value?: string;
|
|
21
|
+
type?: TagType;
|
|
22
|
+
x?: number;
|
|
23
|
+
y?: number;
|
|
24
|
+
fontColor?: string;
|
|
25
|
+
symbol?: Symbol;
|
|
26
|
+
}
|
|
27
|
+
export interface Tag {
|
|
28
|
+
key?: string;
|
|
29
|
+
items?: Array<Item>;
|
|
30
|
+
direction?: string;
|
|
31
|
+
offsetX?: number;
|
|
32
|
+
offsetY?: number;
|
|
33
|
+
gap?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface TableProps {
|
|
36
|
+
id?: string;
|
|
37
|
+
labels?: Label[];
|
|
38
|
+
fontColor?: string;
|
|
39
|
+
src?: string;
|
|
40
|
+
shape?: Shape;
|
|
41
|
+
seatFill?: string;
|
|
42
|
+
text?: string;
|
|
43
|
+
tags?: Tag[];
|
|
44
|
+
gapTags?: number;
|
|
45
|
+
x?: number;
|
|
46
|
+
y?: number;
|
|
47
|
+
width?: number;
|
|
48
|
+
height?: number;
|
|
49
|
+
seatCount?: number;
|
|
50
|
+
openSpace?: number;
|
|
51
|
+
fontSize?: number;
|
|
52
|
+
label?: string;
|
|
53
|
+
radius?: number;
|
|
54
|
+
rotation?: number;
|
|
55
|
+
points?: Point[];
|
|
56
|
+
fill?: string;
|
|
57
|
+
strokeWidth?: number;
|
|
58
|
+
stroke?: string;
|
|
59
|
+
opacity?: number;
|
|
60
|
+
seatPositions?: {
|
|
61
|
+
top: number;
|
|
62
|
+
right: number;
|
|
63
|
+
bottom: number;
|
|
64
|
+
left: number;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export interface SVGElementProps extends SVGAttributes<SVGElement> {
|
|
68
|
+
}
|
|
69
|
+
export interface PropertiesProps extends Omit<SVGAttributes<SVGElement>, keyof TableProps>, TableProps {
|
|
70
|
+
}
|
|
71
|
+
export type BaseElement = {
|
|
72
|
+
x: number;
|
|
73
|
+
y: number;
|
|
74
|
+
width: number;
|
|
75
|
+
height: number;
|
|
76
|
+
};
|
|
77
|
+
export type Point = {
|
|
78
|
+
x: number;
|
|
79
|
+
y: number;
|
|
80
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Component {
|
|
2
|
+
id: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export interface InitialState {
|
|
6
|
+
components: Component[];
|
|
7
|
+
backgroundColor: string;
|
|
8
|
+
themeColor: string;
|
|
9
|
+
extraComponents: Component[];
|
|
10
|
+
flagChange: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const addComponent: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "board/addComponent">, removeComponent: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "board/removeComponent">, updateComponent: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "board/updateComponent">, setBackgroundColor: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "board/setBackgroundColor">, removeExtraComponent: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "board/removeExtraComponent">;
|
|
13
|
+
declare const _default: import("redux").Reducer<InitialState>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createSlice } from "@reduxjs/toolkit";
|
|
2
|
+
const initialState = {
|
|
3
|
+
components: [],
|
|
4
|
+
backgroundColor: "#FFFFFF",
|
|
5
|
+
themeColor: "#4A90E2",
|
|
6
|
+
extraComponents: [],
|
|
7
|
+
flagChange: false
|
|
8
|
+
};
|
|
9
|
+
const boardSlice = createSlice({
|
|
10
|
+
name: "board",
|
|
11
|
+
initialState,
|
|
12
|
+
reducers: {
|
|
13
|
+
addComponent: (state, action) => {
|
|
14
|
+
state.components.push(action.payload);
|
|
15
|
+
},
|
|
16
|
+
removeComponent: (state, action) => {
|
|
17
|
+
state.components = state.components.filter((component) => component.id !== action.payload.id);
|
|
18
|
+
},
|
|
19
|
+
removeExtraComponent: (state, action) => {
|
|
20
|
+
state.extraComponents = state.extraComponents.filter((component) => component.id !== action.payload.id);
|
|
21
|
+
},
|
|
22
|
+
updateComponent: (state, action) => {
|
|
23
|
+
const index = state.components.findIndex((component) => component.id === action.payload.id);
|
|
24
|
+
const indexExtra = state.extraComponents.findIndex((extraComponent) => extraComponent.id === action.payload.id);
|
|
25
|
+
if (index !== -1) {
|
|
26
|
+
// Update component biasa
|
|
27
|
+
state.components[index] = Object.assign(Object.assign({}, state.components[index]), action.payload);
|
|
28
|
+
}
|
|
29
|
+
else if (indexExtra !== -1) {
|
|
30
|
+
// Update extraComponent
|
|
31
|
+
state.extraComponents[indexExtra] = Object.assign(Object.assign({}, state.extraComponents[indexExtra]), action.payload);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
setBackgroundColor: (state, action) => {
|
|
35
|
+
state.backgroundColor = action.payload;
|
|
36
|
+
},
|
|
37
|
+
setNewComponents: (state, action) => {
|
|
38
|
+
state.components = action.payload;
|
|
39
|
+
},
|
|
40
|
+
setNewExtraComponents: (state, action) => {
|
|
41
|
+
state.extraComponents = action.payload;
|
|
42
|
+
},
|
|
43
|
+
setExtraComponent: (state, action) => {
|
|
44
|
+
state.extraComponents.push(action.payload);
|
|
45
|
+
},
|
|
46
|
+
setFlagChange: (state, action) => {
|
|
47
|
+
state.flagChange = action.payload;
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
export const { addComponent, removeComponent, updateComponent, setBackgroundColor, removeExtraComponent } = boardSlice.actions;
|
|
52
|
+
export default boardSlice.reducer;
|