Skip to content

Commit 207f9ca

Browse files
committed
Change build size
1 parent 96dc82f commit 207f9ca

12 files changed

Lines changed: 122 additions & 67 deletions

File tree

docs/pages/404.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import { Navigate } from 'react-router-dom';
32

43
const Component404 = () => {

docs/pages/examples/CustomItem/CustomItem.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { CSSProperties } from 'react';
12
import { SortableTree, SortableTreeProps } from 'dnd-tree-sortable';
23

34
import { tree } from '../utils';
@@ -28,7 +29,7 @@ const ItemContent: SortableTreeProps<{}>['renderItemContent'] = ({
2829
{
2930
'--spacing': `${indentationWidth * depth}px`,
3031
paddingLeft: 'var(--spacing)',
31-
} as React.CSSProperties
32+
} as CSSProperties
3233
}
3334
{...rest}
3435
>

lib/components/Action/Action.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React, { CSSProperties } from 'react';
1+
import { CSSProperties, HTMLAttributes } from 'react';
22
import classNames from 'clsx';
33

44
import styles from './Action.module.scss';
55

6-
export interface ActionProps extends React.HTMLAttributes<HTMLButtonElement> {
6+
export interface ActionProps extends HTMLAttributes<HTMLButtonElement> {
77
active?: {
88
fill: string;
99
background: string;

lib/components/Icons/CollapseIcon.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
export const CollapseIcon = (props: React.SVGProps<SVGSVGElement>) => {
1+
import { SVGProps } from 'react';
2+
3+
export const CollapseIcon = (props: SVGProps<SVGSVGElement>) => {
24
return (
35
<svg width='10' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 41' {...props}>
46
<path d='M30.76 39.2402C31.885 40.3638 33.41 40.995 35 40.995C36.59 40.995 38.115 40.3638 39.24 39.2402L68.24 10.2402C69.2998 9.10284 69.8768 7.59846 69.8494 6.04406C69.822 4.48965 69.1923 3.00657 68.093 1.90726C66.9937 0.807959 65.5106 0.178263 63.9562 0.150837C62.4018 0.123411 60.8974 0.700397 59.76 1.76024L35 26.5102L10.24 1.76024C9.10259 0.700397 7.59822 0.123411 6.04381 0.150837C4.4894 0.178263 3.00632 0.807959 1.90702 1.90726C0.807714 3.00657 0.178019 4.48965 0.150593 6.04406C0.123167 7.59846 0.700153 9.10284 1.75999 10.2402L30.76 39.2402Z' />

lib/components/Scroll/Scrollbars.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { memo, forwardRef, useCallback, useMemo } from 'react';
1+
import { memo, forwardRef, useCallback, useMemo, MutableRefObject, CSSProperties, ReactNode } from 'react';
22
import { Scrollbars } from 'rc-scrollbars';
3-
import type { MutableRefObject, CSSProperties, ReactNode } from 'react';
43
import type { ScrollValues } from 'rc-scrollbars';
54

65
import styles from './Scrollbars.module.css';
@@ -48,8 +47,7 @@ const CustomScrollbars = forwardRef<HTMLElement, CustomScrollbarsProps>(function
4847
overflowX ? undefined : (props) => <div {...props} className='track-horizontal' style={{ display: 'none' }} />
4948
}
5049
renderThumbVertical={({ style, ...props }) => <div {...props} style={{ ...style }} className={styles.Scroll} />}
51-
ref={refSetter}
52-
>
50+
ref={refSetter}>
5351
{children}
5452
</Scrollbars>
5553
);

lib/components/Scroll/VirtuosoScrollbars.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import type { ComponentProps, Ref } from 'react';
2-
import { forwardRef } from 'react';
1+
import { ComponentProps, Ref, forwardRef } from 'react';
32

43
import CustomScrollbars from './Scrollbars';
54

@@ -13,8 +12,7 @@ const VirtuosoScrollbars = forwardRef(function VirtuosoScrollbars(
1312
<CustomScrollbars
1413
style={style}
1514
ref={ref}
16-
renderView={(viewProps) => <div {...viewProps} {...props} tabIndex={-1} />}
17-
>
15+
renderView={(viewProps) => <div {...viewProps} {...props} tabIndex={-1} />}>
1816
{children}
1917
</CustomScrollbars>
2018
);

lib/components/TreeItem/SortableTreeItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CSSProperties, memo } from 'react';
1+
import { CSSProperties, memo, JSX } from 'react';
22
import type { UniqueIdentifier } from '@dnd-kit/core';
33
import { useSortable } from '@dnd-kit/sortable';
44
import { CSS } from '@dnd-kit/utilities';

lib/components/TreeItem/TreeItem.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { forwardRef, HTMLAttributes, memo, ForwardedRef } from 'react';
1+
import { forwardRef, HTMLAttributes, memo, ForwardedRef, CSSProperties, JSX } from 'react';
22
import classNames from 'clsx';
33

44
import styles from './TreeItem.module.css';
@@ -70,10 +70,9 @@ const TreeItemComponent = <T extends TreeItemType>(props: TreeItemProps<T>, ref:
7070
style={
7171
{
7272
'--spacing': `${indentationWidth * depth}px`,
73-
} as React.CSSProperties
73+
} as CSSProperties
7474
}
75-
{...rest}
76-
>
75+
{...rest}>
7776
<div className={styles.TreeItem} ref={ref} style={style}>
7877
<Handle {...handleProps} />
7978
{onCollapse && (

lib/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { MutableRefObject } from 'react';
1+
import { MutableRefObject, JSX } from 'react';
22
import type { UniqueIdentifier } from '@dnd-kit/core';
33
import { ActionProps, BadgeProps } from './components';
44

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "dnd-tree-sortable",
33
"private": false,
4-
"version": "1.0.2",
4+
"version": "1.0.3",
55
"license": "MIT",
66
"type": "module",
7-
"main": "dist/dnd-tree-sortable.umd.js",
8-
"module": "dist/dnd-tree-sortable.es.js",
7+
"main": "dist/index.js",
8+
"module": "dist/index.js",
99
"types": "dist/types/index.d.ts",
1010
"author": "Ghost Alpha",
1111
"description": "React sortable tree component",
@@ -59,13 +59,15 @@
5959
"eslint": "^9.9.0",
6060
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
6161
"eslint-plugin-react-refresh": "^0.4.9",
62+
"glob": "^11.0.0",
6263
"globals": "^15.9.0",
6364
"husky": "^9.1.6",
6465
"prettier": "^3.3.3",
6566
"rc-scrollbars": "^1.1.6",
6667
"react-router-dom": "^6.26.2",
6768
"react-virtuoso": "^4.10.4",
6869
"rimraf": "^6.0.1",
70+
"rollup-plugin-visualizer": "^5.12.0",
6971
"sass": "^1.78.0",
7072
"serve": "^14.2.3",
7173
"typescript": "^5.5.3",
@@ -74,9 +76,5 @@
7476
"vite-pages-theme-doc": "^5.0.0",
7577
"vite-plugin-dts": "^4.2.1",
7678
"vite-plugin-react-pages": "^5.0.0"
77-
},
78-
"dependencies": {
79-
"react": "^18.3.1",
80-
"react-dom": "^18.3.1"
8179
}
8280
}

0 commit comments

Comments
 (0)