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,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,4 @@
1
+ declare const ModalPreview: ({ children }: {
2
+ children: React.ReactNode;
3
+ }) => import("react").JSX.Element;
4
+ export default ModalPreview;
@@ -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;
@@ -0,0 +1,6 @@
1
+ interface BoardTemplateProps {
2
+ onSelectComponent?: (items: any) => void;
3
+ mappingKey?: string;
4
+ }
5
+ declare const BoardTemplate: ({ onSelectComponent }: BoardTemplateProps) => import("react").JSX.Element;
6
+ export default BoardTemplate;