js.foresight-devtools 1.4.0 → 2.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/LICENSE +21 -0
- package/README.md +9 -4
- package/dist/index.d.mts +627 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2197 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +64 -65
- package/dist/index.d.ts +0 -569
- package/dist/index.js +0 -2031
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Bart Spaans
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
These tools are built entirely using `ForesightJS`'s [built-in events](/docs/events), demonstrating how you can create your own monitoring and debugging tools using the same event system.
|
|
10
10
|
|
|
11
|
+
Since the devtools observe the `ForesightManager` directly, they work with every Foresight integration: the [`js.foresight`](https://foresightjs.com/docs/getting-started/quick-start) core, the official [React](https://foresightjs.com/docs/react/installation) and [Vue](https://foresightjs.com/docs/vue/installation) packages, or your own [custom binding](https://foresightjs.com/docs/other-frameworks).
|
|
12
|
+
|
|
11
13
|
## Installation
|
|
12
14
|
|
|
13
15
|
To install the `ForesightJS` Development Tools package, use your preferred package manager:
|
|
@@ -31,16 +33,19 @@ ForesightManager.initialize({})
|
|
|
31
33
|
|
|
32
34
|
// Initialize the development tools (all options are optional)
|
|
33
35
|
ForesightDevtools.initialize({
|
|
34
|
-
|
|
36
|
+
show: {
|
|
37
|
+
controlPanel: true, // show the floating control panel
|
|
38
|
+
nameTags: true, // show the element name above each registered element
|
|
39
|
+
elementOverlays: true, // show the hit-slop boundary around each registered element
|
|
40
|
+
mouseTrajectory: true, // show the predicted mouse trajectory line
|
|
41
|
+
scrollTrajectory: true, // show the predicted scroll trajectory line
|
|
42
|
+
},
|
|
35
43
|
isControlPanelDefaultMinimized: false, // optional setting which allows you to minimize the control panel on default
|
|
36
|
-
showNameTags: true, // optional setting which shows the name of the element
|
|
37
44
|
sortElementList: "visibility", // optional setting for how the elements in the control panel are sorted
|
|
38
45
|
logging: {
|
|
39
46
|
logLocation: "controlPanel", // Where to log the Foresight Events
|
|
40
47
|
callbackCompleted: true,
|
|
41
|
-
elementReactivated: true,
|
|
42
48
|
callbackInvoked: true,
|
|
43
|
-
elementDataUpdated: false,
|
|
44
49
|
elementRegistered: false,
|
|
45
50
|
elementUnregistered: false,
|
|
46
51
|
managerSettingsChanged: true,
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,627 @@
|
|
|
1
|
+
import { LitElement, PropertyValues, TemplateResult } from "lit";
|
|
2
|
+
import { CallbackHitType, CallbackHits, ForesightElement, ForesightElementState, ForesightEvent, ForesightManagerData, ForesightManagerSettings, ForesightPoint, HitSlop, ScrollDirection, UpdatedManagerSetting } from "js.foresight";
|
|
3
|
+
|
|
4
|
+
//#region src/types/types.d.ts
|
|
5
|
+
type DeepPartial<T> = T extends object ? { [P in keyof T]?: DeepPartial<T[P]> } : T;
|
|
6
|
+
type ShowSettings = {
|
|
7
|
+
/**
|
|
8
|
+
* Show the debugger control panel.
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
controlPanel: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Show name tags above each registered element.
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
nameTags: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Show element hit-slop overlays (the expanded boundary around each registered element).
|
|
19
|
+
*
|
|
20
|
+
* Note: turning this off also hides name tags, since the labels live inside
|
|
21
|
+
* the same overlay host.
|
|
22
|
+
*
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
elementOverlays: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Show the predicted mouse trajectory line.
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
mouseTrajectory: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Show the predicted scroll trajectory line.
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
scrollTrajectory: boolean;
|
|
36
|
+
};
|
|
37
|
+
type ShowKey = keyof ShowSettings;
|
|
38
|
+
type DevtoolsSettings = {
|
|
39
|
+
/**
|
|
40
|
+
* Granular visibility flags for the devtools UI.
|
|
41
|
+
*
|
|
42
|
+
* @link https://foresightjs.com/docs/getting_started/debug
|
|
43
|
+
*/
|
|
44
|
+
show: ShowSettings;
|
|
45
|
+
/**
|
|
46
|
+
* Determines if the debugger control panel should be initialized in a minimized state.
|
|
47
|
+
*
|
|
48
|
+
* @link https://foresightjs.com/docs/getting_started/debug
|
|
49
|
+
*
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
isControlPanelDefaultMinimized: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Specifies the default sorting order for the list of registered elements in the debugger panel.
|
|
55
|
+
* - `'visibility'`: Sorts elements by their viewport visibility (visible elements first),
|
|
56
|
+
* with a secondary documentOrder sort.
|
|
57
|
+
* - `'documentOrder'`: Sorts elements based on their order of appearance in the
|
|
58
|
+
* document's structure (matching the HTML source).
|
|
59
|
+
* - `'insertionOrder'`: Sorts by registration order.
|
|
60
|
+
*
|
|
61
|
+
*
|
|
62
|
+
* @link https://foresightjs.com/docs/getting_started/debug
|
|
63
|
+
*
|
|
64
|
+
* @default 'visibility'
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
sortElementList: SortElementList;
|
|
68
|
+
logging: LogEvents & {
|
|
69
|
+
logLocation: LoggingLocations;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
type LogEvents = { [K in ForesightEvent]: boolean };
|
|
73
|
+
type LoggingLocations = "controlPanel" | "console" | "both" | "none";
|
|
74
|
+
type SortElementList = "documentOrder" | "visibility" | "insertionOrder";
|
|
75
|
+
type DebuggerBooleanSettingKeys = ShowKey;
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/lit-entry/control-panel/base-tab/chip.d.ts
|
|
78
|
+
declare class ChipElement extends LitElement {
|
|
79
|
+
static styles: any[];
|
|
80
|
+
title: string;
|
|
81
|
+
render(): any;
|
|
82
|
+
}
|
|
83
|
+
declare global {
|
|
84
|
+
interface HTMLElementTagNameMap {
|
|
85
|
+
"chip-element": ChipElement;
|
|
86
|
+
}
|
|
87
|
+
} //# sourceMappingURL=chip.d.ts.map
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/lit-entry/control-panel/base-tab/tab-content.d.ts
|
|
90
|
+
declare class TabContent extends LitElement {
|
|
91
|
+
static styles: any[];
|
|
92
|
+
noContentMessage: string;
|
|
93
|
+
hasContent: boolean;
|
|
94
|
+
render(): any;
|
|
95
|
+
}
|
|
96
|
+
declare global {
|
|
97
|
+
interface HTMLElementTagNameMap {
|
|
98
|
+
"tab-content": TabContent;
|
|
99
|
+
}
|
|
100
|
+
} //# sourceMappingURL=tab-content.d.ts.map
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/lit-entry/control-panel/base-tab/tab-header.d.ts
|
|
103
|
+
declare class TabHeader extends LitElement {
|
|
104
|
+
static styles: any[];
|
|
105
|
+
render(): any;
|
|
106
|
+
}
|
|
107
|
+
declare global {
|
|
108
|
+
interface HTMLElementTagNameMap {
|
|
109
|
+
"tab-header": TabHeader;
|
|
110
|
+
}
|
|
111
|
+
} //# sourceMappingURL=tab-header.d.ts.map
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/lit-entry/control-panel/dropdown/base-dropdown.d.ts
|
|
114
|
+
type DropdownOption = {
|
|
115
|
+
value: string;
|
|
116
|
+
label: string;
|
|
117
|
+
title: string;
|
|
118
|
+
icon: TemplateResult;
|
|
119
|
+
};
|
|
120
|
+
declare abstract class BaseDropdown extends LitElement {
|
|
121
|
+
private static currentlyOpen;
|
|
122
|
+
static styles: any[];
|
|
123
|
+
protected isDropdownOpen: boolean;
|
|
124
|
+
dropdownOptions: DropdownOption[];
|
|
125
|
+
connectedCallback(): void;
|
|
126
|
+
disconnectedCallback(): void;
|
|
127
|
+
protected _toggleDropdown: (event: MouseEvent) => void;
|
|
128
|
+
protected _closeDropdown(): void;
|
|
129
|
+
protected _positionDropdown(): void;
|
|
130
|
+
protected _handleOutsideClick: (event: MouseEvent) => void;
|
|
131
|
+
protected abstract _handleOptionClick(option: DropdownOption): void;
|
|
132
|
+
protected abstract _getTriggerIcon(): TemplateResult;
|
|
133
|
+
protected abstract _isOptionSelected(option: DropdownOption): boolean;
|
|
134
|
+
protected abstract _getTriggerTitle(): string;
|
|
135
|
+
protected abstract _getTriggerLabel(): string;
|
|
136
|
+
render(): any;
|
|
137
|
+
}
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region src/lit-entry/control-panel/dropdown/single-select-dropdown.d.ts
|
|
140
|
+
declare class SingleSelectDropdown extends BaseDropdown {
|
|
141
|
+
selectedOptionValue: string;
|
|
142
|
+
onSelectionChange?: (value: string) => void;
|
|
143
|
+
connectedCallback(): void;
|
|
144
|
+
willUpdate(changedProperties: Map<PropertyKey, unknown>): void;
|
|
145
|
+
protected _handleOptionClick(option: DropdownOption): void;
|
|
146
|
+
protected _getTriggerIcon(): TemplateResult;
|
|
147
|
+
protected _isOptionSelected(option: DropdownOption): boolean;
|
|
148
|
+
protected _getTriggerTitle(): string;
|
|
149
|
+
protected _getTriggerLabel(): string;
|
|
150
|
+
private _getSelectedOption;
|
|
151
|
+
}
|
|
152
|
+
declare global {
|
|
153
|
+
interface HTMLElementTagNameMap {
|
|
154
|
+
"single-select-dropdown": SingleSelectDropdown;
|
|
155
|
+
}
|
|
156
|
+
} //# sourceMappingURL=single-select-dropdown.d.ts.map
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/lit-entry/control-panel/copy-icon/copy-icon.d.ts
|
|
159
|
+
declare class CopyIcon extends LitElement {
|
|
160
|
+
static styles: any;
|
|
161
|
+
title: string;
|
|
162
|
+
onCopy?: (event: MouseEvent) => Promise<void> | void;
|
|
163
|
+
private isCopied;
|
|
164
|
+
private copyTimeout;
|
|
165
|
+
private handleClick;
|
|
166
|
+
disconnectedCallback(): void;
|
|
167
|
+
render(): any;
|
|
168
|
+
}
|
|
169
|
+
declare global {
|
|
170
|
+
interface HTMLElementTagNameMap {
|
|
171
|
+
"copy-icon": CopyIcon;
|
|
172
|
+
}
|
|
173
|
+
} //# sourceMappingURL=copy-icon.d.ts.map
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/lit-entry/control-panel/base-tab/expandable-item.d.ts
|
|
176
|
+
declare class ExpandableItem extends LitElement {
|
|
177
|
+
static styles: any[];
|
|
178
|
+
borderColor: string;
|
|
179
|
+
showCopyButton: boolean;
|
|
180
|
+
itemId: string;
|
|
181
|
+
isExpanded: boolean;
|
|
182
|
+
onToggle: ((itemId: string) => void) | undefined;
|
|
183
|
+
private toggleExpand;
|
|
184
|
+
private handleCopy;
|
|
185
|
+
render(): any;
|
|
186
|
+
}
|
|
187
|
+
declare global {
|
|
188
|
+
interface HTMLElementTagNameMap {
|
|
189
|
+
"expandable-item": ExpandableItem;
|
|
190
|
+
}
|
|
191
|
+
} //# sourceMappingURL=expandable-item.d.ts.map
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/lit-entry/control-panel/element-tab/reactivate-countdown.d.ts
|
|
194
|
+
declare class ReactivateCountdown extends LitElement {
|
|
195
|
+
static styles: any[];
|
|
196
|
+
element: ForesightElement;
|
|
197
|
+
state: ForesightElementState;
|
|
198
|
+
private remainingTime;
|
|
199
|
+
private isCountdownActive;
|
|
200
|
+
private intervalId;
|
|
201
|
+
private startTime;
|
|
202
|
+
private lastDisplayedTime;
|
|
203
|
+
private countdownForElement;
|
|
204
|
+
private countdownReactivateAfter;
|
|
205
|
+
connectedCallback(): void;
|
|
206
|
+
disconnectedCallback(): void;
|
|
207
|
+
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
208
|
+
private checkAndStartCountdown;
|
|
209
|
+
private startCountdown;
|
|
210
|
+
private clearCountdown;
|
|
211
|
+
private handleTimerClick;
|
|
212
|
+
private formatTime;
|
|
213
|
+
render(): any;
|
|
214
|
+
}
|
|
215
|
+
declare global {
|
|
216
|
+
interface HTMLElementTagNameMap {
|
|
217
|
+
"reactivate-countdown": ReactivateCountdown;
|
|
218
|
+
}
|
|
219
|
+
} //# sourceMappingURL=reactivate-countdown.d.ts.map
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region src/lit-entry/control-panel/element-tab/single-element.d.ts
|
|
222
|
+
declare class SingleElement extends LitElement {
|
|
223
|
+
static styles: any[];
|
|
224
|
+
element: ForesightElement;
|
|
225
|
+
state: ForesightElementState;
|
|
226
|
+
isExpanded: boolean;
|
|
227
|
+
onToggle: ((elementId: string) => void) | undefined;
|
|
228
|
+
private currentDeviceStrategy;
|
|
229
|
+
private _abortController;
|
|
230
|
+
connectedCallback(): void;
|
|
231
|
+
disconnectedCallback(): void;
|
|
232
|
+
private getInactiveReasons;
|
|
233
|
+
private getBorderColor;
|
|
234
|
+
private getStatusIndicatorClass;
|
|
235
|
+
private getStatusText;
|
|
236
|
+
private formatElementDetails;
|
|
237
|
+
private handleUnregister;
|
|
238
|
+
private handleToggleEnabled;
|
|
239
|
+
render(): any;
|
|
240
|
+
}
|
|
241
|
+
declare global {
|
|
242
|
+
interface HTMLElementTagNameMap {
|
|
243
|
+
"single-element": SingleElement;
|
|
244
|
+
}
|
|
245
|
+
} //# sourceMappingURL=single-element.d.ts.map
|
|
246
|
+
//#endregion
|
|
247
|
+
//#region src/lit-entry/control-panel/element-tab/element-tab.d.ts
|
|
248
|
+
declare class ElementTab extends LitElement {
|
|
249
|
+
static styles: any;
|
|
250
|
+
private hitCount;
|
|
251
|
+
private sortDropdown;
|
|
252
|
+
private sortOrder;
|
|
253
|
+
private elementListItems;
|
|
254
|
+
private noContentMessage;
|
|
255
|
+
private expandedElementIds;
|
|
256
|
+
private activeSectionCollapsed;
|
|
257
|
+
private inactiveSectionCollapsed;
|
|
258
|
+
private _abortController;
|
|
259
|
+
private _elementSubscriptions;
|
|
260
|
+
private _pendingElementUpdates;
|
|
261
|
+
private _updateDebounceId;
|
|
262
|
+
private _cachedActiveElements;
|
|
263
|
+
private _cachedInactiveElements;
|
|
264
|
+
private _elementsCacheDirty;
|
|
265
|
+
constructor();
|
|
266
|
+
private handleSortChange;
|
|
267
|
+
private handleElementToggle;
|
|
268
|
+
private _generateHitsChipTitle;
|
|
269
|
+
private _subscribeToElement;
|
|
270
|
+
private _unsubscribeFromElement;
|
|
271
|
+
connectedCallback(): void;
|
|
272
|
+
disconnectedCallback(): void;
|
|
273
|
+
private _scheduleDebouncedUpdate;
|
|
274
|
+
private _flushPendingUpdates;
|
|
275
|
+
private updateElementListFromManager;
|
|
276
|
+
private handleCallbackCompleted;
|
|
277
|
+
private getSortedElements;
|
|
278
|
+
private _recomputeElementsCache;
|
|
279
|
+
private get activeElements();
|
|
280
|
+
private get inactiveElements();
|
|
281
|
+
private sortByDocumentPosition;
|
|
282
|
+
private renderElementSection;
|
|
283
|
+
render(): any;
|
|
284
|
+
}
|
|
285
|
+
declare global {
|
|
286
|
+
interface HTMLElementTagNameMap {
|
|
287
|
+
"element-tab": ElementTab;
|
|
288
|
+
}
|
|
289
|
+
} //# sourceMappingURL=element-tab.d.ts.map
|
|
290
|
+
//#endregion
|
|
291
|
+
//#region src/lit-entry/control-panel/dropdown/multi-select-dropdown.d.ts
|
|
292
|
+
declare class MultiSelectDropdown extends BaseDropdown {
|
|
293
|
+
static styles: any[];
|
|
294
|
+
selectedValues: string[];
|
|
295
|
+
onSelectionChange?: (changedValue: string, isSelected: boolean) => void;
|
|
296
|
+
protected _handleOptionClick(option: DropdownOption): void;
|
|
297
|
+
protected _getTriggerIcon(): TemplateResult;
|
|
298
|
+
protected _isOptionSelected(option: DropdownOption): boolean;
|
|
299
|
+
protected _getTriggerTitle(): string;
|
|
300
|
+
protected _getTriggerLabel(): string;
|
|
301
|
+
render(): any;
|
|
302
|
+
}
|
|
303
|
+
declare global {
|
|
304
|
+
interface HTMLElementTagNameMap {
|
|
305
|
+
"multi-select-dropdown": MultiSelectDropdown;
|
|
306
|
+
}
|
|
307
|
+
} //# sourceMappingURL=multi-select-dropdown.d.ts.map
|
|
308
|
+
//#endregion
|
|
309
|
+
//#region src/helpers/safeSerializeEventData.d.ts
|
|
310
|
+
type SerializedEventType = ForesightEvent | "serializationError" | "managerDataPayload";
|
|
311
|
+
interface PayloadBase {
|
|
312
|
+
type: SerializedEventType;
|
|
313
|
+
localizedTimestamp: string;
|
|
314
|
+
summary: string;
|
|
315
|
+
logId: string;
|
|
316
|
+
}
|
|
317
|
+
interface ElementRegisteredPayload extends PayloadBase {
|
|
318
|
+
type: "elementRegistered";
|
|
319
|
+
name: string;
|
|
320
|
+
id: string;
|
|
321
|
+
state: ForesightElementState;
|
|
322
|
+
hitslop: HitSlop;
|
|
323
|
+
meta: Record<string, unknown>;
|
|
324
|
+
}
|
|
325
|
+
interface ElementUnregisteredEvent extends PayloadBase {
|
|
326
|
+
type: "elementUnregistered";
|
|
327
|
+
name: string;
|
|
328
|
+
id: string;
|
|
329
|
+
state: ForesightElementState;
|
|
330
|
+
meta: Record<string, unknown>;
|
|
331
|
+
wasLastRegisteredElement: boolean;
|
|
332
|
+
}
|
|
333
|
+
interface CallbackInvokedPayload extends PayloadBase {
|
|
334
|
+
type: "callbackInvoked";
|
|
335
|
+
name: string;
|
|
336
|
+
hitType: CallbackHitType;
|
|
337
|
+
state: ForesightElementState;
|
|
338
|
+
meta: Record<string, unknown>;
|
|
339
|
+
}
|
|
340
|
+
interface CallbackCompletedPayload extends PayloadBase {
|
|
341
|
+
type: "callbackCompleted";
|
|
342
|
+
elapsed: string;
|
|
343
|
+
name: string;
|
|
344
|
+
hitType: CallbackHitType;
|
|
345
|
+
status: "success" | "error" | undefined;
|
|
346
|
+
errorMessage: string | undefined | null;
|
|
347
|
+
state: ForesightElementState;
|
|
348
|
+
wasLastActiveElement: boolean;
|
|
349
|
+
meta: Record<string, unknown>;
|
|
350
|
+
}
|
|
351
|
+
interface MouseTrajectoryUpdatePayload extends PayloadBase {
|
|
352
|
+
type: "mouseTrajectoryUpdate";
|
|
353
|
+
currentPoint: ForesightPoint;
|
|
354
|
+
predictedPoint: ForesightPoint;
|
|
355
|
+
positionCount: number;
|
|
356
|
+
mousePredictionEnabled: boolean;
|
|
357
|
+
}
|
|
358
|
+
interface ScrollTrajectoryUpdatePayload extends PayloadBase {
|
|
359
|
+
type: "scrollTrajectoryUpdate";
|
|
360
|
+
currentPoint: ForesightPoint;
|
|
361
|
+
predictedPoint: ForesightPoint;
|
|
362
|
+
scrollDirection: ScrollDirection;
|
|
363
|
+
}
|
|
364
|
+
interface ManagerSettingsChangedPayload extends PayloadBase {
|
|
365
|
+
type: "managerSettingsChanged";
|
|
366
|
+
globalSettings: ForesightManagerSettings;
|
|
367
|
+
settingsChanged: UpdatedManagerSetting[];
|
|
368
|
+
}
|
|
369
|
+
interface DeviceStrategyChangedPayload extends PayloadBase {
|
|
370
|
+
type: "deviceStrategyChanged";
|
|
371
|
+
oldStrategy: string;
|
|
372
|
+
newStrategy: string;
|
|
373
|
+
}
|
|
374
|
+
interface SerializationErrorPayload extends PayloadBase {
|
|
375
|
+
type: "serializationError";
|
|
376
|
+
error: "Failed to serialize event data";
|
|
377
|
+
errorMessage: string;
|
|
378
|
+
}
|
|
379
|
+
interface ManagerDataPayload extends PayloadBase {
|
|
380
|
+
type: "managerDataPayload";
|
|
381
|
+
warning: string;
|
|
382
|
+
globalCallbackHits: CallbackHits;
|
|
383
|
+
eventListenerCount: Record<string, number>;
|
|
384
|
+
managerSettings: ForesightManagerSettings;
|
|
385
|
+
registeredElements: Array<ForesightElementState & {
|
|
386
|
+
elementInfo: string;
|
|
387
|
+
}>;
|
|
388
|
+
loadedModules: ForesightManagerData["loadedModules"];
|
|
389
|
+
}
|
|
390
|
+
type SerializedEventData = ElementRegisteredPayload | ElementUnregisteredEvent | CallbackInvokedPayload | CallbackCompletedPayload | MouseTrajectoryUpdatePayload | ScrollTrajectoryUpdatePayload | ManagerSettingsChangedPayload | DeviceStrategyChangedPayload | ManagerDataPayload | SerializationErrorPayload;
|
|
391
|
+
//#endregion
|
|
392
|
+
//#region src/lit-entry/control-panel/log-tab/single-log.d.ts
|
|
393
|
+
declare class SingleLog extends LitElement {
|
|
394
|
+
static styles: any[];
|
|
395
|
+
log: SerializedEventData;
|
|
396
|
+
constructor(log: SerializedEventData);
|
|
397
|
+
isExpanded: boolean;
|
|
398
|
+
onToggle: ((logId: string) => void) | undefined;
|
|
399
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
400
|
+
private serializeLogDataWithoutSummary;
|
|
401
|
+
private getLogTypeColor;
|
|
402
|
+
private getEventDisplayName;
|
|
403
|
+
private truncateLogSummary;
|
|
404
|
+
render(): any;
|
|
405
|
+
}
|
|
406
|
+
declare global {
|
|
407
|
+
interface HTMLElementTagNameMap {
|
|
408
|
+
"single-log": SingleLog;
|
|
409
|
+
}
|
|
410
|
+
} //# sourceMappingURL=single-log.d.ts.map
|
|
411
|
+
//#endregion
|
|
412
|
+
//#region src/lit-entry/control-panel/log-tab/log-tab.d.ts
|
|
413
|
+
declare class LogTab extends LitElement {
|
|
414
|
+
static styles: any[];
|
|
415
|
+
private logDropdown;
|
|
416
|
+
private filterDropdown;
|
|
417
|
+
private logLocation;
|
|
418
|
+
private eventsEnabled;
|
|
419
|
+
private logs;
|
|
420
|
+
private expandedLogIds;
|
|
421
|
+
private MAX_LOGS;
|
|
422
|
+
private logIdCounter;
|
|
423
|
+
noContentMessage: string;
|
|
424
|
+
private _abortController;
|
|
425
|
+
private _eventListeners;
|
|
426
|
+
constructor();
|
|
427
|
+
private handleLogLocationChange;
|
|
428
|
+
private handleFilterChange;
|
|
429
|
+
private getSelectedEventFilters;
|
|
430
|
+
private shouldShowPerformanceWarning;
|
|
431
|
+
private getNoLogsMessage;
|
|
432
|
+
private handleLogToggle;
|
|
433
|
+
private clearLogs;
|
|
434
|
+
connectedCallback(): void;
|
|
435
|
+
disconnectedCallback(): void;
|
|
436
|
+
private setupDynamicEventListeners;
|
|
437
|
+
private addForesightEventListener;
|
|
438
|
+
private removeForesightEventListener;
|
|
439
|
+
private removeAllEventListeners;
|
|
440
|
+
private getEventColor;
|
|
441
|
+
private handleEvent;
|
|
442
|
+
private addLog;
|
|
443
|
+
private logManagerData;
|
|
444
|
+
private addManagerLog;
|
|
445
|
+
private addEventLog;
|
|
446
|
+
render(): any;
|
|
447
|
+
}
|
|
448
|
+
declare global {
|
|
449
|
+
interface HTMLElementTagNameMap {
|
|
450
|
+
"log-tab": LogTab;
|
|
451
|
+
}
|
|
452
|
+
} //# sourceMappingURL=log-tab.d.ts.map
|
|
453
|
+
//#endregion
|
|
454
|
+
//#region src/lit-entry/control-panel/settings-tab/setting-item/setting-item.d.ts
|
|
455
|
+
declare class SettingItem extends LitElement {
|
|
456
|
+
static styles: any[];
|
|
457
|
+
header: string;
|
|
458
|
+
description: string;
|
|
459
|
+
render(): any;
|
|
460
|
+
}
|
|
461
|
+
declare global {
|
|
462
|
+
interface HTMLElementTagNameMap {
|
|
463
|
+
"setting-item": SettingItem;
|
|
464
|
+
}
|
|
465
|
+
} //# sourceMappingURL=setting-item.d.ts.map
|
|
466
|
+
//#endregion
|
|
467
|
+
//#region src/lit-entry/control-panel/settings-tab/setting-item/setting-item-checkbox.d.ts
|
|
468
|
+
type ShowSettingKey = `show.${ShowKey}`;
|
|
469
|
+
declare class SettingItemCheckbox extends LitElement {
|
|
470
|
+
static styles: any[];
|
|
471
|
+
isChecked: boolean;
|
|
472
|
+
header: string;
|
|
473
|
+
description: string;
|
|
474
|
+
setting: keyof ForesightManagerSettings | keyof DevtoolsSettings | ShowSettingKey;
|
|
475
|
+
private handleCheckboxChange;
|
|
476
|
+
render(): any;
|
|
477
|
+
}
|
|
478
|
+
declare global {
|
|
479
|
+
interface HTMLElementTagNameMap {
|
|
480
|
+
"setting-item-checkbox": SettingItemCheckbox;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
//#endregion
|
|
484
|
+
//#region src/lit-entry/control-panel/settings-tab/setting-item/setting-item-range.d.ts
|
|
485
|
+
declare class SettingItemRange extends LitElement {
|
|
486
|
+
static styles: any[];
|
|
487
|
+
minValue: number;
|
|
488
|
+
maxValue: number;
|
|
489
|
+
currentValue: number;
|
|
490
|
+
unit: string;
|
|
491
|
+
header: string;
|
|
492
|
+
description: string;
|
|
493
|
+
setting: keyof ForesightManagerSettings;
|
|
494
|
+
private displayValue;
|
|
495
|
+
private handleRangeInput;
|
|
496
|
+
private handleRangeChange;
|
|
497
|
+
willUpdate(changedProperties: PropertyValues): void;
|
|
498
|
+
render(): any;
|
|
499
|
+
}
|
|
500
|
+
declare global {
|
|
501
|
+
interface HTMLElementTagNameMap {
|
|
502
|
+
"setting-item-range": SettingItemRange;
|
|
503
|
+
}
|
|
504
|
+
} //# sourceMappingURL=setting-item-range.d.ts.map
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region src/lit-entry/control-panel/settings-tab/settings-tab.d.ts
|
|
507
|
+
declare class SettingsTab extends LitElement {
|
|
508
|
+
static styles: any;
|
|
509
|
+
private managerSettings;
|
|
510
|
+
private initialSettings;
|
|
511
|
+
private devtoolsSettings;
|
|
512
|
+
private changedSettings;
|
|
513
|
+
private currentCorner;
|
|
514
|
+
private touchDeviceStrategyOptions;
|
|
515
|
+
private minimumConnectionTypeOptions;
|
|
516
|
+
private cornerOptions;
|
|
517
|
+
private _abortController;
|
|
518
|
+
constructor();
|
|
519
|
+
connectedCallback(): void;
|
|
520
|
+
disconnectedCallback(): void;
|
|
521
|
+
private _updateChangedSettings;
|
|
522
|
+
private _checkManagerSettingsChanges;
|
|
523
|
+
private _checkDevtoolsSettingsChanges;
|
|
524
|
+
private _handleDevtoolsSettingChange;
|
|
525
|
+
private _handleTouchDeviceStrategyChange;
|
|
526
|
+
private _handleMinimumConnectionTypeChange;
|
|
527
|
+
private _handleCornerChange;
|
|
528
|
+
private getCurrentCorner;
|
|
529
|
+
private handleCopySettings;
|
|
530
|
+
private generateSettingsCode;
|
|
531
|
+
render(): any;
|
|
532
|
+
}
|
|
533
|
+
declare global {
|
|
534
|
+
interface HTMLElementTagNameMap {
|
|
535
|
+
"settings-tab": SettingsTab;
|
|
536
|
+
}
|
|
537
|
+
} //# sourceMappingURL=settings-tab.d.ts.map
|
|
538
|
+
//#endregion
|
|
539
|
+
//#region src/lit-entry/debug-overlay/element-overlays.d.ts
|
|
540
|
+
declare class ElementOverlays extends LitElement {
|
|
541
|
+
private overlayMap;
|
|
542
|
+
private callbackAnimations;
|
|
543
|
+
private _elementSubscriptions;
|
|
544
|
+
private containerElement;
|
|
545
|
+
showNameTags: boolean;
|
|
546
|
+
static styles: any[];
|
|
547
|
+
private _abortController;
|
|
548
|
+
connectedCallback(): void;
|
|
549
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
550
|
+
private _subscribeToElement;
|
|
551
|
+
private _unsubscribeFromElement;
|
|
552
|
+
private createOverlay;
|
|
553
|
+
/**
|
|
554
|
+
* The slop area is the element's own shape offset outward by the hit slop:
|
|
555
|
+
* every corner keeps the element's border radius, grown by the slop on each
|
|
556
|
+
* axis. Sharp corners stay sharp, since offsetting a rectangle outward does
|
|
557
|
+
* not round its corners.
|
|
558
|
+
*/
|
|
559
|
+
private expandedBorderRadius;
|
|
560
|
+
private updateSlopArea;
|
|
561
|
+
private updateNameLabel;
|
|
562
|
+
private createOrUpdateElementOverlay;
|
|
563
|
+
private removeElementOverlay;
|
|
564
|
+
private clearCallbackAnimationTimeout;
|
|
565
|
+
private highlightElementCallback;
|
|
566
|
+
private unhighlightElementCallback;
|
|
567
|
+
updateNameTagVisibility(showNameTags: boolean): void;
|
|
568
|
+
disconnectedCallback(): void;
|
|
569
|
+
render(): any;
|
|
570
|
+
}
|
|
571
|
+
declare global {
|
|
572
|
+
interface HTMLElementTagNameMap {
|
|
573
|
+
"element-overlays": ElementOverlays;
|
|
574
|
+
}
|
|
575
|
+
} //# sourceMappingURL=element-overlays.d.ts.map
|
|
576
|
+
//#endregion
|
|
577
|
+
//#region src/lit-entry/debug-overlay/debug-overlay.d.ts
|
|
578
|
+
declare class DebugOverlay extends LitElement {
|
|
579
|
+
static styles: any[];
|
|
580
|
+
private _abortController;
|
|
581
|
+
private _strategy;
|
|
582
|
+
showElementOverlays: boolean;
|
|
583
|
+
showMouseTrajectory: boolean;
|
|
584
|
+
showScrollTrajectory: boolean;
|
|
585
|
+
showNameTags: boolean;
|
|
586
|
+
connectedCallback(): void;
|
|
587
|
+
private handleDeviceStrategyChange;
|
|
588
|
+
disconnectedCallback(): void;
|
|
589
|
+
render(): any;
|
|
590
|
+
}
|
|
591
|
+
declare global {
|
|
592
|
+
interface HTMLElementTagNameMap {
|
|
593
|
+
"debug-overlay": DebugOverlay;
|
|
594
|
+
}
|
|
595
|
+
} //# sourceMappingURL=debug-overlay.d.ts.map
|
|
596
|
+
//#endregion
|
|
597
|
+
//#region src/lit-entry/foresight-devtools.d.ts
|
|
598
|
+
declare class ForesightDevtools extends LitElement {
|
|
599
|
+
static styles: any[];
|
|
600
|
+
private isInitialized;
|
|
601
|
+
private static _instance;
|
|
602
|
+
devtoolsSettings: Required<DevtoolsSettings>;
|
|
603
|
+
private constructor();
|
|
604
|
+
private static createAndAppendInstance;
|
|
605
|
+
static initialize(props?: DeepPartial<DevtoolsSettings>): ForesightDevtools;
|
|
606
|
+
static get instance(): ForesightDevtools;
|
|
607
|
+
disconnectedCallback(): void;
|
|
608
|
+
private shouldUpdateSetting;
|
|
609
|
+
private updateLoggingSetting;
|
|
610
|
+
private updateShowSetting;
|
|
611
|
+
/**
|
|
612
|
+
* Set every flag inside `show` to the same value. Useful for "turn the
|
|
613
|
+
* entire devtools UI off" without listing each key.
|
|
614
|
+
*/
|
|
615
|
+
setAllShow(value: boolean): void;
|
|
616
|
+
alterDevtoolsSettings(props?: DeepPartial<DevtoolsSettings>): void;
|
|
617
|
+
private cleanup;
|
|
618
|
+
render(): any;
|
|
619
|
+
}
|
|
620
|
+
declare global {
|
|
621
|
+
interface HTMLElementTagNameMap {
|
|
622
|
+
"foresight-devtools": ForesightDevtools;
|
|
623
|
+
}
|
|
624
|
+
} //# sourceMappingURL=foresight-devtools.d.ts.map
|
|
625
|
+
//#endregion
|
|
626
|
+
export { type DebuggerBooleanSettingKeys, type DevtoolsSettings, ForesightDevtools, type SortElementList };
|
|
627
|
+
//# sourceMappingURL=index.d.mts.map
|