Add stats for nerds (#2453)
Co-authored-by: David Luzar <luzar.david@gmail.com> Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
@ -4,7 +4,7 @@ export {
|
||||
getElementsWithinSelection,
|
||||
getCommonAttributeOfSelectedElements,
|
||||
getSelectedElements,
|
||||
getTargetElement,
|
||||
getTargetElements,
|
||||
} from "./selection";
|
||||
export { normalizeScroll, calculateScrollCenter } from "./scroll";
|
||||
export {
|
||||
|
@ -33,9 +33,8 @@ export const getElementsWithinSelection = (
|
||||
export const isSomeElementSelected = (
|
||||
elements: readonly NonDeletedExcalidrawElement[],
|
||||
appState: AppState,
|
||||
): boolean => {
|
||||
return elements.some((element) => appState.selectedElementIds[element.id]);
|
||||
};
|
||||
): boolean =>
|
||||
elements.some((element) => appState.selectedElementIds[element.id]);
|
||||
|
||||
/**
|
||||
* Returns common attribute (picked by `getAttribute` callback) of selected
|
||||
@ -59,15 +58,12 @@ export const getCommonAttributeOfSelectedElements = <T>(
|
||||
export const getSelectedElements = (
|
||||
elements: readonly NonDeletedExcalidrawElement[],
|
||||
appState: AppState,
|
||||
) => {
|
||||
return elements.filter((element) => appState.selectedElementIds[element.id]);
|
||||
};
|
||||
) => elements.filter((element) => appState.selectedElementIds[element.id]);
|
||||
|
||||
export const getTargetElement = (
|
||||
export const getTargetElements = (
|
||||
elements: readonly NonDeletedExcalidrawElement[],
|
||||
appState: AppState,
|
||||
) => {
|
||||
return appState.editingElement
|
||||
) =>
|
||||
appState.editingElement
|
||||
? [appState.editingElement]
|
||||
: getSelectedElements(elements, appState);
|
||||
};
|
||||
|
Reference in New Issue
Block a user