@promptctl/rich-js 0.28.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/core/animation.d.ts +37 -37
- package/dist/core/animation.js +61 -61
- package/dist/core/ansi.d.ts +4 -4
- package/dist/core/ansi.js +9 -9
- package/dist/core/bidi.js +6 -6
- package/dist/core/cells.d.ts +1 -1
- package/dist/core/cells.js +5 -5
- package/dist/core/clock.d.ts +1 -1
- package/dist/core/color.d.ts +50 -50
- package/dist/core/color.js +69 -69
- package/dist/core/console.d.ts +8 -8
- package/dist/core/console.js +5 -5
- package/dist/core/control-codes.d.ts +3 -3
- package/dist/core/control-codes.js +7 -7
- package/dist/core/easing.d.ts +40 -40
- package/dist/core/easing.js +40 -40
- package/dist/core/env.d.ts +1 -1
- package/dist/core/env.js +1 -1
- package/dist/core/export-html.js +1 -1
- package/dist/core/export-lines.d.ts +11 -11
- package/dist/core/export-lines.js +12 -12
- package/dist/core/export-svg.d.ts +3 -3
- package/dist/core/export-svg.js +4 -4
- package/dist/core/markup.js +1 -1
- package/dist/core/memo.d.ts +1 -1
- package/dist/core/memo.js +1 -1
- package/dist/core/oklch.d.ts +14 -14
- package/dist/core/oklch.js +10 -10
- package/dist/core/orient.d.ts +3 -3
- package/dist/core/orient.js +3 -3
- package/dist/core/paint.d.ts +9 -9
- package/dist/core/paint.js +3 -3
- package/dist/core/pretty.d.ts +1 -1
- package/dist/core/pretty.js +3 -3
- package/dist/core/protocol.d.ts +26 -26
- package/dist/core/protocol.js +22 -22
- package/dist/core/render.d.ts +11 -11
- package/dist/core/render.js +12 -12
- package/dist/core/segment.d.ts +3 -3
- package/dist/core/segment.js +5 -5
- package/dist/core/strip.d.ts +83 -83
- package/dist/core/strip.js +70 -70
- package/dist/core/style.d.ts +20 -20
- package/dist/core/style.js +55 -55
- package/dist/core/text.d.ts +2 -2
- package/dist/core/text.js +5 -5
- package/dist/core/timeline.d.ts +5 -5
- package/dist/core/timeline.js +9 -9
- package/dist/core/tween.d.ts +6 -6
- package/dist/core/tween.js +10 -10
- package/dist/core/view.d.ts +4 -4
- package/dist/core/view.js +12 -12
- package/dist/host/app.d.ts +9 -9
- package/dist/host/app.js +12 -12
- package/dist/host/host-environment.d.ts +2 -2
- package/dist/host/host-environment.js +2 -2
- package/dist/host/index.d.ts +2 -2
- package/dist/host/input.d.ts +7 -7
- package/dist/host/input.js +4 -4
- package/dist/host/terminal-colors.d.ts +2 -2
- package/dist/host/terminal-colors.js +4 -4
- package/dist/host/terminal-host.d.ts +2 -2
- package/dist/host/terminal-host.js +1 -1
- package/dist/index.d.ts +14 -14
- package/dist/index.js +10 -10
- package/dist/node/prompt.d.ts +1 -1
- package/dist/node/prompt.js +1 -1
- package/dist/node/terminal-host.d.ts +1 -1
- package/dist/node/traceback.js +2 -2
- package/dist/renderables/change.js +2 -2
- package/dist/renderables/effect.d.ts +39 -39
- package/dist/renderables/effect.js +45 -45
- package/dist/renderables/effects.d.ts +81 -81
- package/dist/renderables/effects.js +157 -157
- package/dist/renderables/embed.d.ts +1 -1
- package/dist/renderables/embed.js +2 -2
- package/dist/renderables/flexStrip.d.ts +7 -7
- package/dist/renderables/flexStrip.js +15 -15
- package/dist/renderables/frames.d.ts +6 -6
- package/dist/renderables/frames.js +11 -11
- package/dist/renderables/glyph-effect.d.ts +15 -15
- package/dist/renderables/glyph-effect.js +17 -17
- package/dist/renderables/glyph-effects.d.ts +7 -7
- package/dist/renderables/glyph-effects.js +16 -16
- package/dist/renderables/html-entities.d.ts +1 -1
- package/dist/renderables/html-entities.js +1 -1
- package/dist/renderables/lifecycle.d.ts +4 -4
- package/dist/renderables/lifecycle.js +12 -12
- package/dist/renderables/live.d.ts +2 -2
- package/dist/renderables/live.js +7 -7
- package/dist/renderables/markdown-parse.js +3 -3
- package/dist/renderables/panel.js +3 -3
- package/dist/renderables/progress.d.ts +1 -1
- package/dist/renderables/progress.js +1 -1
- package/dist/renderables/progressBar.d.ts +1 -1
- package/dist/renderables/progressBar.js +6 -6
- package/dist/renderables/prompt.d.ts +1 -1
- package/dist/renderables/scroll.d.ts +1 -1
- package/dist/renderables/scroll.js +3 -3
- package/dist/renderables/spinner.d.ts +4 -4
- package/dist/renderables/spinner.js +10 -10
- package/dist/renderables/syntax.d.ts +2 -2
- package/dist/renderables/syntax.js +2 -2
- package/dist/renderables/table.js +3 -3
- package/dist/renderables/traceback.d.ts +1 -1
- package/dist/renderables/traceback.js +1 -1
- package/dist/renderables/tree.js +3 -3
- package/dist/template-bindings/animation-funcs.d.ts +14 -14
- package/dist/template-bindings/animation-funcs.js +27 -27
- package/dist/template-bindings/color-funcs.d.ts +14 -14
- package/dist/template-bindings/color-funcs.js +25 -25
- package/dist/template-bindings/index.d.ts +9 -9
- package/dist/template-bindings/index.js +9 -9
- package/dist/template-bindings/palette-funcs.d.ts +1 -1
- package/dist/template-bindings/palette-funcs.js +3 -3
- package/dist/template-bindings/style-funcs.d.ts +5 -5
- package/dist/template-bindings/style-funcs.js +16 -16
- package/dist/themes/{transpose.d.ts → adjust.d.ts} +23 -23
- package/dist/themes/{transpose.js → adjust.js} +28 -28
- package/dist/themes/buildPalette.d.ts +3 -3
- package/dist/themes/buildPalette.js +20 -20
- package/dist/themes/colorMath.d.ts +16 -16
- package/dist/themes/colorMath.js +32 -32
- package/dist/themes/data/ansi-tables.d.ts +2 -2
- package/dist/themes/data/ansi-tables.js +2 -2
- package/dist/themes/data/types.d.ts +4 -4
- package/dist/themes/data/types.js +2 -2
- package/dist/themes/palette.d.ts +12 -12
- package/dist/themes/palette.js +16 -16
- package/dist/themes/ramp.d.ts +17 -17
- package/dist/themes/ramp.js +12 -12
- package/dist/themes/registry.js +4 -4
- package/dist/themes/terminalThemes.d.ts +1 -1
- package/dist/themes/terminalThemes.js +1 -1
- package/dist/widgets/button.d.ts +2 -2
- package/dist/widgets/button.js +4 -4
- package/dist/widgets/checkbox.d.ts +2 -2
- package/dist/widgets/checkbox.js +2 -2
- package/dist/widgets/dropdown.d.ts +2 -2
- package/dist/widgets/dropdown.js +3 -3
- package/dist/widgets/event-router.d.ts +6 -6
- package/dist/widgets/event-router.js +2 -2
- package/dist/widgets/focus-manager.d.ts +3 -3
- package/dist/widgets/focus-manager.js +3 -3
- package/dist/widgets/index.d.ts +2 -2
- package/dist/widgets/index.js +1 -1
- package/dist/widgets/ink.d.ts +3 -3
- package/dist/widgets/ink.js +4 -4
- package/dist/widgets/slider.d.ts +2 -2
- package/dist/widgets/static-item.d.ts +2 -2
- package/dist/widgets/text-input.d.ts +2 -2
- package/dist/widgets/text-input.js +5 -5
- package/dist/widgets/themed-widget.js +1 -1
- package/dist/widgets/toggle.d.ts +3 -3
- package/dist/widgets/toggle.js +3 -3
- package/dist/widgets/types.d.ts +6 -6
- package/dist/widgets/types.js +2 -2
- package/dist/widgets/widget-app.d.ts +10 -10
- package/dist/widgets/widget-app.js +8 -8
- package/dist/widgets/widget-base.d.ts +2 -2
- package/package.json +1 -1
package/dist/core/easing.d.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* `elastic`, Robert Penner's curves at the constants every animation
|
|
23
23
|
* library since has shipped. An ease that leaves [0, 1] — a spring or a
|
|
24
24
|
* back curve overshooting its rest — is still an ease: a `ColorRamp` holds
|
|
25
|
-
* its end
|
|
25
|
+
* its end colors where it does, and an effect's `Curve` saturates at its
|
|
26
26
|
* swing, so the overshoot is read by what can show it (a position, a
|
|
27
27
|
* count) and clipped by what cannot.
|
|
28
28
|
*
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
* [LAW:one-type-per-behavior] An ease is a plain function value. CSS's named
|
|
34
34
|
* curves are four instances of `cubicBezier`, not four implementations, the
|
|
35
35
|
* spring in `EASES` is one `spring()`, and `ColorRamp` and every effect take
|
|
36
|
-
* the same `
|
|
36
|
+
* the same `Easing`.
|
|
37
37
|
*
|
|
38
38
|
* Tier 0 of `src/core/`: imports nothing, so `themes/` and every later
|
|
39
39
|
* `core/` module reach it downhill. [LAW:one-way-deps]
|
|
40
40
|
*/
|
|
41
41
|
/** Progress in [0, 1] in, progress out: a reshaping of [0, 1] that may leave it, as a spring overshooting its rest does. */
|
|
42
|
-
export type
|
|
42
|
+
export type Easing = (x: number) => number;
|
|
43
43
|
/** Time in seconds (plus any per-cell offset) in, progress in [0, 1] out. */
|
|
44
|
-
export type
|
|
44
|
+
export type WrapMode = (t: number) => number;
|
|
45
45
|
/**
|
|
46
46
|
* CSS `cubic-bezier(x1, y1, x2, y2)`: the curve from (0, 0) to (1, 1) with
|
|
47
47
|
* those two control points, read as y at a given x. `x1` and `x2` must lie in
|
|
@@ -49,7 +49,7 @@ export type Phase = (t: number) => number;
|
|
|
49
49
|
* every input has exactly one output. `y1` and `y2` may leave [0, 1]; the
|
|
50
50
|
* curve then overshoots, as a CSS "back" curve does.
|
|
51
51
|
*/
|
|
52
|
-
export declare function cubicBezier(x1: number, y1: number, x2: number, y2: number):
|
|
52
|
+
export declare function cubicBezier(x1: number, y1: number, x2: number, y2: number): Easing;
|
|
53
53
|
/**
|
|
54
54
|
* Where a `steps()` curve jumps, in CSS's terms. `jump-start` jumps at 0,
|
|
55
55
|
* `jump-end` at 1, `jump-both` at both, `jump-none` at neither; `start` and
|
|
@@ -62,11 +62,11 @@ export type StepPosition = "jump-start" | "jump-end" | "jump-none" | "jump-both"
|
|
|
62
62
|
* `position` names — CSS's step algorithm, so `steps(1, "end")` is 0 until
|
|
63
63
|
* the very end.
|
|
64
64
|
*/
|
|
65
|
-
export declare function steps(n: number, position?: StepPosition):
|
|
65
|
+
export declare function steps(n: number, position?: StepPosition): Easing;
|
|
66
66
|
/**
|
|
67
67
|
* The curve `shape` over [0, 1) as an ease that has arrived: its argument
|
|
68
68
|
* held to [0, 1], and exactly 1 at 1. Every built-in ease is one, so the two
|
|
69
|
-
* halves of the `
|
|
69
|
+
* halves of the `Easing` contract — an argument in [0, 1], the end landed on —
|
|
70
70
|
* are enforced here and nowhere else. [LAW:single-enforcer] The end matters
|
|
71
71
|
* because a curve is 1 at its end only in the limit or up to a rounding — a
|
|
72
72
|
* spring settles to within `SPRING_REST`, the elastic's ringing never quite
|
|
@@ -74,7 +74,7 @@ export declare function steps(n: number, position?: StepPosition): Ease;
|
|
|
74
74
|
* and a count or a width eased by it must land on its target, not a
|
|
75
75
|
* thousandth or an ulp short.
|
|
76
76
|
*/
|
|
77
|
-
export declare const
|
|
77
|
+
export declare const withSettlingTime: (shape: (p: number) => number) => Easing;
|
|
78
78
|
/**
|
|
79
79
|
* A spring's physics: the mass on it, the stiffness of its coil and the
|
|
80
80
|
* damping it moves against, in the units every animation library spells them
|
|
@@ -93,19 +93,19 @@ export interface SpringOptions {
|
|
|
93
93
|
* An ease over a duration: CSS's timing function and duration as one value,
|
|
94
94
|
* the whole of what a one-shot move needs to know about time — a tween's
|
|
95
95
|
* (`./tween.ts`), a `spring()`'s, and the part of an effect's `Curve` that
|
|
96
|
-
* is not its swing. `
|
|
96
|
+
* is not its swing. `WrapMode.once(start, seconds)` through `ease` is the move
|
|
97
97
|
* on a timeline. [LAW:one-type-per-behavior] One shape, so a spring is handed
|
|
98
98
|
* to a tween as it is, and a curve written for an effect times a tween.
|
|
99
99
|
*/
|
|
100
100
|
export interface Timing {
|
|
101
101
|
/** How the move is shaped, as progress in to progress out. */
|
|
102
|
-
readonly ease:
|
|
102
|
+
readonly ease: Easing;
|
|
103
103
|
/** How long the move takes, in seconds. */
|
|
104
104
|
readonly seconds: number;
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
107
107
|
* How close to its rest a spring must come to count as settled: one part in a
|
|
108
|
-
* thousand of the way it moves, under a
|
|
108
|
+
* thousand of the way it moves, under a color channel's step (1/255) and
|
|
109
109
|
* under any cell, so what rounds the spring's value to show it draws the rest
|
|
110
110
|
* from there on.
|
|
111
111
|
*/
|
|
@@ -137,28 +137,28 @@ export declare function spring(options?: SpringOptions): Timing;
|
|
|
137
137
|
* `seconds` are `DEFAULT_SPRING`'s; the rest are Penner's at his constants.
|
|
138
138
|
*/
|
|
139
139
|
export declare const EASES: {
|
|
140
|
-
readonly linear:
|
|
141
|
-
readonly ease:
|
|
142
|
-
readonly "ease-in":
|
|
143
|
-
readonly "ease-out":
|
|
144
|
-
readonly "ease-in-out":
|
|
145
|
-
readonly "step-start":
|
|
146
|
-
readonly "step-end":
|
|
147
|
-
readonly step:
|
|
148
|
-
readonly sine:
|
|
149
|
-
readonly spring:
|
|
150
|
-
readonly bounce:
|
|
151
|
-
readonly "back-in":
|
|
152
|
-
readonly "back-out":
|
|
153
|
-
readonly elastic:
|
|
140
|
+
readonly linear: Easing;
|
|
141
|
+
readonly ease: Easing;
|
|
142
|
+
readonly "ease-in": Easing;
|
|
143
|
+
readonly "ease-out": Easing;
|
|
144
|
+
readonly "ease-in-out": Easing;
|
|
145
|
+
readonly "step-start": Easing;
|
|
146
|
+
readonly "step-end": Easing;
|
|
147
|
+
readonly step: Easing;
|
|
148
|
+
readonly sine: Easing;
|
|
149
|
+
readonly spring: Easing;
|
|
150
|
+
readonly bounce: Easing;
|
|
151
|
+
readonly "back-in": Easing;
|
|
152
|
+
readonly "back-out": Easing;
|
|
153
|
+
readonly elastic: Easing;
|
|
154
154
|
};
|
|
155
|
-
export type
|
|
155
|
+
export type EasingName = keyof typeof EASES;
|
|
156
156
|
/**
|
|
157
157
|
* The gate a spelled ease crosses. [LAW:parse-dont-validate] — a name in, the
|
|
158
158
|
* function out, so nothing downstream holds a string it must check again.
|
|
159
159
|
* Unknown names throw naming every legal one. [LAW:no-silent-failure]
|
|
160
160
|
*/
|
|
161
|
-
export declare function
|
|
161
|
+
export declare function parseEasing(name: string): Easing;
|
|
162
162
|
/** Throws, naming `what`, unless `seconds` is a positive, finite number of seconds. */
|
|
163
163
|
export declare function positiveSeconds(what: string, seconds: number): void;
|
|
164
164
|
/**
|
|
@@ -166,11 +166,11 @@ export declare function positiveSeconds(what: string, seconds: number): void;
|
|
|
166
166
|
* way the frames of an animation are each held and then replaced. `at(t)` is
|
|
167
167
|
* the index of the hold in progress at `t`, counted from the first hold at
|
|
168
168
|
* `t = 0`, and the sequence wraps every `period` seconds, before zero too,
|
|
169
|
-
* as `
|
|
169
|
+
* as `WrapMode.loop` wraps. With equal holds `at` is `steps(n)` read as an
|
|
170
170
|
* index; the holds here may differ, which `steps` cannot say, so a frame
|
|
171
171
|
* held for a second and the next for a quarter are one beat.
|
|
172
172
|
*/
|
|
173
|
-
export interface
|
|
173
|
+
export interface StepSequence {
|
|
174
174
|
readonly holds: readonly number[];
|
|
175
175
|
/** The sum of the holds: how long one pass takes, in seconds. */
|
|
176
176
|
readonly period: number;
|
|
@@ -180,10 +180,10 @@ export interface Beat {
|
|
|
180
180
|
* When the hold in progress at `t` began, in seconds on `t`'s own
|
|
181
181
|
* timeline: what a sample-and-hold on this beat reads at `t`. Every `t`
|
|
182
182
|
* inside one hold of one pass answers the same number, to the bit, so an
|
|
183
|
-
* effect handed it draws the same frame throughout. With `
|
|
183
|
+
* effect handed it draws the same frame throughout. With `validUntil`,
|
|
184
184
|
* the two ends of the hold, as every `Animation` answers them.
|
|
185
185
|
*/
|
|
186
|
-
|
|
186
|
+
validFrom(t: number): number;
|
|
187
187
|
/**
|
|
188
188
|
* When the hold in progress at `t` ends, in seconds on `t`'s own timeline:
|
|
189
189
|
* the start of the next hold, the first moment `at` places in it, so it is
|
|
@@ -191,9 +191,9 @@ export interface Beat {
|
|
|
191
191
|
* With `at`, this makes a beat an `Animation` of the hold in progress
|
|
192
192
|
* (`./animation.ts`).
|
|
193
193
|
*/
|
|
194
|
-
|
|
194
|
+
validUntil(t: number): number;
|
|
195
195
|
/** The beat with its motion taken out: its first hold, held for good, as a loop holds its first value. */
|
|
196
|
-
reduced():
|
|
196
|
+
reduced(): StepSequence;
|
|
197
197
|
}
|
|
198
198
|
/**
|
|
199
199
|
* `t`, unless it is not a finite number of seconds, which throws naming
|
|
@@ -234,14 +234,14 @@ export declare function walkUp(sum: number, reached: (x: number) => boolean, fin
|
|
|
234
234
|
* exact to the float and the cost is logarithmic in that distance.
|
|
235
235
|
*/
|
|
236
236
|
export declare function firstReaching(near: number, reached: (x: number) => boolean): number;
|
|
237
|
-
/** `holds` as a `
|
|
238
|
-
export declare function
|
|
239
|
-
/** The three phase shapes. Each takes seconds and returns a `
|
|
240
|
-
export declare const
|
|
237
|
+
/** `holds` as a `StepSequence`; a beat with no hold, or a hold that is not a positive number of seconds, throws. */
|
|
238
|
+
export declare function stepSequence(holds: readonly number[]): StepSequence;
|
|
239
|
+
/** The three phase shapes. Each takes seconds and returns a `WrapMode`. */
|
|
240
|
+
export declare const WrapMode: {
|
|
241
241
|
/** 0 before `start`, rising to 1 over `duration` seconds, then held at 1. */
|
|
242
|
-
once(start: number, duration: number):
|
|
242
|
+
once(start: number, duration: number): WrapMode;
|
|
243
243
|
/** 0 → 1 every `period` seconds, wrapping back to 0; negative `t` wraps too. */
|
|
244
|
-
loop(period: number):
|
|
244
|
+
loop(period: number): WrapMode;
|
|
245
245
|
/** 0 → 1 → 0 every `period` seconds: there in the first half, back in the second. */
|
|
246
|
-
pingPong(period: number):
|
|
246
|
+
pingPong(period: number): WrapMode;
|
|
247
247
|
};
|
package/dist/core/easing.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* `elastic`, Robert Penner's curves at the constants every animation
|
|
23
23
|
* library since has shipped. An ease that leaves [0, 1] — a spring or a
|
|
24
24
|
* back curve overshooting its rest — is still an ease: a `ColorRamp` holds
|
|
25
|
-
* its end
|
|
25
|
+
* its end colors where it does, and an effect's `Curve` saturates at its
|
|
26
26
|
* swing, so the overshoot is read by what can show it (a position, a
|
|
27
27
|
* count) and clipped by what cannot.
|
|
28
28
|
*
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* [LAW:one-type-per-behavior] An ease is a plain function value. CSS's named
|
|
34
34
|
* curves are four instances of `cubicBezier`, not four implementations, the
|
|
35
35
|
* spring in `EASES` is one `spring()`, and `ColorRamp` and every effect take
|
|
36
|
-
* the same `
|
|
36
|
+
* the same `Easing`.
|
|
37
37
|
*
|
|
38
38
|
* Tier 0 of `src/core/`: imports nothing, so `themes/` and every later
|
|
39
39
|
* `core/` module reach it downhill. [LAW:one-way-deps]
|
|
@@ -91,7 +91,7 @@ export function cubicBezier(x1, y1, x2, y2) {
|
|
|
91
91
|
}
|
|
92
92
|
return s;
|
|
93
93
|
};
|
|
94
|
-
return
|
|
94
|
+
return withSettlingTime((p) => yAt(solve(p)));
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
97
|
* CSS `steps(n, position)`: progress held flat in `n` equal intervals, jumping
|
|
@@ -115,12 +115,12 @@ export function steps(n, position = "jump-end") {
|
|
|
115
115
|
"jump-none": n - 1,
|
|
116
116
|
}[position];
|
|
117
117
|
const lift = jumpsAtStart ? 1 : 0;
|
|
118
|
-
return
|
|
118
|
+
return withSettlingTime((p) => Math.min(jumps, Math.floor(p * n) + lift) / jumps);
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
121
121
|
* The curve `shape` over [0, 1) as an ease that has arrived: its argument
|
|
122
122
|
* held to [0, 1], and exactly 1 at 1. Every built-in ease is one, so the two
|
|
123
|
-
* halves of the `
|
|
123
|
+
* halves of the `Easing` contract — an argument in [0, 1], the end landed on —
|
|
124
124
|
* are enforced here and nowhere else. [LAW:single-enforcer] The end matters
|
|
125
125
|
* because a curve is 1 at its end only in the limit or up to a rounding — a
|
|
126
126
|
* spring settles to within `SPRING_REST`, the elastic's ringing never quite
|
|
@@ -128,19 +128,19 @@ export function steps(n, position = "jump-end") {
|
|
|
128
128
|
* and a count or a width eased by it must land on its target, not a
|
|
129
129
|
* thousandth or an ulp short.
|
|
130
130
|
*/
|
|
131
|
-
export const
|
|
131
|
+
export const withSettlingTime = (shape) => (x) => {
|
|
132
132
|
const p = Math.min(1, Math.max(0, x));
|
|
133
133
|
return p === 1 ? 1 : shape(p);
|
|
134
134
|
};
|
|
135
135
|
/** The identity ease: progress unchanged. */
|
|
136
|
-
const linear =
|
|
136
|
+
const linear = withSettlingTime((p) => p);
|
|
137
137
|
/** CSS `step-end`: 0 until the very end. */
|
|
138
138
|
const stepEnd = steps(1, "jump-end");
|
|
139
139
|
/** A half-cosine, flat at both ends: the curve a breathing pulse wants. */
|
|
140
|
-
const sine =
|
|
140
|
+
const sine = withSettlingTime((p) => (1 - Math.cos(Math.PI * p)) / 2);
|
|
141
141
|
/**
|
|
142
142
|
* How close to its rest a spring must come to count as settled: one part in a
|
|
143
|
-
* thousand of the way it moves, under a
|
|
143
|
+
* thousand of the way it moves, under a color channel's step (1/255) and
|
|
144
144
|
* under any cell, so what rounds the spring's value to show it draws the rest
|
|
145
145
|
* from there on.
|
|
146
146
|
*/
|
|
@@ -171,7 +171,7 @@ export function spring(options = {}) {
|
|
|
171
171
|
const zeta = damping / (2 * Math.sqrt(stiffness * mass));
|
|
172
172
|
const decay = zeta * w0;
|
|
173
173
|
const { displacement, seconds } = zeta < 1 ? ringing(w0, zeta, decay) : creeping(w0, zeta, decay);
|
|
174
|
-
return { seconds, ease:
|
|
174
|
+
return { seconds, ease: withSettlingTime((p) => 1 - displacement(p * seconds)) };
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
177
|
* Where `|displacement|` falls through `SPRING_REST` between `lo` and `hi`,
|
|
@@ -258,7 +258,7 @@ const BOUNCE_ARCS = [
|
|
|
258
258
|
{ until: 2.5 / 2.75, centre: 2.25 / 2.75, floor: 0.9375 },
|
|
259
259
|
{ until: Number.POSITIVE_INFINITY, centre: 2.625 / 2.75, floor: 0.984375 },
|
|
260
260
|
];
|
|
261
|
-
const bounce =
|
|
261
|
+
const bounce = withSettlingTime((p) => {
|
|
262
262
|
// The last arc's `until` is unbounded, so an arc is always found.
|
|
263
263
|
const arc = BOUNCE_ARCS.find(({ until }) => p < until);
|
|
264
264
|
return 7.5625 * (p - arc.centre) ** 2 + arc.floor;
|
|
@@ -272,8 +272,8 @@ const bounce = settled((p) => {
|
|
|
272
272
|
* and lands on 1 to the bit.
|
|
273
273
|
*/
|
|
274
274
|
const BACK_OVERSHOOT = 1.70158;
|
|
275
|
-
const backIn =
|
|
276
|
-
const backOut =
|
|
275
|
+
const backIn = withSettlingTime((p) => p ** 3 + BACK_OVERSHOOT * p ** 2 * (p - 1));
|
|
276
|
+
const backOut = withSettlingTime((p) => {
|
|
277
277
|
const q = p - 1;
|
|
278
278
|
return 1 + q ** 3 + BACK_OVERSHOOT * q ** 2 * (q + 1);
|
|
279
279
|
});
|
|
@@ -284,7 +284,7 @@ const backOut = settled((p) => {
|
|
|
284
284
|
* last — `2^(−10x)·sin((10x − 0.75)·2π/3) + 1`.
|
|
285
285
|
*/
|
|
286
286
|
const ELASTIC_PERIOD = (2 * Math.PI) / 3;
|
|
287
|
-
const elastic =
|
|
287
|
+
const elastic = withSettlingTime((p) => 2 ** (-10 * p) * Math.sin((10 * p - 0.75) * ELASTIC_PERIOD) + 1);
|
|
288
288
|
/**
|
|
289
289
|
* Every built-in ease by the name a template spells it with — CSS's keyword
|
|
290
290
|
* names, plus `sine`, plus `step`: the spelling `ColorRamp` used before this
|
|
@@ -314,7 +314,7 @@ export const EASES = {
|
|
|
314
314
|
* function out, so nothing downstream holds a string it must check again.
|
|
315
315
|
* Unknown names throw naming every legal one. [LAW:no-silent-failure]
|
|
316
316
|
*/
|
|
317
|
-
export function
|
|
317
|
+
export function parseEasing(name) {
|
|
318
318
|
if (!Object.hasOwn(EASES, name)) {
|
|
319
319
|
throw new RangeError(`unknown ease ${JSON.stringify(name)}; expected one of ` +
|
|
320
320
|
Object.keys(EASES).map((n) => JSON.stringify(n)).join(", "));
|
|
@@ -335,8 +335,8 @@ const STILL = {
|
|
|
335
335
|
holds: [Number.POSITIVE_INFINITY],
|
|
336
336
|
period: Number.POSITIVE_INFINITY,
|
|
337
337
|
at: () => 0,
|
|
338
|
-
|
|
339
|
-
|
|
338
|
+
validFrom: () => Number.NEGATIVE_INFINITY,
|
|
339
|
+
validUntil: () => Number.POSITIVE_INFINITY,
|
|
340
340
|
reduced: () => STILL,
|
|
341
341
|
};
|
|
342
342
|
/**
|
|
@@ -352,7 +352,7 @@ export function finiteTime(what, t) {
|
|
|
352
352
|
/**
|
|
353
353
|
* The seconds into the current pass of a `period` at `t`: `t` taken modulo
|
|
354
354
|
* the period, into [0, period), before zero too. [LAW:single-enforcer] The
|
|
355
|
-
* one wrap `
|
|
355
|
+
* one wrap `WrapMode.loop` and `beat` both read time through, so a `t` that is
|
|
356
356
|
* not a finite number of seconds fails here, loudly, and nowhere else. A
|
|
357
357
|
* `t` at or past zero is `t % period` alone, which is exact; only a negative
|
|
358
358
|
* `t` is carried up by a period, so a boundary a host samples exactly lands
|
|
@@ -474,21 +474,21 @@ export function firstReaching(near, reached) {
|
|
|
474
474
|
lo = mid;
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
/** `holds` as a `
|
|
478
|
-
export function
|
|
477
|
+
/** `holds` as a `StepSequence`; a beat with no hold, or a hold that is not a positive number of seconds, throws. */
|
|
478
|
+
export function stepSequence(holds) {
|
|
479
479
|
if (holds.length === 0)
|
|
480
|
-
throw new RangeError("a
|
|
481
|
-
holds.forEach((
|
|
482
|
-
const period = holds.reduce((sum,
|
|
480
|
+
throw new RangeError("a step sequence needs at least one step");
|
|
481
|
+
holds.forEach((validity, i) => positiveSeconds(`step ${i}`, validity));
|
|
482
|
+
const period = holds.reduce((sum, validity) => sum + validity, 0);
|
|
483
483
|
// Where each hold begins, in seconds into the period: the unit
|
|
484
484
|
// `wrapSeconds` answers in, so the sum a boundary sits at is the number
|
|
485
485
|
// the wrap of a `t` on that boundary produces, and the hold that begins
|
|
486
486
|
// there is the one in progress, at any rate the host samples.
|
|
487
487
|
const starts = [];
|
|
488
488
|
let elapsed = 0;
|
|
489
|
-
for (const
|
|
489
|
+
for (const validity of holds) {
|
|
490
490
|
starts.push(elapsed);
|
|
491
|
-
elapsed +=
|
|
491
|
+
elapsed += validity;
|
|
492
492
|
}
|
|
493
493
|
// A copy, and the one `at` walks: what `at` and `period` were built from
|
|
494
494
|
// stays what `holds` says whatever the caller does to its array.
|
|
@@ -520,40 +520,40 @@ export function beat(holds) {
|
|
|
520
520
|
holds: own,
|
|
521
521
|
period,
|
|
522
522
|
at(t) {
|
|
523
|
-
return index(wrapSeconds("
|
|
523
|
+
return index(wrapSeconds("StepSequence.at", t, period));
|
|
524
524
|
},
|
|
525
|
-
|
|
526
|
-
const { pass, into } = passAt("
|
|
527
|
-
return boundary("
|
|
525
|
+
validFrom(t) {
|
|
526
|
+
const { pass, into } = passAt("StepSequence.validFrom", t, period);
|
|
527
|
+
return boundary("StepSequence.validFrom", pass, index(into), t);
|
|
528
528
|
},
|
|
529
529
|
// The next hold's start, in the next pass when this hold is the last.
|
|
530
|
-
|
|
531
|
-
const { pass, into } = passAt("
|
|
530
|
+
validUntil(t) {
|
|
531
|
+
const { pass, into } = passAt("StepSequence.validUntil", t, period);
|
|
532
532
|
const i = index(into);
|
|
533
533
|
const last = i === own.length - 1;
|
|
534
|
-
return boundary("
|
|
534
|
+
return boundary("StepSequence.validUntil", pass + (last ? 1 : 0), last ? 0 : i + 1, t);
|
|
535
535
|
},
|
|
536
536
|
reduced: () => STILL,
|
|
537
537
|
};
|
|
538
538
|
}
|
|
539
|
-
/** The three phase shapes. Each takes seconds and returns a `
|
|
540
|
-
export const
|
|
539
|
+
/** The three phase shapes. Each takes seconds and returns a `WrapMode`. */
|
|
540
|
+
export const WrapMode = {
|
|
541
541
|
/** 0 before `start`, rising to 1 over `duration` seconds, then held at 1. */
|
|
542
542
|
once(start, duration) {
|
|
543
543
|
if (!Number.isFinite(start))
|
|
544
|
-
throw new RangeError(`
|
|
545
|
-
positiveSeconds("
|
|
544
|
+
throw new RangeError(`WrapMode.once start must be finite, got ${start}`);
|
|
545
|
+
positiveSeconds("WrapMode.once duration", duration);
|
|
546
546
|
return (t) => Math.min(1, Math.max(0, (t - start) / duration));
|
|
547
547
|
},
|
|
548
548
|
/** 0 → 1 every `period` seconds, wrapping back to 0; negative `t` wraps too. */
|
|
549
549
|
loop(period) {
|
|
550
|
-
positiveSeconds("
|
|
551
|
-
return (t) => wrapSeconds("
|
|
550
|
+
positiveSeconds("WrapMode.loop period", period);
|
|
551
|
+
return (t) => wrapSeconds("WrapMode.loop", t, period) / period;
|
|
552
552
|
},
|
|
553
553
|
/** 0 → 1 → 0 every `period` seconds: there in the first half, back in the second. */
|
|
554
554
|
pingPong(period) {
|
|
555
|
-
positiveSeconds("
|
|
556
|
-
const wrap =
|
|
555
|
+
positiveSeconds("WrapMode.pingPong period", period);
|
|
556
|
+
const wrap = WrapMode.loop(period);
|
|
557
557
|
return (t) => 1 - Math.abs(2 * wrap(t) - 1);
|
|
558
558
|
},
|
|
559
559
|
};
|
package/dist/core/env.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
export type Env = Readonly<Record<string, string | undefined>>;
|
|
17
17
|
/**
|
|
18
18
|
* A terminal that says it cannot be drawn on: `TERM` is `dumb` or `unknown`,
|
|
19
|
-
* as Emacs' shell mode sets it. It takes no
|
|
19
|
+
* as Emacs' shell mode sets it. It takes no color and nothing that moves the
|
|
20
20
|
* cursor.
|
|
21
21
|
*/
|
|
22
22
|
export declare function isDumbTerminal(env: Env): boolean;
|
package/dist/core/env.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
/**
|
|
17
17
|
* A terminal that says it cannot be drawn on: `TERM` is `dumb` or `unknown`,
|
|
18
|
-
* as Emacs' shell mode sets it. It takes no
|
|
18
|
+
* as Emacs' shell mode sets it. It takes no color and nothing that moves the
|
|
19
19
|
* cursor.
|
|
20
20
|
*/
|
|
21
21
|
export function isDumbTerminal(env) {
|
package/dist/core/export-html.js
CHANGED
|
@@ -37,7 +37,7 @@ const OUTLINE = {
|
|
|
37
37
|
encircle: [FRAME, "border-radius:0.5em"],
|
|
38
38
|
};
|
|
39
39
|
/**
|
|
40
|
-
* The glyph
|
|
40
|
+
* The glyph color, and the background when one is painted.
|
|
41
41
|
*
|
|
42
42
|
* Dim arrives already blended into `foreground`. `opacity` is never written:
|
|
43
43
|
* it fades a painted background along with the glyph, which is the bug the
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* lines every exporter draws.
|
|
4
4
|
*
|
|
5
5
|
* The HTML and SVG exporters are two encodings of one picture, and this module
|
|
6
|
-
* is the picture. What a styled cell *looks like* — which
|
|
6
|
+
* is the picture. What a styled cell *looks like* — which color its glyph is,
|
|
7
7
|
* whether its background is painted, which decorations it carries, where it
|
|
8
8
|
* links — is decided here, once, and an exporter decides only how to write
|
|
9
9
|
* that down. Before it existed the decision was made twice, by a CSS method
|
|
10
10
|
* on `Style` and by a private converter on `Console`, and the two had already
|
|
11
|
-
* disagreed: one honoured `
|
|
11
|
+
* disagreed: one honoured `doubleUnderline`, the other dropped it.
|
|
12
12
|
*
|
|
13
13
|
* [LAW:types-are-the-program] `ExportLook` has no `reverse`, `dim`, `conceal`
|
|
14
|
-
* or default
|
|
14
|
+
* or default color, because all four are consumed by `resolveLook` and turned
|
|
15
15
|
* into plain RGB. An exporter holding a look cannot forget to swap a reversed
|
|
16
16
|
* run or to fade a dim one: there is nothing left in its hands to forget. That
|
|
17
17
|
* is the whole reason the representation is resolved rather than a `Style`
|
|
@@ -44,7 +44,7 @@ export type Href = string & {
|
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
46
|
* Where a run's background comes from. `"canvas"` is the theme background
|
|
47
|
-
* showing through — nothing painted — and is distinct from a painted
|
|
47
|
+
* showing through — nothing painted — and is distinct from a painted color
|
|
48
48
|
* that happens to equal it, because `on default` and `on #000000` are
|
|
49
49
|
* different requests even over a black theme.
|
|
50
50
|
*/
|
|
@@ -96,25 +96,25 @@ export interface ExportCanvas {
|
|
|
96
96
|
* The ground every export is drawn on under `theme`.
|
|
97
97
|
*
|
|
98
98
|
* An exporter paints its page or window with this, and a run with no
|
|
99
|
-
* background of its own resolves to `"canvas"` rather than a
|
|
100
|
-
* showing the canvas and the page around it cannot come out different
|
|
99
|
+
* background of its own resolves to `"canvas"` rather than a color, so a run
|
|
100
|
+
* showing the canvas and the page around it cannot come out different colors.
|
|
101
101
|
*/
|
|
102
102
|
export declare function exportCanvas(theme?: TerminalTheme): ExportCanvas;
|
|
103
103
|
/**
|
|
104
104
|
* A `Style` as it appears on screen under `theme`.
|
|
105
105
|
*
|
|
106
|
-
* The order is the terminal's: the
|
|
106
|
+
* The order is the terminal's: the colors are `Style.drawnColors`, the ones
|
|
107
107
|
* `toSgrCodes` writes, resolved through the theme — `reverse` swaps them,
|
|
108
108
|
* `dim` fades the glyph toward whatever background it ended up on, and
|
|
109
109
|
* `conceal` finally paints the glyph in that background. Every step works on
|
|
110
|
-
* opaque
|
|
110
|
+
* opaque color, so no exporter ever draws a translucent one. Text under
|
|
111
111
|
* `conceal` is still present, and still selectable, in both formats.
|
|
112
112
|
*
|
|
113
|
-
* A translucent
|
|
113
|
+
* A translucent color is flattened where the writer flattens it, over
|
|
114
114
|
* `SURFACE_BLACK`, not over this export's canvas. The writer's truecolor
|
|
115
115
|
* bytes are absolute — no terminal theme retints them — so a terminal under
|
|
116
|
-
* `theme` shows that
|
|
117
|
-
* would picture a
|
|
116
|
+
* `theme` shows that color, and an export that flattened over its own canvas
|
|
117
|
+
* would picture a color no terminal draws.
|
|
118
118
|
*
|
|
119
119
|
* `theme` omitted is `ColorSpec.getTruecolor`'s own fallback — black canvas,
|
|
120
120
|
* white ink, the standard ANSI table. Choosing it there rather than naming a
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* lines every exporter draws.
|
|
4
4
|
*
|
|
5
5
|
* The HTML and SVG exporters are two encodings of one picture, and this module
|
|
6
|
-
* is the picture. What a styled cell *looks like* — which
|
|
6
|
+
* is the picture. What a styled cell *looks like* — which color its glyph is,
|
|
7
7
|
* whether its background is painted, which decorations it carries, where it
|
|
8
8
|
* links — is decided here, once, and an exporter decides only how to write
|
|
9
9
|
* that down. Before it existed the decision was made twice, by a CSS method
|
|
10
10
|
* on `Style` and by a private converter on `Console`, and the two had already
|
|
11
|
-
* disagreed: one honoured `
|
|
11
|
+
* disagreed: one honoured `doubleUnderline`, the other dropped it.
|
|
12
12
|
*
|
|
13
13
|
* [LAW:types-are-the-program] `ExportLook` has no `reverse`, `dim`, `conceal`
|
|
14
|
-
* or default
|
|
14
|
+
* or default color, because all four are consumed by `resolveLook` and turned
|
|
15
15
|
* into plain RGB. An exporter holding a look cannot forget to swap a reversed
|
|
16
16
|
* run or to fade a dim one: there is nothing left in its hands to forget. That
|
|
17
17
|
* is the whole reason the representation is resolved rather than a `Style`
|
|
@@ -82,8 +82,8 @@ const DEFAULT_COLOR = ColorSpec.default();
|
|
|
82
82
|
* The ground every export is drawn on under `theme`.
|
|
83
83
|
*
|
|
84
84
|
* An exporter paints its page or window with this, and a run with no
|
|
85
|
-
* background of its own resolves to `"canvas"` rather than a
|
|
86
|
-
* showing the canvas and the page around it cannot come out different
|
|
85
|
+
* background of its own resolves to `"canvas"` rather than a color, so a run
|
|
86
|
+
* showing the canvas and the page around it cannot come out different colors.
|
|
87
87
|
*/
|
|
88
88
|
export function exportCanvas(theme) {
|
|
89
89
|
return {
|
|
@@ -94,18 +94,18 @@ export function exportCanvas(theme) {
|
|
|
94
94
|
/**
|
|
95
95
|
* A `Style` as it appears on screen under `theme`.
|
|
96
96
|
*
|
|
97
|
-
* The order is the terminal's: the
|
|
97
|
+
* The order is the terminal's: the colors are `Style.drawnColors`, the ones
|
|
98
98
|
* `toSgrCodes` writes, resolved through the theme — `reverse` swaps them,
|
|
99
99
|
* `dim` fades the glyph toward whatever background it ended up on, and
|
|
100
100
|
* `conceal` finally paints the glyph in that background. Every step works on
|
|
101
|
-
* opaque
|
|
101
|
+
* opaque color, so no exporter ever draws a translucent one. Text under
|
|
102
102
|
* `conceal` is still present, and still selectable, in both formats.
|
|
103
103
|
*
|
|
104
|
-
* A translucent
|
|
104
|
+
* A translucent color is flattened where the writer flattens it, over
|
|
105
105
|
* `SURFACE_BLACK`, not over this export's canvas. The writer's truecolor
|
|
106
106
|
* bytes are absolute — no terminal theme retints them — so a terminal under
|
|
107
|
-
* `theme` shows that
|
|
108
|
-
* would picture a
|
|
107
|
+
* `theme` shows that color, and an export that flattened over its own canvas
|
|
108
|
+
* would picture a color no terminal draws.
|
|
109
109
|
*
|
|
110
110
|
* `theme` omitted is `ColorSpec.getTruecolor`'s own fallback — black canvas,
|
|
111
111
|
* white ink, the standard ANSI table. Choosing it there rather than naming a
|
|
@@ -130,10 +130,10 @@ export function resolveLook(style, theme) {
|
|
|
130
130
|
background,
|
|
131
131
|
bold: style.bold === true,
|
|
132
132
|
italic: style.italic === true,
|
|
133
|
-
underline: style.
|
|
133
|
+
underline: style.doubleUnderline ? "double" : style.underline ? "single" : "none",
|
|
134
134
|
strike: style.strike === true,
|
|
135
135
|
overline: style.overline === true,
|
|
136
|
-
blink: style.
|
|
136
|
+
blink: style.rapidBlink ? "fast" : style.blink ? "slow" : "none",
|
|
137
137
|
outline: style.encircle ? "encircle" : style.frame ? "frame" : "none",
|
|
138
138
|
href: style.link === undefined ? null : parseHref(style.link),
|
|
139
139
|
};
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
*
|
|
10
10
|
* The geometry is Rich's — a 20px character, a cell 0.61 of that wide, a row
|
|
11
11
|
* 1.22 of it tall, the same margin and padding — so a screenshot of the same
|
|
12
|
-
* program matches the library this ports. The frame's
|
|
12
|
+
* program matches the library this ports. The frame's color is not Rich's:
|
|
13
13
|
* Rich strokes it white at 35% whatever the theme, which vanishes around a
|
|
14
14
|
* light canvas. Here it is the theme's ink blended 35% into the canvas — over
|
|
15
|
-
* a black canvas the
|
|
16
|
-
* lying outside the canvas does not take on the
|
|
15
|
+
* a black canvas the color Rich draws — and opaque, so the half of the stroke
|
|
16
|
+
* lying outside the canvas does not take on the color of the page around it.
|
|
17
17
|
*
|
|
18
18
|
* Nor is how a glyph lands on its cell. The exporter has no font engine and
|
|
19
19
|
* does not know which font the viewer will draw with, so no advance width can
|
package/dist/core/export-svg.js
CHANGED
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
*
|
|
10
10
|
* The geometry is Rich's — a 20px character, a cell 0.61 of that wide, a row
|
|
11
11
|
* 1.22 of it tall, the same margin and padding — so a screenshot of the same
|
|
12
|
-
* program matches the library this ports. The frame's
|
|
12
|
+
* program matches the library this ports. The frame's color is not Rich's:
|
|
13
13
|
* Rich strokes it white at 35% whatever the theme, which vanishes around a
|
|
14
14
|
* light canvas. Here it is the theme's ink blended 35% into the canvas — over
|
|
15
|
-
* a black canvas the
|
|
16
|
-
* lying outside the canvas does not take on the
|
|
15
|
+
* a black canvas the color Rich draws — and opaque, so the half of the stroke
|
|
16
|
+
* lying outside the canvas does not take on the color of the page around it.
|
|
17
17
|
*
|
|
18
18
|
* Nor is how a glyph lands on its cell. The exporter has no font engine and
|
|
19
19
|
* does not know which font the viewer will draw with, so no advance width can
|
|
@@ -141,7 +141,7 @@ function textSvg({ text, column, cells }, baseline, inVisualOrder) {
|
|
|
141
141
|
/**
|
|
142
142
|
* One run: its glyphs, then its lines and outline over them, in a group whose
|
|
143
143
|
* class carries the look — so the lines take the glyph's `fill` and blink
|
|
144
|
-
* with it. The outline is a stroke, so it names its
|
|
144
|
+
* with it. The outline is a stroke, so it names its color itself.
|
|
145
145
|
*/
|
|
146
146
|
function runSvg(run, className) {
|
|
147
147
|
const { look } = run;
|
package/dist/core/markup.js
CHANGED
|
@@ -616,7 +616,7 @@ function compose(frame, baseStyle) {
|
|
|
616
616
|
// The reversal is the whole of the tie-break, not decoration.
|
|
617
617
|
// `[red][blue]x[/blue][/red]` yields two spans that both start at 0, and a
|
|
618
618
|
// stable sort leaves those in the order they arrived — closing order,
|
|
619
|
-
// innermost first — which is the outer
|
|
619
|
+
// innermost first — which is the outer color winning. Reversed first, the
|
|
620
620
|
// outer arrives first and the inner repaints it (rich-markup-krk).
|
|
621
621
|
const spans = [...frame.spans].reverse().sort((a, b) => a.start - b.start);
|
|
622
622
|
const result = new RichText(frame.plain);
|
package/dist/core/memo.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* memo — a string-keyed memo with a size bound: the one cache shape for a
|
|
3
3
|
* pure computation whose keys a long-running host derives without end. A
|
|
4
|
-
* statusline daemon redrawing a time-varying
|
|
4
|
+
* statusline daemon redrawing a time-varying color parses a new hex string,
|
|
5
5
|
* matches a new RGB triple, measures a new cell, on every frame; a memo that
|
|
6
6
|
* never evicts grows by one entry per frame for the life of the process.
|
|
7
7
|
*/
|
package/dist/core/memo.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* memo — a string-keyed memo with a size bound: the one cache shape for a
|
|
3
3
|
* pure computation whose keys a long-running host derives without end. A
|
|
4
|
-
* statusline daemon redrawing a time-varying
|
|
4
|
+
* statusline daemon redrawing a time-varying color parses a new hex string,
|
|
5
5
|
* matches a new RGB triple, measures a new cell, on every frame; a memo that
|
|
6
6
|
* never evicts grows by one entry per frame for the life of the process.
|
|
7
7
|
*/
|