Skip to content

Commit 1ef5987

Browse files
authored
v3.0.0: Modern hooks-based rewrite with TypeScript and accessibility (#850)
v3.0.0 - Modern hooks-based rewrite with TypeScript and accessibility BREAKING CHANGES: - Children must be wrapped in `<Pane>` components - `split` prop renamed to `direction` (meanings swapped to align with CSS flex) - Size constraints (`minSize`, `maxSize`, `defaultSize`) moved to `<Pane>` - Callbacks renamed: `onDragStarted` → `onResizeStart`, `onChange` → `onResize`, `onDragFinished` → `onResizeEnd` - `primary` prop removed (use controlled mode instead) - `allowResize` renamed to `resizable` - CSS classes changed: `SplitPane` → `split-pane`, `Resizer` → `split-pane-divider` - IE11 no longer supported Features: - Hooks-based architecture (no class components) - Full TypeScript support with strict mode - Keyboard navigation (arrow keys, Home, End) and ARIA attributes - Built-in touch support for mobile/tablet - Native support for 2+ panes without nesting - Snap points for resize positions - `usePersistence` hook for localStorage/sessionStorage - Custom divider components via `divider` prop - RAF-throttled resize for smooth performance - ~3.6KB gzipped bundle See MIGRATION.md for upgrade instructions.
1 parent ad8bd17 commit 1ef5987

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+10311
-15022
lines changed

.babelrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/build-test.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,36 @@ on:
77
pull_request:
88
branches:
99
- master
10+
- v3
1011

1112
jobs:
1213
build-test:
14+
name: Build and Test
1315
runs-on: ubuntu-latest
1416

1517
steps:
1618
- name: Checkout code
17-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
1820

1921
- name: Use Node.js
20-
uses: actions/setup-node@v1
22+
uses: actions/setup-node@v4
2123
with:
22-
node-version: 14.x
24+
node-version: 22.x
2325

2426
- name: Install dependencies
25-
uses: bahmutov/npm-install@v1
27+
run: npm ci
2628

27-
- name: Build
28-
run: yarn build
29+
- name: Typecheck
30+
run: npm run typecheck
31+
32+
- name: Lint
33+
run: npm run lint
34+
35+
- name: Format check
36+
run: npm run format:check
2937

30-
- name: Test
31-
run: yarn test
32-
# run: yarn test:coverage
38+
- name: Run tests
39+
run: npm test
40+
41+
- name: Build
42+
run: npm run build
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy Examples to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [master]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-and-deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Build examples
28+
run: npm run examples:build
29+
30+
- name: Deploy to gh-pages
31+
uses: peaceiris/actions-gh-pages@v4
32+
with:
33+
github_token: ${{ secrets.GITHUB_TOKEN }}
34+
publish_dir: ./dist-examples

.gitignore

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,9 @@
1-
# Logs
2-
logs
3-
*.log
4-
5-
# Runtime data
6-
pids
7-
*.pid
8-
*.seed
9-
10-
# Directory for instrumented libs generated by jscoverage/JSCover
11-
lib-cov
12-
13-
# Coverage directory used by tools like istanbul
14-
coverage
15-
16-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17-
.grunt
18-
19-
# Compiled binary addons (http://nodejs.org/api/addons.html)
20-
build/Release
21-
22-
# Dependency directory
23-
# Commenting this out is preferred by some people, see
24-
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
251
node_modules
26-
27-
# Users Environment Variables
28-
.lock-wscript
29-
30-
.idea
31-
*.iml
32-
/lib
33-
34-
lcov.info
35-
.DS_Store
36-
372
dist
38-
build
39-
.cache
3+
dist-examples
4+
coverage
5+
.DS_Store
6+
*.log
7+
.vscode
8+
.idea
9+
*.tsbuildinfo

.npmignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.prettierignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
CHANGELOG.md
1+
dist
2+
node_modules
3+
package-lock.json

.prettierrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
2+
"semi": true,
23
"singleQuote": true,
3-
"trailingComma": "es5"
4+
"tabWidth": 2,
5+
"trailingComma": "es5",
6+
"printWidth": 80,
7+
"arrowParens": "always"
48
}

.storybook/main.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

.storybook/manager.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)