cosveti-sync 0.0.4 → 0.0.6
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 +17 -16
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# cosveti-sync
|
|
2
2
|
|
|
3
3
|
Real-time collaborative editing for TipTap in Svelte with Convex synchronization.
|
|
4
|
+
|
|
4
5
|
Translated to svelte from [React version](https://github.com/get-convex/prosemirror-sync)
|
|
5
6
|
|
|
6
7
|
## Features
|
|
@@ -40,38 +41,38 @@ This package has the following peer dependencies that you'll also need to instal
|
|
|
40
41
|
|
|
41
42
|
## Basic Setup
|
|
42
43
|
|
|
43
|
-
### 1. Convex
|
|
44
|
+
### 1. Convex Config
|
|
44
45
|
|
|
45
|
-
First, set up the backend API in your Convex project. Create a file like `convex/
|
|
46
|
+
First, set up the backend API in your Convex project. Create a file like `convex/convex.config.ts`:
|
|
46
47
|
|
|
47
48
|
```typescript
|
|
48
|
-
import {
|
|
49
|
-
import { components } from './_generated/api.js';
|
|
49
|
+
import { defineApp } from 'convex/server';
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
export const { getSnapshot, submitSnapshot, latestVersion, getSteps, submitSteps } =
|
|
53
|
-
tiptapSyncSvelte.syncApi();
|
|
51
|
+
import tiptapSync from '../lib/component/convex.config.js';
|
|
54
52
|
|
|
55
|
-
|
|
53
|
+
const app = defineApp();
|
|
56
54
|
|
|
57
|
-
|
|
55
|
+
app.use(tiptapSync);
|
|
58
56
|
|
|
59
|
-
|
|
57
|
+
export default app;
|
|
58
|
+
```
|
|
59
|
+
### 2. Convex Backend Configuration
|
|
60
|
+
|
|
61
|
+
First, set up the backend API in your Convex project. Create a file like `convex/tiptapSync.ts`:
|
|
60
62
|
|
|
61
63
|
```typescript
|
|
62
|
-
import {
|
|
64
|
+
import { TiptapSyncClient } from '../lib/client/index.js';
|
|
65
|
+
import { components } from './_generated/api.js';
|
|
63
66
|
|
|
64
|
-
|
|
67
|
+
const tiptapSync = new TiptapSyncClient(components.tiptapSync);
|
|
65
68
|
|
|
66
|
-
const
|
|
69
|
+
export const { getSnapshot, submitSnapshot, latestVersion, getSteps, submitSteps } =
|
|
70
|
+
tiptapSync.syncApi();
|
|
67
71
|
|
|
68
|
-
app.use(tiptapSyncSvelte);
|
|
69
72
|
|
|
70
|
-
export default app;
|
|
71
73
|
```
|
|
72
74
|
|
|
73
75
|
|
|
74
|
-
|
|
75
76
|
## API Documentation
|
|
76
77
|
|
|
77
78
|
### `useTiptapSync()`
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cosveti-sync",
|
|
3
3
|
"description": "A convex component for syncing tiptap in a svelte project",
|
|
4
|
-
"
|
|
4
|
+
"homepage": "https://github.com/feavel1/cosveti-sync",
|
|
5
|
+
"version": "0.0.6",
|
|
5
6
|
"scripts": {
|
|
6
7
|
"dev": "vite dev",
|
|
7
8
|
"build": "vite build && npm run prepack",
|