Skip to content

Commit

Permalink
Merge pull request #747 from tone-row/dev
Browse files Browse the repository at this point in the history
v1.57.7
  • Loading branch information
rob-gordon authored Sep 30, 2024
2 parents c635c93 + 8473836 commit 426fb99
Show file tree
Hide file tree
Showing 20 changed files with 68 additions and 293 deletions.
2 changes: 1 addition & 1 deletion api/prompt/_shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function handleRateLimit(
redis: kv,
limiter: isPro
? Ratelimit.slidingWindow(3, "1m")
: Ratelimit.fixedWindow(0, "30d"),
: Ratelimit.fixedWindow(2, "30d"),
});

const rateLimitKey = isPro ? `pro_${customerId}` : `unauth_${ip}`;
Expand Down
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.57.6",
"version": "1.57.7",
"main": "module/module.js",
"license": "MIT",
"scripts": {
Expand Down
38 changes: 0 additions & 38 deletions app/src/lib/useGetAIPaywallCopy.experiment.ts

This file was deleted.

7 changes: 2 additions & 5 deletions app/src/lib/usePromptStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { AppContext } from "../components/AppContextProvider";
import { unfreezeDoc } from "./useIsFrozen";
import { useDoc } from "./useDoc";
import { repairText } from "./repairText";
import { useGetAIPaywallCopy } from "./useGetAIPaywallCopy.experiment";

export type Mode = "prompt" | "convert" | "edit";
type PromptStore = {
Expand Down Expand Up @@ -91,19 +90,17 @@ export function useRunAiWithStore() {
const hasProAccess = useHasProAccess();
const customer = useContext(AppContext).customer;
const sid = customer?.subscription?.id;
const getAIPaywallCopy = useGetAIPaywallCopy();

const handleError = useCallback(
(error: Error) => {
if (!hasProAccess && error.message === RATE_LIMIT_EXCEEDED) {
const buttonText = getAIPaywallCopy();
// Show paywall
showPaywall({
title: t`Get Unlimited AI Requests`,
content: t`You've used all your free AI conversions. Upgrade to Pro for unlimited AI use, custom themes, private sharing, and more. Keep creating amazing flowcharts effortlessly!`,
movieUrl: "/images/ai-convert.mp4",
toPricingCode: "ConvertToFlowchart",
buttonText,
buttonText: t`Unlock Unlimited AI Flowcharts`,
});
} else {
if (error.message === RATE_LIMIT_EXCEEDED) {
Expand All @@ -113,7 +110,7 @@ export function useRunAiWithStore() {
}
}
},
[getAIPaywallCopy, hasProAccess]
[hasProAccess]
);

return useCallback(() => {
Expand Down
2 changes: 1 addition & 1 deletion app/src/locales/de/messages.js

Large diffs are not rendered by default.

37 changes: 7 additions & 30 deletions app/src/locales/de/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ msgstr ""
msgid "1 Temporary Flowchart"
msgstr "1 Vorläufiger Flussdiagramm"

#: src/lib/getAIPaywallCopy.experiment.ts:29
msgid "5,000+ Users Love AI Flowcharts - Join Now"
msgstr "Über 5.000 Benutzer lieben AI-Flussdiagramme - Treten Sie jetzt bei"

#: src/components/Tabs/ThemeTab.tsx:611
msgid "<0>Custom CSS Only</0> is enabled. Only the Layout and Advanced settings will be applied."
msgstr "<0>Nur benutzerdefiniertes CSS</0> ist aktiviert. Nur die Layout- und Erweiterten Einstellungen werden angewandt."
Expand All @@ -45,10 +41,6 @@ msgstr "Eine neue Version der App ist verfügbar. Bitte neu laden, um zu aktuali
msgid "AI Creation & Editing"
msgstr "KI-Erstellung & Bearbeitung"

#: src/lib/getAIPaywallCopy.experiment.ts:27
msgid "AI Flowcharts Anytime - $2/mo (billed yearly)"
msgstr "AI-Flussdiagramme jederzeit verfügbar - $2/Monat (jährlich abgerechnet)"

#: src/pages/Pricing2.tsx:61
msgid "AI-Powered Flowchart Creation"
msgstr "KI-unterstützte Erstellung von Flussdiagrammen"
Expand Down Expand Up @@ -328,7 +320,7 @@ msgstr "Weiter im Sandbox-Modus (wird täglich zurückgesetzt, Arbeit wird nicht
msgid "Convert"
msgstr "Umwandeln"

#: src/components/ConvertToFlowchart.tsx:80
#: src/components/ConvertToFlowchart.tsx:78
msgid "Convert to Flowchart"
msgstr "In Flussdiagramm konvertieren"

Expand Down Expand Up @@ -844,10 +836,6 @@ msgstr "JSON Canvas ist eine JSON-Repräsentation Ihres Diagramms, die von <0>Ob
msgid "Join 2000+ professionals who've upgraded their workflow"
msgstr "Werden Sie Teil von über 2000 Fachleuten, die ihren Arbeitsablauf verbessert haben"

#: src/lib/getAIPaywallCopy.experiment.ts:23
msgid "Join 5,000+ AI Flowchart Creators. $4/mo"
msgstr "Treten Sie 5.000+ AI-Flussdiagramm-Erstellern bei. $4/Monat"

#: src/pages/Pricing.tsx:37
msgid "Keep Things Private"
msgstr "Halte Dinge privat"
Expand Down Expand Up @@ -879,6 +867,7 @@ msgid "Leading References"
msgstr "Führende Referenzen"

#: src/components/ImportDataUnauthenticatedDialog.tsx:68
#: src/lib/usePaywallModalStore.ts:41
msgid "Learn More"
msgstr "Mehr erfahren"

Expand Down Expand Up @@ -1195,7 +1184,7 @@ msgstr "Schnelle Vorlagen"
msgid "Raster Export (PNG, JPG)"
msgstr "Raster-Export (PNG, JPG)"

#: src/components/ConvertToFlowchart.tsx:41
#: src/components/ConvertToFlowchart.tsx:39
#: src/lib/usePromptStore.ts:107
msgid "Rate limit exceeded. Please try again later."
msgstr "Die Rate-Limit wurde überschritten. Bitte versuchen Sie es später erneut."
Expand Down Expand Up @@ -1621,7 +1610,7 @@ msgstr "Von oben nach unten"
msgid "Transform Your Ideas into Professional Diagrams in Seconds"
msgstr "Transformieren Sie Ihre Ideen in professionelle Diagramme in Sekunden"

#: src/components/ConvertToFlowchart.tsx:33
#: src/components/ConvertToFlowchart.tsx:32
msgid "Transform text into diagrams instantly"
msgstr "Verwandeln Sie Texte sofort in Diagramme"

Expand Down Expand Up @@ -1649,7 +1638,7 @@ msgstr "Zwei Kanten haben die gleiche ID"
msgid "Two nodes have the same ID"
msgstr "Zwei Knoten haben die gleiche ID"

#: src/components/ConvertToFlowchart.tsx:34
#: src/components/ConvertToFlowchart.tsx:33
msgid "Uh oh, you're out of free requests! Upgrade to Flowchart Fun Pro for unlimited diagram conversions, and keep transforming text into clear, visual flowcharts as easily as copy and paste."
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."

Expand All @@ -1669,14 +1658,6 @@ msgstr "Unbekannt"
msgid "Unknown Parsing Error"
msgstr "Unbekannter Parser-Fehler"

#: src/lib/getAIPaywallCopy.experiment.ts:25
msgid "Unlimited AI Flowcharts - Boost Productivity Now"
msgstr "Unbegrenzte AI-Flussdiagramme - Steigern Sie die Produktivität jetzt"

#: src/lib/getAIPaywallCopy.experiment.ts:21
msgid "Unlimited AI Flowcharts: $2/mo (billed yearly)"
msgstr "Unbegrenzte AI-Flussdiagramme: $2/Monat (jährlich abgerechnet)"

#: src/pages/Pricing.tsx:16
msgid "Unlimited Flowcharts"
msgstr "Unbegrenzte Flowcharts"
Expand All @@ -1694,7 +1675,7 @@ msgstr "Unbegrenzte in der Cloud gespeicherte Flussdiagramme"
msgid "Unlock AI Features and never lose your work with a Pro account."
msgstr "Entsperren Sie KI-Funktionen und verlieren Sie nie wieder Ihre Arbeit mit einem Pro-Konto."

#: src/lib/getAIPaywallCopy.experiment.ts:31
#: src/lib/usePromptStore.ts:103
msgid "Unlock Unlimited AI Flowcharts"
msgstr "Entsperren Sie unbegrenzte AI-Flussdiagramme"

Expand All @@ -1710,10 +1691,6 @@ msgstr "E-Mail aktualisieren"
msgid "Upgrade Now - Save My Work"
msgstr "Jetzt upgraden - Meine Arbeit speichern"

#: src/lib/usePromptStore.ts:103
msgid "Upgrade for Unlimited AI"
msgstr "Upgrade für unbegrenzte KI"

#: src/components/SandboxWarning.tsx:56
msgid "Upgrade to Flowchart Fun Pro and unlock:"
msgstr "Upgrade auf Flowchart Fun Pro und schalte frei:"
Expand Down Expand Up @@ -1918,6 +1895,6 @@ msgstr "oder"
msgid "{0}"
msgstr "{0}"

#: src/components/PaywallModal.tsx:70
#: src/components/PaywallModal.tsx:73
msgid "{buttonText}"
msgstr "{buttonText}"
2 changes: 1 addition & 1 deletion app/src/locales/en/messages.js

Large diffs are not rendered by default.

37 changes: 7 additions & 30 deletions app/src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ msgstr ""
msgid "1 Temporary Flowchart"
msgstr "1 Temporary Flowchart"

#: src/lib/getAIPaywallCopy.experiment.ts:29
msgid "5,000+ Users Love AI Flowcharts - Join Now"
msgstr "5,000+ Users Love AI Flowcharts - Join Now"

#: src/components/Tabs/ThemeTab.tsx:611
msgid "<0>Custom CSS Only</0> is enabled. Only the Layout and Advanced settings will be applied."
msgstr "<0>Custom CSS Only</0> is enabled. Only the Layout and Advanced settings will be applied."
Expand All @@ -45,10 +41,6 @@ msgstr "A new version of the app is available. Please reload to update."
msgid "AI Creation & Editing"
msgstr "AI Creation & Editing"

#: src/lib/getAIPaywallCopy.experiment.ts:27
msgid "AI Flowcharts Anytime - $2/mo (billed yearly)"
msgstr "AI Flowcharts Anytime - $2/mo (billed yearly)"

#: src/pages/Pricing2.tsx:61
msgid "AI-Powered Flowchart Creation"
msgstr "AI-Powered Flowchart Creation"
Expand Down Expand Up @@ -328,7 +320,7 @@ msgstr "Continue in Sandbox (Resets daily, work not saved)"
msgid "Convert"
msgstr "Convert"

#: src/components/ConvertToFlowchart.tsx:80
#: src/components/ConvertToFlowchart.tsx:78
msgid "Convert to Flowchart"
msgstr "Convert to Flowchart"

Expand Down Expand Up @@ -844,10 +836,6 @@ msgstr "JSON Canvas is a JSON representation of your diagram used by <0>Obsidian
msgid "Join 2000+ professionals who've upgraded their workflow"
msgstr "Join 2000+ professionals who've upgraded their workflow"

#: src/lib/getAIPaywallCopy.experiment.ts:23
msgid "Join 5,000+ AI Flowchart Creators. $4/mo"
msgstr "Join 5,000+ AI Flowchart Creators. $4/mo"

#: src/pages/Pricing.tsx:37
msgid "Keep Things Private"
msgstr "Keep Things Private"
Expand Down Expand Up @@ -879,6 +867,7 @@ msgid "Leading References"
msgstr "Leading References"

#: src/components/ImportDataUnauthenticatedDialog.tsx:68
#: src/lib/usePaywallModalStore.ts:41
msgid "Learn More"
msgstr "Learn More"

Expand Down Expand Up @@ -1195,7 +1184,7 @@ msgstr "Rapid Templates"
msgid "Raster Export (PNG, JPG)"
msgstr "Raster Export (PNG, JPG)"

#: src/components/ConvertToFlowchart.tsx:41
#: src/components/ConvertToFlowchart.tsx:39
#: src/lib/usePromptStore.ts:107
msgid "Rate limit exceeded. Please try again later."
msgstr "Rate limit exceeded. Please try again later."
Expand Down Expand Up @@ -1621,7 +1610,7 @@ msgstr "Top to Bottom"
msgid "Transform Your Ideas into Professional Diagrams in Seconds"
msgstr "Transform Your Ideas into Professional Diagrams in Seconds"

#: src/components/ConvertToFlowchart.tsx:33
#: src/components/ConvertToFlowchart.tsx:32
msgid "Transform text into diagrams instantly"
msgstr "Transform text into diagrams instantly"

Expand Down Expand Up @@ -1649,7 +1638,7 @@ msgstr "Two edges have the same ID"
msgid "Two nodes have the same ID"
msgstr "Two nodes have the same ID"

#: src/components/ConvertToFlowchart.tsx:34
#: src/components/ConvertToFlowchart.tsx:33
msgid "Uh oh, you're out of free requests! Upgrade to Flowchart Fun Pro for unlimited diagram conversions, and keep transforming text into clear, visual flowcharts as easily as copy and paste."
msgstr "Uh oh, you're out of free requests! Upgrade to Flowchart Fun Pro for unlimited diagram conversions, and keep transforming text into clear, visual flowcharts as easily as copy and paste."

Expand All @@ -1669,14 +1658,6 @@ msgstr "Unknown"
msgid "Unknown Parsing Error"
msgstr "Unknown Parsing Error"

#: src/lib/getAIPaywallCopy.experiment.ts:25
msgid "Unlimited AI Flowcharts - Boost Productivity Now"
msgstr "Unlimited AI Flowcharts - Boost Productivity Now"

#: src/lib/getAIPaywallCopy.experiment.ts:21
msgid "Unlimited AI Flowcharts: $2/mo (billed yearly)"
msgstr "Unlimited AI Flowcharts: $2/mo (billed yearly)"

#: src/pages/Pricing.tsx:16
msgid "Unlimited Flowcharts"
msgstr "Unlimited Flowcharts"
Expand All @@ -1694,7 +1675,7 @@ msgstr "Unlimited cloud-saved flowcharts"
msgid "Unlock AI Features and never lose your work with a Pro account."
msgstr "Unlock AI Features and never lose your work with a Pro account."

#: src/lib/getAIPaywallCopy.experiment.ts:31
#: src/lib/usePromptStore.ts:103
msgid "Unlock Unlimited AI Flowcharts"
msgstr "Unlock Unlimited AI Flowcharts"

Expand All @@ -1710,10 +1691,6 @@ msgstr "Update Email"
msgid "Upgrade Now - Save My Work"
msgstr "Upgrade Now - Save My Work"

#: src/lib/usePromptStore.ts:103
msgid "Upgrade for Unlimited AI"
msgstr "Upgrade for Unlimited AI"

#: src/components/SandboxWarning.tsx:56
msgid "Upgrade to Flowchart Fun Pro and unlock:"
msgstr "Upgrade to Flowchart Fun Pro and unlock:"
Expand Down Expand Up @@ -1918,6 +1895,6 @@ msgstr "or"
msgid "{0}"
msgstr "{0}"

#: src/components/PaywallModal.tsx:70
#: src/components/PaywallModal.tsx:73
msgid "{buttonText}"
msgstr "{buttonText}"
2 changes: 1 addition & 1 deletion app/src/locales/es/messages.js

Large diffs are not rendered by default.

Loading

0 comments on commit 426fb99

Please sign in to comment.