@kibee/renderer-three 0.1.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/dist/index.d.mts +278 -0
- package/dist/index.d.ts +278 -0
- package/dist/index.js +1913 -0
- package/dist/index.mjs +1875 -0
- package/dist/styles.css +739 -0
- package/package.json +31 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { DockPositionConfig } from '@kibee/contracts';
|
|
2
|
+
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
3
|
+
|
|
4
|
+
type BeeVisualState = "idle" | "guiding" | "thinking" | "celebrating";
|
|
5
|
+
type BeeAssetVariant = "hero" | "runtime";
|
|
6
|
+
type BeeQualityTier = "auto" | "high" | "balanced" | "low";
|
|
7
|
+
type BeeMotionMode = "auto" | "full" | "reduced";
|
|
8
|
+
|
|
9
|
+
type BeeDockPosition = DockPositionConfig;
|
|
10
|
+
type BeeDockVariant = "hive";
|
|
11
|
+
/** undock: classic wake behavior. assist-panel: emit kibee-assist-toggle, stay docked. */
|
|
12
|
+
type BeeDockClickBehavior = "undock" | "assist-panel";
|
|
13
|
+
interface MoveToOptions {
|
|
14
|
+
duration?: number;
|
|
15
|
+
offsetX?: number;
|
|
16
|
+
offsetY?: number;
|
|
17
|
+
}
|
|
18
|
+
/** Which edge of the tooltip box holds the notch toward the bee */
|
|
19
|
+
type TooltipArrowEdge = "left" | "right" | "top" | "bottom";
|
|
20
|
+
interface SpeakOptions {
|
|
21
|
+
x?: number;
|
|
22
|
+
y?: number;
|
|
23
|
+
maxWidth?: number;
|
|
24
|
+
/** When x/y are set, positions the speech notch on this side of the bubble */
|
|
25
|
+
arrowEdge?: TooltipArrowEdge;
|
|
26
|
+
/** Called when user clicks the Previous button. Omit or set null to hide the button. */
|
|
27
|
+
onPrev?: (() => void) | null;
|
|
28
|
+
/** Called when user clicks the Next button. Omit or set null to hide the button. */
|
|
29
|
+
onNext?: (() => void) | null;
|
|
30
|
+
/** Step label shown between the nav buttons, e.g. "2 / 5" */
|
|
31
|
+
stepLabel?: string;
|
|
32
|
+
}
|
|
33
|
+
interface DockMotionOptions {
|
|
34
|
+
hideDock?: boolean;
|
|
35
|
+
}
|
|
36
|
+
interface ThreeBeeRendererOptions {
|
|
37
|
+
assetUrl?: string;
|
|
38
|
+
assetVariant?: BeeAssetVariant;
|
|
39
|
+
qualityTier?: BeeQualityTier;
|
|
40
|
+
enableShadows?: boolean;
|
|
41
|
+
motionMode?: BeeMotionMode;
|
|
42
|
+
dockEnabled?: boolean;
|
|
43
|
+
dockPosition?: BeeDockPosition;
|
|
44
|
+
dockSize?: number;
|
|
45
|
+
dockVariant?: BeeDockVariant;
|
|
46
|
+
dockClickBehavior?: BeeDockClickBehavior;
|
|
47
|
+
/**
|
|
48
|
+
* When false, skip reading/writing `kibee:dock_pos` in localStorage (e.g. browser extensions
|
|
49
|
+
* on third-party origins should not inherit or pollute saved dock positions).
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
52
|
+
restorePersistedDockPosition?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/** Options for `ThreeBeeRenderer#setCustomDockPosition`. */
|
|
55
|
+
type SetCustomDockPositionOptions = {
|
|
56
|
+
/** When false, do not persist to localStorage. @default true */
|
|
57
|
+
persist?: boolean;
|
|
58
|
+
};
|
|
59
|
+
type BeeActionChoice = "honey" | "sting";
|
|
60
|
+
interface BeeActionHandler {
|
|
61
|
+
(choice: BeeActionChoice): void;
|
|
62
|
+
}
|
|
63
|
+
interface PromptOptions {
|
|
64
|
+
placeholder?: string;
|
|
65
|
+
}
|
|
66
|
+
interface BeeRenderer {
|
|
67
|
+
mount(container?: HTMLElement): Promise<void>;
|
|
68
|
+
moveTo(x: number, y: number, options?: MoveToOptions): Promise<void>;
|
|
69
|
+
dock(options?: DockMotionOptions): Promise<void>;
|
|
70
|
+
undock(options?: DockMotionOptions): Promise<void>;
|
|
71
|
+
isDocked(): boolean;
|
|
72
|
+
setState(state: BeeVisualState): void;
|
|
73
|
+
speak(message: string, options?: SpeakOptions): void;
|
|
74
|
+
/** Inline 1-2 line note prompt; resolves to the note string, "" if user pressed Save with empty input, or null if they skipped. */
|
|
75
|
+
prompt(message: string, options?: PromptOptions): Promise<string | null>;
|
|
76
|
+
hideMessage(): void;
|
|
77
|
+
showActions(handler: BeeActionHandler): void;
|
|
78
|
+
hideActions(): void;
|
|
79
|
+
resize(): void;
|
|
80
|
+
setDockClickBehavior(mode: BeeDockClickBehavior): void;
|
|
81
|
+
getDockScreenPosition(): {
|
|
82
|
+
x: number;
|
|
83
|
+
y: number;
|
|
84
|
+
};
|
|
85
|
+
/** Current bee viewport coords + dock state. Used by host UIs to anchor
|
|
86
|
+
* panels / context capture without subscribing to kibee-bee-move. */
|
|
87
|
+
getBeePosition(): {
|
|
88
|
+
x: number;
|
|
89
|
+
y: number;
|
|
90
|
+
docked: boolean;
|
|
91
|
+
};
|
|
92
|
+
destroy(): void;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
declare class ThreeBeeRenderer implements BeeRenderer {
|
|
96
|
+
private options;
|
|
97
|
+
private root;
|
|
98
|
+
private canvasWrap;
|
|
99
|
+
private tooltip;
|
|
100
|
+
private hoverZone;
|
|
101
|
+
private dockButton;
|
|
102
|
+
private scene;
|
|
103
|
+
private camera;
|
|
104
|
+
private renderer;
|
|
105
|
+
private beeGroup;
|
|
106
|
+
private visualRig;
|
|
107
|
+
private mixer;
|
|
108
|
+
private actions;
|
|
109
|
+
private activeActionName;
|
|
110
|
+
private runtimeWings;
|
|
111
|
+
private mounted;
|
|
112
|
+
/** Deduplicates concurrent mount() calls (React Strict Mode, double init, etc.) */
|
|
113
|
+
private mountPromise;
|
|
114
|
+
private disposed;
|
|
115
|
+
private animationFrameId;
|
|
116
|
+
private clock;
|
|
117
|
+
private state;
|
|
118
|
+
private currentX;
|
|
119
|
+
private currentY;
|
|
120
|
+
private currentFacing;
|
|
121
|
+
private docked;
|
|
122
|
+
private dockVisible;
|
|
123
|
+
private hoveringHome;
|
|
124
|
+
private reducedMotion;
|
|
125
|
+
private renderingAvailable;
|
|
126
|
+
private idleTween;
|
|
127
|
+
private celebrateTween;
|
|
128
|
+
private tooltipPulseTimer;
|
|
129
|
+
private tooltipMessage;
|
|
130
|
+
private actionHandler;
|
|
131
|
+
private dockClickBehavior;
|
|
132
|
+
private autoDockTimer;
|
|
133
|
+
private customDockPos;
|
|
134
|
+
private radialButtons;
|
|
135
|
+
private isDragging;
|
|
136
|
+
private dragStartX;
|
|
137
|
+
private dragStartY;
|
|
138
|
+
private dragMoved;
|
|
139
|
+
/** Pointer went down while docked — used to distinguish dock tap vs drag-out */
|
|
140
|
+
private dragArmedFromDock;
|
|
141
|
+
private hideButtonsTimer;
|
|
142
|
+
private panelOpen;
|
|
143
|
+
/** When false, constructor skips LS restore and setCustomDockPosition skips LS writes by default. */
|
|
144
|
+
private readonly restorePersistedDockPosition;
|
|
145
|
+
private tooltipText;
|
|
146
|
+
private tooltipNav;
|
|
147
|
+
private navPrevBtn;
|
|
148
|
+
private navLabel;
|
|
149
|
+
private navNextBtn;
|
|
150
|
+
private tooltipHasNav;
|
|
151
|
+
private tooltipPrompt;
|
|
152
|
+
private tooltipPromptInput;
|
|
153
|
+
private tooltipPromptSaveBtn;
|
|
154
|
+
private tooltipPromptSkipBtn;
|
|
155
|
+
private tooltipPromptHint;
|
|
156
|
+
private tooltipPromptActive;
|
|
157
|
+
private readonly tooltipPromptMaxLen;
|
|
158
|
+
constructor(options?: ThreeBeeRendererOptions);
|
|
159
|
+
mount(container?: HTMLElement): Promise<void>;
|
|
160
|
+
private performMount;
|
|
161
|
+
moveTo(x: number, y: number, options?: MoveToOptions): Promise<void>;
|
|
162
|
+
dock(): Promise<void>;
|
|
163
|
+
private resetAutoDockTimer;
|
|
164
|
+
private clearAutoDockTimer;
|
|
165
|
+
undock(options?: DockMotionOptions): Promise<void>;
|
|
166
|
+
isDocked(): boolean;
|
|
167
|
+
setState(state: BeeVisualState): void;
|
|
168
|
+
speak(message: string, options?: SpeakOptions): void;
|
|
169
|
+
hideMessage(): void;
|
|
170
|
+
/**
|
|
171
|
+
* Show an inline 1-2 line prompt inside the bee's speech bubble. Used by
|
|
172
|
+
* the bookmark + issue chips to capture a short note before saving.
|
|
173
|
+
* Resolves to the user's note (trimmed) or null if they skipped / dismissed.
|
|
174
|
+
*/
|
|
175
|
+
prompt(message: string, options?: {
|
|
176
|
+
placeholder?: string;
|
|
177
|
+
}): Promise<string | null>;
|
|
178
|
+
/** Swap the prompt's bottom-left hint between the keyboard hint (when empty)
|
|
179
|
+
* and a tabular char counter (once the user starts typing). */
|
|
180
|
+
private updatePromptHint;
|
|
181
|
+
private inferTooltipArrowEdgeForPlacedTooltip;
|
|
182
|
+
showActions(handler: BeeActionHandler): void;
|
|
183
|
+
hideActions(): void;
|
|
184
|
+
resize(): void;
|
|
185
|
+
setDockClickBehavior(mode: BeeDockClickBehavior): void;
|
|
186
|
+
destroy(): void;
|
|
187
|
+
private createRoot;
|
|
188
|
+
private createScene;
|
|
189
|
+
private createCamera;
|
|
190
|
+
private createRenderer;
|
|
191
|
+
private createLights;
|
|
192
|
+
private loadBeeModel;
|
|
193
|
+
private createFallbackBee;
|
|
194
|
+
private initializeDockedHome;
|
|
195
|
+
private startRenderLoop;
|
|
196
|
+
private updateBeeScreenPosition;
|
|
197
|
+
/**
|
|
198
|
+
* Notify any listeners (the assist panel, debugging overlays) where the
|
|
199
|
+
* bee currently sits in viewport coords. Throttled to ~60fps via the
|
|
200
|
+
* existing render loop — every callsite that moves the bee already calls
|
|
201
|
+
* updateBeeScreenPosition, so this rides along with no extra timer.
|
|
202
|
+
*/
|
|
203
|
+
private publishBeePosition;
|
|
204
|
+
/** Public position read for callers that prefer pull over event subscription. */
|
|
205
|
+
getBeePosition(): {
|
|
206
|
+
x: number;
|
|
207
|
+
y: number;
|
|
208
|
+
docked: boolean;
|
|
209
|
+
};
|
|
210
|
+
private startIdleMotion;
|
|
211
|
+
private startThinkingMotion;
|
|
212
|
+
private startCelebrateMotion;
|
|
213
|
+
private stopStateTweens;
|
|
214
|
+
private positionTooltipNearBee;
|
|
215
|
+
/**
|
|
216
|
+
* Compute viewport-aware radial positions for radial action buttons and the
|
|
217
|
+
* tooltip. All returned coordinates are CSS `left`/`top` pixel values.
|
|
218
|
+
* The tooltip's `top` value is the *rendered center Y* (because CSS applies
|
|
219
|
+
* `transform: translate(0, -50%)` to the tooltip element).
|
|
220
|
+
*/
|
|
221
|
+
private computeRadialLayout;
|
|
222
|
+
private showRadialButtons;
|
|
223
|
+
private hideRadialButtons;
|
|
224
|
+
private positionHoverZone;
|
|
225
|
+
private startTooltipPulse;
|
|
226
|
+
private clearTooltipPulse;
|
|
227
|
+
private handleBeeHoverEnter;
|
|
228
|
+
private handleBeeHoverLeave;
|
|
229
|
+
private scheduleHideButtons;
|
|
230
|
+
private clearHideButtonsTimer;
|
|
231
|
+
/** Instant undock used when the user drags the bee off the dock / launcher */
|
|
232
|
+
private fastUndockForDrag;
|
|
233
|
+
private handlePointerDown;
|
|
234
|
+
private handlePointerMove;
|
|
235
|
+
private handlePointerUp;
|
|
236
|
+
private handleResize;
|
|
237
|
+
private handleVisibilityChange;
|
|
238
|
+
private handlePanelOpen;
|
|
239
|
+
private handlePanelClose;
|
|
240
|
+
private handleDockClick;
|
|
241
|
+
private updateDockAria;
|
|
242
|
+
private shouldReduceMotion;
|
|
243
|
+
private resolvePixelRatioCap;
|
|
244
|
+
private playClipForState;
|
|
245
|
+
private getClipTimeScale;
|
|
246
|
+
private applyFacing;
|
|
247
|
+
private applyHomeFacing;
|
|
248
|
+
private syncDockState;
|
|
249
|
+
private isDockEnabled;
|
|
250
|
+
setCustomDockPosition(x: number, y: number, opts?: SetCustomDockPositionOptions): void;
|
|
251
|
+
/**
|
|
252
|
+
* Snap the docked bee and dock chrome to the current `getDockCenter()` without a full resize.
|
|
253
|
+
* Use after `setCustomDockPosition` when the dock target moves (e.g. scroll-linked layout).
|
|
254
|
+
*/
|
|
255
|
+
refreshDockedBeeAfterDockMove(): void;
|
|
256
|
+
private getDockCenter;
|
|
257
|
+
private presetToCenter;
|
|
258
|
+
private resolveInlineCenter;
|
|
259
|
+
/** Returns true when the dock sits on the right half of the viewport */
|
|
260
|
+
private isDockOnRight;
|
|
261
|
+
/** Returns true when the dock sits on the bottom half of the viewport */
|
|
262
|
+
private isDockOnBottom;
|
|
263
|
+
private resolveDockCSSVars;
|
|
264
|
+
private getWakeHoverPosition;
|
|
265
|
+
getDockScreenPosition(): {
|
|
266
|
+
x: number;
|
|
267
|
+
y: number;
|
|
268
|
+
};
|
|
269
|
+
private getDockSize;
|
|
270
|
+
private getActiveScale;
|
|
271
|
+
private getDockedScale;
|
|
272
|
+
private getHomeHoverScale;
|
|
273
|
+
private disposeSceneObjects;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
declare function applyLegacyBeeMaterialCompat(gltf: GLTF): Promise<void>;
|
|
277
|
+
|
|
278
|
+
export { type BeeActionChoice, type BeeActionHandler, type BeeAssetVariant, type BeeDockClickBehavior, type BeeDockPosition, type BeeDockVariant, type BeeMotionMode, type BeeQualityTier, type BeeRenderer, type BeeVisualState, type DockMotionOptions, type MoveToOptions, type PromptOptions, type SetCustomDockPositionOptions, type SpeakOptions, ThreeBeeRenderer, type ThreeBeeRendererOptions, type TooltipArrowEdge, applyLegacyBeeMaterialCompat };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { DockPositionConfig } from '@kibee/contracts';
|
|
2
|
+
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
3
|
+
|
|
4
|
+
type BeeVisualState = "idle" | "guiding" | "thinking" | "celebrating";
|
|
5
|
+
type BeeAssetVariant = "hero" | "runtime";
|
|
6
|
+
type BeeQualityTier = "auto" | "high" | "balanced" | "low";
|
|
7
|
+
type BeeMotionMode = "auto" | "full" | "reduced";
|
|
8
|
+
|
|
9
|
+
type BeeDockPosition = DockPositionConfig;
|
|
10
|
+
type BeeDockVariant = "hive";
|
|
11
|
+
/** undock: classic wake behavior. assist-panel: emit kibee-assist-toggle, stay docked. */
|
|
12
|
+
type BeeDockClickBehavior = "undock" | "assist-panel";
|
|
13
|
+
interface MoveToOptions {
|
|
14
|
+
duration?: number;
|
|
15
|
+
offsetX?: number;
|
|
16
|
+
offsetY?: number;
|
|
17
|
+
}
|
|
18
|
+
/** Which edge of the tooltip box holds the notch toward the bee */
|
|
19
|
+
type TooltipArrowEdge = "left" | "right" | "top" | "bottom";
|
|
20
|
+
interface SpeakOptions {
|
|
21
|
+
x?: number;
|
|
22
|
+
y?: number;
|
|
23
|
+
maxWidth?: number;
|
|
24
|
+
/** When x/y are set, positions the speech notch on this side of the bubble */
|
|
25
|
+
arrowEdge?: TooltipArrowEdge;
|
|
26
|
+
/** Called when user clicks the Previous button. Omit or set null to hide the button. */
|
|
27
|
+
onPrev?: (() => void) | null;
|
|
28
|
+
/** Called when user clicks the Next button. Omit or set null to hide the button. */
|
|
29
|
+
onNext?: (() => void) | null;
|
|
30
|
+
/** Step label shown between the nav buttons, e.g. "2 / 5" */
|
|
31
|
+
stepLabel?: string;
|
|
32
|
+
}
|
|
33
|
+
interface DockMotionOptions {
|
|
34
|
+
hideDock?: boolean;
|
|
35
|
+
}
|
|
36
|
+
interface ThreeBeeRendererOptions {
|
|
37
|
+
assetUrl?: string;
|
|
38
|
+
assetVariant?: BeeAssetVariant;
|
|
39
|
+
qualityTier?: BeeQualityTier;
|
|
40
|
+
enableShadows?: boolean;
|
|
41
|
+
motionMode?: BeeMotionMode;
|
|
42
|
+
dockEnabled?: boolean;
|
|
43
|
+
dockPosition?: BeeDockPosition;
|
|
44
|
+
dockSize?: number;
|
|
45
|
+
dockVariant?: BeeDockVariant;
|
|
46
|
+
dockClickBehavior?: BeeDockClickBehavior;
|
|
47
|
+
/**
|
|
48
|
+
* When false, skip reading/writing `kibee:dock_pos` in localStorage (e.g. browser extensions
|
|
49
|
+
* on third-party origins should not inherit or pollute saved dock positions).
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
52
|
+
restorePersistedDockPosition?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/** Options for `ThreeBeeRenderer#setCustomDockPosition`. */
|
|
55
|
+
type SetCustomDockPositionOptions = {
|
|
56
|
+
/** When false, do not persist to localStorage. @default true */
|
|
57
|
+
persist?: boolean;
|
|
58
|
+
};
|
|
59
|
+
type BeeActionChoice = "honey" | "sting";
|
|
60
|
+
interface BeeActionHandler {
|
|
61
|
+
(choice: BeeActionChoice): void;
|
|
62
|
+
}
|
|
63
|
+
interface PromptOptions {
|
|
64
|
+
placeholder?: string;
|
|
65
|
+
}
|
|
66
|
+
interface BeeRenderer {
|
|
67
|
+
mount(container?: HTMLElement): Promise<void>;
|
|
68
|
+
moveTo(x: number, y: number, options?: MoveToOptions): Promise<void>;
|
|
69
|
+
dock(options?: DockMotionOptions): Promise<void>;
|
|
70
|
+
undock(options?: DockMotionOptions): Promise<void>;
|
|
71
|
+
isDocked(): boolean;
|
|
72
|
+
setState(state: BeeVisualState): void;
|
|
73
|
+
speak(message: string, options?: SpeakOptions): void;
|
|
74
|
+
/** Inline 1-2 line note prompt; resolves to the note string, "" if user pressed Save with empty input, or null if they skipped. */
|
|
75
|
+
prompt(message: string, options?: PromptOptions): Promise<string | null>;
|
|
76
|
+
hideMessage(): void;
|
|
77
|
+
showActions(handler: BeeActionHandler): void;
|
|
78
|
+
hideActions(): void;
|
|
79
|
+
resize(): void;
|
|
80
|
+
setDockClickBehavior(mode: BeeDockClickBehavior): void;
|
|
81
|
+
getDockScreenPosition(): {
|
|
82
|
+
x: number;
|
|
83
|
+
y: number;
|
|
84
|
+
};
|
|
85
|
+
/** Current bee viewport coords + dock state. Used by host UIs to anchor
|
|
86
|
+
* panels / context capture without subscribing to kibee-bee-move. */
|
|
87
|
+
getBeePosition(): {
|
|
88
|
+
x: number;
|
|
89
|
+
y: number;
|
|
90
|
+
docked: boolean;
|
|
91
|
+
};
|
|
92
|
+
destroy(): void;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
declare class ThreeBeeRenderer implements BeeRenderer {
|
|
96
|
+
private options;
|
|
97
|
+
private root;
|
|
98
|
+
private canvasWrap;
|
|
99
|
+
private tooltip;
|
|
100
|
+
private hoverZone;
|
|
101
|
+
private dockButton;
|
|
102
|
+
private scene;
|
|
103
|
+
private camera;
|
|
104
|
+
private renderer;
|
|
105
|
+
private beeGroup;
|
|
106
|
+
private visualRig;
|
|
107
|
+
private mixer;
|
|
108
|
+
private actions;
|
|
109
|
+
private activeActionName;
|
|
110
|
+
private runtimeWings;
|
|
111
|
+
private mounted;
|
|
112
|
+
/** Deduplicates concurrent mount() calls (React Strict Mode, double init, etc.) */
|
|
113
|
+
private mountPromise;
|
|
114
|
+
private disposed;
|
|
115
|
+
private animationFrameId;
|
|
116
|
+
private clock;
|
|
117
|
+
private state;
|
|
118
|
+
private currentX;
|
|
119
|
+
private currentY;
|
|
120
|
+
private currentFacing;
|
|
121
|
+
private docked;
|
|
122
|
+
private dockVisible;
|
|
123
|
+
private hoveringHome;
|
|
124
|
+
private reducedMotion;
|
|
125
|
+
private renderingAvailable;
|
|
126
|
+
private idleTween;
|
|
127
|
+
private celebrateTween;
|
|
128
|
+
private tooltipPulseTimer;
|
|
129
|
+
private tooltipMessage;
|
|
130
|
+
private actionHandler;
|
|
131
|
+
private dockClickBehavior;
|
|
132
|
+
private autoDockTimer;
|
|
133
|
+
private customDockPos;
|
|
134
|
+
private radialButtons;
|
|
135
|
+
private isDragging;
|
|
136
|
+
private dragStartX;
|
|
137
|
+
private dragStartY;
|
|
138
|
+
private dragMoved;
|
|
139
|
+
/** Pointer went down while docked — used to distinguish dock tap vs drag-out */
|
|
140
|
+
private dragArmedFromDock;
|
|
141
|
+
private hideButtonsTimer;
|
|
142
|
+
private panelOpen;
|
|
143
|
+
/** When false, constructor skips LS restore and setCustomDockPosition skips LS writes by default. */
|
|
144
|
+
private readonly restorePersistedDockPosition;
|
|
145
|
+
private tooltipText;
|
|
146
|
+
private tooltipNav;
|
|
147
|
+
private navPrevBtn;
|
|
148
|
+
private navLabel;
|
|
149
|
+
private navNextBtn;
|
|
150
|
+
private tooltipHasNav;
|
|
151
|
+
private tooltipPrompt;
|
|
152
|
+
private tooltipPromptInput;
|
|
153
|
+
private tooltipPromptSaveBtn;
|
|
154
|
+
private tooltipPromptSkipBtn;
|
|
155
|
+
private tooltipPromptHint;
|
|
156
|
+
private tooltipPromptActive;
|
|
157
|
+
private readonly tooltipPromptMaxLen;
|
|
158
|
+
constructor(options?: ThreeBeeRendererOptions);
|
|
159
|
+
mount(container?: HTMLElement): Promise<void>;
|
|
160
|
+
private performMount;
|
|
161
|
+
moveTo(x: number, y: number, options?: MoveToOptions): Promise<void>;
|
|
162
|
+
dock(): Promise<void>;
|
|
163
|
+
private resetAutoDockTimer;
|
|
164
|
+
private clearAutoDockTimer;
|
|
165
|
+
undock(options?: DockMotionOptions): Promise<void>;
|
|
166
|
+
isDocked(): boolean;
|
|
167
|
+
setState(state: BeeVisualState): void;
|
|
168
|
+
speak(message: string, options?: SpeakOptions): void;
|
|
169
|
+
hideMessage(): void;
|
|
170
|
+
/**
|
|
171
|
+
* Show an inline 1-2 line prompt inside the bee's speech bubble. Used by
|
|
172
|
+
* the bookmark + issue chips to capture a short note before saving.
|
|
173
|
+
* Resolves to the user's note (trimmed) or null if they skipped / dismissed.
|
|
174
|
+
*/
|
|
175
|
+
prompt(message: string, options?: {
|
|
176
|
+
placeholder?: string;
|
|
177
|
+
}): Promise<string | null>;
|
|
178
|
+
/** Swap the prompt's bottom-left hint between the keyboard hint (when empty)
|
|
179
|
+
* and a tabular char counter (once the user starts typing). */
|
|
180
|
+
private updatePromptHint;
|
|
181
|
+
private inferTooltipArrowEdgeForPlacedTooltip;
|
|
182
|
+
showActions(handler: BeeActionHandler): void;
|
|
183
|
+
hideActions(): void;
|
|
184
|
+
resize(): void;
|
|
185
|
+
setDockClickBehavior(mode: BeeDockClickBehavior): void;
|
|
186
|
+
destroy(): void;
|
|
187
|
+
private createRoot;
|
|
188
|
+
private createScene;
|
|
189
|
+
private createCamera;
|
|
190
|
+
private createRenderer;
|
|
191
|
+
private createLights;
|
|
192
|
+
private loadBeeModel;
|
|
193
|
+
private createFallbackBee;
|
|
194
|
+
private initializeDockedHome;
|
|
195
|
+
private startRenderLoop;
|
|
196
|
+
private updateBeeScreenPosition;
|
|
197
|
+
/**
|
|
198
|
+
* Notify any listeners (the assist panel, debugging overlays) where the
|
|
199
|
+
* bee currently sits in viewport coords. Throttled to ~60fps via the
|
|
200
|
+
* existing render loop — every callsite that moves the bee already calls
|
|
201
|
+
* updateBeeScreenPosition, so this rides along with no extra timer.
|
|
202
|
+
*/
|
|
203
|
+
private publishBeePosition;
|
|
204
|
+
/** Public position read for callers that prefer pull over event subscription. */
|
|
205
|
+
getBeePosition(): {
|
|
206
|
+
x: number;
|
|
207
|
+
y: number;
|
|
208
|
+
docked: boolean;
|
|
209
|
+
};
|
|
210
|
+
private startIdleMotion;
|
|
211
|
+
private startThinkingMotion;
|
|
212
|
+
private startCelebrateMotion;
|
|
213
|
+
private stopStateTweens;
|
|
214
|
+
private positionTooltipNearBee;
|
|
215
|
+
/**
|
|
216
|
+
* Compute viewport-aware radial positions for radial action buttons and the
|
|
217
|
+
* tooltip. All returned coordinates are CSS `left`/`top` pixel values.
|
|
218
|
+
* The tooltip's `top` value is the *rendered center Y* (because CSS applies
|
|
219
|
+
* `transform: translate(0, -50%)` to the tooltip element).
|
|
220
|
+
*/
|
|
221
|
+
private computeRadialLayout;
|
|
222
|
+
private showRadialButtons;
|
|
223
|
+
private hideRadialButtons;
|
|
224
|
+
private positionHoverZone;
|
|
225
|
+
private startTooltipPulse;
|
|
226
|
+
private clearTooltipPulse;
|
|
227
|
+
private handleBeeHoverEnter;
|
|
228
|
+
private handleBeeHoverLeave;
|
|
229
|
+
private scheduleHideButtons;
|
|
230
|
+
private clearHideButtonsTimer;
|
|
231
|
+
/** Instant undock used when the user drags the bee off the dock / launcher */
|
|
232
|
+
private fastUndockForDrag;
|
|
233
|
+
private handlePointerDown;
|
|
234
|
+
private handlePointerMove;
|
|
235
|
+
private handlePointerUp;
|
|
236
|
+
private handleResize;
|
|
237
|
+
private handleVisibilityChange;
|
|
238
|
+
private handlePanelOpen;
|
|
239
|
+
private handlePanelClose;
|
|
240
|
+
private handleDockClick;
|
|
241
|
+
private updateDockAria;
|
|
242
|
+
private shouldReduceMotion;
|
|
243
|
+
private resolvePixelRatioCap;
|
|
244
|
+
private playClipForState;
|
|
245
|
+
private getClipTimeScale;
|
|
246
|
+
private applyFacing;
|
|
247
|
+
private applyHomeFacing;
|
|
248
|
+
private syncDockState;
|
|
249
|
+
private isDockEnabled;
|
|
250
|
+
setCustomDockPosition(x: number, y: number, opts?: SetCustomDockPositionOptions): void;
|
|
251
|
+
/**
|
|
252
|
+
* Snap the docked bee and dock chrome to the current `getDockCenter()` without a full resize.
|
|
253
|
+
* Use after `setCustomDockPosition` when the dock target moves (e.g. scroll-linked layout).
|
|
254
|
+
*/
|
|
255
|
+
refreshDockedBeeAfterDockMove(): void;
|
|
256
|
+
private getDockCenter;
|
|
257
|
+
private presetToCenter;
|
|
258
|
+
private resolveInlineCenter;
|
|
259
|
+
/** Returns true when the dock sits on the right half of the viewport */
|
|
260
|
+
private isDockOnRight;
|
|
261
|
+
/** Returns true when the dock sits on the bottom half of the viewport */
|
|
262
|
+
private isDockOnBottom;
|
|
263
|
+
private resolveDockCSSVars;
|
|
264
|
+
private getWakeHoverPosition;
|
|
265
|
+
getDockScreenPosition(): {
|
|
266
|
+
x: number;
|
|
267
|
+
y: number;
|
|
268
|
+
};
|
|
269
|
+
private getDockSize;
|
|
270
|
+
private getActiveScale;
|
|
271
|
+
private getDockedScale;
|
|
272
|
+
private getHomeHoverScale;
|
|
273
|
+
private disposeSceneObjects;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
declare function applyLegacyBeeMaterialCompat(gltf: GLTF): Promise<void>;
|
|
277
|
+
|
|
278
|
+
export { type BeeActionChoice, type BeeActionHandler, type BeeAssetVariant, type BeeDockClickBehavior, type BeeDockPosition, type BeeDockVariant, type BeeMotionMode, type BeeQualityTier, type BeeRenderer, type BeeVisualState, type DockMotionOptions, type MoveToOptions, type PromptOptions, type SetCustomDockPositionOptions, type SpeakOptions, ThreeBeeRenderer, type ThreeBeeRendererOptions, type TooltipArrowEdge, applyLegacyBeeMaterialCompat };
|