@brunosouzas/signwright 0.0.0-stage → 0.19.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 (76) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +15 -0
  3. package/README.md +567 -2
  4. package/dist/scripts/cover.d.ts +29 -0
  5. package/dist/scripts/cover.js +186 -0
  6. package/dist/src/fonts/embed.d.ts +7 -0
  7. package/dist/src/fonts/embed.js +221 -0
  8. package/dist/src/pieces/bank-objects.d.ts +12 -0
  9. package/dist/src/pieces/bank-objects.js +52 -0
  10. package/dist/src/pieces/brand-cast.d.ts +105 -0
  11. package/dist/src/pieces/brand-cast.js +221 -0
  12. package/dist/src/pieces/brand-notation-icons.d.ts +12 -0
  13. package/dist/src/pieces/brand-notation-icons.js +79 -0
  14. package/dist/src/pieces/category-icon.d.ts +12 -0
  15. package/dist/src/pieces/category-icon.js +55 -0
  16. package/dist/src/pieces/cover.d.ts +138 -0
  17. package/dist/src/pieces/cover.js +635 -0
  18. package/dist/src/pieces/diagram.d.ts +141 -0
  19. package/dist/src/pieces/diagram.js +201 -0
  20. package/dist/src/pieces/eip-icons.d.ts +12 -0
  21. package/dist/src/pieces/eip-icons.js +468 -0
  22. package/dist/src/pieces/emote.d.ts +13 -0
  23. package/dist/src/pieces/emote.js +88 -0
  24. package/dist/src/pieces/headline.d.ts +11 -0
  25. package/dist/src/pieces/headline.js +37 -0
  26. package/dist/src/pieces/index.d.ts +17 -0
  27. package/dist/src/pieces/index.js +20 -0
  28. package/dist/src/pieces/ink.d.ts +71 -0
  29. package/dist/src/pieces/ink.js +57 -0
  30. package/dist/src/pieces/keyboard.d.ts +9 -0
  31. package/dist/src/pieces/keyboard.js +33 -0
  32. package/dist/src/pieces/library.d.ts +320 -0
  33. package/dist/src/pieces/library.js +355 -0
  34. package/dist/src/pieces/link-icons.d.ts +23 -0
  35. package/dist/src/pieces/link-icons.js +101 -0
  36. package/dist/src/pieces/metro.d.ts +137 -0
  37. package/dist/src/pieces/metro.js +288 -0
  38. package/dist/src/pieces/node.d.ts +29 -0
  39. package/dist/src/pieces/node.js +56 -0
  40. package/dist/src/pieces/paper.d.ts +31 -0
  41. package/dist/src/pieces/paper.js +72 -0
  42. package/dist/src/pieces/params.d.ts +84 -0
  43. package/dist/src/pieces/params.js +158 -0
  44. package/dist/src/pieces/piece.d.ts +9 -0
  45. package/dist/src/pieces/piece.js +28 -0
  46. package/dist/src/pieces/pose.d.ts +16 -0
  47. package/dist/src/pieces/pose.js +30 -0
  48. package/dist/src/pieces/question-token.d.ts +9 -0
  49. package/dist/src/pieces/question-token.js +49 -0
  50. package/dist/src/pieces/react.d.ts +4 -0
  51. package/dist/src/pieces/react.js +13 -0
  52. package/dist/src/pieces/render.d.ts +2 -0
  53. package/dist/src/pieces/render.js +22 -0
  54. package/dist/src/pieces/skin.d.ts +22 -0
  55. package/dist/src/pieces/skin.js +13 -0
  56. package/dist/src/pieces/stamp.d.ts +11 -0
  57. package/dist/src/pieces/stamp.js +29 -0
  58. package/dist/src/pieces/supporting-cast.d.ts +35 -0
  59. package/dist/src/pieces/supporting-cast.js +168 -0
  60. package/dist/src/pieces/symbol.d.ts +13 -0
  61. package/dist/src/pieces/symbol.js +27 -0
  62. package/dist/src/pieces/ui-icons.d.ts +21 -0
  63. package/dist/src/pieces/ui-icons.js +35 -0
  64. package/dist/tokens/generated/tokens.d.ts +299 -0
  65. package/dist/tokens/generated/tokens.js +299 -0
  66. package/fonts/OFL.txt +97 -0
  67. package/fonts/SourceCodePro-Bold.ttf +0 -0
  68. package/fonts/SourceCodePro-Regular.ttf +0 -0
  69. package/fonts/SourceSans3-Black.ttf +0 -0
  70. package/fonts/SourceSans3-Bold.ttf +0 -0
  71. package/fonts/SourceSans3-Regular.ttf +0 -0
  72. package/fonts/SourceSerif4-Bold.ttf +0 -0
  73. package/package.json +88 -4
  74. package/tokens/generated/tokens.css +215 -0
  75. package/tokens/generated/tokens.json +298 -0
  76. package/tokens/generated/tokens.ts +302 -0
@@ -0,0 +1,11 @@
1
+ import { type SurfaceName } from "./ink.ts";
2
+ export type HeadlineParams = {
3
+ x: number;
4
+ y: number;
5
+ lines: string[];
6
+ size?: number;
7
+ anchor?: "start" | "middle" | "end";
8
+ surface?: SurfaceName;
9
+ };
10
+ /** One to four lines of a title in Source Serif 4 Bold, the first baseline at (x, y). */
11
+ export declare const headline: import("./piece.ts").Piece<HeadlineParams>;
@@ -0,0 +1,37 @@
1
+ // A title in the brand's serif (change headline-piece, card 307; studio
2
+ // decision I9: Source Serif 4 for titles). The default share image of
3
+ // brunosouzas.com is its first use: the slogan in three lines on an `og` image.
4
+ //
5
+ // Like `edgeLabel`, it draws nothing in `body`: its group is `text`, which a
6
+ // cover-frame format writes in the labels group, outside the ink-outlined
7
+ // group, so no stroke reaches the letters. One `g` carries every shared
8
+ // attribute (overriding the labels group's size, weight, fill and anchor), and
9
+ // one `text` per line carries only its position. Values match the approved
10
+ // preview: −0.01 em tracking, written in user units, and a 1.1 × size step.
11
+ import { tokens } from "../../tokens/generated/tokens.js";
12
+ import { surfaceParam } from "./ink.js";
13
+ import { drawn, el, g, r2 } from "./node.js";
14
+ import { label, num, pos } from "./params.js";
15
+ import { definePiece } from "./piece.js";
16
+ /** Line step as a share of the size. */
17
+ const LEADING = 1.1;
18
+ const drawHeadline = ({ x, y, lines, size = 64, anchor = "start", surface = "light" }) => drawn([], [
19
+ g({
20
+ "data-piece": "headline",
21
+ "font-family": tokens.font.serif,
22
+ "font-size": size,
23
+ "font-weight": tokens.font.weightBold,
24
+ "letter-spacing": r2(-size / 100),
25
+ fill: tokens.brand[surface].text,
26
+ "text-anchor": anchor,
27
+ }, ...lines.map((line, i) => el("text", { x, y: r2(y + i * LEADING * size) }, line))),
28
+ ]);
29
+ /** One to four lines of a title in Source Serif 4 Bold, the first baseline at (x, y). */
30
+ export const headline = definePiece("headline", {
31
+ x: pos(),
32
+ y: pos(),
33
+ lines: { kind: "array", required: true, minItems: 1, maxItems: 4, of: label() },
34
+ size: num({ min: 24, max: 160, integer: true }),
35
+ anchor: { kind: "enum", values: ["start", "middle", "end"] },
36
+ surface: surfaceParam,
37
+ }, drawHeadline);
@@ -0,0 +1,17 @@
1
+ export { SVG_TAGS, drawn, el, g, shadowed, type AttrValue, type Attrs, type Drawn, type SvgNode, type SvgTag } from "./node.ts";
2
+ export { toSvg } from "./render.ts";
3
+ export { pose, type Pose } from "./pose.ts";
4
+ export { COLOUR_TOKENS, DATA_COLOUR, MAX_ITEMS, paint, MAX_SIZE, checkParams, colour, isColourLiteral, type ParamSpec, type Problem, type Schema } from "./params.ts";
5
+ export { definePiece, type Piece } from "./piece.ts";
6
+ export * from "./library.ts";
7
+ export { EIP_ICONS, EIP_ICON_NAMES, EIP_ICON_HEIGHT, EIP_ICON_WIDTH, type EipIcon } from "./eip-icons.ts";
8
+ export { FORMATS, LANGUAGE, LINKEDIN_PHOTO_MARGIN, LINKEDIN_PHOTO_ZONES, SAFE_ID, backgroundNames, bannerRingCount, comparePaths, coverTree, diagramRings, validateCoverSpec, type CoverFormat, type CoverOptions, type CoverPiece, type CoverRings, type CoverSpec, type CustomNode, type LinkedinPhotoZone } from "./cover.ts";
9
+ export { tokens, type Tokens } from "../../tokens/generated/tokens.ts";
10
+ export { EMOTE_KINDS, type EmoteKind, type EmoteParams } from "./emote.ts";
11
+ export { CAST_EXPRESSIONS, CAST_VIEWS, VISOR_FACINGS, type CastExpression, type CastView, type HeldSheet, type MiraParams, type VisorParams, type VisorFacing, type VisorHeldSheet, type DroneParams, type KiuParams, type SinalParams } from "./brand-cast.ts";
12
+ export { CAST_FACINGS, type CastFacing } from "./supporting-cast.ts";
13
+ export { BANK_OBJECT_NAMES, type BankObjectName, type BankObjectParams } from "./bank-objects.ts";
14
+ export { type SymbolParams } from "./symbol.ts";
15
+ export { BRAND_NOTATION_ICON_NAMES, type BrandNotationIconName, type BrandNotationIconParams } from "./brand-notation-icons.ts";
16
+ export { CATEGORY_ICON_NAMES, type CategoryIconName, type CategoryIconParams } from "./category-icon.ts";
17
+ export { type QuestionTokenParams } from "./question-token.ts";
@@ -0,0 +1,20 @@
1
+ // Public entry point of the package (`@brunosouzas/signwright`): the
2
+ // illustration pieces, the node contract, the SVG renderer, pose and the cover
3
+ // spec helpers. No React here: the React renderer is the separate entry
4
+ // `@brunosouzas/signwright/react`, so a consumer without React can import
5
+ // this one.
6
+ export { SVG_TAGS, drawn, el, g, shadowed } from "./node.js";
7
+ export { toSvg } from "./render.js";
8
+ export { pose } from "./pose.js";
9
+ export { COLOUR_TOKENS, DATA_COLOUR, MAX_ITEMS, paint, MAX_SIZE, checkParams, colour, isColourLiteral } from "./params.js";
10
+ export { definePiece } from "./piece.js";
11
+ export * from "./library.js";
12
+ export { EIP_ICONS, EIP_ICON_NAMES, EIP_ICON_HEIGHT, EIP_ICON_WIDTH } from "./eip-icons.js";
13
+ export { FORMATS, LANGUAGE, LINKEDIN_PHOTO_MARGIN, LINKEDIN_PHOTO_ZONES, SAFE_ID, backgroundNames, bannerRingCount, comparePaths, coverTree, diagramRings, validateCoverSpec } from "./cover.js";
14
+ export { tokens } from "../../tokens/generated/tokens.js";
15
+ export { EMOTE_KINDS } from "./emote.js";
16
+ export { CAST_EXPRESSIONS, CAST_VIEWS, VISOR_FACINGS } from "./brand-cast.js";
17
+ export { CAST_FACINGS } from "./supporting-cast.js";
18
+ export { BANK_OBJECT_NAMES } from "./bank-objects.js";
19
+ export { BRAND_NOTATION_ICON_NAMES } from "./brand-notation-icons.js";
20
+ export { CATEGORY_ICON_NAMES } from "./category-icon.js";
@@ -0,0 +1,71 @@
1
+ import { type Attrs, type SvgNode } from "./node.ts";
2
+ import type { ParamSpec, Problem, Schema } from "./params.ts";
3
+ export type Point = [number, number];
4
+ export declare const SURFACES: readonly ["light", "dark"];
5
+ export type SurfaceName = (typeof SURFACES)[number];
6
+ export type Ink = {
7
+ surface?: SurfaceName;
8
+ inkScale?: number;
9
+ };
10
+ export declare const surfaceParam: ParamSpec;
11
+ export declare const inkScaleParam: ParamSpec;
12
+ export declare const inkSchema: Schema;
13
+ /** Collects the limits between parameters (piece.ts, `relations`). */
14
+ export declare const limits: (...checks: (Problem | false)[]) => Problem[];
15
+ /**
16
+ * The surface's colours and the ink measures at a scale. `line` is the colour of
17
+ * an ink stroke on the surface's background or on a dark face: ink on light, the
18
+ * surface's muted grey on dark, where ink vanishes (ADR 0009, the cast's rule).
19
+ */
20
+ export declare const inkOf: ({ surface, inkScale }: Ink) => {
21
+ s: {
22
+ readonly backdropCredit: "#ADA79D";
23
+ readonly backdropPark: "#1A241D";
24
+ readonly backdropWater: "#1C2733";
25
+ readonly backdropWaterEdge: "#2A3846";
26
+ readonly background: "#121110";
27
+ readonly grid: "#3B3834";
28
+ readonly muted: "#ADA79D";
29
+ readonly panel: "#1D1C1A";
30
+ readonly rim: "#F1EEE8";
31
+ readonly rimWidth: 0;
32
+ readonly shadow: "#121110";
33
+ readonly text: "#F1EEE8";
34
+ readonly zoneOpacity: 0.22;
35
+ } | {
36
+ readonly backdropCredit: "#5C5852";
37
+ readonly backdropPark: "#D6E4CF";
38
+ readonly backdropWater: "#C7DAEA";
39
+ readonly backdropWaterEdge: "#A9C4DA";
40
+ readonly background: "#F6F3EC";
41
+ readonly grid: "#EDE8DE";
42
+ readonly muted: "#5C5852";
43
+ readonly panel: "#FFFFFF";
44
+ readonly rim: "#F6F3EC";
45
+ readonly rimWidth: 0;
46
+ readonly shadow: "#121212";
47
+ readonly text: "#121212";
48
+ readonly zoneOpacity: 0.12;
49
+ };
50
+ line: "#121212" | "#5C5852" | "#ADA79D";
51
+ outline: number;
52
+ rim: number;
53
+ offset: number;
54
+ };
55
+ /** Outlined shapes need room for their ink: smallest dimension ≥ 4 × outline. */
56
+ export declare const roomFor: (name: string, smallest: number, inkParams: Ink) => Problem | false;
57
+ export declare const atLeast: (name: string, value: number, least: number, what: string) => Problem | false;
58
+ export type Shape = (dx: number, dy: number, attrs: Attrs) => SvgNode;
59
+ /**
60
+ * The ink sticker (metro-and-diagram-pieces design §3): a shadow copy when the
61
+ * offset is above 0 (`map.shadow` is 0 since ADR 0009, so none), a rim when the
62
+ * surface has one (none while `rimWidth` is 0), then the face outlined in the
63
+ * surface's ink line.
64
+ */
65
+ export declare const sticker: (shape: Shape, face: string, inkParams: Ink) => SvgNode[];
66
+ /** Backticks mark code (body-diagram-pieces design §4; the pill since card 190): with an even number of them, each part between backticks becomes a tspan in
67
+ * the monospace stack; empty parts are dropped. With an odd number, the string is drawn as is. */
68
+ export declare const spans: (value: string) => (SvgNode | string)[];
69
+ /** A pill's text length for its default width: backticks of code runs do not count; otherwise `length` as in 0.5.0. */
70
+ export declare const codeLength: (value: string) => number;
71
+ export declare const words: (x: number, y: number, value: string, attrs: Attrs) => SvgNode;
@@ -0,0 +1,57 @@
1
+ // Ink helpers shared by the metro, diagram and body diagram pieces (moved from
2
+ // metro.ts unchanged; change body-diagram-pieces, design §8). Internal: the
3
+ // package does not export this module.
4
+ import { tokens } from "../../tokens/generated/tokens.js";
5
+ import { el, r2 } from "./node.js";
6
+ export const SURFACES = ["light", "dark"];
7
+ const ink = tokens.color.ink;
8
+ const font = tokens.font.sans;
9
+ const M = tokens.map;
10
+ export const surfaceParam = { kind: "enum", values: SURFACES };
11
+ export const inkScaleParam = { kind: "number", min: 0.25, max: 8 };
12
+ export const inkSchema = { surface: surfaceParam, inkScale: inkScaleParam };
13
+ /** Collects the limits between parameters (piece.ts, `relations`). */
14
+ export const limits = (...checks) => checks.filter((check) => check !== false);
15
+ /**
16
+ * The surface's colours and the ink measures at a scale. `line` is the colour of
17
+ * an ink stroke on the surface's background or on a dark face: ink on light, the
18
+ * surface's muted grey on dark, where ink vanishes (ADR 0009, the cast's rule).
19
+ */
20
+ export const inkOf = ({ surface = "light", inkScale = 1 }) => {
21
+ const s = tokens.surface[surface];
22
+ return { s, line: surface === "dark" ? s.muted : ink, outline: M.outline * inkScale, rim: s.rimWidth * inkScale, offset: M.shadow * inkScale };
23
+ };
24
+ /** Outlined shapes need room for their ink: smallest dimension ≥ 4 × outline. */
25
+ export const roomFor = (name, smallest, inkParams) => {
26
+ const need = 4 * inkOf(inkParams).outline;
27
+ return smallest < need && { path: name, message: `leaves no room for the outline: needs at least ${r2(need)} at this ink scale` };
28
+ };
29
+ export const atLeast = (name, value, least, what) => value < least && { path: name, message: `must be at least ${what} (${r2(least)}), found ${r2(value)}` };
30
+ /**
31
+ * The ink sticker (metro-and-diagram-pieces design §3): a shadow copy when the
32
+ * offset is above 0 (`map.shadow` is 0 since ADR 0009, so none), a rim when the
33
+ * surface has one (none while `rimWidth` is 0), then the face outlined in the
34
+ * surface's ink line.
35
+ */
36
+ export const sticker = (shape, face, inkParams) => {
37
+ const { s, line, outline, rim, offset } = inkOf(inkParams);
38
+ const wide = r2(outline + 2 * rim);
39
+ return [
40
+ // Joins are set here, so a sticker draws the same inside any group.
41
+ ...(offset > 0 ? [shape(offset, offset, { fill: s.shadow, stroke: s.shadow, "stroke-width": wide, "stroke-linejoin": "round" })] : []),
42
+ ...(s.rimWidth > 0 ? [shape(0, 0, { fill: s.rim, stroke: s.rim, "stroke-width": wide, "stroke-linejoin": "round" })] : []),
43
+ shape(0, 0, { fill: face, stroke: line, "stroke-width": r2(outline), "stroke-linejoin": "round" }),
44
+ ];
45
+ };
46
+ /** Backticks mark code (body-diagram-pieces design §4; the pill since card 190): with an even number of them, each part between backticks becomes a tspan in
47
+ * the monospace stack; empty parts are dropped. With an odd number, the string is drawn as is. */
48
+ export const spans = (value) => {
49
+ const parts = value.split("`");
50
+ if (parts.length % 2 === 0)
51
+ return [value];
52
+ return parts.flatMap((part, i) => (part === "" ? [] : i % 2 === 1 ? [el("tspan", { "font-family": tokens.font.mono }, part)] : [part]));
53
+ };
54
+ /** A pill's text length for its default width: backticks of code runs do not count; otherwise `length` as in 0.5.0. */
55
+ export const codeLength = (value) => (value.split("`").length % 2 === 1 && value.includes("`") ? value.replace(/`/g, "") : value).length;
56
+ // Every text sets its own anchor, size and weight, so a surrounding group (a cover's label style) does not leak in.
57
+ export const words = (x, y, value, attrs) => el("text", { x: r2(x), y: r2(y), "font-family": font, ...attrs }, value);
@@ -0,0 +1,9 @@
1
+ import { type SurfaceName } from "./ink.ts";
2
+ export type KeyboardParams = {
3
+ x: number;
4
+ y: number;
5
+ width?: number;
6
+ surface?: SurfaceName;
7
+ };
8
+ /** The laptop's base: a white slab outlined in the surface's ink line, with ink key marks. */
9
+ export declare const keyboard: import("./piece.ts").Piece<KeyboardParams>;
@@ -0,0 +1,33 @@
1
+ // The `keyboard` prop piece (spec illustration-pieces, "Keyboard"; change
2
+ // supporting-characters, design §4): the base of a laptop, a white slab with a
3
+ // row of key marks. Chaves types at it (`types`, supporting-cast.ts); a cover
4
+ // can draw it alone, under a `codePanel` as the screen.
5
+ //
6
+ // Why the keys sit in a `stroke: none` group: the cover command wraps every
7
+ // body in an ink-stroked group (cover.ts, the outlined group), so a key with
8
+ // only a fill would take a 4-unit outline there and blur into a blob; the slab
9
+ // carries its own stroke, so the piece draws the same alone, in a cover and in
10
+ // Chaves's hand (as `sheet` keeps its bars).
11
+ //
12
+ // What can go wrong: the schema rejects a width outside 80 to 300, a missing x
13
+ // or y, an unknown surface and any other parameter (no colour, no text), naming it.
14
+ import { tokens } from "../../tokens/generated/tokens.js";
15
+ import { drawn, el, g } from "./node.js";
16
+ import { inkOf, surfaceParam } from "./ink.js";
17
+ import { num, pos } from "./params.js";
18
+ import { definePiece } from "./piece.js";
19
+ /** The slab's height and the key marks' measures (design §4, from the approved concept sheet's deck). */
20
+ const SLAB_HEIGHT = 16;
21
+ const SLAB_RADIUS = 6;
22
+ const KEY = { inset: 16, top: 6, pitch: 21, width: 12, height: 4, radius: 2 };
23
+ /** Key marks that fit the slab: the first `KEY.inset` in, each `KEY.pitch` apart, the last at least `KEY.inset` from the right edge. */
24
+ const keyCount = (width) => Math.floor((width - 2 * KEY.inset - KEY.width) / KEY.pitch) + 1;
25
+ /** The laptop's base: a white slab outlined in the surface's ink line, with ink key marks. */
26
+ export const keyboard = definePiece("keyboard", { x: pos(), y: pos(), width: num({ min: 80, max: 300 }), surface: surfaceParam }, ({ x, y, width = 150, surface = "light" }) => {
27
+ const keys = Array.from({ length: keyCount(width) }, (_, i) =>
28
+ // Marks on a white face stay ink on the dark surface too (ADR 0009).
29
+ el("rect", { x: x + KEY.inset + KEY.pitch * i, y: y + KEY.top, width: KEY.width, height: KEY.height, rx: KEY.radius, fill: tokens.color.ink }));
30
+ return drawn([
31
+ g({ "data-piece": "keyboard" }, el("rect", { x, y, width, height: SLAB_HEIGHT, rx: SLAB_RADIUS, fill: tokens.color.white, stroke: inkOf({ surface }).line, "stroke-width": tokens.outline.block, "stroke-linejoin": "round" }), g({ stroke: "none" }, ...keys)),
32
+ ]);
33
+ });
@@ -0,0 +1,320 @@
1
+ import { emote } from "./emote.ts";
2
+ import { mira, visor, drone, kiu, sinal, type MiraParams, type VisorParams, type DroneParams, type KiuParams, type SinalParams } from "./brand-cast.ts";
3
+ import { bankObject, type BankObjectName, type BankObjectParams } from "./bank-objects.ts";
4
+ import { symbol, type SymbolParams } from "./symbol.ts";
5
+ import { brandNotationIcon, type BrandNotationIconName, type BrandNotationIconParams } from "./brand-notation-icons.ts";
6
+ import { categoryIcon, type CategoryIconParams } from "./category-icon.ts";
7
+ import { headline, type HeadlineParams } from "./headline.ts";
8
+ import { questionToken, type QuestionTokenParams } from "./question-token.ts";
9
+ import { pill, sheet, type PillParams, type SheetParams, type SheetRow } from "./paper.ts";
10
+ import { stamp, type StampParams } from "./stamp.ts";
11
+ import { keyboard, type KeyboardParams } from "./keyboard.ts";
12
+ import { balao, chaves, type BalaoParams, type ChavesParams } from "./supporting-cast.ts";
13
+ export { pill, sheet, stamp, keyboard, balao, chaves };
14
+ export type { PillParams, SheetParams, SheetRow, StampParams, KeyboardParams, BalaoParams, ChavesParams };
15
+ export { emote, mira, visor, drone, kiu, sinal, bankObject, symbol, brandNotationIcon, categoryIcon, headline, questionToken };
16
+ export type { MiraParams, VisorParams, DroneParams, KiuParams, SinalParams, BankObjectName, BankObjectParams, SymbolParams, BrandNotationIconName, BrandNotationIconParams, CategoryIconParams, HeadlineParams, QuestionTokenParams };
17
+ export * from "./metro.ts";
18
+ export * from "./diagram.ts";
19
+ export * from "./ui-icons.ts";
20
+ export * from "./link-icons.ts";
21
+ type Point = [number, number];
22
+ export declare const RING_COUNT = 14;
23
+ /** Most rings one call draws: enough for a banner's farthest corner from any centre a cover spec accepts (548). */
24
+ export declare const MAX_RINGS = 1000;
25
+ export type RingsParams = {
26
+ cx: number;
27
+ cy: number;
28
+ radius?: number;
29
+ color?: string;
30
+ count?: number;
31
+ };
32
+ /** Concentric rings around (cx, cy): `count` rings (14 by default), step and width from the cover tokens. */
33
+ export declare const rings: import("./piece.ts").Piece<RingsParams>;
34
+ declare const CODE_LINE_COLOURS: readonly ["healthy", "caller", "white", "backend"];
35
+ export type CodeLine = {
36
+ indent: number;
37
+ w: number;
38
+ color: (typeof CODE_LINE_COLOURS)[number];
39
+ tall?: boolean;
40
+ };
41
+ export type CodePanelParams = {
42
+ x: number;
43
+ y: number;
44
+ width: number;
45
+ height: number;
46
+ lines: CodeLine[];
47
+ top?: number;
48
+ step?: number;
49
+ };
50
+ /** Dark code panel with neutral lines; a tall line, the one under review, takes the accent (ADR 0009). */
51
+ export declare const codePanel: import("./piece.ts").Piece<CodePanelParams>;
52
+ export type SpeechBubbleParams = {
53
+ x: number;
54
+ y: number;
55
+ width: number;
56
+ height: number;
57
+ fill?: string;
58
+ };
59
+ /** Chat slip with a tail at the bottom left and one text line. */
60
+ export declare const speechBubble: import("./piece.ts").Piece<SpeechBubbleParams>;
61
+ export type BrowserWindowParams = {
62
+ x: number;
63
+ y: number;
64
+ width?: number;
65
+ height?: number;
66
+ };
67
+ /** Browser window: title bar with three dots, a hero block and two text lines. */
68
+ export declare const browserWindow: import("./piece.ts").Piece<BrowserWindowParams>;
69
+ export type FolderParams = {
70
+ x: number;
71
+ y: number;
72
+ scale?: number;
73
+ };
74
+ /** Open folder with two sheets peeking out, measured from the write-in-obsidian cover (190x198 at scale 1). */
75
+ export declare const folder: import("./piece.ts").Piece<FolderParams>;
76
+ export type BookParams = {
77
+ x: number;
78
+ y: number;
79
+ width?: number;
80
+ height?: number;
81
+ };
82
+ /** A closed book seen from the front: back page, front cover, spine and page edges. */
83
+ export declare const book: import("./piece.ts").Piece<BookParams>;
84
+ export type BlockArrowParams = {
85
+ x: number;
86
+ y: number;
87
+ length?: number;
88
+ fill?: string;
89
+ };
90
+ /** Chunky arrow pointing right, centred vertically on y. */
91
+ export declare const blockArrow: import("./piece.ts").Piece<BlockArrowParams>;
92
+ export type ArcArrowParams = {
93
+ from: Point;
94
+ c1: Point;
95
+ c2: Point;
96
+ to: Point;
97
+ color?: string;
98
+ dashed?: boolean;
99
+ width?: number;
100
+ };
101
+ /** Curved arrow (cubic Bézier) with a chevron head at `to`; solid or dashed. */
102
+ export declare const arcArrow: import("./piece.ts").Piece<ArcArrowParams>;
103
+ export type RailParams = {
104
+ x: number;
105
+ y: number;
106
+ width: number;
107
+ nodes: string[];
108
+ fill?: string;
109
+ thickness?: number;
110
+ };
111
+ /** A rail (track) with square nodes spread along it. */
112
+ export declare const rail: import("./piece.ts").Piece<RailParams>;
113
+ export type RoadParams = {
114
+ d: string;
115
+ };
116
+ /** A road: a wide grey band along a path with white dashes in the middle. */
117
+ export declare const road: import("./piece.ts").Piece<RoadParams>;
118
+ export type MilestonePinParams = {
119
+ x: number;
120
+ y: number;
121
+ text: string;
122
+ fill?: string;
123
+ stem?: number;
124
+ size?: number;
125
+ };
126
+ /** A pin standing on (x, y): a stem and a round head with a short label. `size` is the head's radius (18) and
127
+ * scales the head, its outline and the label together (card 190). */
128
+ export declare const milestonePin: import("./piece.ts").Piece<MilestonePinParams>;
129
+ export type PriceTagParams = {
130
+ x: number;
131
+ y: number;
132
+ text: string;
133
+ width?: number;
134
+ fill?: string;
135
+ stringFrom?: Point;
136
+ };
137
+ /** Price or version tag pointing left from its tip (x, y), with a hole and an optional string. */
138
+ export declare const priceTag: import("./piece.ts").Piece<PriceTagParams>;
139
+ export type NameTagParams = {
140
+ hangX: number;
141
+ hangY: number;
142
+ cx: number;
143
+ top: number;
144
+ rotate?: number;
145
+ icon: string;
146
+ fill?: string;
147
+ };
148
+ /** A name tag hanging on a string from (hangX, hangY), showing one EIP icon. */
149
+ export declare const nameTag: import("./piece.ts").Piece<NameTagParams>;
150
+ export type CheckBadgeParams = {
151
+ cx: number;
152
+ cy: number;
153
+ r?: number;
154
+ };
155
+ /** Green round badge with a tick. */
156
+ export declare const checkBadge: import("./piece.ts").Piece<CheckBadgeParams>;
157
+ export type RobotParams = {
158
+ cx: number;
159
+ top: number;
160
+ };
161
+ /** Robot in the v2 grammar: white body and ears, a dark visor with the cast's idle eyes, one grille bar, the accent on the antenna tip. Scale it with pose. */
162
+ export declare const robot: import("./piece.ts").Piece<RobotParams>;
163
+ export type MagnifierParams = {
164
+ cx: number;
165
+ cy: number;
166
+ r?: number;
167
+ color?: string;
168
+ };
169
+ /** Magnifier: lens centred on (cx, cy), handle to the bottom right. */
170
+ export declare const magnifier: import("./piece.ts").Piece<MagnifierParams>;
171
+ export type ServerStackParams = {
172
+ x: number;
173
+ y: number;
174
+ width?: number;
175
+ units?: number;
176
+ fill?: string;
177
+ failing?: number;
178
+ };
179
+ /** Stack of server units; the `failing` unit (0-based) shows a red light. */
180
+ export declare const serverStack: import("./piece.ts").Piece<ServerStackParams>;
181
+ export type CloudParams = {
182
+ cx: number;
183
+ cy: number;
184
+ scale?: number;
185
+ fill?: string;
186
+ };
187
+ export declare const cloud: import("./piece.ts").Piece<CloudParams>;
188
+ export type GearParams = {
189
+ cx: number;
190
+ cy: number;
191
+ r?: number;
192
+ teeth?: number;
193
+ fill?: string;
194
+ };
195
+ /** Gear with square teeth and a hub, as on the maven-release cover. */
196
+ export declare const gear: import("./piece.ts").Piece<GearParams>;
197
+ export type ParcelParams = {
198
+ x: number;
199
+ y: number;
200
+ size?: number;
201
+ fill?: string;
202
+ };
203
+ /** Parcel (box) with a lid line and a tape strip. */
204
+ export declare const parcel: import("./piece.ts").Piece<ParcelParams>;
205
+ export type StepsParams = {
206
+ x: number;
207
+ y: number;
208
+ count?: number;
209
+ width?: number;
210
+ rise?: number;
211
+ fill?: string;
212
+ };
213
+ /** Steps climbing to the right from the bottom-left corner (x, y), as on the obsidian-to-site guide cover. */
214
+ export declare const steps: import("./piece.ts").Piece<StepsParams>;
215
+ export type MuleTile = {
216
+ x: number;
217
+ kind: "scatter-gather" | "choice" | "for-each";
218
+ };
219
+ export type MuleFlowParams = {
220
+ x: number;
221
+ y: number;
222
+ width: number;
223
+ height?: number;
224
+ tiles: MuleTile[];
225
+ tileWidth?: number;
226
+ fill?: string;
227
+ };
228
+ /** A Mule flow: a bar with processor tiles linked left to right, each with its glyph. */
229
+ export declare const muleFlow: import("./piece.ts").Piece<MuleFlowParams>;
230
+ export type EipIconParams = {
231
+ name: string;
232
+ x: number;
233
+ y: number;
234
+ scale?: number;
235
+ };
236
+ /** One of the 27 EIP icons (64x40), placed at (x, y) and scaled; the cover's outline does not leak in. */
237
+ export declare const eipIcon: import("./piece.ts").Piece<EipIconParams>;
238
+ /** Every piece, by name, in catalogue order (spec illustration-pieces, "Piece catalogue"). */
239
+ export declare const PIECES: {
240
+ readonly lineBadge: import("./piece.ts").Piece<import("./metro.ts").LineBadgeParams>;
241
+ readonly stationMarker: import("./piece.ts").Piece<import("./metro.ts").StationMarkerParams>;
242
+ readonly pipe: import("./piece.ts").Piece<import("./metro.ts").PipeParams>;
243
+ readonly countBadge: import("./piece.ts").Piece<import("./metro.ts").CountBadgeParams>;
244
+ readonly nodeBlock: import("./piece.ts").Piece<import("./metro.ts").NodeBlockParams>;
245
+ readonly pillNode: import("./piece.ts").Piece<import("./metro.ts").NodeParams>;
246
+ readonly hexNode: import("./piece.ts").Piece<import("./metro.ts").NodeParams>;
247
+ readonly messageArrow: import("./piece.ts").Piece<import("./metro.ts").MessageArrowParams>;
248
+ readonly ledgerMark: import("./piece.ts").Piece<import("./metro.ts").LedgerMarkParams>;
249
+ readonly renewalRing: import("./piece.ts").Piece<import("./metro.ts").RenewalRingParams>;
250
+ readonly suggestedHalo: import("./piece.ts").Piece<import("./metro.ts").SuggestedHaloParams>;
251
+ readonly licenceMark: import("./piece.ts").Piece<import("./metro.ts").LicenceMarkParams>;
252
+ readonly zone: import("./piece.ts").Piece<import("./metro.ts").ZoneParams>;
253
+ readonly diagramBox: import("./piece.ts").Piece<import("./diagram.ts").DiagramBoxParams>;
254
+ readonly decisionNode: import("./piece.ts").Piece<import("./ink.ts").Ink & {
255
+ x: number;
256
+ y: number;
257
+ width: number;
258
+ height?: number;
259
+ text: string[];
260
+ subtitle?: string;
261
+ fill?: string;
262
+ textSize?: number;
263
+ } & {
264
+ height: number;
265
+ }>;
266
+ readonly storeNode: import("./piece.ts").Piece<import("./diagram.ts").StoreNodeParams>;
267
+ readonly queueNode: import("./piece.ts").Piece<import("./diagram.ts").QueueNodeParams>;
268
+ readonly exchangeNode: import("./piece.ts").Piece<import("./diagram.ts").ShapeParams>;
269
+ readonly taggedContainer: import("./piece.ts").Piece<import("./diagram.ts").TaggedContainerParams>;
270
+ readonly lifeline: import("./piece.ts").Piece<import("./diagram.ts").LifelineParams>;
271
+ readonly phaseBand: import("./piece.ts").Piece<import("./diagram.ts").PhaseBandParams>;
272
+ readonly altFrame: import("./piece.ts").Piece<import("./diagram.ts").AltFrameParams>;
273
+ readonly edgeLabel: import("./piece.ts").Piece<import("./diagram.ts").EdgeLabelParams>;
274
+ readonly pill: import("./piece.ts").Piece<PillParams>;
275
+ readonly rings: import("./piece.ts").Piece<RingsParams>;
276
+ readonly sheet: import("./piece.ts").Piece<SheetParams>;
277
+ readonly blockArrow: import("./piece.ts").Piece<BlockArrowParams>;
278
+ readonly arcArrow: import("./piece.ts").Piece<ArcArrowParams>;
279
+ readonly rail: import("./piece.ts").Piece<RailParams>;
280
+ readonly checkBadge: import("./piece.ts").Piece<CheckBadgeParams>;
281
+ readonly priceTag: import("./piece.ts").Piece<PriceTagParams>;
282
+ readonly nameTag: import("./piece.ts").Piece<NameTagParams>;
283
+ readonly codePanel: import("./piece.ts").Piece<CodePanelParams>;
284
+ readonly serverStack: import("./piece.ts").Piece<ServerStackParams>;
285
+ readonly cloud: import("./piece.ts").Piece<CloudParams>;
286
+ readonly stamp: import("./piece.ts").Piece<StampParams>;
287
+ readonly robot: import("./piece.ts").Piece<RobotParams>;
288
+ readonly magnifier: import("./piece.ts").Piece<MagnifierParams>;
289
+ readonly gear: import("./piece.ts").Piece<GearParams>;
290
+ readonly parcel: import("./piece.ts").Piece<ParcelParams>;
291
+ readonly road: import("./piece.ts").Piece<RoadParams>;
292
+ readonly milestonePin: import("./piece.ts").Piece<MilestonePinParams>;
293
+ readonly browserWindow: import("./piece.ts").Piece<BrowserWindowParams>;
294
+ readonly speechBubble: import("./piece.ts").Piece<SpeechBubbleParams>;
295
+ readonly steps: import("./piece.ts").Piece<StepsParams>;
296
+ readonly folder: import("./piece.ts").Piece<FolderParams>;
297
+ readonly book: import("./piece.ts").Piece<BookParams>;
298
+ readonly muleFlow: import("./piece.ts").Piece<MuleFlowParams>;
299
+ readonly eipIcon: import("./piece.ts").Piece<EipIconParams>;
300
+ readonly uiIcon: import("./piece.ts").Piece<import("./ui-icons.ts").UiIconParams>;
301
+ readonly linkIcon: import("./piece.ts").Piece<import("./link-icons.ts").LinkIconParams>;
302
+ readonly stateStart: import("./piece.ts").Piece<import("./diagram.ts").StateStartParams>;
303
+ readonly emote: import("./piece.ts").Piece<import("./emote.ts").EmoteParams>;
304
+ readonly mira: import("./piece.ts").Piece<MiraParams>;
305
+ readonly visor: import("./piece.ts").Piece<VisorParams>;
306
+ readonly drone: import("./piece.ts").Piece<DroneParams>;
307
+ readonly kiu: import("./piece.ts").Piece<KiuParams>;
308
+ readonly sinal: import("./piece.ts").Piece<SinalParams>;
309
+ readonly bankObject: import("./piece.ts").Piece<BankObjectParams>;
310
+ readonly symbol: import("./piece.ts").Piece<SymbolParams>;
311
+ readonly brandNotationIcon: import("./piece.ts").Piece<BrandNotationIconParams>;
312
+ readonly categoryIcon: import("./piece.ts").Piece<CategoryIconParams>;
313
+ readonly headline: import("./piece.ts").Piece<HeadlineParams>;
314
+ readonly questionToken: import("./piece.ts").Piece<QuestionTokenParams>;
315
+ readonly balao: import("./piece.ts").Piece<BalaoParams>;
316
+ readonly chaves: import("./piece.ts").Piece<ChavesParams>;
317
+ readonly keyboard: import("./piece.ts").Piece<KeyboardParams>;
318
+ };
319
+ export type PieceName = keyof typeof PIECES;
320
+ export declare const PIECE_NAMES: PieceName[];