@towns-protocol/react-sdk 0.0.242 → 0.0.245
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/esm/useReactions.js.map +1 -1
- package/dist/esm/useThreads.js.map +1 -1
- package/dist/esm/useTimeline.js.map +1 -1
- package/dist/types/useCreateDm.d.ts +1 -0
- package/dist/types/useCreateDm.d.ts.map +1 -1
- package/dist/types/useCreateGdm.d.ts +1 -0
- package/dist/types/useCreateGdm.d.ts.map +1 -1
- package/dist/types/useReactions.d.ts +2 -2
- package/dist/types/useReactions.d.ts.map +1 -1
- package/dist/types/useThreads.d.ts +2 -4
- package/dist/types/useThreads.d.ts.map +1 -1
- package/dist/types/useTimeline.d.ts +2 -2
- package/dist/types/useTimeline.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/useReactions.ts +2 -2
- package/src/useThreads.ts +5 -2
- package/src/useTimeline.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReactions.js","sourceRoot":"","sources":["../../src/useReactions.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useReactions.js","sourceRoot":"","sources":["../../src/useReactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAyB,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CACxB,QAAgB,EAChB,MAAoE,EACtE,EAAE;IACA,MAAM,IAAI,GAAG,YAAY,EAAE,CAAA;IAC3B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IACpC,MAAM,CAAC,CAAC,CAAC,IAAI,YAAY,KAAK,CAAC,EAAE,+BAA+B,CAAC,CAAA;IAEjE,OAAO,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;AACzD,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThreads.js","sourceRoot":"","sources":["../../src/useThreads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAyB,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"useThreads.js","sourceRoot":"","sources":["../../src/useThreads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAyB,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CACtB,QAAgB,EAChB,MAAsD,EACxD,EAAE;IACA,MAAM,IAAI,GAAG,YAAY,EAAE,CAAA;IAC3B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAA;IACrE,MAAM,CAAC,CAAC,CAAC,IAAI,YAAY,KAAK,CAAC,EAAE,sBAAsB,CAAC,CAAA;IACxD,OAAO,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;AACvD,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTimeline.js","sourceRoot":"","sources":["../../src/useTimeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"useTimeline.js","sourceRoot":"","sources":["../../src/useTimeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAsB,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAyB,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACvB,QAAgB,EAChB,MAAyD,EAC3D,EAAE;IACA,MAAM,IAAI,GAAG,YAAY,EAAE,CAAA;IAC3B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAA;IACrE,MAAM,CAAC,CAAC,CAAC,IAAI,YAAY,KAAK,CAAC,EAAE,8BAA8B,CAAC,CAAA;IAChE,OAAO,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AACtD,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreateDm.d.ts","sourceRoot":"","sources":["../../src/useCreateDm.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,KAAK,YAAY,EAAa,MAAM,uBAAuB,CAAA;AAGpE;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;;;;;;;;IAK1D;;;;OAIG
|
|
1
|
+
{"version":3,"file":"useCreateDm.d.ts","sourceRoot":"","sources":["../../src/useCreateDm.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,KAAK,YAAY,EAAa,MAAM,uBAAuB,CAAA;AAGpE;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;;;;;;;;IAK1D;;;;OAIG;;;;;;;CAIV,CAAA"}
|
|
@@ -20,6 +20,7 @@ export declare const useCreateGdm: (config?: ActionConfig<Gdms["createGDM"]>) =>
|
|
|
20
20
|
*/
|
|
21
21
|
createGDM: (userIds: string[], channelProperties?: import("@towns-protocol/proto").EncryptedData | undefined, streamSettings?: {
|
|
22
22
|
disableMiniblockCreation: boolean;
|
|
23
|
+
lightStream: boolean;
|
|
23
24
|
} | undefined) => Promise<{
|
|
24
25
|
streamId: string;
|
|
25
26
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreateGdm.d.ts","sourceRoot":"","sources":["../../src/useCreateGdm.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,KAAK,YAAY,EAAa,MAAM,uBAAuB,CAAA;AAGpE;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;;;;;;;;IAK7D;;;;OAIG
|
|
1
|
+
{"version":3,"file":"useCreateGdm.d.ts","sourceRoot":"","sources":["../../src/useCreateGdm.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,KAAK,YAAY,EAAa,MAAM,uBAAuB,CAAA;AAGpE;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;;;;;;;;IAK7D;;;;OAIG;;;;;;;CAIV,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MessageReactions } from '@towns-protocol/sdk';
|
|
2
2
|
import { type ObservableConfig } from './useObservable';
|
|
3
3
|
/**
|
|
4
4
|
* Hook to get the reactions of a specific stream.
|
|
@@ -6,5 +6,5 @@ import { type ObservableConfig } from './useObservable';
|
|
|
6
6
|
* @param config - Configuration options for the observable.
|
|
7
7
|
* @returns The reactions of the stream as a map from the message eventId to the reaction.
|
|
8
8
|
*/
|
|
9
|
-
export declare const useReactions: (streamId: string, config?: ObservableConfig.FromData<
|
|
9
|
+
export declare const useReactions: (streamId: string, config?: ObservableConfig.FromData<Record<string, MessageReactions>>) => import("./useObservable").ObservableValue<Record<string, MessageReactions>>;
|
|
10
10
|
//# sourceMappingURL=useReactions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReactions.d.ts","sourceRoot":"","sources":["../../src/useReactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useReactions.d.ts","sourceRoot":"","sources":["../../src/useReactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAiB,MAAM,qBAAqB,CAAA;AAErE,OAAO,EAAE,KAAK,gBAAgB,EAAiB,MAAM,iBAAiB,CAAA;AAGtE;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GACrB,UAAU,MAAM,EAChB,SAAS,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,gFAOvE,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TimelinesMap } from '@towns-protocol/sdk';
|
|
2
2
|
import { type ObservableConfig } from './useObservable';
|
|
3
3
|
/**
|
|
4
4
|
* Hook to get the threads from a stream.
|
|
@@ -7,7 +7,5 @@ import { type ObservableConfig } from './useObservable';
|
|
|
7
7
|
* @param config - Configuration options for the observable.
|
|
8
8
|
* @returns The threads of the stream as a map from the message eventId to a thread.
|
|
9
9
|
*/
|
|
10
|
-
export declare const useThreads: (streamId: string, config?: ObservableConfig.FromObservable<
|
|
11
|
-
[x: string]: import("@towns-protocol/sdk").TimelineEvent[];
|
|
12
|
-
}>;
|
|
10
|
+
export declare const useThreads: (streamId: string, config?: ObservableConfig.FromObservable<TimelinesMap>) => import("./useObservable").ObservableValue<TimelinesMap>;
|
|
13
11
|
//# sourceMappingURL=useThreads.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThreads.d.ts","sourceRoot":"","sources":["../../src/useThreads.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,
|
|
1
|
+
{"version":3,"file":"useThreads.d.ts","sourceRoot":"","sources":["../../src/useThreads.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,YAAY,EAAU,MAAM,qBAAqB,CAAA;AAEjE,OAAO,EAAE,KAAK,gBAAgB,EAAiB,MAAM,iBAAiB,CAAA;AAGtE;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GACnB,UAAU,MAAM,EAChB,SAAS,gBAAgB,CAAC,cAAc,CAAC,YAAY,CAAC,4DAMzD,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type TimelineEvent } from '@towns-protocol/sdk';
|
|
2
2
|
import { type ObservableConfig } from './useObservable';
|
|
3
3
|
/**
|
|
4
4
|
* Hook to get the timeline events from a stream.
|
|
@@ -20,5 +20,5 @@ import { type ObservableConfig } from './useObservable';
|
|
|
20
20
|
* @param config - Configuration options for the observable.
|
|
21
21
|
* @returns The timeline events of the stream as an observable.
|
|
22
22
|
*/
|
|
23
|
-
export declare const useTimeline: (streamId: string, config?: ObservableConfig.FromObservable<
|
|
23
|
+
export declare const useTimeline: (streamId: string, config?: ObservableConfig.FromObservable<TimelineEvent[]>) => import("./useObservable").ObservableValue<TimelineEvent[]>;
|
|
24
24
|
//# sourceMappingURL=useTimeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTimeline.d.ts","sourceRoot":"","sources":["../../src/useTimeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,
|
|
1
|
+
{"version":3,"file":"useTimeline.d.ts","sourceRoot":"","sources":["../../src/useTimeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,aAAa,EAAU,MAAM,qBAAqB,CAAA;AAEvE,OAAO,EAAE,KAAK,gBAAgB,EAAiB,MAAM,iBAAiB,CAAA;AAItE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,WAAW,GACpB,UAAU,MAAM,EAChB,SAAS,gBAAgB,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC,+DAM5D,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@towns-protocol/react-sdk",
|
|
3
3
|
"description": "React Hooks for Towns Protocol SDK",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.245",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/esm/index.js",
|
|
7
7
|
"types": "./dist/types/index.d.ts",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"watch": "yarn build -w"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@towns-protocol/sdk": "^0.0.
|
|
24
|
+
"@towns-protocol/sdk": "^0.0.245",
|
|
25
25
|
"ethers": "^5.7.2"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
},
|
|
71
71
|
"sideEffects": false,
|
|
72
72
|
"typings": "./dist/types/index.d.ts",
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "72b12b78630a122af504bbe8ad8d655820ae9d7b"
|
|
74
74
|
}
|
package/src/useReactions.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MessageReactions, Space, assert } from '@towns-protocol/sdk'
|
|
2
2
|
import { useSyncAgent } from './useSyncAgent'
|
|
3
3
|
import { type ObservableConfig, useObservable } from './useObservable'
|
|
4
4
|
import { getRoom } from './utils'
|
|
@@ -11,7 +11,7 @@ import { getRoom } from './utils'
|
|
|
11
11
|
*/
|
|
12
12
|
export const useReactions = (
|
|
13
13
|
streamId: string,
|
|
14
|
-
config?: ObservableConfig.FromData<
|
|
14
|
+
config?: ObservableConfig.FromData<Record<string, MessageReactions>>,
|
|
15
15
|
) => {
|
|
16
16
|
const sync = useSyncAgent()
|
|
17
17
|
const room = getRoom(sync, streamId)
|
package/src/useThreads.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from 'react'
|
|
2
|
-
import { Space,
|
|
2
|
+
import { Space, TimelinesMap, assert } from '@towns-protocol/sdk'
|
|
3
3
|
import { useSyncAgent } from './useSyncAgent'
|
|
4
4
|
import { type ObservableConfig, useObservable } from './useObservable'
|
|
5
5
|
import { getRoom } from './utils'
|
|
@@ -11,7 +11,10 @@ import { getRoom } from './utils'
|
|
|
11
11
|
* @param config - Configuration options for the observable.
|
|
12
12
|
* @returns The threads of the stream as a map from the message eventId to a thread.
|
|
13
13
|
*/
|
|
14
|
-
export const useThreads = (
|
|
14
|
+
export const useThreads = (
|
|
15
|
+
streamId: string,
|
|
16
|
+
config?: ObservableConfig.FromObservable<TimelinesMap>,
|
|
17
|
+
) => {
|
|
15
18
|
const sync = useSyncAgent()
|
|
16
19
|
const room = useMemo(() => getRoom(sync, streamId), [streamId, sync])
|
|
17
20
|
assert(!(room instanceof Space), 'room cant be a space')
|
package/src/useTimeline.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Space, type
|
|
1
|
+
import { Space, type TimelineEvent, assert } from '@towns-protocol/sdk'
|
|
2
2
|
import { useMemo } from 'react'
|
|
3
3
|
import { type ObservableConfig, useObservable } from './useObservable'
|
|
4
4
|
import { getRoom } from './utils'
|
|
@@ -26,7 +26,7 @@ import { useSyncAgent } from './useSyncAgent'
|
|
|
26
26
|
*/
|
|
27
27
|
export const useTimeline = (
|
|
28
28
|
streamId: string,
|
|
29
|
-
config?: ObservableConfig.FromObservable<
|
|
29
|
+
config?: ObservableConfig.FromObservable<TimelineEvent[]>,
|
|
30
30
|
) => {
|
|
31
31
|
const sync = useSyncAgent()
|
|
32
32
|
const room = useMemo(() => getRoom(sync, streamId), [streamId, sync])
|