@kensio/colophon 2.10.0 → 2.11.1

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 (84) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/index.js +0 -0
  3. package/dist/config/index.d.ts.map +1 -1
  4. package/dist/config/index.js +2 -1
  5. package/dist/config/index.js.map +1 -1
  6. package/dist/encode/index.d.ts.map +1 -1
  7. package/dist/encode/index.js +10 -5
  8. package/dist/encode/index.js.map +1 -1
  9. package/dist/encode/quantise.d.ts +22 -0
  10. package/dist/encode/quantise.d.ts.map +1 -0
  11. package/dist/encode/quantise.js +29 -0
  12. package/dist/encode/quantise.js.map +1 -0
  13. package/dist/encode/sharp.d.ts +15 -0
  14. package/dist/encode/sharp.d.ts.map +1 -1
  15. package/dist/encode/sharp.js +20 -0
  16. package/dist/encode/sharp.js.map +1 -1
  17. package/dist/image/media.d.ts.map +1 -1
  18. package/dist/image/media.js.map +1 -1
  19. package/dist/image/svg.js +1 -1
  20. package/dist/platform/base64.d.ts.map +1 -1
  21. package/dist/platform/base64.js +0 -2
  22. package/dist/platform/base64.js.map +1 -1
  23. package/dist/png/carry.d.ts +27 -0
  24. package/dist/png/carry.d.ts.map +1 -0
  25. package/dist/png/carry.js +54 -0
  26. package/dist/png/carry.js.map +1 -0
  27. package/dist/png/index.d.ts +7 -5
  28. package/dist/png/index.d.ts.map +1 -1
  29. package/dist/png/index.js +1 -0
  30. package/dist/png/index.js.map +1 -1
  31. package/dist/pool.js +1 -1
  32. package/dist/stamp/config-digest.d.ts +4 -0
  33. package/dist/stamp/config-digest.d.ts.map +1 -1
  34. package/dist/stamp/config-digest.js +5 -0
  35. package/dist/stamp/config-digest.js.map +1 -1
  36. package/dist/texture/color.d.ts +10 -0
  37. package/dist/texture/color.d.ts.map +1 -0
  38. package/dist/texture/color.js +10 -0
  39. package/dist/texture/color.js.map +1 -0
  40. package/dist/texture/index.d.ts +2 -1
  41. package/dist/texture/index.d.ts.map +1 -1
  42. package/dist/texture/index.js +6 -1
  43. package/dist/texture/index.js.map +1 -1
  44. package/dist/texture/pattern.d.ts.map +1 -1
  45. package/dist/texture/pattern.js +1 -2
  46. package/dist/texture/pattern.js.map +1 -1
  47. package/dist/texture/resolve.d.ts +5 -4
  48. package/dist/texture/resolve.d.ts.map +1 -1
  49. package/dist/texture/resolve.js +5 -4
  50. package/dist/texture/resolve.js.map +1 -1
  51. package/dist/texture/waves.d.ts +18 -0
  52. package/dist/texture/waves.d.ts.map +1 -0
  53. package/dist/texture/waves.js +55 -0
  54. package/dist/texture/waves.js.map +1 -0
  55. package/dist/types.d.ts +51 -7
  56. package/dist/types.d.ts.map +1 -1
  57. package/dist/validate/keys.d.ts +4 -2
  58. package/dist/validate/keys.d.ts.map +1 -1
  59. package/dist/validate/keys.js +12 -2
  60. package/dist/validate/keys.js.map +1 -1
  61. package/dist/validate/texture.d.ts.map +1 -1
  62. package/dist/validate/texture.js +5 -1
  63. package/dist/validate/texture.js.map +1 -1
  64. package/package.json +23 -24
  65. package/dist/highlight/probe.d.ts +0 -4
  66. package/dist/highlight/probe.d.ts.map +0 -1
  67. package/dist/highlight/probe.js +0 -4
  68. package/dist/highlight/probe.js.map +0 -1
  69. package/dist/jpeg/index.d.ts +0 -10
  70. package/dist/jpeg/index.d.ts.map +0 -1
  71. package/dist/jpeg/index.js +0 -2
  72. package/dist/jpeg/index.js.map +0 -1
  73. package/dist/render/png.d.ts +0 -20
  74. package/dist/render/png.d.ts.map +0 -1
  75. package/dist/render/png.js +0 -29
  76. package/dist/render/png.js.map +0 -1
  77. package/dist/stamp/chunk.d.ts +0 -14
  78. package/dist/stamp/chunk.d.ts.map +0 -1
  79. package/dist/stamp/chunk.js +0 -38
  80. package/dist/stamp/chunk.js.map +0 -1
  81. package/dist/templates/code/ellipsis.d.ts +0 -3
  82. package/dist/templates/code/ellipsis.d.ts.map +0 -1
  83. package/dist/templates/code/ellipsis.js +0 -3
  84. package/dist/templates/code/ellipsis.js.map +0 -1
@@ -1,38 +0,0 @@
1
- import { chunkBytes, pngSignature } from "../png/chunk.js";
2
- /**
3
- * PNG `tEXt` keyword the stamp is stored under. Keeping it in the image means
4
- * there is no sidecar file to fall out of sync, and deleting an image deletes
5
- * its stamp with it.
6
- */
7
- export const stampKeyword = "colophon";
8
- /** Signature + the whole `IHDR` chunk: length, type, 13 bytes of data, CRC. */
9
- export const afterHeader = pngSignature.length + 4 + 4 + 13 + 4;
10
- /** What a `tEXt` chunk carries: `keyword\0text`. */
11
- function textData(keyword, text) {
12
- return Buffer.concat([
13
- Buffer.from(keyword, "latin1"),
14
- Buffer.from([0]),
15
- Buffer.from(text, "latin1"),
16
- ]);
17
- }
18
- /**
19
- * Return `png` with the stamp embedded as a `tEXt` chunk, inserted straight
20
- * after the header so it can be read back without decoding the image.
21
- */
22
- export function stampPng(png, stamp) {
23
- if (png.length < afterHeader ||
24
- !png.subarray(0, pngSignature.length).equals(pngSignature) ||
25
- png.toString("latin1", 12, 16) !== "IHDR") {
26
- // Reachable in practice only through a configured rasteriser, since resvg
27
- // writes nothing else. Saying why beats leaving someone to work out that
28
- // the stamp is the reason their WebP backend cannot be used yet.
29
- throw new Error("Cannot stamp: not a PNG image. The rebuild stamp is a PNG chunk, so a" +
30
- " rasteriser has to produce PNG for a build to be able to skip it.");
31
- }
32
- return Buffer.concat([
33
- png.subarray(0, afterHeader),
34
- chunkBytes("tEXt", textData(stampKeyword, stamp)),
35
- png.subarray(afterHeader),
36
- ]);
37
- }
38
- //# sourceMappingURL=chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chunk.js","sourceRoot":"","sources":["../../src/stamp/chunk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AAEvC,+EAA+E;AAC/E,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAEhE,oDAAoD;AACpD,SAAS,QAAQ,CAAC,OAAe,EAAE,IAAY;IAC7C,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAChB,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;KAC5B,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW,EAAE,KAAa;IACjD,IACE,GAAG,CAAC,MAAM,GAAG,WAAW;QACxB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QAC1D,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC,KAAK,MAAM,EACzC,CAAC;QACD,0EAA0E;QAC1E,yEAAyE;QACzE,iEAAiE;QACjE,MAAM,IAAI,KAAK,CACb,uEAAuE;YACrE,mEAAmE,CACtE,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,WAAW,CAAC;QAC5B,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QACjD,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC;KAC1B,CAAC,CAAC;AACL,CAAC"}
@@ -1,3 +0,0 @@
1
- /** The mark a truncated line or block ends with. */
2
- export declare const ellipsis = "\u2026";
3
- //# sourceMappingURL=ellipsis.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ellipsis.d.ts","sourceRoot":"","sources":["../../../src/templates/code/ellipsis.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,eAAO,MAAM,QAAQ,WAAM,CAAC"}
@@ -1,3 +0,0 @@
1
- /** The mark a truncated line or block ends with. */
2
- export const ellipsis = "…";
3
- //# sourceMappingURL=ellipsis.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ellipsis.js","sourceRoot":"","sources":["../../../src/templates/code/ellipsis.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAC"}