Skip to content

Commit

Permalink
Merge pull request #765 from tone-row/dev
Browse files Browse the repository at this point in the history
v1.61.1
  • Loading branch information
rob-gordon authored Dec 23, 2024
2 parents a31ff70 + c0405ed commit 8500bc9
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 96 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(3, "15d"),
: Ratelimit.fixedWindow(2, "30d"),
});

const rateLimitKey = isPro ? `pro_${customerId}` : `unauth_${ip}`;
Expand Down
4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app",
"version": "1.61.0",
"version": "1.61.1",
"main": "module/module.js",
"license": "MIT",
"scripts": {
Expand Down Expand Up @@ -99,7 +99,7 @@
"papaparse": "^5.4.1",
"phosphor-react": "^1.3.1",
"postcss-flexbugs-fixes": "^5.0.2",
"posthog-js": "^1.161.3",
"posthog-js": "^1.203.1",
"prettier": "^2.3.1",
"re-resizable": "^6.9.0",
"react": "^18.2.0",
Expand Down
11 changes: 9 additions & 2 deletions app/src/lib/getElements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ export function getElements(text: string): ElementDefinition[] {
if ("source" in element.data) return element;

let size: ReturnType<typeof getSize>;
let style: any = {};

if ("w" in element.data || "h" in element.data) {
size = {
width: element.data.w || "label",
height: element.data.h || "label",
width: "label",
height: "label",
};
if ("w" in element.data) {
size.width = element.data.w;
style["text-max-width"] = element.data.w;
}
if ("h" in element.data) size.height = element.data.h;
} else {
const classes = element.classes
? Array.isArray(element.classes)
Expand All @@ -39,6 +45,7 @@ export function getElements(text: string): ElementDefinition[] {

return {
...element,
style,
data: {
...element.data,
...size,
Expand Down
Loading

0 comments on commit 8500bc9

Please sign in to comment.