Gerador de etiqueta ZPL raster (canvas, dithering, mídia e margens)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 38/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- frontend
调研方向
No ZPL or printer-raster code exists in this repo yet, so start from the package export map to see where a ./print subpath would attach, then read the referenced AC implementation paths (apps/web/src/lib/canvas-to-zpl-image.ts:22-26 for the zpl-image/DPI setup, :55-60 for mmToDots, :86-103 for the ^MT/^MN/^GFA assembly) to understand the target behaviour. Treat the five acceptance boxes as the test plan: dot conversion, media flags, explicit no-CORS error, one shared raster for preview and ZPL, and monotonic black-pixel counts across thresholds. The rasterizer must be injected rather than tied to Konva, which is the main design decision to settle before writing code.
由索引模型根据 Issue 内容生成。
描述
Versão: @codeatlasdev/ui 4.6.0 · código lido em main (950628f2) · classe: lacuna (migração do AC)
Problema
O AC depende deste comportamento hoje e a lib não o oferece. Sem ele, a migração perde qualidade no desktop, no mobile ou no PWA.
O que a lib já oferece (para não duplicar) e o que falta
(leitura de origin/main) sem ZPL nem raster de impressora. ./code é CodeSnippet (syntax highlight), não impressão.
Referência no AC
Caminhos do repo AC (repo privado, só caminho):
apps/web/src/lib/canvas-to-zpl-image.ts:22-26 (zpl-image, DPI 203, PIXEL_RATIO), :55-60 (mmToDots), :86-103 (buildZpl com ^MTT/^MTD, ^MNY/^MNM/^MNN, ^GFA), :213 (black: 50, notrim); components/label-editor/label-preview-panel.tsx:18-19 (captureCanvasAsPng); routes/_app/etiquetas.placas.editor.$id.tsx (export JPEG em pixelRatio).
Defeitos do AC (verificados por leitura do código): (leitura) ver F-06.
Proposta
subpath ./print com toZplRaster(canvas, { widthMm, heightMm, dpi: 203, media: 'gap'|'black_mark'|'continuous', method: 'thermal_transfer'|'direct_thermal', threshold: 50 }) e previewLabel(canvas), injetando o rasterizador (não acoplar Konva).
Critério de aceite (testável)
- Para 100 mm × 50 mm a 203 dpi,
mmToDots(100)= 799 emmToDots(50)= 400. -
media: 'gap'gera^MNY;media: 'black_mark'gera^MNM;media: 'continuous'gera^MNN. - Canvas com imagem de origem sem CORS lança erro explícito ("imagem sem CORS") e não produz ZPL vazio.
- Preview PNG e ZPL vêm do mesmo raster (mesmo hash de bytes).
-
threshold50 e 200 mudam o número de pixels pretos de forma monotônica.
Mãe: #1089
- 主要语言
- TypeScript
- 星标
- 6
- 派生
- 3
- 平均合并
- 5 小时 21 分钟
- 30 天内合并 PR
- 378
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codeatlasdev/ui 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
codeatlasdev/ui#1340 ·
维护者通常 1 天内回复
-
area:a11y area:components bug
难度 2/5 1-3 小时 新手友好度 76/100
codeatlasdev/ui#1336 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
codeatlasdev/ui#1329 ·
维护者通常 1 天内回复
-
good first issue
难度 2/5 1-3 小时 新手友好度 74/100
codeatlasdev/ui#1292 · 1 条评论 ·
维护者通常 1 天内回复
-
area:components enhancement good first issue
难度 2/5 1-3 小时 新手友好度 68/100
codeatlasdev/ui#1198 ·
维护者通常 1 天内回复
相似的 Issue
-
bug frontend
难度 2/5 1-3 小时 新手友好度 85/100
CivicTechWR/accessible-housing-portal#578 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
nekko-labs/nekko-agent#2998 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 86/100
sandbox-quantum/switch#2163 ·
维护者通常 1 天内回复
-
enhancement ux
难度 2/5 1-3 小时 新手友好度 72/100
lolimmlost/aidj#433 ·
维护者通常 1 天内回复
-
test: ipcShownDialogKeys.test.tsx can fail the unit run with 'window is not defined' after it ends未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复