@atlaskit/pragmatic-drag-and-drop 1.7.7 → 1.7.9

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,5 +1,19 @@
1
1
  # @atlaskit/pragmatic-drag-and-drop
2
2
 
3
+ ## 1.7.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`acb61d1d6efd9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/acb61d1d6efd9) -
8
+ Add dependency for a11y testing.
9
+
10
+ ## 1.7.8
11
+
12
+ ### Patch Changes
13
+
14
+ - [`6d87d08be8526`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6d87d08be8526) -
15
+ Add dependency for a11y testing.
16
+
3
17
  ## 1.7.7
4
18
 
5
19
  ### Patch Changes
@@ -67,7 +81,6 @@
67
81
  [`65021fc0267e2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/65021fc0267e2) -
68
82
  The cleanup functions returned by the following utilities now only work on the first call. This
69
83
  was done to prevent unexpected side effects of calling a cleanup function multiple times.
70
-
71
84
  - `@atlaskit/pragmatic-drag-and-drop/adapter/element`
72
85
  - `draggable`
73
86
  - `dropTargetForElements`
@@ -129,7 +142,6 @@
129
142
  [`ef9d1cdc6ea92`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ef9d1cdc6ea92) -
130
143
  The `pointerOutsideOfPreview()` utility will now correctly push the preview forward in right to
131
144
  left layouts.
132
-
133
145
  - Left to right (ltr): preview on right hand side of pointer
134
146
  - Right to left (rtl): preview on left hand side of pointer (**new improvement**)
135
147
 
@@ -246,7 +258,6 @@
246
258
  ability for a user to drag into an `<iframe>` element.
247
259
 
248
260
  Scenarios where this can be helpful:
249
-
250
261
  - When you are shifting the interface around in reponse to a drag operation and you don't want the
251
262
  drag to enter into an `<iframe>` (for example - when resizing)
252
263
  - When you don't want the user to be able to drag into a `<iframe>` on the page (there could be
@@ -331,7 +342,6 @@
331
342
  incorrect styles being applied to elements that the user is not currently over during a drag.
332
343
 
333
344
  **Outcomes**
334
-
335
345
  - Elements will no longer receive `MouseEvent`s (eg `"mouseenter"` and `"mouseleave"`) during a
336
346
  drag (which is a violation of the
337
347
  [drag and drop specification](https://html.spec.whatwg.org/multipage/dnd.html#drag-and-drop-processing-model))
@@ -366,7 +376,6 @@
366
376
  [`2f5d213b2613`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2f5d213b2613) -
367
377
  These fixes only impact situations were you have native drag and drop code in addition to
368
378
  Pragmatic drag and drop running on your page.
369
-
370
379
  - Fix: if a `"drop"` is caused by non Pragmatic drag and drop code on the page, then we will no
371
380
  longer cancel the `"drop"` event.
372
381
  - Fix: No longer exposing external adapter data (`source.items`) in `onDrop` if not dropping on a
@@ -454,7 +463,6 @@
454
463
  [`4d9e25ab4eaa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d9e25ab4eaa) -
455
464
  Updating the descriptions of Pragmatic drag and drop packages, so they each provide a consistent
456
465
  description to various consumers, and so they are consistently formed amongst each other.
457
-
458
466
  - `package.json` `description`
459
467
  - `README.md`
460
468
  - Website documentation
@@ -643,7 +651,6 @@
643
651
  > Scenario: `[A(sticky)]` → `[]` + `A` is unmounted Result: `[]`
644
652
 
645
653
  To help facilitate this change:
646
-
647
654
  - `getIsSticky()` is now only called when an _drop target_ is a potential candidate for stickiness
648
655
  (previously it was called repeatedly)
649
656
  - `getIsSticky()` and `canDrop()` are called on _drop targets_ that are no longer being dragged
@@ -834,7 +841,6 @@
834
841
  finishes, an unrelated element can be entered into.
835
842
  - [`ba7ea570aee`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ba7ea570aee) - > Both
836
843
  of these changes should not impact most consumers as they are targeted at edge cases.
837
-
838
844
  - **Fix**: We no longer extract user input (eg `clientX`) from native `"dragleave"` events due to
839
845
  a
840
846
  [Bug with Chrome we discovered](https://bugs.chromium.org/p/chromium/issues/detail?id=1429937).
@@ -859,7 +865,6 @@
859
865
  - [#30879](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30879)
860
866
  [`2582df26509`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2582df26509) - Fixing a
861
867
  browser bug where after a drag finishes, a unrelated element can be entered into by the browser
862
-
863
868
  - [Visual explanation of bug](https://twitter.com/alexandereardon/status/1633614212873465856)
864
869
  - [Chrome bug](https://bugs.chromium.org/p/chromium/issues/detail?id=410328)
865
870
 
@@ -1025,7 +1030,6 @@
1025
1030
  - [#24613](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24613)
1026
1031
  [`1cf9e484b4b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1cf9e484b4b) - We have
1027
1032
  improved our naming consistency across our drag and drop packages.
1028
-
1029
1033
  - `@atlaskit/drag-and-drop/util/cancel-unhandled` has been renamed to
1030
1034
  `@atlaskit/drag-and-drop/addon/cancel-unhandled`
1031
1035
 
@@ -1,4 +1,4 @@
1
- import { type AllEvents, type BaseEventPayload, type CleanupFn, type DropTargetEventBasePayload, type DropTargetEventPayloadMap, type DropTargetGetFeedbackArgs, type ElementDragType, type EventPayloadMap, type Input, type MonitorGetFeedbackArgs, type NativeMediaType } from '../internal-types';
1
+ import { type AllEvents, type BaseEventPayload, type CleanupFn, type DropTargetArgs, type DropTargetEventBasePayload, type DropTargetEventPayloadMap, type DropTargetGetFeedbackArgs, type ElementDragType, type EventPayloadMap, type Input, type MonitorArgs, type MonitorGetFeedbackArgs, type NativeMediaType } from '../internal-types';
2
2
  type DraggableGetFeedbackArgs = {
3
3
  /**
4
4
  * The user input as a drag is trying to start (the `initial` input)
@@ -37,8 +37,8 @@ type DraggableArgs = {
37
37
  [Key in NativeMediaType]?: string;
38
38
  };
39
39
  } & Partial<AllEvents<ElementDragType>>;
40
- export declare const dropTargetForElements: (args: import("../internal-types").DropTargetArgs<ElementDragType>) => CleanupFn;
41
- export declare const monitorForElements: (args: import("../internal-types").MonitorArgs<ElementDragType>) => CleanupFn;
40
+ export declare const dropTargetForElements: (args: DropTargetArgs<ElementDragType>) => CleanupFn;
41
+ export declare const monitorForElements: (args: MonitorArgs<ElementDragType>) => CleanupFn;
42
42
  export declare function draggable(args: DraggableArgs): CleanupFn;
43
43
  /** Common event payload for all events */
44
44
  export type ElementEventBasePayload = BaseEventPayload<ElementDragType>;
@@ -1,4 +1,4 @@
1
- import { type BaseEventPayload, type CleanupFn, type DropTargetEventBasePayload, type DropTargetEventPayloadMap, type DropTargetGetFeedbackArgs, type EventPayloadMap, type ExternalDragType, type MonitorGetFeedbackArgs, type NativeMediaType } from '../internal-types';
1
+ import { type BaseEventPayload, type CleanupFn, type DropTargetArgs, type DropTargetEventBasePayload, type DropTargetEventPayloadMap, type DropTargetGetFeedbackArgs, type EventPayloadMap, type ExternalDragType, type MonitorArgs, type MonitorGetFeedbackArgs, type NativeMediaType } from '../internal-types';
2
2
  export declare function isAnAvailableType({ type, value }: {
3
3
  type: string;
4
4
  value: string;
@@ -7,8 +7,8 @@ export declare function getAvailableTypes(transfer: DataTransfer): NativeMediaTy
7
7
  export declare function getAvailableItems(dataTransfer: DataTransfer): DataTransferItem[];
8
8
  declare const adapter: {
9
9
  registerUsage: () => CleanupFn;
10
- dropTarget: (args: import("../internal-types").DropTargetArgs<ExternalDragType>) => CleanupFn;
11
- monitor: (args: import("../internal-types").MonitorArgs<ExternalDragType>) => CleanupFn;
10
+ dropTarget: (args: DropTargetArgs<ExternalDragType>) => CleanupFn;
11
+ monitor: (args: MonitorArgs<ExternalDragType>) => CleanupFn;
12
12
  };
13
13
  /**
14
14
  * Some events don't make sense for the external adapter
@@ -1,8 +1,8 @@
1
- import { type BaseEventPayload, type CleanupFn, type DropTargetEventBasePayload, type DropTargetEventPayloadMap, type DropTargetGetFeedbackArgs, type EventPayloadMap, type MonitorGetFeedbackArgs, type TextSelectionDragType } from '../internal-types';
1
+ import { type BaseEventPayload, type CleanupFn, type DropTargetArgs, type DropTargetEventBasePayload, type DropTargetEventPayloadMap, type DropTargetGetFeedbackArgs, type EventPayloadMap, type MonitorArgs, type MonitorGetFeedbackArgs, type TextSelectionDragType } from '../internal-types';
2
2
  declare const adapter: {
3
3
  registerUsage: () => CleanupFn;
4
- dropTarget: (args: import("../internal-types").DropTargetArgs<TextSelectionDragType>) => CleanupFn;
5
- monitor: (args: import("../internal-types").MonitorArgs<TextSelectionDragType>) => CleanupFn;
4
+ dropTarget: (args: DropTargetArgs<TextSelectionDragType>) => CleanupFn;
5
+ monitor: (args: MonitorArgs<TextSelectionDragType>) => CleanupFn;
6
6
  };
7
7
  type StripPreviewEvent<T> = Omit<T, 'onGenerateDragPreview'>;
8
8
  export declare function dropTargetForTextSelection(args: StripPreviewEvent<Parameters<typeof adapter.dropTarget>[0]>): CleanupFn;
@@ -8,7 +8,7 @@ export declare function makeDispatch<DragType extends AllDragTypes>({ source, in
8
8
  }) => void;
9
9
  }): {
10
10
  start({ nativeSetDragImage }: {
11
- nativeSetDragImage: DataTransfer["setDragImage"] | null;
11
+ nativeSetDragImage: DataTransfer['setDragImage'] | null;
12
12
  }): void;
13
13
  dragUpdate({ current }: {
14
14
  current: DragLocation;
@@ -21,6 +21,6 @@ export declare function makeDispatch<DragType extends AllDragTypes>({ source, in
21
21
  /** When dragging from an external source, we need to collect the
22
22
  drag source information again as it is often only available during
23
23
  the "drop" event */
24
- updatedSourcePayload: DragType["payload"] | null;
24
+ updatedSourcePayload: DragType['payload'] | null;
25
25
  }): void;
26
26
  };
@@ -1,4 +1,4 @@
1
- import { type AdapterAPI, type AllDragTypes, type CleanupFn, type DropTargetAllowedDropEffect, type EventPayloadMap } from '../internal-types';
1
+ import { type AdapterAPI, type AllDragTypes, type CleanupFn, type DropTargetAllowedDropEffect, type DropTargetArgs, type EventPayloadMap, type MonitorArgs } from '../internal-types';
2
2
  export declare function makeAdapter<DragType extends AllDragTypes>({ typeKey, mount, dispatchEventToSource, onPostDispatch, defaultDropEffect, }: {
3
3
  typeKey: DragType['type'];
4
4
  mount: (api: AdapterAPI<DragType>) => CleanupFn;
@@ -13,6 +13,6 @@ export declare function makeAdapter<DragType extends AllDragTypes>({ typeKey, mo
13
13
  }) => void;
14
14
  }): {
15
15
  registerUsage: () => CleanupFn;
16
- dropTarget: (args: import("../internal-types").DropTargetArgs<DragType>) => CleanupFn;
17
- monitor: (args: import("../internal-types").MonitorArgs<DragType>) => CleanupFn;
16
+ dropTarget: (args: DropTargetArgs<DragType>) => CleanupFn;
17
+ monitor: (args: MonitorArgs<DragType>) => CleanupFn;
18
18
  };
@@ -1,9 +1,12 @@
1
1
  export declare function getBindingsForBrokenDrags({ onDragEnd }: {
2
2
  onDragEnd: () => void;
3
- }): readonly [{
4
- readonly type: "pointermove";
5
- readonly listener: () => void;
6
- }, {
7
- readonly type: "pointerdown";
8
- readonly listener: () => void;
9
- }];
3
+ }): readonly [
4
+ {
5
+ readonly type: 'pointermove';
6
+ readonly listener: () => void;
7
+ },
8
+ {
9
+ readonly type: 'pointerdown';
10
+ readonly listener: () => void;
11
+ }
12
+ ];
@@ -1,4 +1,4 @@
1
- import { type AllEvents, type BaseEventPayload, type CleanupFn, type DropTargetEventBasePayload, type DropTargetEventPayloadMap, type DropTargetGetFeedbackArgs, type ElementDragType, type EventPayloadMap, type Input, type MonitorGetFeedbackArgs, type NativeMediaType } from '../internal-types';
1
+ import { type AllEvents, type BaseEventPayload, type CleanupFn, type DropTargetArgs, type DropTargetEventBasePayload, type DropTargetEventPayloadMap, type DropTargetGetFeedbackArgs, type ElementDragType, type EventPayloadMap, type Input, type MonitorArgs, type MonitorGetFeedbackArgs, type NativeMediaType } from '../internal-types';
2
2
  type DraggableGetFeedbackArgs = {
3
3
  /**
4
4
  * The user input as a drag is trying to start (the `initial` input)
@@ -37,8 +37,8 @@ type DraggableArgs = {
37
37
  [Key in NativeMediaType]?: string;
38
38
  };
39
39
  } & Partial<AllEvents<ElementDragType>>;
40
- export declare const dropTargetForElements: (args: import("../internal-types").DropTargetArgs<ElementDragType>) => CleanupFn;
41
- export declare const monitorForElements: (args: import("../internal-types").MonitorArgs<ElementDragType>) => CleanupFn;
40
+ export declare const dropTargetForElements: (args: DropTargetArgs<ElementDragType>) => CleanupFn;
41
+ export declare const monitorForElements: (args: MonitorArgs<ElementDragType>) => CleanupFn;
42
42
  export declare function draggable(args: DraggableArgs): CleanupFn;
43
43
  /** Common event payload for all events */
44
44
  export type ElementEventBasePayload = BaseEventPayload<ElementDragType>;
@@ -1,4 +1,4 @@
1
- import { type BaseEventPayload, type CleanupFn, type DropTargetEventBasePayload, type DropTargetEventPayloadMap, type DropTargetGetFeedbackArgs, type EventPayloadMap, type ExternalDragType, type MonitorGetFeedbackArgs, type NativeMediaType } from '../internal-types';
1
+ import { type BaseEventPayload, type CleanupFn, type DropTargetArgs, type DropTargetEventBasePayload, type DropTargetEventPayloadMap, type DropTargetGetFeedbackArgs, type EventPayloadMap, type ExternalDragType, type MonitorArgs, type MonitorGetFeedbackArgs, type NativeMediaType } from '../internal-types';
2
2
  export declare function isAnAvailableType({ type, value }: {
3
3
  type: string;
4
4
  value: string;
@@ -7,8 +7,8 @@ export declare function getAvailableTypes(transfer: DataTransfer): NativeMediaTy
7
7
  export declare function getAvailableItems(dataTransfer: DataTransfer): DataTransferItem[];
8
8
  declare const adapter: {
9
9
  registerUsage: () => CleanupFn;
10
- dropTarget: (args: import("../internal-types").DropTargetArgs<ExternalDragType>) => CleanupFn;
11
- monitor: (args: import("../internal-types").MonitorArgs<ExternalDragType>) => CleanupFn;
10
+ dropTarget: (args: DropTargetArgs<ExternalDragType>) => CleanupFn;
11
+ monitor: (args: MonitorArgs<ExternalDragType>) => CleanupFn;
12
12
  };
13
13
  /**
14
14
  * Some events don't make sense for the external adapter
@@ -1,8 +1,8 @@
1
- import { type BaseEventPayload, type CleanupFn, type DropTargetEventBasePayload, type DropTargetEventPayloadMap, type DropTargetGetFeedbackArgs, type EventPayloadMap, type MonitorGetFeedbackArgs, type TextSelectionDragType } from '../internal-types';
1
+ import { type BaseEventPayload, type CleanupFn, type DropTargetArgs, type DropTargetEventBasePayload, type DropTargetEventPayloadMap, type DropTargetGetFeedbackArgs, type EventPayloadMap, type MonitorArgs, type MonitorGetFeedbackArgs, type TextSelectionDragType } from '../internal-types';
2
2
  declare const adapter: {
3
3
  registerUsage: () => CleanupFn;
4
- dropTarget: (args: import("../internal-types").DropTargetArgs<TextSelectionDragType>) => CleanupFn;
5
- monitor: (args: import("../internal-types").MonitorArgs<TextSelectionDragType>) => CleanupFn;
4
+ dropTarget: (args: DropTargetArgs<TextSelectionDragType>) => CleanupFn;
5
+ monitor: (args: MonitorArgs<TextSelectionDragType>) => CleanupFn;
6
6
  };
7
7
  type StripPreviewEvent<T> = Omit<T, 'onGenerateDragPreview'>;
8
8
  export declare function dropTargetForTextSelection(args: StripPreviewEvent<Parameters<typeof adapter.dropTarget>[0]>): CleanupFn;
@@ -8,7 +8,7 @@ export declare function makeDispatch<DragType extends AllDragTypes>({ source, in
8
8
  }) => void;
9
9
  }): {
10
10
  start({ nativeSetDragImage }: {
11
- nativeSetDragImage: DataTransfer["setDragImage"] | null;
11
+ nativeSetDragImage: DataTransfer['setDragImage'] | null;
12
12
  }): void;
13
13
  dragUpdate({ current }: {
14
14
  current: DragLocation;
@@ -21,6 +21,6 @@ export declare function makeDispatch<DragType extends AllDragTypes>({ source, in
21
21
  /** When dragging from an external source, we need to collect the
22
22
  drag source information again as it is often only available during
23
23
  the "drop" event */
24
- updatedSourcePayload: DragType["payload"] | null;
24
+ updatedSourcePayload: DragType['payload'] | null;
25
25
  }): void;
26
26
  };
@@ -1,4 +1,4 @@
1
- import { type AdapterAPI, type AllDragTypes, type CleanupFn, type DropTargetAllowedDropEffect, type EventPayloadMap } from '../internal-types';
1
+ import { type AdapterAPI, type AllDragTypes, type CleanupFn, type DropTargetAllowedDropEffect, type DropTargetArgs, type EventPayloadMap, type MonitorArgs } from '../internal-types';
2
2
  export declare function makeAdapter<DragType extends AllDragTypes>({ typeKey, mount, dispatchEventToSource, onPostDispatch, defaultDropEffect, }: {
3
3
  typeKey: DragType['type'];
4
4
  mount: (api: AdapterAPI<DragType>) => CleanupFn;
@@ -13,6 +13,6 @@ export declare function makeAdapter<DragType extends AllDragTypes>({ typeKey, mo
13
13
  }) => void;
14
14
  }): {
15
15
  registerUsage: () => CleanupFn;
16
- dropTarget: (args: import("../internal-types").DropTargetArgs<DragType>) => CleanupFn;
17
- monitor: (args: import("../internal-types").MonitorArgs<DragType>) => CleanupFn;
16
+ dropTarget: (args: DropTargetArgs<DragType>) => CleanupFn;
17
+ monitor: (args: MonitorArgs<DragType>) => CleanupFn;
18
18
  };
@@ -2,11 +2,11 @@ export declare function getBindingsForBrokenDrags({ onDragEnd }: {
2
2
  onDragEnd: () => void;
3
3
  }): readonly [
4
4
  {
5
- readonly type: "pointermove";
5
+ readonly type: 'pointermove';
6
6
  readonly listener: () => void;
7
7
  },
8
8
  {
9
- readonly type: "pointerdown";
9
+ readonly type: 'pointerdown';
10
10
  readonly listener: () => void;
11
11
  }
12
12
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/pragmatic-drag-and-drop",
3
- "version": "1.7.7",
3
+ "version": "1.7.9",
4
4
  "description": "The core package for Pragmatic drag and drop - enabling fast drag and drop for any experience on any tech stack",
5
5
  "repository": "https://github.com/atlassian/pragmatic-drag-and-drop",
6
6
  "author": "Atlassian Pty Ltd",
@@ -42,10 +42,11 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "@af/integration-testing": "workspace:^",
45
- "@atlaskit/link": "^3.2.0",
45
+ "@atlaskit/link": "^3.3.0",
46
+ "@atlassian/a11y-jest-testing": "^0.10.0",
46
47
  "@emotion/react": "^11.7.1",
47
48
  "@testing-library/dom": "^10.1.0",
48
- "@testing-library/react": "^13.4.0",
49
+ "@testing-library/react": "^16.3.0",
49
50
  "@types/raf-schd": "^4.0.1",
50
51
  "globby": "^6.1.0",
51
52
  "react": "^18.2.0",