diff --git a/docs/index.js b/docs/index.js
index da8914c..7c53b27 100644
--- a/docs/index.js
+++ b/docs/index.js
@@ -1,5 +1,5 @@
/*! Menduz diagrams */
-const buildInformation={date:"2020-08-22T17:53:08.149Z",commit:"HEAD",ref:"?"};!function(){"use strict";function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}function getCjsExportFromNamespace(e){return e&&e.default||e}
+const buildInformation={date:"2020-08-22T19:10:08.527Z",commit:"HEAD",ref:"?"};!function(){"use strict";function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}function getCjsExportFromNamespace(e){return e&&e.default||e}
/*
object-assign
(c) Sindre Sorhus
@@ -1006,7 +1006,7 @@ function logEvent(e,t,n,r,i){var o=r||{};i&&i.global||(o=tslib_2(tslib_2({},r),{
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */var ERRORS=(_a$2={},_a$2["no-ga-id"]='"'+ANALYTICS_ID_FIELD+'" field is empty in Firebase config. Firebase Analytics requires this field to contain a valid measurement ID.',_a$2["already-exists"]="A Firebase Analytics instance with the measurement ID ${id} already exists. Only one Firebase Analytics instance can be created for each measurement ID.",_a$2["already-initialized"]="Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.",_a$2["interop-component-reg-failed"]="Firebase Analytics Interop Component failed to instantiate",_a$2["indexedDB-unsupported"]="IndexedDB is not supported by current browswer",_a$2["invalid-indexedDB-context"]="Environment doesn't support IndexedDB: {$errorInfo}. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments",_a$2["cookies-not-enabled"]="Cookies are not enabled in this browser environment. Analytics requires cookies to be enabled.",_a$2["invalid-analytics-context"]="Firebase Analytics is not supported in browser extensions.",_a$2),ERROR_FACTORY$1=new index_cjs_3("analytics","Analytics",ERRORS),initializedIdPromisesMap={},dataLayerName="dataLayer",gtagName="gtag",gtagCoreFunction,wrappedGtagFunction,globalInitDone=!1;function settings(e){if(globalInitDone)throw ERROR_FACTORY$1.create("already-initialized");e.dataLayerName&&(dataLayerName=e.dataLayerName),e.gtagName&&(gtagName=e.gtagName)}function factory(e,t){if(index_cjs_22())throw ERROR_FACTORY$1.create("invalid-analytics-context");if(!index_cjs_6())throw ERROR_FACTORY$1.create("cookies-not-enabled");if(!index_cjs_26())throw ERROR_FACTORY$1.create("indexedDB-unsupported");index_cjs_47().catch((function(e){throw ERROR_FACTORY$1.create("invalid-indexedDB-context",{errorInfo:e})}));var n=e.options[ANALYTICS_ID_FIELD];if(!n)throw ERROR_FACTORY$1.create("no-ga-id");if(null!=initializedIdPromisesMap[n])throw ERROR_FACTORY$1.create("already-exists",{id:n});if(!globalInitDone){findGtagScriptOnPage()||insertScriptTag(dataLayerName),getOrCreateDataLayer(dataLayerName);var r=wrapOrCreateGtag(initializedIdPromisesMap,dataLayerName,gtagName),i=r.wrappedGtag,o=r.gtagCore;wrappedGtagFunction=i,gtagCoreFunction=o,globalInitDone=!0}return initializedIdPromisesMap[n]=initializeGAId(e,t,gtagCoreFunction),{app:e,logEvent:function(e,t,r){return logEvent(wrappedGtagFunction,n,e,t,r)},setCurrentScreen:function(e,t){return setCurrentScreen(wrappedGtagFunction,n,e,t)},setUserId:function(e,t){return setUserId(wrappedGtagFunction,n,e,t)},setUserProperties:function(e,t){return setUserProperties(wrappedGtagFunction,n,e,t)},setAnalyticsCollectionEnabled:function(e){return setAnalyticsCollectionEnabled(n,e)}}}var name$3="@firebase/analytics",version$5="0.4.2",ANALYTICS_TYPE="analytics";function registerAnalytics(e){e.INTERNAL.registerComponent(new index_cjs_1$1(ANALYTICS_TYPE,(function(e){return factory(e.getProvider("app").getImmediate(),e.getProvider("installations").getImmediate())}),"PUBLIC").setServiceProps({settings:settings,EventName:EventName,isSupported:isSupported})),e.INTERNAL.registerComponent(new index_cjs_1$1("analytics-internal",(function(e){try{return{logEvent:e.getProvider(ANALYTICS_TYPE).getImmediate().logEvent}}catch(e){throw ERROR_FACTORY$1.create("interop-component-reg-failed",{reason:e})}}),"PRIVATE")),e.registerVersion(name$3,version$5)}function isSupported(){return tslib_7(this,void 0,void 0,(function(){return tslib_8(this,(function(e){switch(e.label){case 0:if(index_cjs_22())return[2,!1];if(!index_cjs_6())return[2,!1];if(!index_cjs_26())return[2,!1];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,index_cjs_47()];case 2:return[2,e.sent()];case 3:return e.sent(),[2,!1];case 4:return[2]}}))}))}registerAnalytics(firebase);let firebaseConfig={apiKey:"AIzaSyBhfoK4AFBLsruM0sDJ-sAFyksh4FqMpC8",authDomain:"diagrams-de8ed.firebaseapp.com",databaseURL:"https://diagrams-de8ed.firebaseio.com",projectId:"diagrams-de8ed",storageBucket:"diagrams-de8ed.appspot.com",messagingSenderId:"346071222923",appId:"1:346071222923:web:4d57d09e64ea7ed1ee628e",measurementId:"G-HLCQLCWE0G"};async function addFirebase(){index_cjs$3.initializeApp(firebaseConfig),index_cjs$3.analytics(),await index_cjs$3.auth().setPersistence(index_cjs$3.auth.Auth.Persistence.LOCAL),await new Promise((e,t)=>{const n=index_cjs$3.auth().onAuthStateChanged(t=>{n(),e(t)},e=>{console.error(e),t("API Failed")})})}function newNotebook(e){const t=index_cjs$3.database().ref(`users/${e}/notebooks`).push();return t.child("meta/uid").set(e,(function(e){e&&console.log("error setting uid",e)})),t.child("meta/title").set("Untitled notebook",(function(e){e&&console.log("error setting titile2",e)})),t}function openByHash(e,t){return index_cjs$3.database().ref().child(`users/${e}/notebooks/${t}`)}function logEvent$1(e){index_cjs$3.analytics().logEvent(e)}function logException(e){index_cjs$3.analytics().logEvent("exception",{description:"object"==typeof e?e.message:e,fatal:"object"==typeof e})}function logPageView(e,t){index_cjs$3.analytics().logEvent("page_view",{page_location:e,page_path:t})}globalThis.firebase=index_cjs$3;const history=createHashHistory();function navigateTo(e,t){const n={pathname:e,state:t||{}};history.location.pathname!=n.pathname&&history.push(n)}history.listen(e=>{logPageView(location.toString(),e.pathname)});var interopRequireDefault=createCommonjsModule((function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}}}));unwrapExports(interopRequireDefault);var _typeof_1=createCommonjsModule((function(e){function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(n)}e.exports=t})),interopRequireWildcard=createCommonjsModule((function(e){function t(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return t=function(){return e},e}e.exports=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==_typeof_1(e)&&"function"!=typeof e)return{default:e};var n=t();if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}}));function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}unwrapExports(interopRequireWildcard);var defineProperty=_defineProperty;function _arrayWithHoles(e){if(Array.isArray(e))return e}var arrayWithHoles=_arrayWithHoles;function _iterableToArrayLimit(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}var iterableToArrayLimit=_iterableToArrayLimit;function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n "+e+"
\n":"'+(n?e:J(e,!0))+"
\n"},t.blockquote=function(e){return""+(n?e:J(e,!0))+"
\n"+e+"
\n"},t.html=function(e){return e},t.heading=function(e,t,n,r){return this.options.headerIds?"
\n":"
\n"},t.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+""+r+">\n"},t.listitem=function(e){return"\n\n"+e+"\n"+t+"
\n"},t.tablerow=function(e){return"\n"+e+" \n"},t.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+""+n+">\n"},t.strong=function(e){return""+e+""},t.em=function(e){return""+e+""},t.codespan=function(e){return""+e+"
"},t.br=function(){return this.options.xhtml?"
":"
"},t.del=function(e){return""+e+""},t.link=function(e,t,n){if(null===(e=X(this.options.sanitize,this.options.baseUrl,e)))return n;var r='"+n+""},t.image=function(e,t,n){if(null===(e=X(this.options.sanitize,this.options.baseUrl,e)))return n;var r='":">"},t.text=function(e){return e},e}(),ee=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,n){return""+n},t.image=function(e,t,n){return""+n},t.br=function(){return""},e}(),te=function(){function e(){this.seen={}}return e.prototype.slug=function(e){var t=e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var n=t;do{this.seen[n]++,t=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},e}(),ne=r.defaults,re=E,ie=function(){function e(e){this.options=e||ne,this.options.renderer=this.options.renderer||new Z,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ee,this.slugger=new te}e.parse=function(t,n){return new e(n).parse(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var n,r,i,o,a,s,l,c,u,h,p,f,d,m,g,y,v,_,b="",w=e.length;for(n=0;n
"+se(e.message+"",!0)+"";throw e}}return he.options=he.setOptions=function(e){return oe(he.defaults,e),ce(he.defaults),he},he.getDefaults=le,he.defaults=ue,he.use=function(e){var t=oe({},e);if(e.renderer&&function(){var n=he.defaults.renderer||new Z,r=function(t){var r=n[t];n[t]=function(){for(var i=arguments.length,o=new Array(i),a=0;a{e=e=>{r(e),n.isPending=!1},t=e=>{i(e),n.isPending=!1}}).catch(e=>Promise.reject(e));return n.resolve=e,n.reject=t,"finally"in n||(n.finally=e=>{n.then(e),n.catch(e)}),n.isPending=!0,n}Object.defineProperty(t,"__esModule",{value:!0}),t.future=n,t.default=n})),future=unwrapExports(fpFuture),fpFuture_1=fpFuture.future;async function injectScript(e){const t=future(),n=document.createElement("script");return n.src=e,n.async=!0,n.type="application/javascript",n.addEventListener("load",t.resolve),n.addEventListener("error",e=>t.reject(e.error||e)),document.body.appendChild(n),t}async function injectCss(e){const t=future(),n=document.createElement("link");return n.href=e,n.rel="stylesheet",n.addEventListener("load",t.resolve),n.addEventListener("error",e=>t.reject(e.error||e)),document.body.appendChild(n),t}function fallbackCopyTextToClipboard(e){var t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{var n=document.execCommand("copy")?"successful":"unsuccessful";console.log("Fallback: Copying text command was "+n)}catch(e){console.error("Fallback: Oops, unable to copy",e)}document.body.removeChild(t)}async function copyTextToClipboard(e){return navigator.clipboard?navigator.clipboard.writeText(e).then((function(){console.log("Async: Copying to clipboard was successful!")}),(function(e){console.error("Async: Could not copy text: ",e)})):fallbackCopyTextToClipboard(e)}function generateStaticLinkFragment(e){return"/static?t="+encodeURIComponent(e)}function generateStaticLink(e){return document.location.protocol+"//"+document.location.host+"#"+generateStaticLinkFragment(e)}var sizeMap={small:16,medium:32,large:64};function getSvgProps(e){var t=e["aria-label"],n=e.className,r=e.size,i=e.verticalAlign,o=e.svgDataByHeight,a=sizeMap[r]||r,s=closestNaturalHeight(Object.keys(o),a),l=o[s].width;return{"aria-hidden":t?"false":"true","aria-label":t,role:"img",className:n,viewBox:"0 0 "+l+" "+s,width:a*(l/s),height:a,fill:"currentColor",style:{display:"inline-block",userSelect:"none",verticalAlign:i},dangerouslySetInnerHTML:{__html:o[s].path}}}function closestNaturalHeight(e,t){return e.map((function(e){return parseInt(e,10)})).reduce((function(e,n){return n<=t?n:e}),e[0])}var _extends$1=Object.assign||function(e){for(var t=1;t
'+(n?e:J(e,!0))+"
\n":""+(n?e:J(e,!0))+"
\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,n,r){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return t&&(t=""+t+""),""+e+"
"},t.br=function(){return this.options.xhtml?""+se(e.message+"",!0)+"";throw e}}return he.options=he.setOptions=function(e){return oe(he.defaults,e),ce(he.defaults),he},he.getDefaults=le,he.defaults=ue,he.use=function(e){var t=oe({},e);if(e.renderer&&function(){var n=he.defaults.renderer||new Z,r=function(t){var r=n[t];n[t]=function(){for(var i=arguments.length,o=new Array(i),a=0;at.reject(e.error||e)),document.body.appendChild(n),t}async function injectCss(e){const t=future(),n=document.createElement("link");return n.href=e,n.rel="stylesheet",n.addEventListener("load",t.resolve),n.addEventListener("error",e=>t.reject(e.error||e)),document.body.appendChild(n),t}function fallbackCopyTextToClipboard(e){var t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{var n=document.execCommand("copy")?"successful":"unsuccessful";console.log("Fallback: Copying text command was "+n)}catch(e){console.error("Fallback: Oops, unable to copy",e)}document.body.removeChild(t)}async function copyTextToClipboard(e){return navigator.clipboard?navigator.clipboard.writeText(e).then((function(){console.log("Async: Copying to clipboard was successful!")}),(function(e){console.error("Async: Could not copy text: ",e)})):fallbackCopyTextToClipboard(e)}function generateStaticLinkFragment(e){return"/static?t="+encodeURIComponent(e)}function generateStaticLink(e){return document.location.protocol+"//"+document.location.host+"#"+generateStaticLinkFragment(e)}var sizeMap={small:16,medium:32,large:64};function getSvgProps(e){var t=e["aria-label"],n=e.className,r=e.size,i=e.verticalAlign,o=e.svgDataByHeight,a=sizeMap[r]||r,s=closestNaturalHeight(Object.keys(o),a),l=o[s].width;return{"aria-hidden":t?"false":"true","aria-label":t,role:"img",className:n,viewBox:"0 0 "+l+" "+s,width:a*(l/s),height:a,fill:"currentColor",style:{display:"inline-block",userSelect:"none",verticalAlign:i},dangerouslySetInnerHTML:{__html:o[s].path}}}function closestNaturalHeight(e,t){return e.map((function(e){return parseInt(e,10)})).reduce((function(e,n){return n<=t?n:e}),e[0])}var _extends$1=Object.assign||function(e){for(var t=1;t
+ {code} ++ ); +} + +function Dot(props: { code: string }) { + const [html, setHtml] = useState("Loading..."); + const [error, setError] = useState
{error}} + +
;
+ } else if ($.type === "paragraph") {
+ if ("tokens" in $) {
+ return {($ as any).tokens.map(renderMarkdown)}
; + } + return{unescape($)}
; + } else if ($.type === "blockquote") { + if ("tokens" in $) { + return ( ++ {($ as any).tokens.map(renderMarkdown)} ++ ); + } + return
{unescape($)}; + } else if ($.type === "em") { + if ("tokens" in $) { + return {($ as any).tokens.map(renderMarkdown)}; + } + return {unescape($)}; + } else if ($.type === "strong") { + if ("tokens" in $) { + return {($ as any).tokens.map(renderMarkdown)}; + } + return {unescape($)}; + } else if ($.type === "html") { + return {JSON.stringify($.raw, null, 2)}; + } else if ($.type === "text") { + if ("tokens" in $) { + return {($ as any).tokens.map(renderMarkdown)}; + } + return {unescape($)}; + } else if ($.type === "codespan") { + return
{unescape($)}
;
+ } else if ($.type === "link") {
+ return {unescape($)};
+ } else if ($.type === "space") {
+ return ;
+ } else if ($.type === "escape") {
+ return {unescape($)};
+ } else if ($.type === "hr") {
+ return
+ {JSON.stringify($, null, 2)}
+
+ );
+}
diff --git a/src/diagrams.tsx b/src/diagrams.tsx
index 38ed261..a8616b2 100644
--- a/src/diagrams.tsx
+++ b/src/diagrams.tsx
@@ -2,7 +2,7 @@ import { injectScript } from "./helpers";
import React, { useEffect, useRef, useState } from "react";
import { DownloadSvg } from "./components/DownloadSvg";
-export const monospaceFont = `Menlo, Monaco, "Courier New", monospace`
+export const monospaceFont = `Menlo, Monaco, "Courier New", monospace`;
const font = `14px ${monospaceFont}`;
@@ -684,7 +684,11 @@ export function SequenceDiagram(props: { input: string; className?: string }) {
if (!error) {
return (
- - {unescape($.code)} -- ); -} - -function defaultExpandedSize() { + } catch {} return window.innerWidth * 0.3; } -function Dot(props: { code: string }) { - const [html, setHtml] = useState("Loading..."); - const [error, setError] = useState
{error}} - -
- );
- } else if ($.type === "paragraph") {
- if ("tokens" in $) {
- return {($ as any).tokens.map(render)}
; - } - return{unescape($.text)}
; - } else if ($.type === "blockquote") { - if ("tokens" in $) { - return ( -{($ as any).tokens.map(render)}- ); - } - return
{unescape($.text)}; - } else if ($.type === "em") { - if ("tokens" in $) { - return {($ as any).tokens.map(render)}; - } - return {unescape($.text)}; - } else if ($.type === "strong") { - if ("tokens" in $) { - return {($ as any).tokens.map(render)}; - } - return {unescape($.text)}; - } else if ($.type === "html") { - return {JSON.stringify($.raw, null, 2)}; - } else if ($.type === "text") { - if ("tokens" in $) { - return {($ as any).tokens.map(render)}; - } - return {unescape($.text)}; - } else if ($.type === "codespan") { - return
{unescape($.text)}
;
- } else if ($.type === "link") {
- return {unescape($.text)};
- } else if ($.type === "space") {
- return ;
- } else if ($.type === "escape") {
- return {unescape($.text)};
- } else if ($.type === "hr") {
- return
- {JSON.stringify($, null, 2)}
-
- );
-}
-
export function Editor(props: { readonly?: boolean; newModel?: boolean }) {
const editorRef = useRef