[WC-3448]: Add datamatrix option for Barcode Generation#2319
[WC-3448]: Add datamatrix option for Barcode Generation#2319samuelreichert wants to merge 11 commits into
Conversation
431b188 to
d9b57b4
Compare
This comment has been minimized.
This comment has been minimized.
Adds the tree-shakeable bwip-js browser entry, the only maintained library with native GS1 Data Matrix support, for upcoming Data Matrix generation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds "Data Matrix" to the top-level barcode format and a new "Advanced Data Matrix Settings" group (GS1 mode toggle, square/rectangle shape, size). Regenerates the widget prop typings to match. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds DataMatrixTypeConfig to the BarcodeConfig union with a format === "DataMatrix" branch in barcodeConfig(), plus a DataMatrix value check and a loose GS1 Application Identifier syntax validator. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds DataMatrixRenderer as a third render path. Selects the bwip-js encoder by GS1 mode and shape (datamatrix / gs1datamatrix / *rectangular), renders inline SVG, and reuses the existing SVG->PNG download pipeline. Wires the dispatch in BarcodeGenerator and the download filename prefix for the datamatrix type. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Renders a representative Data Matrix glyph in the Studio Pro page editor when the Data Matrix format is selected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds config-mapping and validation unit tests plus render tests asserting encoder selection (plain vs GS1, rectangular) and the malformed-GS1 error path. Mocks bwip-js and adds the new required Data Matrix props to the shared test props builder. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Proposal, design, specs, and task checklist for adding Data Matrix and GS1 Data Matrix generation to the barcode generator widget. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move openspec change/archive folders under each widget's own package directory instead of the repo-root openspec/ folder.
bwip-js SVGs carry only a viewBox, no width/height attributes, so the rendered element defaulted to intrinsic sizing instead of the configured size. Derive pixel dimensions from the viewBox and apply them via inline style.
…class, tighten memo deps Data Matrix code value comes from a Mendix DynamicValue and reaches the DOM via dangerouslySetInnerHTML; sanitize the bwip-js SVG output with DOMPurify before injecting it. Also prefix the preview image class per widget style convention and destructure encodeDataMatrix's params so the useMemo dependency list stays exhaustive without a lint suppression.
312ba29 to
f568c62
Compare
AI Code Review
What was reviewed
Skipped (out of scope): Findings🔶 Medium — E2E tests absent; gap undocumented in PR descriptionFile:
|
| return { valid: true }; | ||
| case "DataMatrix": | ||
| // DataMatrix: encoder handles the heavy lifting; guard extremely long static values | ||
| if (value.length > 2000) { |
There was a problem hiding this comment.
can't this value to be the same as QRCode?
let say we use 2000, can we put it as constant or static number configurations?
Pull request type
New feature (non-breaking change which adds functionality)
Description