Release 2.0.28
This commit is contained in:
@@ -0,0 +1 @@
|
||||
var e=Object.defineProperty,a=Object.defineProperties,t=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,s=(a,t,r)=>t in a?e(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r,i=(e,a)=>{for(var t in a||(a={}))n.call(a,t)&&s(e,t,a[t]);if(r)for(var t of r(a))o.call(a,t)&&s(e,t,a[t]);return e},c=(e,r)=>a(e,t(r));import{a2 as l,a3 as d,C as p,a4 as u,a0 as m,a6 as f,a9 as y,S as g,i as h,s as v,e as b,c as w,a as O,d as E,b as S,N as T,f as _,F as D,G as j,H as x,z as P,a8 as C,J as A}from"./vendor-de807e42.js";import{_ as I}from"./preload-helper-9f12a5fd.js";let J;let N;const L=l(p({code:"graph TD\n A[Christmas] --\x3e|Get money| B(Go shopping)\n B --\x3e C{Let me think}\n C --\x3e|One| D[Laptop]\n C --\x3e|Two| E[iPhone]\n C --\x3e|Three| F[fa:fa-car Car]\n ",mermaid:JSON.stringify({theme:"default"},null,2),updateEditor:!1,autoSync:!0,updateDiagram:!0}),d(),"codeStore"),k=u([L],(([e],a)=>{a(m(JSON.stringify(e),!0))})),V=e=>{L.update((a=>i(i({},a),e)))};let G=!1;const z=(e,a,t=!1)=>{var r;r=e,J&&(clearTimeout(N),N=setTimeout((function(){const e=r.replace(/^\s*%%.*\n/g,"\n").trimStart().split(" ")[0];console.debug("ga:","send","event","render",e),J.track("render",{graphType:e})}),5e3));if((e.match(/\n/g)||"").length+1>50&&!G&&f(L).autoSync){const e=confirm("Long diagram deteced. Turn off Auto Sync? Click the sync logo to manually sync.");G=!0,e&&V({autoSync:!1})}L.update((r=>c(i({},r),{code:e,updateEditor:a,updateDiagram:t})))},B=(e,a)=>{L.update((t=>c(i({},t),{mermaid:e,updateEditor:a})))},F=()=>JSON.stringify(f(L)),H=p(void 0);function R(e){let a,t;return{c(){a=b("div"),t=b("div"),this.h()},l(e){a=w(e,"DIV",{id:!0,class:!0});var r=O(a);t=w(r,"DIV",{id:!0,class:!0}),O(t).forEach(E),r.forEach(E),this.h()},h(){S(t,"id","container"),S(t,"class","flex-1 overflow-auto"),S(a,"id","view"),S(a,"class","p-2 svelte-7vvt6c"),T(a,"error",e[1]),T(a,"outOfSync",e[2])},m(r,n){_(r,a,n),D(a,t),e[3](t)},p(e,[t]){2&t&&T(a,"error",e[1]),4&t&&T(a,"outOfSync",e[2])},i:j,o:j,d(t){t&&E(a),e[3](null)}}}function $(e,a,t){let r;x(e,L,(e=>t(6,r=e)));var n=this&&this.__awaiter||function(e,a,t,r){return new(t||(t=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(a){o(a)}}function i(e){try{c(r.throw(e))}catch(a){o(a)}}function c(e){var a;e.done?n(e.value):(a=e.value,a instanceof t?a:new t((function(e){e(a)}))).then(s,i)}c((r=r.apply(e,a||[])).next())}))};const o=window.mermaid;let s,i="",c=!1,l=!1,d=!0;return P((()=>n(void 0,void 0,void 0,(function*(){L.subscribe((e=>{try{if(s&&e&&(e.updateDiagram||e.autoSync)){e.autoSync||C(L,r.updateDiagram=!1,r),t(2,l=!1),d=!0,i=e.code;const a=s.parentElement.parentElement.parentElement.scrollTop;t(0,s.innerHTML=i,s),delete s.dataset.processed,o.initialize(Object.assign({},JSON.parse(e.mermaid))),o.init(s),o.render("graph-div",i),t(0,s.parentElement.parentElement.parentElement.scrollTop=a,s)}else d?d=!1:t(2,l=!0)}catch(a){console.log("view fail",a),t(1,c=!0)}})),H.subscribe((e=>{void 0===e?t(1,c=!1):(t(1,c=!0),console.log("Error: ",e))}))})))),[s,c,l,function(e){A[e?"unshift":"push"]((()=>{s=e,t(0,s)}))}]}class M extends g{constructor(e){super(),h(this,e,$,R,v,{})}}const U=()=>{(e=>{let a;try{const t=y(e);console.log(`Tring to load state: ${t}`),a=JSON.parse(t),"string"!=typeof a.mermaid&&(a.mermaid=JSON.stringify(a.mermaid,null,2))}catch(t){e&&console.error("Init error",t),a=f(L),console.log(a)}V(c(i({},a),{updateEditor:!0}))})(window.location.hash.slice(1))},q=()=>{V({updateDiagram:!0})},K=async()=>{U(),q(),k.subscribe((e=>{history.replaceState(void 0,void 0,`#${e}`)})),await(async()=>{if(!J)try{const{Analytics:e}=await I((()=>import("./analytics.browser.es-eaddcc60.js")),void 0),a=await I((()=>import("./analytics-plugin-ga.browser.es-9bc8c1dc.js")),void 0);J=e({app:"mermaid-live-editor",plugins:[a.init({trackingId:"UA-153180559-1"})]})}catch{console.info("Analytics blocked ;)")}})(),null==J||J.page()};export{M as V,J as a,k as b,L as c,B as d,H as e,F as g,K as i,q as s,z as u};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{S as s,i as a,s as r,j as e,m as t,o as n,G as o,v as f,r as m,w as u,z as c}from"../chunks/vendor-de807e42.js";import{V as i,i as p}from"../chunks/util-1700c988.js";import"../chunks/preload-helper-9f12a5fd.js";function $(s){let a,r;return a=new i({}),{c(){e(a.$$.fragment)},l(s){t(a.$$.fragment,s)},m(s,e){n(a,s,e),r=!0},p:o,i(s){r||(f(a.$$.fragment,s),r=!0)},o(s){m(a.$$.fragment,s),r=!1},d(s){u(a,s)}}}function d(s){return c(p),[]}export default class extends s{constructor(s){super(),a(this,s,d,$,r,{})}}
|
||||
File diff suppressed because one or more lines are too long
@@ -58,14 +58,14 @@
|
||||
|
||||
|
||||
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/_app/start-94b73391.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/_app/start-da354362.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/vendor-de807e42.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/preload-helper-9f12a5fd.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/paths-7dc55c62.js">
|
||||
<link rel="stylesheet" href="/mermaid-live-editor/_app/assets/start-0826e215.css">
|
||||
|
||||
<script type="module">
|
||||
import { start } from "/mermaid-live-editor/_app/start-94b73391.js";
|
||||
import { start } from "/mermaid-live-editor/_app/start-da354362.js";
|
||||
start({
|
||||
target: document.querySelector("#svelte"),
|
||||
paths: {"base":"/mermaid-live-editor","assets":"/mermaid-live-editor"},
|
||||
|
||||
+2
-2
@@ -58,14 +58,14 @@
|
||||
|
||||
|
||||
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/_app/start-94b73391.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/_app/start-da354362.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/vendor-de807e42.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/preload-helper-9f12a5fd.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/paths-7dc55c62.js">
|
||||
<link rel="stylesheet" href="/mermaid-live-editor/_app/assets/start-0826e215.css">
|
||||
|
||||
<script type="module">
|
||||
import { start } from "/mermaid-live-editor/_app/start-94b73391.js";
|
||||
import { start } from "/mermaid-live-editor/_app/start-da354362.js";
|
||||
start({
|
||||
target: document.querySelector("#svelte"),
|
||||
paths: {"base":"/mermaid-live-editor","assets":"/mermaid-live-editor"},
|
||||
|
||||
@@ -58,14 +58,14 @@
|
||||
|
||||
|
||||
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/_app/start-94b73391.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/_app/start-da354362.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/vendor-de807e42.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/preload-helper-9f12a5fd.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/paths-7dc55c62.js">
|
||||
<link rel="stylesheet" href="/mermaid-live-editor/_app/assets/start-0826e215.css">
|
||||
|
||||
<script type="module">
|
||||
import { start } from "/mermaid-live-editor/_app/start-94b73391.js";
|
||||
import { start } from "/mermaid-live-editor/_app/start-da354362.js";
|
||||
start({
|
||||
target: document.querySelector("#svelte"),
|
||||
paths: {"base":"/mermaid-live-editor","assets":"/mermaid-live-editor"},
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mermaid-live-editor",
|
||||
"version": "2.0.27",
|
||||
"version": "2.0.28",
|
||||
"scripts": {
|
||||
"dev": "svelte-kit dev",
|
||||
"build": "svelte-kit build",
|
||||
|
||||
Reference in New Issue
Block a user