Skip to content

Commit bd3a01a

Browse files
jassmithleolabscodeBelt
authored
* Move to packaging core with esbuild * Maybe working first linaria based thing * Make build * Cleanup more usages of styled-components * Use linaria for cells as well * Fix bootstrap * Enable minification * Fix tests * Fix tests * Restore tsc-esm-fix * remove dead printf * Remove all traces of styled-components * Cleanup placement of css file * Update docs * Fix test projects * Fix cra examples too * Remove depreacted API * Fix build * Fix build * Fix sourcemaps and restore boolean toggle * Fix story * Update docs * Disable minification for cells * Remove dead code * More dead code * Cleanup imports * Fix issue where group headers would not get selected with touch events * Fix issue where dragging onto a header menu would emit a click event * Fix beep on Safari when copying cells using CMD+C (glideapps#420) * Fix beep on Safari when copying cells using CMD+C * Move the `preventDefault` to the bottom of the function call so it won't get called when something goes wrong * Ability to override the cursor on a per-cell basis (glideapps#419) * Add the ability to override the cursor per cell * Add the `cursor` field to the API docs * Improve scroll shadows (glideapps#421) * Fix access to first column if there are no columns * Add ability to add a vertical scroll shadow * Show the vertical shadow if there are no fixed columns * Split the `fixedShadow` prop into `fixedShadowX` and `fixedShadowY` * Re-add the opacity transition when smoothScroll isn't enabled * Re-add `pointer-events: none` * Add information about the props to the API docs * Import `clamp` from `lodash/clamp` for better tree-shaking * Move the opacity calculation out of the `useMemo` hook Co-authored-by: Jason Smith <[email protected]> * Fix build * Pass preview value to validate cell * Add checkbox indicator for row markers header column * 4.99.0-alpha1 * Fix deploy * Improve build output * Fix trailing row theem not applying when not sticky * Dramatically improve SVG loader behavior * 4.99.0-alpha2 * Fix tests * Accidentally left minify on * More fixes * Restore RTL support * Fix issue with fill handle being extra precise * Respect readonly flag when filling * 4.99.0-alpha3 * Add sprite test * Transpile down to es2018 * 4.99.0-alpha4 * Fix next build server side * 4.99.0-alpha5 * Depend on real version of canvas-hypertxt now that it is its own package * 4.99.0-alpha6 * Add missing deps to test projects * Variable scoping * Fix spelling (glideapps#431) * Fix spelling * move comma * Minor cleanups * Update eslint * More linting issues * Fix build * Minor simplification * Fix onCellsEdited not preventing onCellEdited * Don't break CSS for custom cell stories * Add column index to draw header args * Don't allow header to get filtered as an outlier when sizing a column * Add delay to tooltip example * Add row hover effect demo * Simpler row hover demo * 4.99.0-beta1 * Add css as a side-effect * 4.99.0-beta2 * Remove react-virtualized-auto-sizer and replace with react-resize-detector * Fix build * 4.99.0-beta3 * Pair down react resize detector to its bare minimum that we actually need. * Fix tests * 4.99.0-beta4 * Add ability to control selection location when coercing a value * Fix header shadow not being able to be turned off * Ensure shadows do not encroach upon padding region * Correct dep list * Make sure context menus work better on all OS's * Improve row marker responsiveness while maintaining proper support for markers when move handle is enabled (glideapps#441) * Improve row marker responsiveness while maintaining proper support for markers when move handle is enabled * Just add a random spot to test the clickable numbers * 4.99.0-beta5 * Don't select row index 0 during a drag when hoving a header cell * Add toArray to CompactSelection for ancient versions of JS to love * Fix offsetting for calls to getBounds * Improve copy support when called from external ref * ResizeDetector smoke test * Prep for 5.0.0 stable * Fix nextjs compilation error * Improve docs slightly * 5.0.0-beta1 * Unify onCellEdited and onCellsEdited so you only need to implement one or the other * Add capability for more granular drag sourcing without losing useful interactions (glideapps#453) * Add capability for more granular drag sourcing without losing useful interactions * Clear mouse state when drag begins * Vastly improve autoscrolling behavior * Be a little permissive with going outside the grid * Prevent weird state with headers on drag when dragging cells enabled * Prevent fetching out of bounds data when sizing a column * Fix typo * Dont scroll if mouse down on row markers * Reduce render looping * Add jerk * Fix newline * Add basic auto-scroller tests * Imports instead of globals * Fix react 18 testing * Don't crash when asked to locate out of bounds cells * Re-add removed effect but now it works as expected * Add new column button example * Return undefined for unknown cells isntead of empty rect * Update changelog * 5.0.0-beta2 * Prep for stable Co-authored-by: Leo Bernard <[email protected]> Co-authored-by: Robert S <[email protected]>
1 parent 9030155 commit bd3a01a

File tree

135 files changed

+12227
-6171
lines changed

Some content is hidden

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

135 files changed

+12227
-6171
lines changed

.devcontainer/devcontainer.json

+21-25
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
22
// https://github.com/microsoft/vscode-dev-containers/tree/v0.158.0/containers/typescript-node
33
{
4-
"name": "Node.js & TypeScript",
5-
"build": {
6-
"dockerfile": "Dockerfile",
7-
// Update 'VARIANT' to pick a Node version: 10, 12, 14
8-
"args": {
9-
"VARIANT": "14"
10-
}
11-
},
4+
"name": "Node.js & TypeScript",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
// Update 'VARIANT' to pick a Node version: 10, 12, 14
8+
"args": {
9+
"VARIANT": "14"
10+
}
11+
},
1212

13-
// Set *default* container specific settings.json values on container create.
14-
"settings": {
15-
"terminal.integrated.shell.linux": "/bin/bash"
16-
},
13+
// Set *default* container specific settings.json values on container create.
14+
"settings": {
15+
"terminal.integrated.shell.linux": "/bin/bash"
16+
},
1717

18-
// Add the IDs of extensions you want installed when the container is created.
19-
"extensions": [
20-
"dbaeumer.vscode-eslint",
21-
"esbenp.prettier-vscode",
22-
"jpoissonnier.vscode-styled-components"
23-
],
18+
// Add the IDs of extensions you want installed when the container is created.
19+
"extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
2420

25-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
26-
"forwardPorts": [9009],
21+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
22+
"forwardPorts": [9009],
2723

28-
// Use 'postCreateCommand' to run commands after the container is created.
29-
"postCreateCommand": "./.devcontainer/run.sh",
24+
// Use 'postCreateCommand' to run commands after the container is created.
25+
"postCreateCommand": "./.devcontainer/run.sh",
3026

31-
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
32-
"remoteUser": "node"
33-
}
27+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
28+
"remoteUser": "node"
29+
}

.github/workflows/beta.js.yml

-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
working-directory: .
2525
- run: npm run lint
2626
- run: npm run build-js
27-
- run: npm run build-cjs
2827
- run: npm run build-types
2928
- uses: JS-DevTools/npm-publish@v1
3029
with:
@@ -47,7 +46,6 @@ jobs:
4746
working-directory: .
4847
- run: npm run lint
4948
- run: npm run build-js
50-
- run: npm run build-cjs
5149
- run: npm run build-types
5250
- uses: JS-DevTools/npm-publish@v1
5351
with:

.github/workflows/release.js.yml

-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
working-directory: .
2626
- run: npm run lint
2727
- run: npm run build-js
28-
- run: npm run build-cjs
2928
- run: npm run build-types
3029
- uses: JS-DevTools/npm-publish@v1
3130
with:
@@ -47,7 +46,6 @@ jobs:
4746
working-directory: .
4847
- run: npm run lint
4948
- run: npm run build-js
50-
- run: npm run build-cjs
5149
- run: npm run build-types
5250
- uses: JS-DevTools/npm-publish@v1
5351
with:

.storybook/.babelrc.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
}
1818
],
1919
"@babel/preset-react",
20-
"@babel/preset-typescript"
20+
"@babel/preset-typescript",
21+
"@linaria/babel-preset"
2122
],
22-
"plugins": ["babel-plugin-styled-components", "@babel/plugin-proposal-class-properties"]
23+
"plugins": ["@babel/plugin-proposal-class-properties"]
2324
}

.storybook/main.js

+25-8
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,38 @@
1-
const path = require("path");
1+
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
22

33
module.exports = {
44
stories: ["../**/*.stories.tsx"],
5-
addons: ["@storybook/addon-links", "@storybook/addon-controls", "./addons/expand-all/register.js"],
6-
devtool: "source-map",
5+
addons: [
6+
"@storybook/addon-links",
7+
"@storybook/addon-essentials",
8+
"@storybook/addon-knobs",
9+
"@storybook/addon-controls",
10+
],
11+
core: {
12+
builder: "webpack5",
13+
},
714
webpackFinal: async (config, { configType }) => {
8-
config.module.rules.push({
9-
test: /\.(ts|tsx)$/,
15+
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
16+
// You can change the configuration based on that.
17+
// 'PRODUCTION' is used when building the static version of storybook.
18+
// Check docs here: https://storybook.js.org/docs/react/configure/webpack#extending-storybooks-webpack-config
19+
20+
config.plugins.push(new MiniCssExtractPlugin({ filename: "[name].css" }));
21+
22+
// Add Linaria loader after babel-loader
23+
config.module.rules.splice(1, 0, {
24+
test: /\.tsx?$/,
25+
exclude: /node_modules/,
1026
use: [
1127
{
12-
loader: require.resolve("babel-loader"),
28+
loader: require.resolve("@linaria/webpack-loader"),
29+
options: {
30+
sourceMap: true,
31+
},
1332
},
1433
],
1534
});
1635

17-
config.resolve.extensions.push(".ts", ".tsx");
18-
config.performance.hints = false;
1936
return config;
2037
},
2138
};

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ is to use Codespaces if you have access to it. If you do not, simply cloning the
77

88
#### Steps
99

10-
- Cick the green dropdown labeled code, there should be two tabs: local and codespaces.
10+
- Click the green dropdown labeled code, there should be two tabs: local and codespaces.
1111
- Click on codespaces.
1212
- If this is your first time, then create a new codespace. It will open a new browser tab and build the docker container for it - there will be a button to open the environment in VSCode if you'd prefer to run it that way
1313
- You should see a screen that says `Setting up your codespace` As soon as that's done, you should see a VSCode like UI with files on the left.
1414

15-
Once codespaces is up and runnng make sure `jq` is installed and then:
15+
Once codespaces is up and running make sure `jq` is installed and then:
1616

1717
```bash
1818
npm run bootstrap && npm run storybook
1919
```
2020

2121
## Forking the data grid?
2222

23-
Please consider submitting your work for review. We are a small project but we are super enthused when anyone comes by to help us build the best damned data grid on the internet.
23+
Please consider submitting your work for review. We are a small project, but we are super enthused when anyone comes by to help us build the best damned data grid on the internet.
2424

2525
## Contributing new cells
2626

README.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Lot's of fun examples are in our [Storybook](https://glideapps.github.io/glide-d
2929
- **It scales to millions of rows**. Cells are rendered lazily on demand for memory efficiency.
3030
- **Scrolling is extremely fast**. Native scrolling keeps everything buttery smooth.
3131
- **Supports multiple types of cells**. Numbers, text, markdown, bubble, image, drilldown, uri
32-
- **Fully Free & Open Source**. [MIT licensed](LICENSE) so you can use Grid in commerical projects.
32+
- **Fully Free & Open Source**. [MIT licensed](LICENSE), so you can use Grid in commercial projects.
3333
- **Editing is built in**.
3434
- **Resizable and movable columns**.
3535
- **Variable sized rows**.
@@ -48,7 +48,7 @@ npm i @glideapps/glide-data-grid
4848
You may also need to install the peer dependencies if you don't have them already:
4949

5050
```shell
51-
npm i lodash marked react-responsive-carousel styled-components
51+
npm i lodash marked react-responsive-carousel
5252
```
5353

5454
Create a new `DataEditor` wherever you need to display lots and lots of data
@@ -57,6 +57,12 @@ Create a new `DataEditor` wherever you need to display lots and lots of data
5757
<DataEditor getCellContent={getData} columns={columns} rows={numRows} />
5858
```
5959

60+
Don't forget to import mandatory CSS
61+
62+
```ts
63+
import "@glideapps/glide-data-grid/dist/index.css";
64+
```
65+
6066
Making your columns is easy
6167

6268
```ts
@@ -141,7 +147,7 @@ Originally we had implemented our Grid using virtualized rendering. We virtualiz
141147

142148
There are some hacks you can do like setting timers and entering into a "low fidelity" rendering mode where you only render a single element per cell. This works okay until you want to show hundreds of cells and you are right back to choppy scrolling. It also doesn't really look or feel great.
143149

144-
**I want to use this with Next.js / Vercel but I'm getting weird errors**
150+
**I want to use this with Next.js / Vercel, but I'm getting weird errors**
145151

146152
The easiest way to use the grid with Next is to create a component which wraps up your grid and then import it as a dynamic.
147153

babel.cjs.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@babel/preset-react",
1919
"@babel/preset-typescript"
2020
],
21-
"plugins": ["babel-plugin-styled-components", "@babel/plugin-proposal-class-properties"],
21+
"plugins": ["@babel/plugin-proposal-class-properties"],
2222
"comments": false,
2323
"sourceMaps": true
2424
}

babel.config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@babel/preset-react",
2020
"@babel/preset-typescript"
2121
],
22-
"plugins": ["babel-plugin-styled-components", "@babel/plugin-proposal-class-properties"],
22+
"plugins": ["@babel/plugin-proposal-class-properties"],
2323
"comments": false,
2424
"sourceMaps": true
2525
}

bootstrap.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ popd
2121
for DIR in "cells" "source"
2222
do
2323
pushd packages/$DIR
24-
update ".dependencies.\"@glideapps/glide-data-grid\" = \"3.4.1\"" package.json
24+
update ".dependencies.\"@glideapps/glide-data-grid\" = \"4.99.0-beta2\"" package.json
2525
npm ci
2626
update ".dependencies.\"@glideapps/glide-data-grid\" = $VERSION" package.json
2727
update ".version = $VERSION" package.json

0 commit comments

Comments
 (0)