js.foresight-devtools 1.0.3 → 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 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$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';
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 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";
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$1;
251
+ hitslop: HitSlop;
345
252
  }
346
253
  interface ElementUnregisteredPayload extends PayloadBase {
347
254
  type: "elementUnregistered";
@@ -349,6 +256,7 @@ interface ElementUnregisteredPayload extends PayloadBase {
349
256
  id: string;
350
257
  registerCount: number;
351
258
  unregisterReason: string;
259
+ wasLastElement: boolean;
352
260
  }
353
261
  interface ElementDataUpdatedPayload extends PayloadBase {
354
262
  type: "elementDataUpdated";
@@ -390,7 +298,7 @@ interface ScrollTrajectoryUpdatePayload extends PayloadBase {
390
298
  }
391
299
  interface ManagerSettingsChangedPayload extends PayloadBase {
392
300
  type: "managerSettingsChanged";
393
- globalSettings: ForesightManagerSettings$1;
301
+ globalSettings: ForesightManagerSettings;
394
302
  settingsChanged: UpdatedManagerSetting[];
395
303
  }
396
304
  interface SerializationErrorPayload extends PayloadBase {
@@ -398,7 +306,17 @@ interface SerializationErrorPayload extends PayloadBase {
398
306
  error: "Failed to serialize event data";
399
307
  errorMessage: string;
400
308
  }
401
- type SerializedEventData = ElementRegisteredPayload | ElementUnregisteredPayload | ElementDataUpdatedPayload | CallbackInvokedPayload | CallbackCompletedPayload | MouseTrajectoryUpdatePayload | ScrollTrajectoryUpdatePayload | ManagerSettingsChangedPayload | SerializationErrorPayload;
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;
402
320
 
403
321
  declare class SingleLog extends LitElement {
404
322
  static styles: lit.CSSResult[];
@@ -448,6 +366,9 @@ declare class LogTab extends LitElement {
448
366
  private removeAllEventListeners;
449
367
  private getEventColor;
450
368
  private handleEvent;
369
+ private addLog;
370
+ private logManagerData;
371
+ private addManagerLog;
451
372
  private addEventLog;
452
373
  render(): lit.TemplateResult<1>;
453
374
  }
@@ -474,7 +395,7 @@ declare class SettingItemCheckbox extends LitElement {
474
395
  isChecked: boolean;
475
396
  header: string;
476
397
  description: string;
477
- setting: keyof ForesightManagerSettings$2 | keyof DevtoolsSettings;
398
+ setting: keyof ForesightManagerSettings$1 | keyof DevtoolsSettings;
478
399
  private handleCheckboxChange;
479
400
  render(): lit.TemplateResult<1>;
480
401
  }
@@ -492,7 +413,7 @@ declare class SettingItemRange extends LitElement {
492
413
  unit: string;
493
414
  header: string;
494
415
  description: string;
495
- setting: keyof ForesightManagerSettings$2;
416
+ setting: keyof ForesightManagerSettings$1;
496
417
  private displayValue;
497
418
  private handleRangeInput;
498
419
  private handleRangeChange;
@@ -530,12 +451,14 @@ declare global {
530
451
  }
531
452
 
532
453
  declare class ElementOverlays extends LitElement {
533
- private overlayDataMap;
454
+ private overlayMap;
534
455
  private callbackAnimations;
535
- private showNameTags;
456
+ private containerElement;
536
457
  static styles: lit.CSSResult[];
537
458
  private _abortController;
538
459
  connectedCallback(): void;
460
+ private createElementOverlays;
461
+ private updateElementOverlays;
539
462
  private createOrUpdateElementOverlay;
540
463
  private removeElementOverlay;
541
464
  private clearCallbackAnimationTimeout;