@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.
- package/README.md +1 -1
- package/dist/astro/index.d.ts.map +1 -1
- package/dist/astro/index.js +0 -1
- package/dist/astro/index.js.map +1 -1
- package/dist/cli/index.js +0 -0
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +5 -0
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/image/media.d.ts.map +1 -1
- package/dist/image/media.js.map +1 -1
- package/dist/image/svg.js +1 -1
- package/dist/measure/faces.d.ts.map +1 -1
- package/dist/measure/faces.js.map +1 -1
- package/dist/platform/base64.d.ts.map +1 -1
- package/dist/platform/base64.js +0 -2
- package/dist/platform/base64.js.map +1 -1
- package/dist/pool.js +1 -1
- package/dist/templates/banner/index.js +2 -2
- package/dist/templates/banner/index.js.map +1 -1
- package/dist/templates/card/index.js +2 -2
- package/dist/templates/card/index.js.map +1 -1
- package/dist/templates/code/bar.d.ts +24 -0
- package/dist/templates/code/bar.d.ts.map +1 -0
- package/dist/templates/code/bar.js +31 -0
- package/dist/templates/code/bar.js.map +1 -0
- package/dist/templates/code/gutter.d.ts +30 -0
- package/dist/templates/code/gutter.d.ts.map +1 -0
- package/dist/templates/code/gutter.js +64 -0
- package/dist/templates/code/gutter.js.map +1 -0
- package/dist/templates/code/index.d.ts.map +1 -1
- package/dist/templates/code/index.js +34 -15
- package/dist/templates/code/index.js.map +1 -1
- package/dist/templates/code/layout.d.ts +6 -1
- package/dist/templates/code/layout.d.ts.map +1 -1
- package/dist/templates/code/layout.js +8 -3
- package/dist/templates/code/layout.js.map +1 -1
- package/dist/templates/code/mark/draw.d.ts +26 -0
- package/dist/templates/code/mark/draw.d.ts.map +1 -0
- package/dist/templates/code/mark/draw.js +41 -0
- package/dist/templates/code/mark/draw.js.map +1 -0
- package/dist/templates/code/mark/index.d.ts +16 -0
- package/dist/templates/code/mark/index.d.ts.map +1 -0
- package/dist/templates/code/mark/index.js +34 -0
- package/dist/templates/code/mark/index.js.map +1 -0
- package/dist/templates/code/mark/locate.d.ts +20 -0
- package/dist/templates/code/mark/locate.d.ts.map +1 -0
- package/dist/templates/code/mark/locate.js +56 -0
- package/dist/templates/code/mark/locate.js.map +1 -0
- package/dist/templates/code/mark/read.d.ts +30 -0
- package/dist/templates/code/mark/read.d.ts.map +1 -0
- package/dist/templates/code/mark/read.js +61 -0
- package/dist/templates/code/mark/read.js.map +1 -0
- package/dist/templates/code/plate.d.ts +7 -1
- package/dist/templates/code/plate.d.ts.map +1 -1
- package/dist/templates/code/plate.js +14 -4
- package/dist/templates/code/plate.js.map +1 -1
- package/dist/templates/footer.d.ts +9 -1
- package/dist/templates/footer.d.ts.map +1 -1
- package/dist/templates/footer.js +24 -0
- package/dist/templates/footer.js.map +1 -1
- package/dist/templates/frame.d.ts.map +1 -1
- package/dist/templates/frame.js +5 -7
- package/dist/templates/frame.js.map +1 -1
- package/dist/templates/terminal/index.js +4 -4
- package/dist/templates/terminal/index.js.map +1 -1
- package/dist/templates/window/dots.d.ts +11 -0
- package/dist/templates/window/dots.d.ts.map +1 -0
- package/dist/templates/window/dots.js +32 -0
- package/dist/templates/window/dots.js.map +1 -0
- package/dist/templates/{terminal/window.d.ts → window/index.d.ts} +4 -2
- package/dist/templates/window/index.d.ts.map +1 -0
- package/dist/templates/window/index.js +48 -0
- package/dist/templates/window/index.js.map +1 -0
- package/dist/templates/window/title.d.ts +9 -0
- package/dist/templates/window/title.d.ts.map +1 -0
- package/dist/templates/window/title.js +24 -0
- package/dist/templates/window/title.js.map +1 -0
- package/dist/texture/chevrons.d.ts +13 -0
- package/dist/texture/chevrons.d.ts.map +1 -0
- package/dist/texture/chevrons.js +22 -0
- package/dist/texture/chevrons.js.map +1 -0
- package/dist/texture/color.d.ts +10 -0
- package/dist/texture/color.d.ts.map +1 -0
- package/dist/texture/color.js +10 -0
- package/dist/texture/color.js.map +1 -0
- package/dist/texture/grid.d.ts +14 -0
- package/dist/texture/grid.d.ts.map +1 -0
- package/dist/texture/grid.js +38 -0
- package/dist/texture/grid.js.map +1 -0
- package/dist/texture/halftone.d.ts +14 -0
- package/dist/texture/halftone.d.ts.map +1 -0
- package/dist/texture/halftone.js +55 -0
- package/dist/texture/halftone.js.map +1 -0
- package/dist/texture/honeycomb.d.ts +14 -0
- package/dist/texture/honeycomb.d.ts.map +1 -0
- package/dist/texture/honeycomb.js +43 -0
- package/dist/texture/honeycomb.js.map +1 -0
- package/dist/texture/index.d.ts.map +1 -1
- package/dist/texture/index.js +44 -8
- package/dist/texture/index.js.map +1 -1
- package/dist/texture/moire.d.ts +18 -0
- package/dist/texture/moire.d.ts.map +1 -0
- package/dist/texture/moire.js +44 -0
- package/dist/texture/moire.js.map +1 -0
- package/dist/texture/pattern.d.ts +10 -0
- package/dist/texture/pattern.d.ts.map +1 -1
- package/dist/texture/pattern.js +37 -15
- package/dist/texture/pattern.js.map +1 -1
- package/dist/texture/rays.d.ts +13 -0
- package/dist/texture/rays.d.ts.map +1 -0
- package/dist/texture/rays.js +36 -0
- package/dist/texture/rays.js.map +1 -0
- package/dist/texture/resolve.d.ts +5 -4
- package/dist/texture/resolve.d.ts.map +1 -1
- package/dist/texture/resolve.js +5 -4
- package/dist/texture/resolve.js.map +1 -1
- package/dist/texture/scallops.d.ts +14 -0
- package/dist/texture/scallops.d.ts.map +1 -0
- package/dist/texture/scallops.js +29 -0
- package/dist/texture/scallops.js.map +1 -0
- package/dist/texture/tile.d.ts +14 -0
- package/dist/texture/tile.d.ts.map +1 -0
- package/dist/texture/tile.js +23 -0
- package/dist/texture/tile.js.map +1 -0
- package/dist/texture/topographic/contours.d.ts +13 -0
- package/dist/texture/topographic/contours.d.ts.map +1 -0
- package/dist/texture/topographic/contours.js +72 -0
- package/dist/texture/topographic/contours.js.map +1 -0
- package/dist/texture/topographic/field.d.ts +8 -0
- package/dist/texture/topographic/field.d.ts.map +1 -0
- package/dist/texture/topographic/field.js +29 -0
- package/dist/texture/topographic/field.js.map +1 -0
- package/dist/texture/topographic/index.d.ts +17 -0
- package/dist/texture/topographic/index.d.ts.map +1 -0
- package/dist/texture/topographic/index.js +48 -0
- package/dist/texture/topographic/index.js.map +1 -0
- package/dist/texture/waves.d.ts +18 -0
- package/dist/texture/waves.d.ts.map +1 -0
- package/dist/texture/waves.js +55 -0
- package/dist/texture/waves.js.map +1 -0
- package/dist/theme/presets.d.ts +13 -5
- package/dist/theme/presets.d.ts.map +1 -1
- package/dist/theme/presets.js +16 -5
- package/dist/theme/presets.js.map +1 -1
- package/dist/types.d.ts +256 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/validate/collect.d.ts.map +1 -1
- package/dist/validate/collect.js +2 -1
- package/dist/validate/collect.js.map +1 -1
- package/dist/validate/keys.d.ts +41 -2
- package/dist/validate/keys.d.ts.map +1 -1
- package/dist/validate/keys.js +141 -4
- package/dist/validate/keys.js.map +1 -1
- package/dist/validate/texture.d.ts +4 -5
- package/dist/validate/texture.d.ts.map +1 -1
- package/dist/validate/texture.js +11 -16
- package/dist/validate/texture.js.map +1 -1
- package/dist/validate/values.d.ts +6 -0
- package/dist/validate/values.d.ts.map +1 -1
- package/dist/validate/values.js +16 -1
- package/dist/validate/values.js.map +1 -1
- package/package.json +23 -31
- package/dist/highlight/probe.d.ts +0 -4
- package/dist/highlight/probe.d.ts.map +0 -1
- package/dist/highlight/probe.js +0 -4
- package/dist/highlight/probe.js.map +0 -1
- package/dist/jpeg/index.d.ts +0 -10
- package/dist/jpeg/index.d.ts.map +0 -1
- package/dist/jpeg/index.js +0 -2
- package/dist/jpeg/index.js.map +0 -1
- package/dist/render/png.d.ts +0 -20
- package/dist/render/png.d.ts.map +0 -1
- package/dist/render/png.js +0 -29
- package/dist/render/png.js.map +0 -1
- package/dist/stamp/chunk.d.ts +0 -14
- package/dist/stamp/chunk.d.ts.map +0 -1
- package/dist/stamp/chunk.js +0 -38
- package/dist/stamp/chunk.js.map +0 -1
- package/dist/templates/code/ellipsis.d.ts +0 -3
- package/dist/templates/code/ellipsis.d.ts.map +0 -1
- package/dist/templates/code/ellipsis.js +0 -3
- package/dist/templates/code/ellipsis.js.map +0 -1
- package/dist/templates/terminal/window.d.ts.map +0 -1
- package/dist/templates/terminal/window.js +0 -84
- 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,I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