qrdx 0.0.59 → 0.0.60

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.
Files changed (68) hide show
  1. package/README.md +3 -3
  2. package/dist/core.js +7 -7
  3. package/dist/core.js.map +1 -1
  4. package/dist/core.mjs +7 -7
  5. package/dist/core.mjs.map +1 -1
  6. package/dist/element.browser.mjs +6 -6
  7. package/dist/element.browser.mjs.map +1 -1
  8. package/dist/index.js +7 -7
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.mjs +7 -7
  11. package/dist/index.mjs.map +1 -1
  12. package/dist/qr-code-canvas.js +1 -1
  13. package/dist/qr-code-canvas.js.map +1 -1
  14. package/dist/qr-code-canvas.mjs +1 -1
  15. package/dist/qr-code-canvas.mjs.map +1 -1
  16. package/dist/schemas.js +1 -1
  17. package/dist/schemas.js.map +1 -1
  18. package/dist/schemas.mjs +1 -1
  19. package/dist/schemas.mjs.map +1 -1
  20. package/dist/src/corner-dot.d.ts.map +1 -1
  21. package/dist/src/corner-eye.d.ts.map +1 -1
  22. package/dist/src/engine.d.ts +1 -1
  23. package/dist/src/engine.d.ts.map +1 -1
  24. package/dist/src/looks.d.ts +45 -17
  25. package/dist/src/looks.d.ts.map +1 -1
  26. package/dist/src/scan-risk.d.ts.map +1 -1
  27. package/dist/src/scan-score.d.ts.map +1 -1
  28. package/dist/src/shapes.d.ts +19 -0
  29. package/dist/src/shapes.d.ts.map +1 -1
  30. package/dist/src/utils/oklab.d.ts +16 -0
  31. package/dist/src/utils/oklab.d.ts.map +1 -0
  32. package/dist/src/utils.d.ts.map +1 -1
  33. package/dist/types/constants.d.ts +40 -5
  34. package/dist/types/constants.d.ts.map +1 -1
  35. package/dist/types/corner-dot.d.ts +11 -6
  36. package/dist/types/corner-dot.d.ts.map +1 -1
  37. package/dist/types/corner-eye.d.ts +21 -8
  38. package/dist/types/corner-eye.d.ts.map +1 -1
  39. package/dist/types/frame-spec.d.ts +1 -1
  40. package/dist/types/frame.d.ts +2 -2
  41. package/dist/types/image-pattern.d.ts +3 -3
  42. package/dist/types/image-pattern.d.ts.map +1 -1
  43. package/dist/types/index.js +2 -2
  44. package/dist/types/index.js.map +1 -1
  45. package/dist/types/index.mjs +2 -2
  46. package/dist/types/index.mjs.map +1 -1
  47. package/dist/types/plain.d.ts +1 -1
  48. package/dist/types/plain.d.ts.map +1 -1
  49. package/dist/types/qr.d.ts +96 -46
  50. package/dist/types/qr.d.ts.map +1 -1
  51. package/dist/vanilla.browser.mjs +29 -29
  52. package/dist/vanilla.browser.mjs.map +1 -1
  53. package/package.json +1 -1
  54. package/src/corner-dot.tsx +15 -0
  55. package/src/corner-eye.ts +163 -72
  56. package/src/engine.ts +4 -0
  57. package/src/looks.ts +272 -69
  58. package/src/scan-risk.ts +19 -3
  59. package/src/scan-score.ts +11 -1
  60. package/src/shapes.ts +123 -0
  61. package/src/utils/oklab.ts +93 -0
  62. package/src/utils.tsx +20 -4
  63. package/types/constants.ts +59 -3
  64. package/types/corner-dot.ts +17 -7
  65. package/types/corner-eye.ts +26 -8
  66. package/types/image-pattern.ts +11 -4
  67. package/types/plain.ts +4 -0
  68. package/types/qr.ts +5 -3
package/README.md CHANGED
@@ -329,9 +329,9 @@ See every option drawn live at [qrdx.dev/docs/styles](https://qrdx.dev/docs/styl
329
329
 
330
330
  **Body** (`bodyPattern`, default `circle`): <!-- catalogue:BODY_PATTERN -->`circle`, `circle-large`, `square`, `diamond`, `circle-mixed`, `pacman`, `rounded`, `small-square`, `vertical-line`, `horizontal-line`, `liquid`, `liquid-horizontal`, `liquid-vertical`, `classy`, `classy-rounded`, `leaf`, `plus`, `hexagon`, `star`, `heart`, `random-dots`, `mosaic`, `octagon`<!-- /catalogue -->
331
331
 
332
- **Corner eye** (`cornerEyePattern`, default `gear`): <!-- catalogue:CORNER_EYE_PATTERNS -->`square`, `rounded`, `gear`, `circle`, `diya`, `extra-rounded`, `message`, `pointy`, `leaf`, `drop`, `octagon`, `bevel`, `squircle`, `cushion`, `shield`, `petal`, `leaf-reverse`<!-- /catalogue -->
332
+ **Corner eye** (`cornerEyePattern`, default `gear`): <!-- catalogue:CORNER_EYE_PATTERNS -->`square`, `rounded`, `gear`, `circle`, `diya`, `extra-rounded`, `message`, `pointy`, `leaf`, `drop`, `octagon`, `bevel`, `squircle`, `cushion`, `shield`, `petal`, `leaf-reverse`, `porthole`, `notch`, `plus`, `bud`, `bowl`<!-- /catalogue -->
333
333
 
334
- **Corner eye dot** (`cornerEyeDotPattern`, default `circle`): <!-- catalogue:CORNER_EYE_DOT_PATTERNS -->`square`, `rounded`, `circle`, `message`, `message-reverse`, `diya`, `diya-reverse`, `rounded-triangle`, `leaf`, `drop`, `plus`, `cross-rounded`, `hexagon`, `octagon`, `flower`, `heart`, `squircle`, `dots`, `extra-rounded`, `leaf-reverse`, `drop-reverse`<!-- /catalogue -->
334
+ **Corner eye dot** (`cornerEyeDotPattern`, default `circle`): <!-- catalogue:CORNER_EYE_DOT_PATTERNS -->`square`, `rounded`, `circle`, `message`, `message-reverse`, `diya`, `diya-reverse`, `rounded-triangle`, `leaf`, `drop`, `plus`, `cross-rounded`, `hexagon`, `octagon`, `flower`, `heart`, `squircle`, `dots`, `extra-rounded`, `leaf-reverse`, `drop-reverse`, `cushion`<!-- /catalogue -->
335
335
 
336
336
  The same lists are exported as `BODY_PATTERN`, `CORNER_EYE_PATTERNS` and `CORNER_EYE_DOT_PATTERNS`. `liquid` and `classy` join neighbouring modules into one outline; `leaf`, `drop` and `petal` eyes turn to face their corner of the code. Alignment patterns are always drawn as solid squares. Every value is tested to decode with jsQR through a phone-camera model next to every other value (and was checked with ZXing and in sharp renders); `square` and `rounded` eyes scan most reliably and `circle` eyes may be missed by some apps. A few body × eye pairs are weak together (`WEAK_BODY_EYES`), and `getStylePairRisk(props)` returns the warning `getScanScore` shows.
337
337
 
@@ -346,7 +346,7 @@ The same lists are exported as `BODY_PATTERN`, `CORNER_EYE_PATTERNS` and `CORNER
346
346
  | `eyeGradient` | `"corner"` (default: each eye sweeps its own gradient) or `"code"`: the eyes' gradients run across the whole code, so eyes painted with the dots' gradient continue it |
347
347
  | `bgRadius` | Corner radius of the background, 0 (default) to `BG_RADIUS_MAX` (0.5) of the code's width; capped at `BG_RADIUS_QUIET_RATIO` (2) × `margin` modules so the quiet zone keeps the code's corners (`getBgRadiusLimit` gives the cap). Square codes only |
348
348
  | `backdrop` | Solid color outside the rounded corners (see-through by default); drawn only when `bgRadius` rounds a corner |
349
- | `halo` | `{ color, width }`: a light rim around every dark module and eye, `width` in modules (`HALO_WIDTH_MIN` 0.1 to `HALO_WIDTH_MAX` 0.5, default 0.25), `color` default `#e5e7eb`, drawn opaque. A look, not a quiet zone. Drawn only on an opaque background, in a color at least as light as `HALO_LIGHT_MIN` (`#d1d5db`) and no lighter than the background (`getHaloRisk` says why not) |
349
+ | `halo` | `{ color, width }`: a light rim around every dark module and eye, `width` in modules (`HALO_WIDTH_MIN` 0.1 to `HALO_WIDTH_MAX` 0.5, default 0.25), `color` default `#e5e7eb`, drawn opaque. A look, not a quiet zone. Drawn only on an opaque background at least as light as `HALO_LIGHT_MIN` (`#d1d5db`) (`getHaloRisk` says why not). Any `color` is taken: one darker than `#d1d5db` or lighter than the background is drawn in the closest color between the two, its hue kept (`fitHaloColor`) |
350
350
  | `shadow` | `{ color, opacity, dx, dy }`: a see-through copy of the dark modules and eyes under them, shifted `dx`/`dy` modules (−`SHADOW_OFFSET_MAX` 0.3 to 0.3, default 0.2) at `opacity` (0.1 to 0.4, default 0.3); `color` default black |
351
351
  | `shape` | `"square"` (default), `"circle"` or `"heart"`: the symbol sits in a disc or a heart filled with decorative modules, behind a light ring of `margin` modules (at least `QR_CIRCLE_QUIET_MIN`, 3). It also takes a `QRSilhouette` traced from a picture (`loadQRSilhouette` in the browser, `createQRSilhouette` from pixels); `getQRSilhouetteFit` refuses one too thin to hold the code, which then draws square. `getLayoutMargin` gives the margin it is drawn with; print sizes and logos follow it. `getQRAsSVG` draws it square |
352
352
  | `frameLabelMarkers` | For editors: marks each frame label `<text>` with `data-qrdx-frame-label` (`"text"`, `"secondaryText"` or a spec label's id), so a preview can edit labels in place. Off by default; exports never include it |