Skip to content

Commit

Permalink
Merge pull request #630 from tone-row/dev
Browse files Browse the repository at this point in the history
v1.45.3
  • Loading branch information
rob-gordon authored Dec 1, 2023
2 parents 6814886 + 7ad575b commit e40696d
Show file tree
Hide file tree
Showing 19 changed files with 185 additions and 107 deletions.
37 changes: 36 additions & 1 deletion api/_lib/_notion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,22 @@ marked.setOptions({
});

export async function getPostHtmlFromId(id: string) {
const mdblocks = await n2m.pageToMarkdown(id);
let mdblocks = await n2m.pageToMarkdown(id);
// convert video blocks to HTML
mdblocks = mdblocks.map((block) => {
if (block.type === "video") {
const videoHtml = videoBlockToHtml(block);
if (videoHtml) {
return {
type: "html",
parent: videoHtml,
children: [],
};
}
}
return block;
});

const mdString = n2m.toMarkdownString(mdblocks);
const html = marked(mdString);
return html;
Expand All @@ -67,3 +82,23 @@ const AREAS_OF_RESEARCH_PAGE_ID = "6797865c1d744aa0babbea7d1558e8b3";
export async function getAreasOfResearchHtml() {
return await getPostHtmlFromId(AREAS_OF_RESEARCH_PAGE_ID);
}

/**
Takes a block in the format
{
type: 'video',
parent: '[image](url)',
children: []
}
and returns an HTML <video /> element with audio muted and autoplay, looping enabled
*/
function videoBlockToHtml(block: any) {
const markdown = block.parent;
const url = markdown.match(/\(([^)]+)\)/)[1];
if (url) return `<video src="${url}" muted autoplay loop></video>`;

return null;
}
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app",
"version": "1.45.2",
"version": "1.45.3",
"main": "module/module.js",
"license": "MIT",
"scripts": {
Expand Down
13 changes: 12 additions & 1 deletion app/src/components/ShareDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,23 @@ function VisioCSVDownload() {
const filename = useDownloadFilename();
return (
<div className="grid gap-2">
<p className="text-sm text-neutral-500 dark:text-neutral-400">
<p className="text-sm text-neutral-600 dark:text-neutral-400">
<Trans>
Import your diagram it into Microsoft Visio using one of these CSV
files.
</Trans>
</p>
<p className="text-sm text-neutral-600 dark:text-neutral-400">
<Trans>Check out the guide:</Trans>{" "}
<a
href="https://flowchart.fun/blog/post/export-to-microsoft-visio"
target="_blank"
rel="noopener noreferrer"
className="text-blue-500 dark:text-blue-300 font-bold"
>
How to Export Your Flowchart Fun Diagrams to Visio
</a>
</p>
<div className="grid md:grid-cols-[repeat(2,minmax(0,300px))] gap-1 md:gap-2">
<VisioDownloadOption
imgSrc="/images/visio-flowchart.svg"
Expand Down
2 changes: 1 addition & 1 deletion app/src/locales/de/messages.js

Large diffs are not rendered by default.

28 changes: 16 additions & 12 deletions app/src/locales/de/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ msgstr "Zurück zum Editor"
msgid "Background Color"
msgstr "Hintergrundfarbe"

#: src/components/ShareDialog.tsx:495
#: src/components/ShareDialog.tsx:511
msgid "Basic Flowchart"
msgstr "Grundlegender Flussdiagramm"

Expand Down Expand Up @@ -185,6 +185,10 @@ msgstr "Änderungsprotokoll"
msgid "Charts"
msgstr "Diagramme"

#: src/components/ShareDialog.tsx:498
msgid "Check out the guide:"
msgstr "Schau dir die Anleitung an:"

#: src/pages/LogIn.tsx:80
msgid "Check your email for a link to log in.<0/>You can close this window."
msgstr "Überprüfen Sie Ihre E-Mail auf einen Link zum Einloggen. Sie können dieses Fenster schließen."
Expand Down Expand Up @@ -297,7 +301,7 @@ msgstr "PNG-Bild kopieren"
msgid "Copy SVG Code"
msgstr "Kopieren Sie den SVG-Code"

#: src/components/ShareDialog.tsx:388
#: src/components/ShareDialog.tsx:393
msgid "Copy your Excalidraw code and paste it into <0>excalidraw.com</0> to edit. This feature is experimental and may not work with all diagrams. If you find a bug, please <1>let us know</1>."
msgstr "Kopiere deinen Excalidraw-Code und füge ihn in <0>excalidraw.com</0> ein, um ihn zu bearbeiten. Diese Funktion ist experimentell und funktioniert möglicherweise nicht mit allen Diagrammen. Wenn du einen Fehler findest, <1>lass es uns wissen</1>."

Expand Down Expand Up @@ -390,7 +394,7 @@ msgid "Don't lose your work!"
msgstr "Verlieren Sie nicht Ihre Arbeit!"

#: src/components/ShareDialog.tsx:63
#: src/components/ShareDialog.tsx:570
#: src/components/ShareDialog.tsx:586
msgid "Download"
msgstr "Herunterladen"

Expand Down Expand Up @@ -678,15 +682,15 @@ msgstr "Importieren Sie aus Lucidchart, Visio und anderen CSV-Dateien."
msgid "Import from Visio, Lucidchart, and CSV"
msgstr "Importieren Sie von Visio, Lucidchart und CSV"

#: src/components/ShareDialog.tsx:487
#: src/components/ShareDialog.tsx:492
msgid "Import your diagram it into Microsoft Visio using one of these CSV files."
msgstr "Importieren Sie Ihr Diagramm mithilfe einer dieser CSV-Dateien in Microsoft Visio."

#: src/components/ImportDataUnauthenticatedDialog.tsx:55
msgid "Importing data is a pro feature. You can upgrade to Flowchart Fun Pro for just $3/month or $30/year."
msgstr "Der Datenimport ist eine Profifunktion. Sie können für nur 3 USD pro Monat oder 30 USD pro Jahr auf Flowchart Fun Pro upgraden."

#: src/components/ShareDialog.tsx:522
#: src/components/ShareDialog.tsx:538
msgid "Include a title using a <0>title</0> attribute. To use Visio coloring, add a <1>roleType</1> attribute equal to one of the following:"
msgstr "Fügen Sie einen Titel mit einem <0>title</0>-Attribut ein. Um die Visio-Farbgebung zu verwenden, fügen Sie ein <1>roleType</1>-Attribut gleich einem der folgenden hinzu:"

Expand Down Expand Up @@ -806,7 +810,7 @@ msgstr "Einloggen, um zu speichern"
msgid "Make a One-Time Donation"
msgstr "Machen Sie eine einmalige Spende"

#: src/components/ShareDialog.tsx:453
#: src/components/ShareDialog.tsx:458
msgid "Make publicly accessible"
msgstr "Öffentlich zugänglich machen"

Expand Down Expand Up @@ -936,7 +940,7 @@ msgstr "Öffnen Sie das Kundenportal"
msgid "Or, you can <0>create a new subscription</0>."
msgstr "Oder Sie können ein neues Abonnement erstellen."

#: src/components/ShareDialog.tsx:508
#: src/components/ShareDialog.tsx:524
#: src/lib/templates/templates.ts:40
msgid "Organization Chart"
msgstr "Organigramm"
Expand Down Expand Up @@ -988,8 +992,8 @@ msgstr "Datenverarbeitung"
msgid "Product is too expensive..."
msgstr "Das Produkt ist zu teuer..."

#: src/components/ShareDialog.tsx:449
#: src/components/ShareDialog.tsx:472
#: src/components/ShareDialog.tsx:454
#: src/components/ShareDialog.tsx:477
msgid "Public"
msgstr "Öffentlich"

Expand Down Expand Up @@ -1345,7 +1349,7 @@ msgstr "Dies ersetzt den aktuellen Inhalt."
msgid "This will replace your current sandbox."
msgstr "Dies ersetzt deine aktuelle Sandbox."

#: src/components/ShareDialog.tsx:579
#: src/components/ShareDialog.tsx:595
msgid "Tip"
msgstr "Tipp"

Expand Down Expand Up @@ -1471,11 +1475,11 @@ msgstr "Verwenden Sie das Kundenportal, um Ihre Rechnungsinformationen zu änder
msgid "Use these settings to adapt the look and behavior of your flowcharts"
msgstr "Verwenden Sie diese Einstellungen, um das Aussehen und Verhalten Ihrer Flussdiagramme anzupassen"

#: src/components/ShareDialog.tsx:517
#: src/components/ShareDialog.tsx:533
msgid "Use this file for org charts, hierarchies, and other organizational structures."
msgstr "Verwenden Sie diese Datei für Organigramme, Hierarchien und andere Organisationsstrukturen."

#: src/components/ShareDialog.tsx:504
#: src/components/ShareDialog.tsx:520
msgid "Use this file for sequences, processes, and workflows."
msgstr "Verwenden Sie diese Datei für Sequenzen, Prozesse und Workflows."

Expand Down
2 changes: 1 addition & 1 deletion app/src/locales/en/messages.js

Large diffs are not rendered by default.

28 changes: 16 additions & 12 deletions app/src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ msgstr "Back To Editor"
msgid "Background Color"
msgstr "Background Color"

#: src/components/ShareDialog.tsx:495
#: src/components/ShareDialog.tsx:511
msgid "Basic Flowchart"
msgstr "Basic Flowchart"

Expand Down Expand Up @@ -185,6 +185,10 @@ msgstr "Changelog"
msgid "Charts"
msgstr "Charts"

#: src/components/ShareDialog.tsx:498
msgid "Check out the guide:"
msgstr "Check out the guide:"

#: src/pages/LogIn.tsx:80
msgid "Check your email for a link to log in.<0/>You can close this window."
msgstr "Check your email for a link to log in.<0/>You can close this window."
Expand Down Expand Up @@ -297,7 +301,7 @@ msgstr "Copy PNG Image"
msgid "Copy SVG Code"
msgstr "Copy SVG Code"

#: src/components/ShareDialog.tsx:388
#: src/components/ShareDialog.tsx:393
msgid "Copy your Excalidraw code and paste it into <0>excalidraw.com</0> to edit. This feature is experimental and may not work with all diagrams. If you find a bug, please <1>let us know</1>."
msgstr "Copy your Excalidraw code and paste it into <0>excalidraw.com</0> to edit. This feature is experimental and may not work with all diagrams. If you find a bug, please <1>let us know</1>."

Expand Down Expand Up @@ -390,7 +394,7 @@ msgid "Don't lose your work!"
msgstr "Don't lose your work!"

#: src/components/ShareDialog.tsx:63
#: src/components/ShareDialog.tsx:570
#: src/components/ShareDialog.tsx:586
msgid "Download"
msgstr "Download"

Expand Down Expand Up @@ -678,15 +682,15 @@ msgstr "Import from Lucidchart, Visio, and other CSV files."
msgid "Import from Visio, Lucidchart, and CSV"
msgstr "Import from Visio, Lucidchart, and CSV"

#: src/components/ShareDialog.tsx:487
#: src/components/ShareDialog.tsx:492
msgid "Import your diagram it into Microsoft Visio using one of these CSV files."
msgstr "Import your diagram it into Microsoft Visio using one of these CSV files."

#: src/components/ImportDataUnauthenticatedDialog.tsx:55
msgid "Importing data is a pro feature. You can upgrade to Flowchart Fun Pro for just $3/month or $30/year."
msgstr "Importing data is a pro feature. You can upgrade to Flowchart Fun Pro for just $3/month or $30/year."

#: src/components/ShareDialog.tsx:522
#: src/components/ShareDialog.tsx:538
msgid "Include a title using a <0>title</0> attribute. To use Visio coloring, add a <1>roleType</1> attribute equal to one of the following:"
msgstr "Include a title using a <0>title</0> attribute. To use Visio coloring, add a <1>roleType</1> attribute equal to one of the following:"

Expand Down Expand Up @@ -806,7 +810,7 @@ msgstr "Log in to Save"
msgid "Make a One-Time Donation"
msgstr "Make a One-Time Donation"

#: src/components/ShareDialog.tsx:453
#: src/components/ShareDialog.tsx:458
msgid "Make publicly accessible"
msgstr "Make publicly accessible"

Expand Down Expand Up @@ -936,7 +940,7 @@ msgstr "Open Customer Portal"
msgid "Or, you can <0>create a new subscription</0>."
msgstr "Or, you can <0>create a new subscription</0>."

#: src/components/ShareDialog.tsx:508
#: src/components/ShareDialog.tsx:524
#: src/lib/templates/templates.ts:40
msgid "Organization Chart"
msgstr "Organization Chart"
Expand Down Expand Up @@ -988,8 +992,8 @@ msgstr "Processing Data"
msgid "Product is too expensive..."
msgstr "Product is too expensive..."

#: src/components/ShareDialog.tsx:449
#: src/components/ShareDialog.tsx:472
#: src/components/ShareDialog.tsx:454
#: src/components/ShareDialog.tsx:477
msgid "Public"
msgstr "Public"

Expand Down Expand Up @@ -1345,7 +1349,7 @@ msgstr "This will replace the current content."
msgid "This will replace your current sandbox."
msgstr "This will replace your current sandbox."

#: src/components/ShareDialog.tsx:579
#: src/components/ShareDialog.tsx:595
msgid "Tip"
msgstr "Tip"

Expand Down Expand Up @@ -1471,11 +1475,11 @@ msgstr "Use the customer portal to change your billing information."
msgid "Use these settings to adapt the look and behavior of your flowcharts"
msgstr "Use these settings to adapt the look and behavior of your flowcharts"

#: src/components/ShareDialog.tsx:517
#: src/components/ShareDialog.tsx:533
msgid "Use this file for org charts, hierarchies, and other organizational structures."
msgstr "Use this file for org charts, hierarchies, and other organizational structures."

#: src/components/ShareDialog.tsx:504
#: src/components/ShareDialog.tsx:520
msgid "Use this file for sequences, processes, and workflows."
msgstr "Use this file for sequences, processes, and workflows."

Expand Down
2 changes: 1 addition & 1 deletion app/src/locales/es/messages.js

Large diffs are not rendered by default.

Loading

1 comment on commit e40696d

@vercel
Copy link

@vercel vercel bot commented on e40696d Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.