@comapeo/core-react 10.0.0 → 11.0.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/dist/commonjs/contexts/MapShares.d.ts +1 -1
- package/dist/commonjs/hooks/documents.d.ts +1 -0
- package/dist/commonjs/hooks/documents.js +0 -1
- package/dist/commonjs/hooks/maps.d.ts +33 -15
- package/dist/commonjs/hooks/maps.js +33 -15
- package/dist/commonjs/index.d.ts +1 -1
- package/dist/commonjs/index.js +6 -2
- package/dist/commonjs/lib/map-shares-stores.d.ts +120 -3
- package/dist/commonjs/lib/map-shares-stores.js +170 -8
- package/dist/esm/contexts/MapShares.d.ts +1 -1
- package/dist/esm/hooks/documents.d.ts +1 -0
- package/dist/esm/hooks/documents.js +0 -1
- package/dist/esm/hooks/maps.d.ts +33 -15
- package/dist/esm/hooks/maps.js +33 -15
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/lib/map-shares-stores.d.ts +120 -3
- package/dist/esm/lib/map-shares-stores.js +166 -7
- package/docs/API.md +4 -9
- package/package.json +6 -6
package/docs/API.md
CHANGED
|
@@ -210,7 +210,7 @@ Set or unset the current device as an archive device.
|
|
|
210
210
|
|
|
211
211
|
| Function | Type |
|
|
212
212
|
| ---------- | ---------- |
|
|
213
|
-
| `useSentMapSharesActions` | `() => { createAndSend({
|
|
213
|
+
| `useSentMapSharesActions` | `() => { createAndSend({ receiverDeviceId, mapId, }: CreateAndSendMapShareOptions): Promise<ServerMapShareState>; cancel({ shareId }: CancelMapShareOptions): Promise<...>; }` |
|
|
214
214
|
|
|
215
215
|
### useSentMapSharesState
|
|
216
216
|
|
|
@@ -965,7 +965,7 @@ Update a document within a project.
|
|
|
965
965
|
|
|
966
966
|
| Function | Type |
|
|
967
967
|
| ---------- | ---------- |
|
|
968
|
-
| `useUpdateDocument` | `<D extends WriteableDocumentType>({ docType, projectId, }: { docType: D; projectId: string; }) => FilteredMutationResult<UseMutationResult<any, Error, { value: Omit<any, "schemaName">; }>>` |
|
|
968
|
+
| `useUpdateDocument` | `<D extends WriteableDocumentType>({ docType, projectId, }: { docType: D; projectId: string; }) => FilteredMutationResult<UseMutationResult<any, Error, { value: Omit<any, "schemaName">; versionId: string; }>>` |
|
|
969
969
|
|
|
970
970
|
Parameters:
|
|
971
971
|
|
|
@@ -1313,11 +1313,6 @@ can be used to track the share status with `useSingleSentMapShare`.
|
|
|
1313
1313
|
| ---------- | ---------- |
|
|
1314
1314
|
| `useSendMapShare` | `() => Pick<Override<MutationObserverIdleResult<ServerMapShareState, Error, CreateAndSendMapShareOptions, unknown>, { mutate: UseMutateFunction<ServerMapShareState, Error, CreateAndSendMapShareOptions, unknown>; }> and { ...; }, "error" or ... 3 more ... or "mutateAsync"> or Pick<...> or Pick<...> or Pick<...>` |
|
|
1315
1315
|
|
|
1316
|
-
Parameters:
|
|
1317
|
-
|
|
1318
|
-
* `opts.projectId`: Public ID of project for sending the map share: you can only send map shares to users on the same project
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
1316
|
Examples:
|
|
1322
1317
|
|
|
1323
1318
|
```tsx
|
|
@@ -1327,7 +1322,7 @@ const { mutate: send } = useSendMapShare()
|
|
|
1327
1322
|
return (
|
|
1328
1323
|
<button
|
|
1329
1324
|
onClick={() =>
|
|
1330
|
-
send({
|
|
1325
|
+
send({ receiverDeviceId: deviceId, mapId: 'custom' }, {
|
|
1331
1326
|
onSuccess: (mapShare) => {
|
|
1332
1327
|
console.log('Share sent with id', mapShare.shareId)
|
|
1333
1328
|
}
|
|
@@ -1427,7 +1422,7 @@ function SentShareStatus({ shareId }: { shareId: string }) {
|
|
|
1427
1422
|
|
|
1428
1423
|
| Constant | Type |
|
|
1429
1424
|
| ---------- | ---------- |
|
|
1430
|
-
| `SentMapSharesContext` | `Context<{ subscribe: (listener: () => void) => () => boolean; getSnapshot: () => ServerMapShareState[]; actions: { createAndSend({
|
|
1425
|
+
| `SentMapSharesContext` | `Context<{ subscribe: (listener: () => void) => () => boolean; getSnapshot: () => ServerMapShareState[]; actions: { createAndSend({ receiverDeviceId, mapId, }: CreateAndSendMapShareOptions): Promise<ServerMapShareState>; cancel({ shareId }: CancelMapShareOptions): Promise<...>; }; } or null>` |
|
|
1431
1426
|
|
|
1432
1427
|
### MapServerContext
|
|
1433
1428
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comapeo/core-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "React wrapper for working with @comapeo/core",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -64,20 +64,20 @@
|
|
|
64
64
|
"types": "tsc"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@comapeo/map-server": "1.0
|
|
67
|
+
"@comapeo/map-server": "^1.1.0",
|
|
68
68
|
"ensure-error": "5.0.0",
|
|
69
69
|
"eventsource-client": "1.2.0",
|
|
70
70
|
"type-fest": "5.4.4"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@comapeo/core": "^
|
|
74
|
-
"@comapeo/ipc": "^
|
|
73
|
+
"@comapeo/core": "^7.0.1",
|
|
74
|
+
"@comapeo/ipc": "^8.0.0",
|
|
75
75
|
"@tanstack/react-query": "^5",
|
|
76
76
|
"react": "^18 || ^19"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@comapeo/core": "
|
|
80
|
-
"@comapeo/ipc": "
|
|
79
|
+
"@comapeo/core": "7.0.1",
|
|
80
|
+
"@comapeo/ipc": "8.0.0",
|
|
81
81
|
"@eslint/compat": "2.0.3",
|
|
82
82
|
"@eslint/js": "9.39.4",
|
|
83
83
|
"@ianvs/prettier-plugin-sort-imports": "4.7.1",
|