diff --git a/.github/workflows/electron-release.yml b/.github/workflows/electron-release.yml index 9e8ef191..9fed5980 100644 --- a/.github/workflows/electron-release.yml +++ b/.github/workflows/electron-release.yml @@ -34,15 +34,7 @@ jobs: node-version: 24 cache: "npm" - - name: Download draw.io static files for offline use - run: | - rm -rf public/drawio - git clone --depth 1 https://github.com/jgraph/drawio.git /tmp/drawio - mkdir -p public/drawio - cp -r /tmp/drawio/src/main/webapp/* public/drawio/ - rm -rf public/drawio/WEB-INF - rm -rf public/drawio/META-INF - + # npm run build downloads draw.io first (prebuild) - name: Install dependencies run: npm install @@ -66,16 +58,7 @@ jobs: node-version: 24 cache: "npm" - - name: Download draw.io static files for offline use - shell: bash - run: | - rm -rf public/drawio - git clone --depth 1 https://github.com/jgraph/drawio.git /tmp/drawio - mkdir -p public/drawio - cp -r /tmp/drawio/src/main/webapp/* public/drawio/ - rm -rf public/drawio/WEB-INF - rm -rf public/drawio/META-INF - + # npm run build downloads draw.io first (prebuild) - name: Install dependencies run: npm install diff --git a/Dockerfile b/Dockerfile index 037b48c1..54149c7c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,9 @@ COPY . . # Disable Next.js telemetry during build ENV NEXT_TELEMETRY_DISABLED=1 -# Build-time argument for self-hosted draw.io URL -ARG NEXT_PUBLIC_DRAWIO_BASE_URL=https://embed.diagrams.net +# Build-time argument for an external draw.io URL. Leave empty to use the +# copy bundled into public/drawio (downloaded by `npm run build`) +ARG NEXT_PUBLIC_DRAWIO_BASE_URL="" ENV NEXT_PUBLIC_DRAWIO_BASE_URL=${NEXT_PUBLIC_DRAWIO_BASE_URL} # Build-time argument to show About link and Notice icon diff --git a/README.md b/README.md index 5c94015a..cbf27f7e 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,8 @@ Here are some example prompts and their generated diagrams: - **Image-Based Diagram Replication**: Upload existing diagrams or images and have the AI replicate and enhance them automatically - **PDF & Text File Upload**: Upload PDF documents and text files to extract content and generate diagrams from existing documents - **AI Reasoning Display**: View the AI's thinking process for supported models (OpenAI o1/o3, Gemini, Claude, etc.) -- **Diagram History**: Comprehensive version control that tracks all changes, allowing you to view and restore previous versions of your diagrams before the AI editing. +- **Versions and Undo**: Every AI change shows up in the chat as a version with a thumbnail. Compare it with the canvas, restore it, or undo it; Ctrl+Z on the canvas also takes back an AI change in one step. Shapes the AI just changed are highlighted. +- **Ask About a Selection**: Select shapes on the canvas and ask the AI to change just those. - **Interactive Chat Interface**: Communicate with AI to refine your diagrams in real-time - **Cloud Architecture Diagram Support**: Specialized support for generating cloud architecture diagrams (AWS, GCP, Azure) - **Animated Connectors**: Create dynamic and animated connectors between diagram elements for better visualization @@ -263,7 +264,7 @@ The application uses the following technologies: - **Next.js**: For the frontend framework and routing - **Vercel AI SDK** (`ai` + `@ai-sdk/*`): For streaming AI responses and multi-provider support -- **react-drawio**: For diagram representation and manipulation +- **draw.io**: The editor runs from a copy bundled into `public/drawio` (downloaded by `npm run dev` / `npm run build`), so the app can drive it directly Diagrams are represented as XML that can be rendered in draw.io. The AI processes your commands and generates or modifies this XML accordingly. diff --git a/app/[lang]/about/cn/page.tsx b/app/[lang]/about/cn/page.tsx index bacd18e9..fe283122 100644 --- a/app/[lang]/about/cn/page.tsx +++ b/app/[lang]/about/cn/page.tsx @@ -149,8 +149,10 @@ export default function AboutCN() { :上传现有图表或图像,让AI自动复制和增强
  • - 图表历史记录 - :全面的版本控制,跟踪所有更改,允许您查看和恢复AI编辑前的图表版本 + 版本与撤销 + :AI + 的每次修改都会成为聊天里的一个版本,可以对比、恢复或撤销;在画布上按 + Ctrl+Z 也能撤回
  • 交互式聊天界面 @@ -294,7 +296,8 @@ export default function AboutCN() { ):用于流式AI响应和多提供商支持
  • - react-drawio:用于图表表示和操作 + draw.io + :内置在应用里的编辑器,应用可以直接控制它
  • diff --git a/app/[lang]/about/ja/page.tsx b/app/[lang]/about/ja/page.tsx index 22f53fc0..cf9d7e87 100644 --- a/app/[lang]/about/ja/page.tsx +++ b/app/[lang]/about/ja/page.tsx @@ -138,8 +138,10 @@ export default function AboutJA() { :既存のダイアグラムや画像をアップロードし、AIが自動的に複製・強化

  • - ダイアグラム履歴 - :すべての変更を追跡する包括的なバージョン管理。AI編集前のダイアグラムの以前のバージョンを表示・復元可能 + バージョンと取り消し + :AI + の変更はそれぞれチャット内のバージョンになり、比較・復元・取り消しができます。キャンバスで + Ctrl+Z を押しても元に戻せます
  • @@ -290,8 +292,8 @@ export default function AboutJA() { ):ストリーミングAIレスポンスとマルチプロバイダーサポート
  • - react-drawio - :ダイアグラムの表現と操作 + draw.io + :アプリに同梱されたエディター。アプリから直接操作できます
  • diff --git a/app/[lang]/about/page.tsx b/app/[lang]/about/page.tsx index 85a46ef5..a25d8869 100644 --- a/app/[lang]/about/page.tsx +++ b/app/[lang]/about/page.tsx @@ -150,10 +150,10 @@ export default function About() { replicate and enhance them automatically

  • - Diagram History: Comprehensive - version control that tracks all changes, allowing - you to view and restore previous versions of your - diagrams before the AI editing + Versions and Undo: Every AI change + becomes a version in the chat that you can compare, + restore or undo; Ctrl+Z on the canvas takes it back + too
  • Interactive Chat Interface: @@ -304,8 +304,8 @@ export default function About() { and multi-provider support
  • - react-drawio: For diagram - representation and manipulation + draw.io: The editor, bundled with + the app so it can be driven directly
  • diff --git a/app/[lang]/layout.tsx b/app/[lang]/layout.tsx index 04bd4eb5..bc2fd112 100644 --- a/app/[lang]/layout.tsx +++ b/app/[lang]/layout.tsx @@ -1,19 +1,25 @@ import { GoogleAnalytics } from "@next/third-parties/google" import type { Metadata, Viewport } from "next" -import { JetBrains_Mono, Plus_Jakarta_Sans } from "next/font/google" +import { Instrument_Sans, JetBrains_Mono } from "next/font/google" import { notFound } from "next/navigation" +import Script from "next/script" +import { AppToaster } from "@/components/workspace/app-toaster" import { DiagramProvider } from "@/contexts/diagram-context" import { DictionaryProvider } from "@/hooks/use-dictionary" import type { Locale } from "@/lib/i18n/config" import { i18n } from "@/lib/i18n/config" import { getDictionary, hasLocale } from "@/lib/i18n/dictionaries" +import { THEME_INIT_SCRIPT } from "@/stores/settings-store" import "../globals.css" -const plusJakarta = Plus_Jakarta_Sans({ - variable: "--font-sans", +const instrumentSans = Instrument_Sans({ + variable: "--font-latin", subsets: ["latin"], weight: ["400", "500", "600", "700"], + // Chinese and Japanese text falls through to system fonts, in the + // order globals.css picks for the page's language + fallback: [], }) const jetbrainsMono = JetBrains_Mono({ @@ -165,17 +171,22 @@ export default async function RootLayout({ return ( + {/* Apply dark mode before the first paint (no white flash) */} +