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: editor polish, E2E-verified interactions, contributing docs

Ashiq Hussain Mir5b0a9a154aa9
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..85ba712
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,50 @@
+# Contributing to Canvix
+
+Thanks for helping build the open-source Canva alternative! 🎨
+
+## Getting set up
+
+```bash
+git clone https://github.com/mir-ashiq/canvix.git
+cd canvix
+bun install
+cp .env.example .env
+bun run db:push
+bun run db:seed
+bun run dev
+```
+
+> `bun run lint` must pass before every commit.
+
+## Where to help
+
+| Area | Files |
+|---|---|
+| New templates | `src/lib/templates.ts` (compose elements with the builder helpers) |
+| New fonts | `src/lib/editor-utils.ts` → `FONTS` + the Google Fonts link in `src/app/layout.tsx` |
+| Stickers / graphics | `src/lib/editor-utils.ts` → `STICKER_GROUPS`, `GRAPHICS` |
+| Canvas behavior | `src/components/editor/canvas/` |
+| Panels & toolbars | `src/components/editor/panels/`, `src/components/editor/PropertiesBar.tsx` |
+| Export | `src/components/editor/canvas/canvas-bridge.ts` |
+| API & data | `src/app/api/`, `prisma/schema.prisma` |
+
+## Adding a template
+
+1. Open `src/lib/templates.ts`.
+2. Compose pages using `tx` (text), `sh` (shape), `ln` (line), `st` (sticker), `gr` (graphic).
+3. Pick a unique `slug`, `category` (`social | presentation | print | logo | thumbnail`) and an `accent` color.
+4. Run `bun run db:seed` and restart the dev server.
+
+## Guidelines
+
+- Keep the Canva-style UI conventions: pill buttons, the teal → violet gradient, dark editor rail.
+- TypeScript strict: no `any` unless unavoidable.
+- Test your change in the browser on **desktop and mobile** widths.
+- Keep design documents small: templates are plain JSON, no binary assets in the repo.
+
+## Pull requests
+
+1. Fork & branch (`feat/my-feature`).
+2. One logical change per PR.
+3. Describe what changed + screenshots for UI changes.
+4. `bun run lint` passes.
diff --git a/src/components/editor/canvas/element-node.tsx b/src/components/editor/canvas/element-node.tsx
index bcb8b91..3e083c9 100644
--- a/src/components/editor/canvas/element-node.tsx
+++ b/src/components/editor/canvas/element-node.tsx
@@ -56,7 +56,7 @@ export function ElementNode({ element: el, interactive, hiding, registerNode, on
const handleClick = (e: KonvaEventObject<MouseEvent | TouchEvent>) => {
if (!interactive) return
e.cancelBubble = true
- const additive = 'shiftKey' in e.evt && (e.evt as MouseEvent).shiftKey
+ const additive = !!e.evt && 'shiftKey' in e.evt && (e.evt as MouseEvent).shiftKey
if (additive) {
store.selectToggle(el.id)
} else {