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.
Files changed (136) hide show
  1. package/dist/app/constant.d.ts +1 -0
  2. package/dist/app/constant.js +1 -0
  3. package/dist/app/layout.d.ts +6 -0
  4. package/dist/app/layout.jsx +27 -0
  5. package/dist/app/new-board/page.jsx +55 -0
  6. package/dist/app/old-board/page.d.ts +3 -0
  7. package/dist/app/old-board/page.jsx +510 -0
  8. package/dist/app/only-view/chair.d.ts +1 -0
  9. package/dist/app/only-view/chair.js +12 -0
  10. package/dist/app/only-view/constant.d.ts +60 -0
  11. package/dist/app/only-view/constant.js +1336 -0
  12. package/dist/app/only-view/page.jsx +248 -0
  13. package/dist/app/only-view/user.d.ts +1 -0
  14. package/dist/app/only-view/user.js +12 -0
  15. package/dist/app/page.d.ts +2 -0
  16. package/dist/app/page.jsx +13 -0
  17. package/dist/app/test/page.d.ts +2 -0
  18. package/dist/app/test/page.jsx +45 -0
  19. package/dist/app/v2/page.d.ts +2 -0
  20. package/dist/app/v2/page.jsx +13 -0
  21. package/dist/components/button-tools/index.d.ts +11 -0
  22. package/dist/components/button-tools/index.jsx +17 -0
  23. package/dist/components/form-tools/label.d.ts +2 -0
  24. package/dist/components/form-tools/label.jsx +63 -0
  25. package/dist/components/form-tools/shape.d.ts +8 -0
  26. package/dist/components/form-tools/shape.jsx +113 -0
  27. package/dist/components/input/number-indicator.d.ts +7 -0
  28. package/dist/components/input/number-indicator.jsx +36 -0
  29. package/dist/components/joystick/index.d.ts +12 -0
  30. package/dist/components/joystick/index.jsx +49 -0
  31. package/dist/components/layer/index.d.ts +19 -0
  32. package/dist/components/layer/index.jsx +383 -0
  33. package/dist/components/layer-v2/index.d.ts +19 -0
  34. package/dist/components/layer-v2/index.jsx +370 -0
  35. package/dist/components/layer-v3/index.d.ts +13 -0
  36. package/dist/components/layer-v3/index.jsx +631 -0
  37. package/dist/components/layer-v3/utils.d.ts +19 -0
  38. package/dist/components/layer-v3/utils.js +72 -0
  39. package/dist/components/layer-v4/constant.d.ts +60 -0
  40. package/dist/components/layer-v4/constant.js +93 -0
  41. package/dist/components/layer-v4/index.d.ts +24 -0
  42. package/dist/components/layer-v4/index.jsx +1046 -0
  43. package/dist/components/lib/index.d.ts +8 -0
  44. package/dist/components/lib/index.jsx +33 -0
  45. package/dist/components/modal-preview/index.d.ts +4 -0
  46. package/dist/components/modal-preview/index.jsx +11 -0
  47. package/dist/dto/event-handler.d.ts +1 -0
  48. package/dist/dto/event-handler.js +1 -0
  49. package/dist/dto/table.d.ts +80 -0
  50. package/dist/dto/table.js +1 -0
  51. package/dist/features/board/board-slice.d.ts +14 -0
  52. package/dist/features/board/board-slice.js +52 -0
  53. package/dist/features/board/index.d.ts +6 -0
  54. package/dist/features/board/index.jsx +725 -0
  55. package/dist/features/board-v2/board-slice.d.ts +14 -0
  56. package/dist/features/board-v2/board-slice.js +52 -0
  57. package/dist/features/board-v2/index.d.ts +8 -0
  58. package/dist/features/board-v2/index.jsx +869 -0
  59. package/dist/features/board-v3/board-slice.d.ts +19 -0
  60. package/dist/features/board-v3/board-slice.js +274 -0
  61. package/dist/features/board-v3/constant.d.ts +5 -0
  62. package/dist/features/board-v3/constant.js +5 -0
  63. package/dist/features/board-v3/history-slice.d.ts +27 -0
  64. package/dist/features/board-v3/history-slice.js +27 -0
  65. package/dist/features/board-v3/icons.d.ts +4 -0
  66. package/dist/features/board-v3/icons.jsx +100 -0
  67. package/dist/features/board-v3/index.d.ts +16 -0
  68. package/dist/features/board-v3/index.jsx +1678 -0
  69. package/dist/features/board-v3/polygon.d.ts +28 -0
  70. package/dist/features/board-v3/polygon.js +109 -0
  71. package/dist/features/board-v3/rect.d.ts +9 -0
  72. package/dist/features/board-v3/rect.js +152 -0
  73. package/dist/features/board-v3/resize-element.d.ts +12 -0
  74. package/dist/features/board-v3/resize-element.js +43 -0
  75. package/dist/features/board-v3/utils.d.ts +180 -0
  76. package/dist/features/board-v3/utils.js +1235 -0
  77. package/dist/features/navbar/index.d.ts +2 -0
  78. package/dist/features/navbar/index.jsx +5 -0
  79. package/dist/features/panel/index.d.ts +6 -0
  80. package/dist/features/panel/index.jsx +251 -0
  81. package/dist/features/panel/panel-slice.d.ts +23 -0
  82. package/dist/features/panel/panel-slice.js +46 -0
  83. package/dist/features/panel/select-tool.d.ts +6 -0
  84. package/dist/features/panel/select-tool.jsx +70 -0
  85. package/dist/features/panel/selected-group.d.ts +2 -0
  86. package/dist/features/panel/selected-group.jsx +93 -0
  87. package/dist/features/panel/square-circle-tool.d.ts +2 -0
  88. package/dist/features/panel/square-circle-tool.jsx +10 -0
  89. package/dist/features/panel/table-seat-circle.d.ts +2 -0
  90. package/dist/features/panel/table-seat-circle.jsx +36 -0
  91. package/dist/features/panel/table-seat-square.d.ts +2 -0
  92. package/dist/features/panel/table-seat-square.jsx +51 -0
  93. package/dist/features/panel/text-tool.d.ts +2 -0
  94. package/dist/features/panel/text-tool.jsx +57 -0
  95. package/dist/features/panel/upload-tool.d.ts +10 -0
  96. package/dist/features/panel/upload-tool.jsx +176 -0
  97. package/dist/features/panel/utils.d.ts +5 -0
  98. package/dist/features/panel/utils.js +47 -0
  99. package/dist/features/side-tool/index.d.ts +8 -0
  100. package/dist/features/side-tool/index.jsx +390 -0
  101. package/dist/features/side-tool/side-tool-slice.d.ts +16 -0
  102. package/dist/features/side-tool/side-tool-slice.js +28 -0
  103. package/dist/features/theme/theme-slice.d.ts +12 -0
  104. package/dist/features/theme/theme-slice.js +15 -0
  105. package/dist/features/view-only/index.d.ts +19 -0
  106. package/dist/features/view-only/index.jsx +205 -0
  107. package/dist/features/view-only-2/index.d.ts +19 -0
  108. package/dist/features/view-only-2/index.jsx +190 -0
  109. package/dist/features/view-only-3/index.d.ts +89 -0
  110. package/dist/features/view-only-3/index.jsx +590 -0
  111. package/dist/features/view-only-3/utils.d.ts +1 -0
  112. package/dist/features/view-only-3/utils.js +3 -0
  113. package/dist/hooks/use-redux.d.ts +4 -0
  114. package/dist/hooks/use-redux.js +3 -0
  115. package/dist/index.js +10 -0
  116. package/dist/libs/middleware.d.ts +2 -0
  117. package/dist/libs/middleware.js +5 -0
  118. package/dist/libs/rootReducer.d.ts +12 -0
  119. package/dist/libs/rootReducer.js +14 -0
  120. package/dist/libs/store.d.ts +18 -0
  121. package/dist/libs/store.js +19 -0
  122. package/dist/provider/antd-provider.d.ts +4 -0
  123. package/dist/provider/antd-provider.jsx +46 -0
  124. package/dist/provider/redux-provider.d.ts +3 -0
  125. package/dist/provider/redux-provider.jsx +6 -0
  126. package/dist/provider/store-provider.d.ts +4 -0
  127. package/dist/provider/store-provider.jsx +10 -0
  128. package/dist/utils/constant.d.ts +3 -0
  129. package/dist/utils/constant.js +13 -0
  130. package/dist/utils/format.d.ts +2 -0
  131. package/dist/utils/format.js +29 -0
  132. package/dist/utils/injectCss.d.ts +1 -0
  133. package/dist/utils/injectCss.js +13 -0
  134. package/dist/utils/regex.d.ts +3 -0
  135. package/dist/utils/regex.js +3 -0
  136. 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,4 @@
1
+ export declare const AntdProvider: React.FC<{
2
+ children: React.ReactNode;
3
+ themeColor?: string;
4
+ }>;
@@ -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,3 @@
1
+ export declare const ReduxProvider: ({ children }: {
2
+ children: React.ReactNode;
3
+ }) => import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { store } from "../libs/store";
3
+ import { Provider } from "react-redux";
4
+ export const ReduxProvider = ({ children }) => {
5
+ return <Provider store={store}>{children}</Provider>;
6
+ };
@@ -0,0 +1,4 @@
1
+ export declare const StoreProvider: ({ children, themeColor, }: {
2
+ children: React.ReactNode;
3
+ themeColor?: string;
4
+ }) => import("react").JSX.Element;
@@ -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,2 @@
1
+ export declare const parseDataAttribute: <T = any>(el: Element | null, attr: string, fallback?: T | null) => T;
2
+ export declare const parseDataAttributeList: <T = any>(elements: Array<Element> | NodeListOf<Element>, attr: string) => T[];
@@ -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
+ };
@@ -0,0 +1,3 @@
1
+ export declare const REGEX: {
2
+ size: RegExp;
3
+ };
@@ -0,0 +1,3 @@
1
+ export const REGEX = {
2
+ size: /^[1-9]\d*$/,
3
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seat-editor",
3
- "version": "3.3.13",
3
+ "version": "3.3.15",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",