@planningcenter/react-beautiful-dnd 13.4.0 → 13.5.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/react-beautiful-dnd",
3
- "version": "13.4.0",
3
+ "version": "13.5.0",
4
4
  "description": "Beautiful and accessible drag and drop for lists with React",
5
5
  "author": "Front End Systems Engineering <frontend@planningcenter.com>",
6
6
  "keywords": [
@@ -49,7 +49,7 @@
49
49
  "bundle-size:update": "yarn build:clean && yarn build:dist && yarn build:clean",
50
50
  "build": "yarn build:clean && yarn build:dist && yarn build:flow",
51
51
  "build:clean": "rimraf dist",
52
- "build:dist": "rollup -c",
52
+ "build:dist": "NODE_OPTIONS=--openssl-legacy-provider rollup -c",
53
53
  "build:flow": "echo \"// @flow\n\nexport * from '../src';\" > dist/react-beautiful-dnd.cjs.js.flow",
54
54
  "storybook": "start-storybook -p 9002",
55
55
  "build-storybook": "build-storybook -c .storybook -o site",
@@ -65,7 +65,7 @@
65
65
  "use-memo-one": "^1.1.1"
66
66
  },
67
67
  "devDependencies": {
68
- "@atlaskit/css-reset": "5.0.12",
68
+ "@atlaskit/css-reset": "^6.6.2",
69
69
  "@atlaskit/theme": "9.5.6",
70
70
  "@babel/core": "7.9.0",
71
71
  "@babel/plugin-proposal-class-properties": "7.8.3",
@@ -78,9 +78,9 @@
78
78
  "@emotion/babel-preset-css-prop": "10.0.27",
79
79
  "@emotion/core": "10.0.28",
80
80
  "@emotion/styled": "10.0.27",
81
- "@storybook/addon-storysource": "5.3.21",
82
- "@storybook/react": "5.3.21",
83
- "@storybook/theming": "5.3.21",
81
+ "@storybook/addon-storysource": "^6.0.0",
82
+ "@storybook/react": "^6.0.0",
83
+ "@storybook/theming": "^6.0.0",
84
84
  "@testing-library/react": "10.4.9",
85
85
  "babel-core": "7.0.0-bridge.0",
86
86
  "babel-eslint": "10.1.0",
@@ -89,7 +89,7 @@
89
89
  "babel-plugin-dev-expression": "0.2.2",
90
90
  "babel-plugin-emotion": "10.0.33",
91
91
  "cross-env": "7.0.3",
92
- "cypress": "4.4.0",
92
+ "cypress": "^4.4.0",
93
93
  "emotion-theming": "10.0.27",
94
94
  "enzyme": "3.11.0",
95
95
  "enzyme-adapter-react-16": "1.15.2",
@@ -113,7 +113,7 @@
113
113
  "jest-axe": "3.5.0",
114
114
  "jest-junit": "10.0.0",
115
115
  "jest-watch-typeahead": "0.6.1",
116
- "lighthouse": "5.6.0",
116
+ "lighthouse": "^11.0.0",
117
117
  "markdown-it": "10.0.0",
118
118
  "prettier": "2.0.4",
119
119
  "raf-stub": "3.0.0",
@@ -124,16 +124,16 @@
124
124
  "react-window": "1.8.6",
125
125
  "require-from-string": "2.0.2",
126
126
  "rimraf": "3.0.2",
127
- "rollup": "2.6.1",
127
+ "rollup": "3.30.0",
128
128
  "rollup-plugin-babel": "4.4.0",
129
129
  "rollup-plugin-commonjs": "10.1.0",
130
- "rollup-plugin-json": "4.0.0",
130
+ "rollup-plugin-json": "^4.0.0",
131
131
  "rollup-plugin-node-resolve": "5.2.0",
132
132
  "rollup-plugin-replace": "2.2.0",
133
133
  "rollup-plugin-size-snapshot": "0.11.0",
134
134
  "rollup-plugin-strip": "1.2.2",
135
135
  "rollup-plugin-terser": "5.3.1",
136
- "storybook-addon-performance": "0.9.0",
136
+ "storybook-addon-performance": "^0.16.0",
137
137
  "styled-components": "5.1.0",
138
138
  "stylelint": "13.13.1",
139
139
  "stylelint-config-prettier": "8.0.2",
@@ -142,7 +142,7 @@
142
142
  "stylelint-config-styled-components": "0.1.1",
143
143
  "stylelint-processor-styled-components": "1.10.0",
144
144
  "wait-port": "0.2.9",
145
- "webpack": "4.42.1"
145
+ "webpack": "5.104.1"
146
146
  },
147
147
  "peerDependencies": {
148
148
  "react": "^16.8.5 || ^17.0.0 || ^18.0.0",
@@ -33,6 +33,40 @@ import { updateViewportMaxScroll as updateViewportMaxScrollAction } from '../../
33
33
  import StoreContext from '../context/store-context';
34
34
  import whatIsDraggedOverFromResult from '../../state/droppable/what-is-dragged-over-from-result';
35
35
 
36
+ function getBody(): HTMLElement {
37
+ invariant(document.body, 'document.body is not ready');
38
+ return document.body;
39
+ }
40
+
41
+ const defaultProps: DefaultProps = {
42
+ mode: 'standard',
43
+ type: 'DEFAULT',
44
+ direction: 'vertical',
45
+ isDropDisabled: false,
46
+ isCombineEnabled: false,
47
+ ignoreContainerClipping: false,
48
+ renderClone: null,
49
+ getContainerForClone: getBody,
50
+ };
51
+
52
+ const attachDefaultPropsToOwnProps = (ownProps: OwnProps) => {
53
+ // We need to assign default props manually because upcoming React version will stop supporting
54
+ // defaultProps on functional components.
55
+ // see: https://github.com/facebook/react/pull/25699
56
+ let mergedProps = { ...ownProps };
57
+ let defaultPropKey;
58
+ for (defaultPropKey in defaultProps) {
59
+ if (ownProps[defaultPropKey] === undefined) {
60
+ mergedProps = {
61
+ ...mergedProps,
62
+ [defaultPropKey]: defaultProps[defaultPropKey],
63
+ };
64
+ }
65
+ }
66
+
67
+ return mergedProps;
68
+ };
69
+
36
70
  const isMatchingType = (type: TypeId, critical: Critical): boolean =>
37
71
  type === critical.droppable.type;
38
72
 
@@ -137,10 +171,12 @@ export const makeMapStateToProps = (): Selector => {
137
171
  const selector = (state: State, ownProps: OwnProps): MapProps => {
138
172
  // not checking if item is disabled as we need the home list to display a placeholder
139
173
 
140
- const id: DroppableId = ownProps.droppableId;
141
- const type: TypeId = ownProps.type;
142
- const isEnabled: boolean = !ownProps.isDropDisabled;
143
- const renderClone: ?DraggableChildrenFn = ownProps.renderClone;
174
+ const ownPropsWithDefaultProps = attachDefaultPropsToOwnProps(ownProps);
175
+ const id: DroppableId = ownPropsWithDefaultProps.droppableId;
176
+ const type: TypeId = ownPropsWithDefaultProps.type;
177
+ const isEnabled = !ownPropsWithDefaultProps.isDropDisabled;
178
+ const renderClone: ?DraggableChildrenFn =
179
+ ownPropsWithDefaultProps.renderClone;
144
180
 
145
181
  if (state.isDragging) {
146
182
  const critical: Critical = state.critical;
@@ -227,22 +263,6 @@ const mapDispatchToProps: DispatchProps = {
227
263
  updateViewportMaxScroll: updateViewportMaxScrollAction,
228
264
  };
229
265
 
230
- function getBody(): HTMLElement {
231
- invariant(document.body, 'document.body is not ready');
232
- return document.body;
233
- }
234
-
235
- const defaultProps = ({
236
- mode: 'standard',
237
- type: 'DEFAULT',
238
- direction: 'vertical',
239
- isDropDisabled: false,
240
- isCombineEnabled: false,
241
- ignoreContainerClipping: false,
242
- renderClone: null,
243
- getContainerForClone: getBody,
244
- }: DefaultProps);
245
-
246
266
  // Abstract class allows to specify props and defaults to component.
247
267
  // All other ways give any or do not let add default props.
248
268
  // eslint-disable-next-line
@@ -260,9 +280,16 @@ const ConnectedDroppable: typeof DroppableType = connect(
260
280
  makeMapStateToProps,
261
281
  // no dispatch props for droppable
262
282
  mapDispatchToProps,
263
- // mergeProps - using default
264
- null,
265
- // $FlowFixMe: current react-redux type does not know about context property
283
+ // We need to assign default props manually because upcoming React version will stop supporting
284
+ // defaultProps on functional components.
285
+ // see: https://github.com/facebook/react/pull/25699
286
+ (stateProps: MapProps, dispatchProps: DispatchProps, ownProps: OwnProps) => {
287
+ return {
288
+ ...attachDefaultPropsToOwnProps(ownProps),
289
+ ...stateProps,
290
+ ...dispatchProps,
291
+ };
292
+ },
266
293
  {
267
294
  // Ensuring our context does not clash with consumers
268
295
  context: StoreContext,
@@ -275,6 +302,4 @@ const ConnectedDroppable: typeof DroppableType = connect(
275
302
  },
276
303
  )(Droppable);
277
304
 
278
- ConnectedDroppable.defaultProps = defaultProps;
279
-
280
305
  export default ConnectedDroppable;
package/CHANGELOG.md DELETED
@@ -1,78 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## Unreleased
9
-
10
- ## [13.4.0] - 2023-09-07
11
-
12
- ### Changed
13
-
14
- - Use `target` to fix mobile drag-and-drop issues
15
-
16
- ## [13.3.0] - 2023-07-25
17
-
18
- ### Added
19
-
20
- - Add support for an element to include data-dnd-ignore-scrollable to not be considered a scrollable container.
21
- - Add shared publish workflow to publish to npm when a github release is created.
22
-
23
- ### Changed
24
-
25
- - build/test workflow: upgrade ubuntu to use latest
26
- - build/test workflow: upgrade node to 16.x
27
-
28
- ### Dependencies
29
-
30
- - `decode-uri-component` from 0.2.0 to 0.2.2
31
- - `express` from 4.17.1 to 4.18.2
32
- - `json5` from 1.0.1 to 1.0.2
33
- - `qs` from 6.5.2 to 6.5.3
34
- - `semver` from 5.7.1 to 5.7.2
35
- - `ua-parser-js` from 0.7.21 to 0.7.33
36
- - `word-wrap` from 1.2.3 to 1.2.4
37
-
38
- ## [13.2.1]
39
-
40
- ### Security
41
-
42
- Includes merged Dependabot PRs for
43
-
44
- - `terser` from 4.6.3 to 4.8.1
45
- - `eventsource` from 1.0.7 to 1.1.2
46
- - `async` from 2.6.3 to 2.6.4
47
-
48
- ## [13.2.0]
49
-
50
- ### Added
51
-
52
- - Added new, opt-in fluid scroller behavior. The new behavior prevents scroll from occuring when a draggable is grabbed within the auto-scroll thresholds _until_ the draggable is explicitly dragged in that threshold's direction.
53
- - Added ability to pass additional configuration options to fluid scroller via `DragDropContext`.
54
-
55
- ## [13.1.2]
56
-
57
- ### Changed
58
-
59
- - Changed package name to `@planningcenter/react-beautiful-dnd`
60
- - Updated author and repo information in `package.json`
61
- - Updated README with overview of why we forked package
62
-
63
- ### Added
64
-
65
- - Added configuration files
66
- - Added GitHub action for building and testing code
67
-
68
- ## 13.1.1 and earlier
69
-
70
- All release notes and upgrade notes for earlier versions can be found on the original
71
- project's [Github Releases] page.
72
-
73
- [13.4.0]: https://github.com/planningcenter/react-beautiful-dnd/compare/v13.3.0..v13.4.0
74
- [13.3.0]: https://github.com/planningcenter/react-beautiful-dnd/compare/v13.2.1..v13.3.0
75
- [13.2.1]: https://github.com/planningcenter/react-beautiful-dnd/compare/v13.2.0..v13.2.1
76
- [13.2.0]: https://github.com/planningcenter/react-beautiful-dnd/compare/v13.1.2..v13.2.0
77
- [13.1.2]: https://github.com/planningcenter/react-beautiful-dnd/compare/v13.1.1..v13.1.2
78
- [github releases]: https://github.com/atlassian/react-beautiful-dnd/releases