@333eco/brand 1.11.0 → 1.12.1

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 CHANGED
@@ -152,6 +152,10 @@ an H3QR names whom you thank, and a B-QR is how that code is drawn.
152
152
  frames an address someone chose. ⛔ A position is a declaration, never a proof: nothing public may say one shows who drew it.
153
153
  - **B-Watermark℠ (v1.11.0)** = the invisible mark, the B-QR, its position, B-Autograph℠ and B-Fingerprint℠, in a person's own picture: `/watermark/`. The
154
154
  fingerprint is `qr/fingerprint.ts`, open and self-contained (`npm run fingerprint:test`).
155
+ - **Two looks with no code (v1.12.0, founder 2026-11-25: *"yes to faint"* · *"how about B-Symbol ?"*):** `qr/looks.ts` draws the SILHOUETTE (the
156
+ B-Emblem faint, 0.4 white, a person's autograph on it) and the B-SYMBOL℠ (a tiny emblem beside a person's B-Autograph℠, as a ™). ⛔ Never without
157
+ the invisible mark in the same file (the caller forces it on and reads it back) · ⛔ no B-Autograph on a picture declared AI-made, so no B-Symbol
158
+ on one · `paintAutograph` is the lobe's own drawing, moved so both can use it (§looks LK1–LK4).
155
159
  - **The card's words are PLACED, never aligned (v1.6.1).** `paintQrCard` measures each line, shrinks its size until it fits,
156
160
  and draws it from the left at the center minus half its width. Safari on iOS 26 ignores `textAlign = "center"` and the
157
161
  `maxWidth` argument for a complex script: a Khmer caption printed starting at the center line. Measured on the Simulator
package/brand.lock CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.11.0",
2
+ "version": "1.12.1",
3
3
  "files": {
4
4
  "css/metta.css": "9bfe986c46c303bf9a48be85322d68e3d626571a424ef3a8aa81faaf5c866692",
5
5
  "css/motion.css": "9bfbe39c0de6a9dfaf9fdc2c61e327b3c8e70221c34dff9befd85da448b9e0c2",
@@ -11,7 +11,8 @@
11
11
  "emblem/emblem.svg": "368f520ad2d2f9db50d83ca9cd7aee9475948dc8e38c61b7afa13f7717fef903",
12
12
  "emblem/emblem.ts": "6e150389eed576c392ff6231c0b38b8fea5d4c11f7a5b21936bb25afab069890",
13
13
  "qr/bqr-card.ts": "55b4cf3d742bb758f789fd18f91737e8da1169610b6b953ad71e95d8bb713168",
14
- "qr/bqr.ts": "fd55381f7298d3b79dcfbec01fbb5b6db117ddaffad48872f59f01bb15a3f6df",
15
- "qr/fingerprint.ts": "4a587cdb3b5ff6026262f995889c329466a2513044a68c0b5d2fa31c2bdd45a3"
14
+ "qr/bqr.ts": "a5561877ddebefa170d7962b37485ac5b822c1c7454e153e11526fa199f0a99d",
15
+ "qr/fingerprint.ts": "4a587cdb3b5ff6026262f995889c329466a2513044a68c0b5d2fa31c2bdd45a3",
16
+ "qr/looks.ts": "3853e04503f42e9d8b70b656469ae9645c35ae0fcd5b927b59f92b2f55a9fb2f"
16
17
  }
17
18
  }
package/data/brand.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "into brand.lock, which is vendored byte-identical into every consumer,",
9
9
  "so 'which sites are on which brand version' is answerable by grep."
10
10
  ],
11
- "version": "1.11.0",
11
+ "version": "1.12.1",
12
12
  "wordmark": {
13
13
  "$comment": [
14
14
  "The composition has an internal short-name as of 2026-09-20: B-Wordmark",
package/dist/Brand.kt CHANGED
@@ -18,7 +18,7 @@ import androidx.compose.ui.graphics.lerp
18
18
  import androidx.compose.ui.unit.dp
19
19
 
20
20
  object Brand {
21
- const val VERSION = "1.11.0"
21
+ const val VERSION = "1.12.1"
22
22
 
23
23
  /** The B-Gem media-type palette. A colour here MEANS a medium.
24
24
  * Not a site palette, and not the six-TLD rainbow. */
package/dist/Brand.swift CHANGED
@@ -14,7 +14,7 @@
14
14
  import SwiftUI
15
15
 
16
16
  public enum Brand {
17
- public static let version = "1.11.0"
17
+ public static let version = "1.12.1"
18
18
 
19
19
  /// The B-Gem media-type palette. A colour here MEANS a medium.
20
20
  /// ⚠️ Not a site palette, and not the six-TLD rainbow. Using a gem as an
package/dist/tokens.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$comment": "GENERATED by scripts/generate.mjs. Do not edit. Values are parsed from css/tokens.css, which is canonical; semantics come from data/. Run `node scripts/generate.mjs --check` to prove this file is current.",
3
- "version": "1.11.0",
3
+ "version": "1.12.1",
4
4
  "gems": [
5
5
  {
6
6
  "name": "ruby",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@333eco/brand",
3
- "version": "1.11.0",
3
+ "version": "1.12.1",
4
4
  "description": "The canonical brand layer for the institution — design tokens, themes, motion, and the B-Emblem. A READ-ONLY MIRROR; institution repos vendor this layer, they do not install it.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Thon Ly",
package/qr/bqr.ts CHANGED
@@ -365,7 +365,15 @@ function drawTm(g: CanvasRenderingContext2D, style: BqrStyle): void {
365
365
  /** ⭐ v1.10.0 — FITTED: the drawing keeps its own shape, grows to fill its box (at most twice the pad's own scale) and stands at the lobe's center,
366
366
  * wherever on the pad it was drawn. It cannot leave its box, so it can never reach the code. */
367
367
  function drawAutograph(g: CanvasRenderingContext2D, a: BqrAutograph, ink: string, fit: boolean): void {
368
- const B = BQR_AUTOGRAPH, pad = B.w / BQR_PAD_W, pen = BQR_AUTOGRAPH_PEN * pad;
368
+ paintAutograph(g, a, BQR_AUTOGRAPH, ink, fit);
369
+ }
370
+ /**
371
+ * ⭐ v1.12.0 — the same drawing into ANY box (the B-QR's lobe above; the silhouette and the B-Symbol℠ in `looks.ts`), in the context's current
372
+ * units. The pen is 3% of the box's width, as in the lobe. Returns where the ink landed, pen included, so a caller can stand something
373
+ * beside it (the B-Symbol's emblem).
374
+ */
375
+ export function paintAutograph(g: CanvasRenderingContext2D, a: BqrAutograph, B: { x: number; y: number; w: number; h: number }, ink: string, fit = true): { x: number; y: number; w: number; h: number } {
376
+ const pad = B.w / BQR_PAD_W, pen = BQR_AUTOGRAPH_PEN * pad;
369
377
  let x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity;
370
378
  for (const s of a.strokes) for (const [x, y] of s) { x0 = Math.min(x0, x); x1 = Math.max(x1, x); y0 = Math.min(y0, y); y1 = Math.max(y1, y); }
371
379
  const k = fit ? Math.min(2 * pad, (B.w - pen) / Math.max(x1 - x0, 1e-6), (B.h - pen) / Math.max(y1 - y0, 1e-6)) : pad;
@@ -380,6 +388,9 @@ function drawAutograph(g: CanvasRenderingContext2D, a: BqrAutograph, ink: string
380
388
  g.lineTo(s[s.length - 1][0], s[s.length - 1][1]); g.stroke();
381
389
  }
382
390
  g.restore();
391
+ const w = (x1 - x0) * k, h = (y1 - y0) * k;
392
+ return fit ? { x: B.x + B.w / 2 - w / 2 - pen / 2, y: B.y + B.h / 2 - h / 2 - pen / 2, w: w + pen, h: h + pen }
393
+ : { x: B.x + x0 * k - pen / 2, y: B.y + y0 * k - pen / 2, w: w + pen, h: h + pen };
383
394
  }
384
395
 
385
396
  /**
package/qr/looks.ts ADDED
@@ -0,0 +1,74 @@
1
+ /**
2
+ * The two B-Watermark℠ looks with no code (v1.12.0; founder 2026-11-25: *"change it; AI-made pictures cannot have a B-Autograph; yes to
3
+ * faint"* · *"how about B-Symbol ?"*):
4
+ *
5
+ * SILHOUETTE — the B-Emblem, FAINT: a see-through white heart with a soft edge, a person's B-Autograph℠ on it when they may add one.
6
+ * B-SYMBOL℠ — a tiny B-Emblem beside a person's B-Autograph, as a ™ stands beside a name, for artists who already sign their work.
7
+ *
8
+ * ⛔ NEVER WITHOUT THE INVISIBLE MARK IN THE SAME FILE. Neither look carries an address, so the caller (origin.333.eco) forces the invisible
9
+ * mark on and reads it back before the press, and refuses the look if it doesn't hold. This file only draws; it cannot see the file.
10
+ * (The 11/23 rule *"the B-Emblem never stands alone in a file's pixels"* was amended to exactly this on 2026-11-25.)
11
+ * ⛔ NO B-AUTOGRAPH ON A PICTURE DECLARED AI-MADE, so a B-Symbol is never on one: the caller decides; `paintSymbol` needs an autograph.
12
+ * ⛔ No word in the pixels, ever: no *signed*, *verified* or *real*. A static emblem asserts no humanness (the two proof-states, 7/01).
13
+ * ⛔ VENDORED, NEVER EDITED IN A CONSUMER: `brand.lock` hashes this file.
14
+ */
15
+ import { EMBLEM_BOX, EMBLEM_D, BQR_OUTLINE, bqrOwnerInk, isAutograph, paintAutograph, type BqrAutograph } from "./bqr";
16
+
17
+ /** How faint: the white let through inside the heart, and the edge's ink. ⭐ "yes to faint" (founder 2026-11-25). */
18
+ export const SILHOUETTE = { white: 0.4, edge: 0.35, line: BQR_OUTLINE * 2 } as const;
19
+ /**
20
+ * The autograph's box on the silhouette, 5 : 3, in viewBox units. Solved from the silhouette: the largest 5 : 3 box at least 0.6 units inside
21
+ * its edge is 14.19 wide, centered at (11.6, 14.15); this one is 12 wide at the same center, for air. `scripts/bqr.test.mjs` §looks holds it.
22
+ */
23
+ export const SILHOUETTE_AUTOGRAPH = { x: 11.6 - 6, y: 14.15 - 3.6, w: 12, h: 7.2 } as const;
24
+ /** The B-Symbol's emblem beside the ink: its height as a part of the ink's height, and the gap before it, as a part of that height. */
25
+ export const SYMBOL = { size: 0.3, gap: 0.2 } as const;
26
+ /** The ink a person's own hand is drawn in when the caller names none: Space's, as every mark of 333.eco (the body palette, `MA`). */
27
+ export const LOOK_INK = bqrOwnerInk("MA");
28
+
29
+ /** Where the silhouette stands in the square `size` at (x, y): its scale and offset, from the emblem's painted box (as `bqrPlacement`, unpadded). */
30
+ export function silhouettePlacement(size: number, x = 0, y = 0): { k: number; tx: number; ty: number } {
31
+ const k = size / Math.max(EMBLEM_BOX.w, EMBLEM_BOX.h);
32
+ return { k, tx: x + (size - EMBLEM_BOX.w * k) / 2 - EMBLEM_BOX.x * k, ty: y + (size - EMBLEM_BOX.h * k) / 2 - EMBLEM_BOX.y * k };
33
+ }
34
+ /** ⭐ v1.12.1 — the autograph's box on a silhouette in the square `size` at (x, y), in the context's own units, so a caller can read the
35
+ * picture under it and choose the ink before painting (origin does). */
36
+ export function silhouetteAutographBox(size: number, x = 0, y = 0) {
37
+ const { k, tx, ty } = silhouettePlacement(size, x, y), A = SILHOUETTE_AUTOGRAPH;
38
+ return { x: tx + A.x * k, y: ty + A.y * k, w: A.w * k, h: A.h * k };
39
+ }
40
+ /** Paint the SILHOUETTE into the square `size` at (x, y), its autograph on it when one is given. Clears nothing: it is drawn ON a picture. */
41
+ export function paintSilhouette(g: CanvasRenderingContext2D, o: { size: number; x?: number; y?: number; white?: number; edgeInk?: string; autograph?: BqrAutograph; ink?: string }): void {
42
+ if (o.autograph !== undefined && !isAutograph(o.autograph)) throw new Error("silhouette: an autograph is a person's own strokes.");
43
+ const { k, tx, ty } = silhouettePlacement(o.size, o.x, o.y), path = new Path2D(EMBLEM_D);
44
+ g.save(); g.translate(tx, ty); g.scale(k, k);
45
+ g.fillStyle = `rgba(255,255,255,${o.white ?? SILHOUETTE.white})`; g.fill(path);
46
+ g.globalAlpha = SILHOUETTE.edge; g.strokeStyle = o.edgeInk ?? LOOK_INK; g.lineWidth = SILHOUETTE.line; g.lineJoin = "round"; g.stroke(path);
47
+ g.restore();
48
+ if (o.autograph) paintAutograph(g, o.autograph, silhouetteAutographBox(o.size, o.x, o.y), o.ink ?? LOOK_INK);
49
+ }
50
+
51
+ /** Where a B-Symbol lands for an autograph fitted to `box`: the ink, the emblem beside it, and the whole. Pure: nothing is drawn. */
52
+ export function symbolLayout(a: BqrAutograph, box: { x: number; y: number; w: number; h: number }) {
53
+ if (!isAutograph(a)) throw new Error("B-Symbol: it stands beside a person's own B-Autograph, never alone.");
54
+ const ink = paintAutograph(nullContext(), a, box, "#000");
55
+ const s = ink.h * SYMBOL.size, em = { x: ink.x + ink.w + s * SYMBOL.gap, y: ink.y, w: s, h: s };
56
+ const x1 = Math.max(ink.x + ink.w, em.x + em.w), y1 = Math.max(ink.y + ink.h, em.y + em.h);
57
+ return { ink, emblem: em, all: { x: ink.x, y: ink.y, w: x1 - ink.x, h: y1 - ink.y } };
58
+ }
59
+ /** Paint the B-SYMBOL: the person's autograph fitted to `box`, and the B-Emblem at its upper right, in the same ink, as a ™. */
60
+ export function paintSymbol(g: CanvasRenderingContext2D, o: { autograph: BqrAutograph; box: { x: number; y: number; w: number; h: number }; ink?: string }) {
61
+ const L = symbolLayout(o.autograph, o.box), ink = o.ink ?? LOOK_INK;
62
+ paintAutograph(g, o.autograph, o.box, ink);
63
+ const k = L.emblem.w / Math.max(EMBLEM_BOX.w, EMBLEM_BOX.h);
64
+ g.save(); g.translate(L.emblem.x - EMBLEM_BOX.x * k, L.emblem.y - EMBLEM_BOX.y * k); g.scale(k, k);
65
+ g.fillStyle = ink; g.fill(new Path2D(EMBLEM_D));
66
+ g.restore();
67
+ return L;
68
+ }
69
+
70
+ /** A context that draws nothing, so the layout is measured by the very code that paints (never a second copy of the arithmetic). */
71
+ function nullContext(): CanvasRenderingContext2D {
72
+ const no = () => undefined;
73
+ return new Proxy({} as CanvasRenderingContext2D, { get: () => no, set: () => true });
74
+ }