Skip to content

Commit 54df673

Browse files
committed
Bump deps.
1 parent 723f619 commit 54df673

File tree

9 files changed

+328
-130
lines changed

9 files changed

+328
-130
lines changed

.size-snapshot.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"index.js": {
3-
"bundled": 66962,
4-
"minified": 39148,
5-
"gzipped": 9849,
3+
"bundled": 67100,
4+
"minified": 39129,
5+
"gzipped": 9871,
66
"treeshaked": {
77
"rollup": {
8-
"code": 31206,
8+
"code": 31134,
99
"import_statements": 535
1010
},
1111
"webpack": {
12-
"code": 32860
12+
"code": 32788
1313
}
1414
}
1515
}

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. See [standa
44

55
## Next
66
* Migrate to TS
7-
* Replace theme package to own theme package
7+
* Replace theme package by own theme package
88
* Bump deps
99

1010
## 3.0.5

babel.config.js

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
module.exports = (api, targets) => {
2-
// https://babeljs.io/docs/en/config-files#config-function-api
3-
const isTestEnv = api.env('test')
4-
5-
return {
6-
babelrc: false,
7-
ignore: ['./node_modules'],
8-
presets: [
9-
[
10-
'@babel/preset-env',
11-
{
12-
loose: true,
13-
modules: isTestEnv ? 'commonjs' : false,
14-
targets: isTestEnv ? { node: 'current' } : targets,
15-
},
16-
],
2+
// https://babeljs.io/docs/en/config-files#config-function-api
3+
const isTestEnv = api.env('test')
4+
5+
return {
6+
babelrc: false,
7+
ignore: ['./node_modules'],
8+
presets: [
9+
[
10+
'@babel/preset-env',
11+
{
12+
loose: true,
13+
modules: isTestEnv ? 'commonjs' : false,
14+
targets: isTestEnv ? { node: 'current' } : targets,
15+
},
1716
],
18-
plugins: ['@babel/plugin-transform-react-jsx'],
19-
}
17+
],
18+
plugins: ['@babel/plugin-transform-react-jsx'],
2019
}
21-
20+
}

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
]
121121
},
122122
"dependencies": {
123-
"@nosferatu500/react-dnd-scrollzone": "^1.0.14",
123+
"@nosferatu500/react-dnd-scrollzone": "2.0.0-beta.0",
124124
"lodash.isequal": "^4.5.0",
125125
"prop-types": "^15.7.2",
126126
"react-dnd": "^14.0.2",
@@ -129,12 +129,13 @@
129129
"react-virtualized": "^9.22.3"
130130
},
131131
"devDependencies": {
132-
"@babel/core": "^7.14.8",
132+
"@babel/core": "^7.15.0",
133+
"@babel/eslint-parser": "^7.15.0",
133134
"@babel/helper-module-imports": "^7.14.5",
134-
"@babel/plugin-transform-react-jsx": "^7.14.5",
135-
"@babel/preset-env": "^7.14.8",
136-
"@babel/types": "^7.14.8",
137-
"@nosferatu500/theme-file-explorer": "^3.0.5",
135+
"@babel/plugin-transform-react-jsx": "^7.14.9",
136+
"@babel/preset-env": "^7.15.0",
137+
"@babel/types": "^7.15.0",
138+
"@nosferatu500/theme-file-explorer": "^3.0.6",
138139
"@rollup/plugin-babel": "^5.3.0",
139140
"@rollup/plugin-node-resolve": "^13.0.4",
140141
"@rollup/plugin-typescript": "^8.2.5",
@@ -145,17 +146,16 @@
145146
"@testing-library/react": "^12.0.0",
146147
"@types/babel-plugin-macros": "^2.8.5",
147148
"@types/jest": "^26.0.24",
148-
"@types/react": "^17.0.15",
149+
"@types/react": "^17.0.16",
149150
"@types/react-dom": "^17.0.9",
150-
"@typescript-eslint/eslint-plugin": "^4.28.5",
151-
"@typescript-eslint/parser": "^4.28.5",
151+
"@typescript-eslint/eslint-plugin": "^4.29.0",
152+
"@typescript-eslint/parser": "^4.29.0",
152153
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.3",
153154
"acorn-jsx": "^5.3.2",
154-
"babel-eslint": "^10.1.0",
155155
"babel-plugin-macros": "^3.1.0",
156156
"babel-plugin-tester": "^10.1.0",
157157
"enzyme": "^3.11.0",
158-
"esbuild": "^0.12.17",
158+
"esbuild": "^0.12.18",
159159
"eslint": "^7.32.0",
160160
"eslint-config-prettier": "^8.3.0",
161161
"eslint-plugin-import": "^2.23.4",
@@ -173,7 +173,7 @@
173173
"react-dom": "^17.0.2",
174174
"react-test-renderer": "^17.0.2",
175175
"rimraf": "^3.0.2",
176-
"rollup": "^2.55.1",
176+
"rollup": "^2.56.0",
177177
"rollup-plugin-esbuild": "^4.5.0",
178178
"rollup-plugin-postcss": "^4.0.0",
179179
"rollup-plugin-size-snapshot": "^0.12.0",

rollup.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function createDeclarationConfig(input, output) {
4242
acornInjectPlugins: [jsx()],
4343
plugins: [
4444
postcss({ extract: 'style.css' }),
45-
typescript({ declaration: true, outDir: output })
45+
typescript({ declaration: true, outDir: output }),
4646
],
4747
}
4848
}
@@ -84,4 +84,3 @@ export default function (args) {
8484
createESMConfig('src/index.ts', 'dist/esm/index.js'),
8585
]
8686
}
87-

src/utils/classnames.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @ts-nocheck
21
// very simple className utility for creating a classname string...
32
// Falsy arguments are ignored:
43
//
@@ -9,7 +8,7 @@
98
// active && "class3"
109
// ); // returns -> class1 class3";
1110
//
12-
export default function classnames(...classes) {
11+
export const classnames = (...classes: string[]) => {
1312
// Use Boolean constructor as a filter callback
1413
// Allows for loose type truthy/falsey checks
1514
// Boolean("") === false;
@@ -20,3 +19,5 @@ export default function classnames(...classes) {
2019
// Boolean("classname") === true;
2120
return classes.filter(Boolean).join(' ')
2221
}
22+
23+
export default classnames

src/utils/default-handlers.ts

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// @ts-nocheck
22

3-
export function defaultGetNodeKey({ treeIndex }) {
3+
export const defaultGetNodeKey = ({ treeIndex }: { treeIndex: number }) => {
44
return treeIndex
55
}
66

77
// Cheap hack to get the text of a react object
8-
function getReactElementText(parent) {
8+
const getReactElementText = (parent: any) => {
99
if (typeof parent === 'string') {
1010
return parent
1111
}
@@ -26,12 +26,18 @@ function getReactElementText(parent) {
2626
}
2727

2828
return parent.props.children
29-
.map((child) => getReactElementText(child))
29+
.map((child: any) => getReactElementText(child))
3030
.join('')
3131
}
3232

3333
// Search for a query string inside a node property
34-
function stringSearch(key, searchQuery, node, path, treeIndex) {
34+
const stringSearch = (
35+
key: string,
36+
searchQuery: string,
37+
node,
38+
path,
39+
treeIndex: number
40+
) => {
3541
if (typeof node[key] === 'function') {
3642
// Search within text after calling its function to generate the text
3743
return (
@@ -47,7 +53,17 @@ function stringSearch(key, searchQuery, node, path, treeIndex) {
4753
return node[key] && String(node[key]).indexOf(searchQuery) > -1
4854
}
4955

50-
export function defaultSearchMethod({ node, path, treeIndex, searchQuery }) {
56+
export const defaultSearchMethod = ({
57+
node,
58+
path,
59+
treeIndex,
60+
searchQuery,
61+
}: {
62+
node
63+
path
64+
treeIndex: number
65+
searchQuery: string
66+
}) => {
5167
return (
5268
stringSearch('title', searchQuery, node, path, treeIndex) ||
5369
stringSearch('subtitle', searchQuery, node, path, treeIndex)

src/utils/dnd-manager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default class DndManager {
7676
dragSourceInitialDepth = 0
7777

7878
if (component) {
79-
const relativePosition = findDOMNode(component).getBoundingClientRect() // eslint-disable-line react/no-find-dom-node
79+
const relativePosition = findDOMNode(component)?.getBoundingClientRect() // eslint-disable-line react/no-find-dom-node
8080
const leftShift =
8181
monitor.getSourceClientOffset().x - relativePosition.left
8282
blocksOffset = Math.round(
@@ -184,7 +184,7 @@ export default class DndManager {
184184
},
185185
}
186186

187-
function nodeDragSourcePropInjection(connect, monitor) {
187+
const nodeDragSourcePropInjection = (connect, monitor) => {
188188
return {
189189
connectDragSource: connect.dragSource(),
190190
connectDragPreview: connect.dragPreview(),
@@ -254,7 +254,7 @@ export default class DndManager {
254254
canDrop: this.canDrop.bind(this),
255255
}
256256

257-
function nodeDropTargetPropInjection(connect, monitor) {
257+
const nodeDropTargetPropInjection = (connect, monitor) => {
258258
const dragged = monitor.getItem()
259259
return {
260260
connectDropTarget: connect.dropTarget(),
@@ -290,7 +290,7 @@ export default class DndManager {
290290
},
291291
}
292292

293-
function placeholderPropInjection(connect, monitor) {
293+
const placeholderPropInjection = (connect, monitor) => {
294294
const dragged = monitor.getItem()
295295
return {
296296
connectDropTarget: connect.dropTarget(),

0 commit comments

Comments
 (0)