@zebrash/core 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +5 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @zebrash/core
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@zebrash/core)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
Internal engine for the `@zebrash` family — the
|
|
7
|
+
[ZPL II](https://en.wikipedia.org/wiki/Zebra_Programming_Language) parser,
|
|
8
|
+
drawer, and barcode encoders, plus a platform abstraction selected at bundle
|
|
9
|
+
time via the `"browser"` field in `package.json`.
|
|
10
|
+
|
|
11
|
+
> **End users should not import `@zebrash/core` directly.** It has no built-in
|
|
12
|
+
> rasterization backend. Pick the runtime-appropriate wrapper instead:
|
|
13
|
+
>
|
|
14
|
+
> - **Node / Bun:** [`@zebrash/node`](https://www.npmjs.com/package/@zebrash/node)
|
|
15
|
+
> - **Browser:** [`@zebrash/browser`](https://www.npmjs.com/package/@zebrash/browser)
|
|
16
|
+
>
|
|
17
|
+
> Both expose the same `Parser` / `Drawer` / `LabelInfo` / `DrawerOptions` API.
|
|
18
|
+
|
|
19
|
+
## Documentation
|
|
20
|
+
|
|
21
|
+
See the [main README](https://github.com/Fountain-Bio/zebrash-ts#readme) for
|
|
22
|
+
usage, supported ZPL commands, and the SVG-output reference.
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
MIT.
|
package/dist/drawer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../src/drawer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,KAAK,aAAa,EAAgB,MAAM,qBAAqB,CAAC;AA2CvE;;;;;GAKG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAkB;IACjD,OAAO,CAAC,iBAAiB,CAAmC;gBAEhD,cAAc,CAAC,EAAE,aAAa,EAAE;IAI5C,8EAA8E;IAC9E,OAAO,CAAC,oBAAoB;IAO5B;;;;;;;;;;;OAWG;IACG,cAAc,CAClB,KAAK,EAAE,SAAS,EAChB,OAAO,GAAE,OAAO,CAAC,aAAa,CAAM,GACnC,OAAO,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../src/drawer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,KAAK,aAAa,EAAgB,MAAM,qBAAqB,CAAC;AA2CvE;;;;;GAKG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAkB;IACjD,OAAO,CAAC,iBAAiB,CAAmC;gBAEhD,cAAc,CAAC,EAAE,aAAa,EAAE;IAI5C,8EAA8E;IAC9E,OAAO,CAAC,oBAAoB;IAO5B;;;;;;;;;;;OAWG;IACG,cAAc,CAClB,KAAK,EAAE,SAAS,EAChB,OAAO,GAAE,OAAO,CAAC,aAAa,CAAM,GACnC,OAAO,CAAC,UAAU,CAAC;IA+EtB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,GAAE,OAAO,CAAC,aAAa,CAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAkF9F"}
|
package/dist/drawer.js
CHANGED
|
@@ -103,6 +103,11 @@ export class Drawer {
|
|
|
103
103
|
wCtx.scale(-1, -1);
|
|
104
104
|
}
|
|
105
105
|
wCtx.drawImage(canvas, Math.floor((labelWidth - imageWidth) / 2), 0);
|
|
106
|
+
// @napi-rs/canvas's putImageData is affected by the active transform
|
|
107
|
+
// (spec violation — putImageData should write at raw pixel coords).
|
|
108
|
+
// encodeMonochrome / encodeGrayscale call putImageData below, so reset
|
|
109
|
+
// to identity here. No-op in browsers, which already follow the spec.
|
|
110
|
+
wCtx.setTransform(1, 0, 0, 1, 0, 0);
|
|
106
111
|
finalCtx = wCtx;
|
|
107
112
|
}
|
|
108
113
|
return opts.grayscaleOutput
|
package/package.json
CHANGED