js.foresight-devtools 1.0.4 → 1.0.5
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.ts +21 -101
- package/dist/index.js +108 -79
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement, TemplateResult, PropertyValues } from 'lit';
|
|
3
|
-
import { ForesightEvent, ForesightElementData, ForesightManagerSettings as ForesightManagerSettings$
|
|
4
|
-
import { ForesightEvent as ForesightEvent$1, HitSlop
|
|
3
|
+
import { ForesightEvent, ForesightElementData, ForesightManagerSettings as ForesightManagerSettings$1 } from 'js.foresight';
|
|
4
|
+
import { ForesightEvent as ForesightEvent$1, HitSlop, UpdatedDataPropertyNames, CallbackHitType, Point, ScrollDirection, ForesightManagerSettings, UpdatedManagerSetting, CallbackHits, ForesightElementData as ForesightElementData$1 } from 'js.foresight/types/types';
|
|
5
5
|
|
|
6
6
|
type DeepPartial<T> = T extends object ? {
|
|
7
7
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
@@ -236,100 +236,7 @@ declare global {
|
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
type
|
|
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";
|
|
239
|
+
type SerializedEventType = ForesightEvent$1 | "serializationError" | "managerDataPayload";
|
|
333
240
|
interface PayloadBase {
|
|
334
241
|
type: SerializedEventType;
|
|
335
242
|
localizedTimestamp: string;
|
|
@@ -341,7 +248,7 @@ interface ElementRegisteredPayload extends PayloadBase {
|
|
|
341
248
|
name: string;
|
|
342
249
|
id: string;
|
|
343
250
|
registerCount: number;
|
|
344
|
-
hitslop: HitSlop
|
|
251
|
+
hitslop: HitSlop;
|
|
345
252
|
}
|
|
346
253
|
interface ElementUnregisteredPayload extends PayloadBase {
|
|
347
254
|
type: "elementUnregistered";
|
|
@@ -391,7 +298,7 @@ interface ScrollTrajectoryUpdatePayload extends PayloadBase {
|
|
|
391
298
|
}
|
|
392
299
|
interface ManagerSettingsChangedPayload extends PayloadBase {
|
|
393
300
|
type: "managerSettingsChanged";
|
|
394
|
-
globalSettings: ForesightManagerSettings
|
|
301
|
+
globalSettings: ForesightManagerSettings;
|
|
395
302
|
settingsChanged: UpdatedManagerSetting[];
|
|
396
303
|
}
|
|
397
304
|
interface SerializationErrorPayload extends PayloadBase {
|
|
@@ -399,7 +306,17 @@ interface SerializationErrorPayload extends PayloadBase {
|
|
|
399
306
|
error: "Failed to serialize event data";
|
|
400
307
|
errorMessage: string;
|
|
401
308
|
}
|
|
402
|
-
|
|
309
|
+
interface ManagerDataPayload extends PayloadBase {
|
|
310
|
+
type: "managerDataPayload";
|
|
311
|
+
warning: string;
|
|
312
|
+
globalCallbackHits: CallbackHits;
|
|
313
|
+
eventListenerCount: Record<string, number>;
|
|
314
|
+
managerSettings: ForesightManagerSettings;
|
|
315
|
+
registeredElements: Array<Omit<ForesightElementData$1, "element"> & {
|
|
316
|
+
elementInfo: string;
|
|
317
|
+
}>;
|
|
318
|
+
}
|
|
319
|
+
type SerializedEventData = ElementRegisteredPayload | ElementUnregisteredPayload | ElementDataUpdatedPayload | CallbackInvokedPayload | CallbackCompletedPayload | MouseTrajectoryUpdatePayload | ScrollTrajectoryUpdatePayload | ManagerSettingsChangedPayload | ManagerDataPayload | SerializationErrorPayload;
|
|
403
320
|
|
|
404
321
|
declare class SingleLog extends LitElement {
|
|
405
322
|
static styles: lit.CSSResult[];
|
|
@@ -449,6 +366,9 @@ declare class LogTab extends LitElement {
|
|
|
449
366
|
private removeAllEventListeners;
|
|
450
367
|
private getEventColor;
|
|
451
368
|
private handleEvent;
|
|
369
|
+
private addLog;
|
|
370
|
+
private logManagerData;
|
|
371
|
+
private addManagerLog;
|
|
452
372
|
private addEventLog;
|
|
453
373
|
render(): lit.TemplateResult<1>;
|
|
454
374
|
}
|
|
@@ -475,7 +395,7 @@ declare class SettingItemCheckbox extends LitElement {
|
|
|
475
395
|
isChecked: boolean;
|
|
476
396
|
header: string;
|
|
477
397
|
description: string;
|
|
478
|
-
setting: keyof ForesightManagerSettings$
|
|
398
|
+
setting: keyof ForesightManagerSettings$1 | keyof DevtoolsSettings;
|
|
479
399
|
private handleCheckboxChange;
|
|
480
400
|
render(): lit.TemplateResult<1>;
|
|
481
401
|
}
|
|
@@ -493,7 +413,7 @@ declare class SettingItemRange extends LitElement {
|
|
|
493
413
|
unit: string;
|
|
494
414
|
header: string;
|
|
495
415
|
description: string;
|
|
496
|
-
setting: keyof ForesightManagerSettings$
|
|
416
|
+
setting: keyof ForesightManagerSettings$1;
|
|
497
417
|
private displayValue;
|
|
498
418
|
private handleRangeInput;
|
|
499
419
|
private handleRangeChange;
|