Socket
Socket
Sign inDemoInstall

vue-mermaid

Package Overview
Dependencies
50
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.4 to 0.0.5

2

dist/vue-mermaid.js

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

define(["mermaid"],function(e){"use strict";function n(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function t(e){return i(e)||r(e)||o()}function i(e){if(Array.isArray(e)){for(var n=0,t=new Array(e.length);n<e.length;n++)t[n]=e[n];return t}}function r(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function a(){const e=document.head||document.getElementsByTagName("head")[0],n=a.styles||(a.styles={}),t="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(i,r){if(!document.querySelector('style[data-vue-ssr-id~="'+i+'"]')){const o=t?r.media||"default":i,a=n[o]||(n[o]={ids:[],parts:[],element:void 0});if(!a.ids.includes(i)){let n=r.source,d=a.ids.length;if(a.ids.push(i),t&&(a.element=a.element||document.querySelector("style[data-group="+o+"]")),!a.element){const n=a.element=document.createElement("style");n.type="text/css",r.media&&n.setAttribute("media",r.media),t&&(n.setAttribute("data-group",o),n.setAttribute("data-next-index","0")),e.appendChild(n)}if(t&&(d=parseInt(a.element.getAttribute("data-next-index")),a.element.setAttribute("data-next-index",d+1)),a.element.styleSheet)a.parts.push(n),a.element.styleSheet.cssText=a.parts.filter(Boolean).join("\n");else{const e=document.createTextNode(n),t=a.element.childNodes;t[d]&&a.element.removeChild(t[d]),t.length?a.element.insertBefore(e,t[d]):a.element.appendChild(e)}}}}}function d(e){e.component("vue-mermaid",l)}e=e&&e.hasOwnProperty("default")?e.default:e;const c={name:"VueMermaid",props:{type:{type:String,default:"graph TD"},nodes:{type:Array,required:!0},config:{type:Object,default:function(){return{theme:"default",startOnLoad:!1}}}},data:function(){return{mermaidNode:[],code:"",nodeObject:{}}},mounted:function(){this.init(),Array.isArray(this.nodes)&&(this.mermaidNode=this.nodes,this.parseCode(),this.load())},methods:{parseCode:function(){var e=this;this.nodeObject=function(e,i){return Object.assign.apply(Object,[{}].concat(t(e.map(function(e){return n({},e[i],e)}))))}(this.mermaidNode,"id");var i=this.type+"\n";this.code=i+this.mermaidNode.map(function(n){"click ".concat(n.id," clickTest");return n.next&&n.next.length>0?n.next.map(function(t){var i=e.nodeObject[t];return null!=i&&void 0!==i?"".concat(n.id,"(").concat(n.text,")--\x3e").concat(i.id,"(").concat(i.text,")"):"".concat(n.id,"(").concat(n.text,")")}).join("\n"):"".concat(n.id,"(").concat(n.text,")\n click ").concat(n.id," clickTest\n ")}).join("\n")},setNodes:function(e){if(null!==e&&void 0!==e)return Array.isArray(e)?void(this.mermaidNode=e):void 0},init:function(){var n=this;window.clickTest=function(e){n.edit(e)},e.initialize(n.config)},load:function(){var n=document.getElementById("mermaid");n.removeAttribute("data-processed"),n.replaceChild(document.createTextNode(this.code),n.firstChild),e.init(void 0,n)},edit:function(e){console.log(this.nodeObject[e]),this.$emit("nodeClick",this.nodeObject[e])}}};var s=function(){var e=this,n=e.$createElement;return(e._self._c||n)("div",{staticClass:"mermaid",attrs:{id:"mermaid"}},[e._v("\n "+e._s(e.code)+"\n")])},u=[];s._withStripped=!0;var l=function(e,n,t,i,r,o,a,d){const c=("function"==typeof t?t.options:t)||{};c.__file="/Users/liu/githome/vue-mermaid/src/vue-mermaid.vue",c.render||(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i;{let e;if(n&&(e=function(e){n.call(this,a(e))}),void 0!==e)if(c.functional){const n=c.render;c.render=function(t,i){return e.call(i),n(t,i)}}else{const n=c.beforeCreate;c.beforeCreate=n?[].concat(n,e):[e]}}return c}({render:s,staticRenderFns:u},function(e){e&&e("data-v-ffa1fc92_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"vue-mermaid.vue"},media:void 0})},c,void 0,!1,void 0,a,void 0);return{install:d}});
define(["mermaid"],function(n){"use strict";function e(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function t(n){return i(n)||r(n)||o()}function i(n){if(Array.isArray(n)){for(var e=0,t=new Array(n.length);e<n.length;e++)t[e]=n[e];return t}}function r(n){if(Symbol.iterator in Object(n)||"[object Arguments]"===Object.prototype.toString.call(n))return Array.from(n)}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function a(){const n=document.head||document.getElementsByTagName("head")[0],e=a.styles||(a.styles={}),t="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(i,r){if(!document.querySelector('style[data-vue-ssr-id~="'+i+'"]')){const o=t?r.media||"default":i,a=e[o]||(e[o]={ids:[],parts:[],element:void 0});if(!a.ids.includes(i)){let e=r.source,d=a.ids.length;if(a.ids.push(i),t&&(a.element=a.element||document.querySelector("style[data-group="+o+"]")),!a.element){const e=a.element=document.createElement("style");e.type="text/css",r.media&&e.setAttribute("media",r.media),t&&(e.setAttribute("data-group",o),e.setAttribute("data-next-index","0")),n.appendChild(e)}if(t&&(d=parseInt(a.element.getAttribute("data-next-index")),a.element.setAttribute("data-next-index",d+1)),a.element.styleSheet)a.parts.push(e),a.element.styleSheet.cssText=a.parts.filter(Boolean).join("\n");else{const n=document.createTextNode(e),t=a.element.childNodes;t[d]&&a.element.removeChild(t[d]),t.length?a.element.insertBefore(n,t[d]):a.element.appendChild(n)}}}}}function d(n){n.component("vue-mermaid",l)}n=n&&n.hasOwnProperty("default")?n.default:n;const c={name:"VueMermaid",props:{type:{type:String,default:"graph TD"},nodes:{type:Array,required:!0},styles:{type:Array,default:function(){return[]}},config:{type:Object,default:function(){return{theme:"default",startOnLoad:!1}}}},mounted:function(){this.init(),this.loadNodes()},computed:{parseCode:function(){var n=this.nodes,i=this.styles;if(Array.isArray(n)&&n.length>0){var r=function(n,i){return Object.assign.apply(Object,[{}].concat(t(n.map(function(n){return e({},n[i],n)}))))}(n,"id"),o=this.type+"\n",a=o+n.map(function(n){return n.next&&n.next.length>0?n.next.map(function(e){var t=r[e]||r[e.id];if(null!=t&&void 0!==t){var i=e.link?"|"+e.link+"|":"";return"".concat(n.id,"(").concat(n.text,")--\x3e").concat(i).concat(t.id,"(").concat(t.text,")")}return"".concat(n.id,"(").concat(n.text,")")}).join("\n"):"".concat(n.id,"(").concat(n.text,")")}).join("\n")+"\n"+i.join(" \n")+"\n"+n.filter(function(n){return n.editable}).map(function(n){return"click ".concat(n.id,' mermaidClick "edit"')}).join("\n");return this.load(a),a}return""}},methods:{loadNodes:function(){this.load(this.parseCode)},init:function(){var e=this;window.mermaidClick=function(n){e.edit(n)},n.initialize(this.config)},load:function(e){if(e){var t=document.getElementById("mermaid");t.removeAttribute("data-processed"),t.replaceChild(document.createTextNode(e),t.firstChild),n.init(e,t)}},edit:function(n){this.$emit("nodeClick",n)}}};var s=function(){var n=this,e=n.$createElement;return(n._self._c||e)("div",{staticClass:"mermaid",attrs:{id:"mermaid"}},[n._v("\n "+n._s(n.parseCode)+"\n")])},u=[];s._withStripped=!0;var l=function(n,e,t,i,r,o,a,d){const c=("function"==typeof t?t.options:t)||{};c.__file="/Users/liu/githome/vue-mermaid/src/vue-mermaid.vue",c.render||(c.render=n.render,c.staticRenderFns=n.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i;{let n;if(e&&(n=function(n){e.call(this,a(n))}),void 0!==n)if(c.functional){const e=c.render;c.render=function(t,i){return n.call(i),e(t,i)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,n):[n]}}return c}({render:s,staticRenderFns:u},function(n){n&&n("data-v-dea1fd00_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"vue-mermaid.vue"},media:void 0})},c,void 0,!1,void 0,a,void 0);return{install:d}});
{
"name": "vue-mermaid",
"description": "flowchart of mermaid with vue componet",
"version": "0.0.4",
"version": "0.0.5",
"main": "dist/vue-mermaid.js",

@@ -6,0 +6,0 @@ "author": "mark_tun <yuguang.liu@foxmail.com>",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc