dragselect 3.0.4 → 3.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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 3.0.5
2
+
3
+ - Fix type issue during build bug [#212](https://github.com/ThibaultJanBeyer/DragSelect/issues/212)
4
+
1
5
  # 3.0.4
2
6
 
3
7
  - Fix scrolling bug ([#208](https://github.com/ThibaultJanBeyer/DragSelect/issues/208)) thanks to [@dbougan](https://github.com/dbougan)
@@ -103,7 +103,6 @@ declare class Interaction<E extends DSInputElement> {
103
103
  private removeDocEventListeners;
104
104
  }
105
105
 
106
- type DSPublicPublishEventNames<E extends DSInputElement> = keyof DSPublicPublish<E>;
107
106
  type DSPublicPublishAdditionalEventData<E extends DSInputElement> = {
108
107
  /** The dropZone element that the element was dropped into (or the mouse is currently hovering over) */
109
108
  dropTarget?: DSDropZone<E>;
@@ -440,7 +439,6 @@ type DSInputElement = HTMLElement | SVGElement;
440
439
  type DSMultiSelectKeys = Array<'Shift' | 'Control' | 'Meta' | string>;
441
440
  type DSEvent = KeyboardEvent | MouseEvent | PointerEvent | TouchEvent;
442
441
  type DSInternalEventName = DSSettingsPublishEventNames | DSAreaPublishEventNames | DSKeyStorePublishEventNames | DSPointerStorePublishEventNames | DSInteractionPublishEventNames | DSSelectablePublishEventNames | DSSelectedPublishEventNames;
443
- type DSCallbackName<E extends DSInputElement> = DSPublicPublishEventNames<E> | DSInternalEventName;
444
442
  type DSBoundingRectBase = {
445
443
  top: number;
446
444
  left: number;
@@ -507,7 +505,7 @@ declare class PubSub<E extends DSInputElement> {
507
505
  * @param callback the callback method signature, has to be exactly the same as when subscribing. Consider using "id" instead.
508
506
  * @param id event id returned when subscribed (more performant than callback search)
509
507
  */
510
- unsubscribe: <K extends DSSettingsPublishEventNames | DSKeyStorePublishEventNames | DSPointerStorePublishEventNames | DSSelectedPublishEventNames | keyof DSAreaPublish<E> | keyof DSInteractionPublish | keyof DSSelectablePublish<E> | keyof DSPublicPublish<E>>(eventName: K, callback?: DSCallback<DSPublishMappings<E>[K]> | undefined, id?: number) => void;
508
+ unsubscribe: <K extends DSSettingsPublishEventNames | DSKeyStorePublishEventNames | DSPointerStorePublishEventNames | DSSelectedPublishEventNames | keyof DSAreaPublish<E> | keyof DSInteractionPublish | keyof DSSelectablePublish<E> | keyof DSPublicPublish<E>>(eventName: K, callback?: DSCallback<DSPublishMappings<E>[K]> | null | undefined, id?: number) => void;
511
509
  /**
512
510
  * Publishes an event to all subscribers
513
511
  * @param eventName
@@ -737,7 +735,7 @@ type IsCollision = {
737
735
  (el1?: DSBoundingRectBase, el2?: DSBoundingRectBase, percent?: number): boolean;
738
736
  };
739
737
 
740
- declare class DragSelect<E extends DSInputElement> {
738
+ declare class DragSelect<E extends DSInputElement = DSInputElement> {
741
739
  /** used to skip all current Selection and dragNdrop functionality */
742
740
  continue: boolean;
743
741
  private PubSub;
@@ -764,7 +762,7 @@ declare class DragSelect<E extends DSInputElement> {
764
762
  /** Un-Subscribe from events */
765
763
  unsubscribe: <T extends keyof DSPublicPublish<E>>(eventName: T, callback?: DSCallback<DSPublishMappings<E>[T]> | undefined, id?: number) => void;
766
764
  /** Publish events */
767
- publish: <T extends DSCallbackName<E_1>>(eventName: T | T[], data: DSPublishMappings<E>[T]) => void;
765
+ publish: <T extends keyof DSPublicPublish<E> | DSInternalEventName>(eventName: T | T[], data: DSPublishMappings<E>[T]) => void;
768
766
  /** Initializes the functionality. Automatically triggered when created. Also, reset the functionality after a teardown */
769
767
  start: () => void;
770
768
  /**
@@ -874,4 +872,4 @@ declare class DragSelect<E extends DSInputElement> {
874
872
 
875
873
  type DSPubCallback<T extends keyof DSPublicPublish<E>, E extends DSInputElement = DSInputElement> = DSCallback<DSPublishMappings<E>[T]>;
876
874
 
877
- export { type DSArea, type DSBoundingRect, type DSBoundingRectBase, type DSCallbackName, type DSCallbackObject, type DSDragKeys, type DSEdges, type DSEdgesObj, type DSElementPos, type DSEvent, type DSInputDropZone, type DSInputElement, type DSInternalEventName, type DSMultiSelectKeys, type DSPubCallback, type DSSelectorArea, type Settings, type Vect2, DragSelect as default };
875
+ export { type DSArea, type DSBoundingRect, type DSBoundingRectBase, type DSCallbackObject, type DSDragKeys, type DSEdges, type DSEdgesObj, type DSElementPos, type DSEvent, type DSInputDropZone, type DSInputElement, type DSInternalEventName, type DSMultiSelectKeys, type DSPubCallback, type DSSelectorArea, type Settings, type Vect2, DragSelect as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dragselect",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "description": "Easy JavaScript library for selecting and moving elements. With no dependencies. Drag-Select & Drag-And-Drop.",
5
5
  "main": "./dist/DragSelect.js",
6
6
  "module": "./dist/DragSelect.esm.js",