@kitlangton/knobs 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1414 -2
- package/dist/dev/chunk-4km87zfx.js +155 -0
- package/dist/dev/chunk-5cr85vv6.js +17726 -0
- package/dist/dev/chunk-693jd1gj.js +1435 -0
- package/dist/dev/chunk-gezhc24g.js +1132 -0
- package/dist/dev/index.js +1660 -0
- package/dist/index.js +2651 -0
- package/dist/panel.js +26404 -0
- package/dist/react.js +326 -0
- package/dist/solid.js +336 -0
- package/dist/themes.js +235 -0
- package/dist/types/core/adapter.d.ts +21 -0
- package/dist/types/core/code.d.ts +3 -0
- package/dist/types/core/color.d.ts +27 -0
- package/dist/types/core/easing.d.ts +21 -0
- package/dist/types/core/internal.d.ts +18 -0
- package/dist/types/core/keys.d.ts +21 -0
- package/dist/types/core/mutate.d.ts +21 -0
- package/dist/types/core/ramp.d.ts +150 -0
- package/dist/types/core/random.d.ts +62 -0
- package/dist/types/core/readout.d.ts +73 -0
- package/dist/types/core/remote.d.ts +260 -0
- package/dist/types/core/schema.d.ts +550 -0
- package/dist/types/core/spring.d.ts +38 -0
- package/dist/types/core/storage.d.ts +8 -0
- package/dist/types/core/store.d.ts +536 -0
- package/dist/types/core/theme.d.ts +27 -0
- package/dist/types/core/variants.d.ts +25 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/panel/attach.d.ts +5 -0
- package/dist/types/panel/choice.d.ts +56 -0
- package/dist/types/panel/die.d.ts +121 -0
- package/dist/types/panel/editors.d.ts +170 -0
- package/dist/types/panel/flash.d.ts +13 -0
- package/dist/types/panel/folds.d.ts +14 -0
- package/dist/types/panel/give.d.ts +73 -0
- package/dist/types/panel/gpu/atlas.d.ts +40 -0
- package/dist/types/panel/gpu/color.d.ts +128 -0
- package/dist/types/panel/gpu/die.wgsl.d.ts +1 -0
- package/dist/types/panel/gpu/renderer.d.ts +784 -0
- package/dist/types/panel/gpu/shader.wgsl.d.ts +2 -0
- package/dist/types/panel/haptics.d.ts +12 -0
- package/dist/types/panel/has.d.ts +13 -0
- package/dist/types/panel/hints.d.ts +45 -0
- package/dist/types/panel/icons.d.ts +30 -0
- package/dist/types/panel/index.d.ts +11 -0
- package/dist/types/panel/inspector.d.ts +50 -0
- package/dist/types/panel/measure.d.ts +6 -0
- package/dist/types/panel/menu.d.ts +38 -0
- package/dist/types/panel/morph.d.ts +38 -0
- package/dist/types/panel/motion.d.ts +77 -0
- package/dist/types/panel/optkeys.d.ts +7 -0
- package/dist/types/panel/page-hints.d.ts +82 -0
- package/dist/types/panel/page.d.ts +423 -0
- package/dist/types/panel/panel.d.ts +43 -0
- package/dist/types/panel/position.d.ts +5 -0
- package/dist/types/panel/prefs.d.ts +28 -0
- package/dist/types/panel/presets.d.ts +60 -0
- package/dist/types/panel/ramp-morph.d.ts +117 -0
- package/dist/types/panel/ramps.d.ts +14 -0
- package/dist/types/panel/readout-row.d.ts +21 -0
- package/dist/types/panel/reel.d.ts +43 -0
- package/dist/types/panel/reveal.d.ts +15 -0
- package/dist/types/panel/rolling-css.d.ts +2 -0
- package/dist/types/panel/scope.d.ts +19 -0
- package/dist/types/panel/search.d.ts +36 -0
- package/dist/types/panel/seg.d.ts +15 -0
- package/dist/types/panel/session.d.ts +21 -0
- package/dist/types/panel/slider.d.ts +92 -0
- package/dist/types/panel/smear.d.ts +7 -0
- package/dist/types/panel/sound.d.ts +137 -0
- package/dist/types/panel/spin.d.ts +13 -0
- package/dist/types/panel/styles.d.ts +11 -0
- package/dist/types/panel/swipe.d.ts +114 -0
- package/dist/types/panel/switcher.d.ts +20 -0
- package/dist/types/panel/tabs.d.ts +31 -0
- package/dist/types/panel/thumb.d.ts +36 -0
- package/dist/types/panel/toolbar-grid.d.ts +6 -0
- package/dist/types/react/Knobs.d.ts +15 -0
- package/dist/types/react/VariantSwitcher.d.ts +10 -0
- package/dist/types/react/index.d.ts +3 -0
- package/dist/types/react/useControls.d.ts +11 -0
- package/dist/types/solid/index.d.ts +50 -0
- package/dist/types/themes/index.d.ts +1 -0
- package/dist/types/ui/activity-css.d.ts +1 -0
- package/dist/types/ui/activity-model.d.ts +122 -0
- package/dist/types/ui/activity.d.ts +67 -0
- package/dist/types/ui/bento-css.d.ts +1 -0
- package/dist/types/ui/bento-model.d.ts +96 -0
- package/dist/types/ui/bento.d.ts +77 -0
- package/dist/types/ui/commands.d.ts +11 -0
- package/dist/types/ui/confirm.d.ts +13 -0
- package/dist/types/ui/follow.d.ts +17 -0
- package/dist/types/ui/index.d.ts +24 -0
- package/dist/types/ui/layer.d.ts +70 -0
- package/dist/types/ui/look.d.ts +62 -0
- package/dist/types/ui/menu.d.ts +63 -0
- package/dist/types/ui/overlay-css.d.ts +1 -0
- package/dist/types/ui/overlay-model.d.ts +87 -0
- package/dist/types/ui/palette.d.ts +38 -0
- package/dist/types/ui/picker-css.d.ts +1 -0
- package/dist/types/ui/picker-model.d.ts +53 -0
- package/dist/types/ui/picker.d.ts +67 -0
- package/dist/types/ui/popover.d.ts +35 -0
- package/dist/types/ui/react.d.ts +72 -0
- package/dist/types/ui/readout-css.d.ts +1 -0
- package/dist/types/ui/readout-model.d.ts +137 -0
- package/dist/types/ui/readouts.d.ts +85 -0
- package/dist/types/ui/rgba.d.ts +6 -0
- package/dist/types/ui/solid.d.ts +63 -0
- package/dist/types/ui/split-model.d.ts +135 -0
- package/dist/types/ui/split.d.ts +92 -0
- package/dist/types/ui/timeline-model.d.ts +83 -0
- package/dist/types/ui/timeline.d.ts +76 -0
- package/dist/types/ui/toast.d.ts +19 -0
- package/dist/types/ui/tooltip.d.ts +19 -0
- package/dist/types/ui/tree-model.d.ts +125 -0
- package/dist/types/ui/tree.d.ts +95 -0
- package/dist/ui-react.js +9230 -0
- package/dist/ui-solid.js +9162 -0
- package/dist/ui.js +11826 -0
- package/package.json +99 -4
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { type SpringValue } from "../core/spring.js";
|
|
2
|
+
import type { RowContext } from "./editors.js";
|
|
3
|
+
export interface Pt {
|
|
4
|
+
readonly x: number;
|
|
5
|
+
readonly y: number;
|
|
6
|
+
}
|
|
7
|
+
export interface MorphPlan {
|
|
8
|
+
/** For each new point, the old point it travels from, or -1: it buds. */
|
|
9
|
+
readonly from: readonly number[];
|
|
10
|
+
/** Each old point without a partner, and the new point it merges into (-1: none, it shrinks). */
|
|
11
|
+
readonly merges: readonly {
|
|
12
|
+
readonly old: number;
|
|
13
|
+
readonly into: number;
|
|
14
|
+
}[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Pairs `prev`'s points with `next`'s. The first stays the first and the last the last; the inner
|
|
18
|
+
* ones pair in order, as many as both have, choosing the pairing that travels least (in the 0…1
|
|
19
|
+
* box). Only the surplus is left over: merging when there are fewer, budding when more.
|
|
20
|
+
*/
|
|
21
|
+
export declare function matchPoints(prev: readonly Pt[], next: readonly Pt[]): MorphPlan;
|
|
22
|
+
/** `flat` (`stride` numbers per sample) resampled to `n` samples evenly along its index. */
|
|
23
|
+
export declare function resample(flat: readonly number[], stride: number, n: number): number[];
|
|
24
|
+
/** The y of an x, y polyline (x not decreasing) at `x`, holding its ends past them. */
|
|
25
|
+
export declare function sampleAt(flat: readonly number[], x: number): number;
|
|
26
|
+
/** A point on its way: its channels (x, y, then any extras, then its size), their speeds and goals. */
|
|
27
|
+
export interface MorphDot {
|
|
28
|
+
readonly id: number;
|
|
29
|
+
readonly at: number[];
|
|
30
|
+
readonly vel: number[];
|
|
31
|
+
readonly to: number[];
|
|
32
|
+
/** Merging: the dot it shrinks into (-1 shrinks where it is); undefined while it's one of the points. */
|
|
33
|
+
into?: number;
|
|
34
|
+
}
|
|
35
|
+
/** The default travel: .3 s with no bounce. */
|
|
36
|
+
export declare const MORPH_SPRING: SpringValue;
|
|
37
|
+
/** How long a point merging into its neighbour takes to shrink away (s). */
|
|
38
|
+
export declare const MERGE_SPRING: SpringValue;
|
|
39
|
+
export interface MorphSet {
|
|
40
|
+
/** Snap there: nothing moves (a drag, a different item, reduced motion). */
|
|
41
|
+
readonly instant?: boolean;
|
|
42
|
+
/** Hold the current motion this long (ms) first, as a cascade of rows does. */
|
|
43
|
+
readonly delay?: number;
|
|
44
|
+
readonly now: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The shown samples and points of a ramp between shapes: `stride` numbers per sample, `dims`
|
|
48
|
+
* channels per point (x, y and any extras; the dot's size is kept after them). Every number has
|
|
49
|
+
* its own spring, so a change mid-flight keeps each one's speed.
|
|
50
|
+
*/
|
|
51
|
+
export declare class RampMorph {
|
|
52
|
+
readonly stride: number;
|
|
53
|
+
readonly dims: number;
|
|
54
|
+
/** Where a new point buds from: on the line under it as it's shown now (no size channel). */
|
|
55
|
+
private readonly origin;
|
|
56
|
+
samples: number[];
|
|
57
|
+
private sampleVel;
|
|
58
|
+
private sampleTo;
|
|
59
|
+
/** The points, in order. */
|
|
60
|
+
live: MorphDot[];
|
|
61
|
+
/** Points merging away into others. */
|
|
62
|
+
gone: MorphDot[];
|
|
63
|
+
private ids;
|
|
64
|
+
private last;
|
|
65
|
+
private pending;
|
|
66
|
+
private resting;
|
|
67
|
+
omega: number;
|
|
68
|
+
zeta: number;
|
|
69
|
+
private readonly shrink;
|
|
70
|
+
constructor(stride: number, dims: number, spring?: SpringValue,
|
|
71
|
+
/** Where a new point buds from: on the line under it as it's shown now (no size channel). */
|
|
72
|
+
origin?: (to: readonly number[], samples: readonly number[]) => number[]);
|
|
73
|
+
get moving(): boolean;
|
|
74
|
+
/** The points' channels as the shape stands (where the live dots are going). */
|
|
75
|
+
private points;
|
|
76
|
+
private dot;
|
|
77
|
+
/** Moves toward `samples` and `points` (each `dims` channels, without the size). */
|
|
78
|
+
set(samples: readonly number[], points: readonly (readonly number[])[], o: MorphSet): void;
|
|
79
|
+
private snap;
|
|
80
|
+
private retarget;
|
|
81
|
+
/** Where a merging dot is headed: the dot it merges into, followed if that one is merging too. */
|
|
82
|
+
private target;
|
|
83
|
+
/** Advances to `now` (ms); whether anything still moves. A time already reached is a no-op. */
|
|
84
|
+
step(now: number): boolean;
|
|
85
|
+
/** The line's fastest sample (px/s), given px per unit across and up. */
|
|
86
|
+
sampleSpeed(sx: number, sy: number): number;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* How wide (px) a moving line or point smears at `speed` px/s, by `strength` (--k-curve-blur, 0
|
|
90
|
+
* to 1): at 1, about what a half-open shutter catches in a 60 Hz frame. Under a quarter pixel it
|
|
91
|
+
* is 0, so it rests crisp.
|
|
92
|
+
*/
|
|
93
|
+
export declare function curveSmear(speed: number, strength: number, cap?: number): number;
|
|
94
|
+
/** The widest a moving curve's line smears (px): it's thin, so less than a point does. */
|
|
95
|
+
export declare const LINE_SMEAR = 4;
|
|
96
|
+
/** How strongly a ramp's moving line and points smear (--k-curve-blur, 0 off to 1). */
|
|
97
|
+
export declare const curveBlur: (row: HTMLElement) => number;
|
|
98
|
+
/**
|
|
99
|
+
* Runs a morph on one frame loop while it moves, drawing each frame; `wake` asks the GPU for a
|
|
100
|
+
* frame too, which reads the same morph (stepping it to its own frame time first: a time already
|
|
101
|
+
* reached is a no-op, so the two never step it twice).
|
|
102
|
+
*/
|
|
103
|
+
export declare function morphLoop(c: RowContext<unknown>, morph: RampMorph, draw: () => void): {
|
|
104
|
+
kick(): void;
|
|
105
|
+
dispose(): void;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* The DOM's motion blur for a ramp's line and points: an SVG Gaussian per element, its deviation
|
|
109
|
+
* the GPU smear's box width over √12 (the same spread). Off (no filter at all) at rest.
|
|
110
|
+
*/
|
|
111
|
+
export declare function smearFilters(doc: Document, plot: SVGSVGElement): {
|
|
112
|
+
/** The line's smear: `set(px)` blurs `path` across (0 takes the filter off). */
|
|
113
|
+
line(path: SVGPathElement): (px: number) => void;
|
|
114
|
+
/** A point's smear along its travel (px across, px down); 0, 0 takes it off. */
|
|
115
|
+
dot(node: HTMLElement, sx: number, sy: number): void;
|
|
116
|
+
drop(node: HTMLElement): void;
|
|
117
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CurveField, GradientField } from "../core/schema.js";
|
|
2
|
+
import { type EditorRow, type RowContext } from "./editors.js";
|
|
3
|
+
/** The custom properties a gradient strip's samples ride on (written each frame of a morph). */
|
|
4
|
+
export declare const GRADIENT_VARS: string[];
|
|
5
|
+
/**
|
|
6
|
+
* A gradient: a swatch strip with stop ticks in the head; a wide strip with a handle per stop, the
|
|
7
|
+
* selected stop's colour strips and any presets in the body.
|
|
8
|
+
*/
|
|
9
|
+
export declare function gradientRow(c: RowContext<GradientField>): EditorRow;
|
|
10
|
+
/**
|
|
11
|
+
* A curve: its name (when it's a preset) and a mini curve in the head; a graph with a grid,
|
|
12
|
+
* draggable points and a hover crosshair, and shape chips, in the body.
|
|
13
|
+
*/
|
|
14
|
+
export declare function curveRow(c: RowContext<CurveField>): EditorRow;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReadoutState } from "../core/readout.js";
|
|
2
|
+
import type { ReadoutField } from "../core/schema.js";
|
|
3
|
+
import { type ReadoutView } from "../ui/readouts.js";
|
|
4
|
+
import type { EditorRow } from "./editors.js";
|
|
5
|
+
import type { RowWave } from "./gpu/renderer.js";
|
|
6
|
+
export interface ReadoutRow extends EditorRow {
|
|
7
|
+
readonly view: ReadoutView;
|
|
8
|
+
/** Something new arrived for this key. */
|
|
9
|
+
notify(): void;
|
|
10
|
+
swap(field: ReadoutField, display: string): void;
|
|
11
|
+
}
|
|
12
|
+
export declare function readoutRow(c: {
|
|
13
|
+
doc: Document;
|
|
14
|
+
key: string;
|
|
15
|
+
display: string;
|
|
16
|
+
field: ReadoutField;
|
|
17
|
+
state: ReadoutState;
|
|
18
|
+
wave: RowWave;
|
|
19
|
+
wake(): void;
|
|
20
|
+
gpu(): boolean;
|
|
21
|
+
}): ReadoutRow;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { DigitPlace } from "./slider.js";
|
|
2
|
+
/**
|
|
3
|
+
* Brings a readout's places to `text` (a place per character, ones first), as rolling-number
|
|
4
|
+
* does: each digit a wheel rolling through every face in the value's direction (98 → 108 rolls
|
|
5
|
+
* the tens 9 → 0 forwards), new places rising in after a short hold, cascading outward, and
|
|
6
|
+
* leaving places fading over ~65% of `ms`. `ms` 0 places it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function syncPlaces(places: DigitPlace[], text: string, trend: number, ms: number, delay: number, entering?: boolean): void;
|
|
9
|
+
/** How long a readout rolls (ms): the panel's --k-roll, 320 by default. */
|
|
10
|
+
export declare function rollMs(el: Element): number;
|
|
11
|
+
/** A readout's parts: text, or a number shown to `decimals` places. */
|
|
12
|
+
export type ReadoutPart = string | {
|
|
13
|
+
readonly value: number;
|
|
14
|
+
readonly decimals: number;
|
|
15
|
+
};
|
|
16
|
+
/** A part as laid out: its element, its text, and a number's places for the canvas. */
|
|
17
|
+
export interface ReelSegment {
|
|
18
|
+
readonly el: HTMLElement;
|
|
19
|
+
text: string;
|
|
20
|
+
readonly places?: DigitPlace[];
|
|
21
|
+
}
|
|
22
|
+
export interface RollingReadout {
|
|
23
|
+
readonly host: HTMLElement;
|
|
24
|
+
readonly segments: readonly ReelSegment[];
|
|
25
|
+
/** Everything it shows, as one string. */
|
|
26
|
+
readonly text: string;
|
|
27
|
+
/**
|
|
28
|
+
* Shows `parts`. Numbers roll over `ms` (0 places them: the first paint, the user's own hand,
|
|
29
|
+
* a landing), after `delay` ms for the row's turn in a cascade.
|
|
30
|
+
*/
|
|
31
|
+
show(parts: readonly ReadoutPart[], ms: number, delay?: number): void;
|
|
32
|
+
dispose(): void;
|
|
33
|
+
}
|
|
34
|
+
/** The rolling readout an element holds, if it holds one (the canvas draws its segments). */
|
|
35
|
+
export declare const rollingReadoutOf: (el: Element) => RollingReadout | undefined;
|
|
36
|
+
/** Makes `host`'s content a rolling readout (its children are the readout's from now on). */
|
|
37
|
+
export declare function rollingReadout(host: HTMLElement): RollingReadout;
|
|
38
|
+
/**
|
|
39
|
+
* Sets a name-like readout (an easing's or curve's name, a hex colour). `fade` crossfades the old
|
|
40
|
+
* text out over the new, where it was; without it (the user's own hand) the text just changes.
|
|
41
|
+
* The canvas does the same, reading `data-text` and `data-fade`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function fadeText(el: HTMLElement, text: string, fade: boolean): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const isAnyRevealing: () => boolean;
|
|
2
|
+
export declare const isRevealingIn: (root: HTMLElement) => boolean;
|
|
3
|
+
export declare const getRevealVersion: () => number;
|
|
4
|
+
export declare const isRevealing: (node: HTMLElement) => boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Eases an in-flow element from height `from` to the height it has now, after its content
|
|
7
|
+
* changed, so what's below glides. Read `from` before the change (mid-flight is fine).
|
|
8
|
+
*/
|
|
9
|
+
export declare function resize(node: HTMLElement, from: number): void;
|
|
10
|
+
/**
|
|
11
|
+
* Shows or hides an in-flow element by animating its height (and margins/padding) open or shut,
|
|
12
|
+
* so the content below glides instead of jumping. Interruptible: reversing mid-flight continues
|
|
13
|
+
* from the current height.
|
|
14
|
+
*/
|
|
15
|
+
export declare function reveal(node: HTMLElement, show: boolean, after?: () => void, delay?: number): void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: ".rn-root {\n display: inline-block;\n position: relative;\n white-space: pre;\n unicode-bidi: isolate;\n vertical-align: baseline;\n}\n.rn-root > .rn-measure,\n.rn-root > .rn-visual { display: none; }\n.rn-root[data-rn-measuring] > .rn-measure {\n display: inline-flex;\n position: relative;\n visibility: hidden;\n white-space: pre;\n padding: 0;\n border: 0;\n}\n.rn-token { display: inline-block; padding: 0; border: 0; }\n.rn-root[data-rn-measuring] > .rn-value,\n.rn-react[data-rn-hydrated] > .rn-semantic,\n.rn-solid[data-rn-hydrated] > .rn-semantic {\n position: absolute;\n inset: 0;\n padding: 0;\n margin: 0;\n color: transparent;\n z-index: 1;\n}\n/* A single native text layer is selectable; decorative reels never enter a copy. */\n.rn-value::selection, .rn-semantic::selection {\n color: HighlightText;\n background: Highlight;\n}\n.rn-root[data-rn-ready] > .rn-visual {\n display: block;\n position: absolute;\n inset: 0;\n pointer-events: none;\n user-select: none;\n}\n.rn-slot {\n position: absolute;\n left: 0;\n overflow: hidden;\n /* Space for italic overhang without changing the measured advance width. */\n box-sizing: content-box;\n padding-inline: 0.15em;\n margin-inline-start: -0.15em;\n -webkit-mask-image: var(--rn-mask, linear-gradient(\n to bottom,\n transparent,\n #000 var(--rn-edge-fade, 0.12em),\n #000 calc(100% - var(--rn-edge-fade, 0.12em)),\n transparent\n ));\n mask-image: var(--rn-mask, linear-gradient(\n to bottom,\n transparent,\n #000 var(--rn-edge-fade, 0.12em),\n #000 calc(100% - var(--rn-edge-fade, 0.12em)),\n transparent\n ));\n -webkit-mask-repeat: no-repeat;\n mask-repeat: no-repeat;\n}\n@supports (overflow: clip) {\n .rn-slot { overflow-x: visible; overflow-y: clip; }\n}\n.rn-slot:not([data-rn-wheel]) {\n overflow: visible;\n -webkit-mask-image: none;\n mask-image: none;\n}\n.rn-enter, .rn-reel, .rn-face { display: block; }\n.rn-reel { position: relative; }\n.rn-ink { display: block; position: absolute; inset: 0; will-change: transform; }\n/* Safari's SVG filter must rasterize the smear's descendants into its input. */\n.rn-smear .rn-ink { will-change: auto; }\n/* Each turning half carries its own perspective transform, not a shared 3D scene. */\n/* The slot acts as the bezel: the card stays vertically framed while it hinges. */\n.rn-slot[data-rn-flap] { -webkit-mask-image: none; mask-image: none; }\n/* Hinged faces must occlude the cards behind them, including with default CSS. */\n:where(.rn-slot[data-rn-flap]) .rn-face { background: var(--rn-flap-background, Canvas); }\n.rn-flap { position: absolute; inset: 0; transform-origin: 50% 50%; backface-visibility: hidden; }\n/* --rn-crease is the visible hinge gap between the two halves. */\n.rn-flap-top { clip-path: inset(0 0 calc(50% + var(--rn-crease, 1px) / 2) 0); }\n.rn-flap-bottom { clip-path: inset(calc(50% + var(--rn-crease, 1px) / 2) 0 0 0); }\n.rn-sharp, .rn-smear { display: block; }\n.rn-smear { position: absolute; inset: 0; pointer-events: none; }\n.rn-blur-defs { position: absolute; width: 0; height: 0; overflow: hidden; }\n.rn-face { text-align: center; white-space: pre; }\n.rn-react, .rn-solid { display: inline-block; position: relative; white-space: pre; unicode-bidi: isolate; }\n.rn-mount { display: inline-block; user-select: none; }\n.rn-mount .rn-value { pointer-events: none; }\n.rn-react:not([data-rn-hydrated]) > .rn-mount,\n.rn-solid:not([data-rn-hydrated]) > .rn-mount { display: none; }\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** How deep focus sits in the panel. */
|
|
2
|
+
export type FocusLevel = "row" | "card" | "panel" | "none";
|
|
3
|
+
/** Where Esc takes focus from `level`: up one, past a card when the row isn't in one. */
|
|
4
|
+
export declare function escapeTo(level: FocusLevel, inCard?: boolean): FocusLevel;
|
|
5
|
+
/** What R and ⇧R act on: a selection always wins, then the level focused. */
|
|
6
|
+
export type CommandScope = "selection" | "row" | "group" | "all";
|
|
7
|
+
export declare function commandScope(level: FocusLevel, selection?: boolean): CommandScope;
|
|
8
|
+
/** How a command reads from where it would land: "Random this", "Reset group", "Random all". */
|
|
9
|
+
export declare function scopeLabel(verb: string, scope: CommandScope): string;
|
|
10
|
+
/**
|
|
11
|
+
* The option a digit picks among `count` (0-based), or undefined when it names none: 1–9 pick
|
|
12
|
+
* the first nine, as they read.
|
|
13
|
+
*/
|
|
14
|
+
export declare function digitOption(key: string, count: number): number | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* The digit hints for a row's options: one per option that shows (up to nine), or, while they
|
|
17
|
+
* don't (a menu, a folded editor), one standing for them all ("1–5").
|
|
18
|
+
*/
|
|
19
|
+
export declare function digitHints(count: number, showing: boolean): string[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface SearchChipSpec {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly label: string;
|
|
4
|
+
readonly count?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A panel's search field: a text field that filters rows as you type, and filter chips beside it
|
|
8
|
+
* ("Modified 3") that narrow them further. It's drawn by the DOM in both renderers.
|
|
9
|
+
*/
|
|
10
|
+
export interface SearchBar {
|
|
11
|
+
readonly element: HTMLElement;
|
|
12
|
+
readonly input: HTMLInputElement;
|
|
13
|
+
readonly chips: readonly HTMLButtonElement[];
|
|
14
|
+
/** The trimmed query, lower-cased. */
|
|
15
|
+
query(): string;
|
|
16
|
+
/** The chips that are on. */
|
|
17
|
+
active(): ReadonlySet<string>;
|
|
18
|
+
/** Whether anything narrows the rows (a query or a chip). */
|
|
19
|
+
filtering(): boolean;
|
|
20
|
+
/** Shows each counted chip's number. */
|
|
21
|
+
counts(counts: ReadonlyMap<string, number>): void;
|
|
22
|
+
/** Empties the query and turns the chips off. */
|
|
23
|
+
clear(): void;
|
|
24
|
+
/** Sets the query as typed, and (when given) exactly which chips are on. */
|
|
25
|
+
set(query: string | undefined, chips?: readonly string[]): void;
|
|
26
|
+
focus(): void;
|
|
27
|
+
}
|
|
28
|
+
export declare function createSearch(doc: Document, options: {
|
|
29
|
+
placeholder: string;
|
|
30
|
+
chips: readonly SearchChipSpec[];
|
|
31
|
+
change(): void;
|
|
32
|
+
}): SearchBar;
|
|
33
|
+
/** Where `query` matches in `text` (case-insensitive), as [start, end), or undefined. */
|
|
34
|
+
export declare function matchSpan(text: string, query: string): [number, number] | undefined;
|
|
35
|
+
/** Writes `text` into `label`, with the matched span wrapped in `<mark class="knobs-match">`. */
|
|
36
|
+
export declare function markLabel(label: HTMLElement, text: string, span: [number, number] | undefined): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Places a segmented control's selected pill (`.knobs-seg-pill`) under the button whose
|
|
3
|
+
* `data-value` is `value`. The pill is placed by its edges so the edge facing the move can lead
|
|
4
|
+
* (see .knobs-seg-pill); a resize (a token gliding) carries it with its option instead of
|
|
5
|
+
* animating it, and the first placement doesn't animate. With no matching button the pill fades.
|
|
6
|
+
* While a pan holds the pill (see `panOptions`), it stays with the fingers. Showing the value it
|
|
7
|
+
* already shows reads no layout (a resize, `resized`, re-places it).
|
|
8
|
+
*/
|
|
9
|
+
export declare function placeSegPill(seg: HTMLElement, buttons: readonly HTMLButtonElement[], value: string, resized?: boolean): void;
|
|
10
|
+
/**
|
|
11
|
+
* Reads where each option sits ahead of a batch's writes (see measure.ts), while layout is still
|
|
12
|
+
* clean: choosing an option doesn't move any, so the pill then places without reading layout
|
|
13
|
+
* after the batch has dirtied it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function primeSegPill(seg: HTMLElement, buttons: readonly HTMLElement[]): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** What a reload should bring back, per tab: open panels, open editors and the focused stop. */
|
|
2
|
+
export interface PanelSession {
|
|
3
|
+
readonly open?: boolean;
|
|
4
|
+
readonly expanded?: readonly string[];
|
|
5
|
+
readonly focus?: {
|
|
6
|
+
readonly inline: boolean;
|
|
7
|
+
readonly stop: number;
|
|
8
|
+
};
|
|
9
|
+
/** A page's collapsible custom cards, by title: whether each is folded. */
|
|
10
|
+
readonly folded?: Readonly<Record<string, boolean>>;
|
|
11
|
+
/** A panel's foldable groups, by id: whether each is folded. */
|
|
12
|
+
readonly groups?: Readonly<Record<string, boolean>>;
|
|
13
|
+
/** A panel's sub-headings, by group and name: whether each is folded. */
|
|
14
|
+
readonly subsections?: Readonly<Record<string, boolean>>;
|
|
15
|
+
/** The tab a panel showed. */
|
|
16
|
+
readonly tab?: string;
|
|
17
|
+
}
|
|
18
|
+
/** The tab's sessionStorage, where there is one. */
|
|
19
|
+
export declare const tabStorage: () => Storage | null;
|
|
20
|
+
export declare function readSession(id: string): PanelSession;
|
|
21
|
+
export declare function writeSession(id: string, patch: Partial<PanelSession>): void;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { Knob as KnobField } from "../core/schema.js";
|
|
2
|
+
import { type Roll, Spring, VelocityTracker } from "./motion.js";
|
|
3
|
+
export interface DigitPlace {
|
|
4
|
+
ch: string;
|
|
5
|
+
/** Unbounded wheel position for digits (… 9, 10, 11 …); face = position mod 10. */
|
|
6
|
+
readonly wheel: Roll;
|
|
7
|
+
/** 1 while shown, 0 once gone: new places fade in and rise, leaving places fade out. */
|
|
8
|
+
readonly presence: Roll;
|
|
9
|
+
/** When this place started entering, and how long the entrance lasts (ms). */
|
|
10
|
+
enterAt: number;
|
|
11
|
+
enterMs: number;
|
|
12
|
+
exiting: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface Slider {
|
|
15
|
+
element: HTMLElement;
|
|
16
|
+
/** The focusable, keyboard-driven surface. */
|
|
17
|
+
track: HTMLElement;
|
|
18
|
+
/** The visible label element. */
|
|
19
|
+
label: HTMLElement;
|
|
20
|
+
/** The value button element. */
|
|
21
|
+
valueButton: HTMLButtonElement;
|
|
22
|
+
/** The inline number editor (hidden until the value is clicked). */
|
|
23
|
+
number: HTMLInputElement;
|
|
24
|
+
/**
|
|
25
|
+
* Spring driving the fill's edge [0..1]: the value, or while a stepped slider is in hand, the
|
|
26
|
+
* value pulled part way toward the pointer (--k-step-resist).
|
|
27
|
+
*/
|
|
28
|
+
fillSpring: Spring;
|
|
29
|
+
/** Spring driving handle visibility/scale [0..1] (the GPU renderer sets its target). */
|
|
30
|
+
handleSpring: Spring;
|
|
31
|
+
/** Per-character springs for GPU rolling number digits. */
|
|
32
|
+
/** Readout characters keyed by place from the right, so 99 → 100 keeps the 9s in place. */
|
|
33
|
+
digitPlaces: DigitPlace[];
|
|
34
|
+
/** Velocity tracker on normalized fill ratio for drag motion blur. */
|
|
35
|
+
velocity: VelocityTracker;
|
|
36
|
+
/** Number of tick marks along the track. */
|
|
37
|
+
readonly tickCount: number;
|
|
38
|
+
/** Where the default value sits along the track [0..1]. */
|
|
39
|
+
readonly notchRatio: number;
|
|
40
|
+
/** Whether a drag is currently held on the default by the notch's magnet. */
|
|
41
|
+
isMagnetized(): boolean;
|
|
42
|
+
/** When the readout last popped (a click landing on a decile, or the default's magnet). */
|
|
43
|
+
poppedAt: number;
|
|
44
|
+
/** Formatted numeric string without unit (e.g. "0.45" or "98"). */
|
|
45
|
+
getDigitsText(): string;
|
|
46
|
+
/** Optional unit string (e.g. "px", "s"). */
|
|
47
|
+
getUnitText(): string;
|
|
48
|
+
/** Whether pointer drag is currently active. */
|
|
49
|
+
isDragging(): boolean;
|
|
50
|
+
/** Whether the inline number input is open. */
|
|
51
|
+
isEditing(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* `delay` (ms) holds this row's motion for its turn in a preset cascade; `instant` places the
|
|
54
|
+
* value without springing or rolling (a different item arrived).
|
|
55
|
+
*/
|
|
56
|
+
update(value: number, delay?: number, instant?: boolean): void;
|
|
57
|
+
/**
|
|
58
|
+
* Reads its design tokens now. A batch (a preset) primes every row it will move before writing
|
|
59
|
+
* any, so no row's read lands after another's writes and forces a style pass.
|
|
60
|
+
*/
|
|
61
|
+
prime(): void;
|
|
62
|
+
/** Takes a new range, step, label or unit in place, keeping the DOM (see `RemoteControls.update`). */
|
|
63
|
+
retune(field: KnobField): void;
|
|
64
|
+
/** The field it currently draws. */
|
|
65
|
+
readonly field: KnobField;
|
|
66
|
+
/** Open the inline editor, with `initial` in place of the value (a digit typed on the track). */
|
|
67
|
+
edit(initial?: string): void;
|
|
68
|
+
/** Puts a row accessory just after the label; the ticks and handle keep clear of it too. */
|
|
69
|
+
slot(node: HTMLElement): void;
|
|
70
|
+
dispose(): void;
|
|
71
|
+
}
|
|
72
|
+
export declare const decimals: (step: number) => number;
|
|
73
|
+
/**
|
|
74
|
+
* `steps` grid steps from `value` (negative goes down), on the slider's grid counted from `min`.
|
|
75
|
+
* From a value between grid points (a declared default like 0.4 on a 0.02 grid from 0.15) the
|
|
76
|
+
* first step lands on the next grid point that way, not past it.
|
|
77
|
+
*/
|
|
78
|
+
export declare function stepValue(field: {
|
|
79
|
+
min: number;
|
|
80
|
+
max: number;
|
|
81
|
+
step: number;
|
|
82
|
+
}, value: number, steps: number): number;
|
|
83
|
+
/**
|
|
84
|
+
* A DialKit-style slider: the whole row is the track, the fill is a full-height block,
|
|
85
|
+
* the handle is a hairline that only shows on hover, and the label + value sit on the
|
|
86
|
+
* track itself. Dragging follows the pointer exactly (⌥ for 1/10 speed) and the default's notch
|
|
87
|
+
* pulls it in from a few px away; a click snaps to the nearest step (or nearest 10% when there
|
|
88
|
+
* are many steps) with a short spring-like ease. A sideways trackpad pan moves it like a drag.
|
|
89
|
+
*/
|
|
90
|
+
export declare function createSlider(doc: Document, key: string, initialField: KnobField, set: (value: number, options?: {
|
|
91
|
+
coalesce?: boolean;
|
|
92
|
+
}) => void, onMotionWake?: () => void): Slider;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Smears `pill` by its speed while it glides: `cap` is the widest smear (px), as on the GPU. */
|
|
2
|
+
export declare function smearPill(pill: HTMLElement, cap: number): void;
|
|
3
|
+
/**
|
|
4
|
+
* How wide a range band's end smears (px) at `speed` px/s, by `strength` (--k-range-blur, 0 to 1):
|
|
5
|
+
* the slider fill's edge ramp, so both read alike. 0 under a quarter pixel, so it rests crisp.
|
|
6
|
+
*/
|
|
7
|
+
export declare function rangeSmear(speed: number, strength: number): number;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { SoundOptions, SoundTheme } from "../core/store.js";
|
|
2
|
+
export type { SoundOptions, SoundTheme };
|
|
3
|
+
/** A cue knobs plays for a moment in a panel (see README, Sound). */
|
|
4
|
+
export type SoundCue = "step" | "limit" | "toggle" | "select" | "preset" | "random" | "mutate" | "reset" | "copy" | "undo" | "redo" | "open" | "close" | "hint" | "type" | "press" | "capture";
|
|
5
|
+
/** What a play knows about its moment. */
|
|
6
|
+
export interface CueDetail {
|
|
7
|
+
/** Where the value now sits in its range, 0–1: a step's pitch. */
|
|
8
|
+
readonly position?: number;
|
|
9
|
+
/** Forwards or on (1), back or off (-1). */
|
|
10
|
+
readonly direction?: number;
|
|
11
|
+
/** A firmer play: the default's notch catching. */
|
|
12
|
+
readonly strong?: boolean;
|
|
13
|
+
readonly volume?: number;
|
|
14
|
+
readonly theme?: SoundTheme;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* One layer of a sound: a tone (`wave`) or a burst of noise through a filter. Times are seconds;
|
|
18
|
+
* `d` is how long it takes to die away by 60 dB.
|
|
19
|
+
*/
|
|
20
|
+
export interface SoundLayer {
|
|
21
|
+
readonly wave?: OscillatorType;
|
|
22
|
+
/** The noise's filter; `bandpass` by default. */
|
|
23
|
+
readonly filter?: BiquadFilterType;
|
|
24
|
+
/** The tone's pitch, or the noise filter's frequency (Hz). */
|
|
25
|
+
readonly f: number;
|
|
26
|
+
/** Glides `f` here over `glide` seconds. */
|
|
27
|
+
readonly to?: number;
|
|
28
|
+
readonly glide?: number;
|
|
29
|
+
readonly q?: number;
|
|
30
|
+
/** Starts this long after the play. */
|
|
31
|
+
readonly at?: number;
|
|
32
|
+
readonly a: number;
|
|
33
|
+
readonly d: number;
|
|
34
|
+
readonly p: number;
|
|
35
|
+
}
|
|
36
|
+
interface Recipe {
|
|
37
|
+
readonly layers: readonly SoundLayer[];
|
|
38
|
+
/** The play's level, matched across cues by ear and by loudness (1 by default). */
|
|
39
|
+
readonly gain?: number;
|
|
40
|
+
/** How much rings into the shared room (0 by default: dry). */
|
|
41
|
+
readonly room?: number;
|
|
42
|
+
}
|
|
43
|
+
/** 0 (unhurried) to 1 (as fast as it goes), from the time since the cue last played. */
|
|
44
|
+
export declare const cadence: (sinceMs: number) => number;
|
|
45
|
+
/**
|
|
46
|
+
* A cue's layers for this play: `speed` from `cadence`, `random` for its small variations (a die's
|
|
47
|
+
* clicks, a key's pitch). Pure, so tests and an offline render read the same sound.
|
|
48
|
+
*/
|
|
49
|
+
export declare function recipe(cue: SoundCue, detail?: CueDetail, speed?: number, random?: () => number): Recipe;
|
|
50
|
+
/** The `mech` theme: the same cues with the rings all but gone and the clicks tighter. */
|
|
51
|
+
export declare const themed: (layers: readonly SoundLayer[], theme: SoundTheme) => SoundLayer[];
|
|
52
|
+
/** The shortest gap (ms) between two plays of a cue: closer ones are dropped. */
|
|
53
|
+
export declare const GAPS: Readonly<Record<SoundCue, number>>;
|
|
54
|
+
/** How a cue's plays are let through: too close are dropped; the rest report their cadence. */
|
|
55
|
+
export declare function createLimiter(gaps?: Readonly<Record<string, number>>): (cue: string, now: number) => number | null;
|
|
56
|
+
/** A change this long (ms) after the last one on its slider is a fresh one (a key, a click). */
|
|
57
|
+
export declare const FRESH_MS = 150;
|
|
58
|
+
/** A continuous slider ticks this many times across its range while it's dragged. */
|
|
59
|
+
export declare const DETENTS = 24;
|
|
60
|
+
/**
|
|
61
|
+
* Whether a slider's change (positions 0–1) earns a tick: a fresh change always does; within a
|
|
62
|
+
* drag, only crossing into another of its `detents` (each stop of a stepped slider, else
|
|
63
|
+
* DETENTS), so a slow drag ratchets evenly instead of ticking every pixel.
|
|
64
|
+
*/
|
|
65
|
+
export declare function createDetents(): (key: string, before: number, after: number, detents: number, now: number) => boolean;
|
|
66
|
+
/** The parts of a field a change's cue reads. */
|
|
67
|
+
interface CueField {
|
|
68
|
+
readonly kind: string;
|
|
69
|
+
readonly value?: unknown;
|
|
70
|
+
readonly min?: unknown;
|
|
71
|
+
readonly max?: unknown;
|
|
72
|
+
readonly step?: unknown;
|
|
73
|
+
readonly options?: readonly unknown[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The cue for a row's value changing by hand from `before` to `after`: a step for numbers (pitched
|
|
77
|
+
* by position, firmer landing on the default), a switch's throw, a choice's detent (by direction),
|
|
78
|
+
* a captured key. `detents` is how many ticks a drag across the whole range may make.
|
|
79
|
+
*/
|
|
80
|
+
export declare function changeCue(field: CueField, before: unknown, after: unknown): {
|
|
81
|
+
cue: SoundCue;
|
|
82
|
+
detail: CueDetail;
|
|
83
|
+
detents: number;
|
|
84
|
+
at: number;
|
|
85
|
+
was: number;
|
|
86
|
+
} | null;
|
|
87
|
+
/** A mount's `sound` option as what the panel plays with, or null for silence. */
|
|
88
|
+
export declare function resolveSound(option: boolean | SoundOptions | undefined): SoundOptions | null;
|
|
89
|
+
/** At most this many plays sound at once; the oldest fades for a new one. */
|
|
90
|
+
export declare const MAX_VOICES = 10;
|
|
91
|
+
/** What the engine needs from the page, so tests can hand it a fake. */
|
|
92
|
+
export interface SoundEnv {
|
|
93
|
+
readonly AudioContext?: {
|
|
94
|
+
new (): AudioContext;
|
|
95
|
+
};
|
|
96
|
+
/** Whether the page has had a user gesture yet (no context is made before one). */
|
|
97
|
+
readonly activated?: () => boolean;
|
|
98
|
+
readonly now?: () => number;
|
|
99
|
+
readonly random?: () => number;
|
|
100
|
+
}
|
|
101
|
+
export interface Sound {
|
|
102
|
+
/** The page's switch: on unless turned off. Panels only play with `sound` on their mount. */
|
|
103
|
+
readonly enabled: boolean;
|
|
104
|
+
enable(on?: boolean): void;
|
|
105
|
+
/** 0–1, 1 by default. */
|
|
106
|
+
readonly volume: number;
|
|
107
|
+
setVolume(volume: number): void;
|
|
108
|
+
readonly theme: SoundTheme;
|
|
109
|
+
setTheme(theme: SoundTheme): void;
|
|
110
|
+
/** Plays a cue, or layers of your own, unless sound is off or the page hasn't been touched. */
|
|
111
|
+
play(cue: SoundCue | readonly SoundLayer[], detail?: CueDetail): void;
|
|
112
|
+
/**
|
|
113
|
+
* The shared context and the bus to connect your own nodes to (volume, mute and the compressor
|
|
114
|
+
* apply), once there is one: after the first user gesture with sound wanted.
|
|
115
|
+
*/
|
|
116
|
+
output(): {
|
|
117
|
+
readonly context: AudioContext;
|
|
118
|
+
readonly destination: AudioNode;
|
|
119
|
+
} | null;
|
|
120
|
+
/** Makes the context on the page's next gesture, so the first cue sounds at once. */
|
|
121
|
+
prime(doc?: Document): void;
|
|
122
|
+
/** Called when `enabled`, `volume` or `theme` change; returns an unsubscribe. */
|
|
123
|
+
subscribe(listener: () => void): () => void;
|
|
124
|
+
}
|
|
125
|
+
export declare function createSound(env?: SoundEnv): Sound;
|
|
126
|
+
/** The page's sound: one switch, volume and theme for every panel (and the host's own cues). */
|
|
127
|
+
export declare const sound: Sound;
|
|
128
|
+
/** Where the page keeps the user's choice, in a store's storage. */
|
|
129
|
+
export declare const SOUND_PREF = "knobs:sound:v1";
|
|
130
|
+
/** Marks `root` as a panel that plays (a mount's resolved `sound`). */
|
|
131
|
+
export declare function soundPanel(root: Element, options: SoundOptions): void;
|
|
132
|
+
/** Whether the panel `from` sits in plays sounds. */
|
|
133
|
+
export declare const sounds: (from: Element | null | undefined) => boolean;
|
|
134
|
+
/** A row's value changing by hand in the panel `from` sits in (see `changeCue`). */
|
|
135
|
+
export declare function changed(from: Element | null | undefined, key: string, field: CueField, before: unknown, after: unknown): void;
|
|
136
|
+
/** Plays `cue` for a moment in the panel `from` sits in, if that panel plays sounds. */
|
|
137
|
+
export declare function cue(from: Element | null | undefined, name: SoundCue, detail?: CueDetail): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One more turn for the ↺ in `button` (its first `.knobs-icon`), from wherever it is now; `rest`
|
|
3
|
+
* runs once it has stopped.
|
|
4
|
+
*/
|
|
5
|
+
export declare function spin(button: HTMLElement, wake?: () => void, rest?: () => void): void;
|
|
6
|
+
/** Whether `button`'s ↺ is turning (or blinking). */
|
|
7
|
+
export declare const spinning: (button: Element) => boolean;
|
|
8
|
+
/** Where `button`'s ↺ is now, for the GPU renderer: its turn (radians, clockwise) and opacity. */
|
|
9
|
+
export declare function spinOf(button: Element, now: number): {
|
|
10
|
+
angle: number;
|
|
11
|
+
alpha: number;
|
|
12
|
+
moving: boolean;
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type TokenPreset } from "../core/theme.js";
|
|
2
|
+
/**
|
|
3
|
+
* What DELAY times: a row's turn in a preset's cascade is set on these (see `showValues` in
|
|
4
|
+
* panel.ts) rather than on the row, where the custom property would restyle all of the row.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DELAYED = ".knobs-fill,.knobs-handle,.knobs-seg-pill,.knobs-toggle,.knobs-toggle i,.knobs-arm,.knobs-curve,.knobs-swatch,.knobs-strip-thumb,.knobs-pad>i,.knobs-ease-handle,.knobs-range-track,.knobs-range-fill,.knobs-range-thumb,.knobs-dial-hand,.knobs-grad,.knobs-grad-mini,.knobs-grad-mini>i,.knobs-grad-stop,.knobs-graph-pt";
|
|
7
|
+
/** Adds a token preset's stylesheet once per document. */
|
|
8
|
+
export declare function injectPreset(doc: Document, preset: TokenPreset): void;
|
|
9
|
+
/** The rules' `:has()` as the attributes has.ts keeps (see there for why). */
|
|
10
|
+
export declare const withoutHas: (css: string) => string;
|
|
11
|
+
export declare function injectStyles(doc: Document): void;
|