Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-filerobot-image-editor

Package Overview
Dependencies
Maintainers
0
Versions
175
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-filerobot-image-editor - npm Package Compare versions

Comparing version 5.0.0-beta.14 to 5.0.0-beta.15

2

lib/hooks/useAnnotation/index.js

@@ -1,1 +0,1 @@

import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _excluded=["fonts","onFontChange"],_excluded2=["x","y","width","height","radius","radiusX","radiusY","points","image","text","scaleX","scaleY","rotation"],_excluded3=["shouldSave","neverSave"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{useCallback,useEffect,useMemo,useRef,useState}from"react";import randomId from"../../utils/randomId";import{TOOLS_IDS}from"../../utils/constants";import{useSelectTool,useSetAnnotation,useStore}from"./..";import previewThenCallAnnotationAdding from"./previewThenCallAnnotationAdding";import useDebouncedCallback from"../useDebouncedCallback";var useAnnotation=function(){var a,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],d=useSetAnnotation(),e=useStore(),f=e.previewGroup,g=e.annotations,h=e.selectionsIds,i=void 0===h?[]:h,j=e.config,k=e.toolId,l=useSelectTool(),m=_objectSpread(_objectSpread({},j.annotationsCommon),j[(null===(a=g[i[0]])||void 0===a?void 0:a.name)||b.name]),n=useState(function(){return _objectSpread(_objectSpread(_objectSpread({},m),b),g[i[0]])}),o=_slicedToArray(n,2),p=o[0],q=o[1],r=useRef(),s=null===f||void 0===f?void 0:f.getStage(),t=useCallback(function(a){var c=a.fonts,e=a.onFontChange,f=_objectWithoutProperties(a,_excluded),g=f.id&&b.name!==TOOLS_IDS.PEN;d(_objectSpread(_objectSpread({},f),{},{selectOnSet:g}))},[]),u=useDebouncedCallback(function(a){q(function(b){return _objectSpread(_objectSpread({},b),{},{shouldSave:!1,neverSave:!1},"function"==typeof a?a(b):a)})},15),v=useCallback(function(a,c){if(a.name===c){var d=a.x,e=a.y,f=a.width,g=a.height,h=a.radius,i=a.radiusX,j=a.radiusY,k=a.points,l=a.image,n=a.text,o=a.scaleX,p=a.scaleY,q=a.rotation,r=_objectWithoutProperties(a,_excluded2);return _objectSpread(_objectSpread(_objectSpread({},m),b),r)}return _objectSpread(_objectSpread({},m),b)},[]),w=useCallback(function(a){q(function(c){var d=v(c,a.name||b.name);return _objectSpread(_objectSpread(_objectSpread({},d),a),{},{id:a.id||randomId(a.name||c.name),shouldSave:!0,neverSave:!1})})},[]);return useEffect(function(){var a=p.name&&p.name!==k;a&&l(p.name,!0)},[p.name]),useEffect(function(){var a=p.shouldSave,b=p.neverSave,c=_objectWithoutProperties(p,_excluded3),d=1===i.length&&g[i[0]];!b&&(a||d)&&t(_objectSpread(_objectSpread({},c),{},{id:a?c.id:d.id}))},[p]),useEffect(function(){setTimeout(function(){1===i.length?(r.current=p,q(_objectSpread(_objectSpread({},g[i[0]]),{},{neverSave:!0}))):r.current&&(q(_objectSpread(_objectSpread({},r.current),{},{neverSave:!0})),r.current=null)})},[i,g]),useEffect(function(){var a=null;if(s&&c){var d=v(p,b.name);a=previewThenCallAnnotationAdding(s,_objectSpread(_objectSpread({},d),{},{name:b.name}),f,w)}return function(){a&&a()}},[s,p,f]),useMemo(function(){return[p,u,w]},[p,u,w])};export default useAnnotation;
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _excluded=["fonts","onFontChange"],_excluded2=["x","y","width","height","radius","radiusX","radiusY","points","image","originalImage","text","scaleX","scaleY","rotation","place","gravity"],_excluded3=["shouldSave","neverSave"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{useCallback,useEffect,useMemo,useRef,useState}from"react";import randomId from"../../utils/randomId";import{TOOLS_IDS}from"../../utils/constants";import{useSelectTool,useSetAnnotation,useStore}from"./..";import previewThenCallAnnotationAdding from"./previewThenCallAnnotationAdding";import useDebouncedCallback from"../useDebouncedCallback";var useAnnotation=function(){var a,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],d=useSetAnnotation(),e=useStore(),f=e.previewGroup,g=e.annotations,h=e.selectionsIds,i=void 0===h?[]:h,j=e.config,k=e.toolId,l=useSelectTool(),m=_objectSpread(_objectSpread({},j.annotationsCommon),j[(null===(a=g[i[0]])||void 0===a?void 0:a.name)||b.name]),n=useState(function(){return _objectSpread(_objectSpread(_objectSpread({},m),b),g[i[0]])}),o=_slicedToArray(n,2),p=o[0],q=o[1],r=useRef(),s=null===f||void 0===f?void 0:f.getStage(),t=useCallback(function(a){var c=a.fonts,e=a.onFontChange,f=_objectWithoutProperties(a,_excluded),g=f.id&&b.name!==TOOLS_IDS.PEN;d(_objectSpread(_objectSpread({},f),{},{selectOnSet:g}))},[]),u=useDebouncedCallback(function(a){q(function(b){return _objectSpread(_objectSpread({},b),{},{shouldSave:!1,neverSave:!1},"function"==typeof a?a(b):a)})},15),v=useCallback(function(a,c){if(a.name===c){var d=a.x,e=a.y,f=a.width,g=a.height,h=a.radius,i=a.radiusX,j=a.radiusY,k=a.points,l=a.image,n=a.originalImage,o=a.text,p=a.scaleX,q=a.scaleY,r=a.rotation,s=a.place,t=a.gravity,u=_objectWithoutProperties(a,_excluded2);return _objectSpread(_objectSpread(_objectSpread({},m),b),u)}return _objectSpread(_objectSpread({},m),b)},[]),w=useCallback(function(a){q(function(c){var d=v(c,a.name||b.name);return _objectSpread(_objectSpread(_objectSpread({},d),a),{},{id:a.id||randomId(a.name||c.name),shouldSave:!0,neverSave:!1})})},[]);return useEffect(function(){var a=p.name&&p.name!==k;a&&l(p.name,!0)},[p.name]),useEffect(function(){var a=p.shouldSave,b=p.neverSave,c=_objectWithoutProperties(p,_excluded3),d=1===i.length&&g[i[0]];!b&&(a||d)&&t(_objectSpread(_objectSpread({},c),{},{id:a?c.id:d.id}))},[p]),useEffect(function(){setTimeout(function(){1===i.length?(r.current=p,q(_objectSpread(_objectSpread({},g[i[0]]),{},{neverSave:!0}))):r.current&&(q(_objectSpread(_objectSpread({},r.current),{},{neverSave:!0})),r.current=null)})},[i,g]),useEffect(function(){var a=null;if(s&&c){var d=v(p,b.name);a=previewThenCallAnnotationAdding(s,_objectSpread(_objectSpread({},d),{},{name:b.name}),f,w)}return function(){a&&a()}},[s,p,f]),useMemo(function(){return[p,u,w]},[p,u,w])};export default useAnnotation;
{
"name": "react-filerobot-image-editor",
"version": "5.0.0-beta.14",
"version": "5.0.0-beta.15",
"license": "MIT",

@@ -46,3 +46,3 @@ "author": "Scaleflex",

},
"gitHead": "3ec9cd80bf9fdae19092f75397c692b9c3f79d64"
"gitHead": "b6b861da36afaccdabc956c18fb8a3d2bf729bb2"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc