Socket
Socket
Sign inDemoInstall

vue-annotator

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-annotator - npm Package Compare versions

Comparing version 0.13.1 to 0.13.2

2

dist/index.js

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

module.exports=function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=5)}([function(t,e){t.exports=require("interactjs")},function(t,e){t.exports=require("svg.js")},function(t,e){t.exports=require("svg.select.js")},function(t,e,n){"use strict";var r=n(0),i=n.n(r),o=n(1),a=n.n(o),s=n(2),c=(n.n(s),n(4)),l=(n.n(c),n(10)),d=n(11),u=n(12),h=n(13);e.a={name:"Annotator",mixins:[l.a,d.a,u.a,h.a],props:{width:{type:[Number,String],validator:function(t){return!isNaN(t)||void 0===t}},height:{type:[Number,String],validator:function(t){return!isNaN(t)||void 0===t}},drawing:Boolean,noInteract:Boolean,noSelect:Boolean},watch:{drawing:function(t){this.enableDrawing(t)},noInteract:function(t){this.enableInteraction(t)},noSelect:function(t){this.enableSelection(t)}},data:function(){return{w:parseInt(this.width)||0,h:parseInt(this.height)||0,background:a.a.adopt(this.$refs.bgSvg),annotations:a.a.adopt(this.$refs.annotations)}},methods:{},updated:function(){this.w=parseInt(this.width)||this.$refs.bg.scrollWidth,this.h=parseInt(this.height)||this.$refs.bg.scrollHeight},beforeMount:function(){var t=this;if(this.$slots.default)var e=this.$slots.default.filter(function(t){return["img","video","audio","picture"].includes(t.tag)}),n=setInterval(function(){e.every(function(t){return t.elm.complete})&&t.$refs.annotations&&(clearInterval(n),t.$forceUpdate())},43.48);else this.$forceUpdate()},created:function(){var t=this;this.observer=new MutationObserver(function(e){var n=!0,r=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var c=a.value;if("childList"===c.type){var l=!0,d=!1,u=void 0;try{for(var h,f=c.addedNodes[Symbol.iterator]();!(l=(h=f.next()).done);l=!0){var g=h.value;t.makeInteractable(g,t.drawing),t.makeSelectable(g)}}catch(t){d=!0,u=t}finally{try{!l&&f.return&&f.return()}finally{if(d)throw u}}var v=!0,p=!1,m=void 0;try{for(var b,y=c.removedNodes[Symbol.iterator]();!(v=(b=y.next()).done);v=!0){var w=b.value;i()(w).unset()}}catch(t){p=!0,m=t}finally{try{!v&&y.return&&y.return()}finally{if(p)throw m}}}}}catch(t){r=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(r)throw o}}})},mounted:function(){var t=this;this.$nextTick(function(){t.background=a.a.adopt(t.$refs.bgSvg),t.annotations=a.a.adopt(t.$refs.annotations),t.enableSelection(!t.noSelect),t.enableInteraction(!t.noInteract),t.enableDrawing(t.drawing),t.observer.observe(t.annotations.node,{childList:!0})})}}},function(t,e){t.exports=require("svg.draw.js")},function(t,e,n){t.exports=n(6)},function(t,e,n){"use strict";function r(t){n(7),n(8)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=n(14),a=n(9),s=r,c=a(i.a,o.a,!1,s,"data-v-bdd73076",null);e.default=c.exports},function(t,e){},function(t,e){},function(t,e){t.exports=function(t,e,n,r,i,o){var a,s=t=t||{},c=typeof t.default;"object"!==c&&"function"!==c||(a=t,s=t.default);var l="function"==typeof s?s.options:s;e&&(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0),n&&(l.functional=!0),i&&(l._scopeId=i);var d;if(o?(d=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},l._ssrRegister=d):r&&(d=r),d){var u=l.functional,h=u?l.render:l.beforeCreate;u?(l._injectStyles=d,l.render=function(t,e){return d.call(e),h(t,e)}):l.beforeCreate=h?[].concat(h,d):[d]}return{esModule:a,exports:s,options:l}}},function(t,e,n){"use strict";var r=n(0),i=n.n(r),o=n(1),a=n.n(o);e.a={props:{inertia:Boolean,grid:{type:[Array,Number],validator:function(t){return 2===t.length&&t.every(function(t){return"number"==typeof t})||"number"==typeof t}},minSize:{type:[Array,Number],default:function(){return 10},validator:function(t){return 2===t.length&&t.every(function(t){return"number"==typeof t})||"number"==typeof t}},multipleSelect:Boolean},methods:{makeInteractable:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=a.a.adopt(this.$refs.svg);return i()(t).draggable({inertia:this.inertia,snap:{targets:[this.gridTarget]},restrict:{restriction:"svg",elementRect:{top:0,left:0,bottom:1,right:1}},autoScroll:!0,onend:function(t){return e.$emit("move-end",a.a.adopt(t.target))},onmove:function(t){return e.$emit("move",a.a.adopt(t.target).dmove(t.dx,t.dy))}}).resizable({inertia:this.inertia,snap:{targets:[this.gridTarget]},edges:{left:!0,right:!0,bottom:!0,top:!0},restrictEdges:n?void 0:{outer:"svg",elementRect:{top:0,left:0,bottom:1,right:1}},autoScroll:!0,restrictSize:n?void 0:{min:{width:this.minWidth,height:this.minHeight}},onend:function(t){return e.$emit("resize-end",a.a.adopt(t.target))},onmove:function(t){var n=a.a.adopt(t.target),i=n.x()+t.deltaRect.left,o=n.y()+t.deltaRect.top;switch(n.type){case"ellipse":n.move(i+t.deltaRect.width/2,o+t.deltaRect.height/2),n.size(t.rect.width,t.rect.height);break;case"circle":var s=function(e,n){return 0!==e&&0!==n&&Math.sign(e)!==Math.sign(n)?0:Math.sign(e+n)*Math.hypot(t.deltaRect.width,t.deltaRect.height)}(t.deltaRect.width,t.deltaRect.height),c=function(t){return 0!==s?t/2:0},l=(e.minWidth+e.minHeight)/2;t.rect.width>l&&t.rect.height>l?(i+=c(t.deltaRect.width),o+=c(t.deltaRect.height)):(i=n.x(),o=n.y());var d=2*n.attr("r")+s;d=Math.max(d,l);var u=i+Math.abs(t.deltaRect.width)>=0&&o+Math.abs(t.deltaRect.height)>=0;i+d<=r.width()+Math.abs(t.deltaRect.width)&&o+d<=r.height()+Math.abs(t.deltaRect.height)&&u&&(n.move(i,o),n.size(d));break;default:n.move(i,o),n.size(t.rect.width,t.rect.height)}e.$emit("resize",n)}})},enableInteraction:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.$refs.annotations.hasChildNodes()&&this.$refs.annotations.childNodes.forEach(function(n,r){e?t.makeInteractable(n):i()(n).draggable(!1).resizable(!1)})}},mounted:function(){var t=this;this.$on("draw-end",function(e){return t.makeInteractable(e.node,!1)})},beforeDestroy:function(){this.$off("draw-end")},computed:{gridTarget:function(){return this.grid?i.a.createSnapGrid({x:this.grid[0],y:this.grid[1]}):null},minWidth:function(){return"number"==typeof this.minSize?this.minSize:this.minSize[0]},minHeight:function(){return"number"==typeof this.minSize?this.minSize:this.minSize[1]}}}},function(t,e,n){"use strict";var r=n(0),i=n.n(r),o=n(1),a=n.n(o),s=n(4);n.n(s);e.a={data:function(){return{drawingable:void 0}},methods:{$_haveVNodeMoreThan:function(t,e,n){e&&e.length>1&&n()},enableDrawing:function(){var t=this;if(arguments.length>0&&void 0!==arguments[0]&&!arguments[0]||this.drawingable&&i.a.isSet(this.background.node))this.background.style("cursor","default"),this.drawingable&&this.drawingable.unset();else{this.$_haveVNodeMoreThan(1,this.$slots.drawing,function(){throw Error('only 1 slot="drawing" allowed, you have '+t.$slots.drawing.length+' slot="drawing"')}),this.background.style("cursor","crosshair");var e=void 0,n={};this.drawingable=i()(this.background.node).styleCursor(!1).draggable({inertia:this.inertia,snap:{targets:[this.gridTarget]},restrict:"svg",autoScroll:!0,onstart:function(r){e=a.a.adopt(t.$slots.drawing[0].elm).clone(),n.oncontextmenu=e.attr("oncontextmenu"),e.draw("point",r).style("cursor","crosshair").addClass("foreground").attr("oncontextmenu","return false;").on("contextmenu",function(n){e.draw("cancel").data("canceled",!0),t.$emit("draw-cancel")})},onmove:function(n){return t.$emit("draw",e.draw("update",n))},onend:function(r){e.data("canceled")?e.off("contextmenu").data("canceled",null):(e.draw("stop",r).style("cursor",null).removeClass("foreground").toParent(t.annotations).off("contextmenu"),t.$forceUpdate(),t.$emit("draw-end",e));for(var i in n)e.attr(i,n[i]||null)}})}}}}},function(t,e,n){"use strict";function r(t){return 0===t?"left":1===t?"middle":2===t?"right":""}var i=n(0),o=n.n(i),a=n(1),s=n.n(a),c=n(2);n.n(c);e.a={props:{multipleSelect:Boolean,mouseSelect:{default:"",type:String}},methods:{makeSelectable:function(t){var e=this,n=s.a.adopt(t),i=function(t){var e=function(e){return t.remember("_selectHandler").nested.select(e).members.forEach(function(t){return t.remove()})};e(".svg_select_boundingRect"),["circle","ellipse"].includes(t.type)?(e(".svg_select_points_lt"),e(".svg_select_points_rt"),e(".svg_select_points_rb"),e(".svg_select_points_lb")):"path"===t.type&&t.remember("_selectHandler").nested.remove()},a=function(){e.$refs.annotations.childNodes.forEach(function(n){if(!t.isSameNode(n)){var r=s.a.adopt(n);r.selectize(!1,{deepSelect:["g","foreignObject","polygon"].includes(r.type)}),r.data("selected")&&(r.data("selected",null),e.$emit("unselect",r))}})},c=function(t){if(e.mouseSelect===r(t.button)){var o=n.selectize({deepSelect:!0,rotationPoint:!1,points:!0}).data("selected",!0);e.$emit("select",o),""!==r(t.button)&&e.$emit("select-"+r(t.button),o),i(o),e.multipleSelect||a()}};return o()(t).on("tap",c)},enableSelection:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.$refs.annotations.hasChildNodes()&&this.$refs.annotations.childNodes.forEach(function(n,r){e?(t.makeSelectable(n),t.background.on("click",t.unselectAll)):(o()(n).selection.off("tap"),t.background.fire("click"),t.background.off("click"))})},unselectAll:function(){var t=this;this.$refs.annotations.hasChildNodes()&&this.$refs.annotations.childNodes.forEach(function(e,n){var r=s.a.adopt(e);r.data("selected")&&(r.selectize(!1,{deepSelect:["g","foreignObject","polygon"].includes(r.type)}),r.data("selected",null),t.$emit("unselect",r))})}}}},function(t,e,n){"use strict";var r=n(0),i=n.n(r),o=n(1),a=n.n(o),s=n(2);n.n(s);e.a={props:{delete:[Boolean]},watch:{delete:function(t){t&&this.triggerDelete()}},methods:{triggerDelete:function(){var t=this;this.$refs.annotations.childNodes.forEach(function(e){var n=a.a.adopt(e);n.data("selected")&&(i()(e).unset(),n.selectize(!1,{deepSelect:["g","foreignObject","polygon"].includes(n.type)}),t.$nextTick(function(){return n.remove()}))}),this.$emit("update:delete",!1)}}}},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("svg",{ref:"svg",attrs:{width:t.w,height:t.h}},[n("foreignObject",{ref:"bgSvg",attrs:{oncontextmenu:"return false;",x:"0",y:"0",width:t.w,height:t.h}},[n("div",{ref:"bg",staticClass:"background"},[t._t("default")],2)]),t._v(" "),n("g",{ref:"annotations",staticClass:"foreground"},[t._t("annotation")],2),t._v(" "),t._t("drawing")],2)},i=[],o={render:r,staticRenderFns:i};e.a=o}]);
module.exports=function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=5)}([function(t,e){t.exports=require("interactjs")},function(t,e){t.exports=require("svg.js")},function(t,e){t.exports=require("svg.select.js")},function(t,e,n){"use strict";var r=n(0),i=n.n(r),o=n(1),a=n.n(o),s=n(2),c=(n.n(s),n(4)),l=(n.n(c),n(10)),d=n(11),u=n(12),h=n(13);e.a={name:"Annotator",mixins:[l.a,d.a,u.a,h.a],props:{width:{type:[Number,String],validator:function(t){return!isNaN(t)||void 0===t}},height:{type:[Number,String],validator:function(t){return!isNaN(t)||void 0===t}},drawing:Boolean,noInteract:Boolean,noSelect:Boolean},watch:{drawing:function(t){this.enableDrawing(t)},noInteract:function(t){this.enableInteraction(!t)},noSelect:function(t){this.enableSelection(!t)}},data:function(){return{w:parseInt(this.width)||0,h:parseInt(this.height)||0,background:a.a.adopt(this.$refs.bgSvg),annotations:a.a.adopt(this.$refs.annotations)}},methods:{},updated:function(){this.w=parseInt(this.width)||this.$refs.bg.scrollWidth,this.h=parseInt(this.height)||this.$refs.bg.scrollHeight},beforeMount:function(){var t=this;if(this.$slots.default)var e=this.$slots.default.filter(function(t){return["img","video","audio","picture"].includes(t.tag)}),n=setInterval(function(){e.every(function(t){return t.elm.complete})&&t.$refs.annotations&&(clearInterval(n),t.$forceUpdate())},43.48);else this.$forceUpdate()},created:function(){var t=this;this.observer=new MutationObserver(function(e){var n=!0,r=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var c=a.value;if("childList"===c.type){var l=!0,d=!1,u=void 0;try{for(var h,f=c.addedNodes[Symbol.iterator]();!(l=(h=f.next()).done);l=!0){var g=h.value;t.makeInteractable(g,t.drawing),t.makeSelectable(g)}}catch(t){d=!0,u=t}finally{try{!l&&f.return&&f.return()}finally{if(d)throw u}}var v=!0,p=!1,m=void 0;try{for(var b,y=c.removedNodes[Symbol.iterator]();!(v=(b=y.next()).done);v=!0){var w=b.value;i()(w).unset()}}catch(t){p=!0,m=t}finally{try{!v&&y.return&&y.return()}finally{if(p)throw m}}}}}catch(t){r=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(r)throw o}}})},mounted:function(){var t=this;this.background=a.a.adopt(this.$refs.bgSvg),this.annotations=a.a.adopt(this.$refs.annotations),this.$nextTick(function(){t.enableSelection(!t.noSelect),t.enableInteraction(!t.noInteract),t.enableDrawing(t.drawing),t.observer.observe(t.annotations.node,{childList:!0})})}}},function(t,e){t.exports=require("svg.draw.js")},function(t,e,n){t.exports=n(6)},function(t,e,n){"use strict";function r(t){n(7),n(8)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=n(14),a=n(9),s=r,c=a(i.a,o.a,!1,s,"data-v-3dcab025",null);e.default=c.exports},function(t,e){},function(t,e){},function(t,e){t.exports=function(t,e,n,r,i,o){var a,s=t=t||{},c=typeof t.default;"object"!==c&&"function"!==c||(a=t,s=t.default);var l="function"==typeof s?s.options:s;e&&(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0),n&&(l.functional=!0),i&&(l._scopeId=i);var d;if(o?(d=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},l._ssrRegister=d):r&&(d=r),d){var u=l.functional,h=u?l.render:l.beforeCreate;u?(l._injectStyles=d,l.render=function(t,e){return d.call(e),h(t,e)}):l.beforeCreate=h?[].concat(h,d):[d]}return{esModule:a,exports:s,options:l}}},function(t,e,n){"use strict";var r=n(0),i=n.n(r),o=n(1),a=n.n(o);e.a={props:{inertia:Boolean,grid:{type:[Array,Number],validator:function(t){return 2===t.length&&t.every(function(t){return"number"==typeof t})||"number"==typeof t}},minSize:{type:[Array,Number],default:function(){return 10},validator:function(t){return 2===t.length&&t.every(function(t){return"number"==typeof t})||"number"==typeof t}},multipleSelect:Boolean},methods:{makeInteractable:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=a.a.adopt(this.$refs.svg);return i()(t).draggable({inertia:this.inertia,snap:{targets:[this.gridTarget]},restrict:{restriction:"svg",elementRect:{top:0,left:0,bottom:1,right:1}},autoScroll:!0,onend:function(t){return e.$emit("move-end",a.a.adopt(t.target))},onmove:function(t){return e.$emit("move",a.a.adopt(t.target).dmove(t.dx,t.dy))}}).resizable({inertia:this.inertia,snap:{targets:[this.gridTarget]},edges:{left:!0,right:!0,bottom:!0,top:!0},restrictEdges:n?void 0:{outer:"svg",elementRect:{top:0,left:0,bottom:1,right:1}},autoScroll:!0,restrictSize:n?void 0:{min:{width:this.minWidth,height:this.minHeight}},onend:function(t){return e.$emit("resize-end",a.a.adopt(t.target))},onmove:function(t){var n=a.a.adopt(t.target),i=n.x()+t.deltaRect.left,o=n.y()+t.deltaRect.top;switch(n.type){case"ellipse":n.move(i+t.deltaRect.width/2,o+t.deltaRect.height/2),n.size(t.rect.width,t.rect.height);break;case"circle":var s=function(e,n){return 0!==e&&0!==n&&Math.sign(e)!==Math.sign(n)?0:Math.sign(e+n)*Math.hypot(t.deltaRect.width,t.deltaRect.height)}(t.deltaRect.width,t.deltaRect.height),c=function(t){return 0!==s?t/2:0},l=(e.minWidth+e.minHeight)/2;t.rect.width>l&&t.rect.height>l?(i+=c(t.deltaRect.width),o+=c(t.deltaRect.height)):(i=n.x(),o=n.y());var d=2*n.attr("r")+s;d=Math.max(d,l);var u=i+Math.abs(t.deltaRect.width)>=0&&o+Math.abs(t.deltaRect.height)>=0;i+d<=r.width()+Math.abs(t.deltaRect.width)&&o+d<=r.height()+Math.abs(t.deltaRect.height)&&u&&(n.move(i,o),n.size(d));break;default:n.move(i,o),n.size(t.rect.width,t.rect.height)}e.$emit("resize",n)}})},enableInteraction:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.$refs.annotations.hasChildNodes()&&this.$refs.annotations.childNodes.forEach(function(n,r){e?t.makeInteractable(n):i()(n).draggable(!1).resizable(!1)})}},mounted:function(){var t=this;this.$on("draw-end",function(e){return t.makeInteractable(e.node,!1)})},beforeDestroy:function(){this.$off("draw-end")},computed:{gridTarget:function(){return this.grid?i.a.createSnapGrid({x:this.grid[0],y:this.grid[1]}):null},minWidth:function(){return"number"==typeof this.minSize?this.minSize:this.minSize[0]},minHeight:function(){return"number"==typeof this.minSize?this.minSize:this.minSize[1]}}}},function(t,e,n){"use strict";var r=n(0),i=n.n(r),o=n(1),a=n.n(o),s=n(4);n.n(s);e.a={data:function(){return{drawingable:void 0}},methods:{$_haveVNodeMoreThan:function(t,e,n){e&&e.length>1&&n()},enableDrawing:function(){var t=this;if(arguments.length>0&&void 0!==arguments[0]&&!arguments[0]||this.drawingable&&i.a.isSet(this.background.node))this.background.style("cursor","default"),this.drawingable&&this.drawingable.unset();else{this.$_haveVNodeMoreThan(1,this.$slots.drawing,function(){throw Error('only 1 slot="drawing" allowed, you have '+t.$slots.drawing.length+' slot="drawing"')}),this.background.style("cursor","crosshair");var e=void 0,n={};this.drawingable=i()(this.background.node).styleCursor(!1).draggable({inertia:this.inertia,snap:{targets:[this.gridTarget]},restrict:"svg",autoScroll:!0,onstart:function(r){e=a.a.adopt(t.$slots.drawing[0].elm).clone(),n.oncontextmenu=e.attr("oncontextmenu"),e.draw("point",r).style("cursor","crosshair").addClass("foreground").attr("oncontextmenu","return false;").on("contextmenu",function(n){e.draw("cancel").data("canceled",!0),t.$emit("draw-cancel")})},onmove:function(n){return t.$emit("draw",e.draw("update",n))},onend:function(r){e.data("canceled")?e.off("contextmenu").data("canceled",null):(e.draw("stop",r).style("cursor",null).removeClass("foreground").toParent(t.annotations).off("contextmenu"),t.$forceUpdate(),t.$emit("draw-end",e));for(var i in n)e.attr(i,n[i]||null)}})}}}}},function(t,e,n){"use strict";function r(t){return 0===t?"left":1===t?"middle":2===t?"right":null}var i=n(0),o=n.n(i),a=n(1),s=n.n(a),c=n(2);n.n(c);e.a={props:{multipleSelect:Boolean,mouseSelect:{default:null,type:String}},methods:{makeSelectable:function(t){var e=this,n=s.a.adopt(t),i=function(t){var e=function(e){return t.remember("_selectHandler").nested.select(e).members.forEach(function(t){return t.remove()})};e(".svg_select_boundingRect"),["circle","ellipse"].includes(t.type)?(e(".svg_select_points_lt"),e(".svg_select_points_rt"),e(".svg_select_points_rb"),e(".svg_select_points_lb")):"path"===t.type&&t.remember("_selectHandler").nested.remove()},a=function(){e.$refs.annotations.childNodes.forEach(function(n){if(!t.isSameNode(n)){var r=s.a.adopt(n);r.selectize(!1,{deepSelect:["g","foreignObject","polygon"].includes(r.type)}),r.data("selected")&&(r.data("selected",null),e.$emit("unselect",r))}})},c=function(t){if(!e.mouseSelect||e.mouseSelect===r(t.button)||!r(t.button)){var o=n.selectize({deepSelect:!0,rotationPoint:!1,points:!0}).data("selected",!0);e.$emit("select",o),""!==r(t.button)&&e.$emit("select-"+r(t.button),o),i(o),e.multipleSelect||a()}};return o()(t).on("tap",c)},enableSelection:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.$refs.annotations.hasChildNodes()&&this.$refs.annotations.childNodes.forEach(function(n,r){e?(t.makeSelectable(n),t.background.on("click",t.unselectAll)):(o()(n).off("tap"),t.background.fire("click"),t.background.off("click"))})},unselectAll:function(){var t=this;this.$refs.annotations.hasChildNodes()&&this.$refs.annotations.childNodes.forEach(function(e,n){var r=s.a.adopt(e);r.data("selected")&&(r.selectize(!1,{deepSelect:["g","foreignObject","polygon"].includes(r.type)}),r.data("selected",null),t.$emit("unselect",r))})}}}},function(t,e,n){"use strict";var r=n(0),i=n.n(r),o=n(1),a=n.n(o),s=n(2);n.n(s);e.a={props:{delete:[Boolean]},watch:{delete:function(t){t&&this.triggerDelete()}},methods:{triggerDelete:function(){var t=this;this.$refs.annotations.childNodes.forEach(function(e){var n=a.a.adopt(e);n.data("selected")&&(i()(e).unset(),n.selectize(!1,{deepSelect:["g","foreignObject","polygon"].includes(n.type)}),t.$nextTick(function(){return n.remove()}))}),this.$emit("update:delete",!1)}}}},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("svg",{ref:"svg",attrs:{width:t.w,height:t.h}},[n("foreignObject",{ref:"bgSvg",attrs:{oncontextmenu:"return false;",x:"0",y:"0",width:t.w,height:t.h}},[n("div",{ref:"bg",staticClass:"background"},[t._t("default")],2)]),t._v(" "),n("g",{ref:"annotations",staticClass:"foreground"},[t._t("annotation")],2),t._v(" "),t._t("drawing")],2)},i=[],o={render:r,staticRenderFns:i};e.a=o}]);
{
"name": "vue-annotator",
"version": "0.13.1",
"version": "0.13.2",
"description": "Vue Component for drawing annotation (box, etc)",

@@ -5,0 +5,0 @@ "homepage": "http://vue-annotator.surge.sh",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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