cosveti-sync 0.0.3 → 0.0.5

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 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 Backend Configuration
44
+ ### 1. Convex Config
44
45
 
45
- First, set up the backend API in your Convex project. Create a file like `convex/tiptapSync.ts`:
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 { TiptapSyncSvelte } from '../lib/client/index.js';
49
- import { components } from './_generated/api.js';
49
+ import { defineApp } from 'convex/server';
50
50
 
51
- const tiptapSyncSvelte = new TiptapSyncSvelte(components.tiptapSyncSvelte);
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
- ### 2. Convex Config
55
+ app.use(tiptapSync);
58
56
 
59
- First, set up the backend API in your Convex project. Create a file like `convex/convex.config.ts`:
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 { defineApp } from 'convex/server';
64
+ import { TiptapSyncClient } from '../lib/client/index.js';
65
+ import { components } from './_generated/api.js';
63
66
 
64
- import tiptapSyncSvelte from '../lib/component/convex.config.js';
67
+ const tiptapSync = new TiptapSyncClient(components.tiptapSync);
65
68
 
66
- const app = defineApp();
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()`
@@ -1 +1,2 @@
1
- export declare const tiptapSyncConfig: import("convex/server").ComponentDefinition<any>;
1
+ declare const _default: import("convex/server").ComponentDefinition<any>;
2
+ export default _default;
@@ -1,2 +1,2 @@
1
1
  import { defineComponent } from 'convex/server';
2
- export const tiptapSyncConfig = defineComponent('tiptapSyncSvelte');
2
+ export default defineComponent('tiptapSync');
package/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
1
  export { useTiptapSync } from './tiptap/index.js';
2
- export { TiptapSyncClient } from './client/index.js';
3
- export { tiptapSyncConfig } from './component/convex.config.js';
4
2
  export type { UseSyncOptions, InitialState, SyncContext } from './tiptap/types.js';
5
3
  export type { SyncApi } from './client/index.js';
package/dist/index.js CHANGED
@@ -1,5 +1,3 @@
1
1
  // Reexport your entry components here
2
2
  // Main entry point for cosveti-sync package
3
3
  export { useTiptapSync } from './tiptap/index.js';
4
- export { TiptapSyncClient } from './client/index.js';
5
- export { tiptapSyncConfig } from './component/convex.config.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cosveti-sync",
3
3
  "description": "A convex component for syncing tiptap in a svelte project",
4
- "version": "0.0.3",
4
+ "version": "0.0.5",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run prepack",
@@ -27,9 +27,22 @@
27
27
  "types": "./dist/index.d.ts",
28
28
  "type": "module",
29
29
  "exports": {
30
+ "./package.json": "./package.json",
30
31
  ".": {
31
- "types": "./dist/index.d.ts",
32
- "svelte": "./dist/index.js"
32
+ "types": "./dist/client/index.d.ts",
33
+ "default": "./dist/client/index.js"
34
+ },
35
+ "./tiptap": {
36
+ "types": "./dist/tiptap/index.d.ts",
37
+ "default": "./dist/tiptap/index.js"
38
+ },
39
+ "./convex.config": {
40
+ "types": "./dist/component/convex.config.d.ts",
41
+ "default": "./dist/component/convex.config.js"
42
+ },
43
+ "./convex.config.js": {
44
+ "types": "./dist/component/convex.config.d.ts",
45
+ "default": "./dist/component/convex.config.js"
33
46
  }
34
47
  },
35
48
  "peerDependencies": {