diff --git a/.vscode/settings.json b/.vscode/settings.json index b2a443e0..0076002f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -47,5 +47,9 @@ "tailwindCSS.experimental.classRegex": [ ["([\"'`][^\"'`]*.*?[\"'`])", "[\"'`]([^\"'`]*).*?[\"'`]"] ], - "tailwindCSS.emmetCompletions": true + "tailwindCSS.emmetCompletions": true, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit", + "source.organizeImports": "explicit" + } } diff --git a/src/lib/components/Actions.svelte b/src/lib/components/Actions.svelte index 8c91ab5f..578c98c4 100644 --- a/src/lib/components/Actions.svelte +++ b/src/lib/components/Actions.svelte @@ -2,12 +2,13 @@ import Card from '$/components/Card/Card.svelte'; import CopyButton from '$/components/CopyButton.svelte'; import CopyInput from '$/components/CopyInput.svelte'; + import ExternalLinkWrapper from '$/components/ExternalLinkWrapper.svelte'; import { Button } from '$/components/ui/button'; import { Input } from '$/components/ui/input'; import { Separator } from '$/components/ui/separator'; import * as ToggleGroup from '$/components/ui/toggle-group'; import { TID } from '$/constants'; - import { env } from '$/util/env'; + import { getDomain } from '$/util/util'; import { browser } from '$app/environment'; import { waitForRender } from '$lib/util/autoSync'; import { inputStateStore, stateStore, urlsStore } from '$lib/util/state'; @@ -204,11 +205,11 @@ ${svgString}`); {text} - {#if url} + - {/if} + {/snippet} @@ -235,22 +236,24 @@ ${svgString}`);
{@render dualActionButton('PNG', onDownloadPNG, $urlsStore.png)} {@render dualActionButton('SVG', onDownloadSVG, $urlsStore.svg)} - {#if env.krokiRendererUrl} + - {/if} +
{#if isClipboardAvailable()} {/if} - {#if $urlsStore.mdCode} + - {/if} - +
diff --git a/src/lib/components/ExternalLinkWrapper.svelte b/src/lib/components/ExternalLinkWrapper.svelte new file mode 100644 index 00000000..be0c885c --- /dev/null +++ b/src/lib/components/ExternalLinkWrapper.svelte @@ -0,0 +1,59 @@ + + +{#if isVisible} + + + +
+ {@render children()} +
+
+ +
+ {#if shouldDisableComponent} +
+ This diagram type is not supported in {domain} +
+ {:else} + + + {labelPrefix} +
{domain}
+
+ {/if} +
+
+
+
+{/if} diff --git a/src/lib/components/MainMenu.svelte b/src/lib/components/MainMenu.svelte index b0f838a9..065590a1 100644 --- a/src/lib/components/MainMenu.svelte +++ b/src/lib/components/MainMenu.svelte @@ -29,16 +29,18 @@ href: $urlsStore.mermaidChart({ medium: 'main_menu' }).playground }, { - label: 'Plugins', - icon: PluginIcon, + checkDiagramType: false, href: $urlsStore.mermaidChart({ medium: 'main_menu' }).plugins, - checkDiagramType: false + icon: PluginIcon, + label: 'Plugins', + sharesData: false }, { - label: 'MermaidChart', - icon: MermaidChartIcon, + checkDiagramType: false, href: $urlsStore.mermaidChart({ medium: 'main_menu' }).home, - checkDiagramType: false + icon: MermaidChartIcon, + label: 'MermaidChart', + sharesData: false } ]); @@ -76,7 +78,11 @@
{#each mermaidChartMenuItems as item} - + {@render menuItem({ ...item, class: 'text-accent bg-background hover:bg-muted' diff --git a/src/lib/components/McWrapper.svelte b/src/lib/components/McWrapper.svelte index 5fedf0b1..6dcd525a 100644 --- a/src/lib/components/McWrapper.svelte +++ b/src/lib/components/McWrapper.svelte @@ -1,50 +1,17 @@ -{#if env.isEnabledMermaidChartLinks} - - - -
- {@render children()} -
-
- -
- {#if shouldDisableComponent} -
- This diagram type is not supported in MermaidChart.com -
- {:else} - - - {labelPrefix} -
MermaidChart.com
-
- {/if} -
-
-
-
-{/if} + + {@render children()} + diff --git a/src/lib/components/Navbar.svelte b/src/lib/components/Navbar.svelte index f25d48e6..42e7c264 100644 --- a/src/lib/components/Navbar.svelte +++ b/src/lib/components/Navbar.svelte @@ -96,7 +96,7 @@ Live Editor - +