Skip to content

Commit

Permalink
Update Graph Selector and Other Packages (#695)
Browse files Browse the repository at this point in the history
* Upgrade graph-selector version and posthog

* Upgrade to better highlighter

* Fix the load-in of text because it's too slow
  • Loading branch information
rob-gordon authored Jul 27, 2024
1 parent 99a4868 commit 51a1fb0
Show file tree
Hide file tree
Showing 21 changed files with 1,052 additions and 373 deletions.
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"axios": "^0.27.2",
"csv-parse": "^5.3.6",
"date-fns": "^2.29.3",
"graph-selector": "^0.10.0",
"graph-selector": "^0.11.1",
"highlight.js": "^11.8.0",
"marked": "^4.1.1",
"micro": "^10.0.1",
Expand Down
4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"file-saver": "^2.0.5",
"formulaic": "workspace:*",
"framer-motion": "^10.13.1",
"graph-selector": "^0.10.0",
"graph-selector": "^0.11.1",
"gray-matter": "^4.0.2",
"highlight.js": "^11.7.0",
"immer": "^9.0.16",
Expand All @@ -98,7 +98,7 @@
"papaparse": "^5.4.1",
"phosphor-react": "^1.3.1",
"postcss-flexbugs-fixes": "^5.0.2",
"posthog-js": "^1.133.0",
"posthog-js": "^1.150.0",
"prettier": "^2.3.1",
"re-resizable": "^6.9.0",
"react": "^18.2.0",
Expand Down
16 changes: 8 additions & 8 deletions app/src/lib/getDefaultText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { t } from "@lingui/macro";

export function getDefaultText() {
return `${t`Welcome to Flowchart Fun!`}
${t`Get Started`}: ${t`Modify the text to see it transform into a flowchart on the right.`}
${t`Understanding Syntax`} .shape_circle.color_orange
${t`Start`}: ${t`Modify text to see it transform into a flowchart on the right.`}
${t`Understand Syntax`} .shape_circle
${t`Begin Typing`}: ${t`Start with a label or decision.`}
${t`Decisions`}: ${t`Use colons, like "Explore options:".`}
${t`Indent for steps`}: ${t`Show progression or dependency.`}
${t`Customize`}: ${t`Add classes to alter color and shape`} \\(.color_blue)
${t`Right-click on nodes to see more options.`}
${t`Decisions`}: ${t`Use colons like "Decisions:".`}
${t`Indent for Steps`}: ${t`Indicate progression or dependency.`}
${t`Customize`}: ${t`Add classes to change color and shape`} \\(.color_red)
${t`Right-click nodes for more options.`}
${t`Use AI`} .color_green
${t`Paste a document or outline to auto-convert into a flowchart.`}
${t`Paste a document to convert it into a flowchart.`}
${t`Share Your Work`} .color_blue
${t`Download or convert your flowchart via the 'Share' button.`}
${t`Download or share your flowchart using the 'Share' button.`}
`;
}
18 changes: 6 additions & 12 deletions app/src/lib/writeEditorText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { useDoc } from "./useDoc";

/**
* This function takes a reference to the editor and a string and a speed
* and animates the text being written to the editor one character at a time.
* and animates the text being written to the editor one line at a time.
* It now checks for a query parameter to skip animation for e2e tests.
*/
export function writeEditorText(
interval: NodeJS.Timeout | null,
editor: editor.IStandaloneCodeEditor,
text: string,
speed: number = 30
speed: number = 1500 / 10
) {
// Check for e2e test query parameter
const urlParams = new URLSearchParams(window.location.search);
Expand All @@ -27,23 +27,17 @@ export function writeEditorText(
if (interval) clearInterval(interval);
});

let lines = text.split("\n");
let index = 0;
interval = setInterval(() => {
if (index < text.length) {
// Find the next non-whitespace character
let nextIndex = index;
while (nextIndex < text.length && /\s/.test(text[nextIndex])) {
nextIndex++;
}
nextIndex++; // Include the non-whitespace character

if (index < lines.length) {
editor.executeEdits("", [
{
range: editor.getModel()!.getFullModelRange(),
text: text.substring(0, nextIndex),
text: lines.slice(0, index + 1).join("\n"),
},
]);
index = nextIndex;
index++;
} else {
if (interval) clearInterval(interval);
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/locales/de/messages.js

Large diffs are not rendered by default.

70 changes: 36 additions & 34 deletions app/src/locales/de/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ msgid "Add a backslash (<0>\\</0>) before any special characters: <1>(</1>, <2>:
msgstr "Fügen Sie einen Backslash (<0>\\</0>) vor jedem Sonderzeichen ein: <1>(</1>, <2>:</2>, <3>#</3>, oder <4>.</4>`"

#: src/lib/getDefaultText.ts:10
msgid "Add classes to alter color and shape"
msgstr "Füge Klassen hinzu, um Farbe und Form zu ändern"
msgid "Add classes to change color and shape"
msgstr "Füge Klassen hinzu, um Farbe und Form zu ändern."

#: src/components/Tabs/ThemeTab.tsx:545
msgid "Advanced"
Expand All @@ -71,6 +71,11 @@ msgstr "Fortgeschritten"
msgid "Advanced Export Options (PNG, JPG, SVG)"
msgstr "Erweiterte Exportoptionen (PNG, JPG, SVG)"

#: src/components/GraphFloatingMenu.tsx:103
#: src/components/GraphFloatingMenu.tsx:107
msgid "Align Nodes"
msgstr "Ausrichten von Knoten"

#: src/pages/Account.tsx:278
msgid "Amount"
msgstr "Betrag"
Expand Down Expand Up @@ -292,7 +297,7 @@ msgid "Continue"
msgstr "Weiter"

#: src/components/AiToolbar.tsx:34
#: src/components/ConvertOnPasteOverlay.tsx:110
#: src/components/ConvertOnPasteOverlay.tsx:107
msgid "Convert"
msgstr "Umwandeln"

Expand Down Expand Up @@ -426,7 +431,7 @@ msgstr "Entwickle einen Entscheidungsbaum für einen CEO, um potenzielle neue Ma
msgid "Direction"
msgstr "Richtung"

#: src/components/ConvertOnPasteOverlay.tsx:81
#: src/components/ConvertOnPasteOverlay.tsx:78
msgid "Dismiss"
msgstr "Entlassen"

Expand Down Expand Up @@ -457,8 +462,8 @@ msgid "Download SVG"
msgstr "SVG herunterladen"

#: src/lib/getDefaultText.ts:15
msgid "Download or convert your flowchart via the 'Share' button."
msgstr "Lade deine Flussdiagramm herunter oder konvertiere es über die Schaltfläche \"Teilen\"."
msgid "Download or share your flowchart using the 'Share' button."
msgstr "Laden Sie Ihre Flussdiagramm herunter oder teilen Sie es mit dem 'Teilen'-Button."

#: src/components/ImportDataDialog.tsx:244
msgid "Drag and drop a CSV file here, or click to select a file"
Expand Down Expand Up @@ -662,10 +667,6 @@ msgstr "Erhalten Sie Zugang zu KI-Funktionen und verlieren Sie nie Ihre Arbeit m
msgid "General"
msgstr "Allgemein"

#: src/lib/getDefaultText.ts:5
msgid "Get Started"
msgstr "Starten"

#: src/pages/404.tsx:12
msgid "Go back home"
msgstr "Geh zurück nach Hause"
Expand Down Expand Up @@ -771,9 +772,13 @@ msgid "Include a title using a <0>title</0> attribute. To use Visio coloring, ad
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:"

#: src/lib/getDefaultText.ts:9
msgid "Indent for steps"
msgid "Indent for Steps"
msgstr "Einrücken für Schritte"

#: src/lib/getDefaultText.ts:9
msgid "Indicate progression or dependency."
msgstr "Zeige Fortschritt oder Abhängigkeit an."

#: src/components/Header.tsx:127
msgid "Info"
msgstr "Info"
Expand All @@ -782,7 +787,7 @@ msgstr "Info"
msgid "Is"
msgstr "Ist"

#: src/components/ConvertOnPasteOverlay.tsx:69
#: src/components/ConvertOnPasteOverlay.tsx:66
msgid "Is this a document? Would you like to convert it to a flowchart?"
msgstr "Ist dies ein Dokument? Möchtest du es in ein Flussdiagramm umwandeln?"

Expand All @@ -807,8 +812,8 @@ msgstr "Sprache"
msgid "Layout"
msgstr "Layout"

#: src/components/GraphFloatingMenu.tsx:82
#: src/components/GraphFloatingMenu.tsx:84
#: src/components/GraphFloatingMenu.tsx:89
#: src/components/GraphFloatingMenu.tsx:91
msgid "Layout Frozen"
msgstr "Layout eingefroren"

Expand Down Expand Up @@ -893,8 +898,8 @@ msgstr "Layout und Stile laden"
msgid "Local File Support"
msgstr "Lokale Dateiunterstützung"

#: src/components/GraphFloatingMenu.tsx:72
#: src/components/GraphFloatingMenu.tsx:74
#: src/components/GraphFloatingMenu.tsx:79
#: src/components/GraphFloatingMenu.tsx:81
msgid "Lock Zoom to Graph"
msgstr "Zoom an Graph anpassen"

Expand Down Expand Up @@ -936,8 +941,8 @@ msgid "Missing a template? Suggest one here!"
msgstr "Fehlt eine Vorlage? Schlag hier eine vor!"

#: src/lib/getDefaultText.ts:5
msgid "Modify the text to see it transform into a flowchart on the right."
msgstr "Ändere den Text, um ihn auf der rechten Seite in ein Flussdiagramm zu verwandeln."
msgid "Modify text to see it transform into a flowchart on the right."
msgstr "Ändern Sie den Text, um ihn auf der rechten Seite in ein Flussdiagramm zu verwandeln."

#: src/components/Checkout.tsx:155
msgid "Monthly"
Expand Down Expand Up @@ -1068,8 +1073,8 @@ msgid "Past Due"
msgstr "Überfällig"

#: src/lib/getDefaultText.ts:13
msgid "Paste a document or outline to auto-convert into a flowchart."
msgstr "Füge ein Dokument oder eine Gliederung ein, um es automatisch in ein Flussdiagramm umzuwandeln."
msgid "Paste a document to convert it into a flowchart."
msgstr "Fügen Sie ein Dokument ein, um es in einen Flussdiagramm umzuwandeln."

#: src/components/AiToolbar.tsx:23
msgid "Paste your document or outline here to convert it into an organized flowchart."
Expand Down Expand Up @@ -1191,8 +1196,8 @@ msgstr "Magic-Link anfordern"
msgid "Request Password Reset"
msgstr "Passwort zurücksetzen anfordern"

#: src/components/GraphFloatingMenu.tsx:37
#: src/components/GraphFloatingMenu.tsx:40
#: src/components/GraphFloatingMenu.tsx:44
#: src/components/GraphFloatingMenu.tsx:47
msgid "Reset"
msgstr "Zurücksetzen"

Expand All @@ -1217,7 +1222,7 @@ msgid "Right to Left"
msgstr "Von rechts nach links"

#: src/lib/getDefaultText.ts:11
msgid "Right-click on nodes to see more options."
msgid "Right-click nodes for more options."
msgstr "Klicken Sie mit der rechten Maustaste auf Knoten, um weitere Optionen anzuzeigen."

#: src/components/Header.tsx:155
Expand Down Expand Up @@ -1274,10 +1279,6 @@ msgstr "Teilen"
msgid "Share Your Work"
msgstr "Teilen Sie Ihre Arbeit"

#: src/lib/getDefaultText.ts:9
msgid "Show progression or dependency."
msgstr "Zeige Fortschritt oder Abhängigkeit."

#: src/pages/LogIn.tsx:102
#: src/pages/LogIn.tsx:325
msgid "Sign In"
Expand Down Expand Up @@ -1332,6 +1333,7 @@ msgstr "Abstand"
msgid "Special Attributes"
msgstr "Spezielle Attribute"

#: src/lib/getDefaultText.ts:5
#: src/pages/Account.tsx:183
msgid "Start"
msgstr "Start"
Expand Down Expand Up @@ -1572,7 +1574,7 @@ msgid "Uh oh, you're out of free requests! Upgrade to Flowchart Fun Pro for unli
msgstr "Oh oh, du hast keine kostenlosen Anfragen mehr! Upgrade auf Flowchart Fun Pro für unbegrenzte Diagramm-Konvertierungen und verwandle Text weiterhin mühelos in klare, visuelle Flussdiagramme wie durch Kopieren und Einfügen."

#: src/lib/getDefaultText.ts:6
msgid "Understanding Syntax"
msgid "Understand Syntax"
msgstr "Syntax verstehen"

#: src/lib/parserErrors.tsx:45
Expand Down Expand Up @@ -1643,8 +1645,8 @@ msgid "Use classes to group nodes"
msgstr "Verwenden Sie Klassen, um Knoten zu gruppieren"

#: src/lib/getDefaultText.ts:8
msgid "Use colons, like \"Explore options:\"."
msgstr "Verwenden Sie Doppelpunkte, wie \\"
msgid "Use colons like \"Decisions:\"."
msgstr "Verwenden Sie Doppelpunkte wie \"
#: src/components/LearnSyntaxDialog.tsx:394
msgid "Use the attribute <0>href</0> to set a link on a node that opens in a new tab."
Expand Down Expand Up @@ -1783,13 +1785,13 @@ msgstr "Ihre Diagramme sind schreibgeschützt, da Ihr Konto nicht mehr aktiv ist
msgid "Your subscription is <0>{statusDisplay}</0>."
msgstr "Ihre Abonnement ist <0>{statusDisplay}</0>."

#: src/components/GraphFloatingMenu.tsx:52
#: src/components/GraphFloatingMenu.tsx:56
#: src/components/GraphFloatingMenu.tsx:59
#: src/components/GraphFloatingMenu.tsx:63
msgid "Zoom In"
msgstr "Vergrößern"

#: src/components/GraphFloatingMenu.tsx:62
#: src/components/GraphFloatingMenu.tsx:66
#: src/components/GraphFloatingMenu.tsx:69
#: src/components/GraphFloatingMenu.tsx:73
msgid "Zoom Out"
msgstr "Verkleinern"

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

Large diffs are not rendered by default.

Loading

0 comments on commit 51a1fb0

Please sign in to comment.