@promptctl/rich-js 0.6.0 → 0.8.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 (153) hide show
  1. package/README.md +31 -30
  2. package/dist/core/box.d.ts +3 -3
  3. package/dist/core/box.d.ts.map +1 -1
  4. package/dist/core/box.js.map +1 -1
  5. package/dist/core/cells.d.ts +46 -1
  6. package/dist/core/cells.d.ts.map +1 -1
  7. package/dist/core/cells.js +55 -14
  8. package/dist/core/cells.js.map +1 -1
  9. package/dist/core/console.d.ts +28 -10
  10. package/dist/core/console.d.ts.map +1 -1
  11. package/dist/core/console.js +141 -80
  12. package/dist/core/console.js.map +1 -1
  13. package/dist/core/markup.d.ts +0 -2
  14. package/dist/core/markup.d.ts.map +1 -1
  15. package/dist/core/markup.js +31 -17
  16. package/dist/core/markup.js.map +1 -1
  17. package/dist/core/measure.d.ts +11 -0
  18. package/dist/core/measure.d.ts.map +1 -1
  19. package/dist/core/measure.js +15 -3
  20. package/dist/core/measure.js.map +1 -1
  21. package/dist/core/oklch.d.ts +22 -0
  22. package/dist/core/oklch.d.ts.map +1 -1
  23. package/dist/core/oklch.js +62 -18
  24. package/dist/core/oklch.js.map +1 -1
  25. package/dist/core/pretty.d.ts +87 -0
  26. package/dist/core/pretty.d.ts.map +1 -0
  27. package/dist/core/pretty.js +304 -0
  28. package/dist/core/pretty.js.map +1 -0
  29. package/dist/core/protocol.d.ts +64 -0
  30. package/dist/core/protocol.d.ts.map +1 -1
  31. package/dist/core/protocol.js +72 -0
  32. package/dist/core/protocol.js.map +1 -1
  33. package/dist/core/segment.d.ts +21 -0
  34. package/dist/core/segment.d.ts.map +1 -1
  35. package/dist/core/segment.js +40 -1
  36. package/dist/core/segment.js.map +1 -1
  37. package/dist/core/subscription.d.ts +13 -0
  38. package/dist/core/subscription.d.ts.map +1 -0
  39. package/dist/core/subscription.js +13 -0
  40. package/dist/core/subscription.js.map +1 -0
  41. package/dist/core/text.d.ts.map +1 -1
  42. package/dist/core/text.js +45 -13
  43. package/dist/core/text.js.map +1 -1
  44. package/dist/host/host-stream.d.ts +31 -0
  45. package/dist/host/host-stream.d.ts.map +1 -0
  46. package/dist/host/host-stream.js +36 -0
  47. package/dist/host/host-stream.js.map +1 -0
  48. package/dist/host/index.d.ts +4 -0
  49. package/dist/host/index.d.ts.map +1 -0
  50. package/dist/host/index.js +3 -0
  51. package/dist/host/index.js.map +1 -0
  52. package/dist/host/terminal-host.d.ts +144 -0
  53. package/dist/host/terminal-host.d.ts.map +1 -0
  54. package/dist/host/terminal-host.js +133 -0
  55. package/dist/host/terminal-host.js.map +1 -0
  56. package/dist/index.d.ts +11 -35
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +36 -22
  59. package/dist/index.js.map +1 -1
  60. package/dist/node/terminal-host.d.ts +85 -0
  61. package/dist/node/terminal-host.d.ts.map +1 -0
  62. package/dist/node/terminal-host.js +161 -0
  63. package/dist/node/terminal-host.js.map +1 -0
  64. package/dist/node/traceback.d.ts +28 -0
  65. package/dist/node/traceback.d.ts.map +1 -0
  66. package/dist/node/traceback.js +113 -0
  67. package/dist/node/traceback.js.map +1 -0
  68. package/dist/renderables/columns.d.ts +24 -2
  69. package/dist/renderables/columns.d.ts.map +1 -1
  70. package/dist/renderables/columns.js +91 -32
  71. package/dist/renderables/columns.js.map +1 -1
  72. package/dist/renderables/layout.d.ts +61 -5
  73. package/dist/renderables/layout.d.ts.map +1 -1
  74. package/dist/renderables/layout.js +191 -19
  75. package/dist/renderables/layout.js.map +1 -1
  76. package/dist/renderables/padding.d.ts +15 -2
  77. package/dist/renderables/padding.d.ts.map +1 -1
  78. package/dist/renderables/padding.js +92 -37
  79. package/dist/renderables/padding.js.map +1 -1
  80. package/dist/renderables/panel.d.ts +44 -3
  81. package/dist/renderables/panel.d.ts.map +1 -1
  82. package/dist/renderables/panel.js +149 -80
  83. package/dist/renderables/panel.js.map +1 -1
  84. package/dist/renderables/table.d.ts +40 -4
  85. package/dist/renderables/table.d.ts.map +1 -1
  86. package/dist/renderables/table.js +276 -158
  87. package/dist/renderables/table.js.map +1 -1
  88. package/dist/renderables/traceback.d.ts +6 -2
  89. package/dist/renderables/traceback.d.ts.map +1 -1
  90. package/dist/renderables/traceback.js +6 -10
  91. package/dist/renderables/traceback.js.map +1 -1
  92. package/dist/renderables/tree.d.ts +27 -2
  93. package/dist/renderables/tree.d.ts.map +1 -1
  94. package/dist/renderables/tree.js +82 -23
  95. package/dist/renderables/tree.js.map +1 -1
  96. package/dist/template-bindings/color-funcs.d.ts +78 -0
  97. package/dist/template-bindings/color-funcs.d.ts.map +1 -0
  98. package/dist/template-bindings/color-funcs.js +212 -0
  99. package/dist/template-bindings/color-funcs.js.map +1 -0
  100. package/dist/template-bindings/index.d.ts +24 -18
  101. package/dist/template-bindings/index.d.ts.map +1 -1
  102. package/dist/template-bindings/index.js +26 -19
  103. package/dist/template-bindings/index.js.map +1 -1
  104. package/dist/template-bindings/palette-funcs.d.ts +70 -51
  105. package/dist/template-bindings/palette-funcs.d.ts.map +1 -1
  106. package/dist/template-bindings/palette-funcs.js +120 -125
  107. package/dist/template-bindings/palette-funcs.js.map +1 -1
  108. package/dist/template-bindings/style-funcs.d.ts +11 -12
  109. package/dist/template-bindings/style-funcs.d.ts.map +1 -1
  110. package/dist/template-bindings/style-funcs.js +48 -74
  111. package/dist/template-bindings/style-funcs.js.map +1 -1
  112. package/dist/themes/buildPalette.d.ts +7 -1
  113. package/dist/themes/buildPalette.d.ts.map +1 -1
  114. package/dist/themes/buildPalette.js +15 -1
  115. package/dist/themes/buildPalette.js.map +1 -1
  116. package/dist/themes/colorRef.d.ts +52 -0
  117. package/dist/themes/colorRef.d.ts.map +1 -0
  118. package/dist/themes/colorRef.js +97 -0
  119. package/dist/themes/colorRef.js.map +1 -0
  120. package/dist/themes/palette.d.ts +4 -2
  121. package/dist/themes/palette.d.ts.map +1 -1
  122. package/dist/themes/palette.js +4 -2
  123. package/dist/themes/palette.js.map +1 -1
  124. package/dist/themes/ramp.d.ts +84 -0
  125. package/dist/themes/ramp.d.ts.map +1 -0
  126. package/dist/themes/ramp.js +123 -0
  127. package/dist/themes/ramp.js.map +1 -0
  128. package/dist/widgets/dropdown.d.ts +1 -1
  129. package/dist/widgets/dropdown.js +1 -1
  130. package/dist/widgets/event-router.d.ts +3 -2
  131. package/dist/widgets/event-router.d.ts.map +1 -1
  132. package/dist/widgets/focus-manager.d.ts +2 -1
  133. package/dist/widgets/focus-manager.d.ts.map +1 -1
  134. package/dist/widgets/index.d.ts +3 -6
  135. package/dist/widgets/index.d.ts.map +1 -1
  136. package/dist/widgets/index.js +4 -3
  137. package/dist/widgets/index.js.map +1 -1
  138. package/dist/widgets/screen.d.ts +1 -1
  139. package/dist/widgets/screen.d.ts.map +1 -1
  140. package/dist/widgets/terminal-host.d.ts +13 -63
  141. package/dist/widgets/terminal-host.d.ts.map +1 -1
  142. package/dist/widgets/terminal-host.js +11 -142
  143. package/dist/widgets/terminal-host.js.map +1 -1
  144. package/dist/widgets/text-input.d.ts +2 -3
  145. package/dist/widgets/text-input.d.ts.map +1 -1
  146. package/dist/widgets/text-input.js +4 -12
  147. package/dist/widgets/text-input.js.map +1 -1
  148. package/dist/widgets/types.d.ts +1 -1
  149. package/dist/widgets/types.d.ts.map +1 -1
  150. package/dist/widgets/types.js.map +1 -1
  151. package/dist/widgets/widget-base.d.ts +2 -1
  152. package/dist/widgets/widget-base.d.ts.map +1 -1
  153. package/package.json +20 -4
@@ -1,157 +1,152 @@
1
1
  /**
2
- * Palette / theme / auto-contrast function registrations for the rich-js
3
- * template binding.
2
+ * The palette-dependent template functions: `color`, and `ramp` whose stops
3
+ * are color references.
4
4
  *
5
- * [LAW:one-source-of-truth] All palette resolution flows through the existing
6
- * `PaletteResolver.resolve(spec, ctx)` API — this module adds no resolution
7
- * logic of its own. The template functions here are thin adaptors that translate
8
- * function call arguments into a `(spec, ctx)` call and wrap the resulting
9
- * `ColorRgba` as a `Style` applied to the child fragment.
5
+ * ### Why `color` is the one name resolver
10
6
  *
11
- * [LAW:dataflow-not-control-flow] Every function follows the same shape:
12
- * resolve spec → apply as foreground color → return styled fragment. The
13
- * variability is in the spec string and the optional against context; the
14
- * operation is fixed.
7
+ * This module used to register four kinds of thing: one function per
8
+ * identifier-safe palette variable (`{{ primary child }}`, `{{ accent child }}`,
9
+ * …), a general `palette "spec" child`, a `paletteOver "spec" "#bg" child` for
10
+ * specs needing a background, and an `auto "#bg" child` sugar. That surface had
11
+ * two defects worth recording, because both are easy to reintroduce.
15
12
  *
16
- * ### Surface design rationale
13
+ * **The name family could not cover its own domain.** A themed palette carries
14
+ * ~150 variables; roughly 14 of them are legal Go-template identifiers. So the
15
+ * generated functions reached under a tenth of the palette, and the other nine
16
+ * tenths needed `palette "text-primary" child` — a *different expression shape*
17
+ * for the same intent. An author who learned `{{ primary x }}` and reasonably
18
+ * tried `{{ text_primary x }}` got a FuncNotFound. [LAW:composability] — the
19
+ * `filterByStatus`/`filterByOwner` shape: names cannot enumerate a domain, and
20
+ * the N+1 case always needs a form you have to learn separately.
17
21
  *
18
- * Four layers of ergonomics:
22
+ * **Resolution and application were fused.** Every one of those functions
23
+ * consumed its color instantly into a styled fragment, so a color could never
24
+ * be held or passed. Composition therefore had to happen inside the spec
25
+ * *string* — hence the old `name-darken-N alpha%` grammar. See
26
+ * `color-funcs.ts` for the full argument; the short version is that a string
27
+ * grammar is function application with the function calls spelled as
28
+ * punctuation, and it grows a new production for every operation.
19
29
  *
20
- * 1. **Semantic-name functions** — one function per palette variable whose
21
- * name is a valid Go template identifier (no hyphens). `{{ primary child }}`,
22
- * `{{ accent child }}`, etc. The happy path: common semantic names read
23
- * cleanly in templates. Hyphenated names (`primary-muted`, `text-primary`)
24
- * cannot be Go template identifiers and are accessed via `palette`.
30
+ * What replaces all of it: `color "name-or-hex"` produces a color value, the
31
+ * functions in `color-funcs.ts` transform colors, and `fg`/`bg` in
32
+ * `style-funcs.ts` paint them. One shape, total over the palette, open to
33
+ * arbitrary composition. [LAW:one-type-per-behavior]
25
34
  *
26
- * 2. **`palette "spec" child`** — the general-purpose function for any spec
27
- * that does not need a background context (bare names and darken/lighten
28
- * modifiers). Covers hyphenated names and modifier chains.
35
+ * ### Why `ramp` lives here and not with the color math
29
36
  *
30
- * 3. **`paletteOver "spec" "#bgHex" child`** — for specs that require a
31
- * background context: alpha compositing (`"primary 50%"`) and auto-contrast
32
- * (`"auto"`, `"auto 33%"`). The bg color is threaded as an explicit hex
33
- * argument rather than via a scope side-channel — no mutable state, no
34
- * closure magic; the data flows through the function call.
37
+ * `ramp` is the one function whose input is a *number*, and its stops are
38
+ * spelled as color references — `ramp .pct "step" 0 "panel" 50 "warning" 80
39
+ * "error"` — resolved through the same `resolveColorRef` that `color` crosses.
40
+ * Requiring `(color "panel")` around every stop would put the boilerplate
41
+ * back that this binding exists to remove, and an author who writes a hex
42
+ * literal loses nothing: the resolver is idempotent on hex. The arithmetic
43
+ * itself is `ColorRamp` in `themes/ramp.ts`, palette-free; only the
44
+ * reference resolution is here. [LAW:one-way-deps]
35
45
  *
36
- * 4. **`auto "#bgHex" child`** — syntactic sugar for
37
- * `{{ paletteOver "auto" "#bgHex" child }}`, the common auto-contrast case.
46
+ * ### Why a getter, not a palette
38
47
  *
39
- * ### Theme switching
48
+ * `paletteFuncs` takes `() => Palette` rather than a `Palette`. A consumer
49
+ * whose theme can change at runtime (a live preview, a theme picker, a
50
+ * status-line that recolors on click) would otherwise be frozen to whichever
51
+ * palette happened to be current when the engine was constructed — and since
52
+ * templates are parsed once and evaluated many times, that freeze outlives
53
+ * every subsequent theme change while the *rest* of the consumer's colors move
54
+ * on. Two palettes, one render: [LAW:one-source-of-truth] violated by a
55
+ * captured reference.
40
56
  *
41
- * `paletteFuncs(resolver)` captures `resolver` at construction time. Consumers
42
- * that need runtime theme switching create a new `paletteFuncs()` from the new
43
- * theme's resolver and rebuild their engine (or merge into a fresh `FuncMap`).
44
- * The same template *source* produces different colors because the functions in
45
- * the engine changed — the template text is the same, the resolver differs.
57
+ * The getter costs nothing structurally. `FuncMap` entries are data in the
58
+ * engine and their bodies run at *evaluate* time, so reading the palette
59
+ * through a getter leaves parse-once/evaluate-many completely intact. What the
60
+ * getter must not change is *which functions exist* — and it cannot, because
61
+ * the two names here do not depend on the palette's contents. That was not
62
+ * true of the generated per-variable functions, which is the second reason
63
+ * they are gone.
46
64
  */
47
- import { ColorSpec } from "../core/color.js";
48
- import { Style } from "../core/style.js";
49
- import { applyStyleToFragment } from "./helpers.js";
50
- // Regex for validating hex bg strings accepted by `paletteOver` and `auto`.
51
- // Accepts #RRGGBB and #RRGGBBAA — same gate as the `hex` style function.
52
- const HEX_BG_RE = /^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$/;
65
+ import { resolveColorRef } from "../themes/colorRef.js";
66
+ import { ColorRamp, parseRampEasing } from "../themes/ramp.js";
53
67
  /**
54
- * Convert a hex string to `ColorRgba`. Only #RRGGBB / #RRGGBBAA accepted.
55
- * Throws `RangeError` on invalid input — surfaces as an `EvalError` in the
56
- * template engine, giving the author a precise failure message.
57
- */
58
- function hexToColorRgba(hex) {
59
- if (!HEX_BG_RE.test(hex)) {
60
- throw new RangeError(`palette background expected #RRGGBB or #RRGGBBAA, got ${JSON.stringify(hex)}`);
61
- }
62
- // ColorSpec.parse("#RRGGBB") → TRUECOLOR spec; getTruecolor() returns value directly.
63
- return ColorSpec.parse(hex).getTruecolor();
64
- }
65
- /**
66
- * Resolve `spec` against the resolver (with optional background context) and
67
- * apply the resulting color as a foreground `Style` on `child`.
68
+ * The `(position, color-ref)` pairs a `ramp` call's tail spells, as stops.
68
69
  *
69
- * Throws on resolution failure with a contextual message — including a hint to
70
- * use `paletteOver` when the spec needs a background but none was provided.
70
+ * The engine's `alternating` gate has already typed every even slot as a
71
+ * float and every odd slot as a string; what it cannot see is the *pairing*
72
+ * — a trailing position with no color — nor that the string is a color
73
+ * reference. Both are settled here, once, and `ColorRamp` receives resolved
74
+ * stops it never re-checks. [LAW:parse-dont-validate]
75
+ *
76
+ * Each reference resolves against the palette of *this* evaluation, so a
77
+ * ramp over palette names follows the theme exactly as `color` does.
71
78
  */
72
- function resolveAndApply(resolver, spec, against, child) {
73
- const color = resolver.resolve(spec, against !== undefined ? { against } : undefined);
74
- if (color === null) {
75
- const hint = against === undefined
76
- ? "; for specs with alpha or auto-contrast, use paletteOver"
77
- : "";
78
- throw new Error(`palette spec ${JSON.stringify(spec)} did not resolve — check the spec string is valid and the variable exists${hint}`);
79
+ function colorStops(tail, palette) {
80
+ if (tail.length === 0) {
81
+ throw new RangeError(`ramp needs at least one stop after the easing: ramp <value> <easing> <position> <color> …`);
79
82
  }
80
- return applyStyleToFragment(child, new Style({ color: ColorSpec.fromRgba(color) }));
81
- }
82
- // [LAW:types-are-the-program] Only palette var names that are valid Go template
83
- // identifiers (letter/underscore start, alphanumeric/underscore body) get
84
- // individual functions. Hyphenated names like "primary-muted" parse as subtraction
85
- // in Go template syntax and cannot be function names.
86
- const IDENTIFIER_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
87
- function semanticNameFuncs(resolver) {
88
- const out = {};
89
- for (const name of resolver.palette.vars.keys()) {
90
- if (!IDENTIFIER_RE.test(name))
91
- continue;
92
- // [LAW:dataflow-not-control-flow] Capture name; same fn shape for every entry.
93
- const captured = name;
94
- out[captured] = {
95
- fn: ((child) => resolveAndApply(resolver, captured, undefined, child)),
96
- argTypes: ["liftable"],
97
- returnType: "T",
98
- };
83
+ if (tail.length % 2 !== 0) {
84
+ throw new RangeError(`ramp's last stop (position ${String(tail[tail.length - 1])}) has no color — ` +
85
+ `stops are <position> <color> pairs`);
99
86
  }
100
- return out;
101
- }
102
- function makePaletteFunc(resolver) {
103
- return {
104
- fn: ((spec, child) => resolveAndApply(resolver, spec, undefined, child)),
105
- argTypes: ["string", "liftable"],
106
- returnType: "T",
107
- };
108
- }
109
- function makePaletteOverFunc(resolver) {
110
- return {
111
- fn: ((spec, bgHex, child) => resolveAndApply(resolver, spec, hexToColorRgba(bgHex), child)),
112
- argTypes: ["string", "string", "liftable"],
113
- returnType: "T",
114
- };
115
- }
116
- function makeAutoFunc(resolver) {
117
- return {
118
- fn: ((bgHex, child) => resolveAndApply(resolver, "auto", hexToColorRgba(bgHex), child)),
119
- argTypes: ["string", "liftable"],
120
- returnType: "T",
121
- };
87
+ const stops = [];
88
+ for (let i = 0; i < tail.length; i += 2) {
89
+ stops.push({
90
+ at: tail[i],
91
+ color: resolveColorRef(palette, tail[i + 1]),
92
+ });
93
+ }
94
+ return stops;
122
95
  }
123
96
  /**
124
- * Build a `FuncMap` exposing the semantic palette of `resolver` as template
125
- * functions. Merge into `richTextFuncs()` (or pass to `createEngine`) to make
126
- * palette colors available in templates.
97
+ * Register `color "name-or-hex"` against a live palette.
98
+ *
99
+ * `color` resolves a palette variable name to a `#RRGGBB` string, and passes
100
+ * an already-literal color through unchanged. That second half is not a
101
+ * convenience — it makes `color` **idempotent**, which is what lets consumers
102
+ * apply it unconditionally to any author-written color string without first
103
+ * asking whether it is a name or already a color. [LAW:dataflow-not-control-flow]
127
104
  *
128
- * Registered functions:
129
- * - One function per palette variable whose name is a valid Go template
130
- * identifier: `{{ primary child }}`, `{{ accent child }}`, etc.
131
- * - `palette "spec" child` — any spec without background context.
132
- * - `paletteOver "spec" "#bgHex" child` — any spec needing a background (alpha,
133
- * auto-contrast).
134
- * - `auto "#bgHex" child` — sugar for `paletteOver "auto" bgHex child`.
105
+ * An unknown name throws, carrying near-miss suggestions from the live
106
+ * palette. In a template that surfaces as an evaluation error at the exact
107
+ * call site, which is the signal an author (or an agent editing a config) needs
108
+ * to fix it. [LAW:no-silent-failure]
135
109
  *
136
110
  * @example
137
111
  * ```ts
138
- * import { createEngine } from "@promptctl/go-template-js";
139
- * import { GRUVBOX, PaletteResolver, RichText } from "rich-js";
140
- * import { richTextFuncs, paletteFuncs } from "rich-js/template-bindings";
141
- *
142
112
  * const engine = createEngine({
143
113
  * fromString: (s) => new RichText(s),
144
114
  * toString: (rt) => rt.plain,
145
- * funcs: { ...richTextFuncs(), ...paletteFuncs(new PaletteResolver(GRUVBOX.palette)) },
115
+ * funcs: {
116
+ * ...richTextFuncs(),
117
+ * ...colorFuncs(),
118
+ * ...paletteFuncs(() => currentTheme.palette),
119
+ * },
146
120
  * });
147
121
  * ```
148
122
  */
149
- export function paletteFuncs(resolver) {
150
- return {
151
- ...semanticNameFuncs(resolver),
152
- palette: makePaletteFunc(resolver),
153
- paletteOver: makePaletteOverFunc(resolver),
154
- auto: makeAutoFunc(resolver),
123
+ export function paletteFuncs(getPalette) {
124
+ const colorFunc = {
125
+ fn: ((ref) => resolveColorRef(getPalette(), ref).hex),
126
+ argTypes: ["string"],
127
+ returnType: "string",
128
+ };
129
+ // `ramp <value> <easing> <position> <color> …` — the argument list is one
130
+ // float/string cycle end to end (value, easing, then each stop's position
131
+ // and color), so the engine's `alternating` gate types every slot; the
132
+ // pairing and the references are parsed in `colorStops`.
133
+ // [LAW:types-are-the-program]
134
+ const rampFunc = {
135
+ fn: ((...args) => {
136
+ // The engine's `alternating` gate types each slot but sets no minimum
137
+ // count, so `{{ ramp }}` and `{{ ramp 65 }}` both reach here: one
138
+ // check over the whole list, naming what is missing. [LAW:no-silent-failure]
139
+ if (args.length < 2) {
140
+ throw new RangeError(`ramp needs a value and an easing before its stops (got ${args.length}): ` +
141
+ `ramp <value> "linear"|"step" <position> <color> …`);
142
+ }
143
+ const [value, easing, ...tail] = args;
144
+ return new ColorRamp(parseRampEasing(easing), colorStops(tail, getPalette())).at(value).hex;
145
+ }),
146
+ argTypes: ["float", "string"],
147
+ argTypePattern: "alternating",
148
+ returnType: "string",
155
149
  };
150
+ return { color: colorFunc, ramp: rampFunc };
156
151
  }
157
152
  //# sourceMappingURL=palette-funcs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"palette-funcs.js","sourceRoot":"","sources":["../../src/template-bindings/palette-funcs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;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AE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC;QAC9F,CAAC,CAAuB;QACxB,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;QAC7B,cAAc,EAAE,aAAa;QAC7B,UAAU,EAAE,QAAQ;KACrB,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAC9C,CAAC"}
@@ -2,12 +2,11 @@
2
2
  * Style-function registrations for the rich-js template binding.
3
3
  *
4
4
  * [LAW:one-source-of-truth] The function inventory below mirrors the
5
- * string-syntax style vocabulary documented in `spec/style.md` —
6
- * foreground colours (named, palette index, hex, RGB), background
7
- * (`on`), text attributes (positive + negated), and short aliases.
8
- * Each registration is a templating-time analogue of a piece of
9
- * `Style.parse`, so a template fragment composed by these functions
10
- * round-trips through `Style` without semantic drift.
5
+ * string-syntax style vocabulary documented in `docs/style.md` — the two
6
+ * colour slots (`fg`/`bg`), text attributes (positive + negated), short
7
+ * aliases, and the hyperlink. Each registration is a templating-time analogue
8
+ * of a piece of `Style.parse`, so a template fragment composed by these
9
+ * functions round-trips through `Style` without semantic drift.
11
10
  *
12
11
  * [LAW:dataflow-not-control-flow] Every function follows the same
13
12
  * shape: child `RichText` in, `RichText` out. The styling difference
@@ -18,13 +17,13 @@
18
17
  */
19
18
  import type { FuncMap } from "@promptctl/go-template-js";
20
19
  /**
21
- * The full binding registration set populated by the template-bindings
22
- * style epics — foreground colours (named + generic forms), background
23
- * (`on`), text attributes (canonical names, short aliases, and `not_*`
24
- * negations), and the hyperlink cell-splitter (`link`).
20
+ * Text-styling registrations: the two colour sinks (`fg`, `bg`), text
21
+ * attributes (canonical names, short aliases, and `not_*` negations), the
22
+ * hyperlink cell-splitter (`link`), and the multi-attribute `style` spec.
25
23
  *
26
- * Palette/theme/auto-contrast and per-position hue rotation are
27
- * deliberately absent — they ship in `rich-template-bindings-83q`.
24
+ * Colours themselves come from elsewhere: `colorFuncs()` for the palette-free
25
+ * math, `paletteFuncs()` for naming a theme colour. This module only paints.
26
+ * [LAW:one-way-deps] — nothing here imports a palette.
28
27
  */
29
28
  export declare function richTextStyleFuncs(): FuncMap;
30
29
  //# sourceMappingURL=style-funcs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"style-funcs.d.ts","sourceRoot":"","sources":["../../src/template-bindings/style-funcs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,2BAA2B,CAAC;AAqKvE;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAW5C"}
1
+ {"version":3,"file":"style-funcs.d.ts","sourceRoot":"","sources":["../../src/template-bindings/style-funcs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,2BAA2B,CAAC;AA0IvE;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAQ5C"}
@@ -2,12 +2,11 @@
2
2
  * Style-function registrations for the rich-js template binding.
3
3
  *
4
4
  * [LAW:one-source-of-truth] The function inventory below mirrors the
5
- * string-syntax style vocabulary documented in `spec/style.md` —
6
- * foreground colours (named, palette index, hex, RGB), background
7
- * (`on`), text attributes (positive + negated), and short aliases.
8
- * Each registration is a templating-time analogue of a piece of
9
- * `Style.parse`, so a template fragment composed by these functions
10
- * round-trips through `Style` without semantic drift.
5
+ * string-syntax style vocabulary documented in `docs/style.md` — the two
6
+ * colour slots (`fg`/`bg`), text attributes (positive + negated), short
7
+ * aliases, and the hyperlink. Each registration is a templating-time analogue
8
+ * of a piece of `Style.parse`, so a template fragment composed by these
9
+ * functions round-trips through `Style` without semantic drift.
11
10
  *
12
11
  * [LAW:dataflow-not-control-flow] Every function follows the same
13
12
  * shape: child `RichText` in, `RichText` out. The styling difference
@@ -17,66 +16,44 @@
17
16
  * variability; the operation is fixed.
18
17
  */
19
18
  import { Style, ATTRIBUTE_NAMES, ATTRIBUTE_SHORT_ALIASES, } from "../core/style.js";
20
- import { ColorSpec, ANSI_COLOR_NAMES } from "../core/color.js";
19
+ import { ColorSpec } from "../core/color.js";
21
20
  import { applyStyleToFragment } from "./helpers.js";
22
- function fgFunc(style) {
21
+ function attrFunc(style) {
23
22
  return {
24
23
  fn: ((child) => applyStyleToFragment(child, style)),
25
24
  argTypes: ["liftable"],
26
25
  returnType: "T",
27
26
  };
28
27
  }
29
- // --- Foreground colours: named ---
30
- function namedColorFuncs() {
31
- const out = {};
32
- for (const name of Object.keys(ANSI_COLOR_NAMES)) {
33
- const colorSpec = ColorSpec.parse(name);
34
- out[name] = fgFunc(new Style({ color: colorSpec }));
35
- }
36
- return out;
28
+ // --- Colour sinks ---
29
+ //
30
+ // `fg` and `bg` are the only two colour-applying functions, and they are the
31
+ // terminal step of the colour pipeline: `color` names a colour, the functions
32
+ // in `color-funcs.ts` transform it, these paint it onto text.
33
+ //
34
+ // [LAW:composability] They replace five separate families — one function per
35
+ // ANSI colour name (`red`, `bright_blue`, …), `hex`, `rgb`, `color` (256-index),
36
+ // and `on` (background). Every one of those encoded *which colour* in the
37
+ // function's identity, so the vocabulary could only grow by adding names, and
38
+ // a colour computed at render time could not be applied at all. Here the colour
39
+ // is an argument, so the sink admits every colour that exists and every colour
40
+ // that will ever exist. Two functions, unbounded reach.
41
+ //
42
+ // [LAW:types-are-the-program] The slot accepts the full `ColorSpec.parse`
43
+ // vocabulary, which is wider than the hex the colour math produces — and that
44
+ // width is deliberate, not laxity. `#7aa2f7` is a *concrete* colour; `"red"`
45
+ // and `"color(42)"` are *symbolic* ones the terminal resolves against its own
46
+ // theme. Only concrete colours can be darkened or blended, which is why the
47
+ // colour-math functions take hex alone; but both kinds can be painted, so the
48
+ // sink takes the union. The type of each slot is exactly the set of values that
49
+ // slot can mean something for.
50
+ function colorSinkFunc(slot) {
51
+ return {
52
+ fn: ((spec, child) => applyStyleToFragment(child, new Style({ [slot]: ColorSpec.parse(spec) }))),
53
+ argTypes: ["string", "liftable"],
54
+ returnType: "T",
55
+ };
37
56
  }
38
- // --- Foreground colours: generic forms ---
39
- const colorPaletteFunc = {
40
- fn: ((index, child) => {
41
- if (!Number.isInteger(index) || index < 0 || index > 255) {
42
- throw new RangeError(`color index ${index} is out of range (0-255)`);
43
- }
44
- return applyStyleToFragment(child, new Style({ color: ColorSpec.fromAnsi(index) }));
45
- }),
46
- argTypes: ["int", "liftable"],
47
- returnType: "T",
48
- };
49
- // [LAW:types-are-the-program] `hex` advertises a narrower domain than the
50
- // general colour-spec parser — only `#RRGGBB` / `#RRGGBBAA` is admitted.
51
- // Without this gate, `ColorSpec.parse` would silently accept any colour-spec
52
- // string (named colours, `rgb(...)`, `color(N)`), letting `hex "red"` succeed
53
- // and masking author mistakes.
54
- const HEX_INPUT_RE = /^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$/;
55
- const colorHexFunc = {
56
- fn: ((hex, child) => {
57
- if (!HEX_INPUT_RE.test(hex)) {
58
- throw new RangeError(`hex expected #RRGGBB or #RRGGBBAA, got ${JSON.stringify(hex)}`);
59
- }
60
- return applyStyleToFragment(child, new Style({ color: ColorSpec.parse(hex) }));
61
- }),
62
- argTypes: ["string", "liftable"],
63
- returnType: "T",
64
- };
65
- const colorRgbFunc = {
66
- fn: ((r, g, b, child) => {
67
- return applyStyleToFragment(child, new Style({ color: ColorSpec.fromRgb(r, g, b) }));
68
- }),
69
- argTypes: ["int", "int", "int", "liftable"],
70
- returnType: "T",
71
- };
72
- // --- Background ---
73
- const onFunc = {
74
- fn: ((spec, child) => {
75
- return applyStyleToFragment(child, new Style({ bgcolor: ColorSpec.parse(spec) }));
76
- }),
77
- argTypes: ["string", "liftable"],
78
- returnType: "T",
79
- };
80
57
  // --- Text attributes ---
81
58
  //
82
59
  // [LAW:one-source-of-truth] The attribute and short-alias inventories
@@ -89,11 +66,11 @@ function attrStyle(name, value) {
89
66
  function attributeFuncs() {
90
67
  const out = {};
91
68
  for (const name of ATTRIBUTE_NAMES) {
92
- out[name] = fgFunc(attrStyle(name, true));
93
- out[`not_${name}`] = fgFunc(attrStyle(name, false));
69
+ out[name] = attrFunc(attrStyle(name, true));
70
+ out[`not_${name}`] = attrFunc(attrStyle(name, false));
94
71
  }
95
72
  for (const [alias, canonical] of Object.entries(ATTRIBUTE_SHORT_ALIASES)) {
96
- out[alias] = fgFunc(attrStyle(canonical, true));
73
+ out[alias] = attrFunc(attrStyle(canonical, true));
97
74
  }
98
75
  return out;
99
76
  }
@@ -105,7 +82,7 @@ function attributeFuncs() {
105
82
  // byte-equivalent to the same spec inside markup, and one that `Style.parse`
106
83
  // rejects raises the same `StyleSyntaxError` surface.
107
84
  //
108
- // Motivation: the per-attribute functions (`bold`, `underline`, `hex`, …)
85
+ // Motivation: the per-attribute functions (`bold`, `underline`, `fg`, …)
109
86
  // compose by nesting. For "apply a fixed set of styles to this child" or
110
87
  // "apply this named style set everywhere", nesting is awkward and the
111
88
  // style description is fragmented across multiple call sites. `style`
@@ -138,7 +115,7 @@ const styleSpecFunc = {
138
115
  //
139
116
  // The cell-boundary signal that consumers (cc-candybar et al.) walk is
140
117
  // `fragment.style.link` being truthy. `Style.add` propagates `link`
141
- // through any outer wrapping call, so `{{ red (link "u" "x") }}` and
118
+ // through any outer wrapping call, so `{{ fg "red" (link "u" "x") }}` and
142
119
  // `{{ link "u" "x" }}` produce shapes that both qualify as cells from
143
120
  // the consumer's perspective. Outer-wins on nested links comes for free
144
121
  // from `Style.add`'s right-wins-on-conflict rule.
@@ -155,21 +132,18 @@ const linkFunc = {
155
132
  };
156
133
  // --- Public assembly ---
157
134
  /**
158
- * The full binding registration set populated by the template-bindings
159
- * style epics — foreground colours (named + generic forms), background
160
- * (`on`), text attributes (canonical names, short aliases, and `not_*`
161
- * negations), and the hyperlink cell-splitter (`link`).
135
+ * Text-styling registrations: the two colour sinks (`fg`, `bg`), text
136
+ * attributes (canonical names, short aliases, and `not_*` negations), the
137
+ * hyperlink cell-splitter (`link`), and the multi-attribute `style` spec.
162
138
  *
163
- * Palette/theme/auto-contrast and per-position hue rotation are
164
- * deliberately absent — they ship in `rich-template-bindings-83q`.
139
+ * Colours themselves come from elsewhere: `colorFuncs()` for the palette-free
140
+ * math, `paletteFuncs()` for naming a theme colour. This module only paints.
141
+ * [LAW:one-way-deps] — nothing here imports a palette.
165
142
  */
166
143
  export function richTextStyleFuncs() {
167
144
  return {
168
- ...namedColorFuncs(),
169
- color: colorPaletteFunc,
170
- hex: colorHexFunc,
171
- rgb: colorRgbFunc,
172
- on: onFunc,
145
+ fg: colorSinkFunc("color"),
146
+ bg: colorSinkFunc("bgcolor"),
173
147
  ...attributeFuncs(),
174
148
  link: linkFunc,
175
149
  style: styleSpecFunc,
@@ -1 +1 @@
1
- {"version":3,"file":"style-funcs.js","sourceRoot":"","sources":["../../src/template-bindings/style-funcs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EACL,KAAK,EACL,eAAe,EACf,uBAAuB,GAExB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,SAAS,MAAM,CAAC,KAAY;IAC1B,OAAO;QACL,EAAE,EAAE,CAAC,CAAC,KAAc,EAAE,EAAE,CAAC,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAuB;QAClF,QAAQ,EAAE,CAAC,UAAU,CAAC;QACtB,UAAU,EAAE,GAAG;KAChB,CAAC;AACJ,CAAC;AAED,oCAAoC;AAEpC,SAAS,eAAe;IACtB,MAAM,GAAG,GAAY,EAAE,CAAC;IACxB,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACjD,MAAM,SAAS,GAAG,SA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AE,CAAC,QAAQ,EAAE,UAAU,CAAC;IAChC,UAAU,EAAE,GAAG;CAChB,CAAC;AAEF,0BAA0B;AAE1B;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO;QACL,EAAE,EAAE,aAAa,CAAC,OAAO,CAAC;QAC1B,EAAE,EAAE,aAAa,CAAC,SAAS,CAAC;QAC5B,GAAG,cAAc,EAAE;QACnB,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,aAAa;KACrB,CAAC;AACJ,CAAC"}
@@ -18,7 +18,13 @@ export interface BaseColors {
18
18
  * Build a full semantic palette from base colors.
19
19
  *
20
20
  * Derived entries follow Textual's formulas:
21
- * - `*-muted` = color blended 70% toward background
21
+ * - `*-muted` = color blended 70% toward its opposite base role. Defined for
22
+ * every accent AND for the two base roles themselves
23
+ * (`foreground-muted` blends toward `background`,
24
+ * `background-muted` blends toward `foreground`) — a caller
25
+ * de-emphasizing body/structural text reaches for
26
+ * `foreground-muted` the same way it reaches for
27
+ * `primary-muted` to de-emphasize an accent.
22
28
  * - `text-*` = contrast text tinted 66% with the accent color (use as
23
29
  * foreground in muted/background-tinted contexts)
24
30
  * - `on-*` = WCAG-correct contrast colour (black or white) for use as
@@ -1 +1 @@
1
- {"version":3,"file":"buildPalette.d.ts","sourceRoot":"","sources":["../../src/themes/buildPalette.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAY,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,SAAS,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,SAAS,CAAC;IACtB,UAAU,EAAE,SAAS,CAAC;CACvB;AAUD;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAyBnF"}
1
+ {"version":3,"file":"buildPalette.d.ts","sourceRoot":"","sources":["../../src/themes/buildPalette.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAY,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,SAAS,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,SAAS,CAAC;IACtB,UAAU,EAAE,SAAS,CAAC;CACvB;AAUD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAkCnF"}
@@ -9,7 +9,13 @@ const ACCENT_KEYS = ["primary", "secondary", "accent", "success", "warning", "er
9
9
  * Build a full semantic palette from base colors.
10
10
  *
11
11
  * Derived entries follow Textual's formulas:
12
- * - `*-muted` = color blended 70% toward background
12
+ * - `*-muted` = color blended 70% toward its opposite base role. Defined for
13
+ * every accent AND for the two base roles themselves
14
+ * (`foreground-muted` blends toward `background`,
15
+ * `background-muted` blends toward `foreground`) — a caller
16
+ * de-emphasizing body/structural text reaches for
17
+ * `foreground-muted` the same way it reaches for
18
+ * `primary-muted` to de-emphasize an accent.
13
19
  * - `text-*` = contrast text tinted 66% with the accent color (use as
14
20
  * foreground in muted/background-tinted contexts)
15
21
  * - `on-*` = WCAG-correct contrast colour (black or white) for use as
@@ -26,6 +32,14 @@ export function buildPalette(name, dark, base) {
26
32
  for (const key of ACCENT_KEYS) {
27
33
  vars.set(key, base[key]);
28
34
  }
35
+ // Muted variants of the two base roles, same "blend 70% toward
36
+ // background" formula as the accent `*-muted` family below — every
37
+ // base color the palette defines gets a de-emphasized variant, not just
38
+ // the accents. `foreground-muted` is what a caller reaches for to draw
39
+ // structural/contextual text (labels, punctuation, ids) at reduced visual
40
+ // weight without a terminal-support-dependent SGR attribute.
41
+ vars.set("foreground-muted", blendRgb(base.foreground, base.background, MUTED_BLEND));
42
+ vars.set("background-muted", blendRgb(base.background, base.foreground, MUTED_BLEND));
29
43
  // Surface — subtle lift from background
30
44
  vars.set("surface", blendRgb(base.background, base.foreground, SURFACE_LIFT));
31
45
  // Derived: muted, text-, and on- for each accent.
@@ -1 +1 @@
1
- {"version":3,"file":"buildPalette.js","sourceRoot":"","sources":["../../src/themes/buildPalette.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAiBvC,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,YAAY,GAAG,IAAI,CAAC;AAI1B,MAAM,WAAW,GAAgB,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAEnG;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,IAAa,EAAE,IAAgB;IACxE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAqB,CAAC;IAE1C,eAAe;IACf,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACxC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,U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