Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
b06deb3
Merge pull request #1 from u8array/feat/add-label-live-preview
u8array Apr 12, 2026
3d46155
feat: enhance LabelPreviewModal and ZPLOutput with icon buttons and i…
u8array Apr 12, 2026
72998fd
refactor: optimize BarcodeObject and LabelCanvas for better performan…
u8array Apr 12, 2026
b8b4508
refactoring
u8array Apr 12, 2026
98d4b63
refactor: improve variable declarations and interface usage in Barcod…
u8array Apr 12, 2026
bf7cfc1
fix: update bwip-js import path and improve height property handling …
u8array Apr 12, 2026
0dee1de
refactor: update selection handling to support multiple selected obje…
u8array Apr 12, 2026
7ee71dd
feat: implement lasso selection for multiple object selection in Labe…
u8array Apr 12, 2026
962d4a8
feat: add lasso drag start handling in LabelCanvas and improve barcod…
u8array Apr 12, 2026
f76f3f1
feat: enhance barcode rendering with improved error handling and disp…
u8array Apr 12, 2026
36713df
feat: improve EAN/UPC check digit calculation and refactor related ba…
u8array Apr 12, 2026
5d98fb7
fix: update ruler color values for dark and light color schemes
u8array Apr 12, 2026
87d4506
feat: implement resizable output panel and enhance ZPLOutput with col…
u8array Apr 12, 2026
06fa6f9
fix: prevent unwanted dragging during lasso selection in LabelCanvas
u8array Apr 12, 2026
924dae3
feat: add copy and paste functionality for selected objects in label …
u8array Apr 12, 2026
7ad46e3
feat: add ZPL file import functionality and update localization strings
u8array Apr 12, 2026
e0c8793
feat: add GitHub Actions workflow for deploying to GitHub Pages
u8array Apr 12, 2026
df632ce
fix: remove unnecessary environment configuration from deploy job in …
u8array Apr 12, 2026
7709bd3
feat: add environment specification for deploy job in GitHub Actions …
u8array Apr 12, 2026
de42ef3
fix: update Node.js version to 24 and ensure environment variable is …
u8array Apr 12, 2026
15154ed
fix: update GitHub Actions to use latest versions of actions and remo…
u8array Apr 12, 2026
4a09a75
fix: update upload-pages-artifact action to version 5.0.0
u8array Apr 12, 2026
4f4fbf1
add README
u8array Apr 12, 2026
72d9670
enhance ZPL import documentation with supported commands and limitations
u8array Apr 13, 2026
9b96054
feat: add DragHandleIcon and GitHubIcon components; integrate into Ob…
u8array Apr 13, 2026
9a72ab5
feat: add unit conversion functionality and integrate into properties…
u8array Apr 13, 2026
3d9cfd8
Merge branch 'main' of https://github.com/u8array/zpl_label_designer
u8array Apr 13, 2026
467bb4d
feat: update parseZPL function to handle implicit text fields and add…
u8array Apr 13, 2026
f9681c9
feat: implement unit cycling and snap options for improved user exper…
u8array Apr 13, 2026
c23e95e
feat: add unit tests for coordinate and unit conversion functions, an…
u8array Apr 13, 2026
0d3a17f
fix: update type assertions in ZPL generation and parsing tests for b…
u8array Apr 13, 2026
cda759c
feat: add unit tests for ZPL parsing, including field blocks, text bl…
u8array Apr 13, 2026
93d965d
feat: add unit tests for label store functionality, including object …
u8array Apr 13, 2026
10d75a6
fix: improve type safety in updateObject and loadDesign tests with ty…
u8array Apr 13, 2026
d6f9626
feat: enhance CI workflow with linting and testing steps; improve typ…
u8array Apr 13, 2026
845a814
refactor: improve test utility functions and enhance readability
u8array Apr 13, 2026
a4a2d9c
feat: enhance ZPL parsing with serialization support for ^SN and ^SF …
u8array Apr 13, 2026
433f7c3
feat: implement object snapping functionality with visual guide lines…
u8array Apr 13, 2026
9e8728f
prevent dragging-snap when snapping is enabled in LabelCanvas
u8array Apr 13, 2026
57c019c
fix: add id to KLine component for correct object-snap handling in Li…
u8array Apr 13, 2026
f35ce8a
fix: update localized labels by removing unit suffixes
u8array Apr 13, 2026
9df1bea
fix: update README for clarity and accuracy in label design instructions
u8array Apr 13, 2026
295baf4
Update README
u8array Apr 13, 2026
9cefab7
feat(locales): add 'comment' translation to multiple languages
u8array Apr 14, 2026
82000d9
Update README.md
u8array Apr 14, 2026
fbd9ddf
Merge branch 'main' of https://github.com/u8array/zpl_label_designer
u8array Apr 14, 2026
2e97ec4
Add MIT License to the project
u8array Apr 14, 2026
82aede8
replace vite SVG favicon with a new icon and update HTML reference
u8array Apr 14, 2026
cab1be9
Merge branch 'main' of https://github.com/u8array/zpl_label_designer
u8array Apr 14, 2026
b6d180b
Remove unused SVG and image assets from the project
u8array Apr 14, 2026
9ff13d9
Update favicon image
u8array Apr 14, 2026
a59386d
Refactor application structure by creating AppShell component and mod…
u8array Apr 14, 2026
a15b51e
Add Zod validation and error handling for design file operations
u8array Apr 14, 2026
4195d15
Refactor DesignFile type declaration from type to interface for consi…
u8array Apr 14, 2026
8f8c0d2
Add import report modal and enhance ZPL import error handling
u8array Apr 14, 2026
ab46225
Refactor ZPL import functionality and clean up unused code; remove fi…
u8array Apr 14, 2026
770fa54
Add select all shortcut (Ctrl+A) to useGlobalShortcuts hook
u8array Apr 14, 2026
dbca30e
Enhance error handling for Labelary API interactions and add ZPL expo…
u8array Apr 14, 2026
a6585d4
Refactor LabelaryError constructor to improve readability and maintai…
u8array Apr 14, 2026
df2e244
Refactor error handling for Labelary interactions and streamline impo…
u8array Apr 14, 2026
9add1d7
Update README and ZplImportModal to clarify ZPL import behavior and d…
u8array Apr 14, 2026
77a48c0
Improve clarity in README regarding ZPL import behavior and design pr…
u8array Apr 14, 2026
99c3005
chore: rename project to ZebraPrintLab
u8array Apr 15, 2026
e838800
feat(barcodes): add 13 new barcode symbologies with ZPL parser and lo…
u8array Apr 15, 2026
e0d03cf
fix(barcodes): correct logmars mapping to code39 and add handling for…
u8array Apr 15, 2026
4ac0018
fix(barcodes): increase minimum row height in BWIP options for better…
u8array Apr 15, 2026
0910e67
chore: update button label from 'ZPL Designer' to 'Zebra Print Lab'
u8array Apr 15, 2026
5f621f7
Update .gitignore
u8array Apr 18, 2026
cf4b967
Add Code 128 encoding function and update LabelPreview image styling
u8array Apr 18, 2026
a701997
Merge branch 'main' of https://github.com/u8array/ZebraPrintLab
u8array Apr 18, 2026
3c56a4e
fix(barcodes): adjust text positioning and sizing for better layout
u8array Apr 18, 2026
d45374c
fix(barcodes): enhance text positioning and sizing for EAN-8 display
u8array Apr 18, 2026
b6a8369
fix(barcodes): ensure ^BY is always emitted for moduleWidth to preven…
u8array Apr 18, 2026
4829f0e
feat(dnd): migrate drag-and-drop functionality to @dnd-kit/core
u8array Apr 19, 2026
2fee39a
feat(layers): implement sortable layers using @dnd-kit/sortable for i…
u8array Apr 19, 2026
43c2879
fix(canvas): track last pointer position to improve drag-and-drop acc…
u8array Apr 19, 2026
1a4fc58
fix(barcodes): adjust text font size calculation based on module widt…
u8array Apr 19, 2026
d8c5a94
fix(line): adjust ZPL output for angles 180 and 270 to correctly posi…
u8array Apr 19, 2026
c2c577a
feat(barcode): enhance MSI and Plessey barcode handling with explicit…
u8array Apr 20, 2026
97ddb10
feat: Add support for custom printer fonts
u8array Apr 21, 2026
8c02c5b
feat: Use font cache version hook
u8array Apr 21, 2026
abd8f44
Adjust y-coordinate for barcode and QR code
u8array Apr 21, 2026
42a77d9
Merge pull request #1 from u8array/feat/cutom-font
u8array Apr 21, 2026
bc1e320
Refactor barcode positioning and sizing
u8array Apr 21, 2026
8fa38e5
Refactor 2D barcode sizing and offsets
u8array Apr 21, 2026
34204e2
Remove unnecessary position calculation
u8array Apr 21, 2026
0f391b6
Merge pull request #2 from u8array/feat/cutom-font
u8array Apr 21, 2026
ec7c46c
Update README
u8array Apr 22, 2026
f2fd652
Refactor barcode object rendering
u8array Apr 22, 2026
fc6b2a1
Fix bwipHelpers regressions and clean up PR artifacts
u8array Apr 22, 2026
d170cb3
Fix CI build errors: export BWIP_SCALE and exclude Node.js test from …
u8array Apr 22, 2026
7e8a572
Tighten BCID type to Partial<Record<LabelObject["type"], string>>
u8array Apr 22, 2026
912be45
Clean up Node.js test files for idiomatic TS
u8array Apr 25, 2026
c27de56
Remove generated diff images and plan file; add __diffs__ to .gitignore
u8array Apr 25, 2026
696141c
Restore plan doc without emojis and em-dashes
u8array Apr 25, 2026
a3daa46
Add src/test/tsconfig.json for IDE support of Node.js test files
u8array Apr 25, 2026
c007fa2
Fix code128 UCC check digit and document visual regression skip list
u8array Apr 25, 2026
2a1ca0d
Restore pdf417 and aztec to skip list with precise root cause
u8array Apr 25, 2026
f633dbc
Fix visual regression tests: Aztec compact mode and PDF417 ECL/height
u8array Apr 25, 2026
666328e
Fix QR visual regression tests by applying Zebra ^FO Y-offset
u8array Apr 25, 2026
8342bef
Fix code128 check-digit encoding and 1D barcode integer-scale rendering
u8array Apr 25, 2026
fd085db
Remove stale test-ref-plan.md
u8array Apr 25, 2026
47e1518
Extract BWIP_PDF417_MIN_ROWHEIGHT constant
u8array Apr 25, 2026
da27a8a
Merge remote-tracking branch 'origin/main' into feat/testing-ref
u8array Apr 25, 2026
e8e6468
Fix useMemo dependency array to include scale and dpmm
u8array Apr 25, 2026
fdbe79e
Fix ^FT drag: invert baseline offset in handleDragEnd
u8array Apr 25, 2026
61b4af0
Fix medium Gemini findings: bulk updateObjects + staggered duplicate …
u8array Apr 25, 2026
69c82f1
Fix lint: use T[] syntax instead of Array<T>
u8array Apr 25, 2026
6deb866
Refactor: extract applyObjectChanges helper + reset _duplicateCount o…
u8array Apr 25, 2026
9b802ac
Remove dead barcode ^FT offset branches from KonvaObjectInner
u8array Apr 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ dist-ssr
*.local
*.local.*

# Test output
tests/fixtures/__diffs__/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@
"devDependencies": {
"@babel/core": "^7.29.0",
"@eslint/js": "^9.39.4",
"@napi-rs/canvas": "^0.1.99",
"@rolldown/plugin-babel": "^0.2.2",
"@tailwindcss/vite": "^4.2.2",
"@types/babel__core": "^7.20.5",
"@types/node": "^24.12.2",
"@types/pixelmatch": "^5.2.6",
"@types/pngjs": "^6.0.5",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.1",
Expand All @@ -39,6 +42,8 @@
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.4.0",
"pixelmatch": "^7.1.0",
"pngjs": "^7.0.0",
"tailwindcss": "^4.2.2",
"typescript": "~6.0.2",
"typescript-eslint": "^8.58.0",
Expand Down
165 changes: 165 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/components/Canvas/BarcodeObject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function BarcodeObject({
}: Props) {
// bwip-js is synchronous — compute canvas directly in render (no async flash on resize)
const { barcodeCanvas, errorMsg } = useMemo(() => {
const opts = buildBwipOptions(obj);
const opts = buildBwipOptions(obj, scale, dpmm);
if (!opts) return { barcodeCanvas: null, errorMsg: null };
const canvas = document.createElement("canvas");
try {
Expand All @@ -52,7 +52,7 @@ export function BarcodeObject({
errorMsg: e instanceof Error ? e.message : String(e),
};
}
}, [obj]);
}, [obj, scale, dpmm]);

let displayW = 0;
let displayH = 0;
Expand Down
40 changes: 19 additions & 21 deletions src/components/Canvas/KonvaObject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -399,27 +399,6 @@ function KonvaObjectInner({
} else if (p.rotation === "B") {
displayX -= renderedH;
}
} else if (
obj.type === "code128" ||
obj.type === "code39" ||
obj.type === "ean13" ||
obj.type === "upca" ||
obj.type === "ean8" ||
obj.type === "upce" ||
obj.type === "interleaved2of5" ||
obj.type === "code93"
) {
const p = obj.props as { height: number };
displayY -= p.height;
} else if (obj.type === "pdf417") {
const p = obj.props as { rowHeight: number };
displayY -= p.rowHeight * 10;
} else if (obj.type === "qrcode") {
const p = obj.props as { magnification: number };
displayY -= p.magnification * 25;
} else if (obj.type === "datamatrix") {
const p = obj.props as { dimension: number };
displayY -= p.dimension * 20;
}
}

Expand Down Expand Up @@ -470,6 +449,25 @@ function KonvaObjectInner({
}
}

// Inverse of the ^FT display offset applied in the render phase above.
// Without this, dragging an ^FT object saves its top-left Konva position
// instead of the ZPL baseline coordinate, causing a vertical jump on re-render.
if (obj.positionType === "FT") {
if (obj.type === "text" || obj.type === "serial") {
const p = obj.props as { fontHeight: number; rotation: string };
const renderedH = p.fontHeight / 1.3;
if (p.rotation === "N") {
finalY += p.fontHeight;
} else if (p.rotation === "R") {
finalX -= renderedH;
} else if (p.rotation === "I") {
finalY -= renderedH;
} else if (p.rotation === "B") {
finalX += renderedH;
}
}
}

onChange({
x: finalX,
y: finalY,
Expand Down
29 changes: 18 additions & 11 deletions src/components/Canvas/LabelCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function LabelCanvas({ unit, showGrid, onGridToggle, snapEnabled, onSnapT

const colors = useColorScheme();

const { label, objects, selectedIds, addObject, updateObject, selectObject, toggleSelectObject, selectObjects } =
const { label, objects, selectedIds, addObject, updateObject, updateObjects, selectObject, toggleSelectObject, selectObjects } =
useLabelStore();

useEffect(() => {
Expand Down Expand Up @@ -168,14 +168,16 @@ export function LabelCanvas({ unit, showGrid, onGridToggle, snapEnabled, onSnapT
const dy =
e.code === "ArrowDown" ? step : e.code === "ArrowUp" ? -step : 0;

ids.forEach((sid) => {
const obj = objs.find((o) => o.id === sid);
if (obj) updateObject(sid, { x: obj.x + dx, y: obj.y + dy });
});
updateObjects(
ids.flatMap((sid) => {
const obj = objs.find((o) => o.id === sid);
return obj ? [{ id: sid, changes: { x: obj.x + dx, y: obj.y + dy } }] : [];
})
);
};
window.addEventListener("keydown", onKeyDown);
return () => window.removeEventListener("keydown", onKeyDown);
}, [snapEnabled, snapSizeMm, label.dpmm, updateObject]);
}, [snapEnabled, snapSizeMm, label.dpmm, updateObjects]);

// Object-snap: applied after grid-snap on every dragmove, single-object only.
// Fires on the Stage so it sees the already-grid-snapped node position.
Expand Down Expand Up @@ -342,11 +344,16 @@ export function LabelCanvas({ unit, showGrid, onGridToggle, snapEnabled, onSnapT
if (srcObj) {
const ddx = finalChanges.x !== undefined ? finalChanges.x - srcObj.x : 0;
const ddy = finalChanges.y !== undefined ? finalChanges.y - srcObj.y : 0;
selIds.forEach((sid) => {
if (sid === id) return;
const other = currentObjs.find((o) => o.id === sid);
if (other) updateObject(sid, { x: other.x + ddx, y: other.y + ddy });
});
updateObjects([
{ id, changes: finalChanges },
...selIds
.filter((sid) => sid !== id)
.flatMap((sid) => {
const other = currentObjs.find((o) => o.id === sid);
return other ? [{ id: sid, changes: { x: other.x + ddx, y: other.y + ddy } }] : [];
}),
]);
return;
}
}
updateObject(id, finalChanges);
Expand Down
Loading