@marktiderman/genesis-chat 0.8.0 → 0.10.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/README.md +1 -1
- package/dist/native.d.ts +11 -6
- package/dist/native.js +167 -233
- package/dist/native.js.map +1 -1
- package/dist/web.d.ts +7 -3
- package/dist/web.js +269 -265
- package/dist/web.js.map +1 -1
- package/migrations/0005_genesis_chat_attachment_paths.sql +80 -0
- package/migrations/tests/0005_genesis_chat_attachment_paths.test.sql +111 -0
- package/package.json +13 -9
- package/src/__tests__/web-attachment-view.test.ts +33 -0
- package/src/__tests__/web.test.tsx +160 -3
- package/src/native/__tests__/composer.test.tsx +75 -0
- package/src/native/__tests__/organise-screens.test.tsx +1 -1
- package/src/native/__tests__/thread-screen.test.tsx +104 -2
- package/src/native/composer.tsx +53 -79
- package/src/native/context.tsx +9 -2
- package/src/native/message-bubble.tsx +3 -3
- package/src/native/modules.ts +13 -18
- package/src/native/organise-copy.ts +3 -0
- package/src/native/thread-screen.tsx +81 -205
- package/src/native/use-jump.ts +5 -2
- package/src/web/attachments.tsx +16 -3
- package/src/web/bubble.tsx +4 -2
- package/src/web/composer.tsx +2 -4
- package/src/web/dock.tsx +3 -3
- package/src/web/inbox.tsx +82 -90
- package/src/web/thread.tsx +248 -259
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ replies, threads, reactions, read state, live updates and push.
|
|
|
11
11
|
| `/web` | Renderers on genesis-ui: inbox, thread, composer (text, photos, voice, video, emoji, scheduled send), media, topics, search, availability, broadcast, and the chat dock. |
|
|
12
12
|
| `/native` | Beta: screens and parts on genesis-ui-native (inbox, thread, search, availability), voice notes, photos and video, and the push block's glue. See "On native" below. |
|
|
13
13
|
| `/server` | `createChatRunner`: works the outbox (push, transcripts, storage cleanup). |
|
|
14
|
-
| `migrations/0001_genesis_chat.sql` … `
|
|
14
|
+
| `migrations/0001_genesis_chat.sql` … `0005_genesis_chat_attachment_paths.sql` | The schema, copied into your app by `genesis add chat` in order, each with its pgTAP test. 0003 makes `search_messages` return a hit's `thread_root_id`; 0004 puts every conversation in a tenant (see Tenants). |
|
|
15
15
|
|
|
16
16
|
## On the web
|
|
17
17
|
|
package/dist/native.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ interface ChatOrganiseCopy {
|
|
|
36
36
|
topicClosedDone: string;
|
|
37
37
|
topicReopenedDone: string;
|
|
38
38
|
schedule: string;
|
|
39
|
+
/** The hint on Send when it can schedule. */
|
|
40
|
+
scheduleHoldHint: string;
|
|
39
41
|
scheduleTitle: string;
|
|
40
42
|
scheduleHint: string;
|
|
41
43
|
schedulePick: string;
|
|
@@ -285,7 +287,7 @@ declare function fill(text: string, values: Record<string, string | number>): st
|
|
|
285
287
|
*
|
|
286
288
|
* import * as Audio from "expo-audio"; // voice notes
|
|
287
289
|
* import * as ImagePicker from "expo-image-picker"; // photos and videos
|
|
288
|
-
* import * as Haptics from "expo-haptics"; // send and record
|
|
290
|
+
* import * as Haptics from "expo-haptics"; // send and record (Genesis's module is used when this is left out)
|
|
289
291
|
* import * as Clipboard from "expo-clipboard"; // copy, paste a picture
|
|
290
292
|
* import { KeyboardAvoidingView } from "react-native-keyboard-controller";
|
|
291
293
|
* import AsyncStorage from "@react-native-async-storage/async-storage"; // drafts
|
|
@@ -808,7 +810,10 @@ interface JumpTarget {
|
|
|
808
810
|
messageId: string;
|
|
809
811
|
seq?: number;
|
|
810
812
|
}
|
|
811
|
-
/**
|
|
813
|
+
/**
|
|
814
|
+
* The row a message is drawn in, or -1.
|
|
815
|
+
* @deprecated NativeThreadList finds a row by `jumpId`. Removed in a later minor, with `useJumpToMessage`.
|
|
816
|
+
*/
|
|
812
817
|
declare function rowIndexOf(rows: readonly ThreadRow[], messageId: string): number;
|
|
813
818
|
interface UseJumpOptions {
|
|
814
819
|
/** What to go to; a new target (another id or seq) starts again. */
|
|
@@ -829,7 +834,7 @@ interface UseJumpOptions {
|
|
|
829
834
|
onError: (e: unknown) => void;
|
|
830
835
|
}
|
|
831
836
|
/**
|
|
832
|
-
* @deprecated
|
|
837
|
+
* @deprecated Use genesis-ui-native's `NativeThreadList` (`jumpTo`, `jumpId`, `onLoadUntil`), or `useThreadJump` for a list of your own. ChatThreadScreen is on NativeThreadList; this copy is removed in a later minor.
|
|
833
838
|
*/
|
|
834
839
|
declare function useJumpToMessage({ target, rows, loading, has, loadUntil, scrollTo, onStart, onLanded, onGone, onError }: UseJumpOptions): {
|
|
835
840
|
highlightedId: string | null;
|
|
@@ -880,7 +885,7 @@ interface ChatThreadScreenSlots {
|
|
|
880
885
|
}
|
|
881
886
|
/**
|
|
882
887
|
* Points from the bottom that still count as "at the bottom" (FlatList, which follows by hand).
|
|
883
|
-
* @deprecated
|
|
888
|
+
* @deprecated Use genesis-ui-native's `THREAD_AT_BOTTOM_POINTS`. ChatThreadScreen is on NativeThreadList; this copy is removed in a later minor.
|
|
884
889
|
*/
|
|
885
890
|
declare const AT_BOTTOM_POINTS = 120;
|
|
886
891
|
/**
|
|
@@ -889,7 +894,7 @@ declare const AT_BOTTOM_POINTS = 120;
|
|
|
889
894
|
* a screen of it, keeps the first visible row in place when earlier ones load
|
|
890
895
|
* at the top). FlatList: keeps its place when earlier rows load at the top;
|
|
891
896
|
* the screen follows new rows itself (`followsByHand`).
|
|
892
|
-
* @deprecated
|
|
897
|
+
* @deprecated Use genesis-ui-native's `threadListMode` (which anchors FlatList past the header, `minIndexForVisible: 1`). ChatThreadScreen is on NativeThreadList; this copy is removed in a later minor.
|
|
893
898
|
*/
|
|
894
899
|
declare function threadListMode(flash: boolean, reducedMotion: boolean): {
|
|
895
900
|
followsByHand: boolean;
|
|
@@ -897,7 +902,7 @@ declare function threadListMode(flash: boolean, reducedMotion: boolean): {
|
|
|
897
902
|
};
|
|
898
903
|
/**
|
|
899
904
|
* Whether a scroll position is at (or near) the bottom of its content.
|
|
900
|
-
* @deprecated
|
|
905
|
+
* @deprecated Use genesis-ui-native's `threadNearBottom`. ChatThreadScreen is on NativeThreadList; this copy is removed in a later minor.
|
|
901
906
|
*/
|
|
902
907
|
declare function nearBottom(m: {
|
|
903
908
|
contentOffset: {
|