@clevertask/react-sortable-tree 0.0.7 → 0.0.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/README.md +98 -32
- package/dist/e2e/index.js +63 -0
- package/dist/e2e/utils/drag-item.d.ts +15 -0
- package/dist/e2e/utils/expect-item-before.d.ts +2 -0
- package/dist/e2e/utils/expect-item-child-of.d.ts +3 -0
- package/dist/e2e/utils/get-tree-item-id.d.ts +2 -0
- package/dist/e2e/utils/get-tree-item.d.ts +4 -0
- package/dist/e2e/utils/index.d.ts +5 -0
- package/dist/react-sortable-tree.css +1 -1
- package/dist/react-sortable-tree.js +770 -731
- package/dist/react-sortable-tree.js.map +1 -1
- package/dist/src/SortableTree/components/TreeItemStructure/index.d.ts +39 -0
- package/package.json +34 -11
- package/dist/SortableTree/components/TreeItemStructure/index.d.ts +0 -19
- /package/dist/{SortableTree → src/SortableTree}/SortableTree.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/components/Action/Action.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/components/Action/index.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/components/Add/Add.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/components/Add/index.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/components/Handle/Handle.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/components/Handle/index.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/components/Remove/Remove.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/components/Remove/index.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/components/TreeItem/SortableTreeItem.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/components/TreeItem/TreeItem.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/components/TreeItem/index.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/components/index.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/createSortableTreeGlobalStyles.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/index.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/keyboardCoordinates.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/types.d.ts +0 -0
- /package/dist/{SortableTree → src/SortableTree}/utilities.d.ts +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{main.d.ts → src/main.d.ts} +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TreeItem } from '../../types';
|
|
2
|
+
import { RenderItemProps } from '../TreeItem/TreeItem';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
type AriaProps = {
|
|
5
|
+
'aria-label'?: string;
|
|
6
|
+
'aria-labelledby'?: string;
|
|
7
|
+
'aria-describedby'?: string;
|
|
8
|
+
};
|
|
9
|
+
export type TreeItemStructureProps = {
|
|
10
|
+
treeItem: TreeItem & {
|
|
11
|
+
parentId?: string;
|
|
12
|
+
};
|
|
13
|
+
dropZoneRef: (element: HTMLElement | null) => void;
|
|
14
|
+
draggableItemRef: React.Ref<any>;
|
|
15
|
+
dropZoneStyle?: React.CSSProperties;
|
|
16
|
+
draggableItemStyle?: React.CSSProperties;
|
|
17
|
+
classNames?: {
|
|
18
|
+
dropZone?: string;
|
|
19
|
+
draggableItem?: string;
|
|
20
|
+
};
|
|
21
|
+
asDropZone?: React.ElementType;
|
|
22
|
+
asDraggableItem?: React.ElementType;
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
clone?: boolean;
|
|
25
|
+
dataSlots: {
|
|
26
|
+
dropZone?: AriaProps & Record<string, string | boolean | number | undefined>;
|
|
27
|
+
draggableItem?: AriaProps & Record<string, string>;
|
|
28
|
+
};
|
|
29
|
+
} & Pick<RenderItemProps, 'dragListeners'>;
|
|
30
|
+
export declare const TreeItemStructure: {
|
|
31
|
+
({ dropZoneRef, draggableItemRef, dropZoneStyle, draggableItemStyle, classNames, asDropZone: DropZoneComponent, asDraggableItem: DraggableComponent, children, dataSlots, treeItem, clone, dragListeners, }: TreeItemStructureProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
DragHandler({ children, as: Component, className, style, }: {
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
as?: React.ElementType;
|
|
35
|
+
className?: string;
|
|
36
|
+
style?: React.CSSProperties;
|
|
37
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
38
|
+
};
|
|
39
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clevertask/react-sortable-tree",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "CleverTask",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
"homepage": "https://github.com/clevertask/react-sortable-tree#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/clevertask/react-sortable-tree/issues"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/clevertask/react-sortable-tree"
|
|
17
|
+
},
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/src/index.d.ts",
|
|
21
|
+
"default": "./dist/react-sortable-tree.js"
|
|
22
|
+
},
|
|
23
|
+
"./e2e": {
|
|
24
|
+
"types": "./dist/e2e/utils/index.d.ts",
|
|
25
|
+
"default": "./dist/e2e/index.js"
|
|
26
|
+
}
|
|
19
27
|
},
|
|
20
28
|
"dependencies": {
|
|
21
29
|
"@dnd-kit/core": "^6.3.1",
|
|
@@ -26,6 +34,7 @@
|
|
|
26
34
|
},
|
|
27
35
|
"devDependencies": {
|
|
28
36
|
"@eslint/js": "^9.25.0",
|
|
37
|
+
"@playwright/test": "^1.57.0",
|
|
29
38
|
"@types/node": "^22.14.1",
|
|
30
39
|
"@types/react": "^19.1.2",
|
|
31
40
|
"@types/react-dom": "^19.1.2",
|
|
@@ -34,6 +43,8 @@
|
|
|
34
43
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
35
44
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
36
45
|
"globals": "^16.0.0",
|
|
46
|
+
"husky": "^9.1.7",
|
|
47
|
+
"lint-staged": "^16.2.7",
|
|
37
48
|
"prettier": "^3.5.3",
|
|
38
49
|
"typescript": "^5.8.3",
|
|
39
50
|
"typescript-eslint": "^8.30.1",
|
|
@@ -43,5 +54,17 @@
|
|
|
43
54
|
"peerDependencies": {
|
|
44
55
|
"react": ">=18.3.1 <20.0.0",
|
|
45
56
|
"react-dom": ">=18.3.1 <20.0.0"
|
|
57
|
+
},
|
|
58
|
+
"lint-staged": {
|
|
59
|
+
"*.{ts, tsx, css}": "pnpm run format"
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"dev": "vite",
|
|
63
|
+
"e2e": "playwright test",
|
|
64
|
+
"e2e:dev": "playwright test --ui",
|
|
65
|
+
"build": "rm -rf dist && vite build && vite build -c vite.test.config.ts",
|
|
66
|
+
"lint": "eslint .",
|
|
67
|
+
"format": "prettier --write",
|
|
68
|
+
"preview": "vite preview"
|
|
46
69
|
}
|
|
47
|
-
}
|
|
70
|
+
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export interface TreeItemStructureProps {
|
|
2
|
-
dropZoneRef: (element: HTMLElement | null) => void;
|
|
3
|
-
draggableItemRef: React.Ref<any>;
|
|
4
|
-
dropZoneStyle?: React.CSSProperties;
|
|
5
|
-
draggableItemStyle?: React.CSSProperties;
|
|
6
|
-
classNames?: {
|
|
7
|
-
dropZone?: string;
|
|
8
|
-
draggableItem?: string;
|
|
9
|
-
};
|
|
10
|
-
asDropZone?: React.ElementType;
|
|
11
|
-
asDraggableItem?: React.ElementType;
|
|
12
|
-
draggableItemProps?: Record<string, any>;
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
dataSlots: {
|
|
15
|
-
dropZone: Record<string, string | boolean | undefined>;
|
|
16
|
-
draggableItem: Record<string, string>;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export declare const TreeItemStructure: ({ dropZoneRef, draggableItemRef, dropZoneStyle, draggableItemStyle, classNames, asDropZone: DropZoneComponent, asDraggableItem: DraggableComponent, draggableItemProps, children, dataSlots, }: TreeItemStructureProps) => import("react/jsx-runtime").JSX.Element;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|