@5even7/dlc-ui 0.2.16 → 0.2.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5even7/dlc-ui",
3
- "version": "0.2.16",
3
+ "version": "0.2.17",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
package/types/emo.d.ts CHANGED
@@ -3,9 +3,12 @@ export {
3
3
  EmoPreset,
4
4
  EmoTypeDefinition,
5
5
  EmoController,
6
+ MiaoPartColors,
7
+ MiaoPartColorKey,
6
8
  EMO_TYPES,
7
9
  EMO_PRESETS,
8
10
  EMO_CATEGORIES,
9
11
  getEmoPreset,
12
+ getEmoAnimation,
10
13
  createEmo
11
14
  } from './index.js';
package/types/index.d.ts CHANGED
@@ -2,6 +2,31 @@ export type Quality = 'auto' | 'low' | 'medium' | 'high';
2
2
  export type PowerPreference = 'default' | 'high-performance' | 'low-power';
3
3
  export type ColorTuple = [string, string, string, string];
4
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
+
5
30
  export interface CapsulePreset {
6
31
  id: string;
7
32
  code: string;
@@ -40,7 +65,7 @@ export interface EmoTypeDefinition {
40
65
  type: string;
41
66
  label: string;
42
67
  names: string[];
43
- colorChannels: Array<'color' | 'accentColor'>;
68
+ partColors: string[];
44
69
  }
45
70
 
46
71
  export interface Copy {
@@ -134,8 +159,7 @@ export interface EmoOptions {
134
159
  name?: string;
135
160
  width?: number | string;
136
161
  height?: number | string;
137
- color?: string;
138
- accentColor?: string | null;
162
+ partColors?: MiaoPartColors;
139
163
  speed?: number;
140
164
  loop?: boolean;
141
165
  autoplay?: boolean;
@@ -279,7 +303,7 @@ export interface EmoController extends Emitter {
279
303
  setSegment(value: EmoOptions['segment']): this;
280
304
  setName(value: string): this;
281
305
  setType(value: string): this;
282
- setColors(color: string, accentColor?: string | null): this;
306
+ setPartColors(value: MiaoPartColors): this;
283
307
  setOpacity(value: number): this;
284
308
  setBackground(value: string): this;
285
309
  setSize(width?: number | string, height?: number | string): this;
@@ -298,8 +322,7 @@ export interface EmoController extends Emitter {
298
322
  readonly renderer: 'svg' | 'canvas';
299
323
  readonly paused: boolean;
300
324
  readonly segment: [number, number] | null;
301
- readonly color: string;
302
- readonly accentColor: string | null;
325
+ readonly partColors: MiaoPartColors;
303
326
  readonly background: string;
304
327
  }
305
328
 
@@ -336,11 +359,12 @@ export declare const EMO_TYPES: EmoTypeDefinition[];
336
359
  export declare const EMO_PRESETS: EmoPreset[];
337
360
  export declare const EMO_CATEGORIES: Record<string, string>;
338
361
  export declare function getEmoPreset(type?: string, name?: string): EmoPreset;
362
+ export declare function getEmoAnimation(type?: string, name?: string): any;
339
363
 
340
364
  export declare const DEFAULTS: {
341
365
  capsule: Required<Pick<CapsuleOptions, 'width' | 'height' | 'quality' | 'respectReducedMotion' | 'mouseColor' | 'renderer' | 'textRatio' | 'renderScale' | 'powerPreference' | 'fps' | 'paused' | 'static'>>;
342
366
  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'>>;
343
- emo: Required<Pick<EmoOptions, 'type' | 'name' | 'width' | 'height' | 'color' | 'speed' | 'loop' | 'autoplay' | 'direction' | 'opacity' | 'fit' | 'renderer' | 'paused' | 'background' | 'respectReducedMotion'>> & Pick<EmoOptions, 'accentColor' | 'segment'>;
367
+ emo: Required<Pick<EmoOptions, 'type' | 'name' | 'width' | 'height' | 'partColors' | 'speed' | 'loop' | 'autoplay' | 'direction' | 'opacity' | 'fit' | 'renderer' | 'paused' | 'background' | 'respectReducedMotion'>> & Pick<EmoOptions, 'segment'>;
344
368
  };
345
369
 
346
370
  export declare const COPY: Copy;
package/types/vue3.d.ts CHANGED
@@ -110,7 +110,7 @@ export interface EmoComponent {
110
110
  setSegment(value: EmoOptions['segment']): any;
111
111
  setName(value: string): any;
112
112
  setType(value: string): any;
113
- setColors(color: string, accentColor?: string | null): any;
113
+ setPartColors(value: import('./index').MiaoPartColors): any;
114
114
  setOpacity(value: number): any;
115
115
  setBackground(value: string): any;
116
116
  setSize(width?: number | string, height?: number | string): any;