@atlaskit/pragmatic-drag-and-drop 1.0.0 → 1.0.1
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 +6 -0
- package/dist/cjs/adapter/element-adapter.js +7 -0
- package/dist/cjs/adapter/external-adapter.js +7 -0
- package/dist/cjs/adapter/text-selection-adapter.js +8 -1
- package/dist/es2019/adapter/element-adapter.js +15 -0
- package/dist/es2019/adapter/external-adapter.js +15 -0
- package/dist/es2019/adapter/text-selection-adapter.js +16 -1
- package/dist/esm/adapter/element-adapter.js +7 -0
- package/dist/esm/adapter/external-adapter.js +7 -0
- package/dist/esm/adapter/text-selection-adapter.js +8 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/pragmatic-drag-and-drop
|
|
2
2
|
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#76476](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/76476) [`35148e092790`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35148e092790) - Adding warning for test environments to let people know if DragEvents have not been setup correctly.
|
|
8
|
+
|
|
3
9
|
## 1.0.0
|
|
4
10
|
|
|
5
11
|
### Major Changes
|
|
@@ -51,6 +51,13 @@ var adapter = (0, _makeAdapter.makeAdapter)({
|
|
|
51
51
|
// If there is not `dataTransfer`, we can assume something is wrong and not
|
|
52
52
|
// start a drag
|
|
53
53
|
if (!event.dataTransfer) {
|
|
54
|
+
// Including this code on "test" and "development" environments:
|
|
55
|
+
// - Browser tests commonly run against "development" builds
|
|
56
|
+
// - Unit tests commonly run in "test"
|
|
57
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
58
|
+
// eslint-disable-next-line no-console
|
|
59
|
+
console.warn("\n It appears as though you have are not testing DragEvents correctly.\n\n - If you are unit testing, ensure you have pollyfilled DragEvent.\n - If you are browser testing, ensure you are dispatching drag events correctly.\n\n Please see our testing guides for more information:\n https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing\n ".replace(/ {2}/g, ''));
|
|
60
|
+
}
|
|
54
61
|
return;
|
|
55
62
|
}
|
|
56
63
|
|
|
@@ -74,6 +74,13 @@ var adapter = (0, _makeAdapter.makeAdapter)({
|
|
|
74
74
|
|
|
75
75
|
// Something has gone wrong with our drag event
|
|
76
76
|
if (!event.dataTransfer) {
|
|
77
|
+
// Including this code on "test" and "development" environments:
|
|
78
|
+
// - Browser tests commonly run against "development" builds
|
|
79
|
+
// - Unit tests commonly run in "test"
|
|
80
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
81
|
+
// eslint-disable-next-line no-console
|
|
82
|
+
console.warn("\n It appears as though you have are not testing DragEvents correctly.\n\n - If you are unit testing, ensure you have pollyfilled DragEvent.\n - If you are browser testing, ensure you are dispatching drag events correctly.\n\n Please see our testing guides for more information:\n https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing\n ".replace(/ {2}/g, ''));
|
|
83
|
+
}
|
|
77
84
|
return;
|
|
78
85
|
}
|
|
79
86
|
if (!api.canStart(event)) {
|
|
@@ -74,7 +74,14 @@ var adapter = (0, _makeAdapter.makeAdapter)({
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// Something has gone wrong with our drag event
|
|
77
|
-
if (event.dataTransfer
|
|
77
|
+
if (!event.dataTransfer) {
|
|
78
|
+
// Including this code on "test" and "development" environments:
|
|
79
|
+
// - Browser tests commonly run against "development" builds
|
|
80
|
+
// - Unit tests commonly run in "test"
|
|
81
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
82
|
+
// eslint-disable-next-line no-console
|
|
83
|
+
console.warn("\n It appears as though you have are not testing DragEvents correctly.\n\n - If you are unit testing, ensure you have pollyfilled DragEvent.\n - If you are browser testing, ensure you are dispatching drag events correctly.\n\n Please see our testing guides for more information:\n https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing\n ".replace(/ {2}/g, ''));
|
|
84
|
+
}
|
|
78
85
|
return;
|
|
79
86
|
}
|
|
80
87
|
|
|
@@ -42,6 +42,21 @@ const adapter = makeAdapter({
|
|
|
42
42
|
// If there is not `dataTransfer`, we can assume something is wrong and not
|
|
43
43
|
// start a drag
|
|
44
44
|
if (!event.dataTransfer) {
|
|
45
|
+
// Including this code on "test" and "development" environments:
|
|
46
|
+
// - Browser tests commonly run against "development" builds
|
|
47
|
+
// - Unit tests commonly run in "test"
|
|
48
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
49
|
+
// eslint-disable-next-line no-console
|
|
50
|
+
console.warn(`
|
|
51
|
+
It appears as though you have are not testing DragEvents correctly.
|
|
52
|
+
|
|
53
|
+
- If you are unit testing, ensure you have pollyfilled DragEvent.
|
|
54
|
+
- If you are browser testing, ensure you are dispatching drag events correctly.
|
|
55
|
+
|
|
56
|
+
Please see our testing guides for more information:
|
|
57
|
+
https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing
|
|
58
|
+
`.replace(/ {2}/g, ''));
|
|
59
|
+
}
|
|
45
60
|
return;
|
|
46
61
|
}
|
|
47
62
|
|
|
@@ -59,6 +59,21 @@ const adapter = makeAdapter({
|
|
|
59
59
|
|
|
60
60
|
// Something has gone wrong with our drag event
|
|
61
61
|
if (!event.dataTransfer) {
|
|
62
|
+
// Including this code on "test" and "development" environments:
|
|
63
|
+
// - Browser tests commonly run against "development" builds
|
|
64
|
+
// - Unit tests commonly run in "test"
|
|
65
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
66
|
+
// eslint-disable-next-line no-console
|
|
67
|
+
console.warn(`
|
|
68
|
+
It appears as though you have are not testing DragEvents correctly.
|
|
69
|
+
|
|
70
|
+
- If you are unit testing, ensure you have pollyfilled DragEvent.
|
|
71
|
+
- If you are browser testing, ensure you are dispatching drag events correctly.
|
|
72
|
+
|
|
73
|
+
Please see our testing guides for more information:
|
|
74
|
+
https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing
|
|
75
|
+
`.replace(/ {2}/g, ''));
|
|
76
|
+
}
|
|
62
77
|
return;
|
|
63
78
|
}
|
|
64
79
|
if (!api.canStart(event)) {
|
|
@@ -65,7 +65,22 @@ const adapter = makeAdapter({
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
// Something has gone wrong with our drag event
|
|
68
|
-
if (event.dataTransfer
|
|
68
|
+
if (!event.dataTransfer) {
|
|
69
|
+
// Including this code on "test" and "development" environments:
|
|
70
|
+
// - Browser tests commonly run against "development" builds
|
|
71
|
+
// - Unit tests commonly run in "test"
|
|
72
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
73
|
+
// eslint-disable-next-line no-console
|
|
74
|
+
console.warn(`
|
|
75
|
+
It appears as though you have are not testing DragEvents correctly.
|
|
76
|
+
|
|
77
|
+
- If you are unit testing, ensure you have pollyfilled DragEvent.
|
|
78
|
+
- If you are browser testing, ensure you are dispatching drag events correctly.
|
|
79
|
+
|
|
80
|
+
Please see our testing guides for more information:
|
|
81
|
+
https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing
|
|
82
|
+
`.replace(/ {2}/g, ''));
|
|
83
|
+
}
|
|
69
84
|
return;
|
|
70
85
|
}
|
|
71
86
|
|
|
@@ -43,6 +43,13 @@ var adapter = makeAdapter({
|
|
|
43
43
|
// If there is not `dataTransfer`, we can assume something is wrong and not
|
|
44
44
|
// start a drag
|
|
45
45
|
if (!event.dataTransfer) {
|
|
46
|
+
// Including this code on "test" and "development" environments:
|
|
47
|
+
// - Browser tests commonly run against "development" builds
|
|
48
|
+
// - Unit tests commonly run in "test"
|
|
49
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
50
|
+
// eslint-disable-next-line no-console
|
|
51
|
+
console.warn("\n It appears as though you have are not testing DragEvents correctly.\n\n - If you are unit testing, ensure you have pollyfilled DragEvent.\n - If you are browser testing, ensure you are dispatching drag events correctly.\n\n Please see our testing guides for more information:\n https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing\n ".replace(/ {2}/g, ''));
|
|
52
|
+
}
|
|
46
53
|
return;
|
|
47
54
|
}
|
|
48
55
|
|
|
@@ -63,6 +63,13 @@ var adapter = makeAdapter({
|
|
|
63
63
|
|
|
64
64
|
// Something has gone wrong with our drag event
|
|
65
65
|
if (!event.dataTransfer) {
|
|
66
|
+
// Including this code on "test" and "development" environments:
|
|
67
|
+
// - Browser tests commonly run against "development" builds
|
|
68
|
+
// - Unit tests commonly run in "test"
|
|
69
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
70
|
+
// eslint-disable-next-line no-console
|
|
71
|
+
console.warn("\n It appears as though you have are not testing DragEvents correctly.\n\n - If you are unit testing, ensure you have pollyfilled DragEvent.\n - If you are browser testing, ensure you are dispatching drag events correctly.\n\n Please see our testing guides for more information:\n https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing\n ".replace(/ {2}/g, ''));
|
|
72
|
+
}
|
|
66
73
|
return;
|
|
67
74
|
}
|
|
68
75
|
if (!api.canStart(event)) {
|
|
@@ -67,7 +67,14 @@ var adapter = makeAdapter({
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// Something has gone wrong with our drag event
|
|
70
|
-
if (event.dataTransfer
|
|
70
|
+
if (!event.dataTransfer) {
|
|
71
|
+
// Including this code on "test" and "development" environments:
|
|
72
|
+
// - Browser tests commonly run against "development" builds
|
|
73
|
+
// - Unit tests commonly run in "test"
|
|
74
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
75
|
+
// eslint-disable-next-line no-console
|
|
76
|
+
console.warn("\n It appears as though you have are not testing DragEvents correctly.\n\n - If you are unit testing, ensure you have pollyfilled DragEvent.\n - If you are browser testing, ensure you are dispatching drag events correctly.\n\n Please see our testing guides for more information:\n https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing\n ".replace(/ {2}/g, ''));
|
|
77
|
+
}
|
|
71
78
|
return;
|
|
72
79
|
}
|
|
73
80
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/pragmatic-drag-and-drop",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "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",
|