UNPKG

react-filerobot-image-editor

Version:

React component version of filerobot image editor (FIE).

1 lines 833 B
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["annotationIds","annotations","annotationNamesToNodeComponents"];import React,{useMemo}from"react";import{useAnnotationEvents,useStore}from"../../../../hooks";import MemoizedAnnotation from"./MemoizedAnnotation";var AnnotationNodes=function(a){var b=a.annotationIds,c=a.annotations,d=a.annotationNamesToNodeComponents,e=_objectWithoutProperties(a,_excluded),f=useStore(),g=f.selectionsIds,h=void 0===g?[]:g,i=useAnnotationEvents();return useMemo(function(){return b.map(function(a){return React.createElement(MemoizedAnnotation,_extends({key:a,annotation:c[a],annotationEvents:i,selectionsIds:h,annotationNamesToNodeComponents:d},e))})},[b,c,i,h])};export default AnnotationNodes;