From 806699d478c0ab3a2b0e960c7a3bccd3b92f75ba Mon Sep 17 00:00:00 2001 From: Steph <35910788+huynhicode@users.noreply.github.com> Date: Fri, 6 Sep 2024 08:20:05 -0700 Subject: [PATCH 1/8] add product hunt badge to navbar --- src/lib/components/Navbar.svelte | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib/components/Navbar.svelte b/src/lib/components/Navbar.svelte index 37a16b7b..83f19983 100644 --- a/src/lib/components/Navbar.svelte +++ b/src/lib/components/Navbar.svelte @@ -89,6 +89,17 @@ Mermaidv{version} Live Editor + + + Date: Thu, 3 Oct 2024 01:50:54 -0700 Subject: [PATCH 2/8] add and update product hunt promo for whiteboard --- src/lib/components/Navbar.svelte | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/lib/components/Navbar.svelte b/src/lib/components/Navbar.svelte index 83f19983..ca513450 100644 --- a/src/lib/components/Navbar.svelte +++ b/src/lib/components/Navbar.svelte @@ -89,17 +89,25 @@ Mermaidv{version} Live Editor - + - + class="decoration font-semibold underline decoration-orange-500 decoration-2 underline-offset-4"> + We're live on Product Hunt! + + + + + Date: Mon, 21 Oct 2024 23:32:40 -0700 Subject: [PATCH 3/8] remove product hunt promo --- src/lib/components/Navbar.svelte | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/lib/components/Navbar.svelte b/src/lib/components/Navbar.svelte index 1290591c..8316c419 100644 --- a/src/lib/components/Navbar.svelte +++ b/src/lib/components/Navbar.svelte @@ -97,25 +97,6 @@ Mermaidv{version} Live Editor - - - We're live on Product Hunt! - - - - - Date: Tue, 22 Oct 2024 00:07:40 -0700 Subject: [PATCH 4/8] update taglines --- src/lib/util/promos/October2024.svelte | 55 ++++++++++++++++++++++++++ src/lib/util/promos/promo.ts | 9 ++++- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 src/lib/util/promos/October2024.svelte diff --git a/src/lib/util/promos/October2024.svelte b/src/lib/util/promos/October2024.svelte new file mode 100644 index 00000000..cca33f8a --- /dev/null +++ b/src/lib/util/promos/October2024.svelte @@ -0,0 +1,55 @@ + + + + {#key currentTagline} + + {currentTagline.label} + Try now + + {/key} + diff --git a/src/lib/util/promos/promo.ts b/src/lib/util/promos/promo.ts index 98ed7fec..d58536c4 100644 --- a/src/lib/util/promos/promo.ts +++ b/src/lib/util/promos/promo.ts @@ -1,6 +1,7 @@ import { writable, type Writable, get } from 'svelte/store'; import { persist, localStorage } from '../persist'; import August2024 from './August2024.svelte'; +import October2024 from './October2024.svelte'; import { env } from '$lib/util/env'; interface Promotion { @@ -14,8 +15,14 @@ const promotions: Promotion[] = [ { id: 'promo-2024', startDate: new Date('2024-08-01'), - endDate: new Date('2024-12-31'), + endDate: new Date('2024-10-20'), component: August2024 + }, + { + id: 'promo-october-2024', + startDate: new Date('2024-10-21'), + endDate: new Date('2024-12-31'), + component: October2024 } ]; From 76c937a878a1a86d1f305c324027145d5ac52a03 Mon Sep 17 00:00:00 2001 From: Steph <35910788+huynhicode@users.noreply.github.com> Date: Tue, 22 Oct 2024 00:12:07 -0700 Subject: [PATCH 5/8] update dates --- src/lib/util/promos/promo.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/util/promos/promo.ts b/src/lib/util/promos/promo.ts index d58536c4..a7b865a3 100644 --- a/src/lib/util/promos/promo.ts +++ b/src/lib/util/promos/promo.ts @@ -15,12 +15,12 @@ const promotions: Promotion[] = [ { id: 'promo-2024', startDate: new Date('2024-08-01'), - endDate: new Date('2024-10-20'), + endDate: new Date('2024-10-21'), component: August2024 }, { id: 'promo-october-2024', - startDate: new Date('2024-10-21'), + startDate: new Date('2024-10-22'), endDate: new Date('2024-12-31'), component: October2024 } From 659e82e9ae950e04adb83c04690c780cbbe4b2ba Mon Sep 17 00:00:00 2001 From: Steph <35910788+huynhicode@users.noreply.github.com> Date: Tue, 22 Oct 2024 07:35:08 -0700 Subject: [PATCH 6/8] remove august promo --- src/lib/util/promos/August2024.svelte | 51 --------------------------- src/lib/util/promos/promo.ts | 7 ---- 2 files changed, 58 deletions(-) delete mode 100644 src/lib/util/promos/August2024.svelte diff --git a/src/lib/util/promos/August2024.svelte b/src/lib/util/promos/August2024.svelte deleted file mode 100644 index ea734bf4..00000000 --- a/src/lib/util/promos/August2024.svelte +++ /dev/null @@ -1,51 +0,0 @@ - - - - {#key currentTagline} - - {currentTagline.label} - Try it now - - {/key} - diff --git a/src/lib/util/promos/promo.ts b/src/lib/util/promos/promo.ts index a7b865a3..851cb761 100644 --- a/src/lib/util/promos/promo.ts +++ b/src/lib/util/promos/promo.ts @@ -1,6 +1,5 @@ import { writable, type Writable, get } from 'svelte/store'; import { persist, localStorage } from '../persist'; -import August2024 from './August2024.svelte'; import October2024 from './October2024.svelte'; import { env } from '$lib/util/env'; @@ -12,12 +11,6 @@ interface Promotion { } const promotions: Promotion[] = [ - { - id: 'promo-2024', - startDate: new Date('2024-08-01'), - endDate: new Date('2024-10-21'), - component: August2024 - }, { id: 'promo-october-2024', startDate: new Date('2024-10-22'), From cfdb4fbf61d840b10d91c05103aced99981ea273 Mon Sep 17 00:00:00 2001 From: Steph <35910788+huynhicode@users.noreply.github.com> Date: Wed, 30 Oct 2024 09:20:01 -0700 Subject: [PATCH 7/8] update whiteboard tagline --- src/lib/util/promos/October2024.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/util/promos/October2024.svelte b/src/lib/util/promos/October2024.svelte index cca33f8a..913fd73e 100644 --- a/src/lib/util/promos/October2024.svelte +++ b/src/lib/util/promos/October2024.svelte @@ -10,7 +10,7 @@ const taglines: Taglines[] = [ { label: 'Explore the Mermaid Whiteboard from the creators of Mermaid', - url: 'https://docs.mermaidchart.com/guides/whiteboard?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=whiteboard' + url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=whiteboard' }, { label: 'Use the Visual Editor in Mermaid Chart to design and build diagrams', From 3e3a0162bf9cfde4093f6989774b3ec2812ba499 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Fri, 8 Nov 2024 22:46:54 +0530 Subject: [PATCH 8/8] fix: Add fallback for state --- src/lib/util/state.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/util/state.ts b/src/lib/util/state.ts index 0af19b89..69e6f190 100644 --- a/src/lib/util/state.ts +++ b/src/lib/util/state.ts @@ -124,6 +124,9 @@ export const loadState = (data: string): void => { console.log(`Loading '${data}'`); try { state = deserializeState(data); + if (!state.mermaid) { + state.mermaid = defaultState.mermaid; + } const mermaidConfig: MermaidConfig = typeof state.mermaid === 'string' ? (JSON.parse(state.mermaid) as MermaidConfig)