Skip to content

Commit

Permalink
Update browserlist db & posthog (#764)
Browse files Browse the repository at this point in the history
* Update browserlist

* Upgrade posthog

* Text-max-width for fixed width elements

* Update posthog
  • Loading branch information
rob-gordon authored Dec 23, 2024
1 parent 30f1019 commit 1dbd0d4
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 95 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
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
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 1dbd0d4

Please sign in to comment.