seat-editor 3.5.61 → 3.5.62

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.
@@ -39,7 +39,6 @@ const ControlPanels = (props) => {
39
39
  const extraComponents = useAppSelector((state) => state.board.extraComponents);
40
40
  const svgRef = useRef(null);
41
41
  const [bufferValueForm, setBufferValueForm] = useState(null);
42
- const [isUsingAverage, setIsUsingAverage] = useState(false);
43
42
  const isProgrammaticChange = useRef(false);
44
43
  useEffect(() => {
45
44
  svgRef.current = document.querySelectorAll("#workspace");
@@ -74,6 +73,7 @@ const ControlPanels = (props) => {
74
73
  }, [tool, show]);
75
74
  useEffect(() => {
76
75
  if (selectedComponent) {
76
+ resetPlaceholders();
77
77
  const id = values === null || values === void 0 ? void 0 : values.id;
78
78
  if (id !== selectedComponent.id) {
79
79
  form.resetFields();
@@ -38,7 +38,6 @@ const ControlPanels = (props) => {
38
38
  const extraComponents = useAppSelector((state) => state.board.extraComponents);
39
39
  const svgRef = useRef(null);
40
40
  const [bufferValueForm, setBufferValueForm] = useState(null);
41
- const [isUsingAverage, setIsUsingAverage] = useState(false);
42
41
  const isProgrammaticChange = useRef(false);
43
42
  useEffect(() => {
44
43
  svgRef.current = document.querySelectorAll("#workspace");
@@ -73,6 +72,7 @@ const ControlPanels = (props) => {
73
72
  }, [tool, show]);
74
73
  useEffect(() => {
75
74
  if (selectedComponent) {
75
+ resetPlaceholders();
76
76
  const id = values === null || values === void 0 ? void 0 : values.id;
77
77
  if (id !== selectedComponent.id) {
78
78
  form.resetFields();
@@ -8,7 +8,7 @@ import { MIN_HEIGHT, MIN_WIDTH, MIN_X, MIN_Y } from "../board-v3/constant";
8
8
  import UploadGroupTool from "./upload-group-tool";
9
9
  const { Option } = Select;
10
10
  const SelectedGroup = ({ action, }) => {
11
- const { placeholders, setPlaceholder, unsetPlaceholder, setPlaceholderBulk, resetPlaceholders, } = useFormPlaceholder();
11
+ const { placeholders } = useFormPlaceholder();
12
12
  const shape = Form.useWatch("shape");
13
13
  const selectedGroup = useAppSelector((state) => state.panel.selectedGroup);
14
14
  const allShapeSelected = selectedGroup.map((item) => item.shape);
@@ -7,7 +7,7 @@ import { MIN_HEIGHT, MIN_WIDTH, MIN_X, MIN_Y } from "../board-v3/constant";
7
7
  import UploadGroupTool from "./upload-group-tool";
8
8
  const { Option } = Select;
9
9
  const SelectedGroup = ({ action, }) => {
10
- const { placeholders, setPlaceholder, unsetPlaceholder, setPlaceholderBulk, resetPlaceholders, } = useFormPlaceholder();
10
+ const { placeholders } = useFormPlaceholder();
11
11
  const shape = Form.useWatch("shape");
12
12
  const selectedGroup = useAppSelector((state) => state.panel.selectedGroup);
13
13
  const allShapeSelected = selectedGroup.map((item) => item.shape);
@@ -7,7 +7,7 @@ import Layers from "../../components/layer-v4";
7
7
  import { getTranslate } from "../board-v3/utils";
8
8
  import { Spin } from "antd";
9
9
  const LayerView = (props) => {
10
- var _a, _b, _c, _d;
10
+ var _a, _b, _c, _d, _e, _f, _g;
11
11
  const { componentProps, extraComponentProps, onSelectComponent, onDoubleClick, onCurrentStateChange, mappingKey, statusKey, defaultBackground, defaultBoundingBox, iconTags, tooltipProps, onRightClick, allowTooltip = true, tableMatchKey, eventMatchTable, ghostAttributes, onDrop, onSwitch, refs, privilegedTags, loadingRender, actionPrivileged = {
12
12
  select: true,
13
13
  move: true,
@@ -35,6 +35,7 @@ const LayerView = (props) => {
35
35
  const { components: componentsEditor, extraComponents: extraComponentsEditor, boundingBox: boundingBoxProps, } = useAppSelector((state) => state.board);
36
36
  const backgroundColor = useAppSelector((state) => state.board.backgroundColor);
37
37
  const { loading } = useAppSelector((state) => state.panel);
38
+ const getScaleTransform = (_c = (_b = (_a = transformRef === null || transformRef === void 0 ? void 0 : transformRef.current) === null || _a === void 0 ? void 0 : _a.instance) === null || _b === void 0 ? void 0 : _b.transformState) === null || _c === void 0 ? void 0 : _c.scale;
38
39
  useImperativeHandle(refs, () => ({
39
40
  svgRef: svgRef === null || svgRef === void 0 ? void 0 : svgRef.current,
40
41
  transformRef: transformRef === null || transformRef === void 0 ? void 0 : transformRef.current,
@@ -647,7 +648,7 @@ const LayerView = (props) => {
647
648
  boundingBox.width > 0 &&
648
649
  boundingBox.height > 0;
649
650
  const viewBox = isValidBoundingBox
650
- ? `${boundingBox.minX - (((_a = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _a === void 0 ? void 0 : _a.paddingLeft) || 0)} ${boundingBox.minY - (((_b = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _b === void 0 ? void 0 : _b.paddingTop) || 0)} ${boundingBox.width + (((_c = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _c === void 0 ? void 0 : _c.paddingRight) || 0)} ${boundingBox.height + (((_d = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _d === void 0 ? void 0 : _d.paddingBottom) || 0)}`
651
+ ? `${boundingBox.minX - (((_d = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _d === void 0 ? void 0 : _d.paddingLeft) || 0)} ${boundingBox.minY - (((_e = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _e === void 0 ? void 0 : _e.paddingTop) || 0)} ${boundingBox.width + (((_f = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _f === void 0 ? void 0 : _f.paddingRight) || 0)} ${boundingBox.height + (((_g = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _g === void 0 ? void 0 : _g.paddingBottom) || 0)}`
651
652
  : "0 0 1000 1000";
652
653
  return (_jsxs("div", Object.assign({ className: "relative w-full h-full flex-1", ref: containerRef, style: {
653
654
  overflow: "auto",
@@ -682,6 +683,6 @@ const LayerView = (props) => {
682
683
  // pointerEvents: disabled ? "none" : "all",
683
684
  touchAction: "none",
684
685
  userSelect: "none",
685
- } }, props.svgProps, { children: [hasBoundingBox && (_jsx("defs", { children: _jsx("clipPath", { id: "contentCrop", children: _jsx("rect", { x: boundingBox.minX, y: boundingBox.minY, width: boundingBox.width, height: boundingBox.height }) }) })), _jsx("g", { id: "main-layer", clipPath: "url(#contentCrop)", children: _jsx(Layers, { components: componentsAll, selectedTable: selectedTable, iconTags: iconTags, eventMatchTable: eventMatchTable, privilegedTags: privilegedTags }) })] })), tooltip.visible && (_jsx("div", { className: `seat-editor tooltip-container ${tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.className}`, style: Object.assign({ top: tooltip.y, left: tooltip.x, transform: `scale(${1 / scale})`, transformOrigin: "top left", minWidth: widthTooltip + "px" }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.style), children: tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.children }))] }) }))] })));
686
+ } }, props.svgProps, { children: [hasBoundingBox && (_jsx("defs", { children: _jsx("clipPath", { id: "contentCrop", children: _jsx("rect", { x: boundingBox.minX, y: boundingBox.minY, width: boundingBox.width, height: boundingBox.height }) }) })), _jsx("g", { id: "main-layer", clipPath: "url(#contentCrop)", children: _jsx(Layers, { components: componentsAll, selectedTable: selectedTable, iconTags: iconTags, eventMatchTable: eventMatchTable, privilegedTags: privilegedTags }) })] })), tooltip.visible && (_jsx("div", { className: `seat-editor tooltip-container ${tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.className}`, style: Object.assign({ top: tooltip.y, left: tooltip.x, transform: `scale(${1 / getScaleTransform})`, transformOrigin: "top left", minWidth: widthTooltip + "px" }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.style), children: tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.children }))] }) }))] })));
686
687
  };
687
688
  export default LayerView;
@@ -6,7 +6,7 @@ import Layers from "../../components/layer-v4";
6
6
  import { getTranslate } from "../board-v3/utils";
7
7
  import { Spin } from "antd";
8
8
  const LayerView = (props) => {
9
- var _a, _b, _c, _d;
9
+ var _a, _b, _c, _d, _e, _f, _g;
10
10
  const { componentProps, extraComponentProps, onSelectComponent, onDoubleClick, onCurrentStateChange, mappingKey, statusKey, defaultBackground, defaultBoundingBox, iconTags, tooltipProps, onRightClick, allowTooltip = true, tableMatchKey, eventMatchTable, ghostAttributes, onDrop, onSwitch, refs, privilegedTags, loadingRender, actionPrivileged = {
11
11
  select: true,
12
12
  move: true,
@@ -34,6 +34,7 @@ const LayerView = (props) => {
34
34
  const { components: componentsEditor, extraComponents: extraComponentsEditor, boundingBox: boundingBoxProps, } = useAppSelector((state) => state.board);
35
35
  const backgroundColor = useAppSelector((state) => state.board.backgroundColor);
36
36
  const { loading } = useAppSelector((state) => state.panel);
37
+ const getScaleTransform = (_c = (_b = (_a = transformRef === null || transformRef === void 0 ? void 0 : transformRef.current) === null || _a === void 0 ? void 0 : _a.instance) === null || _b === void 0 ? void 0 : _b.transformState) === null || _c === void 0 ? void 0 : _c.scale;
37
38
  useImperativeHandle(refs, () => ({
38
39
  svgRef: svgRef === null || svgRef === void 0 ? void 0 : svgRef.current,
39
40
  transformRef: transformRef === null || transformRef === void 0 ? void 0 : transformRef.current,
@@ -646,7 +647,7 @@ const LayerView = (props) => {
646
647
  boundingBox.width > 0 &&
647
648
  boundingBox.height > 0;
648
649
  const viewBox = isValidBoundingBox
649
- ? `${boundingBox.minX - (((_a = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _a === void 0 ? void 0 : _a.paddingLeft) || 0)} ${boundingBox.minY - (((_b = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _b === void 0 ? void 0 : _b.paddingTop) || 0)} ${boundingBox.width + (((_c = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _c === void 0 ? void 0 : _c.paddingRight) || 0)} ${boundingBox.height + (((_d = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _d === void 0 ? void 0 : _d.paddingBottom) || 0)}`
650
+ ? `${boundingBox.minX - (((_d = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _d === void 0 ? void 0 : _d.paddingLeft) || 0)} ${boundingBox.minY - (((_e = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _e === void 0 ? void 0 : _e.paddingTop) || 0)} ${boundingBox.width + (((_f = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _f === void 0 ? void 0 : _f.paddingRight) || 0)} ${boundingBox.height + (((_g = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _g === void 0 ? void 0 : _g.paddingBottom) || 0)}`
650
651
  : "0 0 1000 1000";
651
652
  return (<div className="relative w-full h-full flex-1" ref={containerRef} style={{
652
653
  overflow: "auto",
@@ -705,7 +706,7 @@ const LayerView = (props) => {
705
706
  </g>
706
707
  {/* 🧠 Ghost universal */}
707
708
  </svg>
708
- {tooltip.visible && (<div className={`seat-editor tooltip-container ${tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.className}`} style={Object.assign({ top: tooltip.y, left: tooltip.x, transform: `scale(${1 / scale})`, transformOrigin: "top left", minWidth: widthTooltip + "px" }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.style)}>
709
+ {tooltip.visible && (<div className={`seat-editor tooltip-container ${tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.className}`} style={Object.assign({ top: tooltip.y, left: tooltip.x, transform: `scale(${1 / getScaleTransform})`, transformOrigin: "top left", minWidth: widthTooltip + "px" }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.style)}>
709
710
  {tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.children}
710
711
  </div>)}
711
712
  </TransformComponent>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seat-editor",
3
- "version": "3.5.61",
3
+ "version": "3.5.62",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",