Skip to content

Canvix — Free & open-source graphic design tool. A community-built Canva alternative with a drag-and-drop editor, templates, shapes, text, images & one-click export. Works on desktop, tablet & mobile.

feat: v0.3.2 — 63 fonts, gradient fills, PDF export, photos library, AI apps & trend templates

Ashiq Hussain Mir2e0446e7da7c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 06d5042..0b96ad9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,67 @@
All notable changes to Canvix will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
+## [0.3.2] — 2026-09-03
+
+Fresh canva.com research pass (fonts, design trends 2026, feature taxonomy) plus the
+next tier of editor features: gradient fills, PDF export, a Photos library and AI apps.
+
+### Fonts — 15 → 63 families
+- Font library expanded to **63 families** across five categories with Canva-style
+ pills + search in the font dropdown: 18 sans, 14 serif, 14 display, 14 handwriting
+ and a new **Mono** category (DM Mono, JetBrains Mono, Space Mono).
+- New arrivals include Raleway, Lato, Open Sans, Nunito, Quicksand, Rubik, Work Sans,
+ DM Sans, Josefin Sans, Barlow, Manrope, Outfit, Figtree, Lora, Merriweather, Libre
+ Baskerville, EB Garamond, Cormorant Garamond, DM Serif Display, Prata, Bitter,
+ Fraunces, Bodoni Moda, Cinzel, Alfa Slab One, Bungee, Righteous, Ultra, Passion One,
+ Monoton, Rye, Titan One, Luckiest Guy, Permanent Marker, Great Vibes, Sacramento,
+ Satisfy, Kaushan Script, Alex Brush, Allura, Parisienne, Amatic SC, Shadows Into
+ Light, Indie Flower and Kalam.
+- All fonts load through one consolidated Google-Fonts stylesheet with subset weights.
+
+### Gradient fills (shapes & text)
+- **Linear and radial gradients** on rectangles, ellipses, triangles, stars, paths and
+ text — `fillGradient` on `ShapeElement`/`TextElement`, rendered via Konva
+ `fillLinearGradient*`/`fillRadialGradient*` with per-shape local coordinate frames.
+- The colour menu gains a full **gradient editor**: 12 preset swatches + radial chip,
+ Linear/Radial type toggle, 0-360° angle slider, from/to colour pickers, and
+ *Remove gradient*. The toolbar swatch previews the live gradient.
+- Text effects that own the fill (Hollow, Outline, Neon…) intentionally skip the
+ gradient so the effect stays intact; picking any solid colour clears the gradient.
+
+### PDF export
+- **Multi-page PDF download** in the export dialog (jsPDF, client-side, no watermark):
+ print-ready page-sized PDF, per-page capture at the selected quality, all-pages
+ option, automatic landscape/portrait orientation.
+
+### Photos (new side-panel tab)
+- **Photos rail tab** with Canva-style panel: search + category chips (Nature,
+ Business, People, Food, Travel, Textures, Abstract), hover-to-add grid, broken tiles
+ self-hide. Clicking places a 900×514 image element on the canvas.
+- Bundled **42-photo stock library** (7 categories × 6) — AI-generated for Canvix,
+ license-free, served locally from `public/photos/` (no external requests).
+
+### AI apps (Canva AI parity)
+- **Magic Write** app — prompt + copy kind (headline/tagline/body/caption) + tone;
+ generates 3 options server-side (`/api/ai/write`, z-ai SDK) and adds any option to
+ the canvas as a styled text element.
+- **AI image generator** app — prompt + style chips + size (1:1/16:9/9:16/4:3);
+ server-side generation (`/api/ai/image`) with preview, *Generate another*, and
+ add-to-canvas as an image element.
+- Both apps lead the Apps grid, mirroring Canva's AI-first 2026 navigation.
+
+### Templates — Design Trends 2026
+- Five new templates from Canva's official 2026 trends (research doc): **Prompt
+ Playground** (playful productivity), **Notes App Chic** (raw handwritten notes),
+ **Texture Check** (tactile warm gradients), **Opt Out Era** (structured minimalism),
+ **Granny Wave** (maximalist heritage remix) — several showcase the new gradient
+ fills and new fonts (Fraunces, Cinzel, Kalam, Manrope, Bodoni Moda).
+
+### Guides
+- Manual guides are now **per-page** (`ManualGuide.pageId`): each page owns its own
+ set, snapping only considers the current page's guides, and *Clear guides* clears
+ just the current page.
+
## [0.3.1] — 2026-09-03
Editor-completeness release: the remaining gap-analysis features — rulers & guides,
diff --git a/README.md b/README.md
index 7970c7c..3f40162 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,29 @@ watermarks, no paywalls.
## 🎨 Features
+### v0.3.2 — fonts, gradients, PDF, photos & AI
+
+- **63-font library** — 15 → **63 families** across five categories (sans / serif /
+ display / handwriting / new **Mono**) in a searchable, pill-filtered Canva-style
+ font dropdown
+- **Gradient fills** — linear & radial gradients on all shapes **and text**, edited
+ straight in the colour menu: preset swatches, Linear/Radial toggle, 0-360° angle
+ slider, from/to colour pickers, one-click remove
+- **PDF export** — print-ready, multi-page PDF downloads straight from the browser
+ (jsPDF, zero watermarks)
+- **Photos tab** — new side panel with a bundled, license-free stock library
+ (7 categories × 6 AI-generated photos), tag search, category chips and
+ click-to-place
+- **Magic Write** — AI copywriter app: describe what you need, pick kind (headline /
+ tagline / body / caption) and tone, get 3 on-brand options, add one to the canvas
+- **AI image generator** — prompt + style + aspect ratio → a design-ready image on
+ your canvas
+- **Design Trends 2026 templates** — five templates from Canva's official 2026
+ trend report: Prompt Playground, Notes App Chic, Texture Check, Opt Out Era and
+ Granny Wave
+- **Per-page guides** — ruler guides now belong to their page; snapping and
+ Clear-guides act on the current page only
+
### v0.3.1 — editor completeness: rulers, crop, layers rename, version history
- **Rulers & manual guides** — Canva-style ruler strips (top/left) with adaptive tick
@@ -186,11 +209,11 @@ prisma/ # schema + seed
- [x] Text effects, draw tool, brand kit, charts, preview & share *(v0.2.0)*
- [x] Canva-exact selection, context menus, groups, colour menu, apps ecosystem *(v0.3.0)*
- [x] Rulers & manually placed guides, image crop, layer renaming, version history *(v0.3.1)*
-- [ ] PDF export
-- [ ] Gradient fills for shapes & text
-- [ ] Curated stock photo library
+- [x] 63-font library, gradient fills, PDF export, stock photo library, AI apps *(v0.3.2)*
- [ ] Real-time collaboration (CRDT)
-- [ ] AI-assisted design (local models)
+- [ ] Comment & annotation mode
+- [ ] SVG export
+- [ ] Video/MP4 export
- [ ] Plugin system (external, installable apps)
## 🤝 Contributing
diff --git a/bun.lock b/bun.lock
index 6a7f528..f412c93 100644
--- a/bun.lock
+++ b/bun.lock
@@ -49,6 +49,7 @@
"embla-carousel-react": "^8.6.0",
"framer-motion": "^12.23.2",
"input-otp": "^1.4.2",
+ "jspdf": "^4.2.1",
"konva": "^10.3.2",
"lucide-react": "^0.525.0",
"next": "^16.1.1",
@@ -714,14 +715,20 @@
"@types/node": ["@types/[email protected]", "https://registry.npmjs.com/@types/node/-/node-25.0.9.tgz", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-/rpCXHlCWeqClNBwUhDcusJxXYDjZTyE8v5oTO7WbL8eij2nKhUeU89/6xgjU7N4/Vh3He0BtyhJdQbDyhiXAw=="],
+ "@types/pako": ["@types/[email protected]", "", {}, "sha512-VWDCbrLeVXJM9fihYodcLiIv0ku+AlOa/TQ1SvYOaBuyrSKgEcro95LJyIsJ4vSo6BXIxOKxiJAat04CmST9Fw=="],
+
"@types/qrcode": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw=="],
+ "@types/raf": ["@types/[email protected]", "", {}, "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw=="],
+
"@types/react": ["@types/[email protected]", "https://registry.npmjs.com/@types/react/-/react-19.2.8.tgz", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-3MbSL37jEchWZz2p2mjntRZtPt837ij10ApxKfgmXCTuHWagYg7iA5bqPw6C8BMPfwidlvfPI/fxOc42HLhcyg=="],
"@types/react-dom": ["@types/[email protected]", "https://registry.npmjs.com/@types/react-dom/-/react-dom-19.2.3.tgz", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ=="],
"@types/react-reconciler": ["@types/[email protected]", "", { "peerDependencies": { "@types/react": "*" } }, "sha512-HZOXsKT0tGI9LlUw2LuedXsVeB88wFa536vVL0M6vE8zN63nI+sSr1ByxmPToP5K5bukaVscyeCJcF9guVNJ1g=="],
+ "@types/trusted-types": ["@types/[email protected]", "", {}, "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw=="],
+
"@types/unist": ["@types/[email protected]", "https://registry.npmjs.com/@types/unist/-/unist-3.0.3.tgz", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],
"@typescript-eslint/eslint-plugin": ["@typescript-eslint/[email protected]", "https://registry.npmjs.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.53.0.tgz", { "dependencies": { "@eslint-community/regexpp": "^4.12.2", "@typescript-eslint/scope-manager": "8.53.0", "@typescript-eslint/type-utils": "8.53.0", "@typescript-eslint/utils": "8.53.0", "@typescript-eslint/visitor-keys": "8.53.0", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.4.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.53.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-eEXsVvLPu8Z4PkFibtuFJLJOTAV/nPdgtSjkGoPpddpFk3/ym2oy97jynY6ic2m6+nc5M8SE1e9v/mHKsulcJg=="],
@@ -832,6 +839,8 @@
"balanced-match": ["[email protected]", "https://registry.npmjs.com/balanced-match/-/balanced-match-1.0.2.tgz", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
+ "base64-arraybuffer": ["[email protected]", "", {}, "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ=="],
+
"base64-js": ["[email protected]", "https://registry.npmjs.com/base64-js/-/base64-js-1.5.1.tgz", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="],
"baseline-browser-mapping": ["[email protected]", "https://registry.npmjs.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.15.tgz", { "bin": { "baseline-browser-mapping": "dist/cli.js" } }, "sha512-kX8h7K2srmDyYnXRIppo4AH/wYgzWVCs+eKr3RusRSQ5PvRYoEFmR/I0PbdTjKFAoKqp5+kbxnNTFO9jOfSVJg=="],
@@ -860,6 +869,8 @@
"caniuse-lite": ["[email protected]", "https://registry.npmjs.com/caniuse-lite/-/caniuse-lite-1.0.30001764.tgz", {}, "sha512-9JGuzl2M+vPL+pz70gtMF9sHdMFbY9FJaQBi186cHKH3pSzDvzoUJUPV6fqiKIMyXbud9ZLg4F3Yza1vJ1+93g=="],
+ "canvg": ["[email protected]", "", { "dependencies": { "@babel/runtime": "^7.12.5", "@types/raf": "^3.4.0", "core-js": "^3.8.3", "raf": "^3.4.1", "regenerator-runtime": "^0.13.7", "rgbcolor": "^1.0.1", "stackblur-canvas": "^2.0.0", "svg-pathdata": "^6.0.3" } }, "sha512-5ON+q7jCTgMp9cjpu4Jo6XbvfYwSB2Ow3kzHKfIyJfaCAOHLbdKPQqGKgfED/R5B+3TFFfe8pegYA+b423SRyA=="],
+
"ccount": ["[email protected]", "https://registry.npmjs.com/ccount/-/ccount-2.0.1.tgz", {}, "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg=="],
"chalk": ["[email protected]", "https://registry.npmjs.com/chalk/-/chalk-4.1.2.tgz", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],
@@ -912,10 +923,14 @@
"cookie": ["[email protected]", "https://registry.npmjs.com/cookie/-/cookie-0.7.2.tgz", {}, "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w=="],
+ "core-js": ["[email protected]", "", {}, "sha512-BRWgOLKkFeCgRudR6zrs8p9XJZcE14grzKMMssoYrk6krtuEZ7MTKPIY5RzOnqsEKIR9kst7wNzphttraT+Yqw=="],
+
"crelt": ["[email protected]", "https://registry.npmjs.com/crelt/-/crelt-1.0.6.tgz", {}, "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g=="],
"cross-spawn": ["[email protected]", "https://registry.npmjs.com/cross-spawn/-/cross-spawn-7.0.6.tgz", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],
+ "css-line-break": ["[email protected]", "", { "dependencies": { "utrie": "^1.0.2" } }, "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w=="],
+
"csstype": ["[email protected]", "https://registry.npmjs.com/csstype/-/csstype-3.2.3.tgz", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="],
"d": ["[email protected]", "https://registry.npmjs.com/d/-/d-1.0.2.tgz", { "dependencies": { "es5-ext": "^0.10.64", "type": "^2.7.2" } }, "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw=="],
@@ -992,6 +1007,8 @@
"dom-helpers": ["[email protected]", "https://registry.npmjs.com/dom-helpers/-/dom-helpers-5.2.1.tgz", { "dependencies": { "@babel/runtime": "^7.8.7", "csstype": "^3.0.2" } }, "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA=="],
+ "dompurify": ["[email protected]", "", { "optionalDependencies": { "@types/trusted-types": "^2.0.7" } }, "sha512-dVoH9z+MY+C9IilgGCk3YfFqjLi3fChm2OiKJMzh6axrJ5qwxqWaZamgmHrpv22CN/KdbZJuGEGgfQoL00LTdg=="],
+
"dotenv": ["[email protected]", "https://registry.npmjs.com/dotenv/-/dotenv-16.6.1.tgz", {}, "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow=="],
"downshift": ["[email protected]", "https://registry.npmjs.com/downshift/-/downshift-7.6.2.tgz", { "dependencies": { "@babel/runtime": "^7.14.8", "compute-scroll-into-view": "^2.0.4", "prop-types": "^15.7.2", "react-is": "^17.0.2", "tslib": "^2.3.0" }, "peerDependencies": { "react": ">=16.12.0" } }, "sha512-iOv+E1Hyt3JDdL9yYcOgW7nZ7GQ2Uz6YbggwXvKUSleetYhU2nXD482Rz6CzvM4lvI1At34BYruKAL4swRGxaA=="],
@@ -1102,12 +1119,16 @@
"fast-levenshtein": ["[email protected]", "https://registry.npmjs.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", {}, "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="],
+ "fast-png": ["[email protected]", "", { "dependencies": { "@types/pako": "^2.0.3", "iobuffer": "^5.3.2", "pako": "^2.1.0" } }, "sha512-kAqZq1TlgBjZcLr5mcN6NP5Rv4V2f22z00c3g8vRrwkcqjerx7BEhPbOnWCPqaHUl2XWQBJQvOT/FQhdMT7X/Q=="],
+
"fastq": ["[email protected]", "https://registry.npmjs.com/fastq/-/fastq-1.20.1.tgz", { "dependencies": { "reusify": "^1.0.4" } }, "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw=="],
"fault": ["[email protected]", "https://registry.npmjs.com/fault/-/fault-2.0.1.tgz", { "dependencies": { "format": "^0.2.0" } }, "sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ=="],
"fdir": ["[email protected]", "https://registry.npmjs.com/fdir/-/fdir-6.5.0.tgz", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="],
+ "fflate": ["[email protected]", "", {}, "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA=="],
+
"file-entry-cache": ["[email protected]", "https://registry.npmjs.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz", { "dependencies": { "flat-cache": "^4.0.0" } }, "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ=="],
"fill-range": ["[email protected]", "https://registry.npmjs.com/fill-range/-/fill-range-7.1.1.tgz", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="],
@@ -1190,6 +1211,8 @@
"html-url-attributes": ["[email protected]", "https://registry.npmjs.com/html-url-attributes/-/html-url-attributes-3.0.1.tgz", {}, "sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ=="],
+ "html2canvas": ["[email protected]", "", { "dependencies": { "css-line-break": "^2.1.0", "text-segmentation": "^1.0.3" } }, "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA=="],
+
"ieee754": ["[email protected]", "https://registry.npmjs.com/ieee754/-/ieee754-1.2.1.tgz", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="],
"ignore": ["[email protected]", "https://registry.npmjs.com/ignore/-/ignore-5.3.2.tgz", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="],
@@ -1212,6 +1235,8 @@
"intl-messageformat": ["[email protected]", "https://registry.npmjs.com/intl-messageformat/-/intl-messageformat-10.7.18.tgz", { "dependencies": { "@formatjs/ecma402-abstract": "2.3.6", "@formatjs/fast-memoize": "2.2.7", "@formatjs/icu-messageformat-parser": "2.11.4", "tslib": "^2.8.0" } }, "sha512-m3Ofv/X/tV8Y3tHXLohcuVuhWKo7BBq62cqY15etqmLxg2DZ34AGGgQDeR+SCta2+zICb1NX83af0GJmbQ1++g=="],
+ "iobuffer": ["[email protected]", "", {}, "sha512-DRebOWuqDvxunfkNJAlc3IzWIPD5xVxwUNbHr7xKB8E6aLJxIPfNX3CoMJghcFjpv6RWQsrcJbghtEwSPoJqMA=="],
+
"is-alphabetical": ["[email protected]", "https://registry.npmjs.com/is-alphabetical/-/is-alphabetical-2.0.1.tgz", {}, "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ=="],
"is-alphanumerical": ["[email protected]", "https://registry.npmjs.com/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", { "dependencies": { "is-alphabetical": "^2.0.0", "is-decimal": "^2.0.0" } }, "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw=="],
@@ -1306,6 +1331,8 @@
"json5": ["[email protected]", "https://registry.npmjs.com/json5/-/json5-1.0.2.tgz", { "dependencies": { "minimist": "^1.2.0" }, "bin": { "json5": "lib/cli.js" } }, "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA=="],
+ "jspdf": ["[email protected]", "", { "dependencies": { "@babel/runtime": "^7.28.6", "fast-png": "^6.2.0", "fflate": "^0.8.1" }, "optionalDependencies": { "canvg": "^3.0.11", "core-js": "^3.6.0", "dompurify": "^3.3.1", "html2canvas": "^1.0.0-rc.5" } }, "sha512-YyAXyvnmjTbR4bHQRLzex3CuINCDlQnBqoSYyjJwTP2x9jDLuKDzy7aKUl0hgx3uhcl7xzg32agn5vlie6HIlQ=="],
+
"jsx-ast-utils": ["[email protected]", "https://registry.npmjs.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", { "dependencies": { "array-includes": "^3.1.6", "array.prototype.flat": "^1.3.1", "object.assign": "^4.1.4", "object.values": "^1.1.6" } }, "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ=="],
"keyv": ["[email protected]", "https://registry.npmjs.com/keyv/-/keyv-4.5.4.tgz", { "dependencies": { "json-buffer": "3.0.1" } }, "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw=="],
@@ -1556,6 +1583,8 @@
"p-try": ["[email protected]", "", {}, "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="],
+ "pako": ["[email protected]", "", {}, "sha512-zJq6RP/5q+TO2OpFV3FHzlPnFjmkb7Nc99a5SNjJE+uu/PkpChs+NIZSSzbBoD+6kjiISXjfYdwj1ZRQ81dz/w=="],
+
"parent-module": ["[email protected]", "https://registry.npmjs.com/parent-module/-/parent-module-1.0.1.tgz", { "dependencies": { "callsites": "^3.0.0" } }, "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g=="],
"parse-entities": ["[email protected]", "https://registry.npmjs.com/parse-entities/-/parse-entities-4.0.2.tgz", { "dependencies": { "@types/unist": "^2.0.0", "character-entities-legacy": "^3.0.0", "character-reference-invalid": "^2.0.0", "decode-named-character-reference": "^1.0.0", "is-alphanumerical": "^2.0.0", "is-decimal": "^2.0.0", "is-hexadecimal": "^2.0.0" } }, "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw=="],
@@ -1570,6 +1599,8 @@
"perfect-debounce": ["[email protected]", "https://registry.npmjs.com/perfect-debounce/-/perfect-debounce-1.0.0.tgz", {}, "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA=="],
+ "performance-now": ["[email protected]", "", {}, "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow=="],
+
"picocolors": ["[email protected]", "https://registry.npmjs.com/picocolors/-/picocolors-1.1.1.tgz", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
"picomatch": ["[email protected]", "https://registry.npmjs.com/picomatch/-/picomatch-4.0.3.tgz", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="],
@@ -1608,6 +1639,8 @@
"queue-microtask": ["[email protected]", "https://registry.npmjs.com/queue-microtask/-/queue-microtask-1.2.3.tgz", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="],
+ "raf": ["[email protected]", "", { "dependencies": { "performance-now": "^2.1.0" } }, "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA=="],
+
"rc9": ["[email protected]", "https://registry.npmjs.com/rc9/-/rc9-2.1.2.tgz", { "dependencies": { "defu": "^6.1.4", "destr": "^2.0.3" } }, "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg=="],
"react": ["[email protected]", "https://registry.npmjs.com/react/-/react-19.2.3.tgz", {}, "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA=="],
@@ -1654,6 +1687,8 @@
"refractor": ["[email protected]", "https://registry.npmjs.com/refractor/-/refractor-3.6.0.tgz", { "dependencies": { "hastscript": "^6.0.0", "parse-entities": "^2.0.0", "prismjs": "~1.27.0" } }, "sha512-MY9W41IOWxxk31o+YvFCNyNzdkc9M20NoZK5vq6jkv4I/uh2zkWcfudj0Q1fovjUQJrNewS9NMzeTtqPf+n5EA=="],
+ "regenerator-runtime": ["[email protected]", "", {}, "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="],
+
"regexp.prototype.flags": ["[email protected]", "https://registry.npmjs.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", { "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-errors": "^1.3.0", "get-proto": "^1.0.1", "gopd": "^1.2.0", "set-function-name": "^2.0.2" } }, "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA=="],
"remark-parse": ["[email protected]", "https://registry.npmjs.com/remark-parse/-/remark-parse-11.0.0.tgz", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-from-markdown": "^2.0.0", "micromark-util-types": "^2.0.0", "unified": "^11.0.0" } }, "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA=="],
@@ -1672,6 +1707,8 @@
"reusify": ["[email protected]", "https://registry.npmjs.com/reusify/-/reusify-1.1.0.tgz", {}, "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw=="],
+ "rgbcolor": ["[email protected]", "", {}, "sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw=="],
+
"run-parallel": ["[email protected]", "https://registry.npmjs.com/run-parallel/-/run-parallel-1.2.0.tgz", { "dependencies": { "queue-microtask": "^1.2.2" } }, "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="],
"sade": ["[email protected]", "https://registry.npmjs.com/sade/-/sade-1.8.1.tgz", { "dependencies": { "mri": "^1.1.0" } }, "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A=="],
@@ -1718,6 +1755,8 @@
"stable-hash": ["[email protected]", "https://registry.npmjs.com/stable-hash/-/stable-hash-0.0.5.tgz", {}, "sha512-+L3ccpzibovGXFK+Ap/f8LOS0ahMrHTf3xu7mMLSpEGU0EO9ucaysSylKo9eRDFNhWve/y275iPmIZ4z39a9iA=="],
+ "stackblur-canvas": ["[email protected]", "", {}, "sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ=="],
+
"static-browser-server": ["[email protected]", "https://registry.npmjs.com/static-browser-server/-/static-browser-server-1.0.3.tgz", { "dependencies": { "@open-draft/deferred-promise": "^2.1.0", "dotenv": "^16.0.3", "mime-db": "^1.52.0", "outvariant": "^1.3.0" } }, "sha512-ZUyfgGDdFRbZGGJQ1YhiM930Yczz5VlbJObrQLlk24+qNHVQx4OlLcYswEUo3bIyNAbQUIUR9Yr5/Hqjzqb4zA=="],
"stop-iteration-iterator": ["[email protected]", "https://registry.npmjs.com/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", { "dependencies": { "es-errors": "^1.3.0", "internal-slot": "^1.1.0" } }, "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ=="],
@@ -1758,6 +1797,8 @@
"supports-preserve-symlinks-flag": ["[email protected]", "https://registry.npmjs.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", {}, "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="],
+ "svg-pathdata": ["[email protected]", "", {}, "sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw=="],
+
"tabbable": ["[email protected]", "https://registry.npmjs.com/tabbable/-/tabbable-6.4.0.tgz", {}, "sha512-05PUHKSNE8ou2dwIxTngl4EzcnsCDZGJ/iCLtDflR/SHB/ny14rXc+qU5P4mG9JkusiV7EivzY9Mhm55AzAvCg=="],
"tailwind-merge": ["[email protected]", "https://registry.npmjs.com/tailwind-merge/-/tailwind-merge-3.4.0.tgz", {}, "sha512-uSaO4gnW+b3Y2aWoWfFpX62vn2sR3skfhbjsEnaBI81WD1wBLlHZe5sWf0AqjksNdYTbGBEd0UasQMT3SNV15g=="],
@@ -1768,6 +1809,8 @@
"tapable": ["[email protected]", "https://registry.npmjs.com/tapable/-/tapable-2.3.0.tgz", {}, "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg=="],
+ "text-segmentation": ["[email protected]", "", { "dependencies": { "utrie": "^1.0.2" } }, "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw=="],
+
"tiny-invariant": ["[email protected]", "https://registry.npmjs.com/tiny-invariant/-/tiny-invariant-1.3.3.tgz", {}, "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg=="],
"tinyexec": ["[email protected]", "https://registry.npmjs.com/tinyexec/-/tinyexec-1.0.2.tgz", {}, "sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg=="],
@@ -1838,6 +1881,8 @@
"use-sync-external-store": ["[email protected]", "https://registry.npmjs.com/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w=="],
+ "utrie": ["[email protected]", "", { "dependencies": { "base64-arraybuffer": "^1.0.2" } }, "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw=="],
+
"uuid": ["[email protected]", "https://registry.npmjs.com/uuid/-/uuid-11.1.0.tgz", { "bin": { "uuid": "dist/esm/bin/uuid" } }, "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A=="],
"uvu": ["[email protected]", "https://registry.npmjs.com/uvu/-/uvu-0.5.6.tgz", { "dependencies": { "dequal": "^2.0.0", "diff": "^5.0.0", "kleur": "^4.0.3", "sade": "^1.7.3" }, "bin": { "uvu": "bin.js" } }, "sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA=="],
diff --git a/package.json b/package.json
index 944b8af..c72312e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "canvix",
- "version": "0.1.0",
+ "version": "0.3.2",
"private": false,
"description": "Canvix — free & open-source graphic design tool. A community-built Canva alternative.",
"scripts": {
@@ -59,6 +59,7 @@
"embla-carousel-react": "^8.6.0",
"framer-motion": "^12.23.2",
"input-otp": "^1.4.2",
+ "jspdf": "^4.2.1",
"konva": "^10.3.2",
"lucide-react": "^0.525.0",
"next": "^16.1.1",
diff --git a/public/photos/abstract-1.jpg b/public/photos/abstract-1.jpg
new file mode 100644
index 0000000..eb2e354
Binary files /dev/null and b/public/photos/abstract-1.jpg differ
diff --git a/public/photos/abstract-2.jpg b/public/photos/abstract-2.jpg
new file mode 100644
index 0000000..a21e5f4
Binary files /dev/null and b/public/photos/abstract-2.jpg differ
diff --git a/public/photos/abstract-3.jpg b/public/photos/abstract-3.jpg
new file mode 100644
index 0000000..6f3ec19
Binary files /dev/null and b/public/photos/abstract-3.jpg differ
diff --git a/public/photos/abstract-4.jpg b/public/photos/abstract-4.jpg
new file mode 100644
index 0000000..1850fec
Binary files /dev/null and b/public/photos/abstract-4.jpg differ
diff --git a/public/photos/abstract-5.jpg b/public/photos/abstract-5.jpg
new file mode 100644
index 0000000..c07327f
Binary files /dev/null and b/public/photos/abstract-5.jpg differ
diff --git a/public/photos/abstract-6.jpg b/public/photos/abstract-6.jpg
new file mode 100644
index 0000000..5219349
Binary files /dev/null and b/public/photos/abstract-6.jpg differ
diff --git a/public/photos/business-1.jpg b/public/photos/business-1.jpg
new file mode 100644
index 0000000..cf3c0f0
Binary files /dev/null and b/public/photos/business-1.jpg differ
diff --git a/public/photos/business-2.jpg b/public/photos/business-2.jpg
new file mode 100644
index 0000000..15cda1a
Binary files /dev/null and b/public/photos/business-2.jpg differ
diff --git a/public/photos/business-3.jpg b/public/photos/business-3.jpg
new file mode 100644
index 0000000..e938153
Binary files /dev/null and b/public/photos/business-3.jpg differ
diff --git a/public/photos/business-4.jpg b/public/photos/business-4.jpg
new file mode 100644
index 0000000..0b0b0e3
Binary files /dev/null and b/public/photos/business-4.jpg differ
diff --git a/public/photos/business-5.jpg b/public/photos/business-5.jpg
new file mode 100644
index 0000000..7f0d04b
Binary files /dev/null and b/public/photos/business-5.jpg differ
diff --git a/public/photos/business-6.jpg b/public/photos/business-6.jpg
new file mode 100644
index 0000000..b4bb520
Binary files /dev/null and b/public/photos/business-6.jpg differ
diff --git a/public/photos/food-1.jpg b/public/photos/food-1.jpg
new file mode 100644
index 0000000..8aa8055
Binary files /dev/null and b/public/photos/food-1.jpg differ
diff --git a/public/photos/food-2.jpg b/public/photos/food-2.jpg
new file mode 100644
index 0000000..47eed43
Binary files /dev/null and b/public/photos/food-2.jpg differ
diff --git a/public/photos/food-3.jpg b/public/photos/food-3.jpg
new file mode 100644
index 0000000..4344ad0
Binary files /dev/null and b/public/photos/food-3.jpg differ
diff --git a/public/photos/food-4.jpg b/public/photos/food-4.jpg
new file mode 100644
index 0000000..72c1a60
Binary files /dev/null and b/public/photos/food-4.jpg differ
diff --git a/public/photos/food-5.jpg b/public/photos/food-5.jpg
new file mode 100644
index 0000000..2072713
Binary files /dev/null and b/public/photos/food-5.jpg differ
diff --git a/public/photos/food-6.jpg b/public/photos/food-6.jpg
new file mode 100644
index 0000000..148f957
Binary files /dev/null and b/public/photos/food-6.jpg differ
diff --git a/public/photos/nature-1.jpg b/public/photos/nature-1.jpg
new file mode 100644
index 0000000..fa57bc4
Binary files /dev/null and b/public/photos/nature-1.jpg differ
diff --git a/public/photos/nature-2.jpg b/public/photos/nature-2.jpg
new file mode 100644
index 0000000..74a843d
Binary files /dev/null and b/public/photos/nature-2.jpg differ
diff --git a/public/photos/nature-3.jpg b/public/photos/nature-3.jpg
new file mode 100644
index 0000000..546904d
Binary files /dev/null and b/public/photos/nature-3.jpg differ
diff --git a/public/photos/nature-4.jpg b/public/photos/nature-4.jpg
new file mode 100644
index 0000000..80a20bd
Binary files /dev/null and b/public/photos/nature-4.jpg differ
diff --git a/public/photos/nature-5.jpg b/public/photos/nature-5.jpg
new file mode 100644
index 0000000..84c4745
Binary files /dev/null and b/public/photos/nature-5.jpg differ
diff --git a/public/photos/nature-6.jpg b/public/photos/nature-6.jpg
new file mode 100644
index 0000000..d4cc42d
Binary files /dev/null and b/public/photos/nature-6.jpg differ
diff --git a/public/photos/people-1.jpg b/public/photos/people-1.jpg
new file mode 100644
index 0000000..6aa5e69
Binary files /dev/null and b/public/photos/people-1.jpg differ
diff --git a/public/photos/people-2.jpg b/public/photos/people-2.jpg
new file mode 100644
index 0000000..c03dca9
Binary files /dev/null and b/public/photos/people-2.jpg differ
diff --git a/public/photos/people-3.jpg b/public/photos/people-3.jpg
new file mode 100644
index 0000000..0fbcf17
Binary files /dev/null and b/public/photos/people-3.jpg differ
diff --git a/public/photos/people-4.jpg b/public/photos/people-4.jpg
new file mode 100644
index 0000000..790ea15
Binary files /dev/null and b/public/photos/people-4.jpg differ
diff --git a/public/photos/people-5.jpg b/public/photos/people-5.jpg
new file mode 100644
index 0000000..1856a23
Binary files /dev/null and b/public/photos/people-5.jpg differ
diff --git a/public/photos/people-6.jpg b/public/photos/people-6.jpg
new file mode 100644
index 0000000..111f650
Binary files /dev/null and b/public/photos/people-6.jpg differ
diff --git a/public/photos/texture-1.jpg b/public/photos/texture-1.jpg
new file mode 100644
index 0000000..8917cb7
Binary files /dev/null and b/public/photos/texture-1.jpg differ
diff --git a/public/photos/texture-2.jpg b/public/photos/texture-2.jpg
new file mode 100644
index 0000000..667ff27
Binary files /dev/null and b/public/photos/texture-2.jpg differ
diff --git a/public/photos/texture-3.jpg b/public/photos/texture-3.jpg
new file mode 100644
index 0000000..000b125
Binary files /dev/null and b/public/photos/texture-3.jpg differ
diff --git a/public/photos/texture-4.jpg b/public/photos/texture-4.jpg
new file mode 100644
index 0000000..e12dc64
Binary files /dev/null and b/public/photos/texture-4.jpg differ
diff --git a/public/photos/texture-5.jpg b/public/photos/texture-5.jpg
new file mode 100644
index 0000000..e8b7f02
Binary files /dev/null and b/public/photos/texture-5.jpg differ
diff --git a/public/photos/texture-6.jpg b/public/photos/texture-6.jpg
new file mode 100644
index 0000000..089181a
Binary files /dev/null and b/public/photos/texture-6.jpg differ
diff --git a/public/photos/travel-1.jpg b/public/photos/travel-1.jpg
new file mode 100644
index 0000000..b7c177a
Binary files /dev/null and b/public/photos/travel-1.jpg differ
diff --git a/public/photos/travel-2.jpg b/public/photos/travel-2.jpg
new file mode 100644
index 0000000..7374ca6
Binary files /dev/null and b/public/photos/travel-2.jpg differ
diff --git a/public/photos/travel-3.jpg b/public/photos/travel-3.jpg
new file mode 100644
index 0000000..9e4e0e0
Binary files /dev/null and b/public/photos/travel-3.jpg differ
diff --git a/public/photos/travel-4.jpg b/public/photos/travel-4.jpg
new file mode 100644
index 0000000..09419fd
Binary files /dev/null and b/public/photos/travel-4.jpg differ
diff --git a/public/photos/travel-5.jpg b/public/photos/travel-5.jpg
new file mode 100644
index 0000000..b65f015
Binary files /dev/null and b/public/photos/travel-5.jpg differ
diff --git a/public/photos/travel-6.jpg b/public/photos/travel-6.jpg
new file mode 100644
index 0000000..014afd0
Binary files /dev/null and b/public/photos/travel-6.jpg differ
diff --git a/research/CANVA-V032-RESEARCH.md b/research/CANVA-V032-RESEARCH.md
new file mode 100644
index 0000000..d756895
--- /dev/null
+++ b/research/CANVA-V032-RESEARCH.md
@@ -0,0 +1,62 @@
+# Canva v0.3.2 Research — fresh canva.com visit (2026-09-03, session 2)
+
+> Method: stealth Playwright (chromium, automation flags stripped) on Xvfb; public
+> pages only this session (login cookies unavailable after sandbox reset).
+> Captures in `research/canvix-v032-capture/`.
+
+## 1. canva.com landing (2026 re-design)
+- New brand palette (measured): **#8B3DFF** (bright violet, primary CTA),
+ **#9E9EFF** (light periwinkle), ink **#0F1015**, classic link blue `rgb(0,0,238)`.
+- The marketing site moved to a dark, high-contrast aesthetic with violet gradients.
+- Editor chrome (from v0.3.0 research) remains the purple #7630D7 / cyan #02C0CC system.
+
+## 2. Official **Design Trends 2026** (canva.com/design-trends)
+Ten named trends — great template/effect inspiration:
+| Trend | Essence |
+|---|---|
+| Prompt Playground | fun productivity-software aesthetic |
+| Reality Warp | warped visuals, otherworldly photography |
+| Explorecore | layered storytelling, purposeful motion |
+| Texture Check | tactile, feel-able design |
+| Notes App Chic | raw, honest, human "notes app" look |
+| Opt Out Era | structured simplicity, decluttered |
+| Drama Club | dramatic, theatrical breaks from reality |
+| Granny Wave | maximalist remix of heritage + modern design |
+| Zinegeist | texture, touch, analog zine effects |
+| Block Party | cinematic regional stylization |
+
+## 3. Feature taxonomy (canva.com/create mega-nav, 2026)
+- Digital design: Sheets, Docs, **Whiteboards**, Presentations, Social, Photo Editor, Videos, Print, Websites, **PDF Editor**
+- Images & photos: Background remover, Photo collages, Mockups, Image enhancer, **AI image generator**, AI photo editor, AI art generator, Draw, Logos
+- Product nav: **Canva AI**, **Magic Layers**, Canva AI assistant, **Canva Code**, **Magic Resize**, **Magic Animate**, **Magic Write**, Translate, Magic Insights, Magic Formulas
+- AI is now the flagship surface → Canvix answer: Magic Write + AI image generation apps (z-ai sdk, server-side).
+
+## 4. Fonts
+- `canva.com/fonts/` now 404s; the directory moved into the editor + learn articles.
+- `canva.com/learn/50-free-commercial-fonts` yielded 135 specimen fonts (niche
+ freebies: RM Almanack, Bona Nova, Alegreya, Old Standard TT, Didonesque, Lavigne,
+ Coolvetica, Phantomonia, Kong Quest, Plexifont, Don Graffiti, Eddie, Shagadelic,
+ Fanzine, Brushstroke, Impact Label, Mr Bedfort…).
+- Strategy: Canva's picker is dominated by Google-Fonts-class families. Canvix v0.3.2
+ expands 15 → **60 families** (sans/serif/display/handwriting + mono pill) with
+ search + category pills, matching the Canva font-dropdown UX measured in v0.3.0.
+
+## 5. Gaps → v0.3.2 feature list (this release)
+1. **Font library 15 → 60** with categories + search (Canva-style).
+2. **Gradient fills for shapes & text** (linear + radial, angle, 2-stop) — Canva
+ colour menu "Gradient" tab. (v0.3 had gradients only on page background.)
+3. **PDF export** (multi-page, client-side jsPDF) — Canva download dialog parity.
+4. **Photos panel** — full rail tab with curated free stock library (search +
+ categories), click-to-place. Canvix previously had no Photos tab at all.
+5. **Per-page guides** (v0.3.1 guides were design-scoped).
+6. **AI apps**: Magic Write (text generation) + AI Images (image generation) via
+ server routes + z-ai sdk — mirrors Canva AI / Magic Write flagship.
+7. **Trend templates 2026**: Prompt Playground, Notes App Chic, Texture Check,
+ Opt Out Era, Granny Wave inspired templates.
+
+## 6. Rejected / deferred
+- Real-time collaboration & comments (needs presence backend) → v0.5.
+- Whiteboards/Docs/Sheets editors (separate apps, huge scope) → out of scope.
+- Video/MP4 export (encoder + codec licensing) → later.
+- SVG export (Konva has no toSVG; hand-rolled exporter is error-prone) → later.
+- Justify alignment (Konva limitation, kept in UI).
diff --git a/research/CANVIX-V03-GAP-ANALYSIS.md b/research/CANVIX-V03-GAP-ANALYSIS.md
index d10badb..a3e993b 100644
--- a/research/CANVIX-V03-GAP-ANALYSIS.md
+++ b/research/CANVIX-V03-GAP-ANALYSIS.md
@@ -55,12 +55,24 @@
| Group transform rotation | double-rotation fixed; ungroup orbits children around group origin | ✅ |
| App/chart tile clickability | whole card is role=button + keyboard support | ✅ |
+## Remaining gaps — closed by v0.3.2
+
+| Gap (from v0.4.x backlog) | v0.3.2 resolution | Status |
+|---|---|---|
+| Gradient fills for shapes & text | `fillGradient` (linear/radial, angle, from/to) on shapes + text; full gradient editor inside the colour menu | ✅ |
+| PDF export | jsPDF multi-page export from the Download dialog (client-side, no watermark) | ✅ |
+| Curated stock photo library | Photos rail tab + 42 AI-generated license-free photos bundled in `public/photos/` | ✅ |
+| Small font library (15) | 63 families, 5 categories incl. Mono, Canva-style search + pills | ✅ |
+| Design-scoped guides | guides carry `pageId`; snapping + clearing are page-scoped | ✅ |
+| No AI surface (Canva AI is 2026 flagship) | Magic Write + AI image generator apps via server routes | ✅ |
+| Template stagnation | 5 templates from Canva's official Design Trends 2026 | ✅ |
+
## Remaining gaps (accepted for v0.4.x)
- Justify alignment renders as left in Konva (Konva limitation) — kept in the UI for parity
- Real-time collaboration & comments (need a backend presence channel)
- Server-side version history (v0.3.1 stores snapshots in localStorage per design)
-- PDF export, gradient fills for shapes & text, curated stock photo library
-- Guides are design-scoped (one set shared across all pages); per-page guide sets in a later release
+- SVG export, video/MP4 export
+- Runtime photo *search* is tag-based over the bundled library (Canva searches millions of licensed photos)
## Risk register (respected)
- v0.2 features verified post-upgrade: text effects, freehand draw, charts, autosave, export, preview/share, mobile sheets — all E2E-green.
diff --git a/research/canvix-v032-qa-scores.md b/research/canvix-v032-qa-scores.md
new file mode 100644
index 0000000..d8978b3
--- /dev/null
+++ b/research/canvix-v032-qa-scores.md
@@ -0,0 +1,15 @@
+# Canvix v0.3.2 — VLM visual QA scores
+
+| 01-editor | 8.5 | Topbar gradient is too linear and lacks the specific Canva 2025 purple-to-cyan depth; Icon rail is ~72px but icons are slightly undersized and misaligned; Typography uses a generic sans-serif instead of the distinct Canva Sans font. |
+| 03-fill-menu | 8.5 | Topbar height is ~44px instead of the standard ~56px; Left sidebar icon rail is ~60px instead of 72px; Fill dialog lacks the characteristic 28-32px border radius and subtle backdrop blur of modern Canva. |
+| 04-gradient-applied | 8.5 | Topbar gradient is too blue; left rail icons are too small (~48px vs 72px); dialog border radius is slightly too sharp. |
+| 06-font-search-cinzel | 8.5 | Top bar gradient is cyan-to-purple instead of purple-to-dark; left rail icons are ~48px instead of the standard 72px; font picker dropdown lacks the specific rounded container style and spacing of Canva's 2025 UI. |
+| 08-photos-panel | 8.4 | Left sidebar is ~280px wide instead of the standard 72px icon rail; topbar height and font weight slightly off; placeholder images lack realistic stock photo metadata/overlays. |
+| 10-photo-added | 8.5 | Top bar gradient is too linear and lacks the subtle cyan-to-purple transition of the real editor. Left sidebar icons are slightly too small (real Canva uses ~72px rail). Typography in the sidebar lacks the specific weight and tracking of Canva Sans. |
+| 11-export-pdf | 8.5 | Topbar gradient is too linear and lacks the deep purple-to-violet transition of the real editor. Dialog border radius is slightly smaller than the standard 28-32px. Typography lacks the specific weight and spacing of Canva Sans. |
+| 12-apps-grid | 8.5 | Topbar height is ~48px instead of the standard ~56px; Left rail width is slightly narrower than the canonical 72px; Typography lacks the specific geometric weight of Canva Sans. |
+| 13-magic-write | 9.2 | Top bar height is ~44px instead of the standard ~56px; left rail icons are ~60px instead of the standard ~72px; 'Generate' button gradient is slightly too blue compared to Canva's deep purple. |
+| 16-ai-image-result | 8.5 | Topbar gradient is too linear and lacks the specific cyan-to-purple transition of the real editor. Left sidebar icon rail is ~60px instead of the standard 72px. Typography and button border radii are slightly smaller than the 28-32px standard. |
+| 17-templates-granny | 8.5 | Topbar gradient is slightly too blue; sidebar icon rail is narrower than the standard 72px; selection handles are circles instead of squares. |
+
+**Average score: 8.6 / 10 across 11 screenshots**
diff --git a/src/app/api/ai/image/route.ts b/src/app/api/ai/image/route.ts
new file mode 100644
index 0000000..98f636a
--- /dev/null
+++ b/src/app/api/ai/image/route.ts
@@ -0,0 +1,49 @@
+import { NextRequest, NextResponse } from 'next/server'
+
+export const runtime = 'nodejs'
+export const maxDuration = 60
+
+const SUPPORTED_SIZES = ['1024x1024', '1344x768', '768x1344', '1152x864', '864x1152', '1440x720', '720x1440'] as const
+type ImgSize = (typeof SUPPORTED_SIZES)[number]
+
+interface ImageBody {
+ prompt?: string
+ size?: string
+}
+
+/** POST /api/ai/image — AI image generation for the canvas. Returns a PNG dataURL. */
+export async function POST(req: NextRequest) {
+ try {
+ const body = (await req.json()) as ImageBody
+ const prompt = (body.prompt ?? '').trim().slice(0, 600)
+ const size = (SUPPORTED_SIZES as readonly string[]).includes(body.size ?? '')
+ ? (body.size as ImgSize)
+ : '1024x1024'
+
+ if (!prompt) {
+ return NextResponse.json({ error: 'A prompt is required.' }, { status: 400 })
+ }
+
+ const { default: ZAI } = await import('z-ai-web-dev-sdk')
+ const zai = await ZAI.create()
+
+ const response = await zai.images.generations.create({
+ prompt,
+ size,
+ })
+
+ const base64 = response.data[0]?.base64
+ if (!base64) {
+ return NextResponse.json({ error: 'The image service returned no image. Try again.' }, { status: 502 })
+ }
+
+ const [w, h] = size.split('x').map(Number)
+ return NextResponse.json({ dataUrl: `data:image/png;base64,${base64}`, width: w, height: h })
+ } catch (err) {
+ console.error('[api/ai/image]', err)
+ return NextResponse.json(
+ { error: 'AI image generation is unavailable right now. Please try again.' },
+ { status: 502 }
+ )
+ }
+}
diff --git a/src/app/api/ai/write/route.ts b/src/app/api/ai/write/route.ts
new file mode 100644
index 0000000..43ec382
--- /dev/null
+++ b/src/app/api/ai/write/route.ts
@@ -0,0 +1,70 @@
+import { NextRequest, NextResponse } from 'next/server'
+
+export const runtime = 'nodejs'
+export const maxDuration = 60
+
+interface WriteBody {
+ prompt?: string
+ tone?: string
+ kind?: 'headline' | 'tagline' | 'body' | 'social'
+}
+
+const KIND_HINTS: Record<string, string> = {
+ headline: 'a punchy headline of at most 8 words',
+ tagline: 'a memorable tagline of at most 10 words',
+ body: 'a short body paragraph of 2-3 sentences (max 45 words)',
+ social: 'an engaging social-media caption with at most 30 words',
+}
+
+const TONES = ['bold', 'playful', 'elegant', 'minimal', 'corporate', 'warm'] as const
+
+/** POST /api/ai/write — Magic Write: generate on-brand copy variants for designs. */
+export async function POST(req: NextRequest) {
+ try {
+ const body = (await req.json()) as WriteBody
+ const prompt = (body.prompt ?? '').trim().slice(0, 500)
+ const kind = body.kind && KIND_HINTS[body.kind] ? body.kind : 'tagline'
+ const tone = TONES.includes((body.tone ?? '') as (typeof TONES)[number]) ? body.tone! : 'bold'
+
+ if (!prompt) {
+ return NextResponse.json({ error: 'A prompt is required.' }, { status: 400 })
+ }
+
+ const { default: ZAI } = await import('z-ai-web-dev-sdk')
+ const zai = await ZAI.create()
+
+ const completion = await zai.chat.completions.create({
+ messages: [
+ {
+ role: 'assistant',
+ content:
+ 'You are a senior brand copywriter for a design tool. Return EXACTLY 3 numbered options, one per line, ' +
+ 'no extra commentary, no quotes. Each option is ' +
+ KIND_HINTS[kind] +
+ `. Tone: ${tone}. Plain text only, ready to paste on a design.`,
+ },
+ { role: 'user', content: `Subject: ${prompt}` },
+ ],
+ thinking: { type: 'disabled' },
+ })
+
+ const raw = completion.choices[0]?.message?.content ?? ''
+ const options = raw
+ .split('\n')
+ .map((l) => l.replace(/^\s*\d+[.)]\s*/, '').trim())
+ .filter((l) => l.length > 0 && !/^here/i.test(l))
+ .slice(0, 3)
+
+ if (options.length === 0) {
+ return NextResponse.json({ error: 'Generation returned no usable text. Try rephrasing.' }, { status: 502 })
+ }
+
+ return NextResponse.json({ options })
+ } catch (err) {
+ console.error('[api/ai/write]', err)
+ return NextResponse.json(
+ { error: 'Magic Write is unavailable right now. Please try again.' },
+ { status: 502 }
+ )
+ }
+}
diff --git a/src/app/globals.css b/src/app/globals.css
index b0b2a7e..22c3513 100644
--- a/src/app/globals.css
+++ b/src/app/globals.css
@@ -157,7 +157,7 @@
--cv-slider-fill: #7630d7; /* popover slider fill */
/* gradients */
- --cv-grad-bar: linear-gradient(95deg, #02c0cc 0%, #6425f0 45%, #9333ea 78%, #b04fd7 100%);
+ --cv-grad-bar: linear-gradient(95deg, #0aa8c8 0%, #5b2bd9 26%, #7c3aed 54%, #a855f7 80%, #c86bd9 100%);
--cv-grad-brand: linear-gradient(120deg, #02c0cc 0%, #7630d7 55%, #ff5c8a 100%);
}
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index aae69ce..e5dc262 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -42,9 +42,10 @@ export default function RootLayout({
<head>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
+ {/* 60-family design font library (Google Fonts) — subset weights for performance */}
{/* eslint-disable-next-line @next/next/no-page-custom-font -- App Router root layout applies to all pages */}
<link
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Poppins:wght@400;600;700;800&family=Montserrat:wght@600;700;800;900&family=Space+Grotesk:wght@500;700&family=Oswald:wght@500;700&family=Bebas+Neue&family=Anton&family=Archivo+Black&family=Playfair+Display:wght@400;700;800&family=Abril+Fatface&family=Roboto+Slab:wght@400;700&family=Lobster&family=Pacifico&family=Caveat:wght@400;700&family=Dancing+Script:wght@400;700&display=swap"
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Poppins:wght@400;600;700;800&family=Montserrat:wght@600;700;800;900&family=Space+Grotesk:wght@500;700&family=Oswald:wght@500;700&family=Raleway:wght@400;700&family=Lato:wght@400;700&family=Open+Sans:wght@400;700&family=Nunito:wght@400;700&family=Quicksand:wght@400;700&family=Rubik:wght@400;700&family=Work+Sans:wght@400;700&family=DM+Sans:wght@400;700&family=Josefin+Sans:wght@400;700&family=Barlow:wght@400;700&family=Manrope:wght@400;700&family=Outfit:wght@400;700&family=Figtree:wght@400;700&family=Playfair+Display:wght@400;700;800&family=Abril+Fatface&family=Roboto+Slab:wght@400;700&family=Lora:wght@400;700&family=Merriweather:wght@400;700&family=Libre+Baskerville:wght@400;700&family=EB+Garamond:wght@400;700&family=Cormorant+Garamond:wght@400;700&family=DM+Serif+Display&family=Prata&family=Bitter:wght@400;700&family=Fraunces:wght@400;700&family=Bodoni+Moda:wght@400;700&family=Cinzel:wght@400;700&family=Bebas+Neue&family=Anton&family=Archivo+Black&family=Lobster&family=Alfa+Slab+One&family=Bungee&family=Righteous&family=Ultra&family=Passion+One:wght@400;700&family=Monoton&family=Rye&family=Titan+One&family=Luckiest+Guy&family=Permanent+Marker&family=Pacifico&family=Caveat:wght@400;700&family=Dancing+Script:wght@400;700&family=Great+Vibes&family=Sacramento&family=Satisfy&family=Kaushan+Script&family=Alex+Brush&family=Allura&family=Parisienne&family=Amatic+SC:wght@400;700&family=Shadows+Into+Light&family=Indie+Flower&family=Kalam:wght@400;700&family=DM+Mono:wght@400;500&family=JetBrains+Mono:wght@400;700&family=Space+Mono:wght@400;700&display=swap"
rel="stylesheet"
/>
</head>
diff --git a/src/components/editor/Editor.tsx b/src/components/editor/Editor.tsx
index 7e78348..d469e19 100644
--- a/src/components/editor/Editor.tsx
+++ b/src/components/editor/Editor.tsx
@@ -15,6 +15,7 @@ import { TemplatesPanel } from './panels/TemplatesPanel'
import { ElementsPanel } from './panels/ElementsPanel'
import { TextPanel } from './panels/TextPanel'
import { UploadsPanel } from './panels/UploadsPanel'
+import { PhotosPanel } from './panels/PhotosPanel'
import { BrandPanel } from './panels/BrandPanel'
import { ToolsPanel } from './panels/ToolsPanel'
import { ProjectsPanel } from './panels/ProjectsPanel'
@@ -37,6 +38,7 @@ const PANEL_TITLES: Record<Exclude<PanelId, null>, string> = {
text: 'Text',
brand: 'Brand',
uploads: 'Uploads',
+ photos: 'Photos',
tools: 'Tools',
projects: 'Projects',
apps: 'Apps',
@@ -317,6 +319,7 @@ export default function Editor() {
case 'elements': return <ElementsPanel />
case 'text': return <TextPanel />
case 'uploads': return <UploadsPanel />
+ case 'photos': return <PhotosPanel />
case 'brand': return <BrandPanel />
case 'tools': return <ToolsPanel />
case 'projects': return <ProjectsPanel />
diff --git a/src/components/editor/ExportDialog.tsx b/src/components/editor/ExportDialog.tsx
index 9a0ea1a..5fe1cf8 100644
--- a/src/components/editor/ExportDialog.tsx
+++ b/src/components/editor/ExportDialog.tsx
@@ -1,7 +1,7 @@
'use client'
import { useState } from 'react'
-import { Download, Loader2, FileImage } from 'lucide-react'
+import { Download, Loader2, FileImage, FileType2 } from 'lucide-react'
import { useEditorStore } from '@/store/editor-store'
import { captureStage, canvasBridge } from './canvas/canvas-bridge'
import { toast } from '@/hooks/use-toast'
@@ -36,17 +36,20 @@ const SCALES = [
]
const FORMATS = [
- { id: 'png', label: 'PNG', hint: 'Lossless · transparency' },
- { id: 'jpg', label: 'JPG', hint: 'Smaller file' },
+ { id: 'png', label: 'PNG', hint: 'Lossless · transparency', icon: FileImage },
+ { id: 'jpg', label: 'JPG', hint: 'Smaller file', icon: FileImage },
+ { id: 'pdf', label: 'PDF', hint: 'Print-ready · all pages', icon: FileType2 },
] as const
+type FormatId = (typeof FORMATS)[number]['id']
+
export function ExportDialog({ open, onOpenChange }: { open: boolean; onOpenChange: (o: boolean) => void }) {
const name = useEditorStore((s) => s.designName)
const pages = useEditorStore((s) => s.pages)
const setCurrentPage = useEditorStore((s) => s.setCurrentPage)
const currentPage = useEditorStore((s) => s.currentPage)
- const [format, setFormat] = useState<'png' | 'jpg'>('png')
+ const [format, setFormat] = useState<FormatId>('png')
const [scale, setScale] = useState(2)
const [allPages, setAllPages] = useState(false)
const [busy, setBusy] = useState(false)
@@ -59,6 +62,31 @@ export function ExportDialog({ open, onOpenChange }: { open: boolean; onOpenChan
const run = async () => {
setBusy(true)
try {
+ if (format === 'pdf') {
+ // multi-page PDF via jsPDF (client-side, no watermark)
+ const { jsPDF } = await import('jspdf')
+ const pw = canvasBridge.pageWidth
+ const ph = canvasBridge.pageHeight
+ const orientation = pw >= ph ? 'landscape' : 'portrait'
+ const pdf = new jsPDF({ orientation, unit: 'px', format: [pw, ph], compress: true })
+ const savedPage = currentPage
+ const indices = allPages ? pages.map((_, i) => i) : [currentPage]
+ for (let k = 0; k < indices.length; k++) {
+ const idx = indices[k]
+ if (idx !== useEditorStore.getState().currentPage) {
+ setCurrentPage(idx)
+ await new Promise((r) => setTimeout(r, 260))
+ }
+ const url = await captureStage({ pixelScale: scale, mimeType: 'image/jpeg', quality: 0.95 })
+ if (k > 0) pdf.addPage([pw, ph], orientation)
+ pdf.addImage(url, 'JPEG', 0, 0, pw, ph)
+ }
+ if (savedPage !== useEditorStore.getState().currentPage) setCurrentPage(savedPage)
+ pdf.save(`${base}.pdf`)
+ toast({ title: `PDF downloaded (${pageCount} page${pageCount > 1 ? 's' : ''})` })
+ onOpenChange(false)
+ return
+ }
const mimeType = format === 'png' ? 'image/png' : 'image/jpeg'
const indices = allPages ? pages.map((_, i) => i) : [currentPage]
const savedPage = currentPage
@@ -98,20 +126,25 @@ export function ExportDialog({ open, onOpenChange }: { open: boolean; onOpenChan
<div className="space-y-5 py-2">
<div>
<h4 className="text-xs font-semibold text-muted-foreground mb-2">File type</h4>
- <div className="grid grid-cols-2 gap-2">
- {FORMATS.map((f) => (
- <button
- key={f.id}
- onClick={() => setFormat(f.id)}
- className={cn(
- 'rounded-xl border-2 p-3 text-left transition-all',
- format === f.id ? 'border-[#00C4CC] bg-[#F0FBFC]' : 'border-black/10 hover:border-black/25'
- )}
- >
- <div className="font-bold text-sm">{f.label}</div>
- <div className="text-[11px] text-muted-foreground mt-0.5">{f.hint}</div>
- </button>
- ))}
+ <div className="grid grid-cols-3 gap-2">
+ {FORMATS.map((f) => {
+ const Ico = f.icon
+ return (
+ <button
+ key={f.id}
+ onClick={() => setFormat(f.id)}
+ className={cn(
+ 'rounded-xl border-2 p-3 text-left transition-all',
+ format === f.id ? 'border-[#00C4CC] bg-[#F0FBFC]' : 'border-black/10 hover:border-black/25'
+ )}
+ >
+ <div className="font-bold text-sm flex items-center gap-1.5">
+ <Ico size={13} className="text-[#7D2AE8]" /> {f.label}
+ </div>
+ <div className="text-[11px] text-muted-foreground mt-0.5">{f.hint}</div>
+ </button>
+ )
+ })}
</div>
</div>
@@ -140,8 +173,8 @@ export function ExportDialog({ open, onOpenChange }: { open: boolean; onOpenChan
{pages.length > 1 && (
<label className="flex items-center justify-between rounded-xl border border-black/10 px-4 py-3 cursor-pointer">
<span className="text-sm font-medium">
- Download all pages
- <span className="block text-[11px] text-muted-foreground font-normal">{pages.length} files, one per page</span>
+ {format === 'pdf' ? 'Include all pages' : 'Download all pages'}
+ <span className="block text-[11px] text-muted-foreground font-normal">{format === 'pdf' ? `${pages.length} pages in one PDF file` : `${pages.length} files, one per page`}</span>
</span>
<input type="checkbox" checked={allPages} onChange={(e) => setAllPages(e.target.checked)} className="accent-[#00C4CC] h-4 w-4" />
</label>
diff --git a/src/components/editor/LeftRail.tsx b/src/components/editor/LeftRail.tsx
index 287704b..0b12740 100644
--- a/src/components/editor/LeftRail.tsx
+++ b/src/components/editor/LeftRail.tsx
@@ -1,18 +1,19 @@
'use client'
-import { LayoutTemplate, Shapes, Type, Upload, Palette, Layers, Wrench, FolderOpen, LayoutGrid, BookMarked } from 'lucide-react'
+import { LayoutTemplate, Shapes, Type, Upload, Palette, Layers, Wrench, FolderOpen, LayoutGrid, BookMarked, Image } from 'lucide-react'
import { useEditorStore, type PanelId } from '@/store/editor-store'
import { cn } from '@/lib/utils'
import { useIsMobile } from '@/hooks/use-mobile'
import { Tip } from './tooltip'
-/** Canva-2026 rail: 8 tabs (72×72), 72px wide — Templates / Elements / Text / Brand / Uploads / Tools / Projects / Apps */
+/** Canva-2026 rail: 9 tabs (72×72), 72px wide — Templates / Elements / Text / Brand / Uploads / Photos / Tools / Projects / Apps */
const PANELS: { id: Exclude<PanelId, null>; label: string; icon: typeof LayoutTemplate }[] = [
{ id: 'templates', label: 'Templates', icon: LayoutTemplate },
{ id: 'elements', label: 'Elements', icon: Shapes },
{ id: 'text', label: 'Text', icon: Type },
{ id: 'brand', label: 'Brand', icon: BookMarked },
{ id: 'uploads', label: 'Uploads', icon: Upload },
+ { id: 'photos', label: 'Photos', icon: Image },
{ id: 'tools', label: 'Tools', icon: Wrench },
{ id: 'projects', label: 'Projects', icon: FolderOpen },
{ id: 'apps', label: 'Apps', icon: LayoutGrid },
diff --git a/src/components/editor/PropertiesBar.tsx b/src/components/editor/PropertiesBar.tsx
index 6195582..d0d41d2 100644
--- a/src/components/editor/PropertiesBar.tsx
+++ b/src/components/editor/PropertiesBar.tsx
@@ -115,7 +115,13 @@ export function ContextToolbar({ variant = 'topbar' }: { variant?: 'topbar' | 'm
</TBtn>
</div>
- <ColorMenu value={text.fill} onChange={(c, committed) => committed ? update(ids, { fill: c }) : updateLive(ids, { fill: c })} title="Text colour" />
+ <ColorMenu
+ value={text.fill}
+ gradient={text.fillGradient ?? null}
+ onChange={(c, committed) => committed ? update(ids, { fill: c, fillGradient: null }) : updateLive(ids, { fill: c, fillGradient: null })}
+ onGradient={(g, committed) => { const patch = g ? { fillGradient: g, fill: g.from } : { fillGradient: null }; if (committed) update(ids, patch); else updateLive(ids, patch) }}
+ title="Text colour"
+ />
<TBtn onClick={() => update(ids, { bold: !text.bold })} dataActive={text.bold} title="Bold" ariaLabel="Bold">
<Bold size={14} />
@@ -225,7 +231,13 @@ export function ContextToolbar({ variant = 'topbar' }: { variant?: 'topbar' | 'm
<>
{shape && (
<>
- <ColorMenu value={shape.fill} onChange={(c, committed) => committed ? update(ids, { fill: c }) : updateLive(ids, { fill: c })} title="Fill" />
+ <ColorMenu
+ value={shape.fill}
+ gradient={shape.fillGradient ?? null}
+ onChange={(c, committed) => committed ? update(ids, { fill: c, fillGradient: null }) : updateLive(ids, { fill: c, fillGradient: null })}
+ onGradient={(g, committed) => { const patch = g ? { fillGradient: g, fill: g.from } : { fillGradient: null }; if (committed) update(ids, patch); else updateLive(ids, patch) }}
+ title="Fill"
+ />
{/* border colour + width */}
<ToolbarPopover trigger={(open) => (
<button className="cv-tbtn gap-1 !px-2.5" data-active={open} aria-label="Border" title="Border">
diff --git a/src/components/editor/add-element.ts b/src/components/editor/add-element.ts
index 7395a98..1de2aa0 100644
--- a/src/components/editor/add-element.ts
+++ b/src/components/editor/add-element.ts
@@ -12,7 +12,7 @@ import { useEditorStore } from '@/store/editor-store'
import { GRAPHICS } from '@/lib/editor-utils'
/** center-ish placement with a small cascade so stacked adds are visible */
-function placement(width: number, height: number, count: number) {
+export function placement(width: number, height: number, count: number) {
const state = useEditorStore.getState()
return {
x: Math.max(0, (state.width - width) / 2 + ((count % 7) - 3) * 18),
diff --git a/src/components/editor/apps/AIImageApp.tsx b/src/components/editor/apps/AIImageApp.tsx
new file mode 100644
index 0000000..2452a3d
--- /dev/null
+++ b/src/components/editor/apps/AIImageApp.tsx
@@ -0,0 +1,213 @@
+'use client'
+
+import { useState } from 'react'
+import { ImageIcon, Loader2, Plus, RefreshCw, Sparkles } from 'lucide-react'
+import { createImageElement } from '@/lib/types'
+import { useEditorStore } from '@/store/editor-store'
+import { AppHeader, type AppPanelProps } from './registry'
+import { cn } from '@/lib/utils'
+import { toast } from '@/hooks/use-toast'
+
+const SIZES = [
+ { id: '1024x1024', label: 'Square 1:1', w: 1, h: 1 },
+ { id: '1344x768', label: 'Wide 16:9', w: 16, h: 9 },
+ { id: '768x1344', label: 'Story 9:16', w: 9, h: 16 },
+ { id: '1152x864', label: 'Photo 4:3', w: 4, h: 3 },
+] as const
+
+const STYLES = [
+ 'Photorealistic, professional photography',
+ 'Flat vector illustration',
+ '3D render, soft studio lighting',
+ 'Watercolour painting',
+ 'Minimal gradient poster art',
+]
+
+const IDEAS = [
+ 'A minimalist workspace with a plant and coffee, soft morning light',
+ 'Abstract wave shapes in purple and teal, poster style',
+ 'Cute 3D character holding a rocket ship',
+ 'Sunset over calm ocean with pastel sky',
+]
+
+interface Generated {
+ dataUrl: string
+ width: number
+ height: number
+ prompt: string
+}
+
+export function AIImageApp({ onClose }: AppPanelProps) {
+ const addElement = useEditorStore((s) => s.addElement)
+ const pages = useEditorStore((s) => s.pages)
+ const currentPage = useEditorStore((s) => s.currentPage)
+ const designW = useEditorStore((s) => s.width)
+ const designH = useEditorStore((s) => s.height)
+
+ const [prompt, setPrompt] = useState('')
+ const [style, setStyle] = useState<string | null>(null)
+ const [size, setSize] = useState<(typeof SIZES)[number]['id']>('1024x1024')
+ const [image, setImage] = useState<Generated | null>(null)
+ const [busy, setBusy] = useState(false)
+ const [error, setError] = useState<string | null>(null)
+
+ const generate = async (regen = false) => {
+ if (!prompt.trim() || busy) return
+ setBusy(true)
+ setError(null)
+ if (!regen) setImage(null)
+ try {
+ const fullPrompt = style ? `${prompt}, ${style}` : prompt
+ const res = await fetch('/api/ai/image', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ prompt: fullPrompt, size }),
+ })
+ const data = (await res.json()) as Generated & { error?: string }
+ if (!res.ok || !data.dataUrl) throw new Error(data.error ?? 'Generation failed')
+ setImage({ ...data, prompt: fullPrompt })
+ } catch (e) {
+ setError(e instanceof Error ? e.message : 'Generation failed')
+ } finally {
+ setBusy(false)
+ }
+ }
+
+ const addToCanvas = () => {
+ if (!image) return
+ const maxW = designW * 0.7
+ const maxH = designH * 0.7
+ const scale = Math.min(maxW / image.width, maxH / image.height, 1)
+ const w = Math.round(image.width * scale)
+ const h = Math.round(image.height * scale)
+ addElement(
+ createImageElement(image.dataUrl, image.width, image.height, {
+ x: Math.max(0, (designW - w) / 2),
+ y: Math.max(0, (designH - h) / 2),
+ width: w,
+ height: h,
+ })
+ )
+ toast({ title: 'AI image added' })
+ }
+
+ return (
+ <div>
+ <AppHeader icon={ImageIcon} title="AI image generator" onClose={onClose} />
+
+ <div className="rounded-xl border border-white/10 bg-white/[0.04] focus-within:border-[#7630D7] transition-colors p-3 mb-2.5">
+ <textarea
+ value={prompt}
+ onChange={(e) => setPrompt(e.target.value)}
+ onKeyDown={(e) => { if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) generate() }}
+ rows={2}
+ maxLength={600}
+ placeholder="Describe the image — e.g. “A dreamy purple nebula with a lone astronaut”"
+ className="w-full bg-transparent outline-none text-[12.5px] text-white resize-none placeholder:text-white/35"
+ aria-label="Image generation prompt"
+ />
+ </div>
+
+ <div className="grid grid-cols-4 gap-1.5 mb-2">
+ {SIZES.map((s) => (
+ <button
+ key={s.id}
+ onClick={() => setSize(s.id)}
+ className={cn(
+ 'h-7 rounded-lg text-[10px] font-semibold transition-colors',
+ size === s.id ? 'bg-[#7630D7] text-white' : 'bg-white/[0.05] text-white/60 hover:text-white'
+ )}
+ title={s.label}
+ >
+ {s.label}
+ </button>
+ ))}
+ </div>
+
+ <div className="flex gap-1.5 flex-wrap mb-2.5">
+ {STYLES.map((s) => (
+ <button
+ key={s}
+ onClick={() => setStyle(style === s ? null : s)}
+ className={cn(
+ 'h-6 px-2.5 rounded-full text-[10px] font-semibold border transition-colors',
+ style === s ? 'bg-white/[0.16] text-white border-white/25' : 'text-white/55 border-white/10 hover:text-white'
+ )}
+ >
+ {s.split(',')[0]}
+ </button>
+ ))}
+ </div>
+
+ <button
+ onClick={() => generate()}
+ disabled={busy || !prompt.trim()}
+ className="w-full h-10 rounded-xl bg-gradient-to-r from-[#7630D7] to-[#9B6BFF] text-white text-[13px] font-bold flex items-center justify-center gap-2 disabled:opacity-40 hover:brightness-110 transition-all"
+ aria-label="Generate image"
+ >
+ {busy ? <Loader2 size={14} className="animate-spin" /> : <Sparkles size={14} />}
+ {busy ? 'Dreaming…' : 'Generate image'}
+ </button>
+
+ {error && <p className="text-[11px] text-[#FF8095] mt-2.5">{error}</p>}
+
+ {busy && (
+ <div className="mt-3 rounded-xl border border-white/10 bg-white/[0.03] aspect-square flex flex-col items-center justify-center gap-2">
+ <Loader2 size={22} className="animate-spin text-[#9B6BFF]" />
+ <span className="text-[11px] text-white/50">Painting your image…</span>
+ </div>
+ )}
+
+ {image && !busy && (
+ <div className="mt-3">
+ <button
+ onClick={addToCanvas}
+ className="group relative w-full rounded-xl overflow-hidden border border-white/10 hover:border-[#7630D7] transition-colors"
+ role="button"
+ aria-label="Add image to canvas"
+ >
+ <img src={image.dataUrl} alt={image.prompt} className="w-full block" />
+ <span className="absolute inset-0 hidden group-hover:flex items-center justify-center bg-black/35">
+ <span className="h-8 px-4 rounded-full bg-[#7630D7] text-white text-[11.5px] font-bold flex items-center gap-1.5 shadow-lg">
+ <Plus size={12} /> Add to canvas
+ </span>
+ </span>
+ </button>
+ <div className="flex gap-2 mt-2">
+ <button
+ onClick={() => generate(true)}
+ className="flex-1 h-8 rounded-lg border border-white/12 text-white/70 hover:text-white text-[11px] font-semibold flex items-center justify-center gap-1.5"
+ aria-label="Generate another"
+ >
+ <RefreshCw size={11} /> Another
+ </button>
+ <button
+ onClick={addToCanvas}
+ className="flex-1 h-8 rounded-lg bg-[#7630D7] hover:bg-[#8B5CF6] text-white text-[11px] font-semibold flex items-center justify-center gap-1.5"
+ aria-label="Add to canvas"
+ >
+ <Plus size={11} /> Add to canvas
+ </button>
+ </div>
+ </div>
+ )}
+
+ {!image && !busy && !error && (
+ <div className="mt-3.5">
+ <p className="text-[10.5px] font-bold text-white/60 uppercase tracking-wide mb-1.5">Try a prompt like…</p>
+ <div className="space-y-1">
+ {IDEAS.map((idea) => (
+ <button
+ key={idea}
+ onClick={() => setPrompt(idea)}
+ className="block w-full text-left text-[11.5px] text-white/55 hover:text-white rounded-lg border border-white/[0.07] hover:border-white/20 px-2.5 py-1.5 transition-colors"
+ >
+ “{idea}”
+ </button>
+ ))}
+ </div>
+ </div>
+ )}
+ </div>
+ )
+}
diff --git a/src/components/editor/apps/MagicWriteApp.tsx b/src/components/editor/apps/MagicWriteApp.tsx
new file mode 100644
index 0000000..410854a
--- /dev/null
+++ b/src/components/editor/apps/MagicWriteApp.tsx
@@ -0,0 +1,188 @@
+'use client'
+
+import { useState } from 'react'
+import { Sparkles, Loader2, Plus, RefreshCw, Wand2 } from 'lucide-react'
+import { createTextElement } from '@/lib/types'
+import { placement } from '../add-element'
+import { useEditorStore } from '@/store/editor-store'
+import { AppHeader, type AppPanelProps } from './registry'
+import { cn } from '@/lib/utils'
+import { toast } from '@/hooks/use-toast'
+
+const KINDS = [
+ { id: 'headline', label: 'Headline', fontSize: 64, bold: true },
+ { id: 'tagline', label: 'Tagline', fontSize: 44, bold: true },
+ { id: 'body', label: 'Body', fontSize: 28, bold: false },
+ { id: 'social', label: 'Caption', fontSize: 30, bold: false },
+] as const
+
+const TONES = ['bold', 'playful', 'elegant', 'minimal', 'corporate', 'warm'] as const
+
+const IDEAS = [
+ 'A poster for a summer music festival',
+ 'Instagram caption for a new coffee shop',
+ 'Headline for an eco-friendly water bottle',
+ 'Tagline for a fitness app launch',
+]
+
+export function MagicWriteApp({ onClose }: AppPanelProps) {
+ const addElement = useEditorStore((s) => s.addElement)
+ const pages = useEditorStore((s) => s.pages)
+ const currentPage = useEditorStore((s) => s.currentPage)
+ const width = useEditorStore((s) => s.width)
+ const height = useEditorStore((s) => s.height)
+
+ const [prompt, setPrompt] = useState('')
+ const [kind, setKind] = useState<(typeof KINDS)[number]['id']>('tagline')
+ const [tone, setTone] = useState<(typeof TONES)[number]>('bold')
+ const [options, setOptions] = useState<string[]>([])
+ const [busy, setBusy] = useState(false)
+ const [error, setError] = useState<string | null>(null)
+
+ const generate = async () => {
+ if (!prompt.trim() || busy) return
+ setBusy(true)
+ setError(null)
+ setOptions([])
+ try {
+ const res = await fetch('/api/ai/write', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ prompt, kind, tone }),
+ })
+ const data = (await res.json()) as { options?: string[]; error?: string }
+ if (!res.ok || !data.options) throw new Error(data.error ?? 'Generation failed')
+ setOptions(data.options)
+ } catch (e) {
+ setError(e instanceof Error ? e.message : 'Generation failed')
+ } finally {
+ setBusy(false)
+ }
+ }
+
+ const addToCanvas = (text: string) => {
+ const preset = KINDS.find((k) => k.id === kind)!
+ const pos = placement(Math.min(width * 0.7, 800), preset.fontSize, pages[currentPage].elements.length)
+ addElement(
+ createTextElement({
+ ...pos,
+ width: Math.min(width * 0.72, 820),
+ height: preset.fontSize * 1.6,
+ text,
+ fontSize: preset.fontSize,
+ bold: preset.bold,
+ align: 'center',
+ })
+ )
+ toast({ title: 'Added to canvas' })
+ }
+
+ return (
+ <div>
+ <AppHeader icon={Wand2} title="Magic Write" onClose={onClose} />
+
+ <div
+ className="rounded-xl border border-white/10 bg-white/[0.04] focus-within:border-[#7630D7] transition-colors p-3 mb-2.5"
+ >
+ <textarea
+ value={prompt}
+ onChange={(e) => setPrompt(e.target.value)}
+ onKeyDown={(e) => { if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) generate() }}
+ rows={2}
+ maxLength={500}
+ placeholder="Describe what you need — e.g. “A poster tagline for a summer music festival”"
+ className="w-full bg-transparent outline-none text-[12.5px] text-white resize-none placeholder:text-white/35"
+ aria-label="Magic Write prompt"
+ />
+ </div>
+
+ <div className="grid grid-cols-4 gap-1.5 mb-2">
+ {KINDS.map((k) => (
+ <button
+ key={k.id}
+ onClick={() => setKind(k.id)}
+ className={cn(
+ 'h-7 rounded-lg text-[10.5px] font-semibold transition-colors',
+ kind === k.id ? 'bg-[#7630D7] text-white' : 'bg-white/[0.05] text-white/60 hover:text-white'
+ )}
+ >
+ {k.label}
+ </button>
+ ))}
+ </div>
+
+ <div className="flex gap-1.5 flex-wrap mb-2.5">
+ {TONES.map((t) => (
+ <button
+ key={t}
+ onClick={() => setTone(t)}
+ className={cn(
+ 'h-6 px-2.5 rounded-full text-[10px] font-semibold border transition-colors capitalize',
+ tone === t ? 'bg-white/[0.16] text-white border-white/25' : 'text-white/55 border-white/10 hover:text-white'
+ )}
+ >
+ {t}
+ </button>
+ ))}
+ </div>
+
+ <button
+ onClick={generate}
+ disabled={busy || !prompt.trim()}
+ className="w-full h-10 rounded-xl bg-gradient-to-r from-[#7630D7] to-[#9B6BFF] text-white text-[13px] font-bold flex items-center justify-center gap-2 disabled:opacity-40 hover:brightness-110 transition-all"
+ aria-label="Generate copy"
+ >
+ {busy ? <Loader2 size={14} className="animate-spin" /> : <Sparkles size={14} />}
+ {busy ? 'Writing…' : 'Generate 3 options'}
+ </button>
+
+ {error && <p className="text-[11px] text-[#FF8095] mt-2.5">{error}</p>}
+
+ {options.length > 0 && (
+ <div className="mt-3 space-y-1.5">
+ <div className="flex items-center justify-between">
+ <span className="text-[10.5px] font-bold text-white/60 uppercase tracking-wide">Results</span>
+ <button
+ onClick={generate}
+ className="text-[10px] text-white/50 hover:text-white flex items-center gap-1"
+ aria-label="Regenerate"
+ >
+ <RefreshCw size={10} /> Regenerate
+ </button>
+ </div>
+ {options.map((opt, i) => (
+ <button
+ key={i}
+ onClick={() => addToCanvas(opt)}
+ className="group w-full text-left rounded-xl border border-white/10 bg-white/[0.04] hover:border-[#7630D7] p-2.5 transition-colors"
+ role="button"
+ aria-label={`Add option ${i + 1}`}
+ >
+ <p className="text-[12px] text-white/90 leading-snug">{opt}</p>
+ <span className="hidden group-hover:flex items-center gap-1 mt-1.5 text-[10px] font-bold text-[#02C0CC]">
+ <Plus size={10} /> Add to canvas
+ </span>
+ </button>
+ ))}
+ </div>
+ )}
+
+ {options.length === 0 && !busy && !error && (
+ <div className="mt-3.5">
+ <p className="text-[10.5px] font-bold text-white/60 uppercase tracking-wide mb-1.5">Try asking for…</p>
+ <div className="space-y-1">
+ {IDEAS.map((idea) => (
+ <button
+ key={idea}
+ onClick={() => setPrompt(idea)}
+ className="block w-full text-left text-[11.5px] text-white/55 hover:text-white rounded-lg border border-white/[0.07] hover:border-white/20 px-2.5 py-1.5 transition-colors"
+ >
+ “{idea}”
+ </button>
+ ))}
+ </div>
+ </div>
+ )}
+ </div>
+ )
+}
diff --git a/src/components/editor/apps/registry.tsx b/src/components/editor/apps/registry.tsx
index 2a3b90e..32c192e 100644
--- a/src/components/editor/apps/registry.tsx
+++ b/src/components/editor/apps/registry.tsx
@@ -1,6 +1,6 @@
'use client'
-import { BarChart3, QrCode, Smile, Shapes, Palette, Type } from 'lucide-react'
+import { BarChart3, QrCode, Smile, Shapes, Palette, Type, Wand2, ImageIcon } from 'lucide-react'
import type { LucideIcon } from 'lucide-react'
/** ── Canvix app registry ─────────────────────────────────────
@@ -30,8 +30,13 @@ import { IconsApp } from './IconsApp'
import { PaletteApp } from './PaletteApp'
import { LoremApp } from './LoremApp'
import { StickersApp } from './StickersApp'
+import { MagicWriteApp } from './MagicWriteApp'
+import { AIImageApp } from './AIImageApp'
export const CANVIX_APPS: CanvixApp[] = [
+ // AI apps first (canva 2026: “Canva AI” is the flagship surface)
+ { id: 'magic-write', name: 'Magic Write', desc: 'AI copy — headlines, taglines & captions', icon: Wand2, color: '#9B6BFF', content: MagicWriteApp },
+ { id: 'ai-image', name: 'AI image generator', desc: 'Turn a prompt into a design-ready image', icon: ImageIcon, color: '#02C0CC', content: AIImageApp },
{ id: 'charts', name: 'Charts', desc: 'Bar, line & donut charts as editable shapes', icon: BarChart3, color: '#7630D7', content: ChartsApp },
{ id: 'qr', name: 'QR generator', desc: 'Turn any link or text into a QR code', icon: QrCode, color: '#3B82F6', content: QRApp },
{ id: 'icons', name: 'Icons', desc: 'Line & solid icon shapes for any design', icon: Shapes, color: '#02C0CC', content: IconsApp },
diff --git a/src/components/editor/canvas/CanvasStage.tsx b/src/components/editor/canvas/CanvasStage.tsx
index 8943b4d..939a571 100644
--- a/src/components/editor/canvas/CanvasStage.tsx
+++ b/src/components/editor/canvas/CanvasStage.tsx
@@ -1,6 +1,6 @@
'use client'
-import { useCallback, useEffect, useRef, useState } from 'react'
+import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import type Konva from 'konva'
import { Group, Layer, Line, Rect, Stage, Transformer } from 'react-konva'
import type { KonvaEventObject } from 'konva/lib/Node'
@@ -39,9 +39,14 @@ export default function CanvasStage() {
const drawColor = useEditorStore((s) => s.drawColor)
const drawSize = useEditorStore((s) => s.drawSize)
const editingMode = useEditorStore((s) => s.editingMode)
- // v0.3.1: rulers & manual guides
+ // v0.3.1: rulers & manual guides (v0.3.2: per-page)
const showRulers = useEditorStore((s) => s.showRulers)
- const manualGuides = useEditorStore((s) => s.manualGuides)
+ const allGuides = useEditorStore((s) => s.manualGuides)
+ const currentPageId = useEditorStore((s) => s.pages[s.currentPage]?.id)
+ const manualGuides = useMemo(
+ () => allGuides.filter((g) => g.pageId === currentPageId),
+ [allGuides, currentPageId]
+ )
const addManualGuide = useEditorStore((s) => s.addManualGuide)
const moveManualGuide = useEditorStore((s) => s.moveManualGuide)
const removeManualGuide = useEditorStore((s) => s.removeManualGuide)
@@ -217,7 +222,8 @@ export default function CanvasStage() {
.map((e) => ({ x: e.x, y: e.y, width: e.width, height: e.height, rotation: e.rotation }))
// v0.3.1: manual guides act as snap targets (zero-size virtual edges)
if (state.showRulers) {
- for (const g of state.manualGuides) {
+ const pageId = p.id
+ for (const g of state.manualGuides.filter((gg) => gg.pageId === pageId)) {
others.push(
g.axis === 'x'
? { x: g.position, y: 0, width: 0, height: 0, rotation: 0 }
diff --git a/src/components/editor/canvas/context-menu.tsx b/src/components/editor/canvas/context-menu.tsx
index 3e2caad..b7397c9 100644
--- a/src/components/editor/canvas/context-menu.tsx
+++ b/src/components/editor/canvas/context-menu.tsx
@@ -68,6 +68,9 @@ export function CanvasContextMenu({ state, onClose }: { state: ContextMenuState;
const selectedIds = store.selectedIds
const canGroup = selectedIds.length >= 2
+ // per-page guides (v0.3.2)
+ const pageId = store.pages[store.currentPage]?.id
+ const pageGuidesCount = store.manualGuides.filter((g) => g.pageId === pageId).length
const canUngroup = store.pages[store.currentPage].elements.some(
(el) => selectedIds.includes(el.id) && isGroup(el)
)
@@ -105,8 +108,8 @@ export function CanvasContextMenu({ state, onClose }: { state: ContextMenuState;
const pageItems: Item[] = [
{ label: 'Paste', icon: ClipboardPaste, kbd: 'Ctrl+V', onSelect: () => store.pasteClipboard() },
{ label: 'Select all', icon: MousePointerClick, kbd: 'Ctrl+A', onSelect: () => store.setSelection(store.pages[store.currentPage].elements.filter((e) => !e.locked).map((e) => e.id)) },
- ...(store.manualGuides.length > 0
- ? [{ label: `Clear guides (${store.manualGuides.length})`, icon: Ruler, onSelect: () => store.clearManualGuides() }]
+ ...(pageGuidesCount > 0
+ ? [{ label: `Clear guides (${pageGuidesCount})`, icon: Ruler, onSelect: () => store.clearManualGuides() }]
: []),
Sep as unknown as Item,
{ label: 'Add page', icon: FilePlus2, onSelect: () => store.addPage() },
diff --git a/src/components/editor/canvas/element-node.tsx b/src/components/editor/canvas/element-node.tsx
index 93f83ab..fb8822d 100644
--- a/src/components/editor/canvas/element-node.tsx
+++ b/src/components/editor/canvas/element-node.tsx
@@ -14,7 +14,8 @@ import type {
StrokeElement,
TextElement,
} from '@/lib/types'
-import { isLine, withAlpha } from '@/lib/types'
+import { isLine, withAlpha, type GradientFill } from '@/lib/types'
+import { elementGradientProps } from '@/lib/editor-utils'
import { useEditorStore } from '@/store/editor-store'
import { useLoadedImage } from './use-loaded-image'
@@ -300,6 +301,12 @@ export function ElementNode({ element: el, interactive, hiding, registerNode, on
const t = el as TextElement
const effect = t.effect && t.effect !== 'none' ? textEffectProps(t) : {}
const rendered = t.uppercase ? t.text.toUpperCase() : t.text
+ // gradient fill (skipped for effects that own the fill, e.g. Hollow)
+ const textGrad: GradientFill | null | undefined = t.fillGradient
+ const gradProps =
+ textGrad && (!t.effect || ['none', 'shadow', 'lift', 'echo', 'splice'].includes(t.effect))
+ ? elementGradientProps(textGrad, t.width, Math.max(t.height, t.fontSize * t.lineHeight), 'corner')
+ : {}
if (t.effect === 'background') {
// canva "Background" effect: solid block behind the text
@@ -342,12 +349,13 @@ export function ElementNode({ element: el, interactive, hiding, registerNode, on
<Text
{...common}
{...effect}
+ {...gradProps}
text={rendered}
fontSize={t.fontSize}
fontFamily={t.fontFamily}
fontStyle={`${t.italic ? 'italic ' : ''}${t.bold ? 'bold' : 'normal'}`}
textDecoration={[t.underline ? 'underline' : '', t.strike ? 'line-through' : ''].filter(Boolean).join(' ')}
- fill={t.fill}
+ fill={Object.keys(gradProps).length ? undefined : t.fill}
align={t.align === 'justify' ? 'left' : t.align}
width={t.width}
lineHeight={t.lineHeight}
@@ -360,28 +368,33 @@ export function ElementNode({ element: el, interactive, hiding, registerNode, on
case 'rect': {
const s = el as ShapeElement
- return <Rect {...common} width={s.width} height={s.height} fill={s.fill} stroke={s.stroke} strokeWidth={s.strokeWidth} cornerRadius={s.cornerRadius} />
+ const grad = s.fillGradient ? elementGradientProps(s.fillGradient, s.width, s.height, 'corner') : {}
+ return <Rect {...common} width={s.width} height={s.height} {...grad} fill={s.fillGradient ? undefined : s.fill} stroke={s.stroke} strokeWidth={s.strokeWidth} cornerRadius={s.cornerRadius} />
}
case 'ellipse': {
const s = el as ShapeElement
- return <Ellipse {...common} x={s.x + s.width / 2} y={s.y + s.height / 2} radiusX={s.width / 2} radiusY={s.height / 2} fill={s.fill} stroke={s.stroke} strokeWidth={s.strokeWidth} />
+ const grad = s.fillGradient ? elementGradientProps(s.fillGradient, s.width, s.height, 'center') : {}
+ return <Ellipse {...common} x={s.x + s.width / 2} y={s.y + s.height / 2} radiusX={s.width / 2} radiusY={s.height / 2} {...grad} fill={s.fillGradient ? undefined : s.fill} stroke={s.stroke} strokeWidth={s.strokeWidth} />
}
case 'triangle': {
const s = el as ShapeElement
- return <Line {...common} points={[0, s.height, s.width / 2, 0, s.width, s.height]} closed fill={s.fill} stroke={s.stroke} strokeWidth={s.strokeWidth} />
+ const grad = s.fillGradient ? elementGradientProps(s.fillGradient, s.width, s.height, 'corner') : {}
+ return <Line {...common} points={[0, s.height, s.width / 2, 0, s.width, s.height]} closed {...grad} fill={s.fillGradient ? undefined : s.fill} stroke={s.stroke} strokeWidth={s.strokeWidth} />
}
case 'star': {
const s = el as ShapeElement
const outer = Math.min(s.width, s.height) / 2
- return <Star {...common} x={s.x + s.width / 2} y={s.y + s.height / 2} numPoints={5} innerRadius={outer * 0.55} outerRadius={outer} fill={s.fill} stroke={s.stroke} strokeWidth={s.strokeWidth} />
+ const grad = s.fillGradient ? elementGradientProps(s.fillGradient, s.width, s.height, 'center') : {}
+ return <Star {...common} x={s.x + s.width / 2} y={s.y + s.height / 2} numPoints={5} innerRadius={outer * 0.55} outerRadius={outer} {...grad} fill={s.fillGradient ? undefined : s.fill} stroke={s.stroke} strokeWidth={s.strokeWidth} />
}
case 'path': {
const s = el as ShapeElement
- return <Path {...common} data={s.pathData ?? ''} scaleX={s.width / 100} scaleY={s.height / 100} fill={s.fill} stroke={s.stroke} strokeWidth={s.strokeWidth / (s.width / 100)} />
+ const grad = s.fillGradient ? elementGradientProps(s.fillGradient, s.width, s.height, 'box100') : {}
+ return <Path {...common} data={s.pathData ?? ''} scaleX={s.width / 100} scaleY={s.height / 100} {...grad} fill={s.fillGradient ? undefined : s.fill} stroke={s.stroke} strokeWidth={s.strokeWidth / (s.width / 100)} />
}
case 'line': {
diff --git a/src/components/editor/panels/PhotosPanel.tsx b/src/components/editor/panels/PhotosPanel.tsx
new file mode 100644
index 0000000..026b44c
--- /dev/null
+++ b/src/components/editor/panels/PhotosPanel.tsx
@@ -0,0 +1,135 @@
+'use client'
+
+import { useMemo, useState } from 'react'
+import { Plus, ImageDown } from 'lucide-react'
+import { PanelShell } from './panel-shell'
+import { addImageFromSrc } from '../add-element'
+import { cn } from '@/lib/utils'
+import { toast } from '@/hooks/use-toast'
+
+/** stock photo entry — bundled, AI-generated, license-free */
+interface StockPhoto {
+ file: string
+ cat: string
+ tags: string[]
+}
+
+const CATEGORIES = [
+ { id: 'all', label: 'All photos' },
+ { id: 'nature', label: 'Nature' },
+ { id: 'business', label: 'Business' },
+ { id: 'people', label: 'People' },
+ { id: 'food', label: 'Food' },
+ { id: 'travel', label: 'Travel' },
+ { id: 'texture', label: 'Textures' },
+ { id: 'abstract', label: 'Abstract' },
+]
+
+const TAGS: Record<string, string[]> = {
+ nature: ['mountain', 'landscape', 'forest', 'lake', 'sunset', 'outdoor', 'green', 'mist'],
+ business: ['office', 'work', 'laptop', 'desk', 'startup', 'meeting', 'coffee', 'minimal'],
+ people: ['team', 'portrait', 'collaboration', 'creative', 'diverse', 'lifestyle'],
+ food: ['flat lay', 'healthy', 'fresh', 'colorful', 'vegetables', 'meal'],
+ travel: ['beach', 'ocean', 'tropical', 'palm', 'summer', 'vacation', 'sunset'],
+ texture: ['paper', 'macro', 'pastel', 'tactile', 'material', 'background'],
+ abstract: ['gradient', 'color', 'modern', 'wallpaper', 'purple', 'teal'],
+}
+
+const PHOTOS: StockPhoto[] = []
+for (const cat of Object.keys(TAGS)) {
+ for (let n = 1; n <= 6; n++) {
+ PHOTOS.push({ file: `/photos/${cat}-${n}.jpg`, cat, tags: TAGS[cat] })
+ }
+}
+
+export function PhotosPanel() {
+ const [cat, setCat] = useState('all')
+ const [query, setQuery] = useState('')
+ // resilient to not-yet-bundled photos: broken tiles hide themselves
+ const [hidden, setHidden] = useState<Record<string, boolean>>({})
+
+ const photos = useMemo(() => {
+ const q = query.trim().toLowerCase()
+ return PHOTOS.filter((p) => {
+ if (hidden[p.file]) return false
+ if (cat !== 'all' && p.cat !== cat) return false
+ if (!q) return true
+ const label = CATEGORIES.find((c) => c.id === p.cat)?.label ?? p.cat
+ return p.cat.includes(q) || label.toLowerCase().includes(q) || p.tags.some((t) => t.includes(q))
+ })
+ }, [cat, query, hidden])
+
+ const add = (p: StockPhoto) => {
+ // bundled photos are 900 × ~514 (1344×768 originals downscaled)
+ addImageFromSrc(p.file, 900, 514)
+ toast({ title: 'Photo added' })
+ }
+
+ return (
+ <PanelShell
+ title="Photos"
+ subtitle="Free stock library — search or browse"
+ searchPlaceholder="Search photos (e.g. nature, coffee, beach)"
+ onSearch={setQuery}
+ belowSearch={
+ <div className="flex gap-1.5 flex-wrap mt-2.5">
+ {CATEGORIES.map((c) => (
+ <button
+ key={c.id}
+ onClick={() => setCat(c.id)}
+ className={cn(
+ 'h-7 px-3 rounded-full text-[11.5px] font-semibold transition-colors border',
+ cat === c.id
+ ? 'bg-white/[0.16] text-white border-white/25'
+ : 'bg-transparent text-white/65 border-white/10 hover:bg-white/[0.07] hover:text-white'
+ )}
+ aria-pressed={cat === c.id}
+ >
+ {c.label}
+ </button>
+ ))}
+ </div>
+ }
+ >
+ {photos.length === 0 ? (
+ <div className="py-16 text-center">
+ <ImageDown size={28} className="mx-auto text-white/25 mb-3" />
+ <p className="text-[13px] text-white/50 font-medium">No photos match “{query}”</p>
+ <p className="text-[11.5px] text-white/35 mt-1">Try a different keyword or category.</p>
+ </div>
+ ) : (
+ <div className="grid grid-cols-2 gap-2.5">
+ {photos.map((p) => (
+ <button
+ key={p.file}
+ onClick={() => add(p)}
+ className={cn(
+ 'group relative aspect-[7/5] rounded-xl overflow-hidden border border-white/10',
+ 'hover:border-[#7630D7] transition-colors'
+ )}
+ aria-label={`Add photo ${p.cat}`}
+ >
+ <img
+ src={p.file}
+ alt={`${p.cat} stock photo`}
+ loading="lazy"
+ onError={() => setHidden((h) => ({ ...h, [p.file]: true }))}
+ className="absolute inset-0 h-full w-full object-cover group-hover:scale-[1.04] transition-transform duration-300"
+ />
+ <span className="absolute inset-0 bg-black/0 group-hover:bg-black/25 transition-colors" />
+ <span className="absolute inset-0 hidden group-hover:flex items-center justify-center">
+ <span className="h-8 px-3 rounded-full bg-[#7630D7] text-white text-[11.5px] font-bold flex items-center gap-1.5 shadow-lg">
+ <Plus size={12} /> Add
+ </span>
+ </span>
+ </button>
+ ))}
+ </div>
+ )}
+
+ <p className="text-[10.5px] text-white/30 mt-3 leading-relaxed">
+ All photos are AI-generated for Canvix and free to use in your designs.
+ </p>
+ </PanelShell>
+ )
+}
diff --git a/src/components/editor/toolbar/ColorMenu.tsx b/src/components/editor/toolbar/ColorMenu.tsx
index 018c55f..d9eecc4 100644
--- a/src/components/editor/toolbar/ColorMenu.tsx
+++ b/src/components/editor/toolbar/ColorMenu.tsx
@@ -4,21 +4,24 @@ import { useEffect, useRef, useState } from 'react'
import { X, Pipette, Plus, ChevronRight, Search } from 'lucide-react'
import { SOLID_SWATCHES, GRADIENT_PRESETS } from '@/lib/editor-utils'
import { useEditorStore } from '@/store/editor-store'
+import type { GradientFill } from '@/lib/types'
import { cn } from '@/lib/utils'
interface ColorMenuProps {
/** current colour value */
value: string
onChange: (color: string, committed: boolean) => void
- /** gradient swatches apply from→to (page background context only) */
- onGradient?: (from: string, to: string, angle: number) => void
+ /** current gradient of the target element/page (null/undefined = solid fill context) */
+ gradient?: GradientFill | null
+ /** apply a gradient (null removes it and restores the solid fill) */
+ onGradient?: (g: GradientFill | null, committed: boolean) => void
/** menu title (canva: "Text colour" / "Background colour" / "Fill") */
title?: string
children?: React.ReactNode
}
/** canva-style colour menu: quick row, brand kit, solid grid, gradient rows. */
-export function ColorMenu({ value, onChange, onGradient, title = 'Colour', children }: ColorMenuProps) {
+export function ColorMenu({ value, onChange, gradient, onGradient, title = 'Colour', children }: ColorMenuProps) {
const [open, setOpen] = useState(false)
const [pos, setPos] = useState<{ x: number; y: number } | null>(null)
const [hex, setHex] = useState(value)
@@ -65,7 +68,15 @@ export function ColorMenu({ value, onChange, onGradient, title = 'Colour', child
{children ?? (
<span
className="block h-[18px] w-[18px] rounded-full border-2 border-white/90 shadow-[0_0_0_1px_rgba(0,0,0,0.35)]"
- style={{ background: value === 'transparent' ? 'repeating-conic-gradient(#e3e3e8 0% 25%, #ffffff 0% 50%) 50% / 8px 8px' : value }}
+ style={{
+ background: gradient
+ ? gradient.type === 'radial'
+ ? `radial-gradient(circle, ${gradient.from}, ${gradient.to})`
+ : `linear-gradient(${gradient.angle}deg, ${gradient.from}, ${gradient.to})`
+ : value === 'transparent'
+ ? 'repeating-conic-gradient(#e3e3e8 0% 25%, #ffffff 0% 50%) 50% / 8px 8px'
+ : value,
+ }}
/>
)}
</button>
@@ -150,7 +161,7 @@ export function ColorMenu({ value, onChange, onGradient, title = 'Colour', child
</div>
</Section>
- {/* gradients (background context) */}
+ {/* gradients — element fills & page background */}
{onGradient && (
<Section label="Default gradient colours" icon="gradient">
<div className="grid grid-cols-7 gap-2 px-3 pb-2.5">
@@ -159,11 +170,83 @@ export function ColorMenu({ value, onChange, onGradient, title = 'Colour', child
key={i}
className="cv-swatch h-7 w-7"
style={{ background: `linear-gradient(${g.angle}deg, ${g.from}, ${g.to})` }}
- onClick={() => onGradient(g.from, g.to, g.angle)}
+ onClick={() => onGradient({ type: 'linear', from: g.from, to: g.to, angle: g.angle }, true)}
aria-label={`Gradient ${g.from} to ${g.to}`}
/>
))}
+ <button
+ className="cv-swatch h-7 w-7"
+ style={{ background: `radial-gradient(circle, ${gradient?.from ?? '#7D2AE8'}, ${gradient?.to ?? '#00C4CC'})` }}
+ onClick={() => onGradient({ type: 'radial', from: gradient?.from ?? '#7D2AE8', to: gradient?.to ?? '#00C4CC', angle: 0 }, true)}
+ aria-label="Radial gradient"
+ title="Radial gradient"
+ />
</div>
+
+ {gradient && (
+ <div className="px-3 pb-3 space-y-2.5 border-t border-white/[0.05] pt-2.5">
+ {/* type toggle */}
+ <div className="flex items-center gap-1.5">
+ {(['linear', 'radial'] as const).map((t) => (
+ <button
+ key={t}
+ onClick={() => onGradient({ ...gradient, type: t }, true)}
+ className={cn(
+ 'flex-1 h-7 rounded-lg text-[11px] font-semibold capitalize transition-colors',
+ gradient.type === t ? 'bg-[#7630D7] text-white' : 'bg-white/[0.08] text-white/70 hover:bg-white/[0.14]'
+ )}
+ >
+ {t}
+ </button>
+ ))}
+ </div>
+
+ {/* angle (linear only) */}
+ {gradient.type === 'linear' && (
+ <div className="flex items-center gap-2">
+ <span className="text-[10px] text-white/50 w-8 shrink-0">Angle</span>
+ <input
+ type="range"
+ min={0}
+ max={360}
+ value={gradient.angle}
+ onChange={(e) => onGradient({ ...gradient, angle: Number(e.target.value) }, false)}
+ onPointerUp={() => onGradient(gradient, true)}
+ className="flex-1 accent-[#7630D7] h-1.5"
+ aria-label="Gradient angle"
+ />
+ <span className="text-[10px] text-white/70 w-8 text-right tabular-nums">{gradient.angle}°</span>
+ </div>
+ )}
+
+ {/* from / to editors */}
+ <div className="flex items-center gap-2">
+ {(['from', 'to'] as const).map((stop) => (
+ <label key={stop} className="relative flex-1 cursor-pointer" title={`Gradient ${stop}`}>
+ <span className="flex items-center gap-1.5 h-7 rounded-lg bg-white/[0.06] border border-white/10 px-2">
+ <span className="h-4 w-4 rounded border border-black/10" style={{ background: gradient[stop] }} />
+ <span className="text-[10px] text-white/60 capitalize">{stop}</span>
+ </span>
+ <input
+ type="color"
+ value={/^#[0-9a-fA-F]{6}$/.test(gradient[stop]) ? gradient[stop] : '#ffffff'}
+ onChange={(e) => onGradient({ ...gradient, [stop]: e.target.value }, false)}
+ onBlur={() => onGradient(gradient, true)}
+ className="absolute inset-0 opacity-0 cursor-pointer"
+ aria-label={`Gradient ${stop} colour`}
+ />
+ </label>
+ ))}
+ </div>
+
+ <button
+ onClick={() => onGradient(null, true)}
+ className="w-full h-7 rounded-lg bg-white/[0.06] border border-white/10 text-[11px] font-semibold text-white/70 hover:text-white hover:bg-white/[0.12]"
+ >
+ Remove gradient
+ </button>
+ </div>
+ )}
</Section>
)}
</div>
diff --git a/src/components/editor/toolbar/FontDropdown.tsx b/src/components/editor/toolbar/FontDropdown.tsx
index e308eaa..1fc217f 100644
--- a/src/components/editor/toolbar/FontDropdown.tsx
+++ b/src/components/editor/toolbar/FontDropdown.tsx
@@ -18,7 +18,7 @@ export function FontDropdown({ value, onChange }: FontDropdownProps) {
const ref = useRef<HTMLDivElement>(null)
const [cat, setCat] = useState<string>('All')
- const cats = ['All', 'sans', 'serif', 'display', 'handwriting']
+ const cats = ['All', 'sans', 'serif', 'display', 'handwriting', 'mono']
const list = useMemo(
() =>
diff --git a/src/lib/editor-utils.ts b/src/lib/editor-utils.ts
index f0712d8..436f628 100644
--- a/src/lib/editor-utils.ts
+++ b/src/lib/editor-utils.ts
@@ -2,7 +2,7 @@
// Canvix editor utilities — fonts, palettes, graphics, helpers
// ─────────────────────────────────────────────────────────────
-import type { AnyElement, PageData } from './types'
+import type { AnyElement, GradientFill, PageData } from './types'
// ── Fonts (loaded in layout via Google Fonts) ────────────────
@@ -10,25 +10,78 @@ export interface FontOption {
family: string
label: string
weights: string
- category: 'sans' | 'serif' | 'display' | 'handwriting'
+ category: 'sans' | 'serif' | 'display' | 'handwriting' | 'mono'
}
export const FONTS: FontOption[] = [
+ // ── Sans (18) ──
{ family: 'Inter', label: 'Inter', weights: '400,500,600,700,800', category: 'sans' },
{ family: 'Poppins', label: 'Poppins', weights: '400,600,700,800', category: 'sans' },
{ family: 'Montserrat', label: 'Montserrat', weights: '600,700,800,900', category: 'sans' },
{ family: 'Space Grotesk', label: 'Space Grotesk', weights: '500,700', category: 'sans' },
{ family: 'Oswald', label: 'Oswald', weights: '500,700', category: 'sans' },
- { family: 'Bebas Neue', label: 'Bebas Neue', weights: '400', category: 'display' },
- { family: 'Anton', label: 'Anton', weights: '400', category: 'display' },
- { family: 'Archivo Black', label: 'Archivo Black', weights: '400', category: 'display' },
+ { family: 'Raleway', label: 'Raleway', weights: '400,700', category: 'sans' },
+ { family: 'Lato', label: 'Lato', weights: '400,700', category: 'sans' },
+ { family: 'Open Sans', label: 'Open Sans', weights: '400,700', category: 'sans' },
+ { family: 'Nunito', label: 'Nunito', weights: '400,700', category: 'sans' },
+ { family: 'Quicksand', label: 'Quicksand', weights: '400,700', category: 'sans' },
+ { family: 'Rubik', label: 'Rubik', weights: '400,700', category: 'sans' },
+ { family: 'Work Sans', label: 'Work Sans', weights: '400,700', category: 'sans' },
+ { family: 'DM Sans', label: 'DM Sans', weights: '400,700', category: 'sans' },
+ { family: 'Josefin Sans', label: 'Josefin Sans', weights: '400,700', category: 'sans' },
+ { family: 'Barlow', label: 'Barlow', weights: '400,700', category: 'sans' },
+ { family: 'Manrope', label: 'Manrope', weights: '400,700', category: 'sans' },
+ { family: 'Outfit', label: 'Outfit', weights: '400,700', category: 'sans' },
+ { family: 'Figtree', label: 'Figtree', weights: '400,700', category: 'sans' },
+ // ── Serif (14) ──
{ family: 'Playfair Display', label: 'Playfair Display', weights: '400,700,800', category: 'serif' },
{ family: 'Abril Fatface', label: 'Abril Fatface', weights: '400', category: 'serif' },
{ family: 'Roboto Slab', label: 'Roboto Slab', weights: '400,700', category: 'serif' },
+ { family: 'Lora', label: 'Lora', weights: '400,700', category: 'serif' },
+ { family: 'Merriweather', label: 'Merriweather', weights: '400,700', category: 'serif' },
+ { family: 'Libre Baskerville', label: 'Libre Baskerville', weights: '400,700', category: 'serif' },
+ { family: 'EB Garamond', label: 'EB Garamond', weights: '400,700', category: 'serif' },
+ { family: 'Cormorant Garamond', label: 'Cormorant Garamond', weights: '400,700', category: 'serif' },
+ { family: 'DM Serif Display', label: 'DM Serif Display', weights: '400', category: 'serif' },
+ { family: 'Prata', label: 'Prata', weights: '400', category: 'serif' },
+ { family: 'Bitter', label: 'Bitter', weights: '400,700', category: 'serif' },
+ { family: 'Fraunces', label: 'Fraunces', weights: '400,700', category: 'serif' },
+ { family: 'Bodoni Moda', label: 'Bodoni Moda', weights: '400,700', category: 'serif' },
+ { family: 'Cinzel', label: 'Cinzel', weights: '400,700', category: 'serif' },
+ // ── Display (14) ──
+ { family: 'Bebas Neue', label: 'Bebas Neue', weights: '400', category: 'display' },
+ { family: 'Anton', label: 'Anton', weights: '400', category: 'display' },
+ { family: 'Archivo Black', label: 'Archivo Black', weights: '400', category: 'display' },
{ family: 'Lobster', label: 'Lobster', weights: '400', category: 'display' },
+ { family: 'Alfa Slab One', label: 'Alfa Slab One', weights: '400', category: 'display' },
+ { family: 'Bungee', label: 'Bungee', weights: '400', category: 'display' },
+ { family: 'Righteous', label: 'Righteous', weights: '400', category: 'display' },
+ { family: 'Ultra', label: 'Ultra', weights: '400', category: 'display' },
+ { family: 'Passion One', label: 'Passion One', weights: '400,700', category: 'display' },
+ { family: 'Monoton', label: 'Monoton', weights: '400', category: 'display' },
+ { family: 'Rye', label: 'Rye', weights: '400', category: 'display' },
+ { family: 'Titan One', label: 'Titan One', weights: '400', category: 'display' },
+ { family: 'Luckiest Guy', label: 'Luckiest Guy', weights: '400', category: 'display' },
+ { family: 'Permanent Marker', label: 'Permanent Marker', weights: '400', category: 'display' },
+ // ── Handwriting (14) ──
{ family: 'Pacifico', label: 'Pacifico', weights: '400', category: 'handwriting' },
{ family: 'Caveat', label: 'Caveat', weights: '400,700', category: 'handwriting' },
{ family: 'Dancing Script', label: 'Dancing Script', weights: '400,700', category: 'handwriting' },
+ { family: 'Great Vibes', label: 'Great Vibes', weights: '400', category: 'handwriting' },
+ { family: 'Sacramento', label: 'Sacramento', weights: '400', category: 'handwriting' },
+ { family: 'Satisfy', label: 'Satisfy', weights: '400', category: 'handwriting' },
+ { family: 'Kaushan Script', label: 'Kaushan Script', weights: '400', category: 'handwriting' },
+ { family: 'Alex Brush', label: 'Alex Brush', weights: '400', category: 'handwriting' },
+ { family: 'Allura', label: 'Allura', weights: '400', category: 'handwriting' },
+ { family: 'Parisienne', label: 'Parisienne', weights: '400', category: 'handwriting' },
+ { family: 'Amatic SC', label: 'Amatic SC', weights: '400,700', category: 'handwriting' },
+ { family: 'Shadows Into Light', label: 'Shadows Into Light', weights: '400', category: 'handwriting' },
+ { family: 'Indie Flower', label: 'Indie Flower', weights: '400', category: 'handwriting' },
+ { family: 'Kalam', label: 'Kalam', weights: '400,700', category: 'handwriting' },
+ // ── Mono (3) ──
+ { family: 'DM Mono', label: 'DM Mono', weights: '400,500', category: 'mono' },
+ { family: 'JetBrains Mono', label: 'JetBrains Mono', weights: '400,700', category: 'mono' },
+ { family: 'Space Mono', label: 'Space Mono', weights: '400,700', category: 'mono' },
]
// Curated "font pairings" shown in the Text panel (Canva-style)
@@ -326,6 +379,46 @@ export function gradientProps(from: string, to: string, angle: number, w: number
}
}
+/**
+ * Konva gradient props for an element's GradientFill.
+ * `origin` selects the shape's local coordinate frame:
+ * - 'corner' : rect / triangle / text — (0,0)..(w,h)
+ * - 'center' : ellipse / star — local origin is the shape centre
+ * - 'box100' : path — authored in a 100×100 box (scaled by shape w/h)
+ */
+export function elementGradientProps(
+ g: GradientFill,
+ w: number,
+ h: number,
+ origin: 'corner' | 'center' | 'box100' = 'corner'
+): Record<string, unknown> {
+ const bw = origin === 'box100' ? 100 : w
+ const bh = origin === 'box100' ? 100 : h
+ const cx = origin === 'center' ? 0 : bw / 2
+ const cy = origin === 'center' ? 0 : bh / 2
+
+ if (g.type === 'radial') {
+ const r = Math.max(bw, bh) / 2
+ return {
+ fillRadialGradientStartPoint: { x: cx, y: cy },
+ fillRadialGradientStartRadius: 0,
+ fillRadialGradientEndPoint: { x: cx, y: cy },
+ fillRadialGradientEndRadius: r,
+ fillRadialGradientColorStops: [0, g.from, 1, g.to],
+ }
+ }
+
+ const rad = (g.angle * Math.PI) / 180
+ const halfLen = Math.sqrt((Math.cos(rad) * bw) ** 2 + (Math.sin(rad) * bh) ** 2) / 2
+ const ux = Math.cos(rad) * halfLen
+ const uy = Math.sin(rad) * halfLen
+ return {
+ fillLinearGradientStartPoint: { x: cx - ux, y: cy - uy },
+ fillLinearGradientEndPoint: { x: cx + ux, y: cy + uy },
+ fillLinearGradientColorStops: [0, g.from, 1, g.to],
+ }
+}
+
export const PRESET_SIZES = [
{ name: 'Instagram post', width: 1080, height: 1080, hint: '1080 × 1080 px' },
{ name: 'Instagram story', width: 1080, height: 1920, hint: '1080 × 1920 px' },
diff --git a/src/lib/templates.ts b/src/lib/templates.ts
index ca2398a..ec1f066 100644
--- a/src/lib/templates.ts
+++ b/src/lib/templates.ts
@@ -322,6 +322,138 @@ export const TEMPLATES: TemplateDef[] = [
},
],
},
+
+ // ── Design Trends 2026 (research/CANVA-V032-RESEARCH.md) ──
+ {
+ slug: 'prompt-playground',
+ name: 'Prompt Playground',
+ category: 'social',
+ width: 1080,
+ height: 1080,
+ accent: '#8B3DFF',
+ pages: [
+ {
+ id: 'p1',
+ background: { type: 'solid', color: '#0F1015' },
+ elements: [
+ // playful productivity: gradient blob + prompt-bar aesthetic
+ sh('ellipse', { x: 560, y: -140, width: 620, height: 620, fill: '#8B3DFF', fillGradient: { type: 'radial', from: '#9E9EFF', to: '#8B3DFF', angle: 0 } }),
+ sh('rect', { x: 90, y: 330, width: 900, height: 110, fill: '#FFFFFF', cornerRadius: 55 }),
+ tx({ x: 130, y: 360, width: 700, height: 60, text: 'ask me anything →', fontFamily: 'Manrope', bold: true, fontSize: 38, fill: '#0F1015', align: 'left' }),
+ sh('rect', { x: 90, y: 480, width: 440, height: 90, fill: '#8B3DFF', fillGradient: { type: 'linear', from: '#8B3DFF', to: '#C3A6FF', angle: 90 }, cornerRadius: 24 }),
+ tx({ x: 110, y: 506, width: 400, height: 50, text: 'make it playful', fontFamily: 'Outfit', bold: true, fontSize: 30, fill: '#FFFFFF', align: 'center' }),
+ tx({ x: 90, y: 620, width: 900, height: 130, text: 'PRODUCTIVITY,\nBUT MAKE IT FUN', fontFamily: 'Outfit', bold: true, fontSize: 84, fill: '#FFFFFF', align: 'left', lineHeight: 1.1 }),
+ tx({ x: 90, y: 800, width: 900, height: 60, text: 'the prompt playground trend — canva design trends 2026', fontFamily: 'Figtree', fontSize: 26, fill: '#9E9EFF', align: 'left' }),
+ st('✨', { x: 850, y: 880, width: 160, height: 160, fontSize: 120 }),
+ ],
+ },
+ ],
+ },
+ {
+ slug: 'notes-app-chic',
+ name: 'Notes App Chic',
+ category: 'social',
+ width: 1080,
+ height: 1080,
+ accent: '#E8DFC8',
+ pages: [
+ {
+ id: 'p1',
+ background: { type: 'solid', color: '#F6F0E1' },
+ elements: [
+ // raw, honest, human: paper + handwriting
+ sh('rect', { x: 80, y: 80, width: 920, height: 920, fill: '#FFFDF4', cornerRadius: 28, stroke: '#D9CFB4', strokeWidth: 2 }),
+ tx({ x: 140, y: 150, width: 780, height: 90, text: 'things i want to remember', fontFamily: 'Caveat', fontSize: 76, fill: '#2B2B26', align: 'left' }),
+ ln({ x: 140, y: 280, width: 800, height: 0, stroke: '#E4D9BC', strokeWidth: 3, dashed: true }),
+ tx({ x: 140, y: 320, width: 760, height: 70, text: '◦ slow mornings, good coffee', fontFamily: 'Kalam', fontSize: 42, fill: '#4A4A40', align: 'left' }),
+ tx({ x: 140, y: 420, width: 760, height: 70, text: '◦ calling people back', fontFamily: 'Kalam', fontSize: 42, fill: '#4A4A40', align: 'left' }),
+ tx({ x: 140, y: 520, width: 760, height: 70, text: '◦ less scrolling, more making', fontFamily: 'Kalam', fontSize: 42, fill: '#4A4A40', align: 'left' }),
+ tx({ x: 140, y: 620, width: 760, height: 70, text: '◦ being honest about the mess', fontFamily: 'Kalam', fontSize: 42, fill: '#4A4A40', align: 'left' }),
+ tx({ x: 140, y: 830, width: 500, height: 60, text: '— notes app, 6:41 am', fontFamily: 'Indie Flower', fontSize: 34, fill: '#8A8672', align: 'left' }),
+ sh('rect', { x: 140, y: 740, width: 330, height: 56, fill: '#FFE8A3', rotation: -2, cornerRadius: 10 }),
+ tx({ x: 158, y: 754, width: 300, height: 44, text: 'keep it human ★', fontFamily: 'Caveat', fontSize: 36, fill: '#5C4A00', align: 'left' }),
+ ],
+ },
+ ],
+ },
+ {
+ slug: 'texture-check',
+ name: 'Texture Check',
+ category: 'presentation',
+ width: 1920,
+ height: 1080,
+ accent: '#B86B4F',
+ pages: [
+ {
+ id: 'p1',
+ background: { type: 'solid', color: '#EAD9C2' },
+ elements: [
+ // tactile design: layered warm gradients + serif elegance
+ sh('rect', { x: -80, y: -80, width: 900, height: 1240, rotation: -6, fill: '#D9A47E', fillGradient: { type: 'linear', from: '#D9A47E', to: '#B86B4F', angle: 120 } }),
+ sh('rect', { x: 120, y: 140, width: 1240, height: 800, fill: '#F7EDE0', cornerRadius: 40 }),
+ tx({ x: 200, y: 260, width: 1080, height: 200, text: 'Design you can\nalmost feel', fontFamily: 'Fraunces', bold: true, fontSize: 110, fill: '#3E2A1C', align: 'left', lineHeight: 1.05 }),
+ ln({ x: 200, y: 520, width: 220, height: 0, stroke: '#B86B4F', strokeWidth: 8 }),
+ tx({ x: 200, y: 560, width: 1000, height: 140, text: 'Tactile surfaces, warm neutrals and honest materials — the 2026 answer to cold, flat screens.', fontFamily: 'Lora', fontSize: 38, fill: '#6B5340', align: 'left', lineHeight: 1.5 }),
+ sh('ellipse', { x: 1490, y: 190, width: 260, height: 260, fill: '#E2906B', fillGradient: { type: 'radial', from: '#F3C4A6', to: '#D97747', angle: 0 } }),
+ sh('ellipse', { x: 1560, y: 560, width: 180, height: 180, fill: '#C49A6C' }),
+ st('🌾', { x: 1470, y: 820, width: 200, height: 200, fontSize: 150 }),
+ ],
+ },
+ ],
+ },
+ {
+ slug: 'opt-out-era',
+ name: 'Opt Out Era',
+ category: 'presentation',
+ width: 1920,
+ height: 1080,
+ accent: '#0F1015',
+ pages: [
+ {
+ id: 'p1',
+ background: { type: 'solid', color: '#F4F3EF' },
+ elements: [
+ // structured simplicity: grid lines, whitespace, restraint
+ ln({ x: 960, y: 0, width: 0, height: 1080, stroke: '#E3E1D8', strokeWidth: 2 }),
+ ln({ x: 0, y: 620, width: 1920, height: 0, stroke: '#E3E1D8', strokeWidth: 2 }),
+ tx({ x: 110, y: 170, width: 700, height: 300, text: 'Opt out\nof the noise.', fontFamily: 'Manrope', bold: true, fontSize: 120, fill: '#0F1015', align: 'left', lineHeight: 1.02 }),
+ tx({ x: 110, y: 520, width: 620, height: 120, text: 'Structured simplicity. Fewer things, better made.', fontFamily: 'Manrope', fontSize: 34, fill: '#6E6E66', align: 'left', lineHeight: 1.5 }),
+ tx({ x: 110, y: 900, width: 400, height: 40, text: 'LESS, BETTER — 2026', fontFamily: 'Manrope', bold: true, fontSize: 22, letterSpacing: 4, fill: '#0F1015', align: 'left' }),
+ sh('rect', { x: 1100, y: 180, width: 700, height: 330, fill: '#0F1015', cornerRadius: 0 }),
+ tx({ x: 1140, y: 260, width: 620, height: 80, text: '01 — declutter', fontFamily: 'DM Mono', bold: true, fontSize: 30, fill: '#F4F3EF', align: 'left' }),
+ tx({ x: 1140, y: 340, width: 620, height: 80, text: '02 — slow down', fontFamily: 'DM Mono', bold: true, fontSize: 30, fill: '#F4F3EF', align: 'left' }),
+ tx({ x: 1140, y: 420, width: 620, height: 80, text: '03 — keep what matters', fontFamily: 'DM Mono', bold: true, fontSize: 30, fill: '#F4F3EF', align: 'left' }),
+ tx({ x: 1100, y: 720, width: 700, height: 200, text: '“Simplicity is the\nultimate sophistication.”', fontFamily: 'Bodoni Moda', italic: true, fontSize: 52, fill: '#0F1015', align: 'left', lineHeight: 1.25 }),
+ ],
+ },
+ ],
+ },
+ {
+ slug: 'granny-wave',
+ name: 'Granny Wave',
+ category: 'social',
+ width: 1080,
+ height: 1080,
+ accent: '#8E2A3C',
+ pages: [
+ {
+ id: 'p1',
+ background: { type: 'gradient', from: '#4A0F22', to: '#8E2A3C', angle: 160 },
+ elements: [
+ // maximalist heritage remix: ornamental shapes, gold + heritage tones
+ sh('ellipse', { x: 140, y: 140, width: 800, height: 800, fill: '#C9A24B', fillGradient: { type: 'radial', from: '#E8C877', to: '#A67C2E', angle: 0 } }),
+ sh('ellipse', { x: 190, y: 190, width: 700, height: 700, fill: '#5E1230' }),
+ gr('badge', { x: 415, y: 115, width: 250, height: 250, fill: '#C9A24B' }),
+ tx({ x: 240, y: 420, width: 600, height: 130, text: 'GRANNY', fontFamily: 'Cinzel', bold: true, fontSize: 96, fill: '#F3DFA2', align: 'center' }),
+ tx({ x: 240, y: 550, width: 600, height: 130, text: 'WAVE', fontFamily: 'Cinzel', bold: true, fontSize: 96, fill: '#F3DFA2', align: 'center' }),
+ ln({ x: 300, y: 700, width: 480, height: 0, stroke: '#C9A24B', strokeWidth: 4 }),
+ tx({ x: 240, y: 730, width: 600, height: 90, text: 'heritage remixed for 2026', fontFamily: 'Cormorant Garamond', italic: true, fontSize: 44, fill: '#E8C877', align: 'center' }),
+ st('🌺', { x: 60, y: 800, width: 140, height: 140, fontSize: 100 }),
+ st('🪭', { x: 880, y: 800, width: 140, height: 140, fontSize: 100 }),
+ ],
+ },
+ ],
+ },
]
export function templatesAsRecords(): TemplateRecord[] {
diff --git a/src/lib/types.ts b/src/lib/types.ts
index a06170a..f435eca 100644
--- a/src/lib/types.ts
+++ b/src/lib/types.ts
@@ -41,6 +41,15 @@ export interface ShadowConfig {
offsetY: number
}
+/** Canva-style element gradient fill (shapes + text) */
+export interface GradientFill {
+ type: 'linear' | 'radial'
+ from: string
+ to: string
+ /** linear direction in degrees (0 = →, 90 = ↓) */
+ angle: number
+}
+
export interface BaseElement {
id: string
type: ElementType
@@ -68,6 +77,8 @@ export interface TextElement extends BaseElement {
strike: boolean
uppercase: boolean
fill: string
+ /** gradient fill — when set, renders instead of the solid fill */
+ fillGradient?: GradientFill | null
align: TextAlign
lineHeight: number
letterSpacing: number
@@ -80,6 +91,8 @@ export interface TextElement extends BaseElement {
export interface ShapeElement extends BaseElement {
type: 'rect' | 'ellipse' | 'triangle' | 'star' | 'path'
fill: string
+ /** gradient fill — when set, renders instead of the solid fill */
+ fillGradient?: GradientFill | null
stroke: string
strokeWidth: number
cornerRadius: number // rect only
@@ -174,11 +187,13 @@ export interface PageData {
elements: AnyElement[]
}
-/** user-placed ruler guide (position in page px) */
+/** user-placed ruler guide (position in page px; scoped to a page) */
export interface ManualGuide {
id: string
axis: 'x' | 'y'
position: number
+ /** owning page — guides are per-page since v0.3.2 */
+ pageId: string
}
/** saved version snapshot (per design, persisted to localStorage) */
diff --git a/src/store/editor-store.ts b/src/store/editor-store.ts
index 6fbbec2..27c1623 100644
--- a/src/store/editor-store.ts
+++ b/src/store/editor-store.ts
@@ -21,6 +21,7 @@ export type PanelId =
| 'text'
| 'brand'
| 'uploads'
+ | 'photos'
| 'tools'
| 'projects'
| 'apps'
@@ -504,11 +505,12 @@ export const useEditorStore = create<EditorState>((set, get) => ({
setDrawSize: (n) => set({ drawSize: Math.min(64, Math.max(1, n)) }),
setBrand: (b) => set({ brand: b }),
- // ── v0.3.1: rulers & manual guides ─────────────────────
+ // ── v0.3.1: rulers & manual guides (per-page since v0.3.2) ─
toggleRulers: () => set({ showRulers: !get().showRulers }),
addManualGuide: (axis, position) => {
const id = uid('guide')
- set({ manualGuides: [...get().manualGuides, { id, axis, position: Math.round(position) }] })
+ const pageId = get().pages[get().currentPage]?.id ?? ''
+ set({ manualGuides: [...get().manualGuides, { id, axis, position: Math.round(position), pageId }] })
return id
},
moveManualGuide: (id, position) => {
@@ -517,7 +519,11 @@ export const useEditorStore = create<EditorState>((set, get) => ({
})
},
removeManualGuide: (id) => set({ manualGuides: get().manualGuides.filter((g) => g.id !== id) }),
- clearManualGuides: () => set({ manualGuides: [] }),
+ clearManualGuides: () => {
+ // clears only the current page's guides
+ const pageId = get().pages[get().currentPage]?.id ?? ''
+ set({ manualGuides: get().manualGuides.filter((g) => g.pageId !== pageId) })
+ },
// ── v0.3.1: version history ────────────────────────────
saveVersion: (label) => {