intrasheets 3.2.0 → 6.0.1
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 +73 -0
- package/dist/index.js +2683 -18
- package/dist/index.mjs +18801 -0
- package/dist/style.css +1 -2250
- package/package.json +41 -19
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Intrasheets
|
|
2
|
+
|
|
3
|
+
The Excel experience on top of [Jspreadsheet](https://jspreadsheet.com), as a library: ribbon,
|
|
4
|
+
formula bar, sheet tabs, backstage, charts, pivot tables, comments, XLSX import and export, an
|
|
5
|
+
AI assistant and realtime collaboration through Jspreadsheet Server.
|
|
6
|
+
|
|
7
|
+
A Jspreadsheet license is required: https://jspreadsheet.com
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install intrasheets
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import intrasheets from 'intrasheets';
|
|
17
|
+
import 'intrasheets/dist/style.css';
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Or with a script tag (self-contained build, global `intrasheets`):
|
|
21
|
+
|
|
22
|
+
```html
|
|
23
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/intrasheets/dist/style.css" />
|
|
24
|
+
<script src="https://cdn.jsdelivr.net/npm/intrasheets/dist/index.min.js"></script>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
intrasheets({
|
|
31
|
+
license: '...', // Jspreadsheet license (required)
|
|
32
|
+
client: { url: 'https://sheets.example.com', token }, // Jspreadsheet Server and the user's token
|
|
33
|
+
google: { clientId, apiKey }, // Google Sheets import (optional)
|
|
34
|
+
onopen: function(guid) { ... }, // a document was created or picked; default: navigate to /{guid}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// One server document
|
|
38
|
+
intrasheets.load(el, {
|
|
39
|
+
guid: guid,
|
|
40
|
+
width: 1000,
|
|
41
|
+
height: 600,
|
|
42
|
+
onchange: function(worksheet, cell, x, y, value) { ... },
|
|
43
|
+
}).then(function(worksheets) { ... });
|
|
44
|
+
|
|
45
|
+
// The user's document list
|
|
46
|
+
intrasheets.list(el, { height: '100vh' });
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- `client.api` is the REST base when the server sits behind a path that differs from the socket
|
|
50
|
+
address, for example `{ url: 'https://host', path: 's/', api: 'https://host/s' }`.
|
|
51
|
+
- `width` and `height` size the container: a number is pixels, a string any CSS length. Without
|
|
52
|
+
them the container keeps the size the page gives it.
|
|
53
|
+
- Every `on<event>` option of `load` is a Jspreadsheet event handler, called after the shell's own
|
|
54
|
+
handler with the same arguments.
|
|
55
|
+
- `load` rejects when the document does not exist or the token cannot open it.
|
|
56
|
+
- The Material Symbols icon font is loaded from Google Fonts when the page does not bring it.
|
|
57
|
+
- Menus and dialogs float over the page; the backstage (File) stays inside the container.
|
|
58
|
+
|
|
59
|
+
## Files
|
|
60
|
+
|
|
61
|
+
| File | Use |
|
|
62
|
+
|---------------------|------------------------------------------------------------------------|
|
|
63
|
+
| `dist/index.js` | Self-contained UMD build for a `<script>` tag (jsDelivr serves it minified as `index.min.js`) |
|
|
64
|
+
| `dist/index.mjs` | ES module for bundlers (`@jspreadsheet/bundle`, `lemonadejs`, `@lemonadejs/studio` and `markdown-it` are dependencies) |
|
|
65
|
+
| `dist/style.css` | Everything the shell needs |
|
|
66
|
+
|
|
67
|
+
## Server
|
|
68
|
+
|
|
69
|
+
Documents live on [Jspreadsheet Server](https://jspreadsheet.com/docs/server), which handles
|
|
70
|
+
persistence, authentication and realtime collaboration.
|
|
71
|
+
|
|
72
|
+
A complete example with React, the server and MongoDB in Docker:
|
|
73
|
+
https://github.com/intrasheets/demo
|