f49fca67cf1b871e280fa2fcbbb576da.json
22.4 KB
{"ast":null,"code":"/**\r\n * @author NHN Ent. FE Development Team <dl_javascript@nhn.com>\r\n * @fileoverview Constants\r\n */\nimport { keyMirror } from './util';\n/**\r\n * Editor help features\r\n * @type {Array.<string>}\r\n */\n\nexport const HELP_MENUS = ['undo', 'redo', 'reset', 'delete', 'deleteAll'];\n/**\r\n * Filter name value map\r\n * @type {Object.<string, string>}\r\n */\n\nexport const FILTER_NAME_VALUE_MAP = {\n blur: 'blur',\n blocksize: 'pixelate'\n};\n/**\r\n * Fill type for shape\r\n * @type {Object.<string, string>}\r\n */\n\nexport const SHAPE_FILL_TYPE = {\n FILTER: 'filter',\n COLOR: 'color'\n};\n/**\r\n * Shape type list\r\n * @type {Array.<string>}\r\n */\n\nexport const SHAPE_TYPE = ['rect', 'circle', 'triangle'];\n/**\r\n * Component names\r\n * @type {Object.<string, string>}\r\n */\n\nexport const componentNames = keyMirror('IMAGE_LOADER', 'CROPPER', 'FLIP', 'ROTATION', 'FREE_DRAWING', 'LINE', 'TEXT', 'ICON', 'FILTER', 'SHAPE');\n/**\r\n * Shape default option\r\n * @type {Object}\r\n */\n\nexport const SHAPE_DEFAULT_OPTIONS = {\n lockSkewingX: true,\n lockSkewingY: true,\n bringForward: true,\n isRegular: false\n};\n/**\r\n * Cropzone default option\r\n * @type {Object}\r\n */\n\nexport const CROPZONE_DEFAULT_OPTIONS = {\n hasRotatingPoint: false,\n hasBorders: false,\n lockScalingFlip: true,\n lockRotation: true,\n lockSkewingX: true,\n lockSkewingY: true\n};\n/**\r\n * Command names\r\n * @type {Object.<string, string>}\r\n */\n\nexport const commandNames = {\n CLEAR_OBJECTS: 'clearObjects',\n LOAD_IMAGE: 'loadImage',\n FLIP_IMAGE: 'flip',\n ROTATE_IMAGE: 'rotate',\n ADD_OBJECT: 'addObject',\n REMOVE_OBJECT: 'removeObject',\n APPLY_FILTER: 'applyFilter',\n REMOVE_FILTER: 'removeFilter',\n ADD_ICON: 'addIcon',\n CHANGE_ICON_COLOR: 'changeIconColor',\n ADD_SHAPE: 'addShape',\n CHANGE_SHAPE: 'changeShape',\n ADD_TEXT: 'addText',\n CHANGE_TEXT: 'changeText',\n CHANGE_TEXT_STYLE: 'changeTextStyle',\n ADD_IMAGE_OBJECT: 'addImageObject',\n RESIZE_CANVAS_DIMENSION: 'resizeCanvasDimension',\n SET_OBJECT_PROPERTIES: 'setObjectProperties',\n SET_OBJECT_POSITION: 'setObjectPosition',\n CHANGE_SELECTION: 'changeSelection'\n};\n/**\r\n * Event names\r\n * @type {Object.<string, string>}\r\n */\n\nexport const eventNames = {\n OBJECT_ACTIVATED: 'objectActivated',\n OBJECT_MOVED: 'objectMoved',\n OBJECT_SCALED: 'objectScaled',\n OBJECT_CREATED: 'objectCreated',\n OBJECT_ROTATED: 'objectRotated',\n OBJECT_ADDED: 'objectAdded',\n OBJECT_MODIFIED: 'objectModified',\n TEXT_EDITING: 'textEditing',\n TEXT_CHANGED: 'textChanged',\n ICON_CREATE_RESIZE: 'iconCreateResize',\n ICON_CREATE_END: 'iconCreateEnd',\n ADD_TEXT: 'addText',\n ADD_OBJECT: 'addObject',\n ADD_OBJECT_AFTER: 'addObjectAfter',\n MOUSE_DOWN: 'mousedown',\n MOUSE_UP: 'mouseup',\n MOUSE_MOVE: 'mousemove',\n // UNDO/REDO Events\n REDO_STACK_CHANGED: 'redoStackChanged',\n UNDO_STACK_CHANGED: 'undoStackChanged',\n SELECTION_CLEARED: 'selectionCleared',\n SELECTION_CREATED: 'selectionCreated'\n};\n/**\r\n * Editor states\r\n * @type {Object.<string, string>}\r\n */\n\nexport const drawingModes = keyMirror('NORMAL', 'CROPPER', 'FREE_DRAWING', 'LINE_DRAWING', 'TEXT', 'SHAPE', 'ICON');\n/**\r\n * Shortcut key values\r\n * @type {Object.<string, number>}\r\n */\n\nexport const keyCodes = {\n Z: 90,\n Y: 89,\n C: 67,\n V: 86,\n SHIFT: 16,\n BACKSPACE: 8,\n DEL: 46,\n ARROW_DOWN: 40,\n ARROW_UP: 38\n};\n/**\r\n * Fabric object options\r\n * @type {Object.<string, Object>}\r\n */\n\nexport const fObjectOptions = {\n SELECTION_STYLE: {\n borderColor: 'red',\n cornerColor: 'green',\n cornerSize: 10,\n originX: 'center',\n originY: 'center',\n transparentCorners: false\n }\n};\n/**\r\n * Promise reject messages\r\n * @type {Object.<string, string>}\r\n */\n\nexport const rejectMessages = {\n addedObject: 'The object is already added.',\n flip: 'The flipX and flipY setting values are not changed.',\n invalidDrawingMode: 'This operation is not supported in the drawing mode.',\n invalidParameters: 'Invalid parameters.',\n isLock: 'The executing command state is locked.',\n loadImage: 'The background image is empty.',\n loadingImageFailed: 'Invalid image loaded.',\n noActiveObject: 'There is no active object.',\n noObject: 'The object is not in canvas.',\n redo: 'The promise of redo command is reject.',\n rotation: 'The current angle is same the old angle.',\n undo: 'The promise of undo command is reject.',\n unsupportedOperation: 'Unsupported operation.',\n unsupportedType: 'Unsupported object type.'\n};\n/**\r\n * Default icon menu svg path\r\n * @type {Object.<string, string>}\r\n */\n\nexport const defaultIconPath = {\n 'icon-arrow': 'M40 12V0l24 24-24 24V36H0V12h40z',\n 'icon-arrow-2': 'M49,32 H3 V22 h46 l-18,-18 h12 l23,23 L43,50 h-12 l18,-18 z ',\n 'icon-arrow-3': 'M43.349998,27 L17.354,53 H1.949999 l25.996,-26 L1.949999,1 h15.404 L43.349998,27 z ',\n 'icon-star': 'M35,54.557999 l-19.912001,10.468 l3.804,-22.172001 l-16.108,-15.7 l22.26,-3.236 L35,3.746 l9.956,20.172001 l22.26,3.236 l-16.108,15.7 l3.804,22.172001 z ',\n 'icon-star-2': 'M17,31.212 l-7.194,4.08 l-4.728,-6.83 l-8.234,0.524 l-1.328,-8.226 l-7.644,-3.14 l2.338,-7.992 l-5.54,-6.18 l5.54,-6.176 l-2.338,-7.994 l7.644,-3.138 l1.328,-8.226 l8.234,0.522 l4.728,-6.83 L17,-24.312 l7.194,-4.08 l4.728,6.83 l8.234,-0.522 l1.328,8.226 l7.644,3.14 l-2.338,7.992 l5.54,6.178 l-5.54,6.178 l2.338,7.992 l-7.644,3.14 l-1.328,8.226 l-8.234,-0.524 l-4.728,6.83 z ',\n 'icon-polygon': 'M3,31 L19,3 h32 l16,28 l-16,28 H19 z ',\n 'icon-location': 'M24 62C8 45.503 0 32.837 0 24 0 10.745 10.745 0 24 0s24 10.745 24 24c0 8.837-8 21.503-24 38zm0-28c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10z',\n 'icon-heart': 'M49.994999,91.349998 l-6.96,-6.333 C18.324001,62.606995 2.01,47.829002 2.01,29.690998 C2.01,14.912998 13.619999,3.299999 28.401001,3.299999 c8.349,0 16.362,5.859 21.594,12 c5.229,-6.141 13.242001,-12 21.591,-12 c14.778,0 26.390999,11.61 26.390999,26.390999 c0,18.138 -16.314001,32.916 -41.025002,55.374001 l-6.96,6.285 z ',\n 'icon-bubble': 'M44 48L34 58V48H12C5.373 48 0 42.627 0 36V12C0 5.373 5.373 0 12 0h40c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12h-8z'\n};\nexport const defaultRotateRangeValus = {\n realTimeEvent: true,\n min: -360,\n max: 360,\n value: 0\n};\nexport const defaultDrawRangeValus = {\n min: 5,\n max: 30,\n value: 12\n};\nexport const defaultShapeStrokeValus = {\n realTimeEvent: true,\n min: 2,\n max: 300,\n value: 3\n};\nexport const defaultTextRangeValus = {\n realTimeEvent: true,\n min: 10,\n max: 100,\n value: 50\n};\nexport const defaultFilterRangeValus = {\n tintOpacityRange: {\n realTimeEvent: true,\n min: 0,\n max: 1,\n value: 0.7,\n useDecimal: true\n },\n removewhiteDistanceRange: {\n realTimeEvent: true,\n min: 0,\n max: 1,\n value: 0.2,\n useDecimal: true\n },\n brightnessRange: {\n realTimeEvent: true,\n min: -1,\n max: 1,\n value: 0,\n useDecimal: true\n },\n noiseRange: {\n realTimeEvent: true,\n min: 0,\n max: 1000,\n value: 100\n },\n pixelateRange: {\n realTimeEvent: true,\n min: 2,\n max: 20,\n value: 4\n },\n colorfilterThresholeRange: {\n realTimeEvent: true,\n min: 0,\n max: 1,\n value: 0.2,\n useDecimal: true\n },\n blurFilterRange: {\n value: 0.1\n }\n};","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/src/js/consts.js"],"names":["keyMirror","HELP_MENUS","FILTER_NAME_VALUE_MAP","blur","blocksize","SHAPE_FILL_TYPE","FILTER","COLOR","SHAPE_TYPE","componentNames","SHAPE_DEFAULT_OPTIONS","lockSkewingX","lockSkewingY","bringForward","isRegular","CROPZONE_DEFAULT_OPTIONS","hasRotatingPoint","hasBorders","lockScalingFlip","lockRotation","commandNames","CLEAR_OBJECTS","LOAD_IMAGE","FLIP_IMAGE","ROTATE_IMAGE","ADD_OBJECT","REMOVE_OBJECT","APPLY_FILTER","REMOVE_FILTER","ADD_ICON","CHANGE_ICON_COLOR","ADD_SHAPE","CHANGE_SHAPE","ADD_TEXT","CHANGE_TEXT","CHANGE_TEXT_STYLE","ADD_IMAGE_OBJECT","RESIZE_CANVAS_DIMENSION","SET_OBJECT_PROPERTIES","SET_OBJECT_POSITION","CHANGE_SELECTION","eventNames","OBJECT_ACTIVATED","OBJECT_MOVED","OBJECT_SCALED","OBJECT_CREATED","OBJECT_ROTATED","OBJECT_ADDED","OBJECT_MODIFIED","TEXT_EDITING","TEXT_CHANGED","ICON_CREATE_RESIZE","ICON_CREATE_END","ADD_OBJECT_AFTER","MOUSE_DOWN","MOUSE_UP","MOUSE_MOVE","REDO_STACK_CHANGED","UNDO_STACK_CHANGED","SELECTION_CLEARED","SELECTION_CREATED","drawingModes","keyCodes","Z","Y","C","V","SHIFT","BACKSPACE","DEL","ARROW_DOWN","ARROW_UP","fObjectOptions","SELECTION_STYLE","borderColor","cornerColor","cornerSize","originX","originY","transparentCorners","rejectMessages","addedObject","flip","invalidDrawingMode","invalidParameters","isLock","loadImage","loadingImageFailed","noActiveObject","noObject","redo","rotation","undo","unsupportedOperation","unsupportedType","defaultIconPath","defaultRotateRangeValus","realTimeEvent","min","max","value","defaultDrawRangeValus","defaultShapeStrokeValus","defaultTextRangeValus","defaultFilterRangeValus","tintOpacityRange","useDecimal","removewhiteDistanceRange","brightnessRange","noiseRange","pixelateRange","colorfilterThresholeRange","blurFilterRange"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,QAA1B;AAEA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,UAAU,GAAG,CAAC,MAAD,EAAS,MAAT,EAAiB,OAAjB,EAA0B,QAA1B,EAAoC,WAApC,CAAnB;AAEP;AACA;AACA;AACA;;AACA,OAAO,MAAMC,qBAAqB,GAAG;AACnCC,EAAAA,IAAI,EAAE,MAD6B;AAEnCC,EAAAA,SAAS,EAAE;AAFwB,CAA9B;AAKP;AACA;AACA;AACA;;AACA,OAAO,MAAMC,eAAe,GAAG;AAC7BC,EAAAA,MAAM,EAAE,QADqB;AAE7BC,EAAAA,KAAK,EAAE;AAFsB,CAAxB;AAKP;AACA;AACA;AACA;;AACA,OAAO,MAAMC,UAAU,GAAG,CAAC,MAAD,EAAS,QAAT,EAAmB,UAAnB,CAAnB;AAEP;AACA;AACA;AACA;;AACA,OAAO,MAAMC,cAAc,GAAGT,SAAS,CACrC,cADqC,EAErC,SAFqC,EAGrC,MAHqC,EAIrC,UAJqC,EAKrC,cALqC,EAMrC,MANqC,EAOrC,MAPqC,EAQrC,MARqC,EASrC,QATqC,EAUrC,OAVqC,CAAhC;AAaP;AACA;AACA;AACA;;AACA,OAAO,MAAMU,qBAAqB,GAAG;AACnCC,EAAAA,YAAY,EAAE,IADqB;AAEnCC,EAAAA,YAAY,EAAE,IAFqB;AAGnCC,EAAAA,YAAY,EAAE,IAHqB;AAInCC,EAAAA,SAAS,EAAE;AAJwB,CAA9B;AAOP;AACA;AACA;AACA;;AACA,OAAO,MAAMC,wBAAwB,GAAG;AACtCC,EAAAA,gBAAgB,EAA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ADF;AAEbC,IAAAA,GAAG,EAAE,CAFQ;AAGbC,IAAAA,GAAG,EAAE,EAHQ;AAIbC,IAAAA,KAAK,EAAE;AAJM,GA5BsB;AAkCrCW,EAAAA,yBAAyB,EAAE;AACzBd,IAAAA,aAAa,EAAE,IADU;AAEzBC,IAAAA,GAAG,EAAE,CAFoB;AAGzBC,IAAAA,GAAG,EAAE,CAHoB;AAIzBC,IAAAA,KAAK,EAAE,GAJkB;AAKzBM,IAAAA,UAAU,EAAE;AALa,GAlCU;AAyCrCM,EAAAA,eAAe,EAAE;AACfZ,IAAAA,KAAK,EAAE;AADQ;AAzCoB,CAAhC","sourcesContent":["/**\r\n * @author NHN Ent. FE Development Team <dl_javascript@nhn.com>\r\n * @fileoverview Constants\r\n */\r\nimport { keyMirror } from './util';\r\n\r\n/**\r\n * Editor help features\r\n * @type {Array.<string>}\r\n */\r\nexport const HELP_MENUS = ['undo', 'redo', 'reset', 'delete', 'deleteAll'];\r\n\r\n/**\r\n * Filter name value map\r\n * @type {Object.<string, string>}\r\n */\r\nexport const FILTER_NAME_VALUE_MAP = {\r\n blur: 'blur',\r\n blocksize: 'pixelate',\r\n};\r\n\r\n/**\r\n * Fill type for shape\r\n * @type {Object.<string, string>}\r\n */\r\nexport const SHAPE_FILL_TYPE = {\r\n FILTER: 'filter',\r\n COLOR: 'color',\r\n};\r\n\r\n/**\r\n * Shape type list\r\n * @type {Array.<string>}\r\n */\r\nexport const SHAPE_TYPE = ['rect', 'circle', 'triangle'];\r\n\r\n/**\r\n * Component names\r\n * @type {Object.<string, string>}\r\n */\r\nexport const componentNames = keyMirror(\r\n 'IMAGE_LOADER',\r\n 'CROPPER',\r\n 'FLIP',\r\n 'ROTATION',\r\n 'FREE_DRAWING',\r\n 'LINE',\r\n 'TEXT',\r\n 'ICON',\r\n 'FILTER',\r\n 'SHAPE'\r\n);\r\n\r\n/**\r\n * Shape default option\r\n * @type {Object}\r\n */\r\nexport const SHAPE_DEFAULT_OPTIONS = {\r\n lockSkewingX: true,\r\n lockSkewingY: true,\r\n bringForward: true,\r\n isRegular: false,\r\n};\r\n\r\n/**\r\n * Cropzone default option\r\n * @type {Object}\r\n */\r\nexport const CROPZONE_DEFAULT_OPTIONS = {\r\n hasRotatingPoint: false,\r\n hasBorders: false,\r\n lockScalingFlip: true,\r\n lockRotation: true,\r\n lockSkewingX: true,\r\n lockSkewingY: true,\r\n};\r\n\r\n/**\r\n * Command names\r\n * @type {Object.<string, string>}\r\n */\r\nexport const commandNames = {\r\n CLEAR_OBJECTS: 'clearObjects',\r\n LOAD_IMAGE: 'loadImage',\r\n FLIP_IMAGE: 'flip',\r\n ROTATE_IMAGE: 'rotate',\r\n ADD_OBJECT: 'addObject',\r\n REMOVE_OBJECT: 'removeObject',\r\n APPLY_FILTER: 'applyFilter',\r\n REMOVE_FILTER: 'removeFilter',\r\n ADD_ICON: 'addIcon',\r\n CHANGE_ICON_COLOR: 'changeIconColor',\r\n ADD_SHAPE: 'addShape',\r\n CHANGE_SHAPE: 'changeShape',\r\n ADD_TEXT: 'addText',\r\n CHANGE_TEXT: 'changeText',\r\n CHANGE_TEXT_STYLE: 'changeTextStyle',\r\n ADD_IMAGE_OBJECT: 'addImageObject',\r\n RESIZE_CANVAS_DIMENSION: 'resizeCanvasDimension',\r\n SET_OBJECT_PROPERTIES: 'setObjectProperties',\r\n SET_OBJECT_POSITION: 'setObjectPosition',\r\n CHANGE_SELECTION: 'changeSelection',\r\n};\r\n\r\n/**\r\n * Event names\r\n * @type {Object.<string, string>}\r\n */\r\nexport const eventNames = {\r\n OBJECT_ACTIVATED: 'objectActivated',\r\n OBJECT_MOVED: 'objectMoved',\r\n OBJECT_SCALED: 'objectScaled',\r\n OBJECT_CREATED: 'objectCreated',\r\n OBJECT_ROTATED: 'objectRotated',\r\n OBJECT_ADDED: 'objectAdded',\r\n OBJECT_MODIFIED: 'objectModified',\r\n TEXT_EDITING: 'textEditing',\r\n TEXT_CHANGED: 'textChanged',\r\n ICON_CREATE_RESIZE: 'iconCreateResize',\r\n ICON_CREATE_END: 'iconCreateEnd',\r\n ADD_TEXT: 'addText',\r\n ADD_OBJECT: 'addObject',\r\n ADD_OBJECT_AFTER: 'addObjectAfter',\r\n MOUSE_DOWN: 'mousedown',\r\n MOUSE_UP: 'mouseup',\r\n MOUSE_MOVE: 'mousemove',\r\n // UNDO/REDO Events\r\n REDO_STACK_CHANGED: 'redoStackChanged',\r\n UNDO_STACK_CHANGED: 'undoStackChanged',\r\n SELECTION_CLEARED: 'selectionCleared',\r\n SELECTION_CREATED: 'selectionCreated',\r\n};\r\n\r\n/**\r\n * Editor states\r\n * @type {Object.<string, string>}\r\n */\r\nexport const drawingModes = keyMirror(\r\n 'NORMAL',\r\n 'CROPPER',\r\n 'FREE_DRAWING',\r\n 'LINE_DRAWING',\r\n 'TEXT',\r\n 'SHAPE',\r\n 'ICON'\r\n);\r\n\r\n/**\r\n * Shortcut key values\r\n * @type {Object.<string, number>}\r\n */\r\nexport const keyCodes = {\r\n Z: 90,\r\n Y: 89,\r\n C: 67,\r\n V: 86,\r\n SHIFT: 16,\r\n BACKSPACE: 8,\r\n DEL: 46,\r\n ARROW_DOWN: 40,\r\n ARROW_UP: 38,\r\n};\r\n\r\n/**\r\n * Fabric object options\r\n * @type {Object.<string, Object>}\r\n */\r\nexport const fObjectOptions = {\r\n SELECTION_STYLE: {\r\n borderColor: 'red',\r\n cornerColor: 'green',\r\n cornerSize: 10,\r\n originX: 'center',\r\n originY: 'center',\r\n transparentCorners: false,\r\n },\r\n};\r\n\r\n/**\r\n * Promise reject messages\r\n * @type {Object.<string, string>}\r\n */\r\nexport const rejectMessages = {\r\n addedObject: 'The object is already added.',\r\n flip: 'The flipX and flipY setting values are not changed.',\r\n invalidDrawingMode: 'This operation is not supported in the drawing mode.',\r\n invalidParameters: 'Invalid parameters.',\r\n isLock: 'The executing command state is locked.',\r\n loadImage: 'The background image is empty.',\r\n loadingImageFailed: 'Invalid image loaded.',\r\n noActiveObject: 'There is no active object.',\r\n noObject: 'The object is not in canvas.',\r\n redo: 'The promise of redo command is reject.',\r\n rotation: 'The current angle is same the old angle.',\r\n undo: 'The promise of undo command is reject.',\r\n unsupportedOperation: 'Unsupported operation.',\r\n unsupportedType: 'Unsupported object type.',\r\n};\r\n\r\n/**\r\n * Default icon menu svg path\r\n * @type {Object.<string, string>}\r\n */\r\nexport const defaultIconPath = {\r\n 'icon-arrow': 'M40 12V0l24 24-24 24V36H0V12h40z',\r\n 'icon-arrow-2': 'M49,32 H3 V22 h46 l-18,-18 h12 l23,23 L43,50 h-12 l18,-18 z ',\r\n 'icon-arrow-3':\r\n 'M43.349998,27 L17.354,53 H1.949999 l25.996,-26 L1.949999,1 h15.404 L43.349998,27 z ',\r\n 'icon-star':\r\n 'M35,54.557999 l-19.912001,10.468 l3.804,-22.172001 l-16.108,-15.7 l22.26,-3.236 L35,3.746 l9.956,20.172001 l22.26,3.236 l-16.108,15.7 l3.804,22.172001 z ',\r\n 'icon-star-2':\r\n 'M17,31.212 l-7.194,4.08 l-4.728,-6.83 l-8.234,0.524 l-1.328,-8.226 l-7.644,-3.14 l2.338,-7.992 l-5.54,-6.18 l5.54,-6.176 l-2.338,-7.994 l7.644,-3.138 l1.328,-8.226 l8.234,0.522 l4.728,-6.83 L17,-24.312 l7.194,-4.08 l4.728,6.83 l8.234,-0.522 l1.328,8.226 l7.644,3.14 l-2.338,7.992 l5.54,6.178 l-5.54,6.178 l2.338,7.992 l-7.644,3.14 l-1.328,8.226 l-8.234,-0.524 l-4.728,6.83 z ',\r\n 'icon-polygon': 'M3,31 L19,3 h32 l16,28 l-16,28 H19 z ',\r\n 'icon-location':\r\n 'M24 62C8 45.503 0 32.837 0 24 0 10.745 10.745 0 24 0s24 10.745 24 24c0 8.837-8 21.503-24 38zm0-28c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10z',\r\n 'icon-heart':\r\n 'M49.994999,91.349998 l-6.96,-6.333 C18.324001,62.606995 2.01,47.829002 2.01,29.690998 C2.01,14.912998 13.619999,3.299999 28.401001,3.299999 c8.349,0 16.362,5.859 21.594,12 c5.229,-6.141 13.242001,-12 21.591,-12 c14.778,0 26.390999,11.61 26.390999,26.390999 c0,18.138 -16.314001,32.916 -41.025002,55.374001 l-6.96,6.285 z ',\r\n 'icon-bubble':\r\n 'M44 48L34 58V48H12C5.373 48 0 42.627 0 36V12C0 5.373 5.373 0 12 0h40c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12h-8z',\r\n};\r\n\r\nexport const defaultRotateRangeValus = {\r\n realTimeEvent: true,\r\n min: -360,\r\n max: 360,\r\n value: 0,\r\n};\r\n\r\nexport const defaultDrawRangeValus = {\r\n min: 5,\r\n max: 30,\r\n value: 12,\r\n};\r\n\r\nexport const defaultShapeStrokeValus = {\r\n realTimeEvent: true,\r\n min: 2,\r\n max: 300,\r\n value: 3,\r\n};\r\n\r\nexport const defaultTextRangeValus = {\r\n realTimeEvent: true,\r\n min: 10,\r\n max: 100,\r\n value: 50,\r\n};\r\n\r\nexport const defaultFilterRangeValus = {\r\n tintOpacityRange: {\r\n realTimeEvent: true,\r\n min: 0,\r\n max: 1,\r\n value: 0.7,\r\n useDecimal: true,\r\n },\r\n removewhiteDistanceRange: {\r\n realTimeEvent: true,\r\n min: 0,\r\n max: 1,\r\n value: 0.2,\r\n useDecimal: true,\r\n },\r\n brightnessRange: {\r\n realTimeEvent: true,\r\n min: -1,\r\n max: 1,\r\n value: 0,\r\n useDecimal: true,\r\n },\r\n noiseRange: {\r\n realTimeEvent: true,\r\n min: 0,\r\n max: 1000,\r\n value: 100,\r\n },\r\n pixelateRange: {\r\n realTimeEvent: true,\r\n min: 2,\r\n max: 20,\r\n value: 4,\r\n },\r\n colorfilterThresholeRange: {\r\n realTimeEvent: true,\r\n min: 0,\r\n max: 1,\r\n value: 0.2,\r\n useDecimal: true,\r\n },\r\n blurFilterRange: {\r\n value: 0.1,\r\n },\r\n};\r\n"]},"metadata":{},"sourceType":"module"}