@ttt-productions/chat-react 0.13.2 → 0.13.3

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.
Files changed (58) hide show
  1. package/README.md +13 -11
  2. package/dist/context/ChatNameResolverContext.d.ts +3 -3
  3. package/dist/context/ChatNameResolverContext.js +3 -3
  4. package/dist/context/ChatNameResolverContext.js.map +1 -1
  5. package/dist/hooks/useChatMessages.d.ts.map +1 -1
  6. package/dist/hooks/useChatMessages.js +4 -13
  7. package/dist/hooks/useChatMessages.js.map +1 -1
  8. package/dist/index.d.ts +2 -4
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +1 -3
  11. package/dist/index.js.map +1 -1
  12. package/dist/realtime/channel-client.d.ts +0 -4
  13. package/dist/realtime/channel-client.d.ts.map +1 -1
  14. package/dist/realtime/channel-client.js +0 -8
  15. package/dist/realtime/channel-client.js.map +1 -1
  16. package/dist/realtime/map.d.ts +3 -5
  17. package/dist/realtime/map.d.ts.map +1 -1
  18. package/dist/realtime/map.js +3 -18
  19. package/dist/realtime/map.js.map +1 -1
  20. package/dist/realtime/useRealtimeChatMessages.d.ts +1 -4
  21. package/dist/realtime/useRealtimeChatMessages.d.ts.map +1 -1
  22. package/dist/realtime/useRealtimeChatMessages.js +1 -3
  23. package/dist/realtime/useRealtimeChatMessages.js.map +1 -1
  24. package/dist/realtime/wire.d.ts +6 -5
  25. package/dist/realtime/wire.d.ts.map +1 -1
  26. package/dist/realtime/wire.js.map +1 -1
  27. package/dist/types.d.ts +1 -52
  28. package/dist/types.d.ts.map +1 -1
  29. package/dist/types.js.map +1 -1
  30. package/dist/ui/ChatShell.d.ts +2 -2
  31. package/dist/ui/ChatShell.d.ts.map +1 -1
  32. package/dist/ui/ChatShell.js +6 -10
  33. package/dist/ui/ChatShell.js.map +1 -1
  34. package/dist/ui/Composer.d.ts +7 -6
  35. package/dist/ui/Composer.d.ts.map +1 -1
  36. package/dist/ui/Composer.js +2 -18
  37. package/dist/ui/Composer.js.map +1 -1
  38. package/dist/ui/MessageItemDefault.d.ts.map +1 -1
  39. package/dist/ui/MessageItemDefault.js +7 -12
  40. package/dist/ui/MessageItemDefault.js.map +1 -1
  41. package/dist/ui/MessageText.d.ts +19 -0
  42. package/dist/ui/MessageText.d.ts.map +1 -0
  43. package/dist/ui/MessageText.js +7 -0
  44. package/dist/ui/MessageText.js.map +1 -0
  45. package/package.json +5 -5
  46. package/src/styles/chat.css +0 -40
  47. package/dist/mentions/MentionAutocomplete.d.ts +0 -22
  48. package/dist/mentions/MentionAutocomplete.d.ts.map +0 -1
  49. package/dist/mentions/MentionAutocomplete.js +0 -21
  50. package/dist/mentions/MentionAutocomplete.js.map +0 -1
  51. package/dist/mentions/MessageText.d.ts +0 -27
  52. package/dist/mentions/MessageText.d.ts.map +0 -1
  53. package/dist/mentions/MessageText.js +0 -20
  54. package/dist/mentions/MessageText.js.map +0 -1
  55. package/dist/mentions/use-mention-autocomplete.d.ts +0 -82
  56. package/dist/mentions/use-mention-autocomplete.d.ts.map +0 -1
  57. package/dist/mentions/use-mention-autocomplete.js +0 -323
  58. package/dist/mentions/use-mention-autocomplete.js.map +0 -1
package/README.md CHANGED
@@ -1,21 +1,21 @@
1
1
  # @ttt-productions/chat-react
2
2
 
3
3
  Chat **React UI** for TTT Productions apps: chat shell, composer, message list,
4
- the generic mention autocomplete UI, the name-resolver context, and the
5
- realtime-newest-window + infinite-older hooks. Chat is TEXT-only — a
6
- conversation's files live in the consuming app's Conversation Files surface,
7
- never in the message timeline.
4
+ the name-resolver context, and the realtime-newest-window + infinite-older
5
+ hooks. Chat is PLAIN-TEXT-only — a conversation's files live in the consuming
6
+ app's Conversation Files surface, never in the message timeline, and message text
7
+ carries no token grammar (no mentions, no autocomplete, no chips).
8
8
 
9
9
  Built on the pure [`@ttt-productions/chat-core`](../chat-core) package
10
- (contracts, mention parser/serializer, grouping). A non-React consumer (a Cloud
11
- Function, a script, a future native/TV client) installs `chat-core` and pulls
12
- in none of this frontend tree.
10
+ (contracts, grouping). A non-React consumer (a Cloud Function, a script, a
11
+ future native/TV client) installs `chat-core` and pulls in none of this frontend
12
+ tree.
13
13
 
14
14
  ## Entry points
15
15
 
16
16
  - `.` — React components, hooks, the Firebase-client adapter config types
17
- (`ChatCoreConfig`, `ChatMentionConfig`), and the React render types
18
- (`MessageRenderer`, `RenderableMentionProvider`, `MentionResultRenderer`).
17
+ (`ChatCoreConfig`), and the React render types (`MessageRenderer`,
18
+ `MessageRendererRegistry`).
19
19
  - `./styles` — chat CSS. Import once in your app layout:
20
20
  `import "@ttt-productions/chat-react/styles";`
21
21
 
@@ -27,5 +27,7 @@ are optional peers — provided by the consuming app.
27
27
  ## Boundary
28
28
 
29
29
  `chat-react` does not import `ttt-core`, does not hardcode TTT origins, and does
30
- not build TTT storage paths — it runs no upload path at all. TTT mention kinds,
31
- permissions, provider lists, routing, and search live in TTT code.
30
+ not build TTT storage paths — it runs no upload path at all. It owns no mention
31
+ machinery either: mentions belong to the app's Square-posts surface, not to chat.
32
+ And it owns no reply-to machinery: every send path takes text alone, because the
33
+ product has no affordance for replying to a specific message.
@@ -16,9 +16,9 @@ export type ChatNameResolverProviderProps = {
16
16
  */
17
17
  export declare function ChatNameResolverProvider(props: ChatNameResolverProviderProps): React.JSX.Element;
18
18
  /**
19
- * Strict hook — throws if no provider is wrapped. Used inside chat-core's
20
- * own renderers (MessageItemDefault, ReplyQuote) so a missing setup surfaces
21
- * immediately on first render rather than silently rendering "User".
19
+ * Strict hook — throws if no provider is wrapped. Used inside this package's
20
+ * own renderers (MessageItemDefault) so a missing setup surfaces immediately on
21
+ * first render rather than silently rendering "User".
22
22
  */
23
23
  export declare function useChatNameResolver(): ChatNameResolverContextValue;
24
24
  /**
@@ -13,9 +13,9 @@ export function ChatNameResolverProvider(props) {
13
13
  return (_jsx(ChatNameResolverContext.Provider, { value: value, children: children }));
14
14
  }
15
15
  /**
16
- * Strict hook — throws if no provider is wrapped. Used inside chat-core's
17
- * own renderers (MessageItemDefault, ReplyQuote) so a missing setup surfaces
18
- * immediately on first render rather than silently rendering "User".
16
+ * Strict hook — throws if no provider is wrapped. Used inside this package's
17
+ * own renderers (MessageItemDefault) so a missing setup surfaces immediately on
18
+ * first render rather than silently rendering "User".
19
19
  */
20
20
  export function useChatNameResolver() {
21
21
  const ctx = React.useContext(ChatNameResolverContext);
@@ -1 +1 @@
1
- {"version":3,"file":"ChatNameResolverContext.js","sourceRoot":"","sources":["../../src/context/ChatNameResolverContext.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,uBAAuB,GAAG,KAAK,CAAC,aAAa,CAAsC,IAAI,CAAC,CAAC;AAQ/F;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAoC;IAC3E,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACjD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IACtF,OAAO,CACL,KAAC,uBAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAC3C,QAAQ,GACwB,CACpC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;IACtD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,6GAA6G,CAC9G,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,2BAA2B;IACzC,OAAO,KAAK,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgB;IACpD,MAAM,EAAE,WAAW,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAC9C,OAAO,WAAW,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC;AACzC,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type { ChatNameResolver, ChatPrewarmSenders } from \"@ttt-productions/chat-core\";\n\ntype ChatNameResolverContextValue = {\n resolveName: ChatNameResolver;\n prewarm?: ChatPrewarmSenders;\n};\n\nconst ChatNameResolverContext = React.createContext<ChatNameResolverContextValue | null>(null);\n\nexport type ChatNameResolverProviderProps = {\n resolveName: ChatNameResolver;\n prewarm?: ChatPrewarmSenders;\n children: React.ReactNode;\n};\n\n/**\n * Wraps any chat-core consumer (typically the whole app shell) and provides\n * a name resolver. Required for any tree that renders <ChatShell>, <MessageList>,\n * or <MessageItemDefault>.\n */\nexport function ChatNameResolverProvider(props: ChatNameResolverProviderProps) {\n const { resolveName, prewarm, children } = props;\n const value = React.useMemo(() => ({ resolveName, prewarm }), [resolveName, prewarm]);\n return (\n <ChatNameResolverContext.Provider value={value}>\n {children}\n </ChatNameResolverContext.Provider>\n );\n}\n\n/**\n * Strict hook — throws if no provider is wrapped. Used inside chat-core's\n * own renderers (MessageItemDefault, ReplyQuote) so a missing setup surfaces\n * immediately on first render rather than silently rendering \"User\".\n */\nexport function useChatNameResolver(): ChatNameResolverContextValue {\n const ctx = React.useContext(ChatNameResolverContext);\n if (!ctx) {\n throw new Error(\n \"[chat-core] ChatNameResolverProvider is required. Wrap your ChatShell tree with <ChatNameResolverProvider>.\"\n );\n }\n return ctx;\n}\n\n/**\n * Optional variant — returns null instead of throwing when no provider is\n * wrapped. Used internally by useChatMessages so headless callers (tests,\n * data-only consumers that don't render UI) can still use the hook.\n */\nexport function useOptionalChatNameResolver(): ChatNameResolverContextValue | null {\n return React.useContext(ChatNameResolverContext);\n}\n\n/**\n * Convenience hook for renderers. Returns a resolved string — never null —\n * by falling back to \"User\" when the cache hasn't filled yet. Re-renders\n * automatically once the upstream cache settles.\n */\nexport function useResolvedSenderName(senderId: string): string {\n const { resolveName } = useChatNameResolver();\n return resolveName(senderId) ?? \"User\";\n}\n"]}
1
+ {"version":3,"file":"ChatNameResolverContext.js","sourceRoot":"","sources":["../../src/context/ChatNameResolverContext.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,uBAAuB,GAAG,KAAK,CAAC,aAAa,CAAsC,IAAI,CAAC,CAAC;AAQ/F;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAoC;IAC3E,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACjD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IACtF,OAAO,CACL,KAAC,uBAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAC3C,QAAQ,GACwB,CACpC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;IACtD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,6GAA6G,CAC9G,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,2BAA2B;IACzC,OAAO,KAAK,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgB;IACpD,MAAM,EAAE,WAAW,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAC9C,OAAO,WAAW,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC;AACzC,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type { ChatNameResolver, ChatPrewarmSenders } from \"@ttt-productions/chat-core\";\n\ntype ChatNameResolverContextValue = {\n resolveName: ChatNameResolver;\n prewarm?: ChatPrewarmSenders;\n};\n\nconst ChatNameResolverContext = React.createContext<ChatNameResolverContextValue | null>(null);\n\nexport type ChatNameResolverProviderProps = {\n resolveName: ChatNameResolver;\n prewarm?: ChatPrewarmSenders;\n children: React.ReactNode;\n};\n\n/**\n * Wraps any chat-core consumer (typically the whole app shell) and provides\n * a name resolver. Required for any tree that renders <ChatShell>, <MessageList>,\n * or <MessageItemDefault>.\n */\nexport function ChatNameResolverProvider(props: ChatNameResolverProviderProps) {\n const { resolveName, prewarm, children } = props;\n const value = React.useMemo(() => ({ resolveName, prewarm }), [resolveName, prewarm]);\n return (\n <ChatNameResolverContext.Provider value={value}>\n {children}\n </ChatNameResolverContext.Provider>\n );\n}\n\n/**\n * Strict hook — throws if no provider is wrapped. Used inside this package's\n * own renderers (MessageItemDefault) so a missing setup surfaces immediately on\n * first render rather than silently rendering \"User\".\n */\nexport function useChatNameResolver(): ChatNameResolverContextValue {\n const ctx = React.useContext(ChatNameResolverContext);\n if (!ctx) {\n throw new Error(\n \"[chat-core] ChatNameResolverProvider is required. Wrap your ChatShell tree with <ChatNameResolverProvider>.\"\n );\n }\n return ctx;\n}\n\n/**\n * Optional variant — returns null instead of throwing when no provider is\n * wrapped. Used internally by useChatMessages so headless callers (tests,\n * data-only consumers that don't render UI) can still use the hook.\n */\nexport function useOptionalChatNameResolver(): ChatNameResolverContextValue | null {\n return React.useContext(ChatNameResolverContext);\n}\n\n/**\n * Convenience hook for renderers. Returns a resolved string — never null —\n * by falling back to \"User\" when the cache hasn't filled yet. Re-renders\n * automatically once the upstream cache settles.\n */\nexport function useResolvedSenderName(senderId: string): string {\n const { resolveName } = useChatNameResolver();\n return resolveName(senderId) ?? \"User\";\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useChatMessages.d.ts","sourceRoot":"","sources":["../../src/hooks/useChatMessages.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAQlD,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAwCF,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,qBAAqB,CAuF7E"}
1
+ {"version":3,"file":"useChatMessages.d.ts","sourceRoot":"","sources":["../../src/hooks/useChatMessages.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAQlD,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAgCF,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,qBAAqB,CAsF7E"}
@@ -13,15 +13,9 @@ function mapMsg(data, threadId) {
13
13
  if (!createdAt) {
14
14
  console.error('[useChatMessages] Message missing valid createdAt:', data.id, d.createdAt);
15
15
  }
16
- // replyTo: the new shape uses senderId, not senderUsername. Tolerate older
17
- // docs that still have senderUsername — drop the name and keep what we can.
18
- const replyTo = d.replyTo
19
- ? {
20
- messageId: d.replyTo.messageId,
21
- senderId: d.replyTo.senderId ?? "",
22
- messagePreview: d.replyTo.messagePreview,
23
- }
24
- : undefined;
16
+ // A stored `replyTo` (if any legacy doc still carries one) is deliberately NOT
17
+ // mapped: chat has no reply-authoring affordance, so the UI has no reply
18
+ // renderer to feed (DJ ruling 2026-07-29).
25
19
  return {
26
20
  messageId: data.id,
27
21
  threadId,
@@ -29,7 +23,6 @@ function mapMsg(data, threadId) {
29
23
  senderId: d.senderId,
30
24
  text: d.text ?? "",
31
25
  type: d.type,
32
- replyTo,
33
26
  isSystemMessage: d.isSystemMessage ?? undefined,
34
27
  // Moderation tombstone flag (backend-written) — carried through so renderers
35
28
  // can tombstone the content.
@@ -64,15 +57,13 @@ export function useChatMessages(config) {
64
57
  getSortValue: (data) => toMillis(data.createdAt) ?? 0,
65
58
  });
66
59
  const messages = React.useMemo(() => (allowed ? items : []), [allowed, items]);
67
- // Pre-warm name cache for all visible senders (and reply-to senders).
60
+ // Pre-warm name cache for all visible senders.
68
61
  // Optional resolver: silent no-op if no provider is wrapped.
69
62
  const resolverCtx = useOptionalChatNameResolver();
70
63
  const senderIds = React.useMemo(() => {
71
64
  const set = new Set();
72
65
  for (const m of messages) {
73
66
  set.add(m.senderId);
74
- if (m.replyTo?.senderId)
75
- set.add(m.replyTo.senderId);
76
67
  }
77
68
  return Array.from(set);
78
69
  }, [messages]);
@@ -1 +1 @@
1
- {"version":3,"file":"useChatMessages.js","sourceRoot":"","sources":["../../src/hooks/useChatMessages.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAG7E,OAAO,EAAE,eAAe,EAAE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W,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;IAE7B,OAAO;QACL,OAAO;QACP,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK;QACpD,QAAQ;QACR,UAAU;QACV,QAAQ;QACR,eAAe;KAChB,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type { DocumentData } from \"firebase/firestore\";\nimport { toMillis } from \"@ttt-productions/firebase-helpers\";\nimport { useFirestoreLiveInfinite } from \"@ttt-productions/query-core/react\";\nimport type { ChatMessageV1 } from \"@ttt-productions/chat-core\";\nimport type { ChatCoreConfig } from \"../types.js\";\nimport { canAccessThread } from \"./useChatThreadAccess.js\";\nimport { messagesColPath } from \"../firestore/queries.js\";\nimport { useOptionalChatNameResolver } from \"../context/ChatNameResolverContext.js\";\n\n// Safety limit to prevent memory exhaustion\nconst MAX_PAGE_SIZE = 100;\n\nexport type UseChatMessagesResult = {\n allowed: boolean;\n isInitialLoading: boolean;\n messages: ChatMessageV1[];\n fetchOlder: () => Promise<void>;\n hasOlder: boolean;\n isFetchingOlder: boolean;\n};\n\nfunction mapMsg(\n data: DocumentData & { id: string },\n threadId: string\n): ChatMessageV1 {\n const d = data as any;\n\n const createdAt = toMillis(d.createdAt);\n\n if (!createdAt) {\n console.error('[useChatMessages] Message missing valid createdAt:', data.id, d.createdAt);\n }\n\n // replyTo: the new shape uses senderId, not senderUsername. Tolerate older\n // docs that still have senderUsername — drop the name and keep what we can.\n const replyTo = d.replyTo\n ? {\n messageId: d.replyTo.messageId,\n senderId: d.replyTo.senderId ?? \"\",\n messagePreview: d.replyTo.messagePreview,\n }\n : undefined;\n\n return {\n messageId: data.id,\n threadId,\n createdAt: createdAt || 0,\n senderId: d.senderId,\n text: d.text ?? \"\",\n type: d.type,\n replyTo,\n isSystemMessage: d.isSystemMessage ?? undefined,\n // Moderation tombstone flag (backend-written) — carried through so renderers\n // can tombstone the content.\n hidden: d.hidden ?? undefined,\n meta: d.meta,\n };\n}\n\nexport function useChatMessages(config: ChatCoreConfig): UseChatMessagesResult {\n const {\n chatCollectionPath,\n messagesSubcollection = \"messages\",\n threadId,\n pageSize: requestedPageSize = 20,\n currentUserId,\n isAdmin,\n accessMode,\n threadAllowedUserIds,\n createdAtField = \"createdAt\",\n } = config;\n\n const pageSize = Math.min(requestedPageSize, MAX_PAGE_SIZE);\n\n if (requestedPageSize > MAX_PAGE_SIZE) {\n console.warn(\n `[useChatMessages] Requested pageSize ${requestedPageSize} exceeds maximum ${MAX_PAGE_SIZE}. Using ${MAX_PAGE_SIZE}.`\n );\n }\n\n const allowed = React.useMemo(\n () =>\n canAccessThread({\n accessMode,\n isAdmin,\n currentUserId,\n allowedUserIds: threadAllowedUserIds,\n }),\n [accessMode, isAdmin, currentUserId, threadAllowedUserIds]\n );\n\n // Stable key segment for the message collection path (string | string[]).\n const pathKey = React.useMemo(\n () =>\n JSON.stringify(\n Array.isArray(chatCollectionPath) ? chatCollectionPath : [chatCollectionPath]\n ),\n [chatCollectionPath]\n );\n\n // Slash-joined collection path for the generic hook (handles nested paths).\n const collectionPath = React.useMemo(\n () => messagesColPath(chatCollectionPath, threadId, messagesSubcollection).join(\"/\"),\n [chatCollectionPath, threadId, messagesSubcollection]\n );\n\n const { items, isInitialLoading, fetchOlder, hasOlder, isFetchingOlder } =\n useFirestoreLiveInfinite<ChatMessageV1>({\n collectionPath,\n queryKey: [\"chat-core\", \"messages\", pathKey, threadId, messagesSubcollection, pageSize],\n orderByField: createdAtField,\n pageSize,\n enabled: allowed,\n sort: \"asc\",\n select: (data) => mapMsg(data, threadId),\n getSortValue: (data) => toMillis(data.createdAt) ?? 0,\n });\n\n const messages = React.useMemo(() => (allowed ? items : []), [allowed, items]);\n\n // Pre-warm name cache for all visible senders (and reply-to senders).\n // Optional resolver: silent no-op if no provider is wrapped.\n const resolverCtx = useOptionalChatNameResolver();\n const senderIds = React.useMemo(() => {\n const set = new Set<string>();\n for (const m of messages) {\n set.add(m.senderId);\n if (m.replyTo?.senderId) set.add(m.replyTo.senderId);\n }\n return Array.from(set);\n }, [messages]);\n\n React.useEffect(() => {\n if (resolverCtx?.prewarm && senderIds.length > 0) {\n resolverCtx.prewarm(senderIds);\n }\n }, [resolverCtx, senderIds]);\n\n return {\n allowed,\n isInitialLoading: allowed ? isInitialLoading : false,\n messages,\n fetchOlder,\n hasOlder,\n isFetchingOlder,\n };\n}"]}
1
+ {"version":3,"file":"useChatMessages.js","sourceRoot":"","sources":["../../src/hooks/useChatMessages.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAG7E,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAEpF,4CAA4C;AAC5C,MAAM,aAAa,GAAG,GAAG,CAAC;AAW1B,SAAS,MAAM,CACb,IAAmC,EACnC,QAAgB;IAEhB,MAAM,CAAC,GAAG,IAAW,CAAC;IAEtB,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAExC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,oDAAoD,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;IAC5F,CAAC;IAED,+EAA+E;IAC/E,yEAAyE;IACzE,2CAA2C;IAC3C,OAAO;QACL,SAAS,EAAE,IAAI,CAAC,EAAE;QAClB,QAAQ;QACR,SAAS,EAAE,SAAS,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Q,CAAC,CAAC;QACtB,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,WAAW,EAAE,OAAO,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjD,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;IAE7B,OAAO;QACL,OAAO;QACP,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK;QACpD,QAAQ;QACR,UAAU;QACV,QAAQ;QACR,eAAe;KAChB,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type { DocumentData } from \"firebase/firestore\";\nimport { toMillis } from \"@ttt-productions/firebase-helpers\";\nimport { useFirestoreLiveInfinite } from \"@ttt-productions/query-core/react\";\nimport type { ChatMessageV1 } from \"@ttt-productions/chat-core\";\nimport type { ChatCoreConfig } from \"../types.js\";\nimport { canAccessThread } from \"./useChatThreadAccess.js\";\nimport { messagesColPath } from \"../firestore/queries.js\";\nimport { useOptionalChatNameResolver } from \"../context/ChatNameResolverContext.js\";\n\n// Safety limit to prevent memory exhaustion\nconst MAX_PAGE_SIZE = 100;\n\nexport type UseChatMessagesResult = {\n allowed: boolean;\n isInitialLoading: boolean;\n messages: ChatMessageV1[];\n fetchOlder: () => Promise<void>;\n hasOlder: boolean;\n isFetchingOlder: boolean;\n};\n\nfunction mapMsg(\n data: DocumentData & { id: string },\n threadId: string\n): ChatMessageV1 {\n const d = data as any;\n\n const createdAt = toMillis(d.createdAt);\n\n if (!createdAt) {\n console.error('[useChatMessages] Message missing valid createdAt:', data.id, d.createdAt);\n }\n\n // A stored `replyTo` (if any legacy doc still carries one) is deliberately NOT\n // mapped: chat has no reply-authoring affordance, so the UI has no reply\n // renderer to feed (DJ ruling 2026-07-29).\n return {\n messageId: data.id,\n threadId,\n createdAt: createdAt || 0,\n senderId: d.senderId,\n text: d.text ?? \"\",\n type: d.type,\n isSystemMessage: d.isSystemMessage ?? undefined,\n // Moderation tombstone flag (backend-written) — carried through so renderers\n // can tombstone the content.\n hidden: d.hidden ?? undefined,\n meta: d.meta,\n };\n}\n\nexport function useChatMessages(config: ChatCoreConfig): UseChatMessagesResult {\n const {\n chatCollectionPath,\n messagesSubcollection = \"messages\",\n threadId,\n pageSize: requestedPageSize = 20,\n currentUserId,\n isAdmin,\n accessMode,\n threadAllowedUserIds,\n createdAtField = \"createdAt\",\n } = config;\n\n const pageSize = Math.min(requestedPageSize, MAX_PAGE_SIZE);\n\n if (requestedPageSize > MAX_PAGE_SIZE) {\n console.warn(\n `[useChatMessages] Requested pageSize ${requestedPageSize} exceeds maximum ${MAX_PAGE_SIZE}. Using ${MAX_PAGE_SIZE}.`\n );\n }\n\n const allowed = React.useMemo(\n () =>\n canAccessThread({\n accessMode,\n isAdmin,\n currentUserId,\n allowedUserIds: threadAllowedUserIds,\n }),\n [accessMode, isAdmin, currentUserId, threadAllowedUserIds]\n );\n\n // Stable key segment for the message collection path (string | string[]).\n const pathKey = React.useMemo(\n () =>\n JSON.stringify(\n Array.isArray(chatCollectionPath) ? chatCollectionPath : [chatCollectionPath]\n ),\n [chatCollectionPath]\n );\n\n // Slash-joined collection path for the generic hook (handles nested paths).\n const collectionPath = React.useMemo(\n () => messagesColPath(chatCollectionPath, threadId, messagesSubcollection).join(\"/\"),\n [chatCollectionPath, threadId, messagesSubcollection]\n );\n\n const { items, isInitialLoading, fetchOlder, hasOlder, isFetchingOlder } =\n useFirestoreLiveInfinite<ChatMessageV1>({\n collectionPath,\n queryKey: [\"chat-core\", \"messages\", pathKey, threadId, messagesSubcollection, pageSize],\n orderByField: createdAtField,\n pageSize,\n enabled: allowed,\n sort: \"asc\",\n select: (data) => mapMsg(data, threadId),\n getSortValue: (data) => toMillis(data.createdAt) ?? 0,\n });\n\n const messages = React.useMemo(() => (allowed ? items : []), [allowed, items]);\n\n // Pre-warm name cache for all visible senders.\n // Optional resolver: silent no-op if no provider is wrapped.\n const resolverCtx = useOptionalChatNameResolver();\n const senderIds = React.useMemo(() => {\n const set = new Set<string>();\n for (const m of messages) {\n set.add(m.senderId);\n }\n return Array.from(set);\n }, [messages]);\n\n React.useEffect(() => {\n if (resolverCtx?.prewarm && senderIds.length > 0) {\n resolverCtx.prewarm(senderIds);\n }\n }, [resolverCtx, senderIds]);\n\n return {\n allowed,\n isInitialLoading: allowed ? isInitialLoading : false,\n messages,\n fetchOlder,\n hasOlder,\n isFetchingOlder,\n };\n}"]}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { ChatCoreConfig, ChatTransportMode, ChatRealtimeTransportConfig, ChatMentionConfig, MessageRenderer, MessageRendererRegistry, RenderableMentionProvider, MentionResultRenderer, } from "./types.js";
1
+ export type { ChatCoreConfig, ChatTransportMode, ChatRealtimeTransportConfig, MessageRenderer, MessageRendererRegistry, } from "./types.js";
2
2
  export type { ChatNameResolverProviderProps } from "./context/ChatNameResolverContext.js";
3
3
  export { ChatNameResolverProvider, useChatNameResolver, useOptionalChatNameResolver, useResolvedSenderName, } from "./context/ChatNameResolverContext.js";
4
4
  export type { UseChatMessagesResult } from "./hooks/useChatMessages.js";
@@ -14,7 +14,5 @@ export { Composer } from "./ui/Composer.js";
14
14
  export type { MessageItemDefaultProps } from "./ui/MessageItemDefault.js";
15
15
  export { MessageItemDefault } from "./ui/MessageItemDefault.js";
16
16
  export { MessageActions, ThreadActions } from "./ui/menus.js";
17
- export { MessageText, type MessageTextProps } from "./mentions/MessageText.js";
18
- export { MentionAutocomplete, type MentionAutocompleteProps, } from "./mentions/MentionAutocomplete.js";
19
- export { useMentionAutocomplete, type UseMentionAutocompleteArgs, type UseMentionAutocompleteResult, type AutocompleteState, type AutocompleteResultGroup, } from "./mentions/use-mention-autocomplete.js";
17
+ export { MessageText, type MessageTextProps } from "./ui/MessageText.js";
20
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,2BAA2B,EAC3B,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,sCAAsC,CAAC;AAE9C,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAKjE,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,6BAA6B,GAC9B,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,kBAAkB,EAClB,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,6BAA6B,EAC7B,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAU7B,YAAY,EAAE,cAAc,EAAE,MAAM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BAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,6BAA6B,GAC9B,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,kBAAkB,EAClB,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,6BAA6B,EAC7B,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAU7B,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,YAAY,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -11,7 +11,5 @@ export { MessageList } from "./ui/MessageList.js";
11
11
  export { Composer } from "./ui/Composer.js";
12
12
  export { MessageItemDefault } from "./ui/MessageItemDefault.js";
13
13
  export { MessageActions, ThreadActions } from "./ui/menus.js";
14
- export { MessageText } from "./mentions/MessageText.js";
15
- export { MentionAutocomplete, } from "./mentions/MentionAutocomplete.js";
16
- export { useMentionAutocomplete, } from "./mentions/use-mention-autocomplete.js";
14
+ export { MessageText } from "./ui/MessageText.js";
17
15
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAsBb,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,+EAA+E;AAC/E,kFAAkF;AAClF,oFAAoF;AACpF,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,6BAA6B,GAC9B,MAAM,qBAAqB,CAAC;AAkC7B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAyB,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EACL,mBAAmB,GAEpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,sBAAsB,GAKvB,MAAM,wCAAwC,CAAC","sourcesContent":["\"use client\";\n\n// @ttt-productions/chat-react — chat React UI, hooks, the Firebase-client\n// adapter config types, and React render types. Depends on the pure\n// @ttt-productions/chat-core for contracts, parser, and grouping.\n//\n// Apps import chat CSS via \"@ttt-productions/chat-react/styles\".\n\n// React-coupled config + render types (previously on chat-core root).\nexport type {\n ChatCoreConfig,\n ChatTransportMode,\n ChatRealtimeTransportConfig,\n ChatMentionConfig,\n MessageRenderer,\n MessageRendererRegistry,\n RenderableMentionProvider,\n MentionResultRenderer,\n} from \"./types.js\";\n\n// Name-resolver context.\nexport type { ChatNameResolverProviderProps } from \"./context/ChatNameResolverContext.js\";\nexport {\n ChatNameResolverProvider,\n useChatNameResolver,\n useOptionalChatNameResolver,\n useResolvedSenderName,\n} from \"./context/ChatNameResolverContext.js\";\n\nexport type { UseChatMessagesResult } from \"./hooks/useChatMessages.js\";\nexport { useChatMessages } from \"./hooks/useChatMessages.js\";\nexport { canAccessThread } from \"./hooks/useChatThreadAccess.js\";\n\n// Realtime (Cloudflare Durable Object) transport — the client half of the chat\n// worker wire protocol. Opt-in via `ChatCoreConfig.transport === 'realtime'`; the\n// firestore transport stays the unchanged default. See docs/packages/chat-react.md.\nexport {\n createRealtimeChatClient,\n createInboxClient,\n ChannelClient,\n InboxClient,\n useRealtimeChatMessages,\n browserSocketFactory,\n ChatAccessDeniedError,\n isChatAccessDeniedError,\n CHAT_SUBPROTOCOL,\n CHAT_CLOSE_CODES,\n CLIENT_FRAME,\n SERVER_FRAME,\n buildFrame,\n parseFrame,\n CHAT_CLIENT_DIAGNOSTIC_EVENTS,\n} from \"./realtime/index.js\";\nexport type {\n RealtimeChatClient,\n RealtimeTransportConfig,\n ChatClientDiagnosticsOption,\n ChatClientDiagnosticsSink,\n ChatClientDiagnosticEventName,\n ChannelClientState,\n ChannelClientConfig,\n InboxClientState,\n InboxClientConfig,\n UseRealtimeChatMessagesResult,\n GrantProvider,\n TransportTimers,\n RealtimeStatus,\n RealtimeSocket,\n SocketFactory,\n SocketHandlers,\n ChannelRefTuple,\n WireMessageRow,\n WireInboxSnapshot,\n WireRegistryEntry,\n ServerFrame,\n} from \"./realtime/index.js\";\n\n// TODO (re-export when a consumer needs them): the moderation-overlay helpers\n// `RevisionKind`, `ModerationOverlay`, `applyModerationOverlay`, `overlayFromRow`,\n// and `MODERATION_REDACTED_TEXT` live in `./realtime` but are intentionally NOT\n// re-exported from this package root yet — the consuming app's renderer reads moderation\n// state off `message.meta` (the realtime client applies the overlay internally), so\n// nothing imports them from here today. Add them to the block above when a consumer\n// genuinely needs to apply the overlay directly. (Comment-only; rides the next publish.)\n\nexport type { ChatShellProps } from \"./ui/ChatShell.js\";\nexport { ChatShell } from \"./ui/ChatShell.js\";\nexport { MessageList } from \"./ui/MessageList.js\";\nexport type { ComposerProps } from \"./ui/Composer.js\";\nexport { Composer } from \"./ui/Composer.js\";\nexport type { MessageItemDefaultProps } from \"./ui/MessageItemDefault.js\";\nexport { MessageItemDefault } from \"./ui/MessageItemDefault.js\";\nexport { MessageActions, ThreadActions } from \"./ui/menus.js\";\nexport { MessageText, type MessageTextProps } from \"./mentions/MessageText.js\";\nexport {\n MentionAutocomplete,\n type MentionAutocompleteProps,\n} from \"./mentions/MentionAutocomplete.js\";\nexport {\n useMentionAutocomplete,\n type UseMentionAutocompleteArgs,\n type UseMentionAutocompleteResult,\n type AutocompleteState,\n type AutocompleteResultGroup,\n} from \"./mentions/use-mention-autocomplete.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAmBb,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,+EAA+E;AAC/E,kFAAkF;AAClF,oFAAoF;AACpF,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,6BAA6B,GAC9B,MAAM,qBAAqB,CAAC;AAkC7B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAyB,MAAM,qBAAqB,CAAC","sourcesContent":["\"use client\";\n\n// @ttt-productions/chat-react — chat React UI, hooks, the Firebase-client\n// adapter config types, and React render types. Depends on the pure\n// @ttt-productions/chat-core for contracts, parser, and grouping.\n//\n// Apps import chat CSS via \"@ttt-productions/chat-react/styles\".\n\n// React-coupled config + render types (previously on chat-core root).\nexport type {\n ChatCoreConfig,\n ChatTransportMode,\n ChatRealtimeTransportConfig,\n MessageRenderer,\n MessageRendererRegistry,\n} from \"./types.js\";\n\n// Name-resolver context.\nexport type { ChatNameResolverProviderProps } from \"./context/ChatNameResolverContext.js\";\nexport {\n ChatNameResolverProvider,\n useChatNameResolver,\n useOptionalChatNameResolver,\n useResolvedSenderName,\n} from \"./context/ChatNameResolverContext.js\";\n\nexport type { UseChatMessagesResult } from \"./hooks/useChatMessages.js\";\nexport { useChatMessages } from \"./hooks/useChatMessages.js\";\nexport { canAccessThread } from \"./hooks/useChatThreadAccess.js\";\n\n// Realtime (Cloudflare Durable Object) transport — the client half of the chat\n// worker wire protocol. Opt-in via `ChatCoreConfig.transport === 'realtime'`; the\n// firestore transport stays the unchanged default. See docs/packages/chat-react.md.\nexport {\n createRealtimeChatClient,\n createInboxClient,\n ChannelClient,\n InboxClient,\n useRealtimeChatMessages,\n browserSocketFactory,\n ChatAccessDeniedError,\n isChatAccessDeniedError,\n CHAT_SUBPROTOCOL,\n CHAT_CLOSE_CODES,\n CLIENT_FRAME,\n SERVER_FRAME,\n buildFrame,\n parseFrame,\n CHAT_CLIENT_DIAGNOSTIC_EVENTS,\n} from \"./realtime/index.js\";\nexport type {\n RealtimeChatClient,\n RealtimeTransportConfig,\n ChatClientDiagnosticsOption,\n ChatClientDiagnosticsSink,\n ChatClientDiagnosticEventName,\n ChannelClientState,\n ChannelClientConfig,\n InboxClientState,\n InboxClientConfig,\n UseRealtimeChatMessagesResult,\n GrantProvider,\n TransportTimers,\n RealtimeStatus,\n RealtimeSocket,\n SocketFactory,\n SocketHandlers,\n ChannelRefTuple,\n WireMessageRow,\n WireInboxSnapshot,\n WireRegistryEntry,\n ServerFrame,\n} from \"./realtime/index.js\";\n\n// TODO (re-export when a consumer needs them): the moderation-overlay helpers\n// `RevisionKind`, `ModerationOverlay`, `applyModerationOverlay`, `overlayFromRow`,\n// and `MODERATION_REDACTED_TEXT` live in `./realtime` but are intentionally NOT\n// re-exported from this package root yet — the consuming app's renderer reads moderation\n// state off `message.meta` (the realtime client applies the overlay internally), so\n// nothing imports them from here today. Add them to the block above when a consumer\n// genuinely needs to apply the overlay directly. (Comment-only; rides the next publish.)\n\nexport type { ChatShellProps } from \"./ui/ChatShell.js\";\nexport { ChatShell } from \"./ui/ChatShell.js\";\nexport { MessageList } from \"./ui/MessageList.js\";\nexport type { ComposerProps } from \"./ui/Composer.js\";\nexport { Composer } from \"./ui/Composer.js\";\nexport type { MessageItemDefaultProps } from \"./ui/MessageItemDefault.js\";\nexport { MessageItemDefault } from \"./ui/MessageItemDefault.js\";\nexport { MessageActions, ThreadActions } from \"./ui/menus.js\";\nexport { MessageText, type MessageTextProps } from \"./ui/MessageText.js\";\n"]}
@@ -275,10 +275,6 @@ export declare class ChannelClient {
275
275
  send(args: {
276
276
  clientMessageId: string;
277
277
  text: string;
278
- replyTo?: {
279
- messageSeq: number;
280
- preview: string;
281
- } | null;
282
278
  }): boolean;
283
279
  /**
284
280
  * Explicit read ack (delivery != read). `focused` => the channel is open + at latest.
@@ -1 +1 @@
1
- {"version":3,"file":"channel-client.d.ts","sourceRoot":"","sources":["../../src/realtime/channel-client.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAahE,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,aAAa,CAAC;AASjE,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EAKL,KAAK,2BAA2B,EACjC,MAAM,kBAAkB,CAAC;AA6C1B,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,cAAc,CAAC;IACvB,mFAAmF;IACnF,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,4EAA4E;IAC5E,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,6DAA6D;IAC7D,eAAe,EAAE,OAAO,CAAC;IACzB,2FAA2F;IAC3F,QAAQ,EAAE,OAAO,CAAC;IAClB,kGAAkG;IAClG,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;;;;;;;OASG;IACH,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAmB;IAClC,iGAAiG;IACjG,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,CAAC;IACjB,yFAAyF;IACzF,aAAa,EAAE,MAAM,CAAC;IACtB,sFAAsF;IACtF,aAAa,EAAE,aAAa,CAAC;IAC7B,aAAa,EAAE,aAAa,CAAC;IAC7B,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,6DAA6D;IAC7D,SAAS,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,GA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AC,SAAS;IAsEjB;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;IAwC1B;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAOxB,kFAAkF;IAClF,OAAO,CAAC,SAAS;IAOjB;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,oBAAoB;IAgE5B;;;;;;;;;OASG;IACH,OAAO,CAAC,YAAY;IA2BpB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAerB;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,QAAQ;IAoChB,OAAO,CAAC,gBAAgB;IAgDxB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,SAAS;IAMjB;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO;IAgD9D;;;;;OAKG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO;IAKnD,yEAAyE;IACzE,MAAM,IAAI,IAAI;IAOd,iBAAiB,IAAI,IAAI;IAKzB,mBAAmB,IAAI,IAAI;IAM3B,2FAA2F;IAC3F,UAAU,IAAI,IAAI;IAQlB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,aAAa;IASrB,8EAA8E;IAC9E,KAAK,IAAI,IAAI;CAyBd"}
@@ -243,7 +243,6 @@ export class ChannelClient {
243
243
  const sent = this.sendFrame(CLIENT_FRAME.SEND, {
244
244
  clientMessageId: pending.clientMessageId,
245
245
  text: pending.text,
246
- replyTo: pending.replyTo,
247
246
  });
248
247
  if (sent)
249
248
  pending.attempts += 1;
@@ -418,7 +417,6 @@ export class ChannelClient {
418
417
  const sent = this.sendFrame(CLIENT_FRAME.SEND, {
419
418
  clientMessageId: current.clientMessageId,
420
419
  text: current.text,
421
- replyTo: current.replyTo,
422
420
  });
423
421
  this.diag?.(DIAG.SEND_RETRY, {
424
422
  clientMessageId: current.clientMessageId,
@@ -487,7 +485,6 @@ export class ChannelClient {
487
485
  const sent = this.sendFrame(CLIENT_FRAME.SEND, {
488
486
  clientMessageId: pending.clientMessageId,
489
487
  text: pending.text,
490
- replyTo: pending.replyTo,
491
488
  });
492
489
  pending.attempts = sent ? 1 : 0;
493
490
  this.diag?.(DIAG.SEND_RETRY, {
@@ -988,7 +985,6 @@ export class ChannelClient {
988
985
  const sent = this.sendFrame(CLIENT_FRAME.SEND, {
989
986
  clientMessageId: args.clientMessageId,
990
987
  text: args.text,
991
- replyTo: args.replyTo ?? null,
992
988
  });
993
989
  if (!sent) {
994
990
  this.diag?.(DIAG.SEND_FAILED, {
@@ -1007,7 +1003,6 @@ export class ChannelClient {
1007
1003
  this.pendingSends.set(args.clientMessageId, {
1008
1004
  clientMessageId: args.clientMessageId,
1009
1005
  text: args.text,
1010
- replyTo: args.replyTo ?? null,
1011
1006
  sentAt: now,
1012
1007
  attempts: 1,
1013
1008
  failed: false,
@@ -1020,14 +1015,11 @@ export class ChannelClient {
1020
1015
  senderId: this.config.currentUserId,
1021
1016
  text: args.text,
1022
1017
  createdAt: now,
1023
- replyTo: args.replyTo ? { messageId: seqToMessageId(args.replyTo.messageSeq), messagePreview: args.replyTo.preview } : null,
1024
1018
  });
1025
1019
  const next = [...this.state.messages, echo].sort(sortBySeq);
1026
1020
  this.setState({ messages: next, lastErrorCode: null });
1027
1021
  this.diag?.(DIAG.SEND_OPTIMISTIC, {
1028
1022
  clientMessageId: args.clientMessageId,
1029
- hasReplyTo: Boolean(args.replyTo),
1030
- replyToSeq: args.replyTo?.messageSeq ?? null,
1031
1023
  pendingSends: this.pendingSends.size,
1032
1024
  });
1033
1025
  return true;