seat-editor 3.1.21 → 3.1.23
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.
|
@@ -21,7 +21,7 @@ const boardSlice = createSlice({
|
|
|
21
21
|
state.components.push(action.payload);
|
|
22
22
|
},
|
|
23
23
|
removeComponent: (state, action) => {
|
|
24
|
-
state.components = state.components.filter((component) => component.id !== action.payload.id);
|
|
24
|
+
state.components = state.components.filter((component) => (component === null || component === void 0 ? void 0 : component.id) !== action.payload.id);
|
|
25
25
|
},
|
|
26
26
|
removeExtraComponent: (state, action) => {
|
|
27
27
|
state.extraComponents = state.extraComponents.filter((component) => component.id !== action.payload.id);
|
|
@@ -14,12 +14,14 @@ export type TableMatchEvent = {
|
|
|
14
14
|
event: EventHandleType;
|
|
15
15
|
properties: PropertiesProps;
|
|
16
16
|
};
|
|
17
|
-
export type ComponentProps<T =
|
|
18
|
-
[
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
export type ComponentProps<T = undefined> = PropertiesProps | ({
|
|
18
|
+
[key: string]: PropertiesProps | string | number | boolean | null | undefined;
|
|
19
|
+
} & (T extends undefined ? {} : {
|
|
20
|
+
meta: T;
|
|
21
|
+
}));
|
|
22
|
+
export type OnCurrentStateChange<TMeta = undefined> = ({ components, extraComponents, }: {
|
|
23
|
+
components: ComponentProps<TMeta>[];
|
|
24
|
+
extraComponents: ComponentProps<TMeta>[];
|
|
23
25
|
}) => void;
|
|
24
26
|
export type TransformProps = React.ForwardRefExoticComponent<Omit<ReactZoomPanPinchProps, "ref"> & React.RefAttributes<ReactZoomPanPinchContentRef>>;
|
|
25
27
|
export type RefLayerView = {
|
|
@@ -29,9 +31,9 @@ export type RefLayerView = {
|
|
|
29
31
|
tableGhost: SVGGElement;
|
|
30
32
|
hoverUnderghost: ComponentProps;
|
|
31
33
|
};
|
|
32
|
-
export interface LayerViewProps {
|
|
33
|
-
componentProps?: ComponentProps[];
|
|
34
|
-
extraComponentProps?: ComponentProps[];
|
|
34
|
+
export interface LayerViewProps<TMeta = undefined> {
|
|
35
|
+
componentProps?: ComponentProps<TMeta>[];
|
|
36
|
+
extraComponentProps?: ComponentProps<TMeta>[];
|
|
35
37
|
onCurrentStateChange?: OnCurrentStateChange;
|
|
36
38
|
onSelectComponent?: (component: ComponentProps) => void;
|
|
37
39
|
mappingKey?: string;
|
|
@@ -163,8 +163,10 @@ const LayerView = (props) => {
|
|
|
163
163
|
minY = minY;
|
|
164
164
|
}
|
|
165
165
|
const hasBoundingBox = extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor.some((item) => { var _a; return (_a = item === null || item === void 0 ? void 0 : item.shape) === null || _a === void 0 ? void 0 : _a.includes("bounding-box"); });
|
|
166
|
-
const paddingY = maxY * (((_h = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _h === void 0 ? void 0 : _h.paddingY) || 0) +
|
|
167
|
-
|
|
166
|
+
const paddingY = maxY * (((_h = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _h === void 0 ? void 0 : _h.paddingY) || 0) +
|
|
167
|
+
minY * (((_j = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _j === void 0 ? void 0 : _j.paddingY) || 0);
|
|
168
|
+
const paddingX = maxX * (((_k = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _k === void 0 ? void 0 : _k.paddingX) || 0) +
|
|
169
|
+
minX * (((_l = props === null || props === void 0 ? void 0 : props.viewStyles) === null || _l === void 0 ? void 0 : _l.paddingX) || 0);
|
|
168
170
|
if (hasBoundingBox) {
|
|
169
171
|
const findBoundingBox = extraComponentsEditor.find((item) => { var _a; return (_a = item === null || item === void 0 ? void 0 : item.shape) === null || _a === void 0 ? void 0 : _a.includes("bounding-box"); });
|
|
170
172
|
hasBoundingBoxRef.current = true;
|