seat-editor 3.5.50 → 3.5.52

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.
@@ -1,6 +1,6 @@
1
1
  import { createSlice, current } from "@reduxjs/toolkit";
2
2
  import { forEach } from "lodash";
3
- const MAX_HISTORY_CHANGES = 20;
3
+ const MAX_HISTORY_CHANGES = 21;
4
4
  const initialState = {
5
5
  components: [],
6
6
  backgroundColor: "#FFFFFF",
@@ -28,7 +28,7 @@ export const panelSlice = createSlice({
28
28
  updateSelectedComponent: (state, action) => {
29
29
  state.selectedComponent = Object.assign({}, action.payload);
30
30
  state.history.push(state.selectedComponent);
31
- if (state.history.length > 20) {
31
+ if (state.history.length >= 20) {
32
32
  state.history.shift();
33
33
  }
34
34
  },
@@ -183,14 +183,13 @@ const UploadTool = ({ name, type, action, defaultValue, transform, }) => {
183
183
  };
184
184
  const { Option } = Select;
185
185
  const UploadToolForm = (props) => {
186
- var _a, _b;
187
186
  const shape = Form.useWatch("shape");
188
187
  const seatKey = useAppSelector((state) => state.panel.seatDefaultKey);
189
188
  const selectedComponent = useAppSelector((state) => state.panel.selectedComponent);
190
189
  const extraComponents = useAppSelector((state) => state.board.extraComponents);
191
190
  const isExtraComponent = extraComponents.some((item) => item.id === (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id));
192
191
  const maxSeat = (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent[seatKey]) || 0;
193
- return (_jsxs("div", { className: "py-2", children: [_jsxs("h1", { className: "heading-s", children: ["Shape ", (_b = (_a = optionsShape === null || optionsShape === void 0 ? void 0 : optionsShape.find((item) => item.value === shape)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : "Image"] }), (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) && !isExtraComponent && (_jsx(Flex, { gap: 2, className: "w-full", children: _jsx(Form.Item, { label: "Name", name: "shape", className: "w-full", children: _jsx(Select, { className: "w-full", children: optionsShape === null || optionsShape === void 0 ? void 0 : optionsShape.map((item) => {
192
+ return (_jsxs("div", { className: "py-2", children: [_jsx("h1", { className: "heading-s", children: "Section Shape" }), (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) && !isExtraComponent && (_jsx(Flex, { gap: 2, className: "w-full", children: _jsx(Form.Item, { label: "Name", name: "shape", className: "w-full", children: _jsx(Select, { className: "w-full", children: optionsShape === null || optionsShape === void 0 ? void 0 : optionsShape.map((item) => {
194
193
  const disabled = item.value === "table-seat-rect-circle" && (maxSeat > 4 || maxSeat < 4);
195
194
  return (_jsx(Option, { value: item.value, disabled: disabled, className: "flex w-full items-center", children: _jsxs(Flex, { gap: 5, align: "center", justify: "between", children: [item.icon, _jsx("span", { children: item.value === "table-seat-rect-circle"
196
195
  ? `Circle Type 2 (only for 4 ${seatKey})`
@@ -211,7 +211,6 @@ const UploadTool = ({ name, type, action, defaultValue, transform, }) => {
211
211
  };
212
212
  const { Option } = Select;
213
213
  const UploadToolForm = (props) => {
214
- var _a, _b;
215
214
  const shape = Form.useWatch("shape");
216
215
  const seatKey = useAppSelector((state) => state.panel.seatDefaultKey);
217
216
  const selectedComponent = useAppSelector((state) => state.panel.selectedComponent);
@@ -219,7 +218,7 @@ const UploadToolForm = (props) => {
219
218
  const isExtraComponent = extraComponents.some((item) => item.id === (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id));
220
219
  const maxSeat = (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent[seatKey]) || 0;
221
220
  return (<div className="py-2">
222
- <h1 className="heading-s">Shape {(_b = (_a = optionsShape === null || optionsShape === void 0 ? void 0 : optionsShape.find((item) => item.value === shape)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : "Image"}</h1>
221
+ <h1 className="heading-s">Section Shape</h1>
223
222
  {(selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id) && !isExtraComponent && (<Flex gap={2} className="w-full">
224
223
  <Form.Item label="Name" name="shape" className="w-full">
225
224
  <Select className="w-full">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seat-editor",
3
- "version": "3.5.50",
3
+ "version": "3.5.52",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",