@sofereditor/react 0.1.0
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/LICENSE +661 -0
- package/README.md +27 -0
- package/dist/index.cjs +3759 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +353 -0
- package/dist/index.d.ts +353 -0
- package/dist/index.js +3778 -0
- package/dist/index.js.map +1 -0
- package/package.json +62 -0
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# @sofer/react
|
|
2
|
+
|
|
3
|
+
> React renderer for the Sofer editor with built-in A4 pagination.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @sofer/react @sofer/core yjs
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Editor, EditorProvider, Toolbar, useEditor, A4_PAGE } from '@sofer/react';
|
|
11
|
+
|
|
12
|
+
export function MyEditor() {
|
|
13
|
+
const editor = useEditor();
|
|
14
|
+
return (
|
|
15
|
+
<EditorProvider editor={editor}>
|
|
16
|
+
<Toolbar />
|
|
17
|
+
<Editor editor={editor} pageGeometry={A4_PAGE} />
|
|
18
|
+
</EditorProvider>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Optional `uploadImage` hook routes paste/drop/picker to external storage (S3, Azure Blob) so the Y.Doc stores URLs instead of base64.
|
|
24
|
+
|
|
25
|
+
## License
|
|
26
|
+
|
|
27
|
+
[AGPL-3.0-or-later](./LICENSE) © Rafael Marreca. Part of the [Sofer](https://github.com/rafael145a/sofer) editor monorepo.
|