dsh-theme-mineradio 2.3.4 → 2.3.6
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 +91 -89
- package/README.zh.md +91 -89
- package/lib/client.js +56 -8
- package/lib/types/client/MineradioAppearanceRow.d.ts +72 -72
- package/lib/types/client/MineradioControls.d.ts +38 -38
- package/lib/types/client/MineradioPluginCard.d.ts +15 -15
- package/lib/types/client/audio-reactivity.d.ts +33 -33
- package/lib/types/client/cinema-drift.d.ts +20 -20
- package/lib/types/client/color-extract.d.ts +14 -14
- package/lib/types/client/critters.d.ts +21 -21
- package/lib/types/client/fluid-interactions.d.ts +19 -19
- package/lib/types/client/fluid-shader.d.ts +57 -57
- package/lib/types/client/fluid-tones.d.ts +30 -30
- package/lib/types/client/glass-dispersion.d.ts +29 -29
- package/lib/types/client/greetings.d.ts +24 -24
- package/lib/types/client/host-store.d.ts +24 -0
- package/lib/types/client/index.d.ts +21 -21
- package/lib/types/client/locales.d.ts +140 -140
- package/lib/types/client/mesh.d.ts +18 -18
- package/lib/types/client/seam-stamper.d.ts +21 -21
- package/lib/types/client/settings-store.d.ts +2 -2
- package/lib/types/client/specular-parallax.d.ts +5 -5
- package/lib/types/client/spot-core.d.ts +52 -52
- package/lib/types/client/spotlight.d.ts +11 -11
- package/lib/types/client/star-river.d.ts +43 -43
- package/lib/types/client/station-dial.d.ts +24 -24
- package/lib/types/client/theme-layer.d.ts +287 -287
- package/lib/types/client/wallpaper-store.d.ts +30 -30
- package/lib/types/client/whale.d.ts +25 -25
- package/lib/types/client/wordmark-badge.d.ts +25 -25
- package/lib/types/index.d.ts +9 -9
- package/lib/types/invariant.d.ts +15 -15
- package/package.json +13 -3
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Station dial — every workspace is its own radio station.
|
|
3
|
-
*
|
|
4
|
-
* The sidebar's workspace rows (`.projectRow`) name the station. Each name
|
|
5
|
-
* maps to a stable hue offset from a curated set of warm-adjacent stops,
|
|
6
|
-
* remembered in localStorage; switching workspaces glides the fluid, glow
|
|
7
|
-
* and dispersion tints there over ~2 seconds — like tuning a radio dial.
|
|
8
|
-
* The brand row carries a tiny frequency window (`FM 044`) that flickers
|
|
9
|
-
* while tuning. No settings knob: this is the radio being a radio.
|
|
10
|
-
*
|
|
11
|
-
* Resolution walks the flat ARIA tree: sessions are `.sessionRow` siblings
|
|
12
|
-
* that follow their workspace's `.projectRow`, so "the nearest projectRow
|
|
13
|
-
* at-or-before the selected session" names the station. Hero phase (no
|
|
14
|
-
* selection) keeps whatever was tuned last.
|
|
15
|
-
*/
|
|
16
|
-
/** The station name: nearest `.projectRow` at-or-before the selected session. */
|
|
17
|
-
export declare function resolveStationName(): string | null;
|
|
18
|
-
/**
|
|
19
|
-
* Watch the sidebar and retune when the station changes.
|
|
20
|
-
* @param onOffset called with the interpolated offset each frame of a tune
|
|
21
|
-
* (and once at boot/settle), so the layer can repaint fluid + accents.
|
|
22
|
-
* @returns a disposer that disconnects the observer and cancels any glide.
|
|
23
|
-
*/
|
|
24
|
-
export declare function startStationDial(onOffset: (offset: number) => void): () => void;
|
|
1
|
+
/**
|
|
2
|
+
* Station dial — every workspace is its own radio station.
|
|
3
|
+
*
|
|
4
|
+
* The sidebar's workspace rows (`.projectRow`) name the station. Each name
|
|
5
|
+
* maps to a stable hue offset from a curated set of warm-adjacent stops,
|
|
6
|
+
* remembered in localStorage; switching workspaces glides the fluid, glow
|
|
7
|
+
* and dispersion tints there over ~2 seconds — like tuning a radio dial.
|
|
8
|
+
* The brand row carries a tiny frequency window (`FM 044`) that flickers
|
|
9
|
+
* while tuning. No settings knob: this is the radio being a radio.
|
|
10
|
+
*
|
|
11
|
+
* Resolution walks the flat ARIA tree: sessions are `.sessionRow` siblings
|
|
12
|
+
* that follow their workspace's `.projectRow`, so "the nearest projectRow
|
|
13
|
+
* at-or-before the selected session" names the station. Hero phase (no
|
|
14
|
+
* selection) keeps whatever was tuned last.
|
|
15
|
+
*/
|
|
16
|
+
/** The station name: nearest `.projectRow` at-or-before the selected session. */
|
|
17
|
+
export declare function resolveStationName(): string | null;
|
|
18
|
+
/**
|
|
19
|
+
* Watch the sidebar and retune when the station changes.
|
|
20
|
+
* @param onOffset called with the interpolated offset each frame of a tune
|
|
21
|
+
* (and once at boot/settle), so the layer can repaint fluid + accents.
|
|
22
|
+
* @returns a disposer that disconnects the observer and cancels any glide.
|
|
23
|
+
*/
|
|
24
|
+
export declare function startStationDial(onOffset: (offset: number) => void): () => void;
|
|
@@ -1,287 +1,287 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* the Mineradio layer: one toggleable visual skin over the whole Web surface.
|
|
3
|
-
* Everything this layer owns is an effect — token overrides ride the theme
|
|
4
|
-
* service's override stack, the CSS hooks ride a `data-dsh-aqua` attribute on
|
|
5
|
-
* <html> (the stylesheet only applies under it), the ambient scene and page
|
|
6
|
-
* fades are mounted/removed with the layer — so switching the flag off (or
|
|
7
|
-
* unloading the plugin) restores the stock UI exactly: no residue, no reload.
|
|
8
|
-
*
|
|
9
|
-
* The enable flag persists in localStorage: a client-only visual preference
|
|
10
|
-
* (like the selected-session key), written and read by this plugin alone.
|
|
11
|
-
*/
|
|
12
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
13
|
-
import type { ThemeTokenOverrides } from '@deepseek-ai/dsh-client-ui-theme/client';
|
|
14
|
-
/** html attribute selecting the Mineradio layer: CSS hooks and ambient effects.
|
|
15
|
-
* Kept as the internal `data-dsh-aqua` seam so the stylesheet's 100+ gated
|
|
16
|
-
* selectors and the helper modules stay consistent across the skin. */
|
|
17
|
-
export declare const MINERADIO_ATTRIBUTE = "data-dsh-aqua";
|
|
18
|
-
/** localStorage key carrying the layer enable flag. */
|
|
19
|
-
export declare const MINERADIO_ENABLED_KEY = "dsh.ui-mineradio.enabled";
|
|
20
|
-
/** Default state when nothing is stored yet: on. */
|
|
21
|
-
export declare const DEFAULT_ENABLED = true;
|
|
22
|
-
/**
|
|
23
|
-
* Alias-token override layer: the Mineradio "cinema gold" palette. Every
|
|
24
|
-
* value is a `{ light, dark }` pair so the layer stays legible when the user
|
|
25
|
-
* switches the Appearance preference — dark is the near-black studio
|
|
26
|
-
* ({INK}), light is a warm paper white. The brand accent is champagne gold
|
|
27
|
-
* with mint + ember rose echoes, straight from the Mineradio wordmark.
|
|
28
|
-
*/
|
|
29
|
-
export declare const MINERADIO_TOKEN_OVERRIDES: ThemeTokenOverrides;
|
|
30
|
-
/** Preset global text-ink tints: the "text colour" switch swaps the warm
|
|
31
|
-
* champagne ink for a neutral / mint / rose tint while keeping the SAME
|
|
32
|
-
* lightness ladder, so every preset stays readable in either scheme. The
|
|
33
|
-
* champagne preset reproduces the shipped values exactly (no regression). */
|
|
34
|
-
export type TextStyle = 'champagne' | 'neutral' | 'mint' | 'rose';
|
|
35
|
-
/** Tunable layer knobs, persisted independently of the enable flag. */
|
|
36
|
-
export interface MineradioSettings {
|
|
37
|
-
/** Rendering mode: mica (frosted floating cards) or the stock layout with a generic glass material. */
|
|
38
|
-
mode: 'mica' | 'compat';
|
|
39
|
-
/** Global text-ink tint: warm champagne (default) or a neutral/mint/rose. */
|
|
40
|
-
textStyle: TextStyle;
|
|
41
|
-
/** Glass backdrop blur radius, px. */
|
|
42
|
-
blur: number;
|
|
43
|
-
/** Glass fill opacity, 0-100 (50 = the shipped look; drives the frost multiplier). */
|
|
44
|
-
frost: number;
|
|
45
|
-
/** Fluid hue, degrees (0-360, continuous). */
|
|
46
|
-
fluidHue: number;
|
|
47
|
-
/** Fluid depth, 0-100 (0 = deep saturated, 100 = pale light, continuous). */
|
|
48
|
-
fluidDepth: number;
|
|
49
|
-
/** Glass dispersion tint hue, degrees (0-360, continuous). */
|
|
50
|
-
dispersionHue: number;
|
|
51
|
-
/** Glass refraction strength, 0-100 (0 = none, 100 = strong). */
|
|
52
|
-
dispersionRefract: number;
|
|
53
|
-
/** Background brightness, 0-100 (0 = pure black, 50 = transparent, 100 = pure white). */
|
|
54
|
-
bgBrightness: number;
|
|
55
|
-
/** Backdrop source: the living fluid board or a custom wallpaper. */
|
|
56
|
-
background: 'fluid' | 'wallpaper';
|
|
57
|
-
/** Wallpaper image data URL (empty until one is picked). */
|
|
58
|
-
wallpaper: string;
|
|
59
|
-
/** Auto-derive the accent hue from the wallpaper (spotlight/bloom/dispersion). */
|
|
60
|
-
autoTint: boolean;
|
|
61
|
-
/** Particle whale in the chat area center (opt-in extra; off by default —
|
|
62
|
-
* the Mineradio star river is the shipped particle stage). */
|
|
63
|
-
whale: boolean;
|
|
64
|
-
/** Ambient marine life (fish / bubbles / plankton). */
|
|
65
|
-
critters: boolean;
|
|
66
|
-
/** Interactive mesh (the site's dot-grid with pointer repel). */
|
|
67
|
-
mesh: boolean;
|
|
68
|
-
/** Star-river particle density, 0-100 (50 = 1×, 100 = 2× the default field). */
|
|
69
|
-
starDensity: number;
|
|
70
|
-
/** Cursor spotlight glow that follows the pointer over the glass panes. */
|
|
71
|
-
spotlight: boolean;
|
|
72
|
-
/** Hover press-down: the pane under the cursor sinks a touch (tactile depth). */
|
|
73
|
-
press: boolean;
|
|
74
|
-
/** Audio reactivity: the backdrop pulses with mic audio (fluid/stars/glow). */
|
|
75
|
-
audioReact: boolean;
|
|
76
|
-
/** Wallpaper blur radius, px. */
|
|
77
|
-
wallpaperBlur: number;
|
|
78
|
-
/** Wallpaper frost veil, 0-100. */
|
|
79
|
-
wallpaperFrost: number;
|
|
80
|
-
/** Frosted-glass mask over the wallpaper (readability veil + stronger blur). */
|
|
81
|
-
wallpaperMask: boolean;
|
|
82
|
-
/** Frost mask blur radius, px (0 = none, 40 = heavy frosted glass). */
|
|
83
|
-
wallpaperMaskBlur: number;
|
|
84
|
-
/** Frost mask veil opacity, 0-100 (0 = clear, 100 = fully opaque scrim). */
|
|
85
|
-
wallpaperMaskOpacity: number;
|
|
86
|
-
/** Video wallpaper blur radius, px (0 = crisp, 40 = heavy acrylic). */
|
|
87
|
-
videoBlur: number;
|
|
88
|
-
/** Video wallpaper brightness, 0-100 (100 = fully lit, 0 = deepest dim). */
|
|
89
|
-
videoBrightness: number;
|
|
90
|
-
/** Performance gate: which motion layers actually run. Orthogonal to scenes. */
|
|
91
|
-
perf: PerfTier;
|
|
92
|
-
/** Optional rainbow fluid drift. Off by default; does not rewrite fluidHue. */
|
|
93
|
-
rainbow: boolean;
|
|
94
|
-
}
|
|
95
|
-
/** Performance gate. Scenes keep their knob values; this only mounts layers. */
|
|
96
|
-
export type PerfTier = 'performance' | 'balanced' | 'vivid';
|
|
97
|
-
/** One-click scene: a named bundle of existing knobs (never the wallpaper). */
|
|
98
|
-
export type ScenePreset = 'studio' | 'deepsea' | 'midnight' | 'mist' | 'rainbow';
|
|
99
|
-
/** Knob bundle for one scene. Wallpaper / video files stay untouched. */
|
|
100
|
-
type SceneBundle = Pick<MineradioSettings, 'textStyle' | 'blur' | 'frost' | 'fluidHue' | 'fluidDepth' | 'dispersionHue' | 'dispersionRefract' | 'starDensity' | 'spotlight' | 'press' | 'audioReact' | 'background' | 'rainbow'>;
|
|
101
|
-
/** Which scene the current knobs match, or null after a manual tweak. */
|
|
102
|
-
export declare function matchScenePreset(settings: Pick<MineradioSettings, keyof SceneBundle>): ScenePreset | null;
|
|
103
|
-
/**
|
|
104
|
-
* Owns the Mineradio layer lifecycle: reads the durable enable flag, and applies /
|
|
105
|
-
* retracts every layer on change. Cross-tab flips arrive through the storage
|
|
106
|
-
* event; every subscription and mounted effect are released when the plugin
|
|
107
|
-
* fiber is disposed.
|
|
108
|
-
*/
|
|
109
|
-
export declare class MineradioLayer {
|
|
110
|
-
private enabled;
|
|
111
|
-
private settings;
|
|
112
|
-
/** Resolved palette scheme: dark = the brightness knob darkens, light = it brightens. */
|
|
113
|
-
private dark;
|
|
114
|
-
private tokenDisposer;
|
|
115
|
-
private mainFluid;
|
|
116
|
-
private interactionDisposer;
|
|
117
|
-
private themeListener;
|
|
118
|
-
private seamDisposer;
|
|
119
|
-
private spotlightDisposer;
|
|
120
|
-
private whaleHandle;
|
|
121
|
-
private meshHandle;
|
|
122
|
-
private starRiverHandle;
|
|
123
|
-
private audioHandle;
|
|
124
|
-
private cinemaDrift;
|
|
125
|
-
private dispersion;
|
|
126
|
-
private specularParallaxDisposer;
|
|
127
|
-
/** Object URL of the current large-video wallpaper (revoked on replace). */
|
|
128
|
-
private videoObjectUrl;
|
|
129
|
-
/** IndexedDB id backing the current object URL (guards against reloads). */
|
|
130
|
-
private videoBlobId;
|
|
131
|
-
/** Extracted accent hue from the wallpaper (undefined until read). */
|
|
132
|
-
private extractedHue;
|
|
133
|
-
/** Wallpaper source the extracted hue was computed from (guards re-reads). */
|
|
134
|
-
private extractedWallpaper;
|
|
135
|
-
/** Live rainbow hue, only while the rainbow scene is on. Not persisted. */
|
|
136
|
-
private rainbowHue;
|
|
137
|
-
private rainbowRaf;
|
|
138
|
-
/** Station dial: per-workspace hue offset, glided by station-dial.ts. */
|
|
139
|
-
private stationOffset;
|
|
140
|
-
private stationDisposer;
|
|
141
|
-
private readonly ctx;
|
|
142
|
-
/**
|
|
143
|
-
* @param ctx - owning client context.
|
|
144
|
-
*/
|
|
145
|
-
constructor(ctx: Context);
|
|
146
|
-
/** Current enable state (the settings row mirrors this). */
|
|
147
|
-
getEnabled(): boolean;
|
|
148
|
-
/** Current knob values (the settings row mirrors these). */
|
|
149
|
-
getSettings(): MineradioSettings;
|
|
150
|
-
/** Whether the resolved palette is dark (the brightness knob darkens). */
|
|
151
|
-
getDark(): boolean;
|
|
152
|
-
/** Resolved scheme from the theme service (falls back to the body attribute). */
|
|
153
|
-
private resolveScheme;
|
|
154
|
-
/** Re-read every knob from localStorage into memory. */
|
|
155
|
-
private reloadSettings;
|
|
156
|
-
/** Set the performance gate (does not rewrite scene knobs). */
|
|
157
|
-
setPerf(value: PerfTier): void;
|
|
158
|
-
/** Apply one named scene. Wallpaper / video files stay as they are. */
|
|
159
|
-
applyScene(preset: ScenePreset): void;
|
|
160
|
-
/** Flip the layer: persist, then apply or retract every owned effect. */
|
|
161
|
-
setEnabled(value: boolean): void;
|
|
162
|
-
/** Set the rendering mode ('mica' or 'compat'). */
|
|
163
|
-
setMode(value: 'mica' | 'compat'): void;
|
|
164
|
-
/** Set the global text-ink preset ('champagne' | 'neutral' | 'mint' | 'rose'). */
|
|
165
|
-
setTextStyle(value: TextStyle): void;
|
|
166
|
-
/** Set the glass blur radius (px). */
|
|
167
|
-
setBlur(value: number): void;
|
|
168
|
-
/** Set the glass frost amount (0-100). */
|
|
169
|
-
setFrost(value: number): void;
|
|
170
|
-
/** Set the fluid hue (degrees, continuous). */
|
|
171
|
-
setFluidHue(value: number): void;
|
|
172
|
-
/** Set the glass dispersion tint hue (degrees, continuous). */
|
|
173
|
-
setDispersionHue(value: number): void;
|
|
174
|
-
/** Set the glass refraction strength (0-100). */
|
|
175
|
-
setDispersionRefract(value: number): void;
|
|
176
|
-
/** Set the fluid depth (0-100, continuous: deep ↔ pale). */
|
|
177
|
-
setFluidDepth(value: number): void;
|
|
178
|
-
/** Set the background brightness (0-100: 0 = pure black, 50 = transparent, 100 = pure white). */
|
|
179
|
-
setBgBrightness(value: number): void;
|
|
180
|
-
/** Set the backdrop source (fluid board or custom wallpaper). */
|
|
181
|
-
setBackground(value: 'fluid' | 'wallpaper'): void;
|
|
182
|
-
/** Set the wallpaper image (a data URL; empty clears it) or a large video
|
|
183
|
-
* (`idb:<id>` marker whose blob lives in IndexedDB). */
|
|
184
|
-
setWallpaper(value: string): void;
|
|
185
|
-
/** Set the wallpaper auto-tint flag (derive accent hues from the wallpaper). */
|
|
186
|
-
setAutoTint(value: boolean): void;
|
|
187
|
-
/** Set the particle-whale flag (chat-area center decoration). */
|
|
188
|
-
setWhale(value: boolean): void;
|
|
189
|
-
/** Set the ambient marine-life flag (fish / bubbles / plankton). */
|
|
190
|
-
setCritters(value: boolean): void;
|
|
191
|
-
/** Set the interactive-mesh flag (dot-grid decoration). */
|
|
192
|
-
setMesh(value: boolean): void;
|
|
193
|
-
/** Set the star-river particle density (0-100). */
|
|
194
|
-
setStarDensity(value: number): void;
|
|
195
|
-
/** Set the cursor-spotlight flag (pointer-tracking glass glow). */
|
|
196
|
-
setSpotlight(value: boolean): void;
|
|
197
|
-
/** Set the hover-press flag (pane sinks a touch under the cursor). */
|
|
198
|
-
setPress(value: boolean): void;
|
|
199
|
-
/** Set the audio-reactivity flag (mic-driven backdrop pulse). */
|
|
200
|
-
setAudioReact(value: boolean): void;
|
|
201
|
-
/** Set the wallpaper blur radius (px). */
|
|
202
|
-
setWallpaperBlur(value: number): void;
|
|
203
|
-
/** Set the wallpaper frost veil (0-100). */
|
|
204
|
-
setWallpaperFrost(value: number): void;
|
|
205
|
-
/** Set the wallpaper frost-mask flag (readability veil + stronger blur). */
|
|
206
|
-
setWallpaperMask(value: boolean): void;
|
|
207
|
-
/** Set the frost-mask blur radius (px). */
|
|
208
|
-
setWallpaperMaskBlur(value: number): void;
|
|
209
|
-
/** Set the frost-mask veil opacity (0-100). */
|
|
210
|
-
setWallpaperMaskOpacity(value: number): void;
|
|
211
|
-
/** Set the video wallpaper blur radius (px). */
|
|
212
|
-
setVideoBlur(value: number): void;
|
|
213
|
-
/** Set the video wallpaper brightness (0-100, 100 = fully lit). */
|
|
214
|
-
setVideoBrightness(value: number): void;
|
|
215
|
-
/** After the user re-grants file access (选择视频 click on an fsa: video),
|
|
216
|
-
* drop the mount guard and re-apply so the file is re-read and played. */
|
|
217
|
-
authorizeVideo(): void;
|
|
218
|
-
private sync;
|
|
219
|
-
/** Write the knob-driven CSS variables and mode attributes onto <html>. */
|
|
220
|
-
private applySettings;
|
|
221
|
-
/** The wallpaper plays as a plain <video> element (the browser's own
|
|
222
|
-
* decoder, no player chrome at all): looping on, cover fill via CSS, and
|
|
223
|
-
* autoplay with a muted fallback where policy requires it. A direct
|
|
224
|
-
* element (not an iframe) keeps backdrop-filter working over it, so the
|
|
225
|
-
* glass panels stay frosted above the video. */
|
|
226
|
-
private configureWallpaperVideo;
|
|
227
|
-
/** The hue driving the spotlight glow + ambient bloom right now. */
|
|
228
|
-
private accentHue;
|
|
229
|
-
/** The dispersion edge-tint hue (auto-extracted, or the user's knob). */
|
|
230
|
-
private dispersionTintHue;
|
|
231
|
-
/** Write the hue-driven accent vars (spotlight glow + bloom + dispersion). */
|
|
232
|
-
private applyAccentTint;
|
|
233
|
-
/** Kick off (or clear) wallpaper color extraction, guarded by source. */
|
|
234
|
-
private ensureWallpaperTint;
|
|
235
|
-
/** Extract the dominant hue and repaint the accents (async, guarded). */
|
|
236
|
-
private extractWallpaperTint;
|
|
237
|
-
/** Draw a wallpaper image into the extractor. */
|
|
238
|
-
private extractImageHue;
|
|
239
|
-
/** Draw the wallpaper video's first available frame into the extractor. */
|
|
240
|
-
private extractVideoHue;
|
|
241
|
-
/** Apply the mode's token layer (floating palette, or translucent compat). */
|
|
242
|
-
private applyTokens;
|
|
243
|
-
/** The text-ink override for the current preset: redefines the warm ink
|
|
244
|
-
* tokens only; every other token falls through to the base layer. */
|
|
245
|
-
private inkOverrides;
|
|
246
|
-
private mount;
|
|
247
|
-
/** Performance / balanced keep the last fluid frame; vivid runs the loop. */
|
|
248
|
-
private allowFluidLoop;
|
|
249
|
-
/** Balanced + vivid keep stars / drift / dispersion / specular. */
|
|
250
|
-
private allowMotionFx;
|
|
251
|
-
/** Only vivid mounts the optional extras (whale / mesh / audio). */
|
|
252
|
-
private allowDecor;
|
|
253
|
-
/** Hover glow / tilt stay off in the performance gate. */
|
|
254
|
-
private allowHoverFx;
|
|
255
|
-
/** Mount or drop motion layers to match the performance gate. */
|
|
256
|
-
private syncMotionLayers;
|
|
257
|
-
/** Mount the Mineradio star-river particle stage when the gate allows it. */
|
|
258
|
-
private syncStarRiver;
|
|
259
|
-
/** Start or stop the cinematic camera drift. */
|
|
260
|
-
private syncCinemaDrift;
|
|
261
|
-
/** Start or stop the glass chromatic-dispersion filter. */
|
|
262
|
-
private syncGlassDispersion;
|
|
263
|
-
/** Start or stop the specular-highlight cursor parallax. */
|
|
264
|
-
private syncSpecularParallax;
|
|
265
|
-
/** Mount or drop the particle whale to match enabled + the whale flag. */
|
|
266
|
-
private syncWhale;
|
|
267
|
-
/** Mount or drop the interactive mesh to match enabled + the mesh flag. */
|
|
268
|
-
private syncMesh;
|
|
269
|
-
/** Start or stop the mic audio feed to match enabled + the audioReact flag.
|
|
270
|
-
* The feed routes bass → fluid, mids/highs → star river, and overall
|
|
271
|
-
* loudness → a CSS var that lifts the spotlight glow. */
|
|
272
|
-
private syncAudioReact;
|
|
273
|
-
private unmount;
|
|
274
|
-
/** Attach the fluid shader and the interaction feeds. */
|
|
275
|
-
private mountFluid;
|
|
276
|
-
private teardownFluid;
|
|
277
|
-
private fluidParams;
|
|
278
|
-
/** Slow hue walk for the rainbow scene. Does not rewrite the stored knob. */
|
|
279
|
-
private syncRainbowDrift;
|
|
280
|
-
private stopRainbowDrift;
|
|
281
|
-
private applyFluidPalettes;
|
|
282
|
-
/** Stamp the data-* seams the stylesheet keys off (self-contained mode). */
|
|
283
|
-
private startSeamStamper;
|
|
284
|
-
/** Attach the cursor-spotlight pointer feeds (idempotent per mount). */
|
|
285
|
-
private startSpotlightFeed;
|
|
286
|
-
}
|
|
287
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* the Mineradio layer: one toggleable visual skin over the whole Web surface.
|
|
3
|
+
* Everything this layer owns is an effect — token overrides ride the theme
|
|
4
|
+
* service's override stack, the CSS hooks ride a `data-dsh-aqua` attribute on
|
|
5
|
+
* <html> (the stylesheet only applies under it), the ambient scene and page
|
|
6
|
+
* fades are mounted/removed with the layer — so switching the flag off (or
|
|
7
|
+
* unloading the plugin) restores the stock UI exactly: no residue, no reload.
|
|
8
|
+
*
|
|
9
|
+
* The enable flag persists in localStorage: a client-only visual preference
|
|
10
|
+
* (like the selected-session key), written and read by this plugin alone.
|
|
11
|
+
*/
|
|
12
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
13
|
+
import type { ThemeTokenOverrides } from '@deepseek-ai/dsh-client-ui-theme/client';
|
|
14
|
+
/** html attribute selecting the Mineradio layer: CSS hooks and ambient effects.
|
|
15
|
+
* Kept as the internal `data-dsh-aqua` seam so the stylesheet's 100+ gated
|
|
16
|
+
* selectors and the helper modules stay consistent across the skin. */
|
|
17
|
+
export declare const MINERADIO_ATTRIBUTE = "data-dsh-aqua";
|
|
18
|
+
/** localStorage key carrying the layer enable flag. */
|
|
19
|
+
export declare const MINERADIO_ENABLED_KEY = "dsh.ui-mineradio.enabled";
|
|
20
|
+
/** Default state when nothing is stored yet: on. */
|
|
21
|
+
export declare const DEFAULT_ENABLED = true;
|
|
22
|
+
/**
|
|
23
|
+
* Alias-token override layer: the Mineradio "cinema gold" palette. Every
|
|
24
|
+
* value is a `{ light, dark }` pair so the layer stays legible when the user
|
|
25
|
+
* switches the Appearance preference — dark is the near-black studio
|
|
26
|
+
* ({INK}), light is a warm paper white. The brand accent is champagne gold
|
|
27
|
+
* with mint + ember rose echoes, straight from the Mineradio wordmark.
|
|
28
|
+
*/
|
|
29
|
+
export declare const MINERADIO_TOKEN_OVERRIDES: ThemeTokenOverrides;
|
|
30
|
+
/** Preset global text-ink tints: the "text colour" switch swaps the warm
|
|
31
|
+
* champagne ink for a neutral / mint / rose tint while keeping the SAME
|
|
32
|
+
* lightness ladder, so every preset stays readable in either scheme. The
|
|
33
|
+
* champagne preset reproduces the shipped values exactly (no regression). */
|
|
34
|
+
export type TextStyle = 'champagne' | 'neutral' | 'mint' | 'rose';
|
|
35
|
+
/** Tunable layer knobs, persisted independently of the enable flag. */
|
|
36
|
+
export interface MineradioSettings {
|
|
37
|
+
/** Rendering mode: mica (frosted floating cards) or the stock layout with a generic glass material. */
|
|
38
|
+
mode: 'mica' | 'compat';
|
|
39
|
+
/** Global text-ink tint: warm champagne (default) or a neutral/mint/rose. */
|
|
40
|
+
textStyle: TextStyle;
|
|
41
|
+
/** Glass backdrop blur radius, px. */
|
|
42
|
+
blur: number;
|
|
43
|
+
/** Glass fill opacity, 0-100 (50 = the shipped look; drives the frost multiplier). */
|
|
44
|
+
frost: number;
|
|
45
|
+
/** Fluid hue, degrees (0-360, continuous). */
|
|
46
|
+
fluidHue: number;
|
|
47
|
+
/** Fluid depth, 0-100 (0 = deep saturated, 100 = pale light, continuous). */
|
|
48
|
+
fluidDepth: number;
|
|
49
|
+
/** Glass dispersion tint hue, degrees (0-360, continuous). */
|
|
50
|
+
dispersionHue: number;
|
|
51
|
+
/** Glass refraction strength, 0-100 (0 = none, 100 = strong). */
|
|
52
|
+
dispersionRefract: number;
|
|
53
|
+
/** Background brightness, 0-100 (0 = pure black, 50 = transparent, 100 = pure white). */
|
|
54
|
+
bgBrightness: number;
|
|
55
|
+
/** Backdrop source: the living fluid board or a custom wallpaper. */
|
|
56
|
+
background: 'fluid' | 'wallpaper';
|
|
57
|
+
/** Wallpaper image data URL (empty until one is picked). */
|
|
58
|
+
wallpaper: string;
|
|
59
|
+
/** Auto-derive the accent hue from the wallpaper (spotlight/bloom/dispersion). */
|
|
60
|
+
autoTint: boolean;
|
|
61
|
+
/** Particle whale in the chat area center (opt-in extra; off by default —
|
|
62
|
+
* the Mineradio star river is the shipped particle stage). */
|
|
63
|
+
whale: boolean;
|
|
64
|
+
/** Ambient marine life (fish / bubbles / plankton). */
|
|
65
|
+
critters: boolean;
|
|
66
|
+
/** Interactive mesh (the site's dot-grid with pointer repel). */
|
|
67
|
+
mesh: boolean;
|
|
68
|
+
/** Star-river particle density, 0-100 (50 = 1×, 100 = 2× the default field). */
|
|
69
|
+
starDensity: number;
|
|
70
|
+
/** Cursor spotlight glow that follows the pointer over the glass panes. */
|
|
71
|
+
spotlight: boolean;
|
|
72
|
+
/** Hover press-down: the pane under the cursor sinks a touch (tactile depth). */
|
|
73
|
+
press: boolean;
|
|
74
|
+
/** Audio reactivity: the backdrop pulses with mic audio (fluid/stars/glow). */
|
|
75
|
+
audioReact: boolean;
|
|
76
|
+
/** Wallpaper blur radius, px. */
|
|
77
|
+
wallpaperBlur: number;
|
|
78
|
+
/** Wallpaper frost veil, 0-100. */
|
|
79
|
+
wallpaperFrost: number;
|
|
80
|
+
/** Frosted-glass mask over the wallpaper (readability veil + stronger blur). */
|
|
81
|
+
wallpaperMask: boolean;
|
|
82
|
+
/** Frost mask blur radius, px (0 = none, 40 = heavy frosted glass). */
|
|
83
|
+
wallpaperMaskBlur: number;
|
|
84
|
+
/** Frost mask veil opacity, 0-100 (0 = clear, 100 = fully opaque scrim). */
|
|
85
|
+
wallpaperMaskOpacity: number;
|
|
86
|
+
/** Video wallpaper blur radius, px (0 = crisp, 40 = heavy acrylic). */
|
|
87
|
+
videoBlur: number;
|
|
88
|
+
/** Video wallpaper brightness, 0-100 (100 = fully lit, 0 = deepest dim). */
|
|
89
|
+
videoBrightness: number;
|
|
90
|
+
/** Performance gate: which motion layers actually run. Orthogonal to scenes. */
|
|
91
|
+
perf: PerfTier;
|
|
92
|
+
/** Optional rainbow fluid drift. Off by default; does not rewrite fluidHue. */
|
|
93
|
+
rainbow: boolean;
|
|
94
|
+
}
|
|
95
|
+
/** Performance gate. Scenes keep their knob values; this only mounts layers. */
|
|
96
|
+
export type PerfTier = 'performance' | 'balanced' | 'vivid';
|
|
97
|
+
/** One-click scene: a named bundle of existing knobs (never the wallpaper). */
|
|
98
|
+
export type ScenePreset = 'studio' | 'deepsea' | 'midnight' | 'mist' | 'rainbow';
|
|
99
|
+
/** Knob bundle for one scene. Wallpaper / video files stay untouched. */
|
|
100
|
+
type SceneBundle = Pick<MineradioSettings, 'textStyle' | 'blur' | 'frost' | 'fluidHue' | 'fluidDepth' | 'dispersionHue' | 'dispersionRefract' | 'starDensity' | 'spotlight' | 'press' | 'audioReact' | 'background' | 'rainbow'>;
|
|
101
|
+
/** Which scene the current knobs match, or null after a manual tweak. */
|
|
102
|
+
export declare function matchScenePreset(settings: Pick<MineradioSettings, keyof SceneBundle>): ScenePreset | null;
|
|
103
|
+
/**
|
|
104
|
+
* Owns the Mineradio layer lifecycle: reads the durable enable flag, and applies /
|
|
105
|
+
* retracts every layer on change. Cross-tab flips arrive through the storage
|
|
106
|
+
* event; every subscription and mounted effect are released when the plugin
|
|
107
|
+
* fiber is disposed.
|
|
108
|
+
*/
|
|
109
|
+
export declare class MineradioLayer {
|
|
110
|
+
private enabled;
|
|
111
|
+
private settings;
|
|
112
|
+
/** Resolved palette scheme: dark = the brightness knob darkens, light = it brightens. */
|
|
113
|
+
private dark;
|
|
114
|
+
private tokenDisposer;
|
|
115
|
+
private mainFluid;
|
|
116
|
+
private interactionDisposer;
|
|
117
|
+
private themeListener;
|
|
118
|
+
private seamDisposer;
|
|
119
|
+
private spotlightDisposer;
|
|
120
|
+
private whaleHandle;
|
|
121
|
+
private meshHandle;
|
|
122
|
+
private starRiverHandle;
|
|
123
|
+
private audioHandle;
|
|
124
|
+
private cinemaDrift;
|
|
125
|
+
private dispersion;
|
|
126
|
+
private specularParallaxDisposer;
|
|
127
|
+
/** Object URL of the current large-video wallpaper (revoked on replace). */
|
|
128
|
+
private videoObjectUrl;
|
|
129
|
+
/** IndexedDB id backing the current object URL (guards against reloads). */
|
|
130
|
+
private videoBlobId;
|
|
131
|
+
/** Extracted accent hue from the wallpaper (undefined until read). */
|
|
132
|
+
private extractedHue;
|
|
133
|
+
/** Wallpaper source the extracted hue was computed from (guards re-reads). */
|
|
134
|
+
private extractedWallpaper;
|
|
135
|
+
/** Live rainbow hue, only while the rainbow scene is on. Not persisted. */
|
|
136
|
+
private rainbowHue;
|
|
137
|
+
private rainbowRaf;
|
|
138
|
+
/** Station dial: per-workspace hue offset, glided by station-dial.ts. */
|
|
139
|
+
private stationOffset;
|
|
140
|
+
private stationDisposer;
|
|
141
|
+
private readonly ctx;
|
|
142
|
+
/**
|
|
143
|
+
* @param ctx - owning client context.
|
|
144
|
+
*/
|
|
145
|
+
constructor(ctx: Context);
|
|
146
|
+
/** Current enable state (the settings row mirrors this). */
|
|
147
|
+
getEnabled(): boolean;
|
|
148
|
+
/** Current knob values (the settings row mirrors these). */
|
|
149
|
+
getSettings(): MineradioSettings;
|
|
150
|
+
/** Whether the resolved palette is dark (the brightness knob darkens). */
|
|
151
|
+
getDark(): boolean;
|
|
152
|
+
/** Resolved scheme from the theme service (falls back to the body attribute). */
|
|
153
|
+
private resolveScheme;
|
|
154
|
+
/** Re-read every knob from localStorage into memory. */
|
|
155
|
+
private reloadSettings;
|
|
156
|
+
/** Set the performance gate (does not rewrite scene knobs). */
|
|
157
|
+
setPerf(value: PerfTier): void;
|
|
158
|
+
/** Apply one named scene. Wallpaper / video files stay as they are. */
|
|
159
|
+
applyScene(preset: ScenePreset): void;
|
|
160
|
+
/** Flip the layer: persist, then apply or retract every owned effect. */
|
|
161
|
+
setEnabled(value: boolean): void;
|
|
162
|
+
/** Set the rendering mode ('mica' or 'compat'). */
|
|
163
|
+
setMode(value: 'mica' | 'compat'): void;
|
|
164
|
+
/** Set the global text-ink preset ('champagne' | 'neutral' | 'mint' | 'rose'). */
|
|
165
|
+
setTextStyle(value: TextStyle): void;
|
|
166
|
+
/** Set the glass blur radius (px). */
|
|
167
|
+
setBlur(value: number): void;
|
|
168
|
+
/** Set the glass frost amount (0-100). */
|
|
169
|
+
setFrost(value: number): void;
|
|
170
|
+
/** Set the fluid hue (degrees, continuous). */
|
|
171
|
+
setFluidHue(value: number): void;
|
|
172
|
+
/** Set the glass dispersion tint hue (degrees, continuous). */
|
|
173
|
+
setDispersionHue(value: number): void;
|
|
174
|
+
/** Set the glass refraction strength (0-100). */
|
|
175
|
+
setDispersionRefract(value: number): void;
|
|
176
|
+
/** Set the fluid depth (0-100, continuous: deep ↔ pale). */
|
|
177
|
+
setFluidDepth(value: number): void;
|
|
178
|
+
/** Set the background brightness (0-100: 0 = pure black, 50 = transparent, 100 = pure white). */
|
|
179
|
+
setBgBrightness(value: number): void;
|
|
180
|
+
/** Set the backdrop source (fluid board or custom wallpaper). */
|
|
181
|
+
setBackground(value: 'fluid' | 'wallpaper'): void;
|
|
182
|
+
/** Set the wallpaper image (a data URL; empty clears it) or a large video
|
|
183
|
+
* (`idb:<id>` marker whose blob lives in IndexedDB). */
|
|
184
|
+
setWallpaper(value: string): void;
|
|
185
|
+
/** Set the wallpaper auto-tint flag (derive accent hues from the wallpaper). */
|
|
186
|
+
setAutoTint(value: boolean): void;
|
|
187
|
+
/** Set the particle-whale flag (chat-area center decoration). */
|
|
188
|
+
setWhale(value: boolean): void;
|
|
189
|
+
/** Set the ambient marine-life flag (fish / bubbles / plankton). */
|
|
190
|
+
setCritters(value: boolean): void;
|
|
191
|
+
/** Set the interactive-mesh flag (dot-grid decoration). */
|
|
192
|
+
setMesh(value: boolean): void;
|
|
193
|
+
/** Set the star-river particle density (0-100). */
|
|
194
|
+
setStarDensity(value: number): void;
|
|
195
|
+
/** Set the cursor-spotlight flag (pointer-tracking glass glow). */
|
|
196
|
+
setSpotlight(value: boolean): void;
|
|
197
|
+
/** Set the hover-press flag (pane sinks a touch under the cursor). */
|
|
198
|
+
setPress(value: boolean): void;
|
|
199
|
+
/** Set the audio-reactivity flag (mic-driven backdrop pulse). */
|
|
200
|
+
setAudioReact(value: boolean): void;
|
|
201
|
+
/** Set the wallpaper blur radius (px). */
|
|
202
|
+
setWallpaperBlur(value: number): void;
|
|
203
|
+
/** Set the wallpaper frost veil (0-100). */
|
|
204
|
+
setWallpaperFrost(value: number): void;
|
|
205
|
+
/** Set the wallpaper frost-mask flag (readability veil + stronger blur). */
|
|
206
|
+
setWallpaperMask(value: boolean): void;
|
|
207
|
+
/** Set the frost-mask blur radius (px). */
|
|
208
|
+
setWallpaperMaskBlur(value: number): void;
|
|
209
|
+
/** Set the frost-mask veil opacity (0-100). */
|
|
210
|
+
setWallpaperMaskOpacity(value: number): void;
|
|
211
|
+
/** Set the video wallpaper blur radius (px). */
|
|
212
|
+
setVideoBlur(value: number): void;
|
|
213
|
+
/** Set the video wallpaper brightness (0-100, 100 = fully lit). */
|
|
214
|
+
setVideoBrightness(value: number): void;
|
|
215
|
+
/** After the user re-grants file access (选择视频 click on an fsa: video),
|
|
216
|
+
* drop the mount guard and re-apply so the file is re-read and played. */
|
|
217
|
+
authorizeVideo(): void;
|
|
218
|
+
private sync;
|
|
219
|
+
/** Write the knob-driven CSS variables and mode attributes onto <html>. */
|
|
220
|
+
private applySettings;
|
|
221
|
+
/** The wallpaper plays as a plain <video> element (the browser's own
|
|
222
|
+
* decoder, no player chrome at all): looping on, cover fill via CSS, and
|
|
223
|
+
* autoplay with a muted fallback where policy requires it. A direct
|
|
224
|
+
* element (not an iframe) keeps backdrop-filter working over it, so the
|
|
225
|
+
* glass panels stay frosted above the video. */
|
|
226
|
+
private configureWallpaperVideo;
|
|
227
|
+
/** The hue driving the spotlight glow + ambient bloom right now. */
|
|
228
|
+
private accentHue;
|
|
229
|
+
/** The dispersion edge-tint hue (auto-extracted, or the user's knob). */
|
|
230
|
+
private dispersionTintHue;
|
|
231
|
+
/** Write the hue-driven accent vars (spotlight glow + bloom + dispersion). */
|
|
232
|
+
private applyAccentTint;
|
|
233
|
+
/** Kick off (or clear) wallpaper color extraction, guarded by source. */
|
|
234
|
+
private ensureWallpaperTint;
|
|
235
|
+
/** Extract the dominant hue and repaint the accents (async, guarded). */
|
|
236
|
+
private extractWallpaperTint;
|
|
237
|
+
/** Draw a wallpaper image into the extractor. */
|
|
238
|
+
private extractImageHue;
|
|
239
|
+
/** Draw the wallpaper video's first available frame into the extractor. */
|
|
240
|
+
private extractVideoHue;
|
|
241
|
+
/** Apply the mode's token layer (floating palette, or translucent compat). */
|
|
242
|
+
private applyTokens;
|
|
243
|
+
/** The text-ink override for the current preset: redefines the warm ink
|
|
244
|
+
* tokens only; every other token falls through to the base layer. */
|
|
245
|
+
private inkOverrides;
|
|
246
|
+
private mount;
|
|
247
|
+
/** Performance / balanced keep the last fluid frame; vivid runs the loop. */
|
|
248
|
+
private allowFluidLoop;
|
|
249
|
+
/** Balanced + vivid keep stars / drift / dispersion / specular. */
|
|
250
|
+
private allowMotionFx;
|
|
251
|
+
/** Only vivid mounts the optional extras (whale / mesh / audio). */
|
|
252
|
+
private allowDecor;
|
|
253
|
+
/** Hover glow / tilt stay off in the performance gate. */
|
|
254
|
+
private allowHoverFx;
|
|
255
|
+
/** Mount or drop motion layers to match the performance gate. */
|
|
256
|
+
private syncMotionLayers;
|
|
257
|
+
/** Mount the Mineradio star-river particle stage when the gate allows it. */
|
|
258
|
+
private syncStarRiver;
|
|
259
|
+
/** Start or stop the cinematic camera drift. */
|
|
260
|
+
private syncCinemaDrift;
|
|
261
|
+
/** Start or stop the glass chromatic-dispersion filter. */
|
|
262
|
+
private syncGlassDispersion;
|
|
263
|
+
/** Start or stop the specular-highlight cursor parallax. */
|
|
264
|
+
private syncSpecularParallax;
|
|
265
|
+
/** Mount or drop the particle whale to match enabled + the whale flag. */
|
|
266
|
+
private syncWhale;
|
|
267
|
+
/** Mount or drop the interactive mesh to match enabled + the mesh flag. */
|
|
268
|
+
private syncMesh;
|
|
269
|
+
/** Start or stop the mic audio feed to match enabled + the audioReact flag.
|
|
270
|
+
* The feed routes bass → fluid, mids/highs → star river, and overall
|
|
271
|
+
* loudness → a CSS var that lifts the spotlight glow. */
|
|
272
|
+
private syncAudioReact;
|
|
273
|
+
private unmount;
|
|
274
|
+
/** Attach the fluid shader and the interaction feeds. */
|
|
275
|
+
private mountFluid;
|
|
276
|
+
private teardownFluid;
|
|
277
|
+
private fluidParams;
|
|
278
|
+
/** Slow hue walk for the rainbow scene. Does not rewrite the stored knob. */
|
|
279
|
+
private syncRainbowDrift;
|
|
280
|
+
private stopRainbowDrift;
|
|
281
|
+
private applyFluidPalettes;
|
|
282
|
+
/** Stamp the data-* seams the stylesheet keys off (self-contained mode). */
|
|
283
|
+
private startSeamStamper;
|
|
284
|
+
/** Attach the cursor-spotlight pointer feeds (idempotent per mount). */
|
|
285
|
+
private startSpotlightFeed;
|
|
286
|
+
}
|
|
287
|
+
export {};
|