@fileverse-dev/dsheet 0.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 +57 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +129005 -0
- package/dist/package/constant/shared-constant.d.ts +8 -0
- package/dist/package/dsheet-editor.d.ts +4 -0
- package/dist/package/types.d.ts +16 -0
- package/dist/package/use-dsheet-editor.d.ts +126 -0
- package/dist/package/utils/diffSheet.d.ts +9 -0
- package/dist/package/utils/handleFileImport.d.ts +1 -0
- package/dist/package/utils/updateSheetUI.d.ts +7 -0
- package/dist/style.css +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +79 -0
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Dsheet Editor
|
|
2
|
+
|
|
3
|
+
[dsheet.new](http://dsheet.new/) is your onchain, privacy-first alternative to G\**gle D*cs: peer-to-peer, end-to-end encrypted, and decentralized. It enables secure, real-time, and async collaboration without compromising user privacy.
|
|
4
|
+
|
|
5
|
+
<img width="4410" alt="github_banner_final@3x" src="./package/assets/sheet.png" />
|
|
6
|
+
|
|
7
|
+
This repository contains:
|
|
8
|
+
|
|
9
|
+
- `/package` – The core package code.
|
|
10
|
+
- Example & demo source code to showcase dSheets functionalities.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
### Prequisites
|
|
15
|
+
|
|
16
|
+
To use dSheet, ensure your project is set up with Tailwind CSS and have a Tailwind configuration file.
|
|
17
|
+
|
|
18
|
+
### Install & import
|
|
19
|
+
|
|
20
|
+
Add the following imports :
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
import { DSheetEditor } from '@fileverse-dev/dsheet';
|
|
24
|
+
import '@fileverse-dev/dsheet/styles'; // in App.jsx/App.tsx
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Update Tailwind Config
|
|
28
|
+
|
|
29
|
+
In your tailwind config, add this line to content array :
|
|
30
|
+
|
|
31
|
+
`@fileverse-dev/dsheet/dist/index.es.js`
|
|
32
|
+
|
|
33
|
+
You should now be set to use dSheets!
|
|
34
|
+
|
|
35
|
+
# dSheetProps Interface
|
|
36
|
+
|
|
37
|
+
The `DsheetProps` interface is a TypeScript interface that defines the properties for a page-related component. It includes properties for handling preview mode, managing publishing data, and optionally storing metadata and content associated with the page.
|
|
38
|
+
|
|
39
|
+
## Core Props
|
|
40
|
+
|
|
41
|
+
| Property | Type | Description |
|
|
42
|
+
| ------------------------ | --------------------------------------------- | ----------------------------------------------- |
|
|
43
|
+
| `portalContent` | `JSONContent` | Initial content of the editor |
|
|
44
|
+
| `onChange` | `(changes: JSONContent, chunk?: any) => void` | Callback triggered on editor content changes |
|
|
45
|
+
| `ref` | `React.RefObject` | Reference to access editor instance |
|
|
46
|
+
| `isReadOnly` | `boolean` | Controls if editor is in preview/read-only mode |
|
|
47
|
+
| `dsheetId` | `string` | Used as room id for collaboration |
|
|
48
|
+
|
|
49
|
+
### Steps to run this example locally
|
|
50
|
+
|
|
51
|
+
- `cd demo`
|
|
52
|
+
- `npm i`
|
|
53
|
+
- `npm run dev`
|
|
54
|
+
|
|
55
|
+
It will open up a vite server, that will have the Dsheet Editor.
|
|
56
|
+
|
|
57
|
+
⚠️ This repository is currently undergoing rapid development, over the time more customization and API will be added.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DsheetEditor } from './package/dsheet-editor';
|