Skip to content

Commit 523c3d0

Browse files
committed
3.0.0-rc.12
1 parent 34e8ce5 commit 523c3d0

13 files changed

Lines changed: 263 additions & 69 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
"install:vue-core": "cd packages/vue-core && pnpm install",
6262
"install:svelte-core": "cd packages/svelte-core && pnpm install",
6363
"install:all": "pnpm install:core && pnpm install:react-core && pnpm install:react-dev && pnpm install:preact-core && pnpm install:functions && pnpm install:storybook && pnpm install:docs && pnpm install:vue-core && pnpm install:svelte-core",
64-
"reset:all": "pnpm remove:all && pnpm install:all && pnpm build:all && pnpm clean:cache"
64+
"reset:all": "pnpm remove:all && pnpm install:all && pnpm build:all && pnpm clean:cache",
65+
"set-version": "node scripts/set-version.mjs"
6566
},
6667
"resolutions": {
6768
"react": "18.2.0",

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gridsheet/core",
3-
"version": "3.0.0-rc.11",
3+
"version": "3.0.0-rc.12",
44
"description": "Framework-agnostic core for gridsheet (Sheet, Registry, formula engine, etc.)",
55
"main": "./dist/index.js",
66
"module": "./dist/index.js",

packages/functions/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gridsheet/functions",
3-
"version": "3.0.0-rc.11",
3+
"version": "3.0.0-rc.12",
44
"description": "Extended formula functions for @gridsheet/react-core",
55
"main": "./dist/index.js",
66
"module": "./dist/index.js",
@@ -77,9 +77,9 @@
7777
"vite-plugin-dts": "^4.5.3"
7878
},
7979
"peerDependencies": {
80-
"@gridsheet/core": "^3.0.0-rc.11"
80+
"@gridsheet/core": "3.0.0-rc.12"
8181
},
8282
"publishConfig": {
8383
"access": "public"
8484
}
85-
}
85+
}

packages/preact-core/README.md

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Spreadsheet component for Preact
55
## Installation
66

77
```bash
8-
npm install @gridsheet/preact-core
8+
npm install @gridsheet/preact-core @gridsheet/functions
99
```
1010

1111
### Peer Dependencies
@@ -17,46 +17,40 @@ This package requires the following peer dependencies:
1717

1818
## Usage
1919

20-
### Basic Preact Component
21-
2220
```tsx
2321
import { GridSheet } from '@gridsheet/preact-core';
22+
import { useSpellbook } from '@gridsheet/preact-core/spellbook'; // requires @gridsheet/functions
2423

25-
// Your Preact component
2624
function App() {
25+
const book = useSpellbook();
2726
return (
28-
<GridSheet />
27+
<>
28+
<GridSheet
29+
book={book}
30+
initialCells={{
31+
A1: { value: 'Hello' },
32+
B1: { value: 'Preact', style: { backgroundColor: '#448888' } },
33+
A2: { value: 123 },
34+
B2: { value: 456 },
35+
A3: { value: 789 },
36+
C6: { value: '=SUM(A2:B2)' },
37+
}}
38+
options={{
39+
mode: 'dark',
40+
}}
41+
sheetName="Sheet1"
42+
/>
43+
<GridSheet
44+
book={book}
45+
initialCells={{
46+
C3: { value: '=SUM(Sheet1!A2:B3)' },
47+
}}
48+
options={{}}
49+
sheetName="Sheet2"
50+
/>
51+
</>
2952
);
3053
}
31-
32-
render(<App />, document.getElementById('app'));
33-
```
34-
35-
### Vanilla JavaScript Integration
36-
37-
```javascript
38-
import { GridSheet, h, render } from '@gridsheet/preact-core';
39-
40-
// Create a container element
41-
const container = document.getElementById('gridsheet');
42-
43-
// Render GridSheet directly
44-
render(
45-
h(GridSheet, {
46-
initialCells: {
47-
A1: { value: 'Hello' },
48-
B1: { value: 'Vanilla JS', style: { backgroundColor: '#448888'} },
49-
A2: { value: 123 },
50-
B2: { value: 456 },
51-
C10: { value: '=SUM(A2:B2)' },
52-
},
53-
options: {
54-
mode: 'dark',
55-
},
56-
sheetName: 'Sheet1'
57-
}),
58-
container
59-
);
6054
```
6155

6256
## Exports

packages/preact-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gridsheet/preact-core",
3-
"version": "3.0.0-rc.11",
3+
"version": "3.0.0-rc.12",
44
"description": "Spreadsheet component for Preact",
55
"main": "dist/index.js",
66
"module": "dist/index.js",

packages/react-core/README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,45 @@
1313
## Installation
1414

1515
```sh
16-
$ npm install @gridsheet/react-core --save
16+
npm install @gridsheet/react-core @gridsheet/functions
17+
```
18+
19+
## Usage
20+
21+
```tsx
22+
import { GridSheet } from '@gridsheet/react-core';
23+
import { useSpellbook } from '@gridsheet/react-core/spellbook'; // requires @gridsheet/functions
24+
25+
function App() {
26+
const book = useSpellbook();
27+
return (
28+
<>
29+
<GridSheet
30+
book={book}
31+
initialCells={{
32+
A1: { value: 'Hello' },
33+
B1: { value: 'React', style: { backgroundColor: '#61DBFB' } },
34+
A2: { value: 123 },
35+
B2: { value: 456 },
36+
A3: { value: 789 },
37+
C6: { value: '=SUM(A2:B2)' },
38+
}}
39+
options={{
40+
mode: 'dark',
41+
}}
42+
sheetName="Sheet1"
43+
/>
44+
<GridSheet
45+
book={book}
46+
initialCells={{
47+
C3: { value: '=SUM(Sheet1!A2:B3)' },
48+
}}
49+
options={{}}
50+
sheetName="Sheet2"
51+
/>
52+
</>
53+
);
54+
}
1755
```
1856

1957
## Docs

packages/react-core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gridsheet/react-core",
3-
"version": "3.0.0-rc.11",
3+
"version": "3.0.0-rc.12",
44
"description": "Spreadsheet component for React",
55
"main": "./dist/index.js",
66
"module": "./dist/index.js",
@@ -78,4 +78,4 @@
7878
"publishConfig": {
7979
"access": "public"
8080
}
81-
}
81+
}

packages/react-dev/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gridsheet/react-dev",
3-
"version": "3.0.0-rc.11",
3+
"version": "3.0.0-rc.12",
44
"description": "Development tools for GridSheet",
55
"main": "./dist/index.js",
66
"module": "./dist/index.js",
@@ -34,7 +34,7 @@
3434
"homepage": "https://gridsheet.walkframe.com/",
3535
"packageManager": "pnpm@10.6.5",
3636
"peerDependencies": {
37-
"@gridsheet/core": ">=3.0.0-rc.11",
37+
"@gridsheet/core": "3.0.0-rc.12",
3838
"react": ">=16.9.0",
3939
"react-dom": ">=16.9.0"
4040
},
@@ -51,4 +51,4 @@
5151
"@types/react-syntax-highlighter": "^15.5.13",
5252
"react-syntax-highlighter": "^16.1.1"
5353
}
54-
}
54+
}

packages/svelte-core/README.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# @gridsheet/svelte-core
2+
3+
Spreadsheet component for Svelte 5
4+
5+
## Installation
6+
7+
```bash
8+
npm install @gridsheet/svelte-core @gridsheet/functions
9+
```
10+
11+
### Peer Dependencies
12+
13+
This package requires the following peer dependency:
14+
15+
- `svelte` ^5.0.0
16+
17+
## Usage
18+
19+
```svelte
20+
<script>
21+
import { GridSheet } from '@gridsheet/svelte-core';
22+
import { useSpellbook } from '@gridsheet/svelte-core/spellbook'; // requires @gridsheet/functions
23+
const book = useSpellbook();
24+
</script>
25+
26+
<GridSheet
27+
{book}
28+
initialCells={{
29+
A1: { value: 'Hello' },
30+
B1: { value: 'Svelte', style: { backgroundColor: '#448888' } },
31+
A2: { value: 123 },
32+
B2: { value: 456 },
33+
A3: { value: 789 },
34+
C6: { value: '=SUM(A2:B2)' },
35+
}}
36+
options={{
37+
mode: 'dark',
38+
}}
39+
sheetName="Sheet1"
40+
/>
41+
42+
<GridSheet
43+
{book}
44+
initialCells={{
45+
C3: { value: '=SUM(Sheet1!A2:B3)' },
46+
}}
47+
options={{}}
48+
sheetName="Sheet2"
49+
/>
50+
```
51+
52+
## Components
53+
54+
### GridSheet
55+
56+
The main spreadsheet component for Svelte 5 applications.
57+
58+
**Props:**
59+
- `book` - Writable store for cross-sheet data binding and state management
60+
- `initialCells` - Initial cell data with values, styles, and formulas
61+
- `options` - GridSheet options (e.g., mode: 'dark')
62+
- `sheetName` - Name of the sheet
63+
- `sheetRef` - Ref object to access sheet handle
64+
- `storeRef` - Ref object to access store handle
65+
- `className` - CSS class name
66+
- `style` - Inline styles
67+
68+
### useSpellbook
69+
70+
Creates a reactive book with all extended functions (`@gridsheet/functions`) pre-loaded. Returns a `Writable<BookType>`.
71+
72+
```js
73+
import { useSpellbook } from '@gridsheet/svelte-core/spellbook'; // requires @gridsheet/functions
74+
const book = useSpellbook({ /* RegistryProps */ });
75+
```
76+
77+
### useBook
78+
79+
Same as `useSpellbook` but without extended functions.
80+
81+
```js
82+
import { useBook } from '@gridsheet/svelte-core';
83+
const book = useBook({ /* RegistryProps */ });
84+
```
85+
86+
## Exports
87+
88+
This package exports:
89+
90+
- All core GridSheet functionality from `@gridsheet/preact-core`
91+
- `GridSheet` - Svelte 5 component
92+
- `useBook` - Svelte-specific reactive book using writable store
93+
- `@gridsheet/svelte-core/spellbook` - `useSpellbook`, `createSpellbook`
94+
95+
## Docs
96+
97+
- [GridSheet document](https://gridsheet.walkframe.com/)
98+
- [Examples](https://gridsheet.walkframe.com/examples/case1)
99+
100+
## Development
101+
102+
```bash
103+
# Start development server
104+
pnpm dev
105+
106+
# Build the package
107+
pnpm build
108+
```
109+
110+
## License
111+
112+
Apache-2.0

packages/svelte-core/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gridsheet/svelte-core",
3-
"version": "3.0.0-rc.11",
3+
"version": "3.0.0-rc.12",
44
"description": "Spreadsheet component for Svelte 5",
55
"main": "dist/index.js",
66
"module": "dist/index.js",
@@ -19,7 +19,9 @@
1919
"default": "./dist/spellbook.js"
2020
}
2121
},
22-
"files": ["dist"],
22+
"files": [
23+
"dist"
24+
],
2325
"scripts": {
2426
"dev": "vite example",
2527
"build": "rm -rf ./dist || true && vite build"

0 commit comments

Comments
 (0)