mirror of
https://github.com/mermaid-js/mermaid-live-editor.git
synced 2026-11-04 08:59:08 +00:00
feat: remove the retired Mermaid Chart Playground from the Share dialog
The playground has been retired, so the Share dialog no longer offers a link to it and only lists the Live Editor link and the embed section. The now-unused "share" analytics medium goes with it; the playground URL itself stays until the main menu entry is removed separately. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
408462ad04
commit
db83b992c6
3 files changed
+11
-17
No files matched your search
@@ -8,16 +8,14 @@
|
||||
import { MERMAID_LOOKS, MERMAID_THEMES, TID } from '$/constants';
|
||||
import { isDarkTheme, type EmbedMode } from '$/util/embed';
|
||||
import { EMBED_IFRAME_SANDBOX, buildEmbedSnippets, buildEmbedUrls } from '$/util/embedCode';
|
||||
import { env } from '$/util/env';
|
||||
import { silentlySanitizeConfig } from '$/util/sanitize';
|
||||
import { urls, validatedState } from '$/util/state.svelte';
|
||||
import { validatedState } from '$/util/state.svelte';
|
||||
import { copyToClipboard } from '$/util/util';
|
||||
import { asset, base } from '$app/paths';
|
||||
import CodeIcon from '~icons/material-symbols/code';
|
||||
import ShareIcon from '~icons/material-symbols/share';
|
||||
import CopyButton from './CopyButton.svelte';
|
||||
import CopyInput from './CopyInput.svelte';
|
||||
import MermaidChartIcon from './MermaidChartIcon.svelte';
|
||||
|
||||
const sanitizedConfig = $derived(silentlySanitizeConfig(validatedState.current.mermaid));
|
||||
// Deliberate initial-value capture: the embed form seeds from the config at
|
||||
@@ -74,19 +72,6 @@
|
||||
The content of the diagrams you create never leaves your browser.
|
||||
</Dialog.Description>
|
||||
</div>
|
||||
{#if env.isEnabledMermaidChartLinks}
|
||||
<Separator />
|
||||
<div class="flex flex-col gap-2">
|
||||
<h2 class="flex items-center gap-2">
|
||||
<MermaidChartIcon class="size-5" />
|
||||
Mermaid Chart Playground
|
||||
</h2>
|
||||
<CopyInput value={urls.current.mermaidChart({ medium: 'share' }).playground} />
|
||||
<Dialog.Description>
|
||||
Opens the Mermaid Chart Playground with Mermaid AI, Visual Editor, and more.
|
||||
</Dialog.Description>
|
||||
</div>
|
||||
{/if}
|
||||
<Separator />
|
||||
<div class="flex flex-col gap-3">
|
||||
<h2 class="flex items-center gap-2">
|
||||
|
||||
@@ -164,7 +164,6 @@ const urlsCurrent = $derived.by(() => {
|
||||
| 'ai_repair'
|
||||
| 'main_menu'
|
||||
| 'save_diagram'
|
||||
| 'share'
|
||||
| 'vibe_diagramming'
|
||||
| 'visual_edit'
|
||||
| 'voice_edit';
|
||||
|
||||
@@ -98,6 +98,16 @@ base.describe('Embed page', () => {
|
||||
});
|
||||
|
||||
editorTest.describe('Share dialog embed section', () => {
|
||||
editorTest('should only offer the live editor link and the embed', async ({ editPage, page }) => {
|
||||
void editPage;
|
||||
await page.getByRole('button', { name: 'Share' }).click();
|
||||
const dialog = page.getByRole('dialog');
|
||||
await expect(dialog.getByRole('heading', { name: 'Mermaid Live Editor' })).toBeVisible();
|
||||
await expect(dialog.getByRole('heading', { name: 'Embed' })).toBeVisible();
|
||||
// The Mermaid Chart Playground is retired and must not be offered any more.
|
||||
await expect(dialog).not.toContainText('Playground');
|
||||
});
|
||||
|
||||
editorTest('should offer iframe and web component snippets', async ({ editPage, page }) => {
|
||||
void editPage;
|
||||
await page.getByRole('button', { name: 'Share' }).click();
|
||||
|
||||
Reference in new issue
Block a user