@5even7/dlc-ui 0.2.17 → 0.2.19
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/CHANGELOG.md +147 -123
- package/LICENSE +21 -21
- package/README.md +338 -316
- package/THIRD_PARTY_NOTICES.md +57 -0
- package/dist/avatar-creator.cjs +7221 -0
- package/dist/avatar-creator.mjs +9278 -0
- package/dist/capsule.cjs +189 -68
- package/dist/capsule.mjs +1208 -1103
- package/dist/color.cjs +186 -67
- package/dist/color.mjs +1157 -1052
- package/dist/emo.cjs +1439 -410
- package/dist/emo.mjs +1405 -496
- package/dist/index.cjs +7808 -310
- package/dist/index.mjs +13435 -3802
- package/dist/index.umd.js +7786 -288
- package/dist/index.umd.min.js +1 -1
- package/dist/progress.cjs +195 -76
- package/dist/progress.mjs +2293 -2188
- package/dist/vue2.cjs +7827 -376
- package/dist/vue2.mjs +13841 -4267
- package/dist/vue3.cjs +7827 -376
- package/dist/vue3.mjs +13841 -4267
- package/package.json +146 -135
- package/styles/avatar-creator.css +13 -0
- package/styles/base.css +32 -32
- package/styles/color.css +18 -18
- package/styles/emo.css +89 -33
- package/styles/progress.css +96 -96
- package/styles/theme.css +1 -0
- package/types/avatar-creator.d.ts +124 -0
- package/types/capsule.d.ts +15 -15
- package/types/color.d.ts +15 -15
- package/types/emo.d.ts +37 -14
- package/types/index.d.ts +581 -417
- package/types/progress.d.ts +16 -16
- package/types/vue2.d.ts +11 -10
- package/types/vue3.d.ts +169 -144
package/types/index.d.ts
CHANGED
|
@@ -1,417 +1,581 @@
|
|
|
1
|
-
export type Quality = 'auto' | 'low' | 'medium' | 'high';
|
|
2
|
-
export type PowerPreference = 'default' | 'high-performance' | 'low-power';
|
|
3
|
-
export type ColorTuple = [string, string, string, string];
|
|
4
|
-
|
|
5
|
-
export type MiaoPartColorKey =
|
|
6
|
-
| 'leftEye'
|
|
7
|
-
| 'rightEye'
|
|
8
|
-
| 'mouth'
|
|
9
|
-
| 'mouthFill'
|
|
10
|
-
| 'sleepBreath'
|
|
11
|
-
| 'shuttlecock'
|
|
12
|
-
| 'meditationFigure'
|
|
13
|
-
| 'meditationBubble'
|
|
14
|
-
| 'musicNotes'
|
|
15
|
-
| 'leftEyeOverlay'
|
|
16
|
-
| 'questionMark'
|
|
17
|
-
| 'leftBlush'
|
|
18
|
-
| 'rightBlush'
|
|
19
|
-
| 'sighBreath'
|
|
20
|
-
| 'particles';
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Per-part color overrides for a Miao emoji. Values are any CSS color
|
|
24
|
-
* (#fff / #rrggbb / named / rgb() / rgba(), alpha ignored); null or missing
|
|
25
|
-
* keys keep the asset's original color, and keys the current animation does
|
|
26
|
-
* not support are ignored.
|
|
27
|
-
*/
|
|
28
|
-
export type MiaoPartColors = Partial<Record<MiaoPartColorKey, string | null>>;
|
|
29
|
-
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
export
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
export
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export interface
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
value:
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
}
|
|
1
|
+
export type Quality = 'auto' | 'low' | 'medium' | 'high';
|
|
2
|
+
export type PowerPreference = 'default' | 'high-performance' | 'low-power';
|
|
3
|
+
export type ColorTuple = [string, string, string, string];
|
|
4
|
+
|
|
5
|
+
export type MiaoPartColorKey =
|
|
6
|
+
| 'leftEye'
|
|
7
|
+
| 'rightEye'
|
|
8
|
+
| 'mouth'
|
|
9
|
+
| 'mouthFill'
|
|
10
|
+
| 'sleepBreath'
|
|
11
|
+
| 'shuttlecock'
|
|
12
|
+
| 'meditationFigure'
|
|
13
|
+
| 'meditationBubble'
|
|
14
|
+
| 'musicNotes'
|
|
15
|
+
| 'leftEyeOverlay'
|
|
16
|
+
| 'questionMark'
|
|
17
|
+
| 'leftBlush'
|
|
18
|
+
| 'rightBlush'
|
|
19
|
+
| 'sighBreath'
|
|
20
|
+
| 'particles';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Per-part color overrides for a Miao emoji. Values are any CSS color
|
|
24
|
+
* (#fff / #rrggbb / named / rgb() / rgba(), alpha ignored); null or missing
|
|
25
|
+
* keys keep the asset's original color, and keys the current animation does
|
|
26
|
+
* not support are ignored.
|
|
27
|
+
*/
|
|
28
|
+
export type MiaoPartColors = Partial<Record<MiaoPartColorKey, string | null>>;
|
|
29
|
+
|
|
30
|
+
export type EmoType = 'miao' | 'grok';
|
|
31
|
+
export type EmoEngine = 'lottie' | 'grok';
|
|
32
|
+
|
|
33
|
+
export type GrokPartColorKey = 'body' | 'eyes';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Per-part color overrides for a Grok emoji. Values are any CSS color;
|
|
37
|
+
* null or missing keys keep the original color.
|
|
38
|
+
*/
|
|
39
|
+
export type GrokPartColors = Partial<Record<GrokPartColorKey, string | null>>;
|
|
40
|
+
|
|
41
|
+
export type EmoPartColors = MiaoPartColors | GrokPartColors;
|
|
42
|
+
|
|
43
|
+
export type GrokShape =
|
|
44
|
+
| 'blob'
|
|
45
|
+
| 'pebble'
|
|
46
|
+
| 'squircle'
|
|
47
|
+
| 'capsule'
|
|
48
|
+
| 'triangle'
|
|
49
|
+
| 'hex'
|
|
50
|
+
| 'cloud'
|
|
51
|
+
| 'drop';
|
|
52
|
+
|
|
53
|
+
export type MiaoName =
|
|
54
|
+
| 'angry'
|
|
55
|
+
| 'cry'
|
|
56
|
+
| 'sad'
|
|
57
|
+
| 'sigh'
|
|
58
|
+
| 'investigate'
|
|
59
|
+
| 'mute'
|
|
60
|
+
| 'ponder'
|
|
61
|
+
| 'question'
|
|
62
|
+
| 'static'
|
|
63
|
+
| 'asleep'
|
|
64
|
+
| 'yawn'
|
|
65
|
+
| 'badminton'
|
|
66
|
+
| 'confident'
|
|
67
|
+
| 'laugh'
|
|
68
|
+
| 'leisure'
|
|
69
|
+
| 'music'
|
|
70
|
+
| 'smile'
|
|
71
|
+
| 'yummy'
|
|
72
|
+
| 'mock'
|
|
73
|
+
| 'shy'
|
|
74
|
+
| 'snigger'
|
|
75
|
+
| 'panic'
|
|
76
|
+
| 'shocked';
|
|
77
|
+
|
|
78
|
+
export type GrokName =
|
|
79
|
+
| 'sleeping'
|
|
80
|
+
| 'idle'
|
|
81
|
+
| 'listening'
|
|
82
|
+
| 'thinking'
|
|
83
|
+
| 'searching'
|
|
84
|
+
| 'working'
|
|
85
|
+
| 'happy'
|
|
86
|
+
| 'surprised'
|
|
87
|
+
| 'angry'
|
|
88
|
+
| 'sad'
|
|
89
|
+
| 'loading'
|
|
90
|
+
| 'confused'
|
|
91
|
+
| 'receiving';
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Grok state presentation categories. Only organizes Docs / Playground
|
|
95
|
+
* display; all 13 public names stay valid regardless of category.
|
|
96
|
+
*/
|
|
97
|
+
export type GrokStateCategory = 'emotion' | 'agent' | 'lifecycle';
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Presentation metadata for one Grok state. A Grok `name` is a dynamic state
|
|
101
|
+
* module (expression pool + cadence + blink + body motion), so its static
|
|
102
|
+
* first frame may look similar to other states even when the dynamics differ.
|
|
103
|
+
*/
|
|
104
|
+
export interface GrokStateMeta {
|
|
105
|
+
category: GrokStateCategory;
|
|
106
|
+
/** Chinese display name. */
|
|
107
|
+
label: string;
|
|
108
|
+
/** Short usage note shown on Docs cards. */
|
|
109
|
+
description?: string;
|
|
110
|
+
/** 'upstream' = ported from LaoA-GrokBot; 'dlc' reserved for DLC extensions. */
|
|
111
|
+
source: 'upstream' | 'dlc';
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface GrokCategoryDef {
|
|
115
|
+
key: GrokStateCategory;
|
|
116
|
+
label: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface EmoPreviewCardOptions {
|
|
120
|
+
container: HTMLElement;
|
|
121
|
+
options: EmoOptions;
|
|
122
|
+
/** Auto-pause after this many ms of preview (default 2800). */
|
|
123
|
+
playFor?: number;
|
|
124
|
+
/** Keep the card static when the user prefers reduced motion (default true). */
|
|
125
|
+
respectReducedMotion?: boolean;
|
|
126
|
+
/** Pause the preview when the card leaves the viewport (default false). */
|
|
127
|
+
trackViewport?: boolean;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface EmoPreviewCardController {
|
|
131
|
+
element: HTMLElement;
|
|
132
|
+
controller: EmoController;
|
|
133
|
+
start(): void;
|
|
134
|
+
stop(): void;
|
|
135
|
+
setViewportVisible(visible: boolean): void;
|
|
136
|
+
dispose(): void;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface CapsulePreset {
|
|
140
|
+
id: string;
|
|
141
|
+
code: string;
|
|
142
|
+
name: string;
|
|
143
|
+
group: 'warm' | 'cold';
|
|
144
|
+
theme?: 'light' | 'dark';
|
|
145
|
+
subtitle?: string;
|
|
146
|
+
seed: number;
|
|
147
|
+
speed: number;
|
|
148
|
+
colors: ColorTuple;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface ProgressPreset {
|
|
152
|
+
id: string;
|
|
153
|
+
code: string;
|
|
154
|
+
name: string;
|
|
155
|
+
group: 'progress';
|
|
156
|
+
subtitle?: string;
|
|
157
|
+
initialProgress: number;
|
|
158
|
+
edgeStyle: 'flow' | 'tide';
|
|
159
|
+
colors: ColorTuple;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface EmoPreset {
|
|
163
|
+
type: EmoType;
|
|
164
|
+
name: string;
|
|
165
|
+
label: string;
|
|
166
|
+
category: string;
|
|
167
|
+
width: number;
|
|
168
|
+
height: number;
|
|
169
|
+
engine: EmoEngine;
|
|
170
|
+
frames?: number;
|
|
171
|
+
fps?: number;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface EmoTypeDefinition {
|
|
175
|
+
type: EmoType;
|
|
176
|
+
label: string;
|
|
177
|
+
defaultName: string;
|
|
178
|
+
engine: EmoEngine;
|
|
179
|
+
names: string[];
|
|
180
|
+
partColors: string[];
|
|
181
|
+
shapes?: string[];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface Copy {
|
|
185
|
+
brandName: string;
|
|
186
|
+
valueSuffix: string;
|
|
187
|
+
progressAria: string;
|
|
188
|
+
capsuleAria: string;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface CapsuleOptions {
|
|
192
|
+
preset?: string;
|
|
193
|
+
width?: number | string;
|
|
194
|
+
height?: number | string;
|
|
195
|
+
colors?: string[];
|
|
196
|
+
seed?: number;
|
|
197
|
+
speed?: number;
|
|
198
|
+
textRatio?: number;
|
|
199
|
+
text?: string | Node | Node[];
|
|
200
|
+
colorContent?: string | Node | Node[];
|
|
201
|
+
label?: string;
|
|
202
|
+
mouseColor?: boolean;
|
|
203
|
+
renderer?: 'auto' | 'webgl2' | 'canvas2d';
|
|
204
|
+
quality?: Quality;
|
|
205
|
+
renderScale?: number;
|
|
206
|
+
powerPreference?: PowerPreference;
|
|
207
|
+
fps?: number;
|
|
208
|
+
paused?: boolean;
|
|
209
|
+
static?: boolean;
|
|
210
|
+
respectReducedMotion?: boolean;
|
|
211
|
+
cssVars?: Record<string, string>;
|
|
212
|
+
[key: string]: unknown;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface ProgressOptions {
|
|
216
|
+
preset?: string;
|
|
217
|
+
width?: number | string;
|
|
218
|
+
height?: number | string;
|
|
219
|
+
value?: number;
|
|
220
|
+
modelValue?: number;
|
|
221
|
+
min?: number;
|
|
222
|
+
max?: number;
|
|
223
|
+
step?: number | 'any';
|
|
224
|
+
draggable?: boolean;
|
|
225
|
+
keyboard?: boolean;
|
|
226
|
+
disabled?: boolean;
|
|
227
|
+
readonly?: boolean;
|
|
228
|
+
valueSuffix?: string;
|
|
229
|
+
precision?: number;
|
|
230
|
+
formatValue?: (value: number, context: { min: number; max: number; suffix: string }) => string;
|
|
231
|
+
direction?: 'ltr' | 'rtl';
|
|
232
|
+
edgeStyle?: 'flow' | 'tide';
|
|
233
|
+
colors?: string[];
|
|
234
|
+
textRatio?: number;
|
|
235
|
+
text?: string | Node | Node[];
|
|
236
|
+
colorContent?: string | Node | Node[];
|
|
237
|
+
label?: string;
|
|
238
|
+
showValue?: boolean;
|
|
239
|
+
renderer?: 'auto' | 'webgl2' | 'canvas2d';
|
|
240
|
+
quality?: Quality;
|
|
241
|
+
renderScale?: number;
|
|
242
|
+
powerPreference?: PowerPreference;
|
|
243
|
+
fps?: number;
|
|
244
|
+
paused?: boolean;
|
|
245
|
+
static?: boolean;
|
|
246
|
+
respectReducedMotion?: boolean;
|
|
247
|
+
cssVars?: Record<string, string>;
|
|
248
|
+
[key: string]: unknown;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export interface ColorBackgroundOptions {
|
|
252
|
+
preset?: string;
|
|
253
|
+
colors?: string[];
|
|
254
|
+
seed?: number;
|
|
255
|
+
speed?: number;
|
|
256
|
+
renderer?: 'auto' | 'webgl2' | 'canvas2d';
|
|
257
|
+
quality?: Quality;
|
|
258
|
+
renderScale?: number;
|
|
259
|
+
powerPreference?: PowerPreference;
|
|
260
|
+
fps?: number;
|
|
261
|
+
paused?: boolean;
|
|
262
|
+
static?: boolean;
|
|
263
|
+
mouseColor?: boolean;
|
|
264
|
+
respectReducedMotion?: boolean;
|
|
265
|
+
opacity?: number;
|
|
266
|
+
fallbackColor?: boolean | string;
|
|
267
|
+
[key: string]: unknown;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export interface EmoCommonOptions {
|
|
271
|
+
width?: number | string;
|
|
272
|
+
height?: number | string;
|
|
273
|
+
speed?: number;
|
|
274
|
+
loop?: boolean;
|
|
275
|
+
autoplay?: boolean;
|
|
276
|
+
paused?: boolean;
|
|
277
|
+
opacity?: number;
|
|
278
|
+
fit?: 'contain' | 'cover' | 'fill';
|
|
279
|
+
background?: string;
|
|
280
|
+
label?: string;
|
|
281
|
+
instanceName?: string;
|
|
282
|
+
respectReducedMotion?: boolean;
|
|
283
|
+
[key: string]: unknown;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export interface MiaoEmoOptions extends EmoCommonOptions {
|
|
287
|
+
type?: 'miao';
|
|
288
|
+
name?: MiaoName;
|
|
289
|
+
partColors?: MiaoPartColors;
|
|
290
|
+
renderer?: 'svg' | 'canvas';
|
|
291
|
+
direction?: 'forward' | 'reverse' | 1 | -1;
|
|
292
|
+
segment?: [number, number] | null;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export interface GrokEmoOptions extends EmoCommonOptions {
|
|
296
|
+
type: 'grok';
|
|
297
|
+
name?: GrokName;
|
|
298
|
+
partColors?: GrokPartColors;
|
|
299
|
+
shape?: GrokShape;
|
|
300
|
+
interactive?: boolean;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export type EmoOptions = MiaoEmoOptions | GrokEmoOptions;
|
|
304
|
+
|
|
305
|
+
export interface Emitter {
|
|
306
|
+
on(event: string, handler: (...args: any[]) => void): () => void;
|
|
307
|
+
off(event: string, handler: (...args: any[]) => void): boolean;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export interface CapsuleController extends Emitter {
|
|
311
|
+
element: HTMLElement;
|
|
312
|
+
canvas: HTMLCanvasElement;
|
|
313
|
+
preset: CapsulePreset;
|
|
314
|
+
setPreset(ref: string): this;
|
|
315
|
+
setColors(colors: string[]): this;
|
|
316
|
+
setSeed(seed: number): this;
|
|
317
|
+
setSpeed(speed: number): this;
|
|
318
|
+
setMouseColor(value: boolean): this;
|
|
319
|
+
setText(content: string | Node | Node[]): this;
|
|
320
|
+
setColorContent(content: string | Node | Node[]): this;
|
|
321
|
+
setTextRatio(ratio: number): this;
|
|
322
|
+
setCssVars(vars: Record<string, string>): this;
|
|
323
|
+
setLabel(label: string): this;
|
|
324
|
+
setSize(width?: number | string, height?: number | string): this;
|
|
325
|
+
randomize(): this;
|
|
326
|
+
pause(): this;
|
|
327
|
+
resume(): this;
|
|
328
|
+
setQuality(quality: Quality): this;
|
|
329
|
+
setRenderScale(value: number): this;
|
|
330
|
+
setPaused(value: boolean): this;
|
|
331
|
+
setStatic(value: boolean): this;
|
|
332
|
+
setFps(value: number): this;
|
|
333
|
+
readonly paused: boolean;
|
|
334
|
+
readonly static: boolean;
|
|
335
|
+
readonly fps: number;
|
|
336
|
+
readonly quality: Quality;
|
|
337
|
+
readonly renderScale: number;
|
|
338
|
+
readonly mouseColor: boolean;
|
|
339
|
+
dispose(): void;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export interface ProgressController extends Emitter {
|
|
343
|
+
element: HTMLElement;
|
|
344
|
+
canvas: HTMLCanvasElement;
|
|
345
|
+
preset: ProgressPreset;
|
|
346
|
+
setValue(value: number, source?: string): this;
|
|
347
|
+
getValue(): number;
|
|
348
|
+
setRange(min: number, max: number): this;
|
|
349
|
+
setStep(step: number | 'any'): this;
|
|
350
|
+
setPreset(ref: string): this;
|
|
351
|
+
setColors(colors: string[]): this;
|
|
352
|
+
setEdgeStyle(style: 'flow' | 'tide'): this;
|
|
353
|
+
setText(content: string | Node | Node[]): this;
|
|
354
|
+
setColorContent(content: string | Node | Node[]): this;
|
|
355
|
+
setTextRatio(ratio: number): this;
|
|
356
|
+
setCssVars(vars: Record<string, string>): this;
|
|
357
|
+
setLabel(label: string): this;
|
|
358
|
+
setValueSuffix(suffix: string): this;
|
|
359
|
+
setPrecision(precision: number): this;
|
|
360
|
+
setFormatValue(formatter: ProgressOptions['formatValue'] | null): this;
|
|
361
|
+
setDirection(direction: 'ltr' | 'rtl'): this;
|
|
362
|
+
setShowValue(show: boolean): this;
|
|
363
|
+
setSize(width?: number | string, height?: number | string): this;
|
|
364
|
+
randomize(): this;
|
|
365
|
+
pause(): this;
|
|
366
|
+
resume(): this;
|
|
367
|
+
setQuality(quality: Quality): this;
|
|
368
|
+
setRenderScale(value: number): this;
|
|
369
|
+
setPaused(value: boolean): this;
|
|
370
|
+
setStatic(value: boolean): this;
|
|
371
|
+
setFps(value: number): this;
|
|
372
|
+
readonly min: number;
|
|
373
|
+
readonly max: number;
|
|
374
|
+
readonly step: number | 'any';
|
|
375
|
+
readonly precision: number;
|
|
376
|
+
readonly formatValue: ProgressOptions['formatValue'] | null;
|
|
377
|
+
readonly direction: 'ltr' | 'rtl';
|
|
378
|
+
readonly showValue: boolean;
|
|
379
|
+
readonly valueSuffix: string;
|
|
380
|
+
readonly paused: boolean;
|
|
381
|
+
readonly static: boolean;
|
|
382
|
+
readonly fps: number;
|
|
383
|
+
readonly quality: Quality;
|
|
384
|
+
readonly renderScale: number;
|
|
385
|
+
dispose(): void;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export interface ColorBackgroundController extends Emitter {
|
|
389
|
+
element: HTMLElement;
|
|
390
|
+
layer: HTMLElement;
|
|
391
|
+
canvas: HTMLCanvasElement;
|
|
392
|
+
preset: CapsulePreset;
|
|
393
|
+
setPreset(ref: string): this;
|
|
394
|
+
setColors(colors: string[]): this;
|
|
395
|
+
setSeed(seed: number): this;
|
|
396
|
+
setSpeed(speed: number): this;
|
|
397
|
+
setFallbackColor(value: boolean | string): this;
|
|
398
|
+
setMouseColor(value: boolean): this;
|
|
399
|
+
setQuality(quality: Quality): this;
|
|
400
|
+
setRenderScale(value: number): this;
|
|
401
|
+
setPaused(value: boolean): this;
|
|
402
|
+
setStatic(value: boolean): this;
|
|
403
|
+
setFps(value: number): this;
|
|
404
|
+
setOpacity(value: number): this;
|
|
405
|
+
randomize(): this;
|
|
406
|
+
pause(): this;
|
|
407
|
+
resume(): this;
|
|
408
|
+
dispose(): void;
|
|
409
|
+
readonly paused: boolean;
|
|
410
|
+
readonly static: boolean;
|
|
411
|
+
readonly fps: number;
|
|
412
|
+
readonly quality: Quality;
|
|
413
|
+
readonly renderScale: number;
|
|
414
|
+
readonly opacity: number;
|
|
415
|
+
readonly fallbackColor: boolean | string;
|
|
416
|
+
readonly mouseColor: boolean;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export interface EmoController extends Emitter {
|
|
420
|
+
element: HTMLElement;
|
|
421
|
+
readonly animation: any;
|
|
422
|
+
readonly preset: EmoPreset;
|
|
423
|
+
play(): this;
|
|
424
|
+
pause(): this;
|
|
425
|
+
stop(): this;
|
|
426
|
+
setPaused(value: boolean): this;
|
|
427
|
+
setSpeed(value: number): this;
|
|
428
|
+
setDirection(value: MiaoEmoOptions['direction']): this;
|
|
429
|
+
setSegment(value: [number, number] | null): this;
|
|
430
|
+
setName(value: string): this;
|
|
431
|
+
setType(value: EmoType): this;
|
|
432
|
+
setPartColors(value: EmoPartColors): this;
|
|
433
|
+
setOpacity(value: number): this;
|
|
434
|
+
setBackground(value: string): this;
|
|
435
|
+
setSize(width?: number | string, height?: number | string): this;
|
|
436
|
+
setFit(value: EmoCommonOptions['fit']): this;
|
|
437
|
+
setRenderer(value: 'svg' | 'canvas'): this;
|
|
438
|
+
setLoop(value: boolean): this;
|
|
439
|
+
setAutoplay(value: boolean): this;
|
|
440
|
+
setShape(value: GrokShape): this;
|
|
441
|
+
setInteractive(value: boolean): this;
|
|
442
|
+
setLabel(value: string): this;
|
|
443
|
+
dispose(): void;
|
|
444
|
+
readonly speed: number;
|
|
445
|
+
readonly loop: boolean;
|
|
446
|
+
readonly autoplay: boolean;
|
|
447
|
+
readonly direction: 1 | -1;
|
|
448
|
+
readonly opacity: number;
|
|
449
|
+
readonly fit: 'contain' | 'cover' | 'fill';
|
|
450
|
+
readonly renderer: 'svg' | 'canvas';
|
|
451
|
+
readonly paused: boolean;
|
|
452
|
+
readonly segment: [number, number] | null;
|
|
453
|
+
readonly partColors: EmoPartColors;
|
|
454
|
+
readonly background: string;
|
|
455
|
+
readonly shape: GrokShape;
|
|
456
|
+
readonly interactive: boolean;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
export declare class ProgressCapsuleController {
|
|
460
|
+
value: number;
|
|
461
|
+
min: number;
|
|
462
|
+
max: number;
|
|
463
|
+
step: number | 'any';
|
|
464
|
+
webglActive: boolean;
|
|
465
|
+
setProgress(nextValue: number, source?: string): boolean;
|
|
466
|
+
setRange(min: number, max: number): this;
|
|
467
|
+
setStep(step: number | 'any'): this;
|
|
468
|
+
setPrecision(precision: number): this;
|
|
469
|
+
setFormatValue(formatter: ProgressOptions['formatValue'] | null): this;
|
|
470
|
+
setDirection(direction: 'ltr' | 'rtl'): this;
|
|
471
|
+
setValueSuffix(suffix: string): this;
|
|
472
|
+
setShowValue(show: boolean): this;
|
|
473
|
+
update(delta: number, paused: boolean, now: number): void;
|
|
474
|
+
draw(): void;
|
|
475
|
+
randomize(): number;
|
|
476
|
+
dispose(): void;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
export declare function createCapsule(container: HTMLElement, options?: CapsuleOptions): CapsuleController;
|
|
480
|
+
export declare function createProgressCapsule(container: HTMLElement, options?: ProgressOptions): ProgressController;
|
|
481
|
+
export declare function createColorBackground(host: HTMLElement, options?: ColorBackgroundOptions): ColorBackgroundController;
|
|
482
|
+
export declare function createEmo(container: HTMLElement, options?: EmoOptions): EmoController;
|
|
483
|
+
export declare function createEmoPreviewCard(options: EmoPreviewCardOptions): EmoPreviewCardController;
|
|
484
|
+
|
|
485
|
+
export {
|
|
486
|
+
AvatarProviderId,
|
|
487
|
+
AvatarControl,
|
|
488
|
+
AvatarStyleDefinition,
|
|
489
|
+
AvatarProviderDefinition,
|
|
490
|
+
AvatarOptions,
|
|
491
|
+
AvatarRenderResult,
|
|
492
|
+
AvatarState,
|
|
493
|
+
AvatarController,
|
|
494
|
+
createAvatarSvg,
|
|
495
|
+
createAvatarCreator,
|
|
496
|
+
getStyleDefinitions,
|
|
497
|
+
getProviders,
|
|
498
|
+
getProvider,
|
|
499
|
+
getStyleDefinition,
|
|
500
|
+
hashSeed,
|
|
501
|
+
fnv1a,
|
|
502
|
+
createPrng,
|
|
503
|
+
escapeXml,
|
|
504
|
+
applySize,
|
|
505
|
+
svgToDataUri,
|
|
506
|
+
sanitizeSvg,
|
|
507
|
+
cleanText,
|
|
508
|
+
validateProviderOptions,
|
|
509
|
+
buildControlsFromSchema
|
|
510
|
+
} from './avatar-creator.js';
|
|
511
|
+
|
|
512
|
+
export declare const PRESETS: CapsulePreset[];
|
|
513
|
+
export declare const PROGRESS_PRESETS: ProgressPreset[];
|
|
514
|
+
export declare const ALL_PRESETS: Array<CapsulePreset | ProgressPreset>;
|
|
515
|
+
export declare function getPreset(kind: 'capsule' | 'progress', ref: string): CapsulePreset | ProgressPreset;
|
|
516
|
+
export declare const EMO_TYPES: EmoTypeDefinition[];
|
|
517
|
+
export declare const EMO_PRESETS: EmoPreset[];
|
|
518
|
+
export declare const EMO_CATEGORIES: Record<string, string>;
|
|
519
|
+
export declare function getEmoType(type?: string): EmoTypeDefinition;
|
|
520
|
+
export declare function getEmoPreset(type?: string, name?: string): EmoPreset;
|
|
521
|
+
export declare function getEmoAnimation(type?: string, name?: string): any;
|
|
522
|
+
export declare const GROK_CATEGORIES: GrokCategoryDef[];
|
|
523
|
+
export declare const GROK_NAMES: GrokName[];
|
|
524
|
+
export declare const GROK_STATE_META: Record<GrokName, GrokStateMeta>;
|
|
525
|
+
export declare function getGrokNamesFor(tab: GrokStateCategory | 'all' | string): GrokName[];
|
|
526
|
+
export declare function getGrokStateMeta(name: string): GrokStateMeta;
|
|
527
|
+
|
|
528
|
+
export declare const DEFAULTS: {
|
|
529
|
+
capsule: Required<Pick<CapsuleOptions, 'width' | 'height' | 'quality' | 'respectReducedMotion' | 'mouseColor' | 'renderer' | 'textRatio' | 'renderScale' | 'powerPreference' | 'fps' | 'paused' | 'static'>>;
|
|
530
|
+
progress: Required<Pick<ProgressOptions, 'width' | 'height' | 'min' | 'max' | 'step' | 'draggable' | 'keyboard' | 'disabled' | 'readonly' | 'direction' | 'precision' | 'valueSuffix' | 'edgeStyle' | 'quality' | 'respectReducedMotion' | 'renderer' | 'textRatio' | 'showValue' | 'renderScale' | 'powerPreference' | 'fps' | 'paused' | 'static'>>;
|
|
531
|
+
emo: Required<Pick<EmoCommonOptions, 'width' | 'height' | 'speed' | 'loop' | 'autoplay' | 'paused' | 'opacity' | 'fit' | 'background' | 'respectReducedMotion'>> & Pick<MiaoEmoOptions, 'type' | 'name' | 'partColors' | 'direction' | 'renderer' | 'segment'>;
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
export declare const COPY: Copy;
|
|
535
|
+
export declare function parseSize(value: number | string): string;
|
|
536
|
+
export declare const QUALITY_TIERS: Record<'low' | 'medium' | 'high', { dpr: number }>;
|
|
537
|
+
export declare function dprCapFor(quality: Quality): number;
|
|
538
|
+
export declare function effectiveDprCap(quality: Quality, renderScale?: number): number;
|
|
539
|
+
export declare function pauseAll(): void;
|
|
540
|
+
export declare function resumeAll(): void;
|
|
541
|
+
export declare function hexToRgb01(hex: string): [number, number, number];
|
|
542
|
+
export declare function hexToRgba(hex: string, alpha?: number): string;
|
|
543
|
+
export declare function normalizeColor(color: string): string | null;
|
|
544
|
+
export declare function validateColors(colors: unknown): boolean;
|
|
545
|
+
|
|
546
|
+
export declare class CosmicRenderer {
|
|
547
|
+
constructor(canvas: HTMLCanvasElement, preset: CapsulePreset, options?: {
|
|
548
|
+
dprCap?: number;
|
|
549
|
+
mouseColor?: boolean;
|
|
550
|
+
eventTarget?: HTMLElement;
|
|
551
|
+
powerPreference?: PowerPreference;
|
|
552
|
+
onContextLost?: (event: Event) => void;
|
|
553
|
+
onContextRestored?: () => void;
|
|
554
|
+
});
|
|
555
|
+
draw(elapsedSeconds: number, paused?: boolean): void;
|
|
556
|
+
setPreset(preset: CapsulePreset): void;
|
|
557
|
+
setDprCap(cap: number): void;
|
|
558
|
+
randomize(): void;
|
|
559
|
+
resize(): void;
|
|
560
|
+
dispose(): void;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
export declare class FallbackRenderer {
|
|
564
|
+
constructor(canvas: HTMLCanvasElement, preset: CapsulePreset, options?: { dprCap?: number });
|
|
565
|
+
draw(elapsedSeconds: number): void;
|
|
566
|
+
setPreset(preset: CapsulePreset): void;
|
|
567
|
+
setDprCap(cap: number): void;
|
|
568
|
+
resize(): void;
|
|
569
|
+
dispose(): void;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
export declare class ProgressFlowRenderer {
|
|
573
|
+
constructor(canvas: HTMLCanvasElement, preset: ProgressPreset, options?: {
|
|
574
|
+
powerPreference?: PowerPreference;
|
|
575
|
+
onContextLost?: (event: Event) => void;
|
|
576
|
+
onContextRestored?: () => void;
|
|
577
|
+
});
|
|
578
|
+
draw(time: number, progress: number, effectImage?: CanvasImageSource | null): void;
|
|
579
|
+
resize(width: number, height: number, dpr: number): void;
|
|
580
|
+
dispose(): void;
|
|
581
|
+
}
|