react-filerobot-image-editor
Advanced tools
Comparing version 5.0.0-beta.21 to 5.0.0-beta.22
@@ -1,1 +0,1 @@ | ||
import _defineProperty from"@babel/runtime/helpers/defineProperty";var _SET_ORIGINAL_SOURCE$;import addFilter,{ADD_FILTER}from"./addFilter";import hideLoader,{HIDE_LOADER}from"./hideLoader";import redo,{REDO}from"./redo";import reset,{RESET}from"./reset";import setFeedback,{SET_FEEDBACK}from"./setFeedback";import showLoader,{SHOW_LOADER}from"./showLoader";import selectTab,{SELECT_TAB}from"./selectTab";import undo,{UNDO}from"./undo";import setFinetune,{SET_FINETUNE}from"./setFinetune";import setAnnotation,{SET_ANNOTATION}from"./setAnnotation";import changePointerIcon,{CHANGE_POINTER_ICON}from"./changePointerIcon";import selectAnnotation,{SELECT_ANNOTATION}from"./selectAnnotation";import clearAnnotationsSelections,{CLEAR_ANNOTATIONS_SELECTIONS}from"./clearAnnotationsSelections";import toggleOriginalImageDisplay,{TOGGLE_ORIGINAL_IMAGE_DISPLAY}from"./toggleOriginalImageDisplay";import selectTool,{SELECT_TOOL}from"./selectTool";import toggleFlip,{TOGGLE_FLIP}from"./toggleFlip";import setCrop,{SET_CROP}from"./setCrop";import changeRotation,{CHANGE_ROTATION}from"./changeRotation";import zoomCanvas,{ZOOM_CANVAS}from"./zoomCanvas";import setCanvasSize,{SET_CANVAS_SIZE}from"./setCanvasSize";import setOriginalSource,{SET_ORIGINAL_SOURCE}from"./setOriginalSource";import setShownImageDimensions,{SET_SHOWN_IMAGE_DIMENSIONS}from"./setShownImageDimensions";import removeAnnotations,{REMOVE_ANNOTATIONS}from"./removeAnnotations";import duplicateAnnotations,{DUPLICATE_ANNOTATIONS}from"./duplicateAnnotations";import enableTextContentEdit,{ENABLE_TEXT_CONTENT_EDIT}from"./enableTextContentEdit";import setResize,{SET_RESIZE}from"./setResize";import setSaved,{SET_SAVED}from"./setSaved";import updateState,{UPDATE_STATE}from"./updateState";import setLatestColor,{SET_LATEST_COLOR}from"./setLatestColor";import toggleTabsNavbar,{TOGGLE_TABS_NAVBAR}from"./toggleTabsNavbar";import setSaving,{SET_SAVING}from"./setSaving";import replaceAnnotations,{REPLACE_ANNOTATIONS}from"./replaceAnnotations";export default(_SET_ORIGINAL_SOURCE$={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_SET_ORIGINAL_SOURCE$,SET_ORIGINAL_SOURCE,setOriginalSource),SET_FEEDBACK,setFeedback),SHOW_LOADER,showLoader),HIDE_LOADER,hideLoader),CHANGE_POINTER_ICON,changePointerIcon),SELECT_ANNOTATION,selectAnnotation),CLEAR_ANNOTATIONS_SELECTIONS,clearAnnotationsSelections),TOGGLE_ORIGINAL_IMAGE_DISPLAY,toggleOriginalImageDisplay),SELECT_TAB,selectTab),SELECT_TOOL,selectTool),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_SET_ORIGINAL_SOURCE$,ZOOM_CANVAS,zoomCanvas),SET_CANVAS_SIZE,setCanvasSize),SET_SHOWN_IMAGE_DIMENSIONS,setShownImageDimensions),ENABLE_TEXT_CONTENT_EDIT,enableTextContentEdit),SET_LATEST_COLOR,setLatestColor),TOGGLE_TABS_NAVBAR,toggleTabsNavbar),SET_SAVING,setSaving),ADD_FILTER,addFilter),SET_FINETUNE,setFinetune),SET_ANNOTATION,setAnnotation),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_SET_ORIGINAL_SOURCE$,REPLACE_ANNOTATIONS,replaceAnnotations),SET_CROP,setCrop),CHANGE_ROTATION,changeRotation),TOGGLE_FLIP,toggleFlip),SET_RESIZE,setResize),REMOVE_ANNOTATIONS,removeAnnotations),DUPLICATE_ANNOTATIONS,duplicateAnnotations),UNDO,undo),REDO,redo),RESET,reset),_defineProperty(_defineProperty(_SET_ORIGINAL_SOURCE$,SET_SAVED,setSaved),UPDATE_STATE,updateState));export{SET_ORIGINAL_SOURCE,SET_FEEDBACK,SHOW_LOADER,HIDE_LOADER,CHANGE_POINTER_ICON,SELECT_ANNOTATION,CLEAR_ANNOTATIONS_SELECTIONS,TOGGLE_ORIGINAL_IMAGE_DISPLAY,SELECT_TAB,SELECT_TOOL,ZOOM_CANVAS,SET_CANVAS_SIZE,SET_SHOWN_IMAGE_DIMENSIONS,ENABLE_TEXT_CONTENT_EDIT,SET_LATEST_COLOR,TOGGLE_TABS_NAVBAR,SET_SAVING,ADD_FILTER,SET_FINETUNE,SET_ANNOTATION,REPLACE_ANNOTATIONS,SET_CROP,CHANGE_ROTATION,TOGGLE_FLIP,SET_RESIZE,REMOVE_ANNOTATIONS,DUPLICATE_ANNOTATIONS,UNDO,REDO,RESET,SET_SAVED,UPDATE_STATE}; | ||
import _defineProperty from"@babel/runtime/helpers/defineProperty";var _SET_ORIGINAL_SOURCE$;import addFilter,{ADD_FILTER}from"./addFilter";import hideLoader,{HIDE_LOADER}from"./hideLoader";import redo,{REDO}from"./redo";import reset,{RESET}from"./reset";import setFeedback,{SET_FEEDBACK}from"./setFeedback";import showLoader,{SHOW_LOADER}from"./showLoader";import selectTab,{SELECT_TAB}from"./selectTab";import undo,{UNDO}from"./undo";import setFinetune,{SET_FINETUNE}from"./setFinetune";import setAnnotation,{SET_ANNOTATION}from"./setAnnotation";import changePointerIcon,{CHANGE_POINTER_ICON}from"./changePointerIcon";import selectAnnotation,{SELECT_ANNOTATION}from"./selectAnnotation";import clearAnnotationsSelections,{CLEAR_ANNOTATIONS_SELECTIONS}from"./clearAnnotationsSelections";import toggleOriginalImageDisplay,{TOGGLE_ORIGINAL_IMAGE_DISPLAY}from"./toggleOriginalImageDisplay";import selectTool,{SELECT_TOOL}from"./selectTool";import toggleFlip,{TOGGLE_FLIP}from"./toggleFlip";import setCrop,{SET_CROP}from"./setCrop";import changeRotation,{CHANGE_ROTATION}from"./changeRotation";import zoomCanvas,{ZOOM_CANVAS}from"./zoomCanvas";import setCanvasSize,{SET_CANVAS_SIZE}from"./setCanvasSize";import setOriginalSource,{SET_ORIGINAL_SOURCE}from"./setOriginalSource";import setShownImageDimensions,{SET_SHOWN_IMAGE_DIMENSIONS}from"./setShownImageDimensions";import removeAnnotations,{REMOVE_ANNOTATIONS}from"./removeAnnotations";import duplicateAnnotations,{DUPLICATE_ANNOTATIONS}from"./duplicateAnnotations";import enableTextContentEdit,{ENABLE_TEXT_CONTENT_EDIT}from"./enableTextContentEdit";import setResize,{SET_RESIZE}from"./setResize";import setSaved,{SET_SAVED}from"./setSaved";import updateState,{UPDATE_STATE}from"./updateState";import setLatestColor,{SET_LATEST_COLOR}from"./setLatestColor";import toggleTabsNavbar,{TOGGLE_TABS_NAVBAR}from"./toggleTabsNavbar";import setSaving,{SET_SAVING}from"./setSaving";import replaceAnnotations,{REPLACE_ANNOTATIONS}from"./replaceAnnotations";import injectIntoLastState,{INJECT_INTO_LAST_STATE}from"./injectIntoLastState";import updateExtraState,{UPDATE_EXTRA_STATE}from"./updateExtraState";import updateAnnotationIds,{UPDATE_ANNOTATION_IDS}from"./updateAnnotationIds";export default(_SET_ORIGINAL_SOURCE$={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_SET_ORIGINAL_SOURCE$,SET_ORIGINAL_SOURCE,setOriginalSource),SET_FEEDBACK,setFeedback),SHOW_LOADER,showLoader),HIDE_LOADER,hideLoader),CHANGE_POINTER_ICON,changePointerIcon),SELECT_ANNOTATION,selectAnnotation),CLEAR_ANNOTATIONS_SELECTIONS,clearAnnotationsSelections),TOGGLE_ORIGINAL_IMAGE_DISPLAY,toggleOriginalImageDisplay),SELECT_TAB,selectTab),SELECT_TOOL,selectTool),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_SET_ORIGINAL_SOURCE$,ZOOM_CANVAS,zoomCanvas),SET_CANVAS_SIZE,setCanvasSize),SET_SHOWN_IMAGE_DIMENSIONS,setShownImageDimensions),ENABLE_TEXT_CONTENT_EDIT,enableTextContentEdit),SET_LATEST_COLOR,setLatestColor),TOGGLE_TABS_NAVBAR,toggleTabsNavbar),SET_SAVING,setSaving),ADD_FILTER,addFilter),SET_FINETUNE,setFinetune),SET_ANNOTATION,setAnnotation),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_SET_ORIGINAL_SOURCE$,REPLACE_ANNOTATIONS,replaceAnnotations),SET_CROP,setCrop),CHANGE_ROTATION,changeRotation),TOGGLE_FLIP,toggleFlip),SET_RESIZE,setResize),REMOVE_ANNOTATIONS,removeAnnotations),DUPLICATE_ANNOTATIONS,duplicateAnnotations),UPDATE_ANNOTATION_IDS,updateAnnotationIds),UNDO,undo),REDO,redo),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_SET_ORIGINAL_SOURCE$,RESET,reset),SET_SAVED,setSaved),UPDATE_STATE,updateState),UPDATE_EXTRA_STATE,updateExtraState),INJECT_INTO_LAST_STATE,injectIntoLastState));export{SET_ORIGINAL_SOURCE,SET_FEEDBACK,SHOW_LOADER,HIDE_LOADER,CHANGE_POINTER_ICON,SELECT_ANNOTATION,CLEAR_ANNOTATIONS_SELECTIONS,TOGGLE_ORIGINAL_IMAGE_DISPLAY,SELECT_TAB,SELECT_TOOL,ZOOM_CANVAS,SET_CANVAS_SIZE,SET_SHOWN_IMAGE_DIMENSIONS,ENABLE_TEXT_CONTENT_EDIT,SET_LATEST_COLOR,TOGGLE_TABS_NAVBAR,SET_SAVING,ADD_FILTER,SET_FINETUNE,SET_ANNOTATION,REPLACE_ANNOTATIONS,SET_CROP,CHANGE_ROTATION,TOGGLE_FLIP,SET_RESIZE,REMOVE_ANNOTATIONS,DUPLICATE_ANNOTATIONS,UPDATE_ANNOTATION_IDS,UNDO,REDO,RESET,SET_SAVED,UPDATE_STATE,UPDATE_EXTRA_STATE,INJECT_INTO_LAST_STATE}; |
@@ -1,1 +0,1 @@ | ||
import _defineProperty from"@babel/runtime/helpers/defineProperty";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{EVENTS}from"../utils/constants";import emitCustomEvent from"../utils/emitCustomEvent";export var REMOVE_ANNOTATIONS="REMOVE_ANNOTATIONS";var removeAnnotations=function(a,b){var c=a.annotations,d=a.selectionsIds;return b.annotationsIds.forEach(function(b){if(d=d.filter(function(a){return a!==b}),a.designLayer&&c[b]){var e=a.designLayer.findOne("#".concat(b));e&&e.destroy(),delete c[b]}}),emitCustomEvent(EVENTS.ANNOTATIONS_REMOVE,{ids:b.annotationsIds}),_objectSpread(_objectSpread({},a),{},{isDesignState:b.isDesignState||!0,annotations:c,selectionsIds:[]})};export default removeAnnotations; | ||
import _defineProperty from"@babel/runtime/helpers/defineProperty";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{EVENTS}from"../utils/constants";import emitCustomEvent from"../utils/emitCustomEvent";export var REMOVE_ANNOTATIONS="REMOVE_ANNOTATIONS";var removeAnnotations=function(a,b){var c=a.annotations,d=a.annotationIds,e=_objectSpread({},c),f=d,g=a.selectionsIds;return b.annotationsIds.forEach(function(b){if(g=g.filter(function(a){return a!==b}),a.designLayer&&e[b]){var c=a.designLayer.findOne("#".concat(b));c&&c.destroy(),delete e[b],f=f.filter(function(a){return b!==a})}}),emitCustomEvent(EVENTS.ANNOTATIONS_REMOVE,{ids:b.annotationsIds}),_objectSpread(_objectSpread({},a),{},{isDesignState:!b.dismissHistory,annotationIds:f,annotations:e,selectionsIds:[]})};export default removeAnnotations; |
@@ -1,1 +0,1 @@ | ||
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["dismissHistory","replaceCurrent","selectOnSet","onAnnotationAdd","applyDimensionsMappingToOriginal"];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{EVENTS}from"../utils/constants";import emitCustomEvent from"../utils/emitCustomEvent";import getProperDimensions from"../utils/getProperDimensions";import mapDimensions from"../utils/mapDimensions";import randomId from"../utils/randomId";export var SET_ANNOTATION="SET_ANNOTATION";var setAnnotation=function(a){var b,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},d=c.dismissHistory,e=c.replaceCurrent,f=void 0!==e&&e,g=c.selectOnSet,h=c.onAnnotationAdd,i=c.applyDimensionsMappingToOriginal,j=_objectWithoutProperties(c,_excluded),k=null!==(b=j.id)&&void 0!==b?b:randomId(j.name),l=_objectSpread(_objectSpread({},j),{},{id:k}),m=a.annotations[k]||{};if((f||0===Object.keys(m))&&"function"==typeof h){var n=h(l,a);l=_objectSpread(_objectSpread({},l),n)}if(m&&!Object.keys(l).some(function(a){return"undefined"!=typeof l[a]&&l[a]!==m[a]}))return a;var o=_objectSpread(_objectSpread({},f?{}:m),l);if(void 0===i||i){var p=getProperDimensions(a.resize,a.adjustments.crop,a.shownImageDimensions,a.originalSource,a.adjustments.rotation),q={x:l.x!==m.x&&l.x,y:l.y!==m.y&&l.y,width:l.width!==m.width&&l.width,height:l.height!==m.height&&l.height,radiusX:l.radiusX!==m.radiusX&&l.radiusX,radiusY:l.radiusY!==m.radiusY&&l.radiusY};o=_objectSpread(_objectSpread({},o),mapDimensions({dimensions:q,oldMapDimensions:a.shownImageDimensions,newMapDimensions:p}))}return emitCustomEvent(m?EVENTS.ANNOTATION_EDIT:EVENTS.ANNOTATION_ADD,{annotation:o}),_objectSpread(_objectSpread({},a),{},{isDesignState:!(void 0!==d&&d),annotations:_objectSpread(_objectSpread({},a.annotations),{},_defineProperty({},o.id,o)),selectionsIds:void 0!==g&&g?[o.id]:a.selectionsIds})};export default setAnnotation; | ||
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["dismissHistory","replaceCurrent","selectOnSet","onAnnotationAdd","applyDimensionsMappingToOriginal"];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{EVENTS}from"../utils/constants";import emitCustomEvent from"../utils/emitCustomEvent";import getProperDimensions from"../utils/getProperDimensions";import mapDimensions from"../utils/mapDimensions";import randomId from"../utils/randomId";export var SET_ANNOTATION="SET_ANNOTATION";var setAnnotation=function(a){var b,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},d=c.dismissHistory,e=c.replaceCurrent,f=void 0!==e&&e,g=c.selectOnSet,h=c.onAnnotationAdd,i=c.applyDimensionsMappingToOriginal,j=_objectWithoutProperties(c,_excluded),k=null!==(b=j.id)&&void 0!==b?b:randomId(j.name),l=a.annotations[k]||{},m=0===Object.keys(l).length,n=_objectSpread(_objectSpread(_objectSpread({},j),m&&{order:a.annotationIds.length}),{},{id:k});if((f||m)&&"function"==typeof h){var o=h(n,a);n=_objectSpread(_objectSpread({},n),o)}if(l&&!Object.keys(n).some(function(a){return"undefined"!=typeof n[a]&&n[a]!==l[a]}))return a;var p=_objectSpread(_objectSpread({},f?{}:l),n);if(void 0===i||i){var q=getProperDimensions(a.resize,a.adjustments.crop,a.shownImageDimensions,a.originalSource,a.adjustments.rotation),r={x:n.x!==l.x&&n.x,y:n.y!==l.y&&n.y,width:n.width!==l.width&&n.width,height:n.height!==l.height&&n.height,radiusX:n.radiusX!==l.radiusX&&n.radiusX,radiusY:n.radiusY!==l.radiusY&&n.radiusY};p=_objectSpread(_objectSpread({},p),mapDimensions({dimensions:r,oldMapDimensions:a.shownImageDimensions,newMapDimensions:q}))}return emitCustomEvent(l?EVENTS.ANNOTATION_EDIT:EVENTS.ANNOTATION_ADD,{annotation:p}),_objectSpread(_objectSpread({},a),{},{isDesignState:!(void 0!==d&&d),annotationIds:m?[].concat(_toConsumableArray(a.annotationIds),[p.id]):a.annotationIds,annotations:_objectSpread(_objectSpread({},a.annotations),{},_defineProperty({},p.id,p)),selectionsIds:void 0!==g&&g?[p.id]:a.selectionsIds})};export default setAnnotation; |
@@ -1,1 +0,1 @@ | ||
import _extends from"@babel/runtime/helpers/extends";import React,{useCallback}from"react";import Redo from"@scaleflex/icons/redo";import{REDO}from"../../../actions";import{useStore}from"../../../hooks";import{StyledHistoryButton}from"./HistoryButtons.styled";var RedoButton=function(a){var b=useStore(),c=b.dispatch,d=b.hasRedo,e=void 0!==d&&d,f=b.t,g=useCallback(function(){c({type:REDO})},[]);return React.createElement(StyledHistoryButton,_extends({className:"FIE_buttons-redo-btn",color:"basic",size:"sm",onClick:e?g:void 0,disabled:!e,title:f("redoTitle")},a),React.createElement(Redo,null))};export default RedoButton; | ||
import _extends from"@babel/runtime/helpers/extends";import Redo from"@scaleflex/icons/redo";import{useManageHistoryState,useStore}from"../../../hooks";import{StyledHistoryButton}from"./HistoryButtons.styled";var RedoButton=function(a){var b=useStore(),c=b.t,d=useManageHistoryState(),e=d.redo,f=d.hasRedo;return React.createElement(StyledHistoryButton,_extends({className:"FIE_buttons-redo-btn",color:"basic",size:"sm",onClick:f?e:void 0,disabled:!f,title:c("redoTitle")},a),React.createElement(Redo,null))};export default RedoButton; |
@@ -1,1 +0,1 @@ | ||
import _extends from"@babel/runtime/helpers/extends";import React,{useCallback}from"react";import Undo from"@scaleflex/icons/undo";import{UNDO}from"../../../actions";import{useStore}from"../../../hooks";import{StyledHistoryButton}from"./HistoryButtons.styled";var UndoButton=function(a){var b=useStore(),c=b.dispatch,d=b.hasUndo,e=void 0!==d&&d,f=b.t,g=b.feedback,h=0===g.duration,i=useCallback(function(){c({type:UNDO})},[]);return React.createElement(StyledHistoryButton,_extends({className:"FIE_buttons-undo-btn",color:"basic",size:"sm",onClick:e?i:void 0,disabled:!e||h,title:f("undoTitle")},a),React.createElement(Undo,null))};export default UndoButton; | ||
import _extends from"@babel/runtime/helpers/extends";import Undo from"@scaleflex/icons/undo";import{useManageHistoryState,useStore}from"../../../hooks";import{StyledHistoryButton}from"./HistoryButtons.styled";var UndoButton=function(a){var b=useStore(),c=b.t,d=b.feedback,e=useManageHistoryState(),f=e.hasUndo,g=e.undo,h=0===d.duration;return React.createElement(StyledHistoryButton,_extends({className:"FIE_buttons-undo-btn",color:"basic",size:"sm",onClick:f?g:void 0,disabled:!f||h,title:c("undoTitle")},a),React.createElement(Undo,null))};export default UndoButton; |
@@ -1,1 +0,1 @@ | ||
import React from"react";import{useStore}from"../../../hooks";import{RESET}from"../../../actions";import ConfirmationModal from"./ConfirmationModal";var ResetConfirmationModal=function(a){var b=a.children,c=a.eventName,d=void 0===c?"onClick":c,e=useStore(),f=e.t,g=e.config,h=e.dispatch;return React.createElement(ConfirmationModal,{title:f("warning"),hint:f("discardChangesWarningHint"),onConfirm:function dispatchReset(){h({type:RESET,payload:{config:g}})},eventName:d},b)};export default ResetConfirmationModal; | ||
import React from"react";import{useManageHistoryState,useStore}from"../../../hooks";import ConfirmationModal from"./ConfirmationModal";var ResetConfirmationModal=function(a){var b=a.children,c=a.eventName,d=void 0===c?"onClick":c,e=useStore(),f=e.t,g=useManageHistoryState(),h=g.reset;return React.createElement(ConfirmationModal,{title:f("warning"),hint:f("discardChangesWarningHint"),onConfirm:h,eventName:d},b)};export default ResetConfirmationModal; |
@@ -1,1 +0,1 @@ | ||
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["annotations","annotationNamesToNodeComponents"];import React,{useMemo}from"react";import{useAnnotationEvents,useStore,useTextAnnotationEditing}from"../../../../hooks";import MemoizedAnnotation from"./MemoizedAnnotation";var AnnotationNodes=function(a){var b=a.annotations,c=a.annotationNamesToNodeComponents,d=_objectWithoutProperties(a,_excluded),e=useStore(),f=e.selectionsIds,g=void 0===f?[]:f,h=useAnnotationEvents();return useTextAnnotationEditing(),useMemo(function(){return Object.values(b).map(function(a){return React.createElement(MemoizedAnnotation,_extends({key:a.id,annotation:a,annotationEvents:h,selectionsIds:g,annotationNamesToNodeComponents:c},d))})},[b,h,g])};export default AnnotationNodes; | ||
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,useTextAnnotationEditing}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 useTextAnnotationEditing(),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; |
@@ -1,1 +0,1 @@ | ||
import React,{useRef}from"react";import{useStore}from"../../../hooks";import AnnotationNodes from"./AnnotationNodes";import PreviewGroup from"./PreviewGroup";import DesignLayerWrapper from"./DesignLayerWrapper";import{ANNOTATION_NAMES_TO_COMPONENT}from"./AnnotationNodes/AnnotationNodes.constants";var DesignLayer=function(){var a=useStore(),b=a.annotations,c=a.config.annotationComponents,d=void 0===c?ANNOTATION_NAMES_TO_COMPONENT:c,e=useRef();return React.createElement(DesignLayerWrapper,{previewGroupRef:e},React.createElement(AnnotationNodes,{annotations:b,annotationNamesToNodeComponents:d}),React.createElement(PreviewGroup,{ref:e}))};export default DesignLayer; | ||
import React,{useRef}from"react";import{useStore}from"../../../hooks";import AnnotationNodes from"./AnnotationNodes";import PreviewGroup from"./PreviewGroup";import DesignLayerWrapper from"./DesignLayerWrapper";import{ANNOTATION_NAMES_TO_COMPONENT}from"./AnnotationNodes/AnnotationNodes.constants";var DesignLayer=function(){var a=useStore(),b=a.annotationIds,c=a.annotations,d=a.config.annotationComponents,e=void 0===d?ANNOTATION_NAMES_TO_COMPONENT:d,f=useRef();return React.createElement(DesignLayerWrapper,{previewGroupRef:f},React.createElement(AnnotationNodes,{annotationIds:b,annotations:c,annotationNamesToNodeComponents:e}),React.createElement(PreviewGroup,{ref:f}))};export default DesignLayer; |
@@ -1,1 +0,1 @@ | ||
import _defineProperty from"@babel/runtime/helpers/defineProperty";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{DEFAULT_ZOOM_FACTOR,POINTER_ICONS,TOOLS_IDS}from"../utils/constants";import filterStrToClass from"../utils/filterStrToClass";import finetunesStrsToClasses from"../utils/finetunesStrsToClasses";var getInitialAppState=function(){var a,b,c,d,e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},f=_objectSpread({},e.loadableDesignState);Array.isArray(f.finetunes)&&(f.finetunes=finetunesStrsToClasses(f.finetunes)),f.filter&&(f.filter=filterStrToClass(f.filter));var g=!!e.loadableDesignState||!!(e.useCloudimage&&(null===(a=e.cloudimage)||void 0===a?void 0:a.loadableQuery));return _objectSpread(_objectSpread({imgSrc:"string"==typeof e.source?e.source:(null===(b=e.source)||void 0===b?void 0:b.src)||"",finetunes:[],finetunesProps:{},filter:null,adjustments:{crop:{ratio:e[TOOLS_IDS.CROP].ratio,ratioTitleKey:null!==(c=e[TOOLS_IDS.CROP].ratioTitleKey)&&void 0!==c?c:e[TOOLS_IDS.CROP].ratio,width:null,height:null,x:0,y:0},isFlippedX:!1,isFlippedY:!1,rotation:0},annotations:{},resize:{},shownImageDimensions:{}},f),{},{pointerCssIcon:POINTER_ICONS.DEFAULT,canvasScale:1,zoom:{factor:DEFAULT_ZOOM_FACTOR,x:null,y:null},isLoadingGlobally:!0,selectionsIds:[],tabId:e.defaultTabId||null,toolId:e.defaultToolId||null,feedback:{},pastDesignStates:[],futureDesignStates:[],isResetted:null===(d=!g)||void 0===d||d,haveNotSavedChanges:!1,latestColors:{},showTabsNavbar:!1,isSaving:!1,presentOriginalSources:{},extra:void 0})};export default getInitialAppState; | ||
import _defineProperty from"@babel/runtime/helpers/defineProperty";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{DEFAULT_ZOOM_FACTOR,POINTER_ICONS,TOOLS_IDS}from"../utils/constants";import filterStrToClass from"../utils/filterStrToClass";import finetunesStrsToClasses from"../utils/finetunesStrsToClasses";var getInitialAppState=function(){var a,b,c,d,e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},f=_objectSpread({},e.loadableDesignState);Array.isArray(f.finetunes)&&(f.finetunes=finetunesStrsToClasses(f.finetunes)),f.filter&&(f.filter=filterStrToClass(f.filter));var g=!!e.loadableDesignState||!!(e.useCloudimage&&(null===(a=e.cloudimage)||void 0===a?void 0:a.loadableQuery));return _objectSpread(_objectSpread({imgSrc:"string"==typeof e.source?e.source:(null===(b=e.source)||void 0===b?void 0:b.src)||"",finetunes:[],finetunesProps:{},filter:null,adjustments:{crop:{ratio:e[TOOLS_IDS.CROP].ratio,ratioTitleKey:null!==(c=e[TOOLS_IDS.CROP].ratioTitleKey)&&void 0!==c?c:e[TOOLS_IDS.CROP].ratio,width:null,height:null,x:0,y:0},isFlippedX:!1,isFlippedY:!1,rotation:0},annotationIds:[],annotations:{},resize:{},shownImageDimensions:{}},f),{},{pointerCssIcon:POINTER_ICONS.DEFAULT,canvasScale:1,zoom:{factor:DEFAULT_ZOOM_FACTOR,x:null,y:null},isLoadingGlobally:!0,selectionsIds:[],tabId:e.defaultTabId||null,toolId:e.defaultToolId||null,feedback:{},pastDesignStates:[],futureDesignStates:[],isResetted:null===(d=!g)||void 0===d||d,haveNotSavedChanges:!1,latestColors:{},showTabsNavbar:!1,isSaving:!1,presentOriginalSources:{},extra:void 0})};export default getInitialAppState; |
@@ -1,1 +0,1 @@ | ||
export{default as useFinetune}from"./useFinetune";export{default as useFilter}from"./useFilter";export{default as useAnnotation}from"./useAnnotation";export{default as useAppReducer}from"./useAppReducer";export{default as useAnnotationEvents}from"./useAnnotationEvents";export{default as useResizeObserver}from"./useResizeObserver";export{default as useDebouncedCallback}from"./useDebouncedCallback";export{default as useStore}from"./useStore";export{default as useDrag}from"./useDrag";export{default as usePhoneScreen}from"./usePhoneScreen";export{default as useTransformedImgData}from"./useTransformedImgData";export{default as useUpdateEffect}from"./useUpdateEffect";export{default as useLoadMainSource}from"./useLoadMainSource";export{default as useScreenWidth}from"./useScreenWidth";export{default as useTabletScreen}from"./useTabletScreen";export{default as useToggleTabsNavbar}from"./useToggleTabsNavbar";export{default as useDispatch}from"./useDispatch";export{default as useAnnotations}from"./useAnnotations";export{default as useSelectedAnnotations}from"./useSelectedAnnotations";export{default as useAnnotationPositioning}from"./useAnnotationPositioning";export{default as useSetAnnotation}from"./useSetAnnotation";export{default as useSelectTool}from"./useSelectTool";export{default as useTextAnnotationEditing}from"./useTextAnnotationEditing";export{default as useImageScaled}from"./useImageScaled";export{default as useUpdateState}from"./useUpdateState";export{default as useMapDimensions}from"./useMapDimensions"; | ||
export{default as useFinetune}from"./useFinetune";export{default as useFilter}from"./useFilter";export{default as useAnnotation}from"./useAnnotation";export{default as useAppReducer}from"./useAppReducer";export{default as useAnnotationEvents}from"./useAnnotationEvents";export{default as useResizeObserver}from"./useResizeObserver";export{default as useDebouncedCallback}from"./useDebouncedCallback";export{default as useStore}from"./useStore";export{default as useDrag}from"./useDrag";export{default as usePhoneScreen}from"./usePhoneScreen";export{default as useTransformedImgData}from"./useTransformedImgData";export{default as useUpdateEffect}from"./useUpdateEffect";export{default as useLoadMainSource}from"./useLoadMainSource";export{default as useScreenWidth}from"./useScreenWidth";export{default as useTabletScreen}from"./useTabletScreen";export{default as useToggleTabsNavbar}from"./useToggleTabsNavbar";export{default as useDispatch}from"./useDispatch";export{default as useAnnotations}from"./useAnnotations";export{default as useSelectedAnnotations}from"./useSelectedAnnotations";export{default as useAnnotationPositioning}from"./useAnnotationPositioning";export{default as useSetAnnotation}from"./useSetAnnotation";export{default as useSelectTool}from"./useSelectTool";export{default as useTextAnnotationEditing}from"./useTextAnnotationEditing";export{default as useImageScaled}from"./useImageScaled";export{default as useUpdateState}from"./useUpdateState";export{default as useMapDimensions}from"./useMapDimensions";export{default as useManageHistoryState}from"./useManageHistoryState";export{default as useAnnotationOrdering}from"./useAnnotationOrdering"; |
@@ -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","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}),!0)},[]),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; | ||
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=["id","x","y","width","height","radius","radiusX","radiusY","points","image","originalImage","text","scaleX","scaleY","rotation","place","gravity","order"],_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,useUpdateEffect}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=null===(a=g[i[0]])||void 0===a?void 0:a.name,n=_objectSpread(_objectSpread({},j.annotationsCommon),j[b.name||m]),o=useState(function(){return _objectSpread(_objectSpread(_objectSpread({},n),b),m===b.name&&g[i[0]])}),p=_slicedToArray(o,2),q=p[0],r=p[1],s=useRef(),t=null===f||void 0===f?void 0:f.getStage(),u=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}),!0)},[]),v=useDebouncedCallback(function(a){r(function(b){return _objectSpread(_objectSpread({},b),{},{shouldSave:!1,neverSave:!1},"function"==typeof a?a(b):a)})},15),w=useCallback(function(a,c){if(a.name===c){var d=a.id,e=a.x,f=a.y,g=a.width,h=a.height,i=a.radius,j=a.radiusX,k=a.radiusY,l=a.points,m=a.image,o=a.originalImage,p=a.text,q=a.scaleX,r=a.scaleY,s=a.rotation,t=a.place,u=a.gravity,v=a.order,w=_objectWithoutProperties(a,_excluded2);return _objectSpread(_objectSpread(_objectSpread({},n),b),w)}return _objectSpread(_objectSpread({},n),b)},[n,b]),x=useCallback(function(a){r(function(c){var d=w(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=q.name&&q.name!==k;a&&l(q.name,!0)},[q.name]),useUpdateEffect(function(){var a=q.shouldSave,b=q.neverSave,c=_objectWithoutProperties(q,_excluded3),d=1===i.length&&g[i[0]];!b&&(a||d)&&u(_objectSpread(_objectSpread({},c),{},{id:a?c.id:d.id}))},[q]),useUpdateEffect(function(){setTimeout(function(){1===i.length?(s.current=q,r(_objectSpread(_objectSpread({},g[i[0]]),{},{neverSave:!0}))):s.current&&(r(_objectSpread(_objectSpread({},s.current),{},{neverSave:!0})),s.current=null)})},[i,g]),useEffect(function(){var a=null;if(t&&c){var d=w(q,b.name);a=previewThenCallAnnotationAdding(t,_objectSpread(_objectSpread({},d),{},{name:b.name}),f,x)}return function(){a&&a()}},[t,q,f]),useMemo(function(){return[q,v,x]},[q,v,x])};export default useAnnotation; |
@@ -1,1 +0,1 @@ | ||
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _excluded=["isDesignState"];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{useReducer}from"react";import{REDO,RESET,UNDO}from"../actions";import extractCurrentDesignState from"../utils/extractCurrentDesignState";import isFunction from"../utils/isFunction";import emitCustomEvent from"../utils/emitCustomEvent";import{EVENTS}from"../utils/constants";var timeout,applyCallbackFn=function(a,b){timeout=setTimeout(function(){clearTimeout(timeout),isFunction(a)&&b&&a(b)})},useAppReducer=function(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},d=_objectSpread(_objectSpread({},b),{},{pastDesignStates:[],futureDesignStates:[],hasRedo:!1,hasUndo:!1});return useReducer(function undoRedoResetReducer(b,e){var f=a(b,e)||d;if([UNDO,REDO,RESET].includes(e.type)){var g;return e.type===UNDO&&(g=c.onUndo,emitCustomEvent(EVENTS.DESIGN_UNDO,f)),e.type===REDO&&(g=c.onRedo,emitCustomEvent(EVENTS.DESIGN_REDO,f)),e.type===RESET&&(g=c.onReset,emitCustomEvent(EVENTS.DESIGN_RESET,f)),emitCustomEvent(EVENTS.DESIGN_UPDATE,f),applyCallbackFn(c.onModify,f),applyCallbackFn(g,f),f}if(f.isDesignState){var h=extractCurrentDesignState(b),i=f.isDesignState,j=_objectWithoutProperties(f,_excluded),k=_objectSpread(_objectSpread({},j),{},{pastDesignStates:[h].concat(_toConsumableArray(b.pastDesignStates)),hasUndo:!0,hasRedo:!1,futureDesignStates:[],isResetted:!1,haveNotSavedChanges:!0});return emitCustomEvent(EVENTS.DESIGN_UPDATE,k),applyCallbackFn(c.onModify,k),k}return f},d)};export default useAppReducer; | ||
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _excluded=["isDesignState"];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{useReducer}from"react";import{REDO,RESET,UNDO}from"../actions";import extractCurrentDesignState from"../utils/extractCurrentDesignState";import isFunction from"../utils/isFunction";import emitCustomEvent from"../utils/emitCustomEvent";import{EVENTS}from"../utils/constants";var applyCallbackFn=function(a,b){setTimeout(function(){isFunction(a)&&b&&a(b)})},useAppReducer=function(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},d=_objectSpread(_objectSpread({},b),{},{pastDesignStates:[],futureDesignStates:[],hasRedo:!1,hasUndo:!1});return useReducer(function undoRedoResetReducer(b,e){var f=a(b,e)||d;if([UNDO,REDO,RESET].includes(e.type)){var g;return e.type===UNDO&&(g=c.onUndo,emitCustomEvent(EVENTS.DESIGN_UNDO,f)),e.type===REDO&&(g=c.onRedo,emitCustomEvent(EVENTS.DESIGN_REDO,f)),e.type===RESET&&(g=c.onReset,emitCustomEvent(EVENTS.DESIGN_RESET,f)),emitCustomEvent(EVENTS.DESIGN_UPDATE,f),applyCallbackFn(c.onModify,f),applyCallbackFn(g,f),f}if(f.isDesignState){var h=extractCurrentDesignState(b),i=f.isDesignState,j=_objectWithoutProperties(f,_excluded),k=_objectSpread(_objectSpread({},j),{},{pastDesignStates:[h].concat(_toConsumableArray(b.pastDesignStates)),hasUndo:!0,hasRedo:!1,futureDesignStates:[],isResetted:!1,haveNotSavedChanges:!0});return emitCustomEvent(EVENTS.DESIGN_UPDATE,k),applyCallbackFn(c.onModify,k),k}return f},d)};export default useAppReducer; |
@@ -1,1 +0,1 @@ | ||
import defaultConfig from"../context/defaultConfig";import getInitialAppState from"../context/getInitialAppState";var extractCurrentDesignState=function(a,b){var c=getInitialAppState(b?a:defaultConfig);return{imgSrc:a.imgSrc||c.imgSrc,finetunes:a.finetunes||c.finetunes,finetunesProps:a.finetunesProps||c.finetunesProps,filter:a.filter||c.filter,adjustments:a.adjustments||c.adjustments,annotations:a.annotations||c.annotations,resize:a.resize||c.resize,originalSource:a.originalSource||c.originalSource,presentOriginalSources:a.presentOriginalSources||c.presentOriginalSources,extra:a.extra||c.extra}};export default extractCurrentDesignState; | ||
import defaultConfig from"../context/defaultConfig";import getInitialAppState from"../context/getInitialAppState";var extractCurrentDesignState=function(a,b){var c=getInitialAppState(b?a:defaultConfig);return{imgSrc:a.imgSrc||c.imgSrc,finetunes:a.finetunes||c.finetunes,finetunesProps:a.finetunesProps||c.finetunesProps,filter:a.filter||c.filter,adjustments:a.adjustments||c.adjustments,annotationIds:a.annotationIds||c.annotationIds,annotations:a.annotations||c.annotations,resize:a.resize||c.resize,originalSource:a.originalSource||c.originalSource,presentOriginalSources:a.presentOriginalSources||c.presentOriginalSources,extra:a.extra||c.extra}};export default extractCurrentDesignState; |
{ | ||
"name": "react-filerobot-image-editor", | ||
"version": "5.0.0-beta.21", | ||
"version": "5.0.0-beta.22", | ||
"license": "MIT", | ||
@@ -46,3 +46,3 @@ "author": "Scaleflex", | ||
}, | ||
"gitHead": "ff0681c3ce0117834e6e3284ca0950ac951e81b1" | ||
"gitHead": "b8242f115f9648bc27f4244fbd03f24a09789d14" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
370904
349