diff --git a/.cursor/rules/ls-foundry-core.mdc b/.cursor/rules/ls-foundry-core.mdc index 959857d..4e43d4b 100644 --- a/.cursor/rules/ls-foundry-core.mdc +++ b/.cursor/rules/ls-foundry-core.mdc @@ -43,7 +43,7 @@ Also update the pin table below, `docs/stickpak/phase-1.md` version table + inst | Package | Version | |---------|---------| | `@jeffgo10/shared-types` | 1.0.0 | -| `@jeffgo10/react-canvas-designer` | 1.1.1 | +| `@jeffgo10/react-canvas-designer` | 1.2.0 | | `@jeffgo10/canvas-upscaler` | 1.0.0 | Always bump `shared-types` first when changing layout/DPI APIs; keep dependent package pins in sync. diff --git a/apps/docs/src/components/StickPakCanvasSection.tsx b/apps/docs/src/components/StickPakCanvasSection.tsx index f70a4c2..b4e2e10 100644 --- a/apps/docs/src/components/StickPakCanvasSection.tsx +++ b/apps/docs/src/components/StickPakCanvasSection.tsx @@ -53,6 +53,7 @@ function StickPakCanvasSection() { const [isArranging, setIsArranging] = useState(false); const [canUndo, setCanUndo] = useState(false); const [canRedo, setCanRedo] = useState(false); + const [viewportZoom, setViewportZoom] = useState(1); const [selectedCutLineOffset, setSelectedCutLineOffset] = useState(false); const [selectedCutLineOffsetMm, setSelectedCutLineOffsetMm] = useState(5); const [selectedCutLineOffsetFill, setSelectedCutLineOffsetFill] = useState< @@ -503,6 +504,9 @@ function StickPakCanvasSection() { setCanUndo(undoAvailable); setCanRedo(redoAvailable); }} + onViewportChange={({ zoom }) => { + setViewportZoom(zoom); + }} onAutoArrange={({ allPlaced }) => { setDuplicateMessage(""); setOverlapMessage(""); @@ -518,15 +522,45 @@ function StickPakCanvasSection() {

{isInspectMode ? hasSelection - ? "Inspect: sticker selected — blue border and size labels only (no drag, resize, or rotate). Click empty canvas to deselect." - : "Inspect: click a sticker to select it. Click empty canvas to clear selection. Move, resize, rotate, and marquee stay off." + ? "Inspect: sticker selected — blue border and size labels only (no drag, resize, or rotate). Click empty canvas to deselect. Scroll to zoom; hold Space and drag to pan." + : "Inspect: click a sticker to select it. Click empty canvas to clear selection. Move, resize, rotate, and marquee stay off. Scroll to zoom; hold Space and drag to pan." : hasSelection ? selectedIds.length > 1 - ? `${selectedIds.length} stickers selected — duplicate fills the whole selection together. Use the transform box to move, resize, or rotate (hold Shift while rotating to snap to 45°). [ / ] rotate 90°.` - : "Selected sticker — duplicate to fill a row or column. Hold Shift while dragging the rotate handle to snap to 45°. [ / ] rotate 90° left/right." - : "Click a sticker to select it. Shift-click to multi-select, or drag on empty canvas to marquee-select."} + ? `${selectedIds.length} stickers selected — duplicate fills the whole selection together. Use the transform box to move, resize, or rotate (hold Shift while rotating to snap to 45°). [ / ] rotate 90°. Scroll to zoom; Space + drag to pan.` + : "Selected sticker — duplicate to fill a row or column. Hold Shift while dragging the rotate handle to snap to 45°. [ / ] rotate 90° left/right. Scroll to zoom; Space + drag to pan." + : "Click a sticker to select it. Shift-click to multi-select, or drag on empty canvas to marquee-select. Scroll to zoom; hold Space and drag to pan."}

+ + + {Math.round(viewportZoom * 100)}% + + +