@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.
- package/LICENSE +202 -0
- package/NOTICE +15 -0
- package/README.md +567 -2
- package/dist/scripts/cover.d.ts +29 -0
- package/dist/scripts/cover.js +186 -0
- package/dist/src/fonts/embed.d.ts +7 -0
- package/dist/src/fonts/embed.js +221 -0
- package/dist/src/pieces/bank-objects.d.ts +12 -0
- package/dist/src/pieces/bank-objects.js +52 -0
- package/dist/src/pieces/brand-cast.d.ts +105 -0
- package/dist/src/pieces/brand-cast.js +221 -0
- package/dist/src/pieces/brand-notation-icons.d.ts +12 -0
- package/dist/src/pieces/brand-notation-icons.js +79 -0
- package/dist/src/pieces/category-icon.d.ts +12 -0
- package/dist/src/pieces/category-icon.js +55 -0
- package/dist/src/pieces/cover.d.ts +138 -0
- package/dist/src/pieces/cover.js +635 -0
- package/dist/src/pieces/diagram.d.ts +141 -0
- package/dist/src/pieces/diagram.js +201 -0
- package/dist/src/pieces/eip-icons.d.ts +12 -0
- package/dist/src/pieces/eip-icons.js +468 -0
- package/dist/src/pieces/emote.d.ts +13 -0
- package/dist/src/pieces/emote.js +88 -0
- package/dist/src/pieces/headline.d.ts +11 -0
- package/dist/src/pieces/headline.js +37 -0
- package/dist/src/pieces/index.d.ts +17 -0
- package/dist/src/pieces/index.js +20 -0
- package/dist/src/pieces/ink.d.ts +71 -0
- package/dist/src/pieces/ink.js +57 -0
- package/dist/src/pieces/keyboard.d.ts +9 -0
- package/dist/src/pieces/keyboard.js +33 -0
- package/dist/src/pieces/library.d.ts +320 -0
- package/dist/src/pieces/library.js +355 -0
- package/dist/src/pieces/link-icons.d.ts +23 -0
- package/dist/src/pieces/link-icons.js +101 -0
- package/dist/src/pieces/metro.d.ts +137 -0
- package/dist/src/pieces/metro.js +288 -0
- package/dist/src/pieces/node.d.ts +29 -0
- package/dist/src/pieces/node.js +56 -0
- package/dist/src/pieces/paper.d.ts +31 -0
- package/dist/src/pieces/paper.js +72 -0
- package/dist/src/pieces/params.d.ts +84 -0
- package/dist/src/pieces/params.js +158 -0
- package/dist/src/pieces/piece.d.ts +9 -0
- package/dist/src/pieces/piece.js +28 -0
- package/dist/src/pieces/pose.d.ts +16 -0
- package/dist/src/pieces/pose.js +30 -0
- package/dist/src/pieces/question-token.d.ts +9 -0
- package/dist/src/pieces/question-token.js +49 -0
- package/dist/src/pieces/react.d.ts +4 -0
- package/dist/src/pieces/react.js +13 -0
- package/dist/src/pieces/render.d.ts +2 -0
- package/dist/src/pieces/render.js +22 -0
- package/dist/src/pieces/skin.d.ts +22 -0
- package/dist/src/pieces/skin.js +13 -0
- package/dist/src/pieces/stamp.d.ts +11 -0
- package/dist/src/pieces/stamp.js +29 -0
- package/dist/src/pieces/supporting-cast.d.ts +35 -0
- package/dist/src/pieces/supporting-cast.js +168 -0
- package/dist/src/pieces/symbol.d.ts +13 -0
- package/dist/src/pieces/symbol.js +27 -0
- package/dist/src/pieces/ui-icons.d.ts +21 -0
- package/dist/src/pieces/ui-icons.js +35 -0
- package/dist/tokens/generated/tokens.d.ts +299 -0
- package/dist/tokens/generated/tokens.js +299 -0
- package/fonts/OFL.txt +97 -0
- package/fonts/SourceCodePro-Bold.ttf +0 -0
- package/fonts/SourceCodePro-Regular.ttf +0 -0
- package/fonts/SourceSans3-Black.ttf +0 -0
- package/fonts/SourceSans3-Bold.ttf +0 -0
- package/fonts/SourceSans3-Regular.ttf +0 -0
- package/fonts/SourceSerif4-Bold.ttf +0 -0
- package/package.json +88 -4
- package/tokens/generated/tokens.css +215 -0
- package/tokens/generated/tokens.json +298 -0
- package/tokens/generated/tokens.ts +302 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
// Mira, protagonist of the parent brand (ADR 0007, identity studio I2). The
|
|
2
|
+
// geometry is the approved round-7 model sheet's, ported unchanged
|
|
3
|
+
// (`~/.hermes/cache/scratch/ab267/sheet7.py`, functions `mira`/`peak`/`legs`/`needle`;
|
|
4
|
+
// `casting3.py`'s `face`). Front and back view only (round 7b dropped the
|
|
5
|
+
// side view and the middle leg).
|
|
6
|
+
import { tokens } from "../../tokens/generated/tokens.js";
|
|
7
|
+
import { drawn, el, g } from "./node.js";
|
|
8
|
+
import { limits, surfaceParam } from "./ink.js";
|
|
9
|
+
import { pill, sheet, sheetRowSchema } from "./paper.js";
|
|
10
|
+
import { label, pos, num, size } from "./params.js";
|
|
11
|
+
import { definePiece } from "./piece.js";
|
|
12
|
+
import { outlined, skin } from "./skin.js";
|
|
13
|
+
export const CAST_EXPRESSIONS = ["idle", "done", "waiting", "failed"];
|
|
14
|
+
export const CAST_VIEWS = ["front", "back"];
|
|
15
|
+
/** The face mode each piece draws, keyed by the shared `CastExpression` (sheets' `m`). */
|
|
16
|
+
const FACE_MODE = { idle: "idle", done: "happy", waiting: "wait", failed: "fail" };
|
|
17
|
+
/**
|
|
18
|
+
* The screen face, the message state (identity studio I2: 4 expressions = parked, done, waiting, failed).
|
|
19
|
+
* Ported from `casting3.py`'s `face(x, y, w, h, S, mode)`.
|
|
20
|
+
*/
|
|
21
|
+
export const faceAt = (x, y, w, h, s, expression) => {
|
|
22
|
+
const mode = FACE_MODE[expression];
|
|
23
|
+
const rx = h / 2.4;
|
|
24
|
+
const visor = el("rect", { x, y, width: w, height: h, rx, fill: s.visor });
|
|
25
|
+
const cx = x + w / 2, cy = y + h / 2, dx = w * 0.2, ew = Math.max(5, w * 0.11), eh = h * 0.42, eye = s.eye;
|
|
26
|
+
const eyes = [];
|
|
27
|
+
if (mode === "idle") {
|
|
28
|
+
for (const sx of [-dx, dx])
|
|
29
|
+
eyes.push(el("rect", { x: cx + sx - ew / 2, y: cy - eh / 2, width: ew, height: eh, rx: ew / 2, fill: eye }));
|
|
30
|
+
}
|
|
31
|
+
else if (mode === "happy") {
|
|
32
|
+
for (const sx of [-dx, dx])
|
|
33
|
+
eyes.push(el("path", { d: `M${cx + sx - ew} ${cy + eh * 0.2} Q${cx + sx} ${cy - eh * 0.6} ${cx + sx + ew} ${cy + eh * 0.2}`, fill: "none", stroke: eye, "stroke-width": ew * 0.7, "stroke-linecap": "round" }));
|
|
34
|
+
}
|
|
35
|
+
else if (mode === "wait") {
|
|
36
|
+
for (const sx of [-dx, 0, dx])
|
|
37
|
+
eyes.push(el("circle", { cx: cx + sx, cy, r: ew * 0.45, fill: eye }));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
for (const sx of [-dx, dx]) {
|
|
41
|
+
const a = ew * 0.8;
|
|
42
|
+
eyes.push(el("path", { d: `M${cx + sx - a} ${cy - a} L${cx + sx + a} ${cy + a} M${cx + sx + a} ${cy - a} L${cx + sx - a} ${cy + a}`, stroke: eye, "stroke-width": ew * 0.6, "stroke-linecap": "round" }));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return g({}, visor, ...eyes);
|
|
46
|
+
};
|
|
47
|
+
/** The hood tip, dipping over the forehead: the parent-brand family device (ADR 0007, I4). Absent on Sinal. */
|
|
48
|
+
export const peak = (s, cx, top, w = 30, dip = 28) => el("path", { d: `M${cx - w} ${top + 3} Q${cx} ${top - 6} ${cx + w} ${top + 3} Q${cx + w * 0.4} ${top + 8} ${cx} ${top + dip} Q${cx - w * 0.4} ${top + 8} ${cx - w} ${top + 3} Z`, fill: s.accent, stroke: s.outline, "stroke-width": 5, "stroke-linejoin": "round" });
|
|
49
|
+
/** The hood tip drawn as a cap sitting astride a circle's rim (Visor, Drone, Kiu use this form; `final.py`'s `tipcap`). */
|
|
50
|
+
export const tipCap = (s, cx, cy, r, depth) => {
|
|
51
|
+
const k = 0.70710678;
|
|
52
|
+
return el("path", {
|
|
53
|
+
d: `M${cx - k * r} ${cy - k * r} A${r} ${r} 0 0 1 ${cx + k * r} ${cy - k * r} Q${cx + r * 0.28} ${cy - r * 0.62} ${cx} ${cy - depth} Q${cx - r * 0.28} ${cy - r * 0.62} ${cx - k * r} ${cy - k * r} Z`,
|
|
54
|
+
fill: s.accent, stroke: s.outline, "stroke-width": 5, "stroke-linejoin": "round",
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
const miraLegs = (s, stride = 0) => [
|
|
58
|
+
el("path", { d: `M-16 -44 L${-34 + stride} 0 M16 -44 L${34 + stride} 0`, stroke: s.outline, "stroke-width": 8, "stroke-linecap": "round" }),
|
|
59
|
+
el("rect", { x: -44 + stride, y: -6, width: 20, height: 7, rx: 3.5, fill: s.outline }),
|
|
60
|
+
el("rect", { x: 24 + stride, y: -6, width: 20, height: 7, rx: 3.5, fill: s.outline }),
|
|
61
|
+
];
|
|
62
|
+
const miraNeedle = (s, a, carry) => {
|
|
63
|
+
const msg = carry ? [el("path", { d: "M86 0 V16", stroke: s.outline, "stroke-width": 3 }), el("circle", { cx: 86, cy: 26, r: 10, fill: s.accent })] : [];
|
|
64
|
+
return g({ transform: `translate(0,-90) rotate(${a})` }, el("rect", { x: -74, y: -3.5, width: 74, height: 7, rx: 3.5, fill: s.outline }), el("circle", { cx: -74, cy: 0, r: 8, fill: s.outline }), el("path", { d: "M14 -7 L96 0 L14 7 Z", fill: s.accent }), ...msg);
|
|
65
|
+
};
|
|
66
|
+
const drawMira = (p) => {
|
|
67
|
+
const s = skin(p.surface ?? "light");
|
|
68
|
+
const expression = p.expression ?? "idle", view = p.view ?? "front";
|
|
69
|
+
const a = p.needleAngle ?? -40, carry = p.carries ?? false, stride = p.stride ?? 0;
|
|
70
|
+
const scale = p.scale ?? 1;
|
|
71
|
+
let body;
|
|
72
|
+
if (view === "back") {
|
|
73
|
+
const rete = [
|
|
74
|
+
el("circle", { cx: 0, cy: -90, r: 28, fill: "none", stroke: s.outline, "stroke-width": 3 }),
|
|
75
|
+
el("path", { d: "M-28 -90 H28 M0 -118 V-62", stroke: s.outline, "stroke-width": 3 }),
|
|
76
|
+
];
|
|
77
|
+
body = g({}, ...miraLegs(s), el("circle", { cx: 0, cy: -90, r: 50, ...outlined(s, 8) }), ...rete, miraNeedle(s, -140, false), el("path", { d: "M-28 -137 Q0 -146 28 -137 Q0 -128 -28 -137 Z", fill: s.accent, stroke: s.outline, "stroke-width": 5, "stroke-linejoin": "round" }));
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
body = g({}, ...miraLegs(s, stride), miraNeedle(s, a, carry), el("circle", { cx: 0, cy: -90, r: 50, ...outlined(s, 8) }), faceAt(-30, -104, 60, 32, s, expression), peak(s, 0, -140, 28, 26));
|
|
81
|
+
}
|
|
82
|
+
return drawn([g({ "data-piece": "mira", transform: `translate(${p.x} ${p.y}) scale(${scale})`, stroke: "none" }, body)]);
|
|
83
|
+
};
|
|
84
|
+
/** Mira, the protagonist: an astrolabe whose needle points the route each message takes. */
|
|
85
|
+
export const mira = definePiece("mira", {
|
|
86
|
+
x: pos(), y: pos(), surface: surfaceParam,
|
|
87
|
+
scale: num({ min: 0.25, max: 4 }),
|
|
88
|
+
expression: { kind: "enum", values: CAST_EXPRESSIONS },
|
|
89
|
+
view: { kind: "enum", values: CAST_VIEWS },
|
|
90
|
+
needleAngle: num({ min: -180, max: 180 }),
|
|
91
|
+
carries: { kind: "boolean" },
|
|
92
|
+
stride: num({ min: 0, max: 20 }),
|
|
93
|
+
}, drawMira);
|
|
94
|
+
// ---------------------------------------------------------------- Visor (AI pillar)
|
|
95
|
+
// Ported from final.py's `visor()`: an agent at work, the hands do, the face shows the state.
|
|
96
|
+
// `holdsSheet` and `facing` (change sdd-scene-pieces, design §1 to §3): Visor holds
|
|
97
|
+
// a sheet in its left hand instead of the card, and faces left as the mirror image.
|
|
98
|
+
export const VISOR_FACINGS = ["right", "left"];
|
|
99
|
+
// Where the held sheet sits, in Visor's units (design §2): its edge under the
|
|
100
|
+
// left hand (x -98 facing right, 98 facing left), so the hand (x -92, radius 15,
|
|
101
|
+
// outline 8) lies 13 units over the page, clear of a row's lead mark and of a tail check;
|
|
102
|
+
// its bottom 4 above the ground line.
|
|
103
|
+
const HELD_SHEET_EDGE = 98;
|
|
104
|
+
const HELD_SHEET_BOTTOM = -4;
|
|
105
|
+
/**
|
|
106
|
+
* A held sheet with its page's top-left corner at (x, y), in the holder's
|
|
107
|
+
* units: the `sheet` and `pill` pieces' own drawings in one group that gives
|
|
108
|
+
* them the cast's outline (cast pieces set `stroke: none` on their root), so
|
|
109
|
+
* it draws the same in a cover and in a scene. The marks sit on the white page,
|
|
110
|
+
* so they stay ink on the dark surface too (ADR 0009). Its words go to the
|
|
111
|
+
* holder's text. Shared by Visor and Chaves (change supporting-characters, design §1).
|
|
112
|
+
*/
|
|
113
|
+
export const holdSheet = (held, s, x, y) => {
|
|
114
|
+
const page = sheet({ x, y, width: held.width, height: held.height, rows: held.rows, top: held.top, step: held.step });
|
|
115
|
+
const tag = held.label === undefined ? null : pill({ x: x + held.width / 2, y, text: held.label });
|
|
116
|
+
// The sheet's marks group (the `g` at outline.small) gets its ink stroke here.
|
|
117
|
+
const body = page.body.map((node) => node.tag === "g" && node.attrs["stroke-width"] === tokens.outline.small && node.attrs.stroke === undefined
|
|
118
|
+
? { ...node, attrs: { ...node.attrs, stroke: tokens.color.ink } }
|
|
119
|
+
: node);
|
|
120
|
+
return drawn([g({ "data-held": "sheet", stroke: s.outline, "stroke-width": tokens.outline.block, "stroke-linejoin": "round" }, ...body, ...(tag?.body ?? []))], [...page.text, ...(tag?.text ?? [])]);
|
|
121
|
+
};
|
|
122
|
+
/** Visor's pointing hand, a finger pill above the palm, turned `angle` degrees about the palm at (x, y). Shared with Chaves (change supporting-characters, design §1). */
|
|
123
|
+
export const pointingHand = (s, x, y, angle) => g({ transform: `translate(${x},${y}) rotate(${angle})` }, el("rect", { x: -6, y: -30, width: 12, height: 26, rx: 6, ...outlined(s, 4.5) }), el("circle", { cx: 0, cy: 0, r: 15, ...outlined(s) }));
|
|
124
|
+
const drawVisor = (p) => {
|
|
125
|
+
const s = skin(p.surface ?? "light");
|
|
126
|
+
const expression = p.expression ?? "idle", view = p.view ?? "front", back = view === "back";
|
|
127
|
+
const hold = p.holds ?? false, point = p.points ?? true, facing = p.facing ?? "right";
|
|
128
|
+
const held = p.holdsSheet === undefined
|
|
129
|
+
? null
|
|
130
|
+
: holdSheet(p.holdsSheet, s, facing === "right" ? -HELD_SHEET_EDGE - p.holdsSheet.width : HELD_SHEET_EDGE, HELD_SHEET_BOTTOM - p.holdsSheet.height);
|
|
131
|
+
const handR = point ? pointingHand(s, 88, -104, -35) : el("circle", { cx: 86, cy: -58, r: 15, ...outlined(s) });
|
|
132
|
+
// With a held sheet the card hand stays where it is, without the card, over the sheet's edge.
|
|
133
|
+
const handL = hold || held
|
|
134
|
+
? [...(held ? [] : [el("rect", { x: -106, y: -96, width: 28, height: 24, rx: 5, fill: s.accent })]), el("circle", { cx: -92, cy: -66, r: 15, ...outlined(s) })]
|
|
135
|
+
: [el("circle", { cx: -86, cy: -58, r: 15, ...outlined(s) })];
|
|
136
|
+
const faceG = back ? null : faceAt(-42, -128, 84, 52, s, expression);
|
|
137
|
+
const pk = back
|
|
138
|
+
? el("path", { d: "M-34 -144 Q0 -152 34 -144 Q0 -136 -34 -144 Z", fill: s.accent, stroke: s.outline, "stroke-width": 5, "stroke-linejoin": "round" })
|
|
139
|
+
: el("path", { d: "M-34 -144 Q0 -152 34 -144 Q14 -138 0 -120 Q-14 -138 -34 -144 Z", fill: s.accent, stroke: s.outline, "stroke-width": 5, "stroke-linejoin": "round" });
|
|
140
|
+
const vent = back
|
|
141
|
+
? el("path", { d: "M-24 -110 H24 M-24 -96 H24 M-24 -82 H24", stroke: s.outline, "stroke-width": 4, "stroke-linecap": "round" })
|
|
142
|
+
: null;
|
|
143
|
+
// Facing left mirrors the body only: a uniform -1 scale keeps every stroke width and colour (ADR 0009).
|
|
144
|
+
const body = g(facing === "left" ? { transform: "scale(-1,1)" } : {}, el("rect", { x: -66, y: -114, width: 14, height: 32, rx: 4, fill: s.outline }), el("rect", { x: 52, y: -114, width: 14, height: 32, rx: 4, fill: s.outline }), el("rect", { x: -56, y: -142, width: 112, height: 88, rx: 30, ...outlined(s) }), faceG, vent, pk, el("path", { d: "M-16 -52 H16 L10 -40 H-10 Z", fill: s.outline }), ...handL, handR);
|
|
145
|
+
const transform = `translate(${p.x} ${p.y}) scale(${p.scale ?? 1})`;
|
|
146
|
+
// The words carry their own font, so they read the same in a scene, where no labels group exists.
|
|
147
|
+
const text = held && held.text.length > 0
|
|
148
|
+
? [g({ transform, "font-family": tokens.font.sans, "font-size": tokens.cover.labelSize, "font-weight": tokens.cover.labelWeight, fill: tokens.color.ink, "text-anchor": "middle" }, ...held.text)]
|
|
149
|
+
: [];
|
|
150
|
+
return drawn([g({ "data-piece": "visor", transform, stroke: "none" }, ...(held?.body ?? []), body)], text);
|
|
151
|
+
};
|
|
152
|
+
/** The held sheet's schema (Visor's and Chaves's `holdsSheet`). */
|
|
153
|
+
export const heldSheetSchema = {
|
|
154
|
+
width: { kind: "number", required: true, min: 80, max: 300 },
|
|
155
|
+
height: { kind: "number", required: true, min: 80, max: 400 },
|
|
156
|
+
rows: { kind: "array", required: true, minItems: 1, maxItems: 8, of: { kind: "object", fields: sheetRowSchema } },
|
|
157
|
+
top: size(),
|
|
158
|
+
step: size(),
|
|
159
|
+
label: label(false),
|
|
160
|
+
};
|
|
161
|
+
export const visor = definePiece("visor", {
|
|
162
|
+
x: pos(), y: pos(), surface: surfaceParam, scale: num({ min: 0.25, max: 4 }),
|
|
163
|
+
expression: { kind: "enum", values: CAST_EXPRESSIONS }, view: { kind: "enum", values: CAST_VIEWS },
|
|
164
|
+
holds: { kind: "boolean" },
|
|
165
|
+
holdsSheet: { kind: "object", fields: heldSheetSchema },
|
|
166
|
+
points: { kind: "boolean" },
|
|
167
|
+
facing: { kind: "enum", values: VISOR_FACINGS },
|
|
168
|
+
}, drawVisor,
|
|
169
|
+
// A card or a sheet, not both; the sheet only in front (its back is not designed). The card is named first.
|
|
170
|
+
(p) => p.holdsSheet === undefined ? [] : limits(p.holds === true && { path: "holdsSheet", message: "Visor holds a card or a sheet, not both" }, p.holds !== true && p.view === "back" && { path: "holdsSheet", message: "Visor holds a sheet only in the front view" }));
|
|
171
|
+
const drawDrone = (p) => {
|
|
172
|
+
const s = skin(p.surface ?? "light");
|
|
173
|
+
const expression = p.expression ?? "idle", view = p.view ?? "front", back = view === "back";
|
|
174
|
+
const cargo = p.carries ?? true;
|
|
175
|
+
const faceG = back ? null : faceAt(-27, -98, 54, 30, s, expression);
|
|
176
|
+
const cap = back
|
|
177
|
+
? el("path", { d: "M-27.6 -109.6 A39 39 0 0 1 27.6 -109.6 Q0 -102 -27.6 -109.6 Z", fill: s.accent, stroke: s.outline, "stroke-width": 5 })
|
|
178
|
+
: tipCap(s, 0, -82, 39, 14);
|
|
179
|
+
const box = cargo
|
|
180
|
+
? [el("rect", { x: -15, y: -36, width: 30, height: 26, rx: 6, fill: s.accent }), el("path", { d: "M-15 -27 H15", stroke: s.body, "stroke-width": 3 })]
|
|
181
|
+
: [];
|
|
182
|
+
const body = g({}, el("path", { d: "M-22 -106 L-46 -126 M22 -106 L46 -126", stroke: s.outline, "stroke-width": 7, "stroke-linecap": "round" }), el("rect", { x: -74, y: -132, width: 54, height: 9, rx: 4.5, fill: s.outline }), el("rect", { x: 20, y: -132, width: 54, height: 9, rx: 4.5, fill: s.outline }), el("circle", { cx: 0, cy: -82, r: 36, ...outlined(s) }), faceG, cap, el("path", { d: "M0 -46 V-36 M-10 -40 H10", stroke: s.outline, "stroke-width": 5, "stroke-linecap": "round" }), ...box);
|
|
183
|
+
return drawn([g({ "data-piece": "drone", transform: `translate(${p.x} ${p.y}) scale(${p.scale ?? 1})`, stroke: "none" }, body)]);
|
|
184
|
+
};
|
|
185
|
+
export const drone = definePiece("drone", { x: pos(), y: pos(), surface: surfaceParam, scale: num({ min: 0.25, max: 4 }), expression: { kind: "enum", values: CAST_EXPRESSIONS }, view: { kind: "enum", values: CAST_VIEWS }, carries: { kind: "boolean" } }, drawDrone);
|
|
186
|
+
const KIU_SEGMENTS = [[-46, 19], [-84, 17], [-118, 15], [-148, 13], [-174, 11]];
|
|
187
|
+
const drawKiu = (p) => {
|
|
188
|
+
const s = skin(p.surface ?? "light");
|
|
189
|
+
const expression = p.expression ?? "idle", view = p.view ?? "front", back = view === "back";
|
|
190
|
+
const n = p.steps ?? 4;
|
|
191
|
+
const seg = KIU_SEGMENTS.slice(0, n);
|
|
192
|
+
const parts = [];
|
|
193
|
+
// Farthest segment first, nearest last (on top) — matches the sheet's `reversed(enumerate(seg))`.
|
|
194
|
+
for (let i = seg.length - 1; i >= 0; i--) {
|
|
195
|
+
const [dx, r] = seg[i];
|
|
196
|
+
const cy = -(r + 10);
|
|
197
|
+
parts.push(el("path", { d: `M${dx - 5} ${cy + r - 3} L${dx - 7} 0 M${dx + 5} ${cy + r - 3} L${dx + 7} 0`, stroke: s.outline, "stroke-width": 4, "stroke-linecap": "round" }));
|
|
198
|
+
parts.push(el("circle", { cx: dx, cy, r, fill: s.body, stroke: s.outline, "stroke-width": 4.5 }));
|
|
199
|
+
if (i % 2 === 0)
|
|
200
|
+
parts.push(el("circle", { cx: dx, cy, r: r * 0.45, fill: s.accent }));
|
|
201
|
+
}
|
|
202
|
+
const head = [
|
|
203
|
+
el("path", { d: "M-6 -10 L-8 0 M8 -10 L10 0", stroke: s.outline, "stroke-width": 4, "stroke-linecap": "round" }),
|
|
204
|
+
el("circle", { cx: 0, cy: -40, r: 31, ...outlined(s) }),
|
|
205
|
+
back
|
|
206
|
+
? el("path", { d: "M-24 -64 A34 34 0 0 1 24 -64 Q0 -58 -24 -64 Z", fill: s.accent, stroke: s.outline, "stroke-width": 5 })
|
|
207
|
+
: g({}, faceAt(-21, -54, 44, 26, s, expression), tipCap(s, 0, -40, 34, 12)),
|
|
208
|
+
];
|
|
209
|
+
const inner = g({ transform: "translate(70,0)" }, ...parts, ...head);
|
|
210
|
+
const body = back ? g({ transform: "scale(-1,1)" }, inner) : inner;
|
|
211
|
+
return drawn([g({ "data-piece": "kiu", transform: `translate(${p.x} ${p.y}) scale(${p.scale ?? 1})`, stroke: "none" }, body)]);
|
|
212
|
+
};
|
|
213
|
+
export const kiu = definePiece("kiu", { x: pos(), y: pos(), surface: surfaceParam, scale: num({ min: 0.25, max: 4 }), expression: { kind: "enum", values: CAST_EXPRESSIONS }, view: { kind: "enum", values: CAST_VIEWS }, steps: { kind: "number", integer: true, min: 2, max: 5 } }, drawKiu);
|
|
214
|
+
const drawSinal = (p) => {
|
|
215
|
+
const s = skin(p.surface ?? "light");
|
|
216
|
+
const expression = p.expression ?? "idle", view = p.view ?? "front";
|
|
217
|
+
const faceG = view === "back" ? null : faceAt(-25, -116, 50, 32, s, expression);
|
|
218
|
+
const body = g({}, el("rect", { x: -22, y: -12, width: 44, height: 12, rx: 6, fill: s.outline }), el("rect", { x: -6, y: -70, width: 12, height: 62, fill: s.outline }), el("circle", { cx: 0, cy: -100, r: 36, ...outlined(s) }), faceG);
|
|
219
|
+
return drawn([g({ "data-piece": "sinal", transform: `translate(${p.x} ${p.y}) scale(${p.scale ?? 1})`, stroke: "none" }, body)]);
|
|
220
|
+
};
|
|
221
|
+
export const sinal = definePiece("sinal", { x: pos(), y: pos(), surface: surfaceParam, scale: num({ min: 0.25, max: 4 }), expression: { kind: "enum", values: CAST_EXPRESSIONS }, view: { kind: "enum", values: CAST_VIEWS } }, drawSinal);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type SurfaceName } from "./ink.ts";
|
|
2
|
+
export declare const BRAND_NOTATION_ICON_NAMES: readonly ["message", "pointToPointChannel", "messageQueue", "publishSubscribeChannel", "contentBasedRouter", "messageFilter", "splitter", "aggregator", "messageTranslator", "contentEnricher", "correlationIdentifier", "idempotentReceiver", "deadLetterChannel", "pipelineStage", "gateToProduction", "rollback", "toolCall", "contextWindow", "guardrail"];
|
|
3
|
+
export type BrandNotationIconName = (typeof BRAND_NOTATION_ICON_NAMES)[number];
|
|
4
|
+
export type BrandNotationIconParams = {
|
|
5
|
+
name: BrandNotationIconName;
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
surface?: SurfaceName;
|
|
9
|
+
scale?: number;
|
|
10
|
+
};
|
|
11
|
+
/** One of the 19 brand notation icons (I11): 13 EIP + 3 delivery + 3 AI, a 48×48 glyph before `scale`. */
|
|
12
|
+
export declare const brandNotationIcon: import("./piece.ts").Piece<BrandNotationIconParams>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// The brand notation: 19 icons (13 EIP + 3 delivery + 3 AI), one grammar,
|
|
2
|
+
// used on covers, home, LinkedIn and GitHub (identity studio I11). Separate
|
|
3
|
+
// from the 27 body-diagram icons (`eip-icons.ts`): never shared, never the
|
|
4
|
+
// same export (review finding S of card 268's spec round). Redraws each
|
|
5
|
+
// pattern's market-recognised silhouette in the new ink-outline grammar —
|
|
6
|
+
// never the EIP book's own artwork, per the brand strategy.
|
|
7
|
+
//
|
|
8
|
+
// Geometry ported unchanged from the approved phase-3/4 source
|
|
9
|
+
// (`~/.hermes/cache/scratch/ab267/final.py`'s `icons()`).
|
|
10
|
+
import { drawn, el, g } from "./node.js";
|
|
11
|
+
import { surfaceParam } from "./ink.js";
|
|
12
|
+
import { pos, num } from "./params.js";
|
|
13
|
+
import { definePiece } from "./piece.js";
|
|
14
|
+
import { colour } from "./params.js";
|
|
15
|
+
export const BRAND_NOTATION_ICON_NAMES = [
|
|
16
|
+
"message", "pointToPointChannel", "messageQueue", "publishSubscribeChannel", "contentBasedRouter",
|
|
17
|
+
"messageFilter", "splitter", "aggregator", "messageTranslator", "contentEnricher",
|
|
18
|
+
"correlationIdentifier", "idempotentReceiver", "deadLetterChannel",
|
|
19
|
+
"pipelineStage", "gateToProduction", "rollback",
|
|
20
|
+
"toolCall", "contextWindow", "guardrail",
|
|
21
|
+
];
|
|
22
|
+
const ln = (d, c, w = 4, dash = false) => el("path", { d, stroke: c, "stroke-width": w, "stroke-linecap": "round", "stroke-linejoin": "round", fill: "none", ...(dash ? { "stroke-dasharray": "0.1 8" } : {}) });
|
|
23
|
+
const dot = (x, y, col, r = 5) => el("circle", { cx: x, cy: y, r, fill: col });
|
|
24
|
+
const sq = (x, y, col, s = 11) => el("rect", { x: x - s / 2, y: y - s / 2, width: s, height: s, rx: 2, fill: col });
|
|
25
|
+
const node = (x, y, a) => el("path", { d: `M${x} ${y - 8} L${x + 8} ${y} L${x} ${y + 8} L${x - 8} ${y} Z`, fill: a });
|
|
26
|
+
const DRAW = {
|
|
27
|
+
message: (p) => [dot(24, 24, p.c, 8)],
|
|
28
|
+
pointToPointChannel: (p) => [ln("M6 24 H38", p.c), el("circle", { cx: 42, cy: 24, r: 5, fill: p.bg, stroke: p.c, "stroke-width": 3.5 })],
|
|
29
|
+
messageQueue: (p) => [ln("M6 24 H38", p.c, 4, true), dot(14, 24, p.c), dot(24, 24, p.c), el("circle", { cx: 42, cy: 24, r: 5, fill: p.bg, stroke: p.c, "stroke-width": 3.5 })],
|
|
30
|
+
publishSubscribeChannel: (p) => {
|
|
31
|
+
const ring = (x, y) => el("circle", { cx: x, cy: y, r: 5, fill: p.bg, stroke: p.c, "stroke-width": 3.5 });
|
|
32
|
+
return [ln("M4 24 H19 M29 24 H40 M24 19 V8 M24 29 V40", p.c), ring(24, 24), ring(43, 24), ring(24, 6), ring(24, 42)];
|
|
33
|
+
},
|
|
34
|
+
contentBasedRouter: (p) => [ln("M4 24 H16 M32 24 H34 Q38 24 38 20 V14 Q38 10 42 10 H44 M34 24 Q38 24 38 28 V34 Q38 38 42 38 H44", p.c), node(24, 24, p.a)],
|
|
35
|
+
messageFilter: (p) => [ln("M4 24 H44", p.c), ln("M24 24 V36", p.c), ln("M18 40 H30", p.c), node(24, 24, p.a)],
|
|
36
|
+
splitter: (p) => [
|
|
37
|
+
ln("M4 24 H16 M30 16 H44 M30 24 H44 M30 32 H44", p.c), sq(10, 24, p.c, 12), sq(40, 16, p.c, 7), sq(40, 24, p.c, 7), sq(40, 32, p.c, 7),
|
|
38
|
+
el("path", { d: "M22 14 V34", stroke: p.c, "stroke-width": 4, "stroke-linecap": "round" }),
|
|
39
|
+
],
|
|
40
|
+
aggregator: (p) => [
|
|
41
|
+
ln("M4 16 H18 M4 24 H18 M4 32 H18 M32 24 H44", p.c), sq(8, 16, p.c, 7), sq(8, 24, p.c, 7), sq(8, 32, p.c, 7),
|
|
42
|
+
el("path", { d: "M26 14 V34", stroke: p.c, "stroke-width": 4, "stroke-linecap": "round" }), sq(40, 24, p.c, 12),
|
|
43
|
+
],
|
|
44
|
+
messageTranslator: (p) => [ln("M4 24 H44", p.c), dot(14, 24, p.c, 6), sq(36, 24, p.c, 12)],
|
|
45
|
+
contentEnricher: (p) => [ln("M4 24 H44", p.c), ln("M24 8 V18", p.c, 4, true), sq(16, 24, p.c, 10), el("rect", { x: 28, y: 16, width: 14, height: 16, rx: 2, fill: p.c })],
|
|
46
|
+
correlationIdentifier: (p) => [
|
|
47
|
+
sq(14, 24, p.c, 14), el("circle", { cx: 14, cy: 24, r: 3, fill: p.bg }), ln("M22 24 H28", p.c, 3), sq(36, 24, p.c, 14), el("circle", { cx: 36, cy: 24, r: 3, fill: p.bg }),
|
|
48
|
+
],
|
|
49
|
+
idempotentReceiver: (p) => [
|
|
50
|
+
ln("M4 18 H34 M4 30 H34", p.c), dot(12, 18, p.c), dot(12, 30, p.c), el("rect", { x: 34, y: 12, width: 10, height: 24, rx: 3, fill: p.c }), ln("M20 30 L28 30", p.mu, 3),
|
|
51
|
+
],
|
|
52
|
+
deadLetterChannel: (p) => [ln("M4 14 H20 Q26 14 26 20 V30", p.f, 4, true), ln("M14 36 V42 H38 V36", p.f, 3.5), dot(26, 36, p.f, 4)],
|
|
53
|
+
pipelineStage: (p) => [ln("M4 24 H44", p.c), ln("M18 14 V34 M32 14 V34", p.c), dot(10, 24, p.c)],
|
|
54
|
+
gateToProduction: (p) => [ln("M4 24 H44", p.c), el("rect", { x: 20, y: 10, width: 8, height: 28, rx: 3, fill: p.a }), dot(10, 24, p.c), el("circle", { cx: 42, cy: 24, r: 5, fill: p.bg, stroke: p.c, "stroke-width": 3.5 })],
|
|
55
|
+
rollback: (p) => [ln("M40 24 H14", p.c), ln("M14 24 Q6 24 6 16 Q6 8 14 8 H24", p.c, 4, true), el("circle", { cx: 42, cy: 24, r: 5, fill: p.bg, stroke: p.c, "stroke-width": 3.5 })],
|
|
56
|
+
toolCall: (p) => [
|
|
57
|
+
ln("M8 18 H32", p.c), ln("M32 32 H10", p.c, 4, true), el("circle", { cx: 6, cy: 25, r: 5, fill: p.bg, stroke: p.c, "stroke-width": 3.5 }), el("rect", { x: 34, y: 12, width: 10, height: 24, rx: 3, fill: p.c }),
|
|
58
|
+
],
|
|
59
|
+
contextWindow: (p) => [
|
|
60
|
+
el("rect", { x: 6, y: 12, width: 36, height: 24, rx: 5, fill: "none", stroke: p.c, "stroke-width": 3.5 }), dot(14, 24, p.c, 3.5), dot(22, 24, p.c, 3.5), dot(30, 24, p.c, 3.5),
|
|
61
|
+
el("path", { d: "M36 20 V28", stroke: p.c, "stroke-width": 3 }),
|
|
62
|
+
],
|
|
63
|
+
guardrail: (p) => [ln("M4 24 H44", p.c), el("path", { d: "M24 8 V40", stroke: p.a, "stroke-width": 4 }), dot(12, 24, p.c), el("circle", { cx: 40, cy: 24, r: 5, fill: p.bg, stroke: p.c, "stroke-width": 3.5 })],
|
|
64
|
+
};
|
|
65
|
+
const c = (path) => colour(path);
|
|
66
|
+
const drawBrandNotationIcon = (p) => {
|
|
67
|
+
const light = (p.surface ?? "light") === "light";
|
|
68
|
+
const palette = {
|
|
69
|
+
c: light ? c("brand.light.text") : c("brand.dark.text"),
|
|
70
|
+
a: light ? c("brand.light.accent") : c("brand.dark.accent"),
|
|
71
|
+
f: light ? c("brand.light.failure") : c("brand.dark.failure"),
|
|
72
|
+
bg: light ? c("brand.light.bg") : c("brand.dark.bg"),
|
|
73
|
+
mu: light ? c("brand.light.textMuted") : c("brand.dark.textMuted"),
|
|
74
|
+
};
|
|
75
|
+
const glyph = DRAW[p.name](palette);
|
|
76
|
+
return drawn([g({ "data-piece": `brand-icon-${p.name}`, transform: `translate(${p.x} ${p.y}) scale(${p.scale ?? 1})`, stroke: "none" }, ...glyph)]);
|
|
77
|
+
};
|
|
78
|
+
/** One of the 19 brand notation icons (I11): 13 EIP + 3 delivery + 3 AI, a 48×48 glyph before `scale`. */
|
|
79
|
+
export const brandNotationIcon = definePiece("brandNotationIcon", { name: { kind: "enum", required: true, values: BRAND_NOTATION_ICON_NAMES }, x: pos(), y: pos(), surface: surfaceParam, scale: num({ min: 0.25, max: 8 }) }, drawBrandNotationIcon);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const CATEGORY_ICON_NAMES: readonly ["integration", "delivery", "aiEngineering", "personalTools", "mulesoft", "contributions"];
|
|
2
|
+
export type CategoryIconName = (typeof CATEGORY_ICON_NAMES)[number];
|
|
3
|
+
/** The badge's box before `scale` (spec cover-cli, "Icon output"). */
|
|
4
|
+
export declare const CATEGORY_ICON_SIZE = 42;
|
|
5
|
+
export type CategoryIconParams = {
|
|
6
|
+
category: CategoryIconName;
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
scale?: number;
|
|
10
|
+
};
|
|
11
|
+
/** One of the site's category badges: the glyph on a disc in its track's default tone, a 42×42 box before `scale`. */
|
|
12
|
+
export declare const categoryIcon: import("./piece.ts").Piece<CategoryIconParams>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// The site's category badge (change site-palette-and-category-badges, design.md
|
|
2
|
+
// Decision 2; owner's choice Q7 of card 302): a disc in the default tone of a
|
|
3
|
+
// track family, ringed in that tone's cover ring, with a glyph on it, in a
|
|
4
|
+
// 42 x 42 box before `scale`. Integration, delivery and AI take a brand
|
|
5
|
+
// notation glyph. Personal tools keeps its own (a wrench crossing a
|
|
6
|
+
// screwdriver, a ring for the bolt), ported from
|
|
7
|
+
// `~/.hermes/cache/scratch/ab267/phase4.py`'s `cat_icon()`. The disc and those
|
|
8
|
+
// four glyphs are the approved preview
|
|
9
|
+
// (`~/.hermes/cache/scratch/ab302/cat/cat.mjs`, 168 x 168) at a quarter. The
|
|
10
|
+
// projects page's MuleSoft and Contributions draw their own glyphs (change
|
|
11
|
+
// project-category-and-recipient-list-icons).
|
|
12
|
+
import { brandNotationIcon } from "./brand-notation-icons.js";
|
|
13
|
+
import { drawn, el, g } from "./node.js";
|
|
14
|
+
import { colour, num, pos } from "./params.js";
|
|
15
|
+
import { definePiece } from "./piece.js";
|
|
16
|
+
export const CATEGORY_ICON_NAMES = ["integration", "delivery", "aiEngineering", "personalTools", "mulesoft", "contributions"];
|
|
17
|
+
/** The badge's box before `scale` (spec cover-cli, "Icon output"). */
|
|
18
|
+
export const CATEGORY_ICON_SIZE = 42;
|
|
19
|
+
const TRACK = {
|
|
20
|
+
integration: "trackIntegration",
|
|
21
|
+
delivery: "trackDelivery",
|
|
22
|
+
aiEngineering: "trackAi",
|
|
23
|
+
personalTools: "trackPersonal",
|
|
24
|
+
// The projects page's own categories repeat two track tones; the glyph tells them apart.
|
|
25
|
+
mulesoft: "trackIntegration",
|
|
26
|
+
contributions: "trackDelivery",
|
|
27
|
+
};
|
|
28
|
+
const GLYPH = {
|
|
29
|
+
integration: "pointToPointChannel",
|
|
30
|
+
delivery: "gateToProduction",
|
|
31
|
+
aiEngineering: "contextWindow",
|
|
32
|
+
};
|
|
33
|
+
const KEBAB = { integration: "integration", delivery: "delivery", aiEngineering: "ai-engineering", personalTools: "personal-tools", mulesoft: "mulesoft", contributions: "contributions" };
|
|
34
|
+
/** Personal tools' own glyph, in its 48 x 48 box, at 9, 9 and scale 0.5 like a notation glyph. */
|
|
35
|
+
const personalToolsGlyph = () => g({ transform: "translate(9 9) scale(0.5)", stroke: "none" }, el("path", { d: "M12 36 L28 20 M24 12 L36 24", stroke: colour("brand.light.text"), "stroke-width": 5, "stroke-linecap": "round", "stroke-linejoin": "round", fill: "none" }), el("circle", { cx: 16, cy: 32, r: 6, fill: "none", stroke: colour("brand.light.accent"), "stroke-width": 3.5 }));
|
|
36
|
+
const line = (d, width) => el("path", { d, stroke: colour("brand.light.text"), "stroke-width": width, "stroke-linecap": "round", "stroke-linejoin": "round", fill: "none" });
|
|
37
|
+
const dot = (cx, cy, r, token = "brand.light.text") => el("circle", { cx, cy, r, fill: colour(token) });
|
|
38
|
+
const ring = (cx, cy) => el("circle", { cx, cy, r: 5, fill: colour("brand.light.bg"), stroke: colour("brand.light.text"), "stroke-width": 3.5 });
|
|
39
|
+
const ownGlyph = (...shapes) => g({ transform: "translate(9 9) scale(0.5)", stroke: "none" }, ...shapes);
|
|
40
|
+
/** The glyphs that are not brand notation, in the same 48 x 48 box: tools, systems joined by an API, a pull request. */
|
|
41
|
+
const OWN_GLYPH = {
|
|
42
|
+
personalTools: personalToolsGlyph,
|
|
43
|
+
mulesoft: () => ownGlyph(line("M8 12 L24 24 L8 36 M24 24 H40", 4), dot(8, 12, 5), dot(8, 36, 5), dot(24, 24, 7, "brand.light.accent"), ring(41, 24)),
|
|
44
|
+
contributions: () => ownGlyph(line("M14 14 V34", 4), line("M34 18 C34 30 14 24 14 34", 3.5), ring(14, 10), ring(14, 38), dot(34, 13, 6, "brand.light.accent")),
|
|
45
|
+
};
|
|
46
|
+
const drawCategoryIcon = (p) => {
|
|
47
|
+
const track = TRACK[p.category];
|
|
48
|
+
const disc = el("circle", { cx: 21, cy: 21, r: 19.5, fill: colour(`coverBackground.${track}.fill`), stroke: colour(`coverBackground.${track}.ring`), "stroke-width": 1 });
|
|
49
|
+
const glyph = p.category === "integration" || p.category === "delivery" || p.category === "aiEngineering"
|
|
50
|
+
? brandNotationIcon({ name: GLYPH[p.category], x: 9, y: 9, scale: 0.5, surface: "light" }).body[0]
|
|
51
|
+
: OWN_GLYPH[p.category]();
|
|
52
|
+
return drawn([g({ "data-piece": `category-icon-${KEBAB[p.category]}`, transform: `translate(${p.x} ${p.y}) scale(${p.scale ?? 1})` }, disc, glyph)]);
|
|
53
|
+
};
|
|
54
|
+
/** One of the site's category badges: the glyph on a disc in its track's default tone, a 42×42 box before `scale`. */
|
|
55
|
+
export const categoryIcon = definePiece("categoryIcon", { category: { kind: "enum", required: true, values: CATEGORY_ICON_NAMES }, x: pos(), y: pos(), scale: num({ min: 0.25, max: 8 }) }, drawCategoryIcon);
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { type PieceName } from "./library.ts";
|
|
2
|
+
import { type SvgNode } from "./node.ts";
|
|
3
|
+
import { type Problem } from "./params.ts";
|
|
4
|
+
export declare const SAFE_ID: RegExp;
|
|
5
|
+
/** Cover (800x420, the default), banner (1200x420, rounded corners), body diagram (560 laid out, 800 shown),
|
|
6
|
+
* icon, favicon (the symbol, both themes), linkedin-card (1080x1080), avatar (500x500, the symbol only) or
|
|
7
|
+
* linkedin-banner (1584x396, a profile background): spec cover-cli, "Banner output", "Diagram output",
|
|
8
|
+
* "Icon output", "New icon formats", "LinkedIn banner output". */
|
|
9
|
+
export declare const FORMATS: readonly ["cover", "banner", "diagram", "icon", "favicon", "linkedin-card", "og", "avatar", "linkedin-banner"];
|
|
10
|
+
export type CoverFormat = (typeof FORMATS)[number];
|
|
11
|
+
/** Fixed frame sizes of the platform-shaped formats (not style, so not tokens — like EIP_ICON_WIDTH). */
|
|
12
|
+
export declare const FAVICON_SIZE = 32;
|
|
13
|
+
export declare const AVATAR_SIZE = 500;
|
|
14
|
+
export declare const LINKEDIN_CARD_SIZE = 1080;
|
|
15
|
+
export declare const OG_WIDTH = 1200;
|
|
16
|
+
export declare const OG_HEIGHT = 630;
|
|
17
|
+
/** LinkedIn's recommended upload for a personal profile background (4:1). */
|
|
18
|
+
export declare const LINKEDIN_BANNER_WIDTH = 1584;
|
|
19
|
+
export declare const LINKEDIN_BANNER_HEIGHT = 396;
|
|
20
|
+
/** Margin added to each profile photo radius for the safe area: the measuring error, the platform's rounding and small drift. */
|
|
21
|
+
export declare const LINKEDIN_PHOTO_MARGIN = 16;
|
|
22
|
+
export type LinkedinPhotoZone = {
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly cx: number;
|
|
25
|
+
readonly cy: number;
|
|
26
|
+
readonly r: number;
|
|
27
|
+
readonly safeRadius: number;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The circles LinkedIn's profile photo covers on a 1584x396 banner, in banner units, the photo's white ring included
|
|
31
|
+
* (spec cover-cli, "LinkedIn profile photo zones"). Measured by the owner on 2026-11-11 from screenshots of his own
|
|
32
|
+
* profile, about ±2 units: desktop web (the 792 px profile card, the banner at 0.5) and the iOS app (full width, about
|
|
33
|
+
* 0.28 on a 440-pt phone; the centre lies below the image's bottom edge). The Android app and desktop windows narrow
|
|
34
|
+
* enough to change the card's width were not measured. The command does not check a spec against them; the PNG
|
|
35
|
+
* script draws them over a render (`npm run png -- … --zones`).
|
|
36
|
+
*/
|
|
37
|
+
export declare const LINKEDIN_PHOTO_ZONES: readonly LinkedinPhotoZone[];
|
|
38
|
+
export type CoverPiece = {
|
|
39
|
+
piece: PieceName;
|
|
40
|
+
} & Record<string, unknown>;
|
|
41
|
+
export type CustomNode = {
|
|
42
|
+
tag: string;
|
|
43
|
+
attrs?: Record<string, unknown>;
|
|
44
|
+
children?: (CustomNode | string)[];
|
|
45
|
+
};
|
|
46
|
+
export type CoverRings = {
|
|
47
|
+
cx: number;
|
|
48
|
+
cy: number;
|
|
49
|
+
radius?: number;
|
|
50
|
+
};
|
|
51
|
+
type SpecCommon = {
|
|
52
|
+
id: string;
|
|
53
|
+
pieces: CoverPiece[];
|
|
54
|
+
/** One table per language; `"@key"` strings elsewhere are replaced for the language asked. */
|
|
55
|
+
text?: Record<string, Record<string, string | string[]>>;
|
|
56
|
+
};
|
|
57
|
+
type Framed = SpecCommon & {
|
|
58
|
+
title: string;
|
|
59
|
+
description: string;
|
|
60
|
+
rings: CoverRings;
|
|
61
|
+
custom?: CustomNode;
|
|
62
|
+
/** `custom` is drawn before `pieces[customAt]`; default after every piece. */
|
|
63
|
+
customAt?: number;
|
|
64
|
+
/** Mira and the symbol, bottom-right corner, `cover.signatureMargin` from both edges (spec cover-cli, "Signature lockup"). */
|
|
65
|
+
signature?: boolean;
|
|
66
|
+
};
|
|
67
|
+
/** A cover spec, by format (spec cover-cli, "Cover spec format" and each format's keys). */
|
|
68
|
+
export type CoverSpec = (Framed & {
|
|
69
|
+
format?: "cover" | "banner" | "linkedin-card" | "og";
|
|
70
|
+
background: string;
|
|
71
|
+
height?: never;
|
|
72
|
+
}) | (Omit<Framed, "signature"> & {
|
|
73
|
+
format: "linkedin-banner";
|
|
74
|
+
background: string;
|
|
75
|
+
height?: never;
|
|
76
|
+
signature?: never;
|
|
77
|
+
}) | (Framed & {
|
|
78
|
+
format: "diagram"; /** Layout units. */
|
|
79
|
+
height: number;
|
|
80
|
+
background?: never;
|
|
81
|
+
}) | (SpecCommon & {
|
|
82
|
+
format: "icon";
|
|
83
|
+
/** Not in an eipIcon spec: the icon's own title and description, with the credit, are drawn. */
|
|
84
|
+
title?: string;
|
|
85
|
+
description?: string;
|
|
86
|
+
background?: never;
|
|
87
|
+
rings?: never;
|
|
88
|
+
custom?: never;
|
|
89
|
+
customAt?: never;
|
|
90
|
+
height?: never;
|
|
91
|
+
signature?: never;
|
|
92
|
+
}) | (Omit<SpecCommon, "pieces"> & {
|
|
93
|
+
format: "favicon";
|
|
94
|
+
pieces?: never[];
|
|
95
|
+
title?: string;
|
|
96
|
+
description?: string;
|
|
97
|
+
background?: never;
|
|
98
|
+
rings?: never;
|
|
99
|
+
custom?: never;
|
|
100
|
+
customAt?: never;
|
|
101
|
+
height?: never;
|
|
102
|
+
signature?: never;
|
|
103
|
+
}) | (Omit<SpecCommon, "pieces"> & {
|
|
104
|
+
format: "avatar";
|
|
105
|
+
pieces?: never[];
|
|
106
|
+
title?: string;
|
|
107
|
+
description?: string;
|
|
108
|
+
/** A `coverBackground` name: the square takes its fill (spec cover-cli, "Avatar ground"). */
|
|
109
|
+
background?: string;
|
|
110
|
+
rings?: never;
|
|
111
|
+
custom?: never;
|
|
112
|
+
customAt?: never;
|
|
113
|
+
height?: never;
|
|
114
|
+
signature?: never;
|
|
115
|
+
});
|
|
116
|
+
export declare const backgroundNames: () => string[];
|
|
117
|
+
/** Compares JSON paths: segment by segment, array indexes as numbers, names by code point. */
|
|
118
|
+
export declare const comparePaths: (a: string, b: string) => number;
|
|
119
|
+
/** A language of a text table and of `--lang`: `pt`, `en`, `pt-br`. */
|
|
120
|
+
export declare const LANGUAGE: RegExp;
|
|
121
|
+
export type CoverOptions = {
|
|
122
|
+
lang?: string;
|
|
123
|
+
};
|
|
124
|
+
/** Every problem of a parsed spec, sorted by path; empty when the spec is valid. `lang` picks a text table. */
|
|
125
|
+
export declare const validateCoverSpec: (spec: unknown, options?: CoverOptions) => Problem[];
|
|
126
|
+
/** Rings a banner draws: out to the frame's farthest corner (spec cover-cli, "Banner rings reach the corners").
|
|
127
|
+
* The frame defaults to the banner's (1200x420); a LinkedIn banner passes its 1584x396 ("Ring count takes a frame size"). */
|
|
128
|
+
export declare const bannerRingCount: (cx: number, cy: number, radius?: number, width?: number, height?: number) => number;
|
|
129
|
+
/** Rings of a diagram (spec cover-cli, "Diagram rings at the shown scale"): the cover's step and width at the shown scale. */
|
|
130
|
+
export declare const diagramRings: (cx: number, cy: number, height: number, radius?: number) => {
|
|
131
|
+
count: number;
|
|
132
|
+
step: number;
|
|
133
|
+
width: number;
|
|
134
|
+
radius: number;
|
|
135
|
+
};
|
|
136
|
+
/** The cover's (banner's, diagram's, icon's, favicon's, avatar's) node tree. The spec must be valid for `lang` (validateCoverSpec returned no problem). */
|
|
137
|
+
export declare const coverTree: (input: CoverSpec, options?: CoverOptions) => SvgNode;
|
|
138
|
+
export {};
|