hanc-webrtc-widgets 2.0.0 → 2.0.2

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.
@@ -1,5 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
- import { ThemeName, VisualStyle, WidgetPosition } from '../../types/config';
2
+ import { ThemeName, VisualStyle, WidgetPosition, ButtonPosition } from '../../types/config';
3
3
  export declare class FloatingCall extends LitElement {
4
4
  static styles: import('lit').CSSResult[];
5
5
  private callManager;
@@ -12,22 +12,54 @@ export declare class FloatingCall extends LitElement {
12
12
  offsetX: number;
13
13
  offsetY: number;
14
14
  orbSize: number;
15
+ orbColor?: string;
16
+ orbColorLight?: string;
17
+ orbColorDark?: string;
18
+ hideButton: boolean;
19
+ buttonPosition: ButtonPosition;
20
+ activeOrbColor?: string;
21
+ activeOrbColorLight?: string;
22
+ activeOrbColorDark?: string;
23
+ buttonColor?: string;
24
+ buttonHoverColor?: string;
25
+ buttonActiveColor?: string;
26
+ buttonTextColor?: string;
15
27
  minimized: boolean;
16
28
  private callStatus;
29
+ private prefersLightScheme;
30
+ private colorSchemeQuery;
17
31
  private renderer;
18
32
  private audioSimTimer;
33
+ private audioSimFrameId;
34
+ private audioSimPhase;
19
35
  private simulatedTargetLevel;
20
36
  private simulatedCurrentLevel;
37
+ private baseColors;
38
+ private themeColors;
39
+ private baseAnimation;
21
40
  private get callState();
22
41
  labelText: string;
23
42
  buttonStartText: string;
24
43
  buttonConnectingText: string;
25
44
  buttonEndText: string;
45
+ private handleColorSchemeChange;
26
46
  connectedCallback(): void;
27
47
  disconnectedCallback(): void;
28
48
  updated(changedProperties: Map<string | number | symbol, unknown>): void;
29
49
  firstUpdated(): void;
30
50
  private setupRenderer;
51
+ private setupColorSchemeListener;
52
+ private teardownColorSchemeListener;
53
+ private clamp;
54
+ private resolveColorValue;
55
+ private buildOrbPalette;
56
+ private getBaseOrbColors;
57
+ private getActiveSeedColor;
58
+ private getActiveColors;
59
+ private getButtonColors;
60
+ private updateButtonThemeVars;
61
+ private getAnimationForState;
62
+ private syncOrbAppearance;
31
63
  private handleStatusChange;
32
64
  /**
33
65
  * Audio animation (MVP): simulate audio level while connected.
@@ -1,5 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
- import { ThemeName, VisualStyle } from '../../types/config';
2
+ import { ThemeName, VisualStyle, ButtonPosition } from '../../types/config';
3
3
  export declare class InlineCall extends LitElement {
4
4
  static styles: import('lit').CSSResult[];
5
5
  private callManager;
@@ -9,20 +9,53 @@ export declare class InlineCall extends LitElement {
9
9
  theme: ThemeName | 'custom';
10
10
  visualStyle: VisualStyle;
11
11
  orbSize: number;
12
+ orbColor?: string;
13
+ orbColorLight?: string;
14
+ orbColorDark?: string;
15
+ hideButton: boolean;
16
+ buttonPosition: ButtonPosition;
17
+ activeOrbColor?: string;
18
+ activeOrbColorLight?: string;
19
+ activeOrbColorDark?: string;
20
+ buttonColor?: string;
21
+ buttonHoverColor?: string;
22
+ buttonActiveColor?: string;
23
+ buttonTextColor?: string;
12
24
  private callStatus;
25
+ private prefersLightScheme;
26
+ private colorSchemeQuery;
13
27
  private renderer;
14
28
  private audioSimTimer;
29
+ private audioSimFrameId;
30
+ private audioSimPhase;
15
31
  private simulatedTargetLevel;
16
32
  private simulatedCurrentLevel;
33
+ private baseColors;
34
+ private themeColors;
35
+ private baseAnimation;
17
36
  private get callState();
18
37
  buttonStartText: string;
19
38
  buttonConnectingText: string;
20
39
  buttonEndText: string;
40
+ private handleColorSchemeChange;
21
41
  connectedCallback(): void;
22
42
  disconnectedCallback(): void;
23
43
  updated(changedProperties: Map<string | number | symbol, unknown>): void;
24
44
  firstUpdated(): void;
25
45
  private setupRenderer;
46
+ private setupColorSchemeListener;
47
+ private teardownColorSchemeListener;
48
+ private clamp;
49
+ private resolveColorValue;
50
+ private buildOrbPalette;
51
+ private getBaseOrbColors;
52
+ private getActiveSeedColor;
53
+ private getActiveColors;
54
+ private getButtonColors;
55
+ private updateButtonThemeVars;
56
+ private getAnimationForState;
57
+ private syncOrbAppearance;
58
+ private applyNeuralNetworkTuning;
26
59
  private startAudioSimulation;
27
60
  private stopAudioSimulation;
28
61
  private handleStatusChange;
@@ -0,0 +1,3 @@
1
+ export declare function getRelativeLuminance(color: string): number | null;
2
+ export declare function blendColors(base: string, target: string, ratio: number): string;
3
+ export declare function colorWithAlpha(color: string, alpha: number): string;
@@ -9,12 +9,16 @@ export declare abstract class BaseRenderer {
9
9
  protected centerX: number;
10
10
  protected centerY: number;
11
11
  protected colors: ColorConfig;
12
+ protected targetColors: ColorConfig;
12
13
  protected animation: AnimationConfig;
14
+ protected colorTransitionSpeed: number;
13
15
  protected time: number;
14
16
  protected audioLevel: number;
15
17
  protected targetAudioLevel: number;
16
18
  protected isActive: boolean;
17
19
  protected animationId: number | null;
20
+ protected lastFrameTime: number | null;
21
+ protected frameDelta: number;
18
22
  constructor(canvas: HTMLCanvasElement, size: number, colors: ColorConfig, animation: AnimationConfig);
19
23
  /**
20
24
  * Setup canvas with device pixel ratio
@@ -47,7 +51,7 @@ export declare abstract class BaseRenderer {
47
51
  /**
48
52
  * Animation loop
49
53
  */
50
- protected animate: () => void;
54
+ protected animate: (timestamp: number) => void;
51
55
  /**
52
56
  * Update state
53
57
  */
@@ -76,4 +80,9 @@ export declare abstract class BaseRenderer {
76
80
  * Cleanup
77
81
  */
78
82
  destroy(): void;
83
+ /**
84
+ * Reset transient animation state so repeated sessions feel consistent.
85
+ */
86
+ resetDynamics(): void;
87
+ protected updateColors(): void;
79
88
  }
@@ -5,11 +5,21 @@ import { ColorConfig, AnimationConfig } from '../types/config';
5
5
  */
6
6
  export declare class NeuralNetworkRenderer extends BaseRenderer {
7
7
  private nodes;
8
+ private thicknessScale;
9
+ private glowRadiusScale;
10
+ private activeBlend;
8
11
  constructor(canvas: HTMLCanvasElement, size: number, colors: ColorConfig, animation: AnimationConfig);
12
+ setThicknessScale(scale: number): void;
13
+ setGlowRadiusScale(scale: number): void;
14
+ resetDynamics(): void;
9
15
  private initNetwork;
10
16
  private createNode;
11
17
  protected render(): void;
18
+ protected update(): void;
19
+ protected getSpeedMultiplier(activeBlend?: number): number;
12
20
  private updateNodes;
13
21
  private drawConnections;
14
22
  private drawNodes;
23
+ private getGlowScale;
24
+ private applyEdgeFade;
15
25
  }
@@ -10,6 +10,10 @@ export type AnimationIntensity = 'low' | 'medium' | 'high';
10
10
  * Widget position for floating variant
11
11
  */
12
12
  export type WidgetPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
13
+ /**
14
+ * Button position within widget layouts
15
+ */
16
+ export type ButtonPosition = 'top' | 'bottom';
13
17
  /**
14
18
  * Call state
15
19
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hanc-webrtc-widgets",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "type": "module",
5
5
  "main": "dist/hanc-webrtc-widgets.umd.js",
6
6
  "module": "dist/hanc-webrtc-widgets.es.js",