Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 32 additions & 30 deletions apps/convert-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,43 @@
"lint": "next lint"
},
"dependencies": {
"@ai-sdk/openai": "^1.0.8",
"@monaco-editor/react": "^4.6.0",
"@radix-ui/react-hover-card": "^1.1.3",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.1.1",
"@radix-ui/react-separator": "^1.1.1",
"@radix-ui/react-slot": "^1.1.1",
"@radix-ui/react-tabs": "^1.1.2",
"@radix-ui/react-toast": "^1.2.3",
"@upstash/ratelimit": "^2.0.5",
"@vercel/functions": "^1.5.2",
"@ai-sdk/openai": "^3.0.51",
"@ai-sdk/react": "^3.0.151",
"@monaco-editor/react": "^4.7.0",
"@radix-ui/react-hover-card": "^1.1.15",
"@radix-ui/react-icons": "^1.3.2",
"@radix-ui/react-label": "^2.1.8",
"@radix-ui/react-separator": "^1.1.8",
"@radix-ui/react-slot": "^1.2.4",
"@radix-ui/react-tabs": "^1.1.13",
"@radix-ui/react-toast": "^1.2.15",
"@upstash/ratelimit": "^2.0.8",
"@vercel/functions": "^3.4.3",
"@vercel/kv": "^3.0.0",
"adaptivecards": "^3.0.4",
"ai": "^4.0.18",
"adaptivecards": "^3.0.6",
"ai": "^6.0.149",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^0.468.0",
"monaco-editor": "^0.52.2",
"next": "15.1.0",
"next-themes": "^0.4.4",
"react": "^19",
"react-dom": "^19",
"sonner": "^1.7.1",
"tailwind-merge": "^2.5.5",
"lucide-react": "^1.7.0",
"monaco-editor": "^0.55.1",
"next": "16.2.2",
"next-themes": "^0.4.6",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"sonner": "^2.0.7",
"tailwind-merge": "^3.5.0",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.24.1"
"zod": "^4.3.6"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "15.0.4",
"postcss": "^8",
"tailwindcss": "^3.4.16",
"typescript": "^5"
"@tailwindcss/postcss": "^4.2.2",
"@types/node": "^25.5.2",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"eslint": "^10.2.0",
"eslint-config-next": "16.2.2",
"postcss": "^8.5.8",
"tailwindcss": "^4.2.2",
"typescript": "^5.8.3"
}
}
2 changes: 1 addition & 1 deletion apps/convert-website/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
"@tailwindcss/postcss": {},
},
};

Expand Down
2 changes: 1 addition & 1 deletion apps/convert-website/src/app/api/use-object/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function POST(req: Request) {
const result = await streamObject({
model: openai("gpt-4o-mini"),
schema: IAdaptiveCardSchema,
maxTokens: 1000,
maxOutputTokens: 1000,
prompt:
`You are a json convert expert. You receive a Microsoft MessageCard as JSON and you need to convert it to an AdaptiveCard.
DO NOT add more content to the card. The card should be as close as possible to the original MessageCard.
Expand Down
2 changes: 1 addition & 1 deletion apps/convert-website/src/app/blocked/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";
import { Button } from "@/components/ui/button";
import { useRouter } from "next/navigation";
import React from "react";
import { Button } from "@/components/ui/button";

function Blocked() {
const route = useRouter();
Expand Down
19 changes: 8 additions & 11 deletions apps/convert-website/src/app/editor.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
"use client";

import { experimental_useObject as useObject } from "@ai-sdk/react";
import * as AdaptiveCards from "adaptivecards";
import { Loader2 } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import CodeEditor from "@/components/code-editor";
import { Button } from "@/components/ui/button";
import { Label } from "@/components/ui/label";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Textarea } from "@/components/ui/textarea";
import { useToast } from "@/components/ui/use-toast";
import * as AdaptiveCards from "adaptivecards";
import { experimental_useObject as useObject } from "ai/react";
import { Loader2 } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import MSTeamsCard from "../components/ms-teams-card";
import exampleMessageCard from "../data/example-message-card.json" assert {
import exampleMessageCard from "../data/example-message-card.json" with {
type: "json",
};
import _jsonSchema from "../schemas/adaptive-card.json" assert { type: "json" };
import { APIRequest } from "./api/use-object/api-request";
import _jsonSchema from "../schemas/adaptive-card.json" with { type: "json" };

import { IAdaptiveCardSchema } from "./api/use-object/schema";

function Editor() {
const { toast } = useToast();

const { object, submit, isLoading, error, stop } = useObject<
unknown,
APIRequest
>({
const { object, submit, isLoading, error, stop } = useObject({
api: "/api/use-object",
schema: IAdaptiveCardSchema,
});
Expand Down
60 changes: 53 additions & 7 deletions apps/convert-website/src/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,53 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss";
@plugin "tailwindcss-animate";

@custom-variant dark (&:is(.dark *));

@theme {
--color-background: hsl(var(--background));
--color-foreground: hsl(var(--foreground));
--color-card: hsl(var(--card));
--color-card-foreground: hsl(var(--card-foreground));
--color-popover: hsl(var(--popover));
--color-popover-foreground: hsl(var(--popover-foreground));
--color-primary: hsl(var(--primary));
--color-primary-foreground: hsl(var(--primary-foreground));
--color-secondary: hsl(var(--secondary));
--color-secondary-foreground: hsl(var(--secondary-foreground));
--color-muted: hsl(var(--muted));
--color-muted-foreground: hsl(var(--muted-foreground));
--color-accent: hsl(var(--accent));
--color-accent-foreground: hsl(var(--accent-foreground));
--color-destructive: hsl(var(--destructive));
--color-destructive-foreground: hsl(var(--destructive-foreground));
--color-border: hsl(var(--border));
--color-input: hsl(var(--input));
--color-ring: hsl(var(--ring));

--radius-lg: var(--radius);
--radius-md: calc(var(--radius) - 2px);
--radius-sm: calc(var(--radius) - 4px);

--animate-accordion-down: accordion-down 0.2s ease-out;
--animate-accordion-up: accordion-up 0.2s ease-out;

@keyframes accordion-down {
from {
height: 0;
}
to {
height: var(--radix-accordion-content-height);
}
}
@keyframes accordion-up {
from {
height: var(--radix-accordion-content-height);
}
to {
height: 0;
}
}
}

@layer base {
:root {
Expand Down Expand Up @@ -57,13 +104,12 @@
--chart-4: 280 65% 60%;
--chart-5: 340 75% 55%;
}
}

@layer base {
* {
@apply border-border;
border-color: hsl(var(--border));
}
body {
@apply bg-background text-foreground;
background-color: hsl(var(--background));
color: hsl(var(--foreground));
}
}
4 changes: 2 additions & 2 deletions apps/convert-website/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Separator } from "@/components/ui/separator";
import { Tabs } from "@/components/ui/tabs";
import { Metadata } from "next";
import Image from "next/image";
import { Separator } from "@/components/ui/separator";
import { Tabs } from "@/components/ui/tabs";
import Editor from "./editor";

export const metadata: Metadata = {
Expand Down
5 changes: 4 additions & 1 deletion apps/convert-website/src/components/ms-teams-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { useEffect, useState } from "react";
function MSTeamsCard({
object,
isLoading,
}: { object: any; isLoading: boolean }) {
}: {
object: any;
isLoading: boolean;
}) {
const [cachedHtmlBuild, setCachedHtmlBuild] = useState<
HTMLElement | undefined
>();
Expand Down
2 changes: 1 addition & 1 deletion apps/convert-website/src/components/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Slot } from "@radix-ui/react-slot";
import { type VariantProps, cva } from "class-variance-authority";
import { cva, type VariantProps } from "class-variance-authority";
import * as React from "react";

import { cn } from "@/lib/utils";
Expand Down
2 changes: 1 addition & 1 deletion apps/convert-website/src/components/ui/hover-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ const HoverCardContent = React.forwardRef<
));
HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;

export { HoverCard, HoverCardTrigger, HoverCardContent };
export { HoverCard, HoverCardContent, HoverCardTrigger };
2 changes: 1 addition & 1 deletion apps/convert-website/src/components/ui/label.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import * as LabelPrimitive from "@radix-ui/react-label";
import { type VariantProps, cva } from "class-variance-authority";
import { cva, type VariantProps } from "class-variance-authority";
import * as React from "react";

import { cn } from "@/lib/utils";
Expand Down
2 changes: 1 addition & 1 deletion apps/convert-website/src/components/ui/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ const TabsContent = React.forwardRef<
));
TabsContent.displayName = TabsPrimitive.Content.displayName;

export { Tabs, TabsList, TabsTrigger, TabsContent };
export { Tabs, TabsContent, TabsList, TabsTrigger };
14 changes: 7 additions & 7 deletions apps/convert-website/src/components/ui/toast.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import * as ToastPrimitives from "@radix-ui/react-toast";
import { type VariantProps, cva } from "class-variance-authority";
import { cva, type VariantProps } from "class-variance-authority";
import { X } from "lucide-react";
import * as React from "react";

Expand Down Expand Up @@ -117,13 +117,13 @@ type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
type ToastActionElement = React.ReactElement<typeof ToastAction>;

export {
type ToastProps,
Toast,
ToastAction,
type ToastActionElement,
ToastClose,
ToastDescription,
type ToastProps,
ToastProvider,
ToastViewport,
Toast,
ToastTitle,
ToastDescription,
ToastClose,
ToastAction,
ToastViewport,
};
2 changes: 1 addition & 1 deletion apps/convert-website/src/components/ui/use-toast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,4 @@ function useToast() {
};
}

export { useToast, toast };
export { toast, useToast };
2 changes: 1 addition & 1 deletion apps/convert-website/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Config } from "tailwindcss";

const config = {
darkMode: ["class"],
darkMode: ["class", ".dark"],
content: [
"./pages/**/*.{ts,tsx}",
"./components/**/*.{ts,tsx}",
Expand Down
10 changes: 8 additions & 2 deletions apps/convert-website/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
Expand All @@ -22,6 +22,12 @@
},
"target": "ES2017"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": ["node_modules"]
}
10 changes: 8 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.2/schema.json",
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand All @@ -8,5 +8,11 @@
"formatter": {
"indentStyle": "space"
},
"linter": { "enabled": false }
"linter": { "enabled": false },
"css": {
"parser": {
"cssModules": true,
"tailwindDirectives": true
}
}
}
4 changes: 2 additions & 2 deletions examples/adaptive-card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"ms-teams-webhook": "workspace:*"
},
"devDependencies": {
"@tsconfig/strictest": "^2.0.5",
"@types/node": "^18.11.18"
"@tsconfig/strictest": "^2.0.8",
"@types/node": "^25.5.2"
}
}
4 changes: 2 additions & 2 deletions examples/legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"ms-teams-webhook-legacy": "workspace:*"
},
"devDependencies": {
"body-parser": "^1.20.2",
"express": "^4.21.2"
"body-parser": "^2.2.2",
"express": "^5.2.1"
}
}
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@
},
"packageManager": "pnpm@9.4.0",
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"pkg-pr-new": "^0.0.35",
"tsup": "^8.2.4",
"turbo": "^2.3.3",
"vite": "^6.0.3",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^2.1.8"
"@biomejs/biome": "^2.4.10",
"pkg-pr-new": "^0.0.66",
"tsup": "^8.5.1",
"turbo": "^2.9.4",
"vite": "^8.0.5",
"vite-tsconfig-paths": "^6.1.1",
"vitest": "^4.1.2"
},
"pnpm": {
"overrides": {
"vitest": "$vitest",
"vite": "$vite",
"tsup": "$tsup"
"tsup": "$tsup",
"typescript": "~5.8.3"
}
}
}
Loading
Loading