@kensio/colophon 2.11.0 → 2.12.0

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 (186) hide show
  1. package/README.md +1 -1
  2. package/dist/astro/index.d.ts.map +1 -1
  3. package/dist/astro/index.js +0 -1
  4. package/dist/astro/index.js.map +1 -1
  5. package/dist/cli/index.js +0 -0
  6. package/dist/config/defaults.d.ts.map +1 -1
  7. package/dist/config/defaults.js +5 -0
  8. package/dist/config/defaults.js.map +1 -1
  9. package/dist/config/index.js +1 -1
  10. package/dist/image/media.d.ts.map +1 -1
  11. package/dist/image/media.js.map +1 -1
  12. package/dist/image/svg.js +1 -1
  13. package/dist/measure/faces.d.ts.map +1 -1
  14. package/dist/measure/faces.js.map +1 -1
  15. package/dist/platform/base64.d.ts.map +1 -1
  16. package/dist/platform/base64.js +0 -2
  17. package/dist/platform/base64.js.map +1 -1
  18. package/dist/pool.js +1 -1
  19. package/dist/templates/banner/index.js +2 -2
  20. package/dist/templates/banner/index.js.map +1 -1
  21. package/dist/templates/card/index.js +2 -2
  22. package/dist/templates/card/index.js.map +1 -1
  23. package/dist/templates/code/bar.d.ts +24 -0
  24. package/dist/templates/code/bar.d.ts.map +1 -0
  25. package/dist/templates/code/bar.js +31 -0
  26. package/dist/templates/code/bar.js.map +1 -0
  27. package/dist/templates/code/gutter.d.ts +30 -0
  28. package/dist/templates/code/gutter.d.ts.map +1 -0
  29. package/dist/templates/code/gutter.js +64 -0
  30. package/dist/templates/code/gutter.js.map +1 -0
  31. package/dist/templates/code/index.d.ts.map +1 -1
  32. package/dist/templates/code/index.js +34 -15
  33. package/dist/templates/code/index.js.map +1 -1
  34. package/dist/templates/code/layout.d.ts +6 -1
  35. package/dist/templates/code/layout.d.ts.map +1 -1
  36. package/dist/templates/code/layout.js +8 -3
  37. package/dist/templates/code/layout.js.map +1 -1
  38. package/dist/templates/code/mark/draw.d.ts +26 -0
  39. package/dist/templates/code/mark/draw.d.ts.map +1 -0
  40. package/dist/templates/code/mark/draw.js +41 -0
  41. package/dist/templates/code/mark/draw.js.map +1 -0
  42. package/dist/templates/code/mark/index.d.ts +16 -0
  43. package/dist/templates/code/mark/index.d.ts.map +1 -0
  44. package/dist/templates/code/mark/index.js +34 -0
  45. package/dist/templates/code/mark/index.js.map +1 -0
  46. package/dist/templates/code/mark/locate.d.ts +20 -0
  47. package/dist/templates/code/mark/locate.d.ts.map +1 -0
  48. package/dist/templates/code/mark/locate.js +56 -0
  49. package/dist/templates/code/mark/locate.js.map +1 -0
  50. package/dist/templates/code/mark/read.d.ts +30 -0
  51. package/dist/templates/code/mark/read.d.ts.map +1 -0
  52. package/dist/templates/code/mark/read.js +61 -0
  53. package/dist/templates/code/mark/read.js.map +1 -0
  54. package/dist/templates/code/plate.d.ts +7 -1
  55. package/dist/templates/code/plate.d.ts.map +1 -1
  56. package/dist/templates/code/plate.js +14 -4
  57. package/dist/templates/code/plate.js.map +1 -1
  58. package/dist/templates/footer.d.ts +9 -1
  59. package/dist/templates/footer.d.ts.map +1 -1
  60. package/dist/templates/footer.js +24 -0
  61. package/dist/templates/footer.js.map +1 -1
  62. package/dist/templates/frame.d.ts.map +1 -1
  63. package/dist/templates/frame.js +5 -7
  64. package/dist/templates/frame.js.map +1 -1
  65. package/dist/templates/terminal/index.js +4 -4
  66. package/dist/templates/terminal/index.js.map +1 -1
  67. package/dist/templates/window/dots.d.ts +11 -0
  68. package/dist/templates/window/dots.d.ts.map +1 -0
  69. package/dist/templates/window/dots.js +32 -0
  70. package/dist/templates/window/dots.js.map +1 -0
  71. package/dist/templates/{terminal/window.d.ts → window/index.d.ts} +4 -2
  72. package/dist/templates/window/index.d.ts.map +1 -0
  73. package/dist/templates/window/index.js +48 -0
  74. package/dist/templates/window/index.js.map +1 -0
  75. package/dist/templates/window/title.d.ts +9 -0
  76. package/dist/templates/window/title.d.ts.map +1 -0
  77. package/dist/templates/window/title.js +24 -0
  78. package/dist/templates/window/title.js.map +1 -0
  79. package/dist/texture/chevrons.d.ts +13 -0
  80. package/dist/texture/chevrons.d.ts.map +1 -0
  81. package/dist/texture/chevrons.js +22 -0
  82. package/dist/texture/chevrons.js.map +1 -0
  83. package/dist/texture/color.d.ts +10 -0
  84. package/dist/texture/color.d.ts.map +1 -0
  85. package/dist/texture/color.js +10 -0
  86. package/dist/texture/color.js.map +1 -0
  87. package/dist/texture/grid.d.ts +14 -0
  88. package/dist/texture/grid.d.ts.map +1 -0
  89. package/dist/texture/grid.js +38 -0
  90. package/dist/texture/grid.js.map +1 -0
  91. package/dist/texture/halftone.d.ts +14 -0
  92. package/dist/texture/halftone.d.ts.map +1 -0
  93. package/dist/texture/halftone.js +55 -0
  94. package/dist/texture/halftone.js.map +1 -0
  95. package/dist/texture/honeycomb.d.ts +14 -0
  96. package/dist/texture/honeycomb.d.ts.map +1 -0
  97. package/dist/texture/honeycomb.js +43 -0
  98. package/dist/texture/honeycomb.js.map +1 -0
  99. package/dist/texture/index.d.ts.map +1 -1
  100. package/dist/texture/index.js +44 -8
  101. package/dist/texture/index.js.map +1 -1
  102. package/dist/texture/moire.d.ts +18 -0
  103. package/dist/texture/moire.d.ts.map +1 -0
  104. package/dist/texture/moire.js +44 -0
  105. package/dist/texture/moire.js.map +1 -0
  106. package/dist/texture/pattern.d.ts +10 -0
  107. package/dist/texture/pattern.d.ts.map +1 -1
  108. package/dist/texture/pattern.js +37 -15
  109. package/dist/texture/pattern.js.map +1 -1
  110. package/dist/texture/rays.d.ts +13 -0
  111. package/dist/texture/rays.d.ts.map +1 -0
  112. package/dist/texture/rays.js +36 -0
  113. package/dist/texture/rays.js.map +1 -0
  114. package/dist/texture/resolve.d.ts +5 -4
  115. package/dist/texture/resolve.d.ts.map +1 -1
  116. package/dist/texture/resolve.js +5 -4
  117. package/dist/texture/resolve.js.map +1 -1
  118. package/dist/texture/scallops.d.ts +14 -0
  119. package/dist/texture/scallops.d.ts.map +1 -0
  120. package/dist/texture/scallops.js +29 -0
  121. package/dist/texture/scallops.js.map +1 -0
  122. package/dist/texture/tile.d.ts +14 -0
  123. package/dist/texture/tile.d.ts.map +1 -0
  124. package/dist/texture/tile.js +23 -0
  125. package/dist/texture/tile.js.map +1 -0
  126. package/dist/texture/topographic/contours.d.ts +13 -0
  127. package/dist/texture/topographic/contours.d.ts.map +1 -0
  128. package/dist/texture/topographic/contours.js +72 -0
  129. package/dist/texture/topographic/contours.js.map +1 -0
  130. package/dist/texture/topographic/field.d.ts +8 -0
  131. package/dist/texture/topographic/field.d.ts.map +1 -0
  132. package/dist/texture/topographic/field.js +29 -0
  133. package/dist/texture/topographic/field.js.map +1 -0
  134. package/dist/texture/topographic/index.d.ts +17 -0
  135. package/dist/texture/topographic/index.d.ts.map +1 -0
  136. package/dist/texture/topographic/index.js +48 -0
  137. package/dist/texture/topographic/index.js.map +1 -0
  138. package/dist/texture/waves.d.ts +18 -0
  139. package/dist/texture/waves.d.ts.map +1 -0
  140. package/dist/texture/waves.js +55 -0
  141. package/dist/texture/waves.js.map +1 -0
  142. package/dist/theme/presets.d.ts +13 -5
  143. package/dist/theme/presets.d.ts.map +1 -1
  144. package/dist/theme/presets.js +16 -5
  145. package/dist/theme/presets.js.map +1 -1
  146. package/dist/types.d.ts +256 -7
  147. package/dist/types.d.ts.map +1 -1
  148. package/dist/validate/collect.d.ts.map +1 -1
  149. package/dist/validate/collect.js +2 -1
  150. package/dist/validate/collect.js.map +1 -1
  151. package/dist/validate/keys.d.ts +41 -2
  152. package/dist/validate/keys.d.ts.map +1 -1
  153. package/dist/validate/keys.js +141 -4
  154. package/dist/validate/keys.js.map +1 -1
  155. package/dist/validate/texture.d.ts +4 -5
  156. package/dist/validate/texture.d.ts.map +1 -1
  157. package/dist/validate/texture.js +11 -16
  158. package/dist/validate/texture.js.map +1 -1
  159. package/dist/validate/values.d.ts +6 -0
  160. package/dist/validate/values.d.ts.map +1 -1
  161. package/dist/validate/values.js +16 -1
  162. package/dist/validate/values.js.map +1 -1
  163. package/package.json +23 -31
  164. package/dist/highlight/probe.d.ts +0 -4
  165. package/dist/highlight/probe.d.ts.map +0 -1
  166. package/dist/highlight/probe.js +0 -4
  167. package/dist/highlight/probe.js.map +0 -1
  168. package/dist/jpeg/index.d.ts +0 -10
  169. package/dist/jpeg/index.d.ts.map +0 -1
  170. package/dist/jpeg/index.js +0 -2
  171. package/dist/jpeg/index.js.map +0 -1
  172. package/dist/render/png.d.ts +0 -20
  173. package/dist/render/png.d.ts.map +0 -1
  174. package/dist/render/png.js +0 -29
  175. package/dist/render/png.js.map +0 -1
  176. package/dist/stamp/chunk.d.ts +0 -14
  177. package/dist/stamp/chunk.d.ts.map +0 -1
  178. package/dist/stamp/chunk.js +0 -38
  179. package/dist/stamp/chunk.js.map +0 -1
  180. package/dist/templates/code/ellipsis.d.ts +0 -3
  181. package/dist/templates/code/ellipsis.d.ts.map +0 -1
  182. package/dist/templates/code/ellipsis.js +0 -3
  183. package/dist/templates/code/ellipsis.js.map +0 -1
  184. package/dist/templates/terminal/window.d.ts.map +0 -1
  185. package/dist/templates/terminal/window.js +0 -84
  186. package/dist/templates/terminal/window.js.map +0 -1
@@ -1,84 +0,0 @@
1
- import { baselineFor, box, clampLine, measureIn, textElement, } from "../../layout/index.js";
2
- /** The title bar's height, as a fraction of the window's width. */
3
- const barScale = 0.055;
4
- /** The buttons' diameter, as a fraction of the bar's height. */
5
- const buttonScale = 0.26;
6
- /**
7
- * The three buttons, in the colours every reader has seen on a window.
8
- *
9
- * They are not the site's colours and are not meant to be. The point of the
10
- * chrome is that the image is recognised as a terminal before a word of it is
11
- * read, and these are what does the recognising.
12
- */
13
- const buttons = ["#ff5f57", "#febc2e", "#28c840"];
14
- /** How tall the title bar is on a window of this width. */
15
- export function barHeight(windowWidth) {
16
- return Math.round(windowWidth * barScale);
17
- }
18
- /**
19
- * A rectangle with its top corners rounded and its bottom ones square, which
20
- * is the shape of a title bar sitting in the top of a rounded window.
21
- *
22
- * It has to be one shape rather than a rounded rectangle with a square one
23
- * over its bottom half, which is the obvious way to do it and the wrong one:
24
- * the band is drawn at low opacity, so anywhere the two overlapped would be
25
- * painted twice and come out as a lighter block with a curve through it.
26
- */
27
- function roundedTop(rect, radius) {
28
- const { x, y, width, height } = rect;
29
- const r = Math.min(radius, Math.round(width / 2), height);
30
- return (`M${String(x)} ${String(y + r)}` +
31
- `a${String(r)} ${String(r)} 0 0 1 ${String(r)} ${String(-r)}` +
32
- `h${String(width - r * 2)}` +
33
- `a${String(r)} ${String(r)} 0 0 1 ${String(r)} ${String(r)}` +
34
- `v${String(height - r)}h${String(-width)}z`);
35
- }
36
- /**
37
- * The bar across the top of the window: a lighter band, the buttons, and the
38
- * title in the middle of what is left.
39
- *
40
- * The band is white at low opacity rather than a colour of its own, so it
41
- * lifts whatever the code theme's background happens to be instead of having
42
- * to be chosen against it.
43
- */
44
- export function titleBar(window, height, title, config, measure) {
45
- const { radius } = window;
46
- const diameter = Math.round(height * buttonScale);
47
- const gap = Math.round(diameter * 1.7);
48
- const left = window.x + Math.round(height * 0.6);
49
- const middle = window.y + Math.round(height / 2);
50
- const band = `<path d="${roundedTop({ x: window.x, y: window.y, width: window.width, height }, radius)}"` +
51
- ` fill="#ffffff" fill-opacity="0.07"/>${box({ x: window.x, y: window.y + height, width: window.width, height: 1 }, { fill: "#ffffff", fillOpacity: 0.1 })}`;
52
- const lights = buttons
53
- .map((fill, index) => box({
54
- x: left + index * gap,
55
- y: middle - Math.round(diameter / 2),
56
- width: diameter,
57
- height: diameter,
58
- }, { radius: Math.round(diameter / 2), fill }))
59
- .join("");
60
- return band + lights + windowTitle(title, window, height, config, measure);
61
- }
62
- /**
63
- * The window's title, centred in the bar. It is cut to the room between the
64
- * buttons and the far edge, taking the buttons' width off both sides so that
65
- * it stays centred in the bar rather than in what the buttons left.
66
- */
67
- function windowTitle(title, window, height, config, measure) {
68
- if (title === "") {
69
- return "";
70
- }
71
- const fontSize = Math.round(height * 0.42);
72
- const reserved = Math.round(height * 2.4);
73
- return textElement(clampLine(title, window.width - reserved * 2, measureIn(measure, config.fontFamily, 600), fontSize), {
74
- x: Math.round(window.x + window.width / 2),
75
- y: baselineFor(window.y + (height - fontSize) / 2, fontSize),
76
- fontFamily: config.fontFamily,
77
- fontSize,
78
- fontWeight: 600,
79
- fill: "#ffffff",
80
- fillOpacity: 0.6,
81
- anchor: "middle",
82
- });
83
- }
84
- //# sourceMappingURL=window.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"window.js","sourceRoot":"","sources":["../../../src/templates/terminal/window.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,GAAG,EACH,SAAS,EACT,SAAS,EACT,WAAW,GACZ,MAAM,uBAAuB,CAAC;AAK/B,mEAAmE;AACnE,MAAM,QAAQ,GAAG,KAAK,CAAC;AAEvB,gEAAgE;AAChE,MAAM,WAAW,GAAG,IAAI,CAAC;AAEzB;;;;;;GAMG;AACH,MAAM,OAAO,GAAsB,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAErE,2DAA2D;AAC3D,MAAM,UAAU,SAAS,CAAC,WAAmB;IAC3C,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,QAAQ,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,UAAU,CAAC,IAAU,EAAE,MAAc;IAC5C,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACrC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAE1D,OAAO,CACL,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE;QAChC,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,UAAU,MAAM,CAAC,CAAC,CAAC,IAAI,M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