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,18 @@
|
|
|
1
|
+
import { Action, ThunkAction } from "@reduxjs/toolkit";
|
|
2
|
+
export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
3
|
+
board: import("../features/board-v3/board-slice").InitialState;
|
|
4
|
+
tool: import("../features/side-tool/side-tool-slice").ToolState;
|
|
5
|
+
panel: import("../features/panel/panel-slice").PanelState;
|
|
6
|
+
theme: import("../features/theme/theme-slice").ThemeProps;
|
|
7
|
+
}, import("redux").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("redux").StoreEnhancer<{
|
|
8
|
+
dispatch: import("redux-thunk").ThunkDispatch<{
|
|
9
|
+
board: import("../features/board-v3/board-slice").InitialState;
|
|
10
|
+
tool: import("../features/side-tool/side-tool-slice").ToolState;
|
|
11
|
+
panel: import("../features/panel/panel-slice").PanelState;
|
|
12
|
+
theme: import("../features/theme/theme-slice").ThemeProps;
|
|
13
|
+
}, undefined, import("redux").UnknownAction>;
|
|
14
|
+
}>, import("redux").StoreEnhancer]>>;
|
|
15
|
+
export type AppDispatch = typeof store.dispatch;
|
|
16
|
+
export type RootState = ReturnType<typeof store.getState>;
|
|
17
|
+
export type AppThunk = ThunkAction<void, RootState, unknown, Action<string>>;
|
|
18
|
+
export type AppStore = typeof store;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { configureStore } from "@reduxjs/toolkit";
|
|
3
|
+
import { rootReducer } from "./rootReducer";
|
|
4
|
+
import { logger } from "redux-logger";
|
|
5
|
+
import { middleware } from "./middleware";
|
|
6
|
+
import { FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER } from "redux-persist";
|
|
7
|
+
if (process.env.NODE_ENV === "development") {
|
|
8
|
+
middleware.push(logger);
|
|
9
|
+
}
|
|
10
|
+
// const rootPersistReducer = persistReducer<RootState>(rootPersistConfig, rootReducer);
|
|
11
|
+
export const store = configureStore({
|
|
12
|
+
reducer: rootReducer,
|
|
13
|
+
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
|
|
14
|
+
serializableCheck: {
|
|
15
|
+
ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
|
|
16
|
+
},
|
|
17
|
+
}).concat(middleware),
|
|
18
|
+
devTools: process.env.NODE_ENV !== "production",
|
|
19
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { ConfigProvider } from "antd";
|
|
4
|
+
import { AntdRegistry } from "@ant-design/nextjs-registry";
|
|
5
|
+
import { useAppSelector, useAppDispatch } from "../hooks/use-redux";
|
|
6
|
+
export const AntdProvider = ({ children, themeColor }) => {
|
|
7
|
+
const dispatch = useAppDispatch();
|
|
8
|
+
const theme = useAppSelector((state) => state.theme);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (themeColor !== theme.primaryColor) {
|
|
11
|
+
dispatch({
|
|
12
|
+
type: "theme/setPrimaryColor",
|
|
13
|
+
payload: themeColor
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}, [themeColor]);
|
|
17
|
+
return (<AntdRegistry>
|
|
18
|
+
<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
|
+
}}>
|
|
43
|
+
{children}
|
|
44
|
+
</ConfigProvider>
|
|
45
|
+
</AntdRegistry>);
|
|
46
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ReduxProvider } from "./redux-provider";
|
|
3
|
+
import { AntdProvider } from "./antd-provider";
|
|
4
|
+
import { injectSeatEditorCSS } from "../utils/injectCss";
|
|
5
|
+
export const StoreProvider = ({ children, themeColor = "red", }) => {
|
|
6
|
+
injectSeatEditorCSS();
|
|
7
|
+
return (<ReduxProvider>
|
|
8
|
+
<AntdProvider themeColor={themeColor}>{children}</AntdProvider>
|
|
9
|
+
</ReduxProvider>);
|
|
10
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const TABLE_KEYS: string[];
|
|
2
|
+
export declare const SEAT_SHAPES: readonly ["circle", "square", "table-seat-circle", "table-seat-square", "table-seat-half-square", "table-seat-rect-square", "table-seat-rect-circle"];
|
|
3
|
+
export type SeatShape = typeof SEAT_SHAPES[number];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const TABLE_KEYS = [
|
|
2
|
+
"labels",
|
|
3
|
+
"fontColor",
|
|
4
|
+
"src",
|
|
5
|
+
"shape",
|
|
6
|
+
"seatFill",
|
|
7
|
+
"tags",
|
|
8
|
+
"gapTags",
|
|
9
|
+
"seatCount",
|
|
10
|
+
"openSpace",
|
|
11
|
+
"seatPositions"
|
|
12
|
+
];
|
|
13
|
+
export const SEAT_SHAPES = ["circle", "square", "table-seat-circle", "table-seat-square", "table-seat-half-square", "table-seat-rect-square", "table-seat-rect-circle"];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const parseDataAttribute = (el, attr, fallback) => {
|
|
2
|
+
if (!el)
|
|
3
|
+
return fallback;
|
|
4
|
+
const raw = el.getAttribute(attr);
|
|
5
|
+
if (!raw)
|
|
6
|
+
return fallback;
|
|
7
|
+
try {
|
|
8
|
+
return JSON.parse(raw);
|
|
9
|
+
}
|
|
10
|
+
catch (err) {
|
|
11
|
+
console.warn(`Failed to parse attribute "${attr}":`, err);
|
|
12
|
+
return fallback;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export const parseDataAttributeList = (elements, attr) => {
|
|
16
|
+
const result = [];
|
|
17
|
+
elements.forEach((el) => {
|
|
18
|
+
const raw = el.getAttribute(attr);
|
|
19
|
+
if (!raw)
|
|
20
|
+
return;
|
|
21
|
+
try {
|
|
22
|
+
result.push(JSON.parse(raw));
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
console.warn(`Failed to parse attribute "${attr}" on element`, err);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return result;
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const injectSeatEditorCSS: () => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/utils/injectCss.ts
|
|
2
|
+
export const injectSeatEditorCSS = () => {
|
|
3
|
+
if (typeof document !== 'undefined') {
|
|
4
|
+
const id = '__seat-editor-css__';
|
|
5
|
+
if (!document.getElementById(id)) {
|
|
6
|
+
const link = document.createElement('link');
|
|
7
|
+
link.id = id;
|
|
8
|
+
link.rel = 'stylesheet';
|
|
9
|
+
link.href = '/node_modules/seat-editor/dist/seat-editor.css'; // atau dynamic import
|
|
10
|
+
document.head.appendChild(link);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
};
|