openpencil/package.json

99 lines
3.2 KiB
JSON
Raw Normal View History

{
"name": "open-pencil-app",
"private": true,
2026-03-07 21:20:47 +00:00
"version": "0.8.0",
2026-03-02 05:31:54 +00:00
"license": "MIT",
"type": "module",
"workspaces": [
"packages/*"
],
"scripts": {
"dev": "vite",
"build": "bun run lint && vite build",
"preview": "vite preview",
"tauri": "tauri",
"lint": "oxlint -c oxlint.json --type-aware --type-check src/",
"format": "oxfmt --write src/",
"check": "bun run lint",
"test": "playwright test --project=openpencil",
"test:update": "playwright test --project=openpencil --update-snapshots",
"test:figma": "playwright test --project=figma",
"figma:debug": "open -a Figma --args --remote-debugging-port=9222",
"test:unit": "bun test ./tests/engine",
2026-03-01 06:34:41 +00:00
"test:coverage": "bun test --coverage ./tests/engine",
2026-03-01 07:49:09 +00:00
"test:dupes": "jscpd packages/core/src packages/cli/src src --min-lines 5 --min-tokens 50 --format typescript",
"open-pencil": "bun packages/cli/src/index.ts",
"docs:dev": "bun --filter @open-pencil/docs dev",
"docs:build": "bun --filter @open-pencil/docs build",
"docs:preview": "bun --filter @open-pencil/docs preview",
"visual-compare": "bun scripts/visual-compare.ts"
},
"dependencies": {
Multi-provider AI, sucrase JSX, Figma zoom shortcuts (#72) * Add multi-provider AI support (Anthropic, OpenAI, Google AI, OpenAI-compatible) - Add AI_PROVIDERS registry with per-provider model lists, key placeholders, and URLs - Refactor use-chat composable: provider factory creates the right AI SDK model - Per-provider API key storage in localStorage with automatic legacy migration - New ProviderSetup.vue replaces APIKeySetup.vue with provider selector - New ProviderSettings.vue popover accessible from gear icon in chat input - OpenAI-compatible provider with custom base URL and model ID fields - Install @ai-sdk/anthropic and @ai-sdk/google dependencies - Update E2E tests for new provider setup flow * Fix reactivity, key masking, missing model ID field, and chat reset on model change - Use ref instead of computed for apiKey — computed getter over localStorage wasn't triggering reactivity when the key was set - Load stored key for new provider in providerId watcher - Reset chat on modelId and customModelId change, not just provider switch - Add custom model ID field to ProviderSetup.vue for OpenAI-compatible - Simplify ProviderSettings key field — empty input with contextual placeholder instead of fragile dot-masking that broke on partial edits - Use data-test-id locator for model selector in E2E test * Use useLocalStorage from vueuse instead of manual ref + watch + localStorage Replaces 5 hand-rolled ref/watch/localStorage sync pairs with useLocalStorage. API key uses a computed storage key that rebinds when the provider changes. * Use useLocalStorage for collab name persistence * Review fixes: changelog placement, remove dead class, cursor-pointer * Extract ProviderSelect component and uiInput helper - ProviderSelect.vue: shared select dropdown for AI providers - ui/input.ts: shared input styling (sm/md sizes) - Remove 7 duplicated input class strings across chat components * Use uppercase acronyms: keyURL, customBaseURL, supportsCustomBaseURL * Match select dropdown width to trigger via --reka-select-trigger-width Move min-w-[var(--reka-select-trigger-width)] into selectContent base style so all selects get it by default. Remove per-component overrides. * Uppercase acronyms in variable names, improve setup form layout - providerID, modelID, customModelID, setAPIKey, AIProviderID - Keep apiKey lowercase at start (standard JS convention) - Compact setup form: single column, full-width Connect button - Fix grammar: 'a OpenRouter' → 'an OpenRouter' - Shorter promo text * Allow text selection in chat panel * Fix chat E2E test: Save → Connect button text * Disable mermaid in chat markdown renderer Alias mermaid and beautiful-mermaid to empty shims in Vite config, preventing vue-stream-markdown from attempting to load them. * Interleave text and tool calls in chat messages Render message parts in order instead of grouping all tool calls first then all text. Use SDK's isToolUIPart/isTextUIPart/getToolName instead of custom type guards. Fix error state: output-error, not error. * Implement figma.viewport.scrollAndZoomIntoView() Figma Plugin API method that centers the viewport on given nodes. Reuses the same bounding box logic as the viewport_zoom_to_fit tool. * Catch tool execution errors and return them to the AI Instead of crashing with an unhandled exception, tool errors are caught and returned as { error: message } so the AI can retry or explain the failure. UI detects error outputs and shows them in red with the error message when expanded. * Replace esbuild with sucrase for JSX transform Sucrase is a pure JS transform (201 KB / 46 KB gzip) that works in both Node/Bun and the browser. Replaces esbuild (13 MB WASM) which only worked in Node/Bun. - buildComponent() and renderJSX() are now synchronous - render tool works in browser AI chat (no more 'esbuild required') - Handles full JS expressions (map, ternaries, Array.from, etc.) * Update system prompt to prioritize render tool with JSX Document available tags, props, layout, text, and sizing options. Instruct the AI to use full JS expressions in JSX for complex layouts. * Fix zoom shortcuts to match Figma Cmd+0: Zoom to 100% (was incorrectly mapped to Zoom to fit) Cmd+1: Zoom to fit Cmd+2: Zoom to selection Shift+1 / Shift+2: same as Cmd+1 / Cmd+2 Add zoomTo100() and zoomToSelection() to editor store. Refactor zoomToFit() to use shared zoomToBounds() helper. * Refactor keyboard shortcuts to useMagicKeys Replace manual keydown handler with VueUse useMagicKeys + whenever for declarative shortcut registration. - mod() helper for cross-platform Meta/Control shortcuts - plain() helper for modifier-free keys - Proper modifier exclusion (⌘G vs ⌘⇧G no longer conflict) - Add E2E tests: duplicate, zoom (⌘0/⌘1/⌘2/⇧1/⇧2), auto-layout (⇧A) - All 26 keyboard shortcut tests pass * Fix scrollAndZoomIntoView to actually zoom Match Figma Plugin API behavior (equivalent to Shift-1): compute zoom level that fits all nodes with padding, capped at 100%. Previously only set center without adjusting zoom.
2026-03-08 19:05:18 +00:00
"@ai-sdk/anthropic": "^3.0.58",
"@ai-sdk/google": "^3.0.43",
"@ai-sdk/openai": "^3.0.37",
"@ai-sdk/valibot": "^2.0.17",
"@ai-sdk/vue": "^3.0.105",
"@open-pencil/cli": "workspace:*",
"@open-pencil/core": "workspace:*",
"@openrouter/ai-sdk-provider": "^2.2.3",
"@tailwindcss/vite": "^4.2.1",
"@tanstack/vue-table": "^8.21.3",
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-dialog": "^2.6.0",
"@tauri-apps/plugin-fs": "^2.4.5",
"@tauri-apps/plugin-opener": "^2",
"@unhead/vue": "^2.1.10",
"@vueuse/core": "^14.2.1",
"ai": "^6.0.105",
"canvaskit-wasm": "^0.40.0",
"culori": "^4.0.2",
"dedent": "^1.7.1",
"fflate": "^0.8.2",
"fzstd": "^0.1.1",
"lib0": "^0.2.117",
"motion-v": "^2.0.0",
"prismjs": "^1.30.0",
"reka-ui": "^2.9.0",
"tailwind-merge": "^3.5.0",
"tailwind-variants": "^3.2.2",
"tailwindcss": "^4.2.1",
"trystero": "^0.22.0",
"valibot": "^1.2.0",
"vue": "^3.5.29",
"vue-router": "^5.0.3",
"vue-stream-markdown": "^0.6.0",
"y-indexeddb": "^9.0.12",
"y-protocols": "^1.0.7",
"yjs": "^13.6.29",
CSS Grid layout mode (#73) * Switch to @open-pencil/yoga-layout with CSS Grid support Use our fork (open-pencil/yoga, grid branch) which cherry-picks the upstream CSS Grid PRs (#1893–#1898) onto current main. The JS bindings are ported from the old embind approach to the new wasm_bridge.c API. npm:@open-pencil/yoga-layout alias keeps all imports as 'yoga-layout'. Also handle FinalizationRegistry change (upstream #1908) — node.free() no longer exists, nodes are garbage collected automatically. * Add CSS Grid layout mode Scene graph: - LayoutMode gains 'GRID' option alongside HORIZONTAL/VERTICAL - GridTrack type (sizing: FIXED/FR/AUTO, value) for track definitions - GridPosition type (column, row, columnSpan, rowSpan) for children - New node props: gridTemplateColumns/Rows, gridColumnGap, gridRowGap, gridPosition Layout engine: - buildGridTree() sets Display.Grid and maps GridTrack[] to Yoga's setGridTemplateColumns/Rows API with FR/Points/Auto track types - Grid children use gridPosition for column/row placement with span - Flex layout path unchanged Store: - setLayoutMode('GRID') auto-creates NxM track grid based on child count (sqrt heuristic), defaults to 1fr tracks UI (LayoutSection.vue): - Grid button (grid-2x2 icon) added to flow direction row - Columns/Rows track editors: ScrubInput for value + AppSelect for sizing mode (Fill fr / Fixed px / Auto), add/remove buttons - Separate column gap and row gap ScrubInputs - Wrap button hidden when grid is active - Flex alignment grid hidden when grid is active Kiwi serialization skips GRID mode for now (no .fig codec support). * Add grid layout integration tests 12 new test scenarios covering: - Basic 2x2 grid, fixed columns, mixed fr/fixed, unequal fr weights - Column gap, row gap, both gaps combined - Padding offsets - Explicit gridPosition placement, column span, row span - Absolute children skipped - Hidden children collapsed - Nested grid inside flex parent (computeAllLayouts) Also fix: grid frames as children of flex parents now correctly use Display.Grid via configureChildAsGrid() instead of falling through to configureChildAsAutoLayout() which set FlexDirection. * Deduplicate grid yoga configuration Extract configureAsGrid() and createGridChildNode() shared by buildGridTree (root-level grid) and configureChildAsGrid (grid nested inside flex parent). * Add grid layout to changelog * Add grid support to JSX and Tailwind CSS export OpenPencil format: grid → columns/rows/columnGap/rowGap props, child colStart/rowStart/colSpan/rowSpan. Tailwind format: grid grid-cols-N grid-rows-N gap-x-* gap-y-*, mixed tracks use arbitrary values (grid-cols-[200px_1fr_auto]), child col-start-*/row-start-*/col-span-*/row-span-*. Both formats: padding emitted for grid frames (shared with flex), flex-only props (justify/items/wrap/gap) scoped to isFlex. * Remove duplicate gridTrackToTw, use shared formatTrack Also drop unused GridTrackSizing import from LayoutSection.vue. * Fix grid icon: use layout-grid instead of grid-2x2 unplugin-icons can't resolve icon names with digits after hyphens (grid-2x2 → grid2x2 which doesn't exist). * Polish layout UI and fix auto-layout behavior - Replace text labels with compact icons: ↔/↕ for gap, ☐ for uniform padding, T/R/B/L for per-side padding - Direction-aware gap icon: ↕ for vertical, ↔ for horizontal - Pin +/− padding toggle button right of gap input - Fix alignment grid axes for vertical layout (transpose primary/counter) - Fix grid switch: set FIXED sizing, compute frame size from children - Remove hardcoded white fill from Shift+A wrap - Auto-detect horizontal vs vertical from selection bounds * Add flex-to-grid switch integration test Verify HUG frame expands and children are placed in 2x2 grid when switching from vertical flex to grid layout. * Update changelog for grid layout
2026-03-08 15:23:53 +00:00
"yoga-layout": "npm:@open-pencil/yoga-layout@3.3.0-grid.2"
},
"devDependencies": {
2026-03-03 17:45:58 +00:00
"@agentclientprotocol/sdk": "^0.14.1",
"@hono/node-server": "^1.19.11",
"@iconify-json/lucide": "^1.2.94",
"@modelcontextprotocol/sdk": "^1.27.1",
"@playwright/test": "^1.58.2",
"@tauri-apps/cli": "^2",
2026-02-28 08:37:02 +00:00
"@types/culori": "^4.0.1",
"@types/node": "^25.3.2",
"@types/prismjs": "^1.26.6",
"@types/ws": "^8.18.1",
2026-02-28 08:37:02 +00:00
"@typescript/native-preview": "^7.0.0-dev.20260228.1",
"@vitejs/plugin-vue": "^6.0.4",
"esbuild": "^0.27.3",
"hono": "^4.12.5",
2026-03-01 07:49:09 +00:00
"jscpd": "^4.0.8",
"oxfmt": "^0.35.0",
"oxlint": "^1.50.0",
"oxlint-tsgolint": "^0.16.0",
"tw-animate-css": "^1.4.0",
"typescript": "~5.8.3",
"unplugin-icons": "^23.0.1",
"unplugin-vue-components": "^31.0.0",
"vite": "^7.0.4",
"vite-plugin-pwa": "^1.2.0",
"workbox-window": "^7.4.0",
"ws": "^8.19.0"
}
}