vue-annotator
Advanced tools
Comparing version 0.12.0 to 0.12.1
@@ -1,1 +0,1 @@ | ||
module.exports=function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},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("svg.js")},function(t,e){t.exports=require("interactjs")},function(t,e){t.exports=require("svg.select.js")},function(t,e,n){"use strict";var i=n(1),r=(n.n(i),n(0)),a=n.n(r),o=n(2),s=(n.n(o),n(4)),c=(n.n(s),n(10)),l=n(11),d=n(12),u=n(13);e.a={name:"Annotator",mixins:[c.a,l.a,d.a,u.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.width)||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})&&(clearInterval(n),t.$forceUpdate())},43.48);else this.$forceUpdate()},mounted:function(){this.background=a.a.adopt(this.$refs.bgSvg),this.annotations=a.a.adopt(this.$refs.annotations),this.enableInteraction(!this.noInteract),this.enableSelection(!this.noSelect),this.enableDrawing(this.drawing)}}},function(t,e){t.exports=require("svg.draw.js")},function(t,e,n){t.exports=n(6)},function(t,e,n){"use strict";function i(t){n(7),n(8)}Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),a=n(14),o=n(9),s=i,c=o(r.a,a.a,!1,s,"data-v-96558546",null);e.default=c.exports},function(t,e){},function(t,e){},function(t,e){t.exports=function(t,e,n,i,r,a){var o,s=t=t||{},c=typeof t.default;"object"!==c&&"function"!==c||(o=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),r&&(l._scopeId=r);var d;if(a?(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__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},l._ssrRegister=d):i&&(d=i),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:o,exports:s,options:l}}},function(t,e,n){"use strict";var i=n(1),r=n.n(i),a=n(0),o=n.n(a);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},data:function(){return{interactables:[]}},methods:{makeInteractable:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=o.a.adopt(this.$refs.svg);return r()(t).draggable({inertia:this.inertia,snap:{targets:[this.gridTarget]},restrict:{restriction:"svg",elementRect:{top:0,left:0,bottom:1,right:1}},autoScroll:!0,onmove:function(t){return o.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}},onmove:function(t){var n=o.a.adopt(t.target),r=n.x()+t.deltaRect.left,a=n.y()+t.deltaRect.top;switch(n.type){case"ellipse":n.move(r+t.deltaRect.width/2,a+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?(r+=c(t.deltaRect.width),a+=c(t.deltaRect.height)):(r=n.x(),a=n.y());var d=2*n.attr("r")+s;d=Math.max(d,l);var u=r+Math.abs(t.deltaRect.width)>=0&&a+Math.abs(t.deltaRect.height)>=0;r+d<=i.width()+Math.abs(t.deltaRect.width)&&a+d<=i.height()+Math.abs(t.deltaRect.height)&&u&&(n.move(r,a),n.size(d));break;default:n.move(r,a),n.size(t.rect.width,t.rect.height)}}})},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,i){!e&&t.interactables.length?t.interactables.forEach(function(t){return t.draggable(!1).resizable(!1)}):t.interactables[i]=t.makeInteractable(n)})}},updated:function(){if((this.$refs.annotations.hasChildNodes()?this.$refs.annotations.childNodes.length:0)>this.interactables.length){var t=this.$refs.annotations.childNodes[this.$refs.annotations.childNodes.length-1],e=this.makeInteractable(t,!0);this.interactables.push(e)}},computed:{gridTarget:function(){return this.grid?r.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 i=n(1),r=n.n(i),a=n(0),o=n.n(a),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&&r.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=r()(this.background.node).styleCursor(!1).draggable({inertia:this.inertia,snap:{targets:[this.gridTarget]},restrict:"svg",autoScroll:!0,onstart:function(i){e=o.a.adopt(t.$slots.drawing[0].elm).clone(),n.oncontextmenu=e.attr("oncontextmenu"),e.draw("point",i).style("cursor","crosshair").addClass("foreground").attr("oncontextmenu","return false;").on("contextmenu",function(n){e.draw("cancel").data("canceled",!0),t.$emit("drawcancel")})},onmove:function(t){return e.draw("update",t)},onend:function(i){e.data("canceled")?e.off("contextmenu").data("canceled",null):(e.draw("stop",i).style("cursor",null).removeClass("foreground").toParent(t.annotations).off("contextmenu"),t.$forceUpdate(),t.$emit("drawfinish",e));for(var r in n)e.attr(r,n[r]||null)}})}}}}},function(t,e,n){"use strict";var i=n(1),r=n.n(i),a=n(0),o=n.n(a),s=n(2);n.n(s);e.a={props:{multipleSelect:Boolean},data:function(){return{selectables:[]}},methods:{makeSelectable:function(t){var e=this,n=o.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 i=o.a.adopt(n);i.selectize(!1,{deepSelect:["g","foreignObject","polygon"].includes(i.type)}),i.data("selected")&&(i.data("selected",null),e.$emit("unselect",i))}})},s=function(t){var r=n.selectize({deepSelect:!0,rotationPoint:!1,points:!0}).data("selected",!0);e.$emit("select",r),i(r),e.multipleSelect||a()},c=r()(t).on("tap",s);return c.unselectListener=function(){n.data("selected")&&(n.selectize(!1,{deepSelect:["g","foreignObject","polygon"].includes(n.type)}),n.data("selected",null),e.$emit("unselect",n))},this.background.on("click",c.unselectListener),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,i){!e&&t.selectables.length?(t.selectables.forEach(function(t){return t.off("tap")}),t.background.fire("click"),t.background.off("click")):t.selectables[i]=t.makeSelectable(n)})}},updated:function(){if((this.$refs.annotations.hasChildNodes()?this.$refs.annotations.childNodes.length:0)>this.selectables.length){var t=this.$refs.annotations.childNodes[this.$refs.annotations.childNodes.length-1],e=this.makeSelectable(t);this.selectables.push(e)}}}},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2);n.n(a);e.a={props:{delete:[Boolean]},watch:{delete:function(t){t&&this.triggerDelete()}},methods:{$_gracefulUnset:function(t){var e=this,n=function(e,n){return e.forEach(function(i,r){i.target.isSameNode(t)&&(n(i),delete e[r],e.splice(r,1))})};n(this.interactables,function(t){return t.unset()}),n(this.selectables,function(t){return e.background.off("click",t.unselectListener)})},triggerDelete:function(){var t=this;this.$refs.annotations.childNodes.forEach(function(e){var n=r.a.adopt(e);n.data("selected")&&(t.$_gracefulUnset(e),n.selectize(!1,{deepSelect:["g","foreignObject","polygon"].includes(n.type)}),setTimeout(function(){return n.remove()},100))}),this.$emit("update:delete",!1)}}}},function(t,e,n){"use strict";var i=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)},r=[],a={render:i,staticRenderFns:r};e.a=a}]); | ||
module.exports=function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},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("svg.js")},function(t,e){t.exports=require("interactjs")},function(t,e){t.exports=require("svg.select.js")},function(t,e,n){"use strict";var i=n(1),r=(n.n(i),n(0)),a=n.n(r),o=n(2),s=(n.n(o),n(4)),c=(n.n(s),n(10)),l=n(11),d=n(12),u=n(13);e.a={name:"Annotator",mixins:[c.a,l.a,d.a,u.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()},mounted:function(){this.background=a.a.adopt(this.$refs.bgSvg),this.annotations=a.a.adopt(this.$refs.annotations),this.enableInteraction(!this.noInteract),this.enableSelection(!this.noSelect),this.enableDrawing(this.drawing)}}},function(t,e){t.exports=require("svg.draw.js")},function(t,e,n){t.exports=n(6)},function(t,e,n){"use strict";function i(t){n(7),n(8)}Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),a=n(14),o=n(9),s=i,c=o(r.a,a.a,!1,s,"data-v-cf787524",null);e.default=c.exports},function(t,e){},function(t,e){},function(t,e){t.exports=function(t,e,n,i,r,a){var o,s=t=t||{},c=typeof t.default;"object"!==c&&"function"!==c||(o=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),r&&(l._scopeId=r);var d;if(a?(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__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},l._ssrRegister=d):i&&(d=i),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:o,exports:s,options:l}}},function(t,e,n){"use strict";var i=n(1),r=n.n(i),a=n(0),o=n.n(a);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},data:function(){return{interactables:[]}},methods:{makeInteractable:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=o.a.adopt(this.$refs.svg);return r()(t).draggable({inertia:this.inertia,snap:{targets:[this.gridTarget]},restrict:{restriction:"svg",elementRect:{top:0,left:0,bottom:1,right:1}},autoScroll:!0,onmove:function(t){return o.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}},onmove:function(t){var n=o.a.adopt(t.target),r=n.x()+t.deltaRect.left,a=n.y()+t.deltaRect.top;switch(n.type){case"ellipse":n.move(r+t.deltaRect.width/2,a+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?(r+=c(t.deltaRect.width),a+=c(t.deltaRect.height)):(r=n.x(),a=n.y());var d=2*n.attr("r")+s;d=Math.max(d,l);var u=r+Math.abs(t.deltaRect.width)>=0&&a+Math.abs(t.deltaRect.height)>=0;r+d<=i.width()+Math.abs(t.deltaRect.width)&&a+d<=i.height()+Math.abs(t.deltaRect.height)&&u&&(n.move(r,a),n.size(d));break;default:n.move(r,a),n.size(t.rect.width,t.rect.height)}}})},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,i){!e&&t.interactables.length?t.interactables.forEach(function(t){return t.draggable(!1).resizable(!1)}):t.interactables[i]=t.makeInteractable(n)})},$_onUpdate:function(t){if((this.$refs.annotations.hasChildNodes()?this.$refs.annotations.childNodes.length:0)>this.interactables.length){var e=this.$refs.annotations.childNodes[this.$refs.annotations.childNodes.length-1],n=this.makeInteractable(e,t);this.interactables.push(n)}}},mounted:function(){var t=this;this.$on("drawfinish",function(){return t.$_onUpdate(!1)})},updated:function(){this.$_onUpdate(this.drawing)},computed:{gridTarget:function(){return this.grid?r.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 i=n(1),r=n.n(i),a=n(0),o=n.n(a),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&&r.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=r()(this.background.node).styleCursor(!1).draggable({inertia:this.inertia,snap:{targets:[this.gridTarget]},restrict:"svg",autoScroll:!0,onstart:function(i){e=o.a.adopt(t.$slots.drawing[0].elm).clone(),n.oncontextmenu=e.attr("oncontextmenu"),e.draw("point",i).style("cursor","crosshair").addClass("foreground").attr("oncontextmenu","return false;").on("contextmenu",function(n){e.draw("cancel").data("canceled",!0),t.$emit("drawcancel")})},onmove:function(t){return e.draw("update",t)},onend:function(i){e.data("canceled")?e.off("contextmenu").data("canceled",null):(e.draw("stop",i).style("cursor",null).removeClass("foreground").toParent(t.annotations).off("contextmenu"),t.$forceUpdate(),t.$emit("drawfinish",e));for(var r in n)e.attr(r,n[r]||null)}})}}}}},function(t,e,n){"use strict";var i=n(1),r=n.n(i),a=n(0),o=n.n(a),s=n(2);n.n(s);e.a={props:{multipleSelect:Boolean},data:function(){return{selectables:[]}},methods:{makeSelectable:function(t){var e=this,n=o.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 i=o.a.adopt(n);i.selectize(!1,{deepSelect:["g","foreignObject","polygon"].includes(i.type)}),i.data("selected")&&(i.data("selected",null),e.$emit("unselect",i))}})},s=function(t){var r=n.selectize({deepSelect:!0,rotationPoint:!1,points:!0}).data("selected",!0);e.$emit("select",r),i(r),e.multipleSelect||a()},c=r()(t).on("tap",s);return c.unselectListener=function(){n.data("selected")&&(n.selectize(!1,{deepSelect:["g","foreignObject","polygon"].includes(n.type)}),n.data("selected",null),e.$emit("unselect",n))},this.background.on("click",c.unselectListener),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,i){!e&&t.selectables.length?(t.selectables.forEach(function(t){return t.off("tap")}),t.background.fire("click"),t.background.off("click")):t.selectables[i]=t.makeSelectable(n)})}},updated:function(){if((this.$refs.annotations.hasChildNodes()?this.$refs.annotations.childNodes.length:0)>this.selectables.length){var t=this.$refs.annotations.childNodes[this.$refs.annotations.childNodes.length-1],e=this.makeSelectable(t);this.selectables.push(e)}}}},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2);n.n(a);e.a={props:{delete:[Boolean]},watch:{delete:function(t){t&&this.triggerDelete()}},methods:{$_gracefulUnset:function(t){var e=this,n=function(e,n){return e.forEach(function(i,r){i.target.isSameNode(t)&&(n(i),delete e[r],e.splice(r,1))})};n(this.interactables,function(t){return t.unset()}),n(this.selectables,function(t){return e.background.off("click",t.unselectListener)})},triggerDelete:function(){var t=this;this.$refs.annotations.childNodes.forEach(function(e){var n=r.a.adopt(e);n.data("selected")&&(t.$_gracefulUnset(e),n.selectize(!1,{deepSelect:["g","foreignObject","polygon"].includes(n.type)}),setTimeout(function(){return n.remove()},100))}),this.$emit("update:delete",!1)}}}},function(t,e,n){"use strict";var i=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)},r=[],a={render:i,staticRenderFns:r};e.a=a}]); |
{ | ||
"name": "vue-annotator", | ||
"version": "0.12.0", | ||
"version": "0.12.1", | ||
"description": "Vue Component for drawing annotation (box, etc)", | ||
@@ -53,6 +53,6 @@ "homepage": "http://vue-annotator.surge.sh", | ||
"peerDependencies": { | ||
"svg.js": "^2.6.3" | ||
"svg.js": "^2.6.4" | ||
}, | ||
"dependencies": { | ||
"interactjs": "^1.3.2", | ||
"interactjs": "^1.3.3", | ||
"svg.draw.js": "^2.0.3", | ||
@@ -59,0 +59,0 @@ "svg.select.js": "^2.1.2" |
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
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
193629
Updatedinteractjs@^1.3.3