seat-editor 3.5.49 → 3.5.51

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.
@@ -49,12 +49,11 @@ export const optionsShape = [
49
49
  },
50
50
  ];
51
51
  const SectionShape = ({ allowChangeShape = true, }) => {
52
- var _a;
53
52
  const shape = Form.useWatch("shape");
54
53
  const seatKey = useAppSelector((state) => state.panel.seatDefaultKey);
55
54
  const selectedComponent = useAppSelector((state) => state.panel.selectedComponent);
56
55
  const maxSeat = (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent[seatKey]) || 0;
57
- return (_jsxs("div", { className: "py-2", children: [_jsxs("h1", { className: "heading-s", children: ["Shape ", (_a = optionsShape === null || optionsShape === void 0 ? void 0 : optionsShape.find((item) => item.value === shape)) === null || _a === void 0 ? void 0 : _a.label] }), allowChangeShape && (_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) => {
56
+ return (_jsxs("div", { className: "py-2", children: [_jsx("h1", { className: "heading-s", children: "Section Shape" }), allowChangeShape && (_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) => {
58
57
  const disabled = item.value === "table-seat-rect-circle" && (maxSeat > 4 || maxSeat < 4);
59
58
  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"
60
59
  ? `Circle Type 2 (only for 4 ${seatKey})`
@@ -48,13 +48,12 @@ export const optionsShape = [
48
48
  },
49
49
  ];
50
50
  const SectionShape = ({ allowChangeShape = true, }) => {
51
- var _a;
52
51
  const shape = Form.useWatch("shape");
53
52
  const seatKey = useAppSelector((state) => state.panel.seatDefaultKey);
54
53
  const selectedComponent = useAppSelector((state) => state.panel.selectedComponent);
55
54
  const maxSeat = (selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent[seatKey]) || 0;
56
55
  return (<div className="py-2">
57
- <h1 className="heading-s">Shape {(_a = optionsShape === null || optionsShape === void 0 ? void 0 : optionsShape.find((item) => item.value === shape)) === null || _a === void 0 ? void 0 : _a.label}</h1>
56
+ <h1 className="heading-s">Section Shape</h1>
58
57
  {allowChangeShape && (<Flex gap={2} className="w-full">
59
58
  <Form.Item label="Name" name="shape" className="w-full">
60
59
  <Select className="w-full">
@@ -19,7 +19,7 @@ const PolygonTool = () => {
19
19
  dispatch({ type: "panel/setShow", payload: false });
20
20
  dispatch({ type: "tool/setActiveTool", payload: "select" });
21
21
  };
22
- return (_jsxs("div", { className: "py-2", children: [_jsx("h1", { className: "heading-s", children: "Shape Polygon" }), _jsxs(Flex, { gap: 2, children: [_jsx(Form.Item, { label: "Fill", name: "fill", getValueFromEvent: (color) => color.toHexString(), className: "w-full ", children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) }), _jsx(Form.Item, { label: "Stroke Fill", name: "stroke", getValueFromEvent: (color) => color.toHexString(), className: "w-full ", children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) }), _jsx(Form.Item, { label: "Stroke Size", name: "strokeWidth", className: "w-full", children: _jsx(InputNumber, {}) })] }), _jsxs(Flex, { gap: 2, children: [_jsx(Form.Item, { label: "Rotation", name: "rotation", className: "w-full", children: _jsx(InputNumber, { suffix: "\u00B0", min: -360, step: 1, max: 360, parser: (value) => {
22
+ return (_jsxs("div", { className: "py-2", children: [_jsx("h1", { className: "heading-s", children: "Section Shape" }), _jsxs(Flex, { gap: 2, children: [_jsx(Form.Item, { label: "Fill", name: "fill", getValueFromEvent: (color) => color.toHexString(), className: "w-full ", children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) }), _jsx(Form.Item, { label: "Stroke Fill", name: "stroke", getValueFromEvent: (color) => color.toHexString(), className: "w-full ", children: _jsx(ColorPicker, { allowClear: true, format: "hex", defaultFormat: "hex" }) }), _jsx(Form.Item, { label: "Stroke Size", name: "strokeWidth", className: "w-full", children: _jsx(InputNumber, {}) })] }), _jsxs(Flex, { gap: 2, children: [_jsx(Form.Item, { label: "Rotation", name: "rotation", className: "w-full", children: _jsx(InputNumber, { suffix: "\u00B0", min: -360, step: 1, max: 360, parser: (value) => {
23
23
  if (!value)
24
24
  return 0;
25
25
  const num = Number(value.replace(/\D/g, ""));
@@ -19,7 +19,7 @@ const PolygonTool = () => {
19
19
  dispatch({ type: "tool/setActiveTool", payload: "select" });
20
20
  };
21
21
  return (<div className="py-2">
22
- <h1 className="heading-s">Shape Polygon</h1>
22
+ <h1 className="heading-s">Section Shape</h1>
23
23
  <Flex gap={2}>
24
24
  <Form.Item label="Fill" name={"fill"} getValueFromEvent={(color) => color.toHexString()} className="w-full ">
25
25
  <ColorPicker allowClear format="hex" defaultFormat="hex"/>
@@ -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.49",
3
+ "version": "3.5.51",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",