@kensio/colophon 2.11.1 → 2.13.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 +4 -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/config/defaults.d.ts +24 -0
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +29 -0
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -1
- package/dist/config/index.js.map +1 -1
- package/dist/config/size.d.ts.map +1 -1
- package/dist/config/size.js +3 -0
- package/dist/config/size.js.map +1 -1
- package/dist/layout/fill.d.ts +32 -0
- package/dist/layout/fill.d.ts.map +1 -0
- package/dist/layout/fill.js +34 -0
- package/dist/layout/fill.js.map +1 -0
- package/dist/layout/index.d.ts +4 -2
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +2 -1
- package/dist/layout/index.js.map +1 -1
- package/dist/measure/faces.d.ts.map +1 -1
- package/dist/measure/faces.js.map +1 -1
- package/dist/render/svg.js +1 -1
- package/dist/render/svg.js.map +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/index.d.ts +1 -0
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +3 -0
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/terminal/index.js +4 -4
- package/dist/templates/terminal/index.js.map +1 -1
- package/dist/templates/thumbnail/index.d.ts +21 -0
- package/dist/templates/thumbnail/index.d.ts.map +1 -0
- package/dist/templates/thumbnail/index.js +68 -0
- package/dist/templates/thumbnail/index.js.map +1 -0
- package/dist/templates/thumbnail/lines.d.ts +38 -0
- package/dist/templates/thumbnail/lines.d.ts.map +1 -0
- package/dist/templates/thumbnail/lines.js +76 -0
- package/dist/templates/thumbnail/lines.js.map +1 -0
- 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/text/fill.d.ts +34 -0
- package/dist/text/fill.d.ts.map +1 -0
- package/dist/text/fill.js +57 -0
- package/dist/text/fill.js.map +1 -0
- package/dist/text/fit.d.ts.map +1 -1
- package/dist/text/fit.js +2 -6
- package/dist/text/fit.js.map +1 -1
- package/dist/text/index.d.ts +2 -0
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.js +1 -0
- package/dist/text/index.js.map +1 -1
- package/dist/text/step.d.ts +13 -0
- package/dist/text/step.d.ts.map +1 -0
- package/dist/text/step.js +17 -0
- package/dist/text/step.js.map +1 -0
- package/dist/text/unbroken.d.ts +22 -0
- package/dist/text/unbroken.d.ts.map +1 -0
- package/dist/text/unbroken.js +29 -0
- package/dist/text/unbroken.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/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 +15 -4
- package/dist/texture/index.d.ts.map +1 -1
- package/dist/texture/index.js +64 -14
- 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 +36 -13
- 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 +10 -0
- package/dist/texture/resolve.d.ts.map +1 -1
- package/dist/texture/resolve.js +15 -0
- 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/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 +259 -3
- 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 +37 -0
- package/dist/validate/keys.d.ts.map +1 -1
- package/dist/validate/keys.js +132 -2
- 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 -20
- 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 +3 -10
- 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
package/dist/validate/keys.js
CHANGED
|
@@ -15,6 +15,7 @@ export const configKeys = knownKeys({
|
|
|
15
15
|
colors: true,
|
|
16
16
|
background: true,
|
|
17
17
|
texture: true,
|
|
18
|
+
textureScale: true,
|
|
18
19
|
fonts: true,
|
|
19
20
|
systemFonts: true,
|
|
20
21
|
fontFamily: true,
|
|
@@ -67,9 +68,7 @@ export const customPlacementKeys = knownKeys({
|
|
|
67
68
|
* point of it.
|
|
68
69
|
*/
|
|
69
70
|
export const placementStrategies = knownKeys({
|
|
70
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
71
71
|
"beside-content": true,
|
|
72
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
73
72
|
"public-dir": true,
|
|
74
73
|
custom: true,
|
|
75
74
|
});
|
|
@@ -111,6 +110,21 @@ export const codeKeys = knownKeys({
|
|
|
111
110
|
cornerScale: true,
|
|
112
111
|
maxFontScale: true,
|
|
113
112
|
minFontScale: true,
|
|
113
|
+
lineNumbers: true,
|
|
114
|
+
chrome: true,
|
|
115
|
+
panelOpacity: true,
|
|
116
|
+
borderColor: true,
|
|
117
|
+
borderOpacity: true,
|
|
118
|
+
});
|
|
119
|
+
/**
|
|
120
|
+
* The window chrome styles, as values, for the reason {@link backgroundTypes}
|
|
121
|
+
* are: the template draws anything it does not recognise as a bar with the
|
|
122
|
+
* neutral buttons, so a mistyped `macOS` would quietly lose the traffic lights.
|
|
123
|
+
*/
|
|
124
|
+
export const codeChromeStyles = knownKeys({
|
|
125
|
+
none: true,
|
|
126
|
+
mono: true,
|
|
127
|
+
macos: true,
|
|
114
128
|
});
|
|
115
129
|
/** One output size, including the overrides it may carry. */
|
|
116
130
|
export const sizeKeys = knownKeys({
|
|
@@ -121,6 +135,7 @@ export const sizeKeys = knownKeys({
|
|
|
121
135
|
colors: true,
|
|
122
136
|
background: true,
|
|
123
137
|
texture: true,
|
|
138
|
+
textureScale: true,
|
|
124
139
|
fontFamily: true,
|
|
125
140
|
footer: true,
|
|
126
141
|
badge: true,
|
|
@@ -239,6 +254,7 @@ export const rulesTextureKeys = knownKeys({
|
|
|
239
254
|
width: true,
|
|
240
255
|
gap: true,
|
|
241
256
|
angle: true,
|
|
257
|
+
cross: true,
|
|
242
258
|
});
|
|
243
259
|
/** Keys of the rings drawn in from either side. */
|
|
244
260
|
export const wavesTextureKeys = knownKeys({
|
|
@@ -248,6 +264,111 @@ export const wavesTextureKeys = knownKeys({
|
|
|
248
264
|
width: true,
|
|
249
265
|
gap: true,
|
|
250
266
|
});
|
|
267
|
+
/** Keys of the fan of straight lines. */
|
|
268
|
+
export const raysTextureKeys = knownKeys({
|
|
269
|
+
type: true,
|
|
270
|
+
color: true,
|
|
271
|
+
opacity: true,
|
|
272
|
+
width: true,
|
|
273
|
+
count: true,
|
|
274
|
+
x: true,
|
|
275
|
+
y: true,
|
|
276
|
+
});
|
|
277
|
+
/** Keys of the two crossed grids. */
|
|
278
|
+
export const moireTextureKeys = knownKeys({
|
|
279
|
+
type: true,
|
|
280
|
+
color: true,
|
|
281
|
+
opacity: true,
|
|
282
|
+
width: true,
|
|
283
|
+
gap: true,
|
|
284
|
+
angle: true,
|
|
285
|
+
});
|
|
286
|
+
/** Keys of squared paper. */
|
|
287
|
+
export const gridTextureKeys = knownKeys({
|
|
288
|
+
type: true,
|
|
289
|
+
color: true,
|
|
290
|
+
opacity: true,
|
|
291
|
+
width: true,
|
|
292
|
+
gap: true,
|
|
293
|
+
major: true,
|
|
294
|
+
});
|
|
295
|
+
/** Keys of the grid of crosses. */
|
|
296
|
+
export const crossesTextureKeys = knownKeys({
|
|
297
|
+
type: true,
|
|
298
|
+
color: true,
|
|
299
|
+
opacity: true,
|
|
300
|
+
size: true,
|
|
301
|
+
width: true,
|
|
302
|
+
gap: true,
|
|
303
|
+
});
|
|
304
|
+
/** Keys of the rows of chevrons. */
|
|
305
|
+
export const chevronsTextureKeys = knownKeys({
|
|
306
|
+
type: true,
|
|
307
|
+
color: true,
|
|
308
|
+
opacity: true,
|
|
309
|
+
width: true,
|
|
310
|
+
gap: true,
|
|
311
|
+
});
|
|
312
|
+
/** Keys of the honeycomb. */
|
|
313
|
+
export const honeycombTextureKeys = knownKeys({
|
|
314
|
+
type: true,
|
|
315
|
+
color: true,
|
|
316
|
+
opacity: true,
|
|
317
|
+
width: true,
|
|
318
|
+
size: true,
|
|
319
|
+
});
|
|
320
|
+
/** Keys of the fish scales. */
|
|
321
|
+
export const scallopsTextureKeys = knownKeys({
|
|
322
|
+
type: true,
|
|
323
|
+
color: true,
|
|
324
|
+
opacity: true,
|
|
325
|
+
width: true,
|
|
326
|
+
size: true,
|
|
327
|
+
});
|
|
328
|
+
/** Keys of the growing dots. */
|
|
329
|
+
export const halftoneTextureKeys = knownKeys({
|
|
330
|
+
type: true,
|
|
331
|
+
color: true,
|
|
332
|
+
opacity: true,
|
|
333
|
+
size: true,
|
|
334
|
+
gap: true,
|
|
335
|
+
angle: true,
|
|
336
|
+
from: true,
|
|
337
|
+
});
|
|
338
|
+
/** Keys of the contour lines. */
|
|
339
|
+
export const topographicTextureKeys = knownKeys({
|
|
340
|
+
type: true,
|
|
341
|
+
color: true,
|
|
342
|
+
opacity: true,
|
|
343
|
+
width: true,
|
|
344
|
+
gap: true,
|
|
345
|
+
relief: true,
|
|
346
|
+
seed: true,
|
|
347
|
+
});
|
|
348
|
+
/**
|
|
349
|
+
* The keys each treatment accepts, by the name it declares.
|
|
350
|
+
*
|
|
351
|
+
* A table rather than a chain of `if`s in `checkTexture`, which had a branch
|
|
352
|
+
* per texture and there are ten of them. It lives here, beside the lists it is
|
|
353
|
+
* made of, because it is one more list rather than a piece of checking. The
|
|
354
|
+
* type is what stops it going stale: a treatment added to `Texture` with no
|
|
355
|
+
* entry here fails to compile.
|
|
356
|
+
*/
|
|
357
|
+
export const textureKeysByType = {
|
|
358
|
+
grain: grainTextureKeys,
|
|
359
|
+
dots: dotsTextureKeys,
|
|
360
|
+
rules: rulesTextureKeys,
|
|
361
|
+
grid: gridTextureKeys,
|
|
362
|
+
crosses: crossesTextureKeys,
|
|
363
|
+
chevrons: chevronsTextureKeys,
|
|
364
|
+
honeycomb: honeycombTextureKeys,
|
|
365
|
+
moire: moireTextureKeys,
|
|
366
|
+
waves: wavesTextureKeys,
|
|
367
|
+
rays: raysTextureKeys,
|
|
368
|
+
scallops: scallopsTextureKeys,
|
|
369
|
+
halftone: halftoneTextureKeys,
|
|
370
|
+
topographic: topographicTextureKeys,
|
|
371
|
+
};
|
|
251
372
|
/**
|
|
252
373
|
* The texture variants, as values, for the reason {@link backgroundTypes} are:
|
|
253
374
|
* they have different keys, so a mistyped `type` has to be reported as itself
|
|
@@ -258,6 +379,15 @@ export const textureTypes = knownKeys({
|
|
|
258
379
|
dots: true,
|
|
259
380
|
rules: true,
|
|
260
381
|
waves: true,
|
|
382
|
+
rays: true,
|
|
383
|
+
moire: true,
|
|
384
|
+
grid: true,
|
|
385
|
+
crosses: true,
|
|
386
|
+
chevrons: true,
|
|
387
|
+
honeycomb: true,
|
|
388
|
+
scallops: true,
|
|
389
|
+
halftone: true,
|
|
390
|
+
topographic: true,
|
|
261
391
|
});
|
|
262
392
|
/**
|
|
263
393
|
* The output formats, as values, for the reason {@link backgroundTypes} are:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../src/validate/keys.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../src/validate/keys.ts"],"names":[],"mappings":"AAqBA;;;;;;;GAOG;AACH,SAAS,SAAS,CAAI,KAA4B;IAChD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAkCD,gCAAgC;AAChC,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAiB;IAClD,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,IAAI;IACb,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,IAAI;IACX,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,IAAI;IACf,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,gBAAgB,EAAE,IAAI;IACtB,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,IAAI;CACZ,CAAC,CAAC;AAEH,kEAAkE;AAClE,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAkB;IAC1D,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,IAAI;CACX,CAAC,CAAC;AAEH,kEAAkE;AAClE,MAAM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AAEJ;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAmC;IACtE,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,IAAI;CAClB,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAgC;IACpE,GAAG,EAAE,IAAI;IACT,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;CACX,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAgC;IACrE,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,IAAI;CACZ,CAAC,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Check a texture against the keys of whichever treatment it declares.
|
|
3
3
|
*
|
|
4
|
-
* The same reasoning as a background's: `
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* keys were meant.
|
|
4
|
+
* The same reasoning as a background's: a mistyped `type` has to be reported
|
|
5
|
+
* as itself rather than as a list of keys that do not apply. A texture with no
|
|
6
|
+
* `type` is left to the type checker, since without one there is no telling
|
|
7
|
+
* which keys were meant.
|
|
9
8
|
*/
|
|
10
9
|
export declare function checkTexture(texture: unknown, path: string, problems: string[]): void;
|
|
11
10
|
//# sourceMappingURL=texture.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"texture.d.ts","sourceRoot":"","sources":["../../src/validate/texture.ts"],"names":[],"mappings":"AAUA
|
|
1
|
+
{"version":3,"file":"texture.d.ts","sourceRoot":"","sources":["../../src/validate/texture.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAAE,GACjB,IAAI,CAiBN"}
|
package/dist/validate/texture.js
CHANGED
|
@@ -1,34 +1,25 @@
|
|
|
1
1
|
import { checkKeys, isRecord } from "./check.js";
|
|
2
|
-
import {
|
|
2
|
+
import { textureKeysByType, textureTypes } from "./keys.js";
|
|
3
3
|
import { describeUnknownValue } from "./values.js";
|
|
4
|
+
/** Whether a declared type is one of the treatments there are. */
|
|
5
|
+
function isTextureType(type) {
|
|
6
|
+
return typeof type === "string" && type in textureKeysByType;
|
|
7
|
+
}
|
|
4
8
|
/**
|
|
5
9
|
* Check a texture against the keys of whichever treatment it declares.
|
|
6
10
|
*
|
|
7
|
-
* The same reasoning as a background's: `
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* keys were meant.
|
|
11
|
+
* The same reasoning as a background's: a mistyped `type` has to be reported
|
|
12
|
+
* as itself rather than as a list of keys that do not apply. A texture with no
|
|
13
|
+
* `type` is left to the type checker, since without one there is no telling
|
|
14
|
+
* which keys were meant.
|
|
12
15
|
*/
|
|
13
16
|
export function checkTexture(texture, path, problems) {
|
|
14
17
|
if (!isRecord(texture)) {
|
|
15
18
|
return;
|
|
16
19
|
}
|
|
17
20
|
const { type } = texture;
|
|
18
|
-
if (type
|
|
19
|
-
checkKeys(texture, path,
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (type === "dots") {
|
|
23
|
-
checkKeys(texture, path, dotsTextureKeys, problems);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
if (type === "rules") {
|
|
27
|
-
checkKeys(texture, path, rulesTextureKeys, problems);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (type === "waves") {
|
|
31
|
-
checkKeys(texture, path, wavesTextureKeys, problems);
|
|
21
|
+
if (isTextureType(type)) {
|
|
22
|
+
checkKeys(texture, path, textureKeysByType[type], problems);
|
|
32
23
|
return;
|
|
33
24
|
}
|
|
34
25
|
if (typeof type === "string") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"texture.js","sourceRoot":"","sources":["../../src/validate/texture.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"texture.js","sourceRoot":"","sources":["../../src/validate/texture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,kEAAkE;AAClE,SAAS,aAAa,CAAC,IAAa;IAClC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,IAAI,iBAAiB,CAAC;AAC/D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,OAAgB,EAChB,IAAY,EACZ,QAAkB;IAElB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACvB,OAAO;IACT,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEzB,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;QAC5D,OAAO;IACT,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,QAAQ,CAAC,IAAI,CACX,oBAAoB,CAAC,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,CAAC,CAClE,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -8,6 +8,12 @@ export declare function describeUnknownValue(noun: string, plural: string, value
|
|
|
8
8
|
* anything else is a shape the type checker already covers, as elsewhere here.
|
|
9
9
|
*/
|
|
10
10
|
export declare function checkSlugStrategy(content: unknown, problems: string[]): void;
|
|
11
|
+
/**
|
|
12
|
+
* Check the window chrome names one of the three there are. A name the
|
|
13
|
+
* template does not know draws the neutral bar, so `macOS` would silently be
|
|
14
|
+
* the wrong window rather than a build that says so.
|
|
15
|
+
*/
|
|
16
|
+
export declare function checkCodeChrome(code: unknown, problems: string[]): void;
|
|
11
17
|
/**
|
|
12
18
|
* Check the output format names one the encoder has. `jpg` is the spelling
|
|
13
19
|
* people reach for, and the suggestion is what turns it into `jpeg` rather than
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../src/validate/values.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,MAAM,CAMR;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAmB5E;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAQrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAUnE"}
|
|
1
|
+
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../src/validate/values.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,MAAM,CAMR;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAmB5E;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAcvE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAQrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAUnE"}
|
package/dist/validate/values.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { themeNames } from "../theme/index.js";
|
|
2
2
|
import { isRecord } from "./check.js";
|
|
3
|
-
import { outputFormats, slugStrategies } from "./keys.js";
|
|
3
|
+
import { codeChromeStyles, outputFormats, slugStrategies } from "./keys.js";
|
|
4
4
|
import { nearestName } from "./suggest.js";
|
|
5
5
|
/**
|
|
6
6
|
* Report a value that is not one of the names a field accepts. `noun` names
|
|
@@ -26,6 +26,21 @@ export function checkSlugStrategy(content, problems) {
|
|
|
26
26
|
}
|
|
27
27
|
problems.push(describeUnknownValue("slug strategy", "strategies", strategy, slugStrategies));
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Check the window chrome names one of the three there are. A name the
|
|
31
|
+
* template does not know draws the neutral bar, so `macOS` would silently be
|
|
32
|
+
* the wrong window rather than a build that says so.
|
|
33
|
+
*/
|
|
34
|
+
export function checkCodeChrome(code, problems) {
|
|
35
|
+
if (!isRecord(code)) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const chrome = code["chrome"];
|
|
39
|
+
if (typeof chrome !== "string" || codeChromeStyles.includes(chrome)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
problems.push(describeUnknownValue("window chrome", "styles", chrome, codeChromeStyles));
|
|
43
|
+
}
|
|
29
44
|
/**
|
|
30
45
|
* Check the output format names one the encoder has. `jpg` is the spelling
|
|
31
46
|
* people reach for, and the suggestion is what turns it into `jpeg` rather than
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../src/validate/values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../src/validate/values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAY,EACZ,MAAc,EACd,KAAa,EACb,KAAwB;IAExB,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAE7C,OAAO,UAAU,KAAK,SAAS;QAC7B,CAAC,CAAC,WAAW,IAAI,KAAK,KAAK,YAAY,MAAM,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;QACrE,CAAC,CAAC,WAAW,IAAI,KAAK,KAAK,oBAAoB,UAAU,IAAI,CAAC;AAClE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAgB,EAAE,QAAkB;IACpE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;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AAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACvD,OAAO;IACT,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AACvE,CAAC"}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"repository": "https://github.com/KensioSoftware/colophon",
|
|
6
6
|
"homepage": "https://github.com/KensioSoftware/colophon#readme",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
|
-
"version": "2.
|
|
8
|
+
"version": "2.13.0",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"main": "./dist/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"build": "tsc -p tsconfig.build.json",
|
|
61
61
|
"prepack": "pnpm build",
|
|
62
62
|
"build:check": "tsc -p tsconfig.json --noEmit",
|
|
63
|
-
"fmt": "oxlint --fix &&
|
|
64
|
-
"lint": "
|
|
63
|
+
"fmt": "oxlint --fix && oxfmt",
|
|
64
|
+
"lint": "oxlint && oxfmt --check",
|
|
65
65
|
"test": "vitest run",
|
|
66
66
|
"test:coverage": "vitest run --coverage",
|
|
67
67
|
"samples": "pnpm build && node scripts/gen-samples.ts",
|
|
@@ -86,25 +86,18 @@
|
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@kensio/smartass": "^1.33.0",
|
|
88
88
|
"@semantic-release/exec": "7.1.0",
|
|
89
|
-
"@types/eslint-plugin-security": "^3.0.1",
|
|
90
89
|
"@types/fontkit": "^2.0.9",
|
|
91
90
|
"@types/node": "^26.0.0",
|
|
92
91
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
93
92
|
"@vitest/coverage-v8": "^4.1.10",
|
|
94
93
|
"conventional-changelog-conventionalcommits": "9.3.1",
|
|
95
94
|
"dejavu-fonts-ttf": "^2.37.3",
|
|
96
|
-
"eslint": "^10.6.0",
|
|
97
|
-
"eslint-plugin-jsdoc": "^63.0.13",
|
|
98
|
-
"eslint-plugin-no-secrets": "^2.3.3",
|
|
99
|
-
"eslint-plugin-security": "^4.0.1",
|
|
100
95
|
"fta-cli": "^3.0.0",
|
|
101
|
-
"jiti": "^2.7.0",
|
|
102
96
|
"oxfmt": "^0.62.0",
|
|
103
97
|
"oxlint": "^1.77.0",
|
|
104
98
|
"oxlint-tsgolint": "^7.0.2001",
|
|
105
99
|
"semantic-release": "25.0.9",
|
|
106
100
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
107
|
-
"typescript-eslint": "^8.63.0",
|
|
108
101
|
"vitest": "^4.1.10"
|
|
109
102
|
},
|
|
110
103
|
"dependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../../src/templates/terminal/window.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAiB9C,2DAA2D;AAC3D,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAErD;AAwBD;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,KAAK,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,WAAW,GACnB,MAAM,CA6BR"}
|
|
@@ -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 @@
|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