js.foresight-devtools 0.0.2 → 1.0.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/README.md +42 -4
- package/dist/index.d.mts +585 -0
- package/dist/index.d.ts +530 -123
- package/dist/index.js +1724 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1724 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -16
- package/dist/Debugger/DebuggerControlPanel.d.ts +0 -81
- package/dist/Debugger/DebuggerControlPanel.js +0 -751
- package/dist/Debugger/ForesightDebugger.d.ts +0 -53
- package/dist/Debugger/ForesightDebugger.js +0 -341
- package/dist/Debugger/helpers/createAndAppend.d.ts +0 -8
- package/dist/Debugger/helpers/createAndAppend.js +0 -16
- package/dist/Debugger/helpers/getIntersectingIcon.d.ts +0 -1
- package/dist/Debugger/helpers/getIntersectingIcon.js +0 -3
- package/dist/Debugger/helpers/objectToMethodCall.d.ts +0 -13
- package/dist/Debugger/helpers/objectToMethodCall.js +0 -65
- package/dist/Debugger/helpers/removeOldDebuggers.d.ts +0 -4
- package/dist/Debugger/helpers/removeOldDebuggers.js +0 -7
- package/dist/Debugger/helpers/updateElementOverlays.d.ts +0 -3
- package/dist/Debugger/helpers/updateElementOverlays.js +0 -18
- package/dist/types.d.ts +0 -47
- package/dist/types.js +0 -1
package/README.md
CHANGED
|
@@ -32,13 +32,13 @@ yarn add -D js.foresight-devtools
|
|
|
32
32
|
|
|
33
33
|
```javascript
|
|
34
34
|
import { ForesightManager } from "js.foresight"
|
|
35
|
-
import {
|
|
35
|
+
import { ForesightDevtools } from "js.foresight-devtools"
|
|
36
36
|
|
|
37
37
|
// Initialize ForesightJS
|
|
38
38
|
ForesightManager.initialize()
|
|
39
39
|
|
|
40
40
|
// Initialize development tools
|
|
41
|
-
|
|
41
|
+
ForesightDevtools.initialize()
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
## Configuration Options
|
|
@@ -49,6 +49,17 @@ type DevelopmentToolsSettings = {
|
|
|
49
49
|
isControlPanelDefaultMinimized?: boolean
|
|
50
50
|
showNameTags?: boolean // Show element names on overlays
|
|
51
51
|
sortElementList?: "documentOrder" | "visibility" | "insertionOrder" // Control panel sorting
|
|
52
|
+
logging: {
|
|
53
|
+
logLocation: "controlPanel" | "console" | "both" | "none" // Where to log the Foresight Events
|
|
54
|
+
callbackCompleted: boolean
|
|
55
|
+
callbackInvoked: boolean
|
|
56
|
+
elementDataUpdated: boolean
|
|
57
|
+
elementRegistered: boolean
|
|
58
|
+
elementUnregistered: boolean
|
|
59
|
+
managerSettingsChanged: boolean
|
|
60
|
+
mouseTrajectoryUpdate: boolean
|
|
61
|
+
scrollTrajectoryUpdate: boolean
|
|
62
|
+
}
|
|
52
63
|
}
|
|
53
64
|
```
|
|
54
65
|
|
|
@@ -63,11 +74,27 @@ type DevelopmentToolsSettings = {
|
|
|
63
74
|
| `showNameTags` | `boolean` | `true` | Shows the element `name` (or `id` if no `name` is given) above registered elements |
|
|
64
75
|
| `sortElementList` | `SortElementList` | `visibility` | Controls element sorting in control panel: `visibility` sorts by viewport visibility, `documentOrder` sorts by HTML structure order, `insertionOrder` sorts by registration order |
|
|
65
76
|
|
|
77
|
+
### Logging Configuration
|
|
78
|
+
|
|
79
|
+
**TypeScript Type:** `LogEvents & { logLocation: LoggingLocations }`
|
|
80
|
+
|
|
81
|
+
| Setting | Type | Default | Description |
|
|
82
|
+
| ------------------------ | ------------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------- |
|
|
83
|
+
| `logLocation` | `"controlPanel"` \| `"console"` \| `"both"` \| `"none"` | `"controlPanel"` | Where to output the ForesightJS event logs |
|
|
84
|
+
| `callbackCompleted` | `boolean` | `false` | Log when element callbacks finish executing (includes success/error status and execution time) |
|
|
85
|
+
| `callbackInvoked` | `boolean` | `false` | Log when element callbacks are triggered (includes hit type: mouse/keyboard/scroll) |
|
|
86
|
+
| `elementDataUpdated` | `boolean` | `false` | Log when element data changes (bounds updates, visibility changes) |
|
|
87
|
+
| `elementRegistered` | `boolean` | `false` | Log when new elements are registered with ForesightJS |
|
|
88
|
+
| `elementUnregistered` | `boolean` | `false` | Log when elements are unregistered (includes reason: callbackHit/disconnected/apiCall) |
|
|
89
|
+
| `managerSettingsChanged` | `boolean` | `false` | Log when ForesightManager global settings are modified |
|
|
90
|
+
| `mouseTrajectoryUpdate` | `boolean` | `false` | Log real-time mouse trajectory predictions (high frequency - use with caution) |
|
|
91
|
+
| `scrollTrajectoryUpdate` | `boolean` | `false` | Log scroll direction predictions and trajectory updates |
|
|
92
|
+
|
|
66
93
|
### Usage Example with All Options
|
|
67
94
|
|
|
68
95
|
```javascript
|
|
69
96
|
import { ForesightManager } from "js.foresight"
|
|
70
|
-
import {
|
|
97
|
+
import { ForesightDevtools } from "js.foresight-devtools"
|
|
71
98
|
|
|
72
99
|
// Initialize ForesightJS
|
|
73
100
|
ForesightManager.initialize({
|
|
@@ -79,11 +106,22 @@ ForesightManager.initialize({
|
|
|
79
106
|
})
|
|
80
107
|
|
|
81
108
|
// Initialize development tools with custom settings
|
|
82
|
-
|
|
109
|
+
ForesightDevtools.initialize({
|
|
83
110
|
showDebugger: true,
|
|
84
111
|
isControlPanelDefaultMinimized: false,
|
|
85
112
|
showNameTags: true,
|
|
86
113
|
sortElementList: "visibility",
|
|
114
|
+
logging: {
|
|
115
|
+
logLocation: "controlPanel",
|
|
116
|
+
callbackCompleted: true,
|
|
117
|
+
callbackInvoked: true,
|
|
118
|
+
elementRegistered: true,
|
|
119
|
+
elementUnregistered: true,
|
|
120
|
+
elementDataUpdated: false, // High frequency - keep disabled for performance
|
|
121
|
+
managerSettingsChanged: true,
|
|
122
|
+
mouseTrajectoryUpdate: false, // High frequency - keep disabled for performance
|
|
123
|
+
scrollTrajectoryUpdate: false, // High frequency - keep disabled for performance
|
|
124
|
+
},
|
|
87
125
|
})
|
|
88
126
|
|
|
89
127
|
// Register elements as usual
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
import * as lit from 'lit';
|
|
2
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
3
|
+
import { ForesightEvent, ForesightElementData, ForesightManagerSettings as ForesightManagerSettings$2 } from 'js.foresight';
|
|
4
|
+
import { ForesightEvent as ForesightEvent$1, HitSlop as HitSlop$1, UpdatedDataPropertyNames, CallbackHitType, Point, ScrollDirection, ForesightManagerSettings as ForesightManagerSettings$1 } from 'js.foresight/types/types';
|
|
5
|
+
|
|
6
|
+
type DeepPartial<T> = T extends object ? {
|
|
7
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
8
|
+
} : T;
|
|
9
|
+
type DevtoolsSettings = {
|
|
10
|
+
/**
|
|
11
|
+
* Whether to show visual debugging information on the screen.
|
|
12
|
+
* This includes overlays for elements, hit slop areas, the predicted mouse path and a debug control panel.
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
15
|
+
showDebugger: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Determines if the debugger control panel should be initialized in a minimized state.
|
|
18
|
+
*
|
|
19
|
+
* @link https://foresightjs.com/docs/getting_started/debug
|
|
20
|
+
*
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
isControlPanelDefaultMinimized: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Determines if name tags should be displayed visually above each registered element.
|
|
26
|
+
* This is a helpful visual aid for identifying which elements are being tracked.
|
|
27
|
+
*
|
|
28
|
+
* @link https://foresightjs.com/docs/getting_started/debug
|
|
29
|
+
*
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
showNameTags: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Specifies the default sorting order for the list of registered elements in the debugger panel.
|
|
35
|
+
* - `'visibility'`: Sorts elements by their viewport visibility (visible elements first),
|
|
36
|
+
* with a secondary documentOrder sort.
|
|
37
|
+
* - `'documentOrder'`: Sorts elements based on their order of appearance in the
|
|
38
|
+
* document's structure (matching the HTML source).
|
|
39
|
+
* - `'insertionOrder'`: Sorts by registration order.
|
|
40
|
+
*
|
|
41
|
+
*
|
|
42
|
+
* @link https://foresightjs.com/docs/getting_started/debug
|
|
43
|
+
*
|
|
44
|
+
* @default 'visibility'
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
sortElementList: SortElementList;
|
|
48
|
+
logging: LogEvents & {
|
|
49
|
+
logLocation: LoggingLocations;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
type LogEvents = {
|
|
53
|
+
[K in ForesightEvent]: boolean;
|
|
54
|
+
};
|
|
55
|
+
type LoggingLocations = "controlPanel" | "console" | "both" | "none";
|
|
56
|
+
type SortElementList = "documentOrder" | "visibility" | "insertionOrder";
|
|
57
|
+
type DebuggerBooleanSettingKeys = {
|
|
58
|
+
[K in keyof DevtoolsSettings]: Required<DevtoolsSettings>[K] extends boolean ? K : never;
|
|
59
|
+
}[keyof DevtoolsSettings];
|
|
60
|
+
|
|
61
|
+
declare class TabHeader extends LitElement {
|
|
62
|
+
static styles: lit.CSSResult[];
|
|
63
|
+
render(): lit.TemplateResult<1>;
|
|
64
|
+
}
|
|
65
|
+
declare global {
|
|
66
|
+
interface HTMLElementTagNameMap {
|
|
67
|
+
"tab-header": TabHeader;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare class TabContent extends LitElement {
|
|
72
|
+
static styles: lit.CSSResult[];
|
|
73
|
+
noContentMessage: string;
|
|
74
|
+
hasContent: boolean;
|
|
75
|
+
render(): lit.TemplateResult<1>;
|
|
76
|
+
}
|
|
77
|
+
declare global {
|
|
78
|
+
interface HTMLElementTagNameMap {
|
|
79
|
+
"tab-content": TabContent;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
type DropdownOption = {
|
|
84
|
+
value: string;
|
|
85
|
+
label: string;
|
|
86
|
+
title: string;
|
|
87
|
+
icon: TemplateResult;
|
|
88
|
+
};
|
|
89
|
+
declare abstract class BaseDropdown extends LitElement {
|
|
90
|
+
private static currentlyOpen;
|
|
91
|
+
static styles: lit.CSSResult[];
|
|
92
|
+
protected isDropdownOpen: boolean;
|
|
93
|
+
dropdownOptions: DropdownOption[];
|
|
94
|
+
connectedCallback(): void;
|
|
95
|
+
disconnectedCallback(): void;
|
|
96
|
+
protected _toggleDropdown: (event: MouseEvent) => void;
|
|
97
|
+
protected _closeDropdown(): void;
|
|
98
|
+
protected _positionDropdown(): void;
|
|
99
|
+
protected _handleOutsideClick: (event: MouseEvent) => void;
|
|
100
|
+
protected abstract _handleOptionClick(option: DropdownOption): void;
|
|
101
|
+
protected abstract _getTriggerIcon(): TemplateResult;
|
|
102
|
+
protected abstract _isOptionSelected(option: DropdownOption): boolean;
|
|
103
|
+
protected abstract _getTriggerTitle(): string;
|
|
104
|
+
protected abstract _getTriggerLabel(): string;
|
|
105
|
+
render(): TemplateResult<1>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare class SingleSelectDropdown extends BaseDropdown {
|
|
109
|
+
selectedOptionValue: string;
|
|
110
|
+
onSelectionChange?: (value: string) => void;
|
|
111
|
+
connectedCallback(): void;
|
|
112
|
+
willUpdate(changedProperties: Map<PropertyKey, unknown>): void;
|
|
113
|
+
protected _handleOptionClick(option: DropdownOption): void;
|
|
114
|
+
protected _getTriggerIcon(): TemplateResult;
|
|
115
|
+
protected _isOptionSelected(option: DropdownOption): boolean;
|
|
116
|
+
protected _getTriggerTitle(): string;
|
|
117
|
+
protected _getTriggerLabel(): string;
|
|
118
|
+
private _getSelectedOption;
|
|
119
|
+
}
|
|
120
|
+
declare global {
|
|
121
|
+
interface HTMLElementTagNameMap {
|
|
122
|
+
"single-select-dropdown": SingleSelectDropdown;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
declare class ChipElement extends LitElement {
|
|
127
|
+
static styles: lit.CSSResult[];
|
|
128
|
+
title: string;
|
|
129
|
+
render(): lit.TemplateResult<1>;
|
|
130
|
+
}
|
|
131
|
+
declare global {
|
|
132
|
+
interface HTMLElementTagNameMap {
|
|
133
|
+
"chip-element": ChipElement;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
declare class CopyIcon extends LitElement {
|
|
138
|
+
static styles: lit.CSSResult;
|
|
139
|
+
title: string;
|
|
140
|
+
onCopy?: (event: MouseEvent) => Promise<void> | void;
|
|
141
|
+
private isCopied;
|
|
142
|
+
private copyTimeout;
|
|
143
|
+
private handleClick;
|
|
144
|
+
disconnectedCallback(): void;
|
|
145
|
+
render(): lit.TemplateResult<1>;
|
|
146
|
+
}
|
|
147
|
+
declare global {
|
|
148
|
+
interface HTMLElementTagNameMap {
|
|
149
|
+
"copy-icon": CopyIcon;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
declare class ExpandableItem extends LitElement {
|
|
154
|
+
static styles: lit.CSSResult[];
|
|
155
|
+
borderColor: string;
|
|
156
|
+
showCopyButton: boolean;
|
|
157
|
+
itemId: string;
|
|
158
|
+
isExpanded: boolean;
|
|
159
|
+
onToggle: ((itemId: string) => void) | undefined;
|
|
160
|
+
private toggleExpand;
|
|
161
|
+
private handleCopy;
|
|
162
|
+
render(): lit.TemplateResult<1>;
|
|
163
|
+
}
|
|
164
|
+
declare global {
|
|
165
|
+
interface HTMLElementTagNameMap {
|
|
166
|
+
"expandable-item": ExpandableItem;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
declare class SingleElement extends LitElement {
|
|
171
|
+
static styles: lit.CSSResult[];
|
|
172
|
+
elementData: ForesightElementData & {
|
|
173
|
+
elementId: string;
|
|
174
|
+
};
|
|
175
|
+
isActive: boolean;
|
|
176
|
+
isExpanded: boolean;
|
|
177
|
+
onToggle: ((elementId: string) => void) | undefined;
|
|
178
|
+
private getBorderColor;
|
|
179
|
+
private getStatusIndicatorClass;
|
|
180
|
+
private formatElementDetails;
|
|
181
|
+
render(): lit.TemplateResult<1>;
|
|
182
|
+
}
|
|
183
|
+
declare global {
|
|
184
|
+
interface HTMLElementTagNameMap {
|
|
185
|
+
"single-element": SingleElement;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
declare class ElementTab extends LitElement {
|
|
190
|
+
static styles: lit.CSSResult;
|
|
191
|
+
private hitCount;
|
|
192
|
+
private visibleElementsCount;
|
|
193
|
+
private totalElementsCount;
|
|
194
|
+
private sortDropdown;
|
|
195
|
+
private sortOrder;
|
|
196
|
+
private elementListItems;
|
|
197
|
+
private noContentMessage;
|
|
198
|
+
private activeCallbacks;
|
|
199
|
+
private expandedElementIds;
|
|
200
|
+
private elementIdCounter;
|
|
201
|
+
private _abortController;
|
|
202
|
+
constructor();
|
|
203
|
+
private handleSortChange;
|
|
204
|
+
private generateElementId;
|
|
205
|
+
private handleElementToggle;
|
|
206
|
+
private updateVisibilityCounts;
|
|
207
|
+
private _generateHitsChipTitle;
|
|
208
|
+
connectedCallback(): void;
|
|
209
|
+
disconnectedCallback(): void;
|
|
210
|
+
private updateElementListFromManager;
|
|
211
|
+
private handleCallbackCompleted;
|
|
212
|
+
private getSortedElements;
|
|
213
|
+
private sortByDocumentPosition;
|
|
214
|
+
render(): lit.TemplateResult<1>;
|
|
215
|
+
}
|
|
216
|
+
declare global {
|
|
217
|
+
interface HTMLElementTagNameMap {
|
|
218
|
+
"element-tab": ElementTab;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
declare class MultiSelectDropdown extends BaseDropdown {
|
|
223
|
+
static styles: lit.CSSResult[];
|
|
224
|
+
selectedValues: string[];
|
|
225
|
+
onSelectionChange?: (changedValue: string, isSelected: boolean) => void;
|
|
226
|
+
protected _handleOptionClick(option: DropdownOption): void;
|
|
227
|
+
protected _getTriggerIcon(): TemplateResult;
|
|
228
|
+
protected _isOptionSelected(option: DropdownOption): boolean;
|
|
229
|
+
protected _getTriggerTitle(): string;
|
|
230
|
+
protected _getTriggerLabel(): string;
|
|
231
|
+
render(): TemplateResult<1>;
|
|
232
|
+
}
|
|
233
|
+
declare global {
|
|
234
|
+
interface HTMLElementTagNameMap {
|
|
235
|
+
"multi-select-dropdown": MultiSelectDropdown;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
type Rect = {
|
|
240
|
+
top: number;
|
|
241
|
+
left: number;
|
|
242
|
+
right: number;
|
|
243
|
+
bottom: number;
|
|
244
|
+
};
|
|
245
|
+
type BaseForesightManagerSettings = {
|
|
246
|
+
/**
|
|
247
|
+
* Number of mouse positions to keep in history for trajectory calculation.
|
|
248
|
+
* A higher number might lead to smoother but slightly delayed predictions.
|
|
249
|
+
*
|
|
250
|
+
*
|
|
251
|
+
* @link https://foresightjs.com/docs/getting_started/config#available-global-settings
|
|
252
|
+
*
|
|
253
|
+
*
|
|
254
|
+
* **This value is clamped between 2 and 30.**
|
|
255
|
+
* @default 8
|
|
256
|
+
*/
|
|
257
|
+
positionHistorySize: number;
|
|
258
|
+
/**
|
|
259
|
+
*
|
|
260
|
+
* @deprecated will be removed from v4.0
|
|
261
|
+
* ForesightJS now have its stand-alone devtools library with the debugger built-in
|
|
262
|
+
* @link https://github.com/spaansba/ForesightJS-DevTools
|
|
263
|
+
*/
|
|
264
|
+
debug: boolean;
|
|
265
|
+
/**
|
|
266
|
+
* How far ahead (in milliseconds) to predict the mouse trajectory.
|
|
267
|
+
* A larger value means the prediction extends further into the future. (meaning it will trigger callbacks sooner)
|
|
268
|
+
*
|
|
269
|
+
* @link https://foresightjs.com/docs/getting_started/config#available-global-settings
|
|
270
|
+
*
|
|
271
|
+
* **This value is clamped between 10 and 200.**
|
|
272
|
+
* @default 120
|
|
273
|
+
*/
|
|
274
|
+
trajectoryPredictionTime: number;
|
|
275
|
+
/**
|
|
276
|
+
* Whether to enable mouse trajectory prediction.
|
|
277
|
+
* If false, only direct hover/interaction is considered.
|
|
278
|
+
* @link https://foresightjs.com/docs/getting_started/config#available-global-settings
|
|
279
|
+
* @default true
|
|
280
|
+
*/
|
|
281
|
+
enableMousePrediction: boolean;
|
|
282
|
+
/**
|
|
283
|
+
* Toggles whether keyboard prediction is on
|
|
284
|
+
*
|
|
285
|
+
* @link https://foresightjs.com/docs/getting_started/config#available-global-settings
|
|
286
|
+
* @default true
|
|
287
|
+
*/
|
|
288
|
+
enableTabPrediction: boolean;
|
|
289
|
+
/**
|
|
290
|
+
* Sets the pixel distance to check from the mouse position in the scroll direction.
|
|
291
|
+
*
|
|
292
|
+
* @link https://foresightjs.com/docs/getting_started/config#available-global-settings
|
|
293
|
+
*
|
|
294
|
+
* **This value is clamped between 30 and 300.**
|
|
295
|
+
* @default 150
|
|
296
|
+
*/
|
|
297
|
+
scrollMargin: number;
|
|
298
|
+
/**
|
|
299
|
+
* Toggles whether scroll prediction is on
|
|
300
|
+
* @link https://foresightjs.com/docs/getting_started/config#available-global-settings
|
|
301
|
+
* @default true
|
|
302
|
+
*/
|
|
303
|
+
enableScrollPrediction: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Tab stops away from an element to trigger callback. Only works when @argument enableTabPrediction is true
|
|
306
|
+
*
|
|
307
|
+
* **This value is clamped between 0 and 20.**
|
|
308
|
+
* @default 2
|
|
309
|
+
*/
|
|
310
|
+
tabOffset: number;
|
|
311
|
+
};
|
|
312
|
+
/**
|
|
313
|
+
* Configuration options for the ForesightManager
|
|
314
|
+
* @link https://foresightjs.com/docs/getting_started/config#available-global-settings
|
|
315
|
+
*/
|
|
316
|
+
type ForesightManagerSettings = BaseForesightManagerSettings & {
|
|
317
|
+
defaultHitSlop: Exclude<HitSlop, number>;
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* Fully invisible "slop" around the element.
|
|
321
|
+
* Basically increases the hover hitbox
|
|
322
|
+
*/
|
|
323
|
+
type HitSlop = Rect | number;
|
|
324
|
+
type UpdatedManagerSetting = {
|
|
325
|
+
[K in keyof ForesightManagerSettings]: {
|
|
326
|
+
setting: K;
|
|
327
|
+
newValue: ForesightManagerSettings[K];
|
|
328
|
+
oldValue: ForesightManagerSettings[K];
|
|
329
|
+
};
|
|
330
|
+
}[keyof ForesightManagerSettings];
|
|
331
|
+
|
|
332
|
+
type SerializedEventType = ForesightEvent$1 | "serializationError";
|
|
333
|
+
interface PayloadBase {
|
|
334
|
+
type: SerializedEventType;
|
|
335
|
+
localizedTimestamp: string;
|
|
336
|
+
summary: string;
|
|
337
|
+
}
|
|
338
|
+
interface ElementRegisteredPayload extends PayloadBase {
|
|
339
|
+
type: "elementRegistered";
|
|
340
|
+
name: string;
|
|
341
|
+
id: string;
|
|
342
|
+
registerCount: number;
|
|
343
|
+
hitslop: HitSlop$1;
|
|
344
|
+
}
|
|
345
|
+
interface ElementUnregisteredPayload extends PayloadBase {
|
|
346
|
+
type: "elementUnregistered";
|
|
347
|
+
name: string;
|
|
348
|
+
id: string;
|
|
349
|
+
registerCount: number;
|
|
350
|
+
unregisterReason: string;
|
|
351
|
+
}
|
|
352
|
+
interface ElementDataUpdatedPayload extends PayloadBase {
|
|
353
|
+
type: "elementDataUpdated";
|
|
354
|
+
name: string;
|
|
355
|
+
updatedProps: UpdatedDataPropertyNames[];
|
|
356
|
+
isIntersecting: boolean;
|
|
357
|
+
}
|
|
358
|
+
interface CallbackInvokedPayload extends PayloadBase {
|
|
359
|
+
type: "callbackInvoked";
|
|
360
|
+
name: string;
|
|
361
|
+
hitType: CallbackHitType;
|
|
362
|
+
}
|
|
363
|
+
interface CallbackCompletedBasePayload extends PayloadBase {
|
|
364
|
+
type: "callbackCompleted";
|
|
365
|
+
name: string;
|
|
366
|
+
callbackRunTimeFormatted: string;
|
|
367
|
+
callbackRunTimeRaw: number;
|
|
368
|
+
hitType: CallbackHitType;
|
|
369
|
+
status: "success" | "error";
|
|
370
|
+
}
|
|
371
|
+
type CallbackCompletedPayload = CallbackCompletedBasePayload & ({
|
|
372
|
+
status: "success";
|
|
373
|
+
} | {
|
|
374
|
+
status: "error";
|
|
375
|
+
errorMessage: string;
|
|
376
|
+
});
|
|
377
|
+
interface MouseTrajectoryUpdatePayload extends PayloadBase {
|
|
378
|
+
type: "mouseTrajectoryUpdate";
|
|
379
|
+
currentPoint: Point;
|
|
380
|
+
predictedPoint: Point;
|
|
381
|
+
positionCount: number;
|
|
382
|
+
mousePredictionEnabled: boolean;
|
|
383
|
+
}
|
|
384
|
+
interface ScrollTrajectoryUpdatePayload extends PayloadBase {
|
|
385
|
+
type: "scrollTrajectoryUpdate";
|
|
386
|
+
currentPoint: Point;
|
|
387
|
+
predictedPoint: Point;
|
|
388
|
+
scrollDirection: ScrollDirection;
|
|
389
|
+
}
|
|
390
|
+
interface ManagerSettingsChangedPayload extends PayloadBase {
|
|
391
|
+
type: "managerSettingsChanged";
|
|
392
|
+
globalSettings: ForesightManagerSettings$1;
|
|
393
|
+
settingsChanged: UpdatedManagerSetting[];
|
|
394
|
+
}
|
|
395
|
+
interface SerializationErrorPayload extends PayloadBase {
|
|
396
|
+
type: "serializationError";
|
|
397
|
+
error: "Failed to serialize event data";
|
|
398
|
+
errorMessage: string;
|
|
399
|
+
}
|
|
400
|
+
type SerializedEventData = ElementRegisteredPayload | ElementUnregisteredPayload | ElementDataUpdatedPayload | CallbackInvokedPayload | CallbackCompletedPayload | MouseTrajectoryUpdatePayload | ScrollTrajectoryUpdatePayload | ManagerSettingsChangedPayload | SerializationErrorPayload;
|
|
401
|
+
|
|
402
|
+
declare class SingleLog extends LitElement {
|
|
403
|
+
static styles: lit.CSSResult[];
|
|
404
|
+
private log;
|
|
405
|
+
isExpanded: boolean;
|
|
406
|
+
onToggle: ((logId: string) => void) | undefined;
|
|
407
|
+
constructor(log: SerializedEventData & {
|
|
408
|
+
logId: string;
|
|
409
|
+
});
|
|
410
|
+
private serializeLogDataWithoutSummary;
|
|
411
|
+
private getLogTypeColor;
|
|
412
|
+
private getEventDisplayName;
|
|
413
|
+
private truncateLogSummary;
|
|
414
|
+
render(): lit.TemplateResult<1>;
|
|
415
|
+
}
|
|
416
|
+
declare global {
|
|
417
|
+
interface HTMLElementTagNameMap {
|
|
418
|
+
"single-log": SingleLog;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
declare class LogTab extends LitElement {
|
|
423
|
+
static styles: lit.CSSResult[];
|
|
424
|
+
private logDropdown;
|
|
425
|
+
private filterDropdown;
|
|
426
|
+
private logLocation;
|
|
427
|
+
private eventsEnabled;
|
|
428
|
+
private logs;
|
|
429
|
+
private expandedLogIds;
|
|
430
|
+
private MAX_LOGS;
|
|
431
|
+
private logIdCounter;
|
|
432
|
+
noContentMessage: string;
|
|
433
|
+
private _abortController;
|
|
434
|
+
private _eventListeners;
|
|
435
|
+
constructor();
|
|
436
|
+
private handleLogLocationChange;
|
|
437
|
+
private handleFilterChange;
|
|
438
|
+
private getSelectedEventFilters;
|
|
439
|
+
private shouldShowPerformanceWarning;
|
|
440
|
+
private getNoLogsMessage;
|
|
441
|
+
private handleLogToggle;
|
|
442
|
+
private clearLogs;
|
|
443
|
+
connectedCallback(): void;
|
|
444
|
+
disconnectedCallback(): void;
|
|
445
|
+
private setupDynamicEventListeners;
|
|
446
|
+
private addForesightEventListener;
|
|
447
|
+
private removeForesightEventListener;
|
|
448
|
+
private removeAllEventListeners;
|
|
449
|
+
private getEventColor;
|
|
450
|
+
private handleEvent;
|
|
451
|
+
private addEventLog;
|
|
452
|
+
render(): lit.TemplateResult<1>;
|
|
453
|
+
}
|
|
454
|
+
declare global {
|
|
455
|
+
interface HTMLElementTagNameMap {
|
|
456
|
+
"log-tab": LogTab;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
declare class SettingItem extends LitElement {
|
|
461
|
+
static styles: lit.CSSResult[];
|
|
462
|
+
header: string;
|
|
463
|
+
description: string;
|
|
464
|
+
render(): lit.TemplateResult<1>;
|
|
465
|
+
}
|
|
466
|
+
declare global {
|
|
467
|
+
interface HTMLElementTagNameMap {
|
|
468
|
+
"setting-item": SettingItem;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
declare class SettingItemCheckbox extends LitElement {
|
|
473
|
+
static styles: lit.CSSResult[];
|
|
474
|
+
isChecked: boolean;
|
|
475
|
+
header: string;
|
|
476
|
+
description: string;
|
|
477
|
+
setting: keyof ForesightManagerSettings$2 | keyof DevtoolsSettings;
|
|
478
|
+
private handleCheckboxChange;
|
|
479
|
+
render(): lit.TemplateResult<1>;
|
|
480
|
+
}
|
|
481
|
+
declare global {
|
|
482
|
+
interface HTMLElementTagNameMap {
|
|
483
|
+
"setting-item-checkbox": SettingItemCheckbox;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
declare class SettingItemRange extends LitElement {
|
|
488
|
+
static styles: lit.CSSResult[];
|
|
489
|
+
minValue: number;
|
|
490
|
+
maxValue: number;
|
|
491
|
+
currentValue: number;
|
|
492
|
+
unit: string;
|
|
493
|
+
header: string;
|
|
494
|
+
description: string;
|
|
495
|
+
setting: keyof ForesightManagerSettings$2;
|
|
496
|
+
private displayValue;
|
|
497
|
+
private handleRangeInput;
|
|
498
|
+
private handleRangeChange;
|
|
499
|
+
willUpdate(changedProperties: Map<string, any>): void;
|
|
500
|
+
render(): lit.TemplateResult<1>;
|
|
501
|
+
}
|
|
502
|
+
declare global {
|
|
503
|
+
interface HTMLElementTagNameMap {
|
|
504
|
+
"setting-item-range": SettingItemRange;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
declare class SettingsTab extends LitElement {
|
|
509
|
+
static styles: lit.CSSResult;
|
|
510
|
+
private managerSettings;
|
|
511
|
+
private initialSettings;
|
|
512
|
+
private devtoolsSettings;
|
|
513
|
+
private changedSettings;
|
|
514
|
+
private _abortController;
|
|
515
|
+
constructor();
|
|
516
|
+
connectedCallback(): void;
|
|
517
|
+
disconnectedCallback(): void;
|
|
518
|
+
private _updateChangedSettings;
|
|
519
|
+
private _checkManagerSettingsChanges;
|
|
520
|
+
private _checkDevtoolsSettingsChanges;
|
|
521
|
+
private _handleDevtoolsSettingChange;
|
|
522
|
+
private handleCopySettings;
|
|
523
|
+
private generateSettingsCode;
|
|
524
|
+
render(): lit.TemplateResult<1>;
|
|
525
|
+
}
|
|
526
|
+
declare global {
|
|
527
|
+
interface HTMLElementTagNameMap {
|
|
528
|
+
"settings-tab": SettingsTab;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
declare class ElementOverlays extends LitElement {
|
|
533
|
+
private overlayMap;
|
|
534
|
+
private callbackAnimations;
|
|
535
|
+
private containerElement;
|
|
536
|
+
static styles: lit.CSSResult[];
|
|
537
|
+
private _abortController;
|
|
538
|
+
connectedCallback(): void;
|
|
539
|
+
private createElementOverlays;
|
|
540
|
+
private updateElementOverlays;
|
|
541
|
+
private createOrUpdateElementOverlay;
|
|
542
|
+
private removeElementOverlay;
|
|
543
|
+
private clearCallbackAnimationTimeout;
|
|
544
|
+
private highlightElementCallback;
|
|
545
|
+
private unhighlightElementCallback;
|
|
546
|
+
updateNameTagVisibility(showNameTags: boolean): void;
|
|
547
|
+
disconnectedCallback(): void;
|
|
548
|
+
render(): lit.TemplateResult<1>;
|
|
549
|
+
}
|
|
550
|
+
declare global {
|
|
551
|
+
interface HTMLElementTagNameMap {
|
|
552
|
+
"element-overlays": ElementOverlays;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
declare class DebugOverlay extends LitElement {
|
|
557
|
+
static styles: lit.CSSResult[];
|
|
558
|
+
render(): lit.TemplateResult<1>;
|
|
559
|
+
}
|
|
560
|
+
declare global {
|
|
561
|
+
interface HTMLElementTagNameMap {
|
|
562
|
+
"debug-overlay": DebugOverlay;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
declare class ForesightDevtools extends LitElement {
|
|
567
|
+
static styles: lit.CSSResult[];
|
|
568
|
+
private isInitialized;
|
|
569
|
+
private static _instance;
|
|
570
|
+
devtoolsSettings: Required<DevtoolsSettings>;
|
|
571
|
+
static initialize(props?: DeepPartial<DevtoolsSettings>): ForesightDevtools;
|
|
572
|
+
static get instance(): ForesightDevtools;
|
|
573
|
+
disconnectedCallback(): void;
|
|
574
|
+
private shouldUpdateSetting;
|
|
575
|
+
alterDevtoolsSettings(props?: DeepPartial<DevtoolsSettings>): void;
|
|
576
|
+
private cleanup;
|
|
577
|
+
render(): lit.TemplateResult<1>;
|
|
578
|
+
}
|
|
579
|
+
declare global {
|
|
580
|
+
interface HTMLElementTagNameMap {
|
|
581
|
+
"foresight-devtools": ForesightDevtools;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
export { type DebuggerBooleanSettingKeys, type DevtoolsSettings, ForesightDevtools, type SortElementList };
|