seat-editor 1.0.3 → 1.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.js +1 -1
- package/dist/app/new-board/page.js +3 -3
- package/dist/app/page.js +6 -6
- package/dist/components/lib/index.d.ts +1 -1
- package/dist/components/lib/index.js +5 -5
- package/dist/components/modal-preview/index.js +1 -1
- package/dist/features/board/board-slice.d.ts +4 -33
- package/dist/features/board/board-slice.js +1 -1
- package/dist/features/board/index.js +3 -3
- package/dist/features/panel/index.js +1 -1
- package/dist/features/panel/panel-slice.d.ts +1 -1
- package/dist/features/panel/select-tool.js +1 -1
- package/dist/features/panel/square-circle-tool.js +2 -2
- package/dist/features/panel/table-seat-circle.js +2 -2
- package/dist/features/panel/upload-tool.js +3 -3
- package/dist/features/side-tool/index.js +1 -1
- package/dist/features/side-tool/side-tool-slice.d.ts +1 -1
- package/dist/features/view/index.js +2 -2
- package/dist/libs/rootReducer.d.ts +10 -1
- package/dist/libs/rootReducer.js +3 -3
- package/dist/libs/store.d.ts +10 -2
- package/dist/provider/antd-provider.js +1 -1
- package/dist/provider/redux-provider.js +1 -1
- package/package.json +1 -1
package/dist/app/layout.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import localFont from "next/font/local";
|
|
3
3
|
import "./globals.css";
|
|
4
4
|
import { Layout } from "antd";
|
|
5
|
-
import { StoreProvider } from "
|
|
5
|
+
import { StoreProvider } from "../provider/store-provider";
|
|
6
6
|
const geistSans = localFont({
|
|
7
7
|
src: "./fonts/GeistVF.woff",
|
|
8
8
|
variable: "--font-geist-sans",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import Board from "
|
|
3
|
-
import SideTool from "
|
|
4
|
-
import ControlPanels from "
|
|
2
|
+
import Board from "../../features/board";
|
|
3
|
+
import SideTool from "../../features/side-tool";
|
|
4
|
+
import ControlPanels from "../../features/panel";
|
|
5
5
|
export default function NewBoard() {
|
|
6
6
|
return (_jsx(_Fragment, { children: _jsxs("div", { className: "w-full h-screen flex relative", children: [_jsx(SideTool, {}), _jsx(Board, {}), _jsx(ControlPanels, {})] }) }));
|
|
7
7
|
}
|
package/dist/app/page.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect } from "react";
|
|
4
|
-
import Board from "
|
|
5
|
-
import SideTool from "
|
|
6
|
-
import ControlPanels from "
|
|
7
|
-
import { useAppDispatch } from "
|
|
4
|
+
import Board from "../features/board";
|
|
5
|
+
import SideTool from "../features/side-tool";
|
|
6
|
+
import ControlPanels from "../features/panel";
|
|
7
|
+
import { useAppDispatch } from "../hooks/use-redux";
|
|
8
8
|
const TableEditor = (props) => {
|
|
9
9
|
const { componentProps, extraComponentProps } = props;
|
|
10
10
|
const dispatch = useAppDispatch();
|
|
11
11
|
useEffect(() => {
|
|
12
|
-
if (componentProps.length > 0) {
|
|
12
|
+
if ((componentProps === null || componentProps === void 0 ? void 0 : componentProps.length) > 0) {
|
|
13
13
|
dispatch({
|
|
14
14
|
type: "board/setNewComponents",
|
|
15
15
|
payload: componentProps,
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
if (extraComponentProps.length > 0) {
|
|
18
|
+
if ((extraComponentProps === null || extraComponentProps === void 0 ? void 0 : extraComponentProps.length) > 0) {
|
|
19
19
|
dispatch({
|
|
20
20
|
type: "board/setNewExtraComponent",
|
|
21
21
|
payload: extraComponentProps,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect } from "react";
|
|
4
|
-
import Board from "
|
|
5
|
-
import SideTool from "
|
|
6
|
-
import ControlPanels from "
|
|
7
|
-
import LayerView from "
|
|
8
|
-
import { useAppDispatch } from "
|
|
4
|
+
import Board from "../../features/board";
|
|
5
|
+
import SideTool from "../../features/side-tool";
|
|
6
|
+
import ControlPanels from "../../features/panel";
|
|
7
|
+
import LayerView from "../../features/view";
|
|
8
|
+
import { useAppDispatch } from "../../hooks/use-redux";
|
|
9
9
|
const TableEditor = ({ componentProps = [], extraComponentProps = [], }) => {
|
|
10
10
|
const dispatch = useAppDispatch();
|
|
11
11
|
useEffect(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Modal } from "antd";
|
|
4
|
-
import { useAppSelector, useAppDispatch } from "
|
|
4
|
+
import { useAppSelector, useAppDispatch } from "../../hooks/use-redux";
|
|
5
5
|
const ModalPreview = ({ children }) => {
|
|
6
6
|
const { isPreview } = useAppSelector((state) => state.tool);
|
|
7
7
|
const dispatch = useAppDispatch();
|
|
@@ -1,41 +1,12 @@
|
|
|
1
|
-
interface Component {
|
|
1
|
+
export interface Component {
|
|
2
2
|
id: string;
|
|
3
3
|
[key: string]: any;
|
|
4
4
|
}
|
|
5
|
-
interface InitialState {
|
|
5
|
+
export interface InitialState {
|
|
6
6
|
components: Component[];
|
|
7
7
|
backgroundColor: string;
|
|
8
8
|
extraComponents: Component[];
|
|
9
9
|
}
|
|
10
|
-
declare const boardSlice: import("@reduxjs/toolkit").Slice<InitialState, {
|
|
11
|
-
addComponent: (state: import("immer").WritableDraft<InitialState>, action: {
|
|
12
|
-
payload: any;
|
|
13
|
-
type: string;
|
|
14
|
-
}) => void;
|
|
15
|
-
removeComponent: (state: import("immer").WritableDraft<InitialState>, action: {
|
|
16
|
-
payload: any;
|
|
17
|
-
type: string;
|
|
18
|
-
}) => void;
|
|
19
|
-
updateComponent: (state: import("immer").WritableDraft<InitialState>, action: {
|
|
20
|
-
payload: any;
|
|
21
|
-
type: string;
|
|
22
|
-
}) => void;
|
|
23
|
-
setBackgroundColor: (state: import("immer").WritableDraft<InitialState>, action: {
|
|
24
|
-
payload: any;
|
|
25
|
-
type: string;
|
|
26
|
-
}) => void;
|
|
27
|
-
setNewComponents: (state: import("immer").WritableDraft<InitialState>, action: {
|
|
28
|
-
payload: any;
|
|
29
|
-
type: string;
|
|
30
|
-
}) => void;
|
|
31
|
-
setNewExtraComponents: (state: import("immer").WritableDraft<InitialState>, action: {
|
|
32
|
-
payload: any;
|
|
33
|
-
type: string;
|
|
34
|
-
}) => void;
|
|
35
|
-
setExtraComponent: (state: import("immer").WritableDraft<InitialState>, action: {
|
|
36
|
-
payload: any;
|
|
37
|
-
type: string;
|
|
38
|
-
}) => void;
|
|
39
|
-
}, "board", "board", import("@reduxjs/toolkit").SliceSelectors<InitialState>>;
|
|
40
10
|
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">;
|
|
41
|
-
|
|
11
|
+
declare const _default: import("redux").Reducer<InitialState>;
|
|
12
|
+
export default _default;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
4
|
import { TransformWrapper, TransformComponent, } from "react-zoom-pan-pinch";
|
|
5
|
-
import { useAppSelector, useAppDispatch } from "
|
|
6
|
-
import Layers from "
|
|
5
|
+
import { useAppSelector, useAppDispatch } from "../../hooks/use-redux";
|
|
6
|
+
import Layers from "../../components/layer";
|
|
7
7
|
import { throttle } from "lodash";
|
|
8
|
-
import ModalPreview from "
|
|
8
|
+
import ModalPreview from "../../components/modal-preview";
|
|
9
9
|
import LayerView from "../view";
|
|
10
10
|
const BoardTemplate = () => {
|
|
11
11
|
const dispatch = useAppDispatch();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
|
-
import { useAppDispatch, useAppSelector } from "
|
|
4
|
+
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
5
5
|
import { Form, Drawer, Input } from "antd";
|
|
6
6
|
import SelectToolForm from "./select-tool";
|
|
7
7
|
import SquareToolForm from "./square-circle-tool";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useAppSelector } from "
|
|
3
|
+
import { useAppSelector } from "../../hooks/use-redux";
|
|
4
4
|
import SquareToolForm from "./square-circle-tool";
|
|
5
5
|
import SeatCircle from "./table-seat-circle";
|
|
6
6
|
import UploadTool from "./upload-tool";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import SectionLabel from "
|
|
4
|
-
import SectionShape from "
|
|
3
|
+
import SectionLabel from "../../components/form-tools/label";
|
|
4
|
+
import SectionShape from "../../components/form-tools/shape";
|
|
5
5
|
const SquareToolForm = () => {
|
|
6
6
|
return (_jsxs(_Fragment, { children: [_jsx(SectionShape, {}), _jsx(SectionLabel, {})] }));
|
|
7
7
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { ColorPicker, Flex, Form, InputNumber } from "antd";
|
|
4
|
-
import SectionLabel from "
|
|
5
|
-
import SectionShape from "
|
|
4
|
+
import SectionLabel from "../../components/form-tools/label";
|
|
5
|
+
import SectionShape from "../../components/form-tools/shape";
|
|
6
6
|
const SeatCircle = () => {
|
|
7
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
8
|
};
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { Upload, message, } from "antd";
|
|
4
4
|
import { InboxOutlined } from "@ant-design/icons";
|
|
5
|
-
import { useAppDispatch } from "
|
|
5
|
+
import { useAppDispatch } from "../../hooks/use-redux";
|
|
6
6
|
import { useState } from "react";
|
|
7
|
-
import SectionLabel from "
|
|
8
|
-
import SectionShape from "
|
|
7
|
+
import SectionLabel from "../../components/form-tools/label";
|
|
8
|
+
import SectionShape from "../../components/form-tools/shape";
|
|
9
9
|
const { Dragger } = Upload;
|
|
10
10
|
const UploadTool = ({ name, type }) => {
|
|
11
11
|
var _a, _b;
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Circle, CopyPlus, Eye, EyeOff, Image, Layers2, MousePointer, PaintBucket, Ratio, SquareMousePointer, Trash, Type, Upload, } from "lucide-react";
|
|
4
4
|
import ButtonTools from "../../components/button-tools";
|
|
5
5
|
import { Divider, ColorPicker, Button, } from "antd";
|
|
6
|
-
import { useAppDispatch, useAppSelector } from "
|
|
6
|
+
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
7
7
|
import { useState } from "react";
|
|
8
8
|
const SideTool = () => {
|
|
9
9
|
const [color, setColor] = useState("#000000");
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
4
|
import { useMemo, useRef, useState } from "react";
|
|
5
5
|
import { TransformWrapper, TransformComponent, } from "react-zoom-pan-pinch";
|
|
6
|
-
import { useAppSelector } from "
|
|
7
|
-
import Layers from "
|
|
6
|
+
import { useAppSelector } from "../../hooks/use-redux";
|
|
7
|
+
import Layers from "../../components/layer";
|
|
8
8
|
const LayerView = (props) => {
|
|
9
9
|
const { componentProps = [], extraComponentProps = [] } = props;
|
|
10
10
|
const transformRef = useRef(null);
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
export declare const rootReducer:
|
|
1
|
+
export declare const rootReducer: import("redux").Reducer<{
|
|
2
|
+
board: import("../features/board/board-slice").InitialState;
|
|
3
|
+
tool: import("../features/side-tool/side-tool-slice").ToolState;
|
|
4
|
+
panel: import("../features/panel/panel-slice").PanelState;
|
|
5
|
+
}, import("redux").UnknownAction, Partial<{
|
|
6
|
+
board: import("../features/board/board-slice").InitialState;
|
|
7
|
+
tool: import("../features/side-tool/side-tool-slice").ToolState;
|
|
8
|
+
panel: import("../features/panel/panel-slice").PanelState;
|
|
9
|
+
}>>;
|
|
10
|
+
export type RootState = ReturnType<typeof rootReducer>;
|
package/dist/libs/rootReducer.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { combineReducers } from "redux";
|
|
3
|
-
import boardSlice from "
|
|
4
|
-
import sideTool from "
|
|
5
|
-
import panelSlice from "
|
|
3
|
+
import boardSlice from "../features/board/board-slice";
|
|
4
|
+
import sideTool from "../features/side-tool/side-tool-slice";
|
|
5
|
+
import panelSlice from "../features/panel/panel-slice";
|
|
6
6
|
export const rootReducer = combineReducers({
|
|
7
7
|
// Add your reducers here
|
|
8
8
|
board: boardSlice,
|
package/dist/libs/store.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { Action, ThunkAction } from "@reduxjs/toolkit";
|
|
2
|
-
export declare const store: import("@reduxjs/toolkit").EnhancedStore<
|
|
3
|
-
|
|
2
|
+
export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
3
|
+
board: import("../features/board/board-slice").InitialState;
|
|
4
|
+
tool: import("../features/side-tool/side-tool-slice").ToolState;
|
|
5
|
+
panel: import("../features/panel/panel-slice").PanelState;
|
|
6
|
+
}, import("redux").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("redux").StoreEnhancer<{
|
|
7
|
+
dispatch: import("redux-thunk").ThunkDispatch<{
|
|
8
|
+
board: import("../features/board/board-slice").InitialState;
|
|
9
|
+
tool: import("../features/side-tool/side-tool-slice").ToolState;
|
|
10
|
+
panel: import("../features/panel/panel-slice").PanelState;
|
|
11
|
+
}, undefined, import("redux").UnknownAction>;
|
|
4
12
|
}>, import("redux").StoreEnhancer]>>;
|
|
5
13
|
export type AppDispatch = typeof store.dispatch;
|
|
6
14
|
export type RootState = ReturnType<typeof store.getState>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { ConfigProvider } from "antd";
|
|
4
4
|
import { AntdRegistry } from "@ant-design/nextjs-registry";
|
|
5
|
-
import { useAppSelector } from "
|
|
5
|
+
import { useAppSelector } from "../hooks/use-redux";
|
|
6
6
|
export const AntdProvider = ({ children, }) => {
|
|
7
7
|
const theme = useAppSelector((state) => state.theme);
|
|
8
8
|
return (_jsx(AntdRegistry, { children: _jsx(ConfigProvider, { theme: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { store } from "
|
|
3
|
+
import { store } from "../libs/store";
|
|
4
4
|
import { Provider } from "react-redux";
|
|
5
5
|
export const ReduxProvider = ({ children }) => {
|
|
6
6
|
return _jsx(Provider, { store: store, children: children });
|